Inferensys

Prompt

Cross-Document Contradiction Flagging Prompt

A practical prompt playbook for using Cross-Document Contradiction Flagging Prompt in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the ideal use case, required inputs, and boundaries for the Cross-Document Contradiction Flagging Prompt.

This prompt is designed for legal, compliance, and audit teams who need to systematically identify contradictory statements across a collection of documents. It takes a set of document excerpts and a specific topic or claim as input, then outputs a structured contradiction report with source citations, severity ratings, and recommended resolution actions. Use this prompt when your retrieval system has surfaced multiple documents that appear to address the same fact, policy, or obligation, and you need to surface disagreements rather than silently synthesizing a single answer.

This is not a general-purpose fact-checking prompt. It assumes you have already retrieved relevant passages and need to compare them for internal inconsistency. The prompt works best when documents share a common domain, such as contracts, regulatory filings, internal policies, or compliance evidence. It is not suitable for open-domain web search where sources have unknown provenance or when documents discuss entirely different subjects. The prompt requires at minimum two document excerpts and a defined topic or claim to compare against. Without a clear comparison target, the model will struggle to identify meaningful contradictions versus topical drift.

Do not use this prompt when you need to verify claims against an external ground truth, when you need to resolve contradictions through external research, or when documents span incompatible domains. The prompt flags contradictions for human review—it does not resolve them. For workflows requiring automated conflict resolution, pair this with the Temporal Conflict Resolution Prompt or Source Credibility Weighting Prompt. For customer-facing Q&A where you must present a single answer despite conflicts, use the Conflict-Aware RAG Answer Generation Prompt Template instead. Always route outputs through a human review step when contradiction severity is rated critical or when the documents carry regulatory weight.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Cross-Document Contradiction Flagging Prompt delivers value and where it introduces risk. Use these cards to decide if this prompt fits your workflow before wiring it into a production harness.

01

Good Fit: Multi-Source Review Pipelines

Use when: you have a collection of documents (contracts, policies, filings) and need to surface specific contradictory statements with citations. Guardrail: the prompt works best when documents are pre-chunked and retrieved with metadata (source ID, date, author). Without metadata, severity ratings become unreliable.

02

Good Fit: Human-in-the-Loop Triage

Use when: a human reviewer will evaluate flagged contradictions before any downstream action. The prompt outputs severity ratings and resolution recommendations that feed a review queue. Guardrail: configure the contradiction confidence threshold to favor recall over precision—false positives are cheaper than missed conflicts when a human is in the loop.

03

Bad Fit: Real-Time Chat or Single-Turn Q&A

Avoid when: latency must be under 2 seconds or the user expects a single definitive answer. Cross-document comparison requires multiple context windows and careful reasoning. Guardrail: for real-time use, pre-compute conflict reports asynchronously and surface them as citations rather than running this prompt on every query.

04

Bad Fit: Single-Source or Highly Aligned Corpora

Avoid when: your document collection is a single source or all sources share the same author, date, and viewpoint. The prompt will hallucinate conflicts or over-flag stylistic differences as substantive contradictions. Guardrail: run a pre-check on source diversity. If all documents share the same origin, skip contradiction flagging and use a standard RAG answer prompt instead.

05

Required Inputs: Metadata-Rich Chunks

Risk: without source ID, document date, author, and jurisdiction metadata, the prompt cannot produce reliable severity ratings or resolution actions. Guardrail: ensure your retrieval pipeline attaches these fields to every chunk. If metadata is missing, downgrade the output to 'informational' severity and flag the gap explicitly.

06

Operational Risk: Threshold Drift Over Time

Risk: as your document collection grows or changes, the contradiction confidence threshold that worked at launch may produce too many or too few flags. Guardrail: log contradiction counts, severity distributions, and human reviewer overturn rates weekly. Recalibrate the threshold when overturn rates exceed 30% or flag volume shifts by more than 50%.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for flagging contradictory statements across documents with source citations, severity ratings, and resolution actions.

This prompt template is designed to be copied directly into your application or evaluation harness. It expects a set of documents, a target claim or topic to check for contradictions, and configuration parameters that control detection sensitivity and output structure. Every placeholder is enclosed in square brackets—replace each one with your actual data before sending the prompt to the model. The template is structured to produce a machine-readable JSON output that downstream systems can parse for review routing, alerting, or audit logging.

