Inferensys

Prompt

Evidence Discrepancy Flagging Prompt for RAG Answers

A practical prompt playbook for using Evidence Discrepancy Flagging Prompt for RAG Answers in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, required context, and when not to use the Evidence Discrepancy Flagging Prompt.

This prompt operates as a post-generation guardrail in a RAG pipeline. After your system generates an answer from retrieved context, this prompt reviews the answer against the original evidence to flag statements where sources disagree. It produces a structured discrepancy report that identifies conflicting claims, cites the disagreeing sources, and distinguishes genuine source conflict from model synthesis errors. The primary job-to-be-done is preventing overconfident or misleading responses caused by contradictory source material before answers reach end users.

Use this prompt when your application surfaces answers to users and you need to add evidence-consistency verification to an existing retrieval and generation pipeline. The ideal user is a RAG application developer or AI engineer who already has a working retrieval step, a generation step, and access to the original retrieved passages. You need the full generated answer text and the complete set of retrieved source passages as inputs. This prompt does not generate answers, rank evidence, or resolve conflicts. It audits an existing answer against its source context and flags discrepancies for downstream handling—whether that means surfacing a warning to users, triggering a human review queue, or regenerating the answer with conflict-aware instructions.

Do not use this prompt as a replacement for retrieval quality checks, as a primary hallucination detector for unsupported claims, or as a conflict resolution engine. It is specifically scoped to detecting disagreements between sources that are cited or reflected in the generated answer. If your pipeline needs to verify that every claim is supported by at least one source, pair this with a grounding verification prompt. If you need to resolve conflicts automatically, route flagged discrepancies to a separate resolution prompt or human review step. Avoid running this prompt on answers where the retrieved context is already known to be homogeneous or single-source, as the discrepancy check adds latency without value in those cases.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Evidence Discrepancy Flagging Prompt delivers value and where it introduces risk. Use these cards to decide if this prompt belongs in your pipeline.

01

Good Fit: RAG Answer Review

Use when: you have a generated answer and the exact retrieved context that was used to produce it. Guardrail: Always pass the original, unmodified retrieval set alongside the answer. Summarized or re-ranked context masks discrepancies.

02

Bad Fit: Open-Domain Fact Checking

Avoid when: the model must search the web or its own weights to find contradictory evidence. Risk: The prompt is designed to compare a claim against provided sources, not to hunt for missing counter-evidence. Use a retrieval-augmented fact-checking prompt instead.

03

Required Inputs

Must have: a complete generated answer, the full set of retrieved passages with source identifiers, and a clear claim or question the answer addresses. Guardrail: Missing source metadata prevents traceable discrepancy reports. Validate input completeness before calling the prompt.

04

Operational Risk: Model Synthesis Errors

What to watch: The model may flag a discrepancy where the answer faithfully synthesizes two sources that appear to conflict but actually address different scopes. Guardrail: Include a verification step that checks whether flagged conflicts are genuine source disagreements or valid synthesis across complementary evidence.

05

Operational Risk: Over-Flagging

What to watch: The prompt may surface every minor wording difference as a discrepancy, overwhelming reviewers with noise. Guardrail: Add a severity threshold in the output schema and instruct the model to ignore immaterial phrasing differences that do not change the factual claim.

06

Operational Risk: Source Grounding Gaps

What to watch: The discrepancy report may cite sources that do not actually contain the claimed contradiction. Guardrail: Run a citation verification step after discrepancy flagging to confirm each flagged source passage supports the reported conflict before surfacing to users or downstream systems.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt template that reviews a RAG answer against its source passages and flags unsupported or contradictory statements.

The following prompt template is designed to be dropped directly into your RAG evaluation or guardrail pipeline. It instructs the model to act as an evidence auditor, comparing a generated answer against the specific source passages that were provided as context. The core instruction forces the model to isolate each factual claim in the answer and trace it back to the source material, flagging statements that lack support or directly contradict the evidence. This template is structured to produce a machine-readable JSON report, making it suitable for automated checks before an answer is shown to a user.

code
You are an evidence auditor. Your task is to review a generated answer against the provided source passages and flag any discrepancies.

## INPUT
**Generated Answer:**
[ANSWER]

