Five Ways to Reduce Hallucinations
Practical tactics to make model outputs more trustworthy.
What You'll Learn
Learning objectives will be added soon.
Tutorial Content
Why models make things up
An LLM is trained to produce plausible text, not true text — and a confident, well-formed wrong answer often looks more plausible than "I don't know." That's why models hallucinate: they fill gaps with fluent guesses. You can't eliminate this entirely, but you can drive it way down by layering a few practical tactics. Here are five that actually work.
Five tactics that work
- Ground with RAG. The single biggest lever: give the model the relevant facts in the prompt instead of relying on its memory. It's far harder to make something up when the answer is sitting right there.
- Allow "I don't know." Explicitly tell the model it's okay to decline. Models invent answers partly because they feel obligated to respond; permission to say "I'm not sure" removes that pressure.
- Ask for citations. Require the model to quote or point to the source for each claim. Statements that can't be sourced get exposed, and the model self-censors shakier ones.
- Lower the temperature. For factual tasks, reduce randomness (temperature near 0). High temperature is great for brainstorming, terrible for accuracy.
- Verify with a second pass. Have the model (or a second call) check its answer against the source: "Does this answer make only claims supported by the context?" Catching errors after the fact is cheap insurance.
Stack them
No single tactic is bulletproof, but they compound. A RAG answer that's instructed to use only the context, allowed to say "I don't know," and verified on a second pass is dramatically more trustworthy than a raw one-shot reply.
The right mindset
Treat hallucination as a risk to manage, not a bug to fully fix. The goal isn't a model that's never wrong — it's a system where wrong answers are rare, caught, or clearly flagged as uncertain. That shift in expectations is what separates a flaky demo from something you can ship.
The takeaway
Ground the model in facts, let it decline, demand sources, turn down the randomness, and double-check. Layer a few of these and an unreliable model becomes a dependable one.
Try it now: Take a prompt that produced a confident wrong answer, add "If the answer isn't in the provided context, say you don't know," and supply the real source. Watch the made-up confidence turn into an honest, grounded response.
Your Progress
Sign in to track your progress