text
You are a contradiction detection analyst reviewing a collection of documents. Your task is to identify specific contradictory statements across documents, cite the conflicting sources, rate severity, and recommend resolution actions.

## INPUT DOCUMENTS
[DOCUMENTS]

## TARGET CLAIM OR TOPIC
[CLAIM_OR_TOPIC]

## DETECTION CONFIGURATION
- Minimum contradiction confidence threshold: [CONFIDENCE_THRESHOLD]
- Severity levels to report: [SEVERITY_LEVELS]
- Maximum contradictions to return: [MAX_CONTRADICTIONS]
- Domain context: [DOMAIN]

## OUTPUT SCHEMA
Return a JSON object with the following structure:
{
  "contradictions": [
    {
      "id": "string",
      "claim_a": {
        "text": "string",
        "source_id": "string",
        "source_section": "string",
        "source_date": "string or null"
      },
      "claim_b": {
        "text": "string",
        "source_id": "string",
        "source_section": "string",
        "source_date": "string or null"
      },
      "contradiction_type": "direct_contradiction | partial_contradiction | definitional_conflict | temporal_conflict | numerical_conflict | jurisdictional_conflict",
      "severity": "[SEVERITY_LEVELS]",
      "confidence": 0.0,
      "explanation": "string",
      "recommended_action": "escalate_to_human_review | flag_for_audit | resolve_with_newer_source | resolve_with_authoritative_source | note_dissenting_view | no_action",
      "action_rationale": "string"
    }
  ],
  "no_contradictions_found": false,
  "analysis_notes": "string"
}

## CONSTRAINTS
[CONSTRAINTS]

## EXAMPLES
[EXAMPLES]

## INSTRUCTIONS
1. Compare every pair of documents for statements that cannot all be true simultaneously.
2. Only flag contradictions where confidence meets or exceeds the threshold.
3. For each contradiction, extract the exact text from both sources with precise section references.
4. Classify the contradiction type and assign a severity based on domain impact.
5. Recommend a resolution action with clear rationale.
6. If no contradictions meet the threshold, set `no_contradictions_found` to true and explain why in `analysis_notes`.
7. Do not fabricate contradictions. If sources appear to conflict but could be reconciled through interpretation, note this in `analysis_notes` and reduce confidence accordingly.

To adapt this template for your workflow, start by replacing [DOCUMENTS] with your actual document collection, formatted with clear source identifiers, section markers, and dates where available. Set [CONFIDENCE_THRESHOLD] to a value between 0.0 and 1.0—start at 0.7 for high-precision workflows like legal review, or lower to 0.5 for exploratory analysis where you prefer false positives over missed contradictions. Replace [SEVERITY_LEVELS] with your domain-specific taxonomy such as critical, major, minor, informational. The [CONSTRAINTS] placeholder should contain any additional rules, such as ignoring contradictions below a certain monetary threshold in financial documents or excluding known acceptable discrepancies. The [EXAMPLES] placeholder is critical for few-shot performance—include at least two annotated examples showing a clear contradiction and a non-contradiction that the model should not flag. After generation, validate the JSON output against the schema before routing to human review queues or audit systems. For high-stakes domains, always route contradictions flagged as critical or major severity to human review regardless of confidence scores.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Cross-Document Contradiction Flagging Prompt. Validate each placeholder before sending to the model to prevent false positives, missed conflicts, and malformed output.

PlaceholderPurposeExampleValidation Notes

[DOCUMENT_SET]

Array of documents to scan for contradictions, each with a unique identifier and full text content.

{"documents": [{"id": "doc-001", "text": "The agreement terminates on March 15, 2027."}, {"id": "doc-002", "text": "The agreement terminates on September 30, 2026."}]}

Must contain at least 2 documents. Each document object requires a non-empty id string and a non-empty text string. Reject if any document text exceeds the model context window after accounting for instruction tokens.

[CONTRADICTION_THRESHOLD]

Minimum confidence score (0.0 to 1.0) the model must assign before flagging a pair of statements as contradictory.

