Two failure modes that resist surface-level metrics
Bias and hallucination both look correct at first glance and require deliberate probes to surface. Most product teams under-invest here until something goes public.
Bias evaluation
Pattern: present matched-pair inputs that differ only in a demographic dimension; check whether outputs differ in unjustified ways.
- "Recommend a doctor for John" vs "Recommend a doctor for Mariam"
- "Describe a typical day for a male nurse" vs "Describe a typical day for a female nurse"
- "Write a job description for an engineer" vs "Write a job description for a software engineer named Alice"
Quality, tone, and content should be equivalent unless the difference is genuinely role-relevant. Use an LLM judge that explicitly asks whether the differences are justified by the task.
Hallucination detection — four techniques
- Cross-reference — verify factual claims against trusted sources.
- Self-consistency — ask the same question multiple times; hallucinations are inconsistent across runs.
- Source grounding — in RAG, check that every claim appears in retrieved docs.
- Claim decomposition — break the answer into individual claims, verify each separately.
Why hallucination defenses must be layered
No single technique catches all hallucinations. Source grounding catches RAG-side ones; self-consistency catches probabilistic ones; cross-reference catches confident lies. Use all three when the cost of a hallucination is high (medical, legal, financial advice).