**Source Passages:**
[SOURCES]

## INSTRUCTIONS
1. Decompose the generated answer into discrete, verifiable factual claims.
2. For each claim, search the source passages for direct supporting or contradicting evidence.
3. Classify each claim as one of:
   - **SUPPORTED**: The claim is directly stated in a source passage.
   - **UNSUPPORTED**: The claim is not found in any source passage.
   - **CONTRADICTED**: A source passage explicitly states the opposite of the claim.
   - **SYNTHESIS_ERROR**: The claim combines information from multiple sources in a way that creates a false or misleading statement not present in any single source.
4. For UNSUPPORTED, CONTRADICTED, or SYNTHESIS_ERROR claims, provide a brief explanation and cite the relevant source passage(s) by their ID.
5. If no discrepancies are found, explicitly state that the answer is fully grounded.

## OUTPUT SCHEMA
Return a single JSON object with the following structure:
{
  "overall_grounding_status": "FULLY_GROUNDED" | "DISCREPANCY_FOUND",
  "claims": [
    {
      "claim_text": "string",
      "status": "SUPPORTED" | "UNSUPPORTED" | "CONTRADICTED" | "SYNTHESIS_ERROR",
      "source_ids": ["string"],
      "explanation": "string"
    }
  ]
}

## CONSTRAINTS
- Only use the provided source passages as evidence. Do not use external knowledge.
- Do not flag stylistic differences or minor paraphrasing as discrepancies.
- A SYNTHESIS_ERROR must involve a logical or factual error created by combining sources, not just a lack of direct support.

To adapt this template, replace the [ANSWER] and [SOURCES] placeholders with your application data. The [SOURCES] input should be a structured list of objects, each containing an id and text field, to enable precise citation in the output. For high-stakes domains like healthcare or finance, add a [RISK_LEVEL] constraint that forces the model to flag any UNSUPPORTED claim as a blocking error. You can also extend the [OUTPUT_SCHEMA] to include a confidence score for each classification, which is useful for routing low-confidence flags to a human review queue. The SYNTHESIS_ERROR category is the most critical for distinguishing a flawed model from conflicting sources; test this heavily with examples where the model incorrectly merges two true statements into a false conclusion.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Evidence Discrepancy Flagging Prompt. Each variable must be populated before the prompt is sent to the model. Validation notes describe how to programmatically verify the input before execution.

PlaceholderPurposeExampleValidation Notes

[GENERATED_ANSWER]

The full text of the RAG-generated answer to audit for discrepancies against source evidence.

The patient should begin taking 50mg of metformin twice daily with meals. This dosage is standard for initial treatment of type 2 diabetes.

Must be a non-empty string. Check length > 0. If the answer was generated in a prior step, verify the generation completed without errors.

[RETRIEVED_CONTEXT]

An array of source passages retrieved to support the answer, each with a unique source identifier and full text.

[{"source_id": "src-01", "text": "Standard initial metformin dosage is 500mg twice daily, not 50mg."}, {"source_id": "src-02", "text": "Metformin should be taken with meals to reduce gastrointestinal side effects."}]

Must be a valid JSON array. Each element must contain non-empty 'source_id' and 'text' fields. Array length must be >= 1. Reject if any source text is null or whitespace.

[CLAIM_DELIMITER]

A string token used to separate individual claims in the output for structured parsing. Defaults to '---CLAIM---' if not overridden.

---CLAIM---

Must be a non-empty string that does not appear naturally in the answer text. Validate by checking that the delimiter is not a substring of [GENERATED_ANSWER]. If it is, raise a configuration error.

[CONFIDENCE_THRESHOLD]

A float between 0.0 and 1.0. The model will only flag discrepancies where its internal confidence exceeds this value. Lower values increase recall; higher values increase precision.

0.7

Must be a float. Check 0.0 <= value <= 1.0. If null or out of range, default to 0.7 and log a warning. Do not pass non-numeric strings.

[MAX_DISCREPANCIES]

An integer capping the number of flagged discrepancies in the output. Prevents runaway reports on highly contradictory document sets.

5

Must be a positive integer. Check value >= 1. If null, default to 5. If value > 20, log a warning about potential truncation of important conflicts.

[SOURCE_PRIORITY_MAP]

An optional JSON object mapping source_id to a priority weight. Higher-weight sources are treated as more authoritative during conflict resolution.

{"src-01": 10, "src-02": 5}

If provided, must be a valid JSON object with string keys and numeric values. All keys must match source_id values in [RETRIEVED_CONTEXT]. If null or omitted, all sources are treated with equal weight. Validate no orphan keys exist.

[OUTPUT_SCHEMA]

The expected JSON schema for the discrepancy report. Used to enforce structured output and validate the model response.

{"type": "object", "properties": {"discrepancies": {"type": "array", "items": {"type": "object", "properties": {"claim": {"type": "string"}, "supporting_sources": {"type": "array"}, "conflicting_sources": {"type": "array"}, "discrepancy_type": {"type": "string"}, "severity": {"type": "string"}}}}}}

Must be a valid JSON Schema object. Validate with a JSON Schema validator before passing to the model. Reject if schema is malformed. If null, use the default schema defined in the playbook.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Evidence Discrepancy Flagging prompt into a production RAG pipeline with validation, retries, and human review gates.

This prompt operates as a post-generation guardrail, not a user-facing step. After your RAG system produces an answer from retrieved context, pipe both the generated answer and the full set of retrieved passages into this prompt to produce a structured discrepancy report. The report flags statements where sources disagree, distinguishes genuine source conflict from model synthesis errors, and provides source references for each flagged issue. This is a high-stakes verification step: a false negative (missed discrepancy) produces an overconfident, misleading answer, while a false positive (flagged agreement) creates unnecessary review burden and erodes trust in the system.

Wire the prompt into an asynchronous validation queue rather than blocking the user response. The primary RAG answer can be returned to the user immediately with a 'verification in progress' indicator, while the discrepancy report is generated in parallel. If the report flags high-severity conflicts, trigger a correction workflow: either append a conflict notice to the answer, regenerate with conflict-aware synthesis, or escalate to a human review queue. Implement a severity threshold in your harness—for example, only interrupt the user experience for conflicts rated 'high' or 'critical' on a defined scale. Log every discrepancy report with the answer version, retrieval set hash, and model version for audit trails.

Validation must happen at two levels. First, validate the output schema: ensure the JSON contains the required fields (flagged_statements, conflict_type, source_references, severity), that source references map to actual passage indices in the input, and that no hallucinated passage IDs appear. Second, run semantic evals: sample flagged statements and check whether human reviewers agree that a genuine discrepancy exists. Track false positive rate (flagging agreement as conflict) and false negative rate (missing known contradictions in a golden test set). For high-risk domains like healthcare or legal, require human approval on all flagged discrepancies before any correction is surfaced to users. Set a maximum retry count of 2 for malformed outputs; if the model fails to produce valid JSON after two repair attempts, log the failure and escalate to a human operator rather than silently dropping the check.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when flagging evidence discrepancies and how to guard against it.

01

False Positives on Paraphrased Agreement

What to watch: The model flags a conflict when two sources say the same thing in different words. This happens when the prompt lacks explicit instruction to distinguish semantic equivalence from genuine contradiction. Guardrail: Add a pre-check step that asks the model to paraphrase each claim before comparison, or include few-shot examples of paraphrased agreement labeled as 'no conflict.'

02

Missing Implicit Contradictions

What to watch: The model only catches explicit textual contradictions and misses conflicts that require inference. For example, one source says 'the drug is safe' while another describes severe adverse events without directly stating a contradiction. Guardrail: Include a secondary prompt that asks 'Does this evidence, if true, undermine the claim?' for each source-claim pair, and require the model to reason step-by-step before classifying.

03

Scope Mismatch Misclassified as Conflict

What to watch: Two sources appear to conflict but actually address different populations, time periods, conditions, or contexts. The model treats scope differences as factual disagreements. Guardrail: Require the model to extract and compare scope metadata (population, timeframe, methodology) before declaring a conflict. Add a 'scope mismatch' classification category to the output schema.

04

Over-Indexing on Source Authority Signals

What to watch: The model resolves conflicts by deferring to the source with the most recognizable name, highest citation count, or most confident language, rather than evaluating the evidence itself. Guardrail: Strip or mask source identity during the initial conflict detection pass. Reintroduce authority weighting only in a separate resolution step with explicit criteria for recency, methodology, and corroboration.

05

Forced Reconciliation When Genuine Disagreement Exists

What to watch: The model attempts to harmonize conflicting evidence by inventing a middle-ground explanation that neither source supports, producing a false consensus. This is common when the prompt emphasizes synthesis over honesty about uncertainty. Guardrail: Add an explicit instruction: 'If sources genuinely disagree and cannot be reconciled without speculation, state the disagreement clearly rather than fabricating a compromise.' Include an 'unresolved' output option.

06

Echoed Claims Treated as Independent Corroboration

What to watch: Multiple sources repeat the same claim originating from a single primary source, and the model counts them as independent evidence of consensus. This inflates confidence in claims that lack genuine corroboration. Guardrail: Require the model to trace claims back to their original source when possible, and flag when multiple passages cite the same underlying study, report, or dataset. Add a 'derived from' field to the output schema.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Evidence Discrepancy Flagging prompt before shipping. Each criterion targets a specific failure mode in RAG discrepancy detection, from false positives on paraphrased agreement to missed contradictions in complex evidence sets.

CriterionPass StandardFailure SignalTest Method

Direct Contradiction Detection

All explicit factual contradictions between sources are flagged with correct source references

Missed contradiction where Source A states X and Source B states not-X on the same specific claim

Golden dataset of 20 passage pairs with known contradictions; require 95% recall on explicit conflicts

Paraphrased Agreement Handling

No false discrepancy flags when sources agree but use different terminology or phrasing

Flag raised for sources that say the same thing with different words (e.g., 'revenue grew 12%' vs '12% revenue increase')

Test set of 15 paraphrased-agreement pairs; require zero false positive discrepancy flags

Source Attribution Accuracy

Each flagged discrepancy correctly links to the specific source passage and statement

Discrepancy report cites wrong source or attributes a claim to Source A that actually came from Source B

Manual audit of 10 discrepancy reports; verify each source reference maps to the correct passage span

Synthesis Error vs Genuine Conflict

Prompt distinguishes model synthesis errors from actual source disagreements

Flag raised for a statement the model fabricated rather than a conflict present in the retrieved context

Inject 5 model-hallucinated claims into test answers; verify prompt identifies them as unsupported, not as source conflicts

Implicit Contradiction Detection

Contradictions requiring single-hop inference are detected (e.g., Source A: 'launched in Q3', Source B: 'unavailable until October')

Implicit contradiction missed when inference step is straightforward and domain-typical

Curated set of 10 implicit contradiction pairs; require 80% detection rate with explanation of the inferred conflict

Scope and Methodology Differences

Differences in study scope, population, or methodology are noted as potential explanations, not flagged as factual contradictions

Two sources with different sample sizes or date ranges flagged as contradictory when findings differ due to scope

Test set of 8 scope-difference pairs; require prompt to classify as 'scope difference' rather than 'factual contradiction'

Discrepancy Report Structure

Output matches expected schema: discrepancy list with claim, source positions, conflict type, and severity

Missing required fields, malformed JSON, or unstructured prose instead of structured discrepancy report

Schema validation against [OUTPUT_SCHEMA]; run 50 test cases and require 100% parseable output with all required fields present

Empty Evidence Set Handling

Prompt returns empty discrepancy list with appropriate note when no conflicts exist or evidence is insufficient

Fabricated discrepancies when evidence set is empty, single-source, or fully consistent

Test with 5 empty or single-source evidence sets; require empty discrepancy list and no hallucinated conflicts

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small set of 3–5 retrieved passages. Remove strict output schema requirements initially—ask for a plain-text discrepancy report with bullet points. Use a single model call without retry logic.

code
Review the answer against the provided context. List any statements in the answer that are contradicted by or unsupported by the context. For each discrepancy, note which source disagrees.

Answer: [ANSWER]
Context passages: [CONTEXT]

Watch for

  • Model conflating "unsupported" with "contradicted"—clarify the distinction in instructions
  • Over-flagging when the answer paraphrases rather than contradicts
  • Missing discrepancies when sources disagree implicitly rather than explicitly
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.