Reducing hallucinations
A language model predicts plausible text — not verified fact. Left to answer from memory, it will confidently fill a gap it can’t actually fill. You can’t eliminate hallucinations entirely, but a few habits remove most of them.
1. Ground the model in context
The single biggest lever: give the model the facts it needs and tell it to use only those. Instead of “What’s our refund policy?”, retrieve the policy and ask “Answer using only the policy below.” This is the core of retrieval-augmented generation (RAG), and it works because the model no longer has to rely on its parametric memory.
Answer the question using ONLY the sources below.
If the answer is not in the sources, reply exactly: "I don't know based on the provided information."
Do not use outside knowledge.
Sources:
"""
{{retrieved_context}}
"""
Question: {{question}}
2. Give it permission to say “I don’t know”
Models hallucinate partly because they’re implicitly rewarded for always answering. Explicitly authorize — and require — an “I don’t know” when the information isn’t available. This one instruction converts a class of confident fabrications into honest abstentions.
3. Constrain the scope
The broader the question, the more room to invent. Narrow it: ask for one fact at a time, restrict the format, and forbid categories the model tends to fabricate (“do not include URLs or citations unless they appear in the sources”). Specific, bounded requests hallucinate far less than open-ended ones.
4. Ask for sources or quotes
When answers must be grounded, require the model to quote the supporting span or cite the source id it used. This does two things: it makes the model actually look at the context, and it gives you something to verify against. If it can’t produce a supporting quote, that’s your signal the answer is unsupported.
5. Separate retrieval from reasoning
Don’t ask one prompt to both recall facts and reason about them. Retrieve (or look up) the facts first, then pass them to a reasoning step. A multi-step flow — fetch, then answer — is more reliable than hoping a single call remembers correctly. For live facts, feed the model real data (search or a database) rather than trusting its training cutoff.
6. Verify high-stakes claims
For anything that matters — numbers, medical/legal/financial statements, code that will run — add a verification step: a schema/regex check, a second model asked to find unsupported claims, or a human review. Treat the first draft as a proposal, not a fact.
Checklist
- The model answers from provided context, not memory, where facts matter.
- It’s explicitly allowed (and required) to say “I don’t know”.
- The scope of each request is narrow and specific.
- It cites or quotes the supporting source for grounded answers.
- High-stakes outputs are verified by a check, a second pass, or a human.
A note on evals
Hallucination is a quality dimension you can measure. Keep a set of questions whose answers aren’t in your sources and assert the model abstains; keep questions whose answers are and assert it quotes them. Run these on every prompt or model change — see Evaluating prompts.
Ship these practices, don't just read them
VernaOne turns prompts into versioned, model-agnostic endpoints with structured output, evals, and automatic fallback — so the best practices here become defaults, not discipline.
Try VernaOne free →