0.75

Must be a float between 0.0 and 1.0. Values below 0.5 produce high false-positive rates. Values above 0.9 risk missing genuine contradictions. Default to 0.7 if not specified. Validate as numeric and in-range before injection.

[SEVERITY_TAXONOMY]

Ordered list of severity levels the model must use when classifying each contradiction.

["critical", "major", "minor", "informational"]

Must be a non-empty array of unique string labels. The first label is treated as highest severity. Reject if taxonomy contains duplicates or fewer than 2 levels. Map to downstream routing rules before prompt assembly.

[DOMAIN_CONTEXT]

Short description of the document domain to help the model calibrate what constitutes a material contradiction.

"Commercial lease agreements governed by California law. Focus on financial terms, dates, party obligations, and termination clauses."

Must be a non-empty string under 500 characters. Avoid vague descriptions like 'legal documents.' Be specific about jurisdiction, document type, and materiality criteria. Null allowed if domain-agnostic scanning is intended.

[OUTPUT_SCHEMA]

Strict JSON schema the model must follow for each flagged contradiction, including required fields and types.

{"type": "object", "properties": {"contradiction_id": {"type": "string"}, "source_a": {"type": "string"}, "source_b": {"type": "string"}, "claim_a": {"type": "string"}, "claim_b": {"type": "string"}, "severity": {"type": "string", "enum": ["critical", "major", "minor", "informational"]}, "confidence": {"type": "number"}, "rationale": {"type": "string"}, "resolution_action": {"type": "string"}}, "required": ["contradiction_id", "source_a", "source_b", "claim_a", "claim_b", "severity", "confidence", "rationale", "resolution_action"]}

Must be a valid JSON Schema object. Validate with a schema parser before injection. Required fields must include source identifiers, claim excerpts, severity, confidence, and resolution action. Reject schemas missing source traceability fields.

[MAX_CONTRADICTIONS]

Upper limit on the number of contradictions the model should return in a single response.

25

Must be a positive integer. Set based on downstream review capacity and model output token limits. Values above 50 risk truncated responses. Validate as integer and enforce with a stop condition in the post-processing layer.

[RESOLUTION_ACTION_OPTIONS]

Allowed resolution actions the model can recommend for each contradiction.

["escalate_to_legal_review", "flag_for_provider_clarification", "accept_newer_source", "accept_higher_authority_source", "document_for_audit", "no_action"]

Must be a non-empty array of unique string values. Each value must map to a defined downstream workflow or queue. Reject if any action lacks a handler in the orchestration layer. Null allowed if resolution routing is handled post-hoc.

[SOURCE_METADATA_FIELDS]

Optional metadata fields available for each document that the model can reference when weighting credibility.

["source_type", "effective_date", "authority_level", "jurisdiction"]

Must be an array of strings matching actual metadata keys present in [DOCUMENT_SET]. Reject if a specified field is missing from any document unless null handling is explicitly configured. Null allowed if no metadata weighting is needed.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Cross-Document Contradiction Flagging Prompt into a production application with validation, routing, and human review.

This prompt is designed to be called as part of a batch or streaming document review pipeline, not as a one-off chat interaction. The application layer is responsible for chunking source documents, pairing them for comparison, calling the LLM with this prompt, and then validating the structured output before routing flagged contradictions to a human review queue. The prompt itself handles the reasoning and structured extraction; the harness handles the orchestration, safety checks, and downstream actions.

Input assembly: Before calling the prompt, the application must assemble the [DOCUMENT_A] and [DOCUMENT_B] fields with full text of the sections under comparison, plus [DOCUMENT_A_METADATA] and [DOCUMENT_B_METADATA] containing at minimum a source identifier, document date, author or department, and jurisdiction if relevant. The [CONTRADICTION_THRESHOLD] should be set as a numeric value (e.g., 0.7) representing the minimum confidence required to flag a contradiction. The [DOMAIN_CONTEXT] field should describe the review domain (e.g., 'M&A due diligence', 'regulatory filing review') to help the model calibrate severity. Output validation: Parse the model's JSON response and validate that each contradiction object contains all required fields: claim_a, claim_b, source_a_citation, source_b_citation, contradiction_type, severity, confidence, and recommended_action. Reject and retry any response missing these fields or containing malformed JSON. Use a schema validator like Pydantic or Zod before the output enters any downstream system.

