Last reviewed: October 2026
To reduce hallucinations in a RAG system, improve the evidence before generation and constrain what the model may claim after it receives that evidence. Retrieve relevant and complete passages, assemble a clean context, keep the answer within that evidence, let the assistant abstain when evidence is insufficient, and measure retrieval and generation separately.
No single prompt, embedding model, or reranker eliminates hallucinations. Treat an unsupported answer as a pipeline failure to diagnose, not as a personality flaw in the language model.
Find the failure before changing the model
A RAG answer can be wrong because the source corpus is incomplete or stale, the query is ambiguous, chunking separated a claim from its conditions, retrieval missed the answer, the model ignored good context, or the system had no rule for missing evidence.
If the answer is absent from the retrieved context, investigate the query, index, filters, and source data. If the context contains the answer but the model adds a contradictory or unsupported claim, investigate the generation instructions, output format, citation mapping, or evaluation rubric. Keep the question, retrieved passages, scores, metadata, assembled context, prompt or model version, and final answer in the same trace.
Fix the source material before tuning retrieval
Retrieval cannot return knowledge that the corpus does not contain. Give each document a stable identifier, title, owner, effective date, jurisdiction, scope, and revision status, and preserve those fields when splitting it into chunks. A model cannot resolve two conflicting policy versions if the context gives it the same title and no effective date.
Keep related conditions together. A chunk that contains a limit without its exception can produce an answer that is locally supported but operationally wrong. Preserve headings, table labels, footnotes, and nearby conditions. Chunking is not a universal number, so compare strategies against the same test cases.
Keep the corpus current. Track ingestion time and source version, and test questions whose answers changed recently. If the system cannot distinguish current from historical material, add an explicit retrieval rule for the applicable date or version.
Retrieve evidence that can support the answer
Resolve ambiguous follow-ups before searching. Include the relevant entities, product names, dates, and constraints. Store the original and rewritten queries so you can check whether query rewriting improved retrieval without dropping meaning.
Use semantic search for paraphrases, lexical search for exact names and identifiers, and metadata filters for tenant, language, region, product version, or publication status. A hybrid strategy is easier to diagnose than asking one similarity score to solve every retrieval problem.
A reranker can move the passages that best answer the question near the top of the context, but it adds latency and cost. Test whether it improves the retrieved evidence and final faithfulness, not only a generic retrieval score. Apply scope and permission filters before generation, not as a task left to the language model.
Assemble context the model can use
Label every passage with a stable source identifier and enough metadata to distinguish similar documents. Separate retrieved evidence from system instructions and user text. Remove duplicates, boilerplate, stale fragments, and navigation noise without removing qualifiers or source identity.
A larger context is not automatically safer. Irrelevant or conflicting passages can dilute attention and encourage an answer that no source supports. If the answer must cite sources, pass citation-ready identifiers with the evidence and require each material claim to connect to one. Citation presence is not proof of faithfulness, because a real document can still be attached to the wrong claim.
Constrain generation and teach the system to abstain
The generation prompt should define the evidence boundary and what happens when it is insufficient. Tell the model to use the supplied context for factual claims, avoid unsupported outside facts, distinguish an answer from an inference, cite material claims, identify what is missing, ask for clarification when needed, and follow application policies even when retrieved text conflicts with them.
Abstention is not a failure when evidence is missing. Define when the assistant must stop: no relevant passage meets the threshold, sources conflict without a precedence rule, the question is ambiguous, a required condition is absent, the request is outside scope, or the action requires human authorization. A specific abstention is more useful than a confident guess.
Do not confuse an evaluator with a synchronous guardrail. A post-generation faithfulness score can flag an answer and route it to review. A control that must block an answer before delivery belongs in the application request path.
Evaluate retrieval and generation as separate systems
A single end-to-end score cannot tell you where the pipeline failed. Test the stages separately, then test the full path.
| Stage | Question | Useful signals |
|---|---|---|
| Source and ingestion | Did the index receive the right, current material? | Source version, freshness, metadata completeness |
| Retrieval | Did the system return the evidence needed? | Context relevance, recall, ranking, scope correctness |
| Context assembly | Did the final prompt preserve useful evidence and boundaries? | Duplicate rate, source coverage, truncation, citation mapping |
| Generation | Did the response stay within the evidence and answer the question? | Faithfulness, factual accuracy, answer relevance, unsupported claims |
| Workflow | Did the system abstain, escalate, or call tools when required? | Policy compliance, refusal behavior, human review, tool checks |
Promptfoo’s RAG guidance also separates retrieval, LLM output, and end-to-end performance. Langfuse’s faithfulness guidance describes claim decomposition followed by verification against the exact retrieved context.
Turn failures into prevention rules
Every confirmed hallucination should produce a better source or retrieval rule, a clearer generation or abstention rule, or a regression test that prevents the same failure from returning.
| Symptom | Prevention move | Evaluation signal |
|---|---|---|
| Irrelevant citation | Improve query rewriting, filters, or reranking | Context relevance and citation support |
| Fact absent from retrieved passages | Add grounding rules and abstention | Faithfulness and unsupported-claim rate |
| Old policy used | Track effective dates and filter by current scope | Source freshness and factual accuracy |
| Important condition omitted | Preserve headings, conditions, and adjacent evidence | Completeness and claim coverage |
| Quality drops after a change | Version datasets, prompts, sources, and models | Offline delta plus online trend |
Use a layered evaluation loop before and after release
Before release, test real questions, missing and irrelevant retrieval, contradictory and stale sources, multi-document questions, unsupported numbers and dates, ambiguous follow-ups, empty retrieval, refusal cases, and changes to chunking, embeddings, reranking, prompts, and models. Keep a held-out set for calibration.
After release, log the query, retrieved context, final answer, source identifiers, model and prompt version, and evaluation result. Sample production sessions for asynchronous scoring, inspect the traces behind changes in faithfulness or unsupported-claim rates, and add confirmed failures to the offline set.
How Galtea fits the prevention loop
Galtea’s public RAG page describes evaluating retrieval, groundedness, completeness, citation accuracy, and unsupported answers, then comparing retrieval pipelines, chunking strategies, embeddings, prompts, and models against the same test cases.
- The Faithfulness metric evaluates generated output against retrieved context and checks factual claims for support.
- The specification-driven evaluation workflow turns behavioral expectations into metrics and datasets.
- The production monitoring workflow supports production sessions, retrieved context, evaluation, and continuous scoring through a Monitor.
- The human evaluation workflow routes difficult cases to reviewers.
- The GitHub Actions integration runs evaluations in CI against a version and its test cases.
The product does not replace retrieval engineering or domain judgment. Its role is to make the pipeline’s evidence, requirements, regressions, and production failures measurable in one workflow. See Galtea’s RAG assistant evaluation and monitoring page for the product workflow.
If you are evaluating a RAG assistant in production, talk to a Galtea engineer about the evidence and review loop your team needs.
Questions teams ask when reducing RAG hallucinations
Does RAG eliminate hallucinations?
No. RAG gives the model external evidence, but retrieval can fail, sources can conflict, and the model can still add unsupported claims. It reduces some knowledge gaps when the right material is retrieved, but it does not guarantee a truthful answer.
Can I reduce hallucinations without a ground-truth answer?
For a RAG answer, yes. A faithfulness check can compare each material claim with the retrieved context, so it does not require a separate expected answer. You still need a trusted source or human review when the question is whether the retrieved context itself is correct, complete, or current.
Can I prevent hallucinations with a lower temperature?
A lower temperature can reduce output variation, but it does not make missing evidence appear or guarantee that claims are grounded. Treat decoding settings as one variable in an evaluation, not as a substitute for better retrieval, abstention rules, and claim-level checks.