Hallucination
A hallucination is generated content that is unsupported or false in the task context. A confident style does not make it reliable.
Before you start: Review Context window first. Python-like examples use variables, lists and functions.
Follow the mechanism
Question
Identify the factual claim being requested.
Start with an everyday explanation
A student inventing a page number rather than admitting the book is missing may sound convincing. A system should expose the missing evidence instead.
See a concrete example
A lookup returns not_found. The answer “I approved and filed it” contradicts the observed result and must not be accepted as execution success.
A claim to question
Low temperature, RAG and a strong system prompt do not eliminate hallucination.
Try before revealing the answer
Write an answer for a missing claim record and name the next safe action.
Show the worked answer
Say that no authorized record was found, ask for a corrected identifier or route to support. Do not invent status, payment or successful submission.
Now explain the idea to someone else using your own example. If you cannot explain a stage, revisit it before moving on.
Engineering details and trade-offs
Separate retrieval failure, reasoning error, outdated knowledge and fabricated tool success. They need different fixes.
Require provenance for factual claims, validate tool outcomes and evaluate abstention. RAG lowers some risks but can still retrieve misleading or malicious content.
Reason through the example
A lookup returns not_found. The answer “I approved and filed it” contradicts the observed result and must not be accepted as execution success.
Implement and test
Write an answer for a missing claim record and name the next safe action.
Inspect the reasoning and expected result
Say that no authorized record was found, ask for a corrected identifier or route to support. Do not invent status, payment or successful submission.
What to measure
State the expected result before changing a control. Record your inputs, compare the observed result and explain one limit of this model. In a real implementation, test the failure case as well as the normal path.
Answer before reading the reference
How would you measure hallucination in a support assistant?
A defensible answer
Label claims against retrieved evidence and known records. Measure unsupported-claim rate, answer correctness, appropriate abstention and harmful fabricated actions on representative and adversarial cases.
Prepare the follow-up
How would you distinguish missing retrieval from misuse of correctly retrieved evidence?
Show follow-up reasoning
Keep query, candidate IDs, authorized evidence, source versions and the actual supplied context in a privacy-safe trace. If evidence never enters the context, investigate retrieval or packaging; if it is present but contradicted, inspect generation, interpretation and answer validation.
Use the engineering explanation and worked task above to support your response. Identify which assumptions you would need to verify in production.
Choose a practice depth
- New to GenAI
- Define hallucination with the everyday example and name its key limitation.
- Applied experience
- Explain the example, implementation choice and a measured failure case. Use the exercise as a small design review.
- Senior or systems depth
- Answer the follow-up, compare alternatives and justify an evaluation or rollout plan with operational constraints.
Self-review your answer
0/4 checks selected. This is self-assessment, not an interview score.
Your explanation and revision notes
Loading local notes…