A 5-step way to answer any hallucination question
- Define the failure. Unsupported, contradicted or fabricated content.
- Find the cause. Missing knowledge, bad retrieval, ambiguous prompt or model limits.
- Apply a mitigation. Grounding, constraints, verification or abstention.
- Measure it. Faithfulness, factual accuracy and citation precision on labeled data.
- Design the product. Show sources, allow feedback and route high-risk cases to humans.
Contents: Causes and types (questions 1 to 4) · Mitigation (questions 5 to 9) · Measurement and product (questions 10 to 14)
Causes and types (questions 1 to 4)
1. What is an LLM hallucination?
- Output that is fluent but not supported by facts or by the provided sources.
- Examples: invented citations, wrong numbers, nonexistent APIs.
- It is a property of next-token generation, which optimizes plausibility.
- It matters most in high-stakes domains.
Common pitfall: Calling every model mistake a hallucination without distinguishing types.
2. Why do LLMs hallucinate?
- They generate likely text, not verified facts.
- Knowledge may be missing, outdated or conflicting in training data.
- Prompts can push the model to answer when it should abstain.
- Training that rewards confident answers over admitting uncertainty can encourage guessing.
Common pitfall: Blaming only the decoding temperature.
3. What is the difference between intrinsic and extrinsic hallucination?
- Intrinsic: output contradicts the source or input.
- Extrinsic: output adds information that cannot be verified from the source.
- In RAG, both are faithfulness failures relative to retrieved context.
- They need different checks: contradiction versus unsupported claims.
Common pitfall: Treating unsupported additions as harmless.
4. How does retrieval quality affect hallucination?
- If retrieval misses the right passage, the model may fill gaps from memory or guesswork.
- Noisy context can lead the model to use the wrong passage.
- Improve recall and ranking before tuning prompts.
- Measure retrieval and generation separately.
Common pitfall: Tuning the generation prompt when retrieval is the problem.
Mitigation (questions 5 to 9)
5. How do you reduce hallucination in a RAG system?
- Instruct the model to answer only from provided sources and to say when the answer is not there.
- Require citations for claims and verify them.
- Improve retrieval with hybrid search and reranking.
- Add a post-generation faithfulness check for high-risk answers.
Common pitfall: Assuming RAG alone removes hallucination.
6. How do citations help, and what can go wrong?
- Citations let users and checkers verify claims.
- Models can cite a real source that does not support the claim.
- Verify that cited passages actually entail the statement.
- Track citation precision and recall.
Common pitfall: Counting the presence of a citation as proof of correctness.
7. What is abstention and why does it matter?
- Letting the model say it does not know when evidence is missing.
- It trades coverage for accuracy, which is right for high-stakes use.
- Encourage it in instructions and examples, and reward it in evaluation.
- Measure both answer rate and accuracy.
Common pitfall: Penalizing "I don't know" in evaluation.
8. Do decoding settings affect hallucination?
- Lower temperature reduces randomness but does not fix missing knowledge.
- Self-consistency (sampling several answers and checking agreement) can flag uncertain outputs.
- Constrained decoding helps for structured fields.
- Treat decoding as a minor lever compared with grounding.
Common pitfall: Claiming temperature 0 prevents hallucination.
9. Can fine-tuning reduce hallucination?
- It can teach format, refusal behavior and domain style.
- Teaching new facts by fine-tuning is unreliable and can increase confident errors.
- Preference tuning can reward grounded or calibrated answers.
- RAG is usually better for factual knowledge that changes.
Common pitfall: Fine-tuning on documents and expecting accurate recall.
Get the free 50 RAG and LLM interview questions
Join the voluntary email list and open the free set of 50 RAG and LLM interview questions with short model answers. You will also get occasional new question sets. No spam, and you can unsubscribe at any time by replying "unsubscribe" to any email.
Measurement and product (questions 10 to 14)
10. How do you measure hallucination rate?
- Build a labeled set of questions with reference answers or sources.
- Check faithfulness to context and factual accuracy separately.
- Use LLM-as-a-judge calibrated against human labels, plus human spot checks.
- Report rates by category and risk level.
Common pitfall: Measuring on a handful of examples.
11. What is faithfulness versus factual correctness?
- Faithfulness: the answer is supported by the provided context.
- Factual correctness: the answer is true in the real world.
- An answer can be faithful to a wrong document.
- Measure both when sources can be outdated.
Common pitfall: Assuming a faithful answer is a correct answer.
12. How do you design a product around hallucination risk?
- Show sources and make them easy to check.
- Use clear language about uncertainty.
- Route high-risk requests to human review.
- Collect user feedback and feed it into evaluation.
Common pitfall: Presenting AI output with no way to verify it.
13. How would you monitor hallucination in production?
- Sample outputs for automated and human review.
- Track user signals such as corrections and thumbs-down.
- Alert on spikes after model or prompt changes.
- Add failures to the regression set.
Common pitfall: Monitoring only latency and errors.
14. A legal assistant cites a case that does not exist. What do you do?
- Treat it as a high-severity incident.
- Verify all case citations against a trusted database before showing them.
- Restrict answers to retrieved, verified documents.
- Add the case to tests and review similar outputs.
Common pitfall: Only adding a prompt instruction not to invent cases.
FAQ
Can hallucination be eliminated?
Not with current models. It can be reduced and contained with grounding, verification, abstention and product design.
Which metric should I mention?
Faithfulness (groundedness) for RAG, plus factual accuracy and citation precision where you have references.
Is a bigger model always better?
Larger models often hallucinate less on some tasks, but they still do, so the same controls apply.
How do I prepare?
Practice explaining causes, then walk through how you would measure and reduce hallucination in one of your own projects.
The 0 to 1 AI Engineer Interview Playbook covers answer frameworks, system-design walkthroughs and an 8-week plan. $19.99 on Gumroad.
Get the playbookAll interview topics · Prep guides · Question deep dives · Free 50 RAG and LLM questions