EasyDeepLearn

Why do LLMs hallucinate and how do you reduce hallucinations?

medium

Answer

  • LLMs generate the most probable next token — they don't have a truth check.
  • Hallucinations arise when the model lacks knowledge, when the prompt is ambiguous, or when it 'commits' to a plausible-sounding continuation.
  • Mitigations: retrieval-augmented generation (ground in cited sources), lower temperature and constrained decoding, explicit 'say you don't know' instructions, tool use, self-consistency and verifier models, and evaluation with factuality benchmarks.
Check yourself — multiple choice
  • Hallucinations disappear with higher temperature
  • RAG grounds outputs in retrieved sources and reduces hallucinations
  • LLMs internally verify facts before answering
  • Setting maxtokens  =  1\operatorname{max}_{\mathrm{tokens}}\; = \;1 prevents hallucinations

Retrieval-augmented generation with cited context is the main practical mitigation.

#hallucinations#reliability

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions