Inferensys

Prompt

Evidence Ranking with Contradiction Detection Prompt

A practical prompt playbook for using Evidence Ranking with Contradiction Detection Prompt in production AI workflows.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Determines if the Evidence Ranking with Contradiction Detection Prompt fits your production workflow and when to choose a simpler alternative.

This prompt is designed for research assistants, decision-support systems, and RAG pipelines that must handle conflicting information. Instead of returning a flat list of relevant passages, it ranks evidence into tiers and explicitly annotates contradictions between sources. Use this when your downstream synthesis step needs to know not just what the evidence says, but where sources disagree. This prompt assumes you have already retrieved a set of candidate passages and need to order them for a specific claim or query. It is not a retrieval step and does not perform web search or database lookup.

The ideal user is a developer or AI engineer building a system where conflicting evidence is a first-class concern—think legal research tools, medical literature review assistants, financial due diligence platforms, or any RAG application where presenting a unified answer without surfacing disagreement would be misleading. The prompt expects structured inputs: a clear [CLAIM_OR_QUERY] to evaluate against, a [RETRIEVED_PASSAGES] array with unique IDs and full text, and optional [SOURCE_METADATA] like publication dates or authority scores. The output is a tiered ranking (e.g., 'strongly supporting', 'weakly supporting', 'neutral', 'contradicting') with explicit conflict annotations linking disagreeing passage pairs and a brief rationale for each conflict.

Do not use this prompt when you only need relevance sorting without contradiction awareness—the simpler Multi-Passage Evidence Ranking Prompt Template or Top-K Evidence Selection Prompt Template will be faster and cheaper. Avoid it when your retrieval set is already homogeneous or from a single authoritative source, as contradiction detection adds latency and token cost without benefit. This prompt is also inappropriate for real-time streaming applications where the full tiered output cannot be rendered incrementally. For high-stakes domains like healthcare or legal, always pair this prompt with human review of the conflict annotations before they reach end users, and log the ranked output alongside the final synthesized answer for auditability.

Before deploying, test the prompt against the Evidence Ranking Failure Mode Catalog Prompt to catch position bias, length bias, or authority overfitting in your contradiction annotations. If your use case requires calibrated confidence scores alongside conflict detection, consider chaining this prompt with the Evidence Confidence Score Assignment Prompt. For production, implement a validation harness that checks the output schema, verifies that every conflict annotation references valid passage IDs, and triggers a retry or fallback to a simpler ranking prompt if the contradiction detection produces malformed or empty conflict arrays.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Evidence Ranking with Contradiction Detection Prompt delivers value and where it introduces risk. Use these cards to decide if this prompt fits your production context.

01

Strong Fit: Multi-Source Research Synthesis

Use when: you have 5+ evidence passages from different sources and need to produce a ranked, conflict-aware synthesis before generating a final answer. Guardrail: The prompt's tiered output (strong consensus, disputed, outlier) maps directly to downstream answer-generation logic that can present uncertainty honestly.

02

Strong Fit: Decision-Support with Audit Requirements

Use when: downstream decisions require traceable evidence handling and explicit conflict surfacing. Guardrail: The contradiction annotations serve as an audit artifact. Pair with a citation verification prompt to confirm that flagged conflicts are genuine, not model hallucinations about disagreement.

03

Poor Fit: Single-Source or Homogeneous Corpora

Avoid when: all evidence comes from one document or a tightly controlled corpus with no meaningful disagreement. Risk: The contradiction detection layer adds latency and token cost without benefit, and may hallucinate spurious conflicts to satisfy the output schema. Use a simpler ranking prompt instead.

04

Required Inputs: Ranked Retrieval Set

What you need: a pre-retrieved set of passages with source identifiers, plus a clear query or claim to rank against. Guardrail: This prompt assumes retrieval quality is already addressed. Feed it a retrieval set that has passed a relevance filter; garbage in produces ranked garbage with fabricated conflict annotations.

05

Operational Risk: Position and Length Bias in Ranking

What to watch: the model may over-rank passages that appear first in the input or are longer, conflating verbosity with evidential strength. Guardrail: Randomize passage order before prompting and include a length-normalization instruction in the system prompt. Validate ranking stability across multiple order permutations in eval.

06

Operational Risk: Conflict Hallucination Under Low Diversity