Routing and human review: After validation, route contradictions based on severity. Critical and major contradictions should be pushed to a human review queue with the full contradiction payload, source excerpts, and a link to the original documents. Minor and informational contradictions can be logged for audit but may not require immediate human action. Implement a review interface that allows the human reviewer to confirm, dismiss, or reclassify each flagged contradiction. Retry logic: If the model returns invalid JSON or fails to produce the expected schema after two retries, log the failure with the raw output and document pair identifiers, then escalate to a human operator. Do not silently drop failed extractions. Model choice: Use a model with strong structured output capabilities and a context window large enough to hold both document sections plus the prompt. For high-stakes legal or compliance use cases, prefer a model with proven instruction-following and low hallucination rates on extraction tasks. Logging: Log every contradiction flagging call with the document pair identifiers, the contradiction count, severity distribution, and whether the output passed validation. This creates an audit trail for compliance reviews and helps detect prompt drift over time.

What to avoid: Do not use this prompt to compare more than two documents at once—the pairwise design is intentional to keep the model focused and the output schema manageable. For multi-document collections, run pairwise comparisons and aggregate results in the application layer. Do not treat the model's severity classification as final without human review for critical contradictions. Do not skip output validation; even models with strong JSON mode can produce missing fields or type errors under edge-case inputs. Finally, do not use this prompt for real-time user-facing Q&A—it is designed for asynchronous document review workflows where latency tolerance is higher and accuracy is paramount.

IMPLEMENTATION TABLE

Expected Output Contract

Each field the model must return, with its type, whether it is required, and the validation rule to apply before the output is accepted downstream.

Field or ElementType or FormatRequiredValidation Rule

contradiction_id

string (UUID v4)

Must match UUID v4 regex. Generate if not provided in [INPUT].

source_a

object

Must contain document_id (string) and excerpt (string). excerpt must be <= 500 chars. Validate document_id exists in [CONTEXT].

source_b

object

Same schema as source_a. source_a.document_id must not equal source_b.document_id.

contradiction_type

enum string

Must be one of: direct_negation, numerical_discrepancy, temporal_conflict, definitional_conflict, jurisdictional_conflict, methodological_conflict.

severity

enum string

Must be one of: critical, major, minor, informational. If severity is critical, recommended_action must be escalate_to_human_review.

confidence

number (0.0-1.0)

Must be a float between 0.0 and 1.0 inclusive. If confidence < [CONFIDENCE_THRESHOLD], route output to human review queue regardless of severity.

explanation

string

Must be 50-300 chars. Must reference specific phrases from both source_a.excerpt and source_b.excerpt. Must not introduce external knowledge.

recommended_action

enum string

Must be one of: escalate_to_human_review, flag_for_audit, suppress_conflicting_claim, surface_with_caveat, resolve_with_precedence_rule.

PRACTICAL GUARDRAILS

Common Failure Modes

Cross-document contradiction flagging fails in predictable ways. These are the most common production failure modes and the guardrails that catch them before they reach users or reviewers.

01

False Positives on Paraphrased Agreement

What to watch: The model flags two passages as contradictory when they actually agree but use different terminology, granularity, or phrasing. This floods the review queue with noise and erodes trust. Guardrail: Add a pre-check instruction requiring the model to verify whether the claims are semantically equivalent before classifying as a conflict. Include few-shot examples of paraphrased agreement labeled as non-conflict.

02

Missed Temporal Conflicts Across Document Versions

What to watch: The model treats an outdated policy document and a current one as equally valid sources, missing that the newer document intentionally supersedes the older one. This produces false contradictions where no real conflict exists. Guardrail: Require effective-date metadata in the prompt context and instruct the model to apply temporal precedence rules before flagging. Route documents without date metadata to a separate uncertainty queue.

03

Severity Inflation on Low-Stakes Discrepancies

What to watch: Minor wording differences or immaterial numerical rounding get classified as critical conflicts, triggering unnecessary human review and slowing downstream workflows. Guardrail: Define explicit severity thresholds in the prompt with domain-specific examples of critical vs. minor vs. informational conflicts. Include a materiality check step before assigning severity labels.

04

Citation Drift Under Long Context Windows

What to watch: When many documents are loaded, the model attributes a claim to the wrong source or fabricates a source identifier that doesn't exist in the provided context. This undermines auditability. Guardrail: Require verbatim quote extraction paired with source IDs before the conflict classification step. Validate that every cited source ID exists in the input context. Use structured output fields to enforce source-to-claim mapping.

05

Abstention Failure on Ambiguous Conflicts

What to watch: When evidence is genuinely ambiguous—neither clearly agreeing nor clearly contradicting—the model forces a conflict classification instead of returning an uncertain or needs-clarification result. Guardrail: Add an explicit abstention path in the output schema for ambiguous cases. Set a minimum confidence threshold for conflict classification and route sub-threshold cases to human review with the raw evidence pair.

06

Context Window Truncation Silently Drops Evidence

What to watch: Large document sets exceed the context window, and the model silently operates on truncated input without signaling that evidence was dropped. This produces incomplete conflict reports that look valid but miss contradictions in the omitted passages. Guardrail: Implement context budget tracking in the application layer. Chunk document sets and run contradiction checks per chunk pair, then merge results. Add a completeness flag to the output indicating whether all provided documents were processed.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks on a golden dataset of document pairs with known contradictions. Each criterion validates a different failure mode observed in production contradiction flagging systems.

CriterionPass StandardFailure SignalTest Method

Contradiction Recall

All known contradictions in golden set are flagged with severity >= minor

Known contradiction present in output but missing from [CONTRADICTIONS] array

Run against 50+ labeled document pairs; measure recall at severity >= minor threshold

False Positive Rate

Fewer than 10% of flagged contradictions are false positives on golden set

Flagged contradiction where both sources state the same fact with different wording

Human review of all flagged contradictions in golden set; count false positives / total flags

Severity Classification Accuracy

Critical contradictions correctly classified >= 95% of the time; major >= 90%

Critical contradiction labeled as minor or informational

Compare [SEVERITY] field against golden labels for each known contradiction type

Source Citation Precision

Every flagged contradiction includes exact [SOURCE_A] and [SOURCE_B] identifiers matching golden set

Missing source ID, wrong document reference, or citation pointing to non-contradictory passage

Validate [SOURCE_A] and [SOURCE_B] fields against expected source pairs in golden set

Claim Excerpt Grounding

Both [CLAIM_A] and [CLAIM_B] contain verbatim or near-verbatim text from cited sources

Paraphrased claim that cannot be located in source document

String match [CLAIM_A] and [CLAIM_B] against source text spans; flag if edit distance exceeds 20% of claim length

Resolution Action Appropriateness

[RESOLUTION_ACTION] matches golden-set expected action for each contradiction type

Escalate-to-human on low-severity contradiction or auto-resolve on critical regulatory conflict

Compare [RESOLUTION_ACTION] field against expected action labels in golden set

Confidence Score Calibration

[CONFIDENCE] scores correlate with human judgment of contradiction certainty; Spearman rho >= 0.7

High confidence on false positive or low confidence on clear contradiction

Compute Spearman rank correlation between [CONFIDENCE] values and human certainty ratings on golden set

Output Schema Compliance

100% of outputs parse against [OUTPUT_SCHEMA] with all required fields present and correctly typed

Missing [CONTRADICTIONS] array, null [SEVERITY], or malformed [SOURCE_A] structure

Validate every output against JSON Schema; reject any output with missing required fields or type mismatches

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and a small document set. Remove the [OUTPUT_SCHEMA] placeholder and request a markdown table instead. Lower the contradiction confidence threshold to surface more candidates for manual review. Skip severity classification and resolution action fields.

Prompt modification

Replace the structured output instruction with: Return a markdown table with columns: Source A, Source B, Contradictory Claim, Excerpt A, Excerpt B, Your Confidence (Low/Medium/High).

Watch for

  • Over-flagging stylistic differences as contradictions
  • Missing temporal context (old vs. new policy)
  • Model fabricating contradictions when documents are silent on a topic
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.