How to Stop Hallucinations in LLMs
Hallucination Types
| Type | Example |
| Fabrication | Fake facts |
| Citation hallucination | Fake references |
| Logical hallucination | Broken reasoning |
| Context hallucination | Ignoring retrieved docs |
Root Causes
- Weak retrieval
- Poor prompts
- Insufficient context
- Model limitations
- Overcompression
Techniques to Reduce Hallucinations
RAG
Most important method.
Injects:
- Ground truth
- Enterprise documents
- Real-time knowledge
Hybrid Retrieval
Dense + sparse retrieval.
Improves factual grounding.
Reranking
Ensures highest relevance documents used.
Query Rewriting
LLM rewrites ambiguous queries.
Improves retrieval quality significantly.
Context Compression
Remove noisy chunks before generation.
Chain of Verification
Second model verifies claims.
Architecture:
Generator → Verifier → Final Answer
Self Reflection
Models critique their own answers.
Common in agentic systems.
Structured Outputs
Force:
- JSON
- Schemas
- SQL-safe outputs
Reduces uncontrolled generation.
Temperature Reduction
Lower temperature:
- More deterministic
- Fewer hallucinations
Fine-Tuning on Domain Data
Specialized domain tuning reduces uncertainty.
Grounded Generation
Prompt example:
Answer ONLY using provided context.
If unavailable, say “I don’t know.”
Simple but highly effective.
Human-in-the-loop
Critical for:
- Healthcare
- Finance
- Legal systems
Hallucination Detection Models
Emerging area.
Specialized models detect:
- Unsupported claims
- Contradictions
- Fake citations