What to watch: when evidence is largely consistent, the model may invent subtle contradictions to satisfy the contradiction-detection instruction. Guardrail: Add a calibration check: if no genuine contradiction exists above a threshold, require the output to explicitly state 'No significant contradictions detected' rather than forcing a conflict annotation.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

Paste this template and replace the square-bracket placeholders. The prompt instructs the model to rank evidence into strength tiers and flag contradictions with specific passage references.

This template is the core instruction set for an evidence ranking and contradiction detection workflow. It is designed to be dropped into a system prompt or a single-turn user message where the model receives a claim and a set of retrieved passages. The prompt forces the model to organize evidence into explicit strength tiers—Strong Support, Weak Support, Neutral, Weak Contradiction, and Strong Contradiction—rather than producing an undifferentiated list. Each passage assignment must include a specific rationale tied to passage content, and the model is explicitly instructed to identify and annotate pairs of passages that conflict with each other or with the broader consensus. This structured output makes downstream synthesis and citation decisions auditable.

text
You are an evidence analyst. Your task is to rank the provided evidence passages by how strongly they support or contradict a given claim, and to flag any contradictions between passages.

CLAIM:
[CLAIM]

EVIDENCE PASSAGES:
[EVIDENCE_PASSAGES]

INSTRUCTIONS:
1. Assign each passage to one of five strength tiers:
   - STRONG_SUPPORT: The passage directly and specifically supports the claim with concrete details.
   - WEAK_SUPPORT: The passage is generally consistent with the claim but lacks specificity or directness.
   - NEUTRAL: The passage is relevant to the topic but neither supports nor contradicts the claim.
   - WEAK_CONTRADICTION: The passage suggests inconsistency with the claim but is indirect or qualified.
   - STRONG_CONTRADICTION: The passage directly and specifically contradicts the claim with concrete details.

2. For each passage, provide:
   - passage_id: The identifier from the input.
   - tier: One of the five tiers above.
   - rationale: A specific explanation referencing the passage content that justifies the tier assignment. Quote key phrases where helpful.

3. After ranking all passages, identify any contradictions:
   - List pairs of passages that conflict with each other or with the consensus of the ranked set.
   - For each conflict, specify the passage_ids involved and describe the nature of the disagreement.

4. If no passages qualify for a tier, state that explicitly rather than forcing an assignment.

OUTPUT FORMAT:
Return a JSON object with the following structure:
{
  "ranked_evidence": [
    {
      "passage_id": "string",
      "tier": "STRONG_SUPPORT | WEAK_SUPPORT | NEUTRAL | WEAK_CONTRADICTION | STRONG_CONTRADICTION",
      "rationale": "string"
    }
  ],
  "contradictions": [
    {
      "passage_ids": ["string", "string"],
      "conflict_description": "string"
    }
  ],
  "empty_tiers": ["string"]
}

CONSTRAINTS:
- Do not invent evidence not present in the passages.
- If the evidence is insufficient to assess the claim, note this in the output rather than guessing.
- When passages conflict, do not resolve the conflict—only flag it.

To adapt this template, replace [CLAIM] with the assertion or question the evidence must be evaluated against, and [EVIDENCE_PASSAGES] with a structured list of retrieved passages, each carrying a unique passage_id and the passage text. If your retrieval system includes source metadata such as publication date or authority score, inject that into each passage entry so the model can use it in its rationale. The output schema is intentionally strict: downstream code should validate that every input passage_id appears exactly once in the ranked_evidence array and that no fabricated passage_ids appear. For high-stakes domains such as legal or clinical review, route outputs where contradictions are detected to a human review queue before any answer synthesis occurs. Run periodic eval checks comparing tier assignments against a golden dataset to detect drift in ranking behavior.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Evidence Ranking with Contradiction Detection Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how to verify the input is well-formed before execution.

PlaceholderPurposeExampleValidation Notes

[QUERY]

The user question or claim that evidence must support or refute

What caused the Q3 revenue decline in the European market?

Must be non-empty string; check for vague queries under 10 words and flag for human clarification

[EVIDENCE_PASSAGES]

Array of retrieved passages to rank and check for contradictions

[{"id":"doc-12-para-3","text":"European revenue fell 8% due to currency headwinds...","source":"Q3 Earnings Report","date":"2024-10-15"}]

Must be valid JSON array with id, text, and source fields; minimum 3 passages required; reject if any passage text is empty or under 20 characters

[RANKING_DIMENSIONS]

Ordered list of criteria for scoring evidence strength

["relevance", "specificity", "recency", "source_authority"]

Must be a non-empty array of strings from allowed set: relevance, specificity, recency, source_authority, directness, factual_precision; reject unknown dimensions

[CONTRADICTION_THRESHOLD]

Minimum semantic conflict score to flag a contradiction between passages

0.7

Must be float between 0.0 and 1.0; values below 0.5 produce excessive false positives; values above 0.9 may miss genuine conflicts

[OUTPUT_TIERS]

Number of ranked tiers to produce in output

3

Must be integer between 2 and 5; tier 1 is strongest evidence; tier N is weakest but still relevant; passages below minimum relevance are excluded entirely

[MAX_PASSAGES_PER_TIER]

Upper limit on passages returned per tier to control output size

5

Must be positive integer; set based on downstream context window budget; null allowed if no limit needed

[CONSENSUS_INDICATOR]

Whether to compute and output a consensus summary across non-contradicting passages

Must be boolean; when true, prompt includes instruction to synthesize agreement across compatible passages; when false, only ranking and conflict flags are returned

PROMPT PLAYBOOK

Implementation Harness Notes

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

This prompt is designed to sit between retrieval and answer generation in a RAG pipeline. It accepts a set of retrieved passages and a query or claim, then returns a ranked list of evidence tiers with explicit contradiction annotations. The primary integration point is after your retrieval step (vector search, hybrid search, or keyword retrieval) and before your synthesis or answer-generation step. The output schema is structured so downstream components can route high-confidence, non-contradictory evidence directly to generation, while flagging contradictory or low-confidence clusters for separate handling—such as a conflict-resolution prompt, a human review queue, or a 'multiple perspectives' display to the user.

Integration pattern: Call this prompt with a batch of retrieved passages (typically 10–30) and the user's query or the claim being evaluated. Parse the JSON output into a typed object in your application code. Use the tier field to gate downstream behavior: STRONG_CONSENSUS passages can feed directly into answer generation with high confidence; MODERATE_SUPPORT passages should be included but with uncertainty language; WEAK_OR_ISOLATED passages should be excluded or presented with explicit caveats; and any passage flagged with contradiction: true and a conflict_cluster_id should be routed to a conflict-resolution workflow. Validation: Before passing ranked evidence to answer generation, validate that the output contains the expected fields (passage_id, tier, relevance_score, contradiction, rationale), that scores are within the defined range, and that conflict_cluster_id values are consistent (passages in the same cluster should reference each other). If validation fails, retry once with the validation errors appended to the prompt as feedback. If retry also fails, log the failure and escalate to a human review queue rather than proceeding with unvalidated rankings.

Model selection: This task requires strong reasoning and comparison capabilities. Use a capable model such as Claude 3.5 Sonnet, GPT-4o, or Gemini 1.5 Pro. Avoid smaller or faster models for this step unless you have calibrated their ranking accuracy against your eval set—ranking with contradiction detection is a higher-cognitive-load task than simple relevance scoring. Latency and cost: This prompt processes multiple passages in a single call, which is more efficient than pairwise comparisons but still consumes significant tokens. Budget approximately 500–1500 output tokens per batch of 20 passages. For high-throughput systems, consider batching passages into groups of 15–20 and running ranking in parallel across shards, then merging results with a secondary deduplication step. Logging and observability: Log the full prompt input, output, validation results, and any retry attempts. Include conflict_cluster_id values and tier distributions in your monitoring dashboards. A sudden increase in contradiction clusters may indicate a retrieval quality problem, a data corpus issue, or an emerging real-world controversy that your system should surface rather than suppress. Human review gates: For regulated or high-risk domains (legal, medical, financial), always route outputs with tier: WEAK_OR_ISOLATED or any contradiction cluster to a human reviewer before the evidence reaches end users. The prompt's contradiction annotations make this triage straightforward: if contradiction: true appears in any passage ranked above your quality threshold, pause the pipeline and request review.

What to avoid: Do not use this prompt's output to automatically resolve contradictions by picking a 'winner.' The prompt identifies conflicts; it does not adjudicate them. Resolution logic—whether it's a second LLM call, a human decision, or a 'both sides' display—belongs in a separate component. Do not skip validation and proceed directly to answer generation with unvalidated rankings; malformed tier assignments or inconsistent conflict clusters will produce misleading or overconfident answers downstream. Finally, do not treat this prompt as a replacement for retrieval quality monitoring. If your retrieval step consistently returns weak or irrelevant passages, ranking them accurately won't fix the underlying retrieval gap—invest in your retrieval pipeline first, then use this prompt to make the best use of what you retrieve.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the strict JSON schema, field types, and validation rules for the evidence ranking with contradiction detection output. Use this contract to build a parser, validator, and retry harness before integrating the prompt into a production pipeline.

Field or ElementType or FormatRequiredValidation Rule

ranked_evidence

array of objects

Array must not be empty. Each object must conform to the evidence_item schema.

evidence_item.id

string

Must match the [PASSAGE_ID] from the input. Non-empty and unique within the array.

evidence_item.rank

integer

Sequential integer starting at 1. No gaps or duplicates. Must be within 1 to total count of input passages.

evidence_item.strength_tier

enum: ['PRIMARY', 'SUPPORTING', 'WEAK', 'IRRELEVANT']

Must be one of the four defined tiers. PRIMARY implies direct, specific support for the claim. WEAK implies tangential or low-authority support.

evidence_item.contradiction_flag

boolean

Must be true if this passage contradicts another passage in the set or the consensus. Must be false otherwise.

evidence_item.contradicts_passage_ids

array of strings or null

If contradiction_flag is true, must contain at least one valid [PASSAGE_ID] from the input. If false, must be null or an empty array.

evidence_item.rationale

string

Must be 1-3 sentences. Cannot be empty. Must reference specific content from the passage, not just generic quality statements.

global_conflicts

array of objects

Array can be empty if no conflicts detected. Each object must have passage_id_a, passage_id_b, and conflict_description fields.

global_conflicts.conflict_description

string

Must describe the specific factual or logical contradiction between the two passages. Cannot be empty or generic.

PRACTICAL GUARDRAILS

Common Failure Modes

Evidence ranking with contradiction detection is powerful but brittle. These are the most common production failure modes and how to prevent them before they reach users.

01

False Consensus from Majority Bias

What to watch: The model treats the most frequent claim as the consensus, even when a single high-authority source contradicts multiple low-quality sources. This buries critical dissent under volume. Guardrail: Inject explicit source authority metadata into the prompt and instruct the model to weight by authority tier, not passage count. Require the output to flag minority reports from high-authority sources separately.

02

Contradiction Blindness from Proximity

What to watch: Passages that appear close together in the ranked list are assumed to agree, while contradictions between top-ranked and bottom-ranked passages are missed entirely. The model stops scanning for conflicts after the first few items. Guardrail: Add a dedicated second-pass instruction that explicitly compares every passage against every other passage for contradiction, regardless of rank position. Use a structured conflict matrix in the output schema.

03

Over-Flagging Minor Disagreements

What to watch: The model flags every minor wording difference or numerical rounding discrepancy as a contradiction, producing a noisy conflict report that downstream synthesis ignores or overreacts to. Guardrail: Define a materiality threshold in the prompt. Instruct the model to distinguish between substantive contradictions (different facts, opposite conclusions) and surface-level variance (synonyms, rounding, phrasing). Require a severity label per conflict.

04

Temporal Contradiction Without Date Awareness

What to watch: Two passages report different facts about the same entity because one is outdated, but the model treats them as a live contradiction rather than a temporal update. This produces false conflict signals. Guardrail: Include publication dates in passage metadata and instruct the model to check whether a contradiction is explained by recency before flagging it. Add a temporal-resolution field to the conflict annotation schema.

05

Ranking Collapse Under Conflict

What to watch: When the model detects a contradiction, it downgrades both conflicting passages in the ranking, even when one is clearly more authoritative or better-supported. This loses strong evidence because of guilt by association. Guardrail: Separate the ranking step from the contradiction detection step. Rank first on evidence strength alone, then run contradiction detection on the ranked list. Do not allow conflict status to retroactively change the strength score.

06

Synthesis Paralysis from Unresolved Conflicts

