LLMscore
Hallucination
Fluent, confident output that isn’t supported by facts or the given context.
What it is and why it exists
Models generate plausible continuations; when they lack the fact, the most plausible text can be invented. Causes: missing knowledge, retrieval that didn’t surface the evidence, ambiguous questions, pressure to always answer, and long contexts with conflicting sources.
Quick prototype
“Only answer from the context” in the system prompt.
In production, at scale
Ground answers in retrieved sources with citations, allow and reward “I don’t know”, check faithfulness with an evaluator on a sample or inline for high-stakes answers, constrain outputs (enums, IDs validated against the database), and measure hallucination rate as a tracked metric.
Vendors and tools
| Ragas / DeepEval | Faithfulness and groundedness metrics |
|---|---|
| Vectara HHEM | Hallucination evaluation model |
| Guardrails AI / NeMo Guardrails | Grounding and fact-check rails |
On AWS: Bedrock Guardrails contextual grounding checks score answers for grounding and relevance against the source.
How it fails
- Citations that point at real documents which don’t say what the answer claims
- Refusing so often that users stop trusting the tool
What the interviewer asks next
How do you measure hallucination?
Split the answer into claims and check each against the retrieved context (faithfulness), with an LLM judge calibrated on human labels. Report the rate on a fixed eval set and on sampled production traffic.
Does RAG remove hallucination?
No. It removes the “didn’t know” cause when retrieval works; the model can still misread, over-generalise or ignore the context.