What to watch: Downstream answer generation receives a conflict report but no resolution guidance, causing the model to either refuse to answer entirely or produce a hedged, useless summary. Guardrail: The contradiction detection output must include a resolution recommendation per conflict: which source to prefer and why, whether to present both sides, or whether to escalate for human review. Never pass raw conflicts to synthesis without a decision rule.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the Evidence Ranking with Contradiction Detection Prompt before shipping. Each row defines a pass standard, a failure signal, and a concrete test method.

CriterionPass StandardFailure SignalTest Method

Contradiction Detection Recall

All manually seeded contradictions in a golden test set are flagged in the output.

A known contradictory passage pair is missing a conflict annotation or is ranked in the same tier without a flag.

Run prompt against a curated dataset of 10 source sets containing 2-3 known contradictions each. Assert that every contradiction appears in the conflict_annotations block.

Ranking Tier Assignment

Passages are assigned to exactly one tier: 'strong_support', 'moderate_support', 'weak_support', or 'contradicts'. No passage appears in multiple tiers.

A passage is missing a tier assignment, assigned an undefined tier, or appears in more than one tier.

Validate output JSON against the [OUTPUT_SCHEMA] using a schema validator. Check that every passage_id in the input appears exactly once across all tier arrays.

Conflict Annotation Accuracy

Every passage flagged as 'contradicts' includes a conflict_reason string that references the specific contradictory passage_id and the point of disagreement.

A conflict annotation is missing the conflict_reason field, references a non-existent passage_id, or describes a disagreement that is not factually present in the text.

For each conflict annotation, verify that the referenced passage_id exists in the input set. Manually review a sample of 5 conflict_reason strings for factual accuracy against the source passages.

Consensus Alignment

The passage ranked highest in 'strong_support' aligns with the majority-evidence position when a clear consensus exists in the input set.

A passage that contradicts the majority of provided evidence is ranked as the top strong_support passage without explanation.

Construct a test case with 5 passages where 4 agree on a fact and 1 disagrees. Assert that the disagreeing passage is not in the strong_support tier and appears in the contradicts tier.

Output Schema Compliance

The output is valid JSON matching the [OUTPUT_SCHEMA] on the first generation attempt without repair.

The output is missing required fields (ranked_tiers, conflict_annotations), contains extra untyped fields, or uses incorrect types.

Parse the output with a strict JSON schema validator configured to the [OUTPUT_SCHEMA]. No additionalProperties allowed. Fail the test if validation errors are present.

Empty Input Handling

When [INPUT_PASSAGES] is an empty array, the prompt returns an empty ranked_tiers object and an empty conflict_annotations array without hallucinating content.

The model generates fictional passages, ranks non-existent content, or returns a refusal message instead of a valid empty structure.

Submit a request with [INPUT_PASSAGES] set to []. Assert that ranked_tiers.strong_support, ranked_tiers.moderate_support, ranked_tiers.weak_support, and ranked_tiers.contradicts are all empty arrays.

Single Passage Handling

When [INPUT_PASSAGES] contains exactly one passage, it is ranked in the appropriate tier based on its content, and conflict_annotations is an empty array.

A single passage is incorrectly flagged as contradictory, or the model refuses to rank a single passage.

Submit a request with one passage that clearly supports [QUERY]. Assert it appears in strong_support and conflict_annotations is an empty array. Repeat with a passage that is off-topic and assert it appears in weak_support.

Position Bias Resistance

The ranking order is not correlated with the input order of passages. A strong passage ranked last in the input list is still placed in strong_support.

The first passage in the input list is consistently ranked highest regardless of its content relevance.

Create a test case with 3 passages where the most relevant passage is placed last in the [INPUT_PASSAGES] array. Assert that this passage appears in strong_support and is not outranked by less relevant passages placed earlier in the input.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single model call. Use a simple text output format with ranked tiers and conflict flags. Skip strict schema enforcement during early experimentation. Feed 3–5 passages at a time to observe ranking and contradiction behavior before scaling to larger retrieval sets.

Prompt modification

  • Remove or simplify the [OUTPUT_SCHEMA] section; accept a structured but unvalidated text response.
  • Reduce [CONSTRAINTS] to a single instruction: "Rank passages by support strength and flag any contradictions."
  • Use a small [EVIDENCE_SET] of 3–5 passages with one known contradiction seeded for testing.

Watch for

  • Ranking instability across repeated calls with the same input
  • Contradiction detection missing subtle conflicts (e.g., partial disagreement on numbers or dates)
  • Output format drift when passages are long or numerous
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.