Inferensys

Prompt

Cross-Document Fact Alignment Prompt

A practical prompt playbook for aligning factual claims across documents to identify agreement, paraphrasing, and genuine conflict in knowledge graph construction and entity resolution pipelines.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Determine whether two or more documents are making the same factual claim or genuinely conflicting claims before merging knowledge bases or surfacing contradictions.

This prompt is designed for knowledge graph engineers, entity resolution pipeline builders, and RAG system architects who need to determine whether two or more documents are making the same factual claim or genuinely conflicting claims. It handles paraphrasing, synonymy, granularity differences, and numerical tolerance. Use this prompt when your system must align facts before merging knowledge bases, deduplicating entities, or surfacing conflicts to downstream systems.

This is not a general question-answering prompt. It assumes you have already extracted candidate claims and need to align them. It does not perform extraction, retrieval, or conflict resolution. It produces alignment judgments with explicit reasoning that your pipeline can act on. Do not use this prompt when you need to extract claims from raw text, resolve conflicts by choosing a winner, or generate end-user-facing answers. Those tasks belong to separate prompts in the Multi-Source Conflict and Consistency family.

Before deploying, pair this prompt with validation checks that verify the output schema contains both the alignment judgment and the reasoning field. For high-stakes domains such as legal or clinical knowledge bases, route low-confidence alignments to human review. The prompt works best when claims are already normalized to a common schema with fields for the claim text, source document identifier, and any numerical values with units.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Cross-Document Fact Alignment Prompt delivers reliable entity resolution and where it introduces risk. Use these cards to decide if this prompt fits your pipeline before investing in eval and integration.

01

Good Fit: Knowledge Graph Population

Use when: building or updating a knowledge graph from multiple documents where the same real-world entity appears under different names or descriptions. Guardrail: require explicit entity grounding fields in the output schema so downstream systems can merge nodes deterministically.

02

Good Fit: Entity Resolution Across Sources

Use when: you have overlapping document sets and need to identify which claims refer to the same person, organization, or event despite paraphrasing. Guardrail: include a confidence score per alignment and route low-confidence pairs to human review before merging.

03

Bad Fit: Single-Document Deduplication

Avoid when: all facts come from one source and the task is removing redundant sentences, not resolving cross-document identity. Guardrail: use a simpler deduplication or salience prompt instead; cross-document alignment adds unnecessary complexity and hallucination risk.

04

Bad Fit: Real-Time Streaming Answers

Avoid when: latency budgets are under 500ms and the user expects a direct answer, not an alignment table. Guardrail: run fact alignment as an offline or async preprocessing step, then serve pre-aligned facts to the real-time answer prompt.

05

Required Inputs

What you need: at least two document chunks with overlapping subject matter, plus source identifiers and optional timestamps. Guardrail: if source metadata is missing, the prompt cannot distinguish genuine conflict from stale data—add metadata validation before invoking alignment.

06

Operational Risk: Paraphrase vs. Genuine Conflict

Risk: the model conflates stylistic paraphrase with factual disagreement, producing false conflict reports. Guardrail: include few-shot examples that distinguish 'same fact, different words' from 'different facts' and add an eval check for false-positive conflict rate.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt for aligning factual claims across documents to identify agreement, paraphrasing, and genuine conflicts.

This template is designed to be dropped directly into your entity resolution or knowledge graph construction pipeline. It takes a set of factual claims extracted from multiple documents and determines whether they refer to the same underlying fact, even when expressed through paraphrasing, synonymy, or different levels of granularity. The prompt distinguishes between sources that genuinely agree on a fact and those that appear to conflict due to wording differences or scope. Copy the template below, replace each square-bracket placeholder with your pipeline's data, and integrate the output into your downstream alignment resolver.

text
You are a fact alignment engine. Your job is to compare factual claims extracted from multiple documents and determine whether they refer to the same underlying fact.

## INPUT
Claims to align:
[CLAIMS]

Each claim includes:
- claim_id: unique identifier
- source_document_id: document the claim came from
- claim_text: the factual statement as written
- extraction_date: when the claim was extracted
- entity_tags: entities referenced in the claim

## ALIGNMENT RULES
1. Two claims refer to the SAME fact if they assert the same real-world proposition, even if:
   - They use different words (paraphrasing)
   - They use synonyms or alternate entity names
   - One is more specific than the other (granularity difference)
   - They express the same value in different units or formats
2. Two claims CONFLICT if they make mutually exclusive assertions about the same entity, property, or event.
3. Two claims are DISTINCT if they address different facts entirely.
4. Claims from the SAME source document should not be flagged as conflicts unless the document internally contradicts itself.
5. When temporal information differs, check whether the claims refer to different time periods before flagging as conflict.

## OUTPUT SCHEMA
Return a JSON object with this structure:
{
  "alignment_groups": [
    {
      "group_id": "string",
      "canonical_fact": "string - the normalized statement of the agreed fact",
      "relationship": "same_fact | conflict | distinct",
      "claims": [
        {
          "claim_id": "string",
          "source_document_id": "string",
          "role": "supporting | conflicting | primary",
          "paraphrase_type": "exact_match | synonym_substitution | granularity_difference | unit_conversion | none",
          "confidence": 0.0-1.0
        }
      ],
      "alignment_notes": "string - explanation of why these claims are grouped"
    }
  ],
  "unmatched_claims": ["claim_id"],
  "conflicts_requiring_review": [
    {
      "group_id": "string",
      "conflict_type": "direct_contradiction | temporal_drift | definitional_difference | scope_mismatch",
      "severity": "critical | major | minor",
      "recommendation": "string"
    }
  ]
}

## CONSTRAINTS
- Do not invent facts to resolve conflicts.
- If two claims cannot be confidently aligned, place them in unmatched_claims.
- Flag any conflict where the resolution would change a downstream decision as severity "critical".
- For claims with confidence below 0.7, add them to conflicts_requiring_review.
- Never merge claims that differ on numerical values outside a 5% tolerance band.

## EXAMPLES
[EXAMPLES]

## RISK LEVEL
[RISK_LEVEL]

Adapt this template by adjusting the alignment rules to match your domain's tolerance for numerical variance, temporal granularity, and entity synonymy. The [EXAMPLES] placeholder should contain 2-4 annotated claim pairs showing clear same-fact alignment, genuine conflict, and granularity differences. For high-risk domains such as legal or clinical fact alignment, set [RISK_LEVEL] to high and add an explicit instruction requiring human review for any conflict group where severity is critical or major. The output schema is designed to feed directly into a downstream resolver or human review queue—do not modify the JSON structure without updating your ingestion pipeline accordingly. Before deploying, run this prompt against a golden set of pre-aligned claim pairs and measure both pairwise alignment accuracy and conflict detection recall.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to work reliably. Replace each placeholder with your pipeline data. Validation notes describe how to check the input before it reaches the model.

PlaceholderPurposeExampleValidation Notes

[DOCUMENT_SET]

Array of documents to align, each with an id and text field

[{"id": "doc-1", "text": "Acme Corp was founded in 2011 by Alice Chen."}, {"id": "doc-2", "text": "Acme Corp launched in 2012, founded by A. Chen."}]

Schema check: array of objects with required id (string) and text (string) fields. Minimum 2 documents. Null not allowed.

[FOCUS_ENTITY]

Primary entity or subject to align facts around

"Acme Corp"

Non-empty string. Must appear in at least one document. If null, prompt should fall back to open-domain alignment across all entities.

[FACT_CATEGORIES]

List of fact types to extract and align

["founding_date", "founder_name", "headquarters_location", "employee_count"]

Array of strings. Must not be empty. Each category should be a snake_case label. Validate against allowed category taxonomy if one exists.

[ALIGNMENT_THRESHOLD]

Confidence score below which facts are treated as unaligned rather than forced

0.75

Float between 0.0 and 1.0. Default 0.75. Lower values increase false alignment risk. Higher values increase false conflict flags.

[OUTPUT_SCHEMA]

Expected JSON schema for the alignment output

{"aligned_facts": [{"category": "string", "claim": "string", "source_ids": ["string"], "alignment_type": "exact_match|paraphrase|granularity_diff|conflict", "confidence": 0.0-1.0}]}

Valid JSON Schema object. Must include aligned_facts array with required fields. Parse check before prompt assembly.

[SYNONYM_MAP]

Optional mapping of known synonyms for entity and value normalization

{"A. Chen": "Alice Chen", "launched": "founded", "HQ": "headquarters"}

Object or null. If provided, keys are surface forms and values are canonical forms. Validate no circular mappings. Null allowed when no synonym map exists.

[MAX_DOCS_PER_FACT]

Upper bound on documents to include per aligned fact to control output size

5

Integer >= 1. Prevents unbounded source arrays. If more documents contain the fact, prompt should select the most authoritative or earliest sources.

[CONFLICT_RESOLUTION_RULE]

Instruction for how to handle genuine conflicts in the output

"flag_all_and_do_not_resolve"

Enum: flag_all_and_do_not_resolve, prefer_most_recent, prefer_highest_authority, escalate_for_human_review. Must match one of the allowed values. Default to flag_all_and_do_not_resolve for audit use cases.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Cross-Document Fact Alignment Prompt into a production knowledge graph or entity resolution pipeline.

This prompt is a component in a batch processing pipeline, not a real-time chat interface. It expects pre-retrieved document pairs or clusters containing potentially overlapping factual claims. The harness must handle document chunking, pair selection, and output normalization before the aligned facts enter a downstream knowledge graph or entity resolution system. Treat each invocation as a single alignment task for a specific set of claims or entity mentions across a bounded set of documents.

Input Assembly: The harness should construct the [DOCUMENTS] placeholder as a structured list of document objects, each containing doc_id, text (the relevant passage), and optional metadata (publication date, source authority, jurisdiction). For large document collections, pre-filter candidate pairs using embedding similarity or entity co-mention to avoid quadratic pair explosion. The [FOCUS_CLAIMS] placeholder should contain the specific factual statements or entity mentions to align, extracted by an upstream extraction step. Model Selection: Use a model with strong reasoning and structured output capabilities (GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro). For high-throughput pipelines, consider a fine-tuned smaller model if alignment patterns are consistent. Validation: Parse the JSON output immediately. Validate that every aligned_fact has a non-empty source_claims array, that alignment_type is one of the allowed enum values (exact_match, paraphrase, more_specific, more_general, conflict, complementary), and that conflicting facts include a conflict_explanation string. Reject and retry outputs that fail schema validation.

Retry and Fallback Logic: If validation fails, retry with the same input and an appended error message in the [CONSTRAINTS] section specifying the exact validation failure. Limit retries to 2 attempts. If the model consistently fails to align certain fact pairs, log the raw input and output to a review queue for human annotation—these are likely genuinely ambiguous cases that need a canonical resolution rule. Logging and Audit: Log every alignment decision with the input document IDs, the raw model output, the validated output, and any retry attempts. For knowledge graph construction, this log serves as provenance evidence for every edge in the graph. Human Review Routing: Route outputs with alignment_type: "conflict" and confidence below 0.7 to a human review queue. Also route any fact where the model marks requires_human_judgment: true. The review interface should display the source passages side-by-side with the model's proposed alignment and conflict explanation, allowing annotators to confirm, override, or refine the alignment.

Downstream Integration: After validation, transform the alignment output into knowledge graph triples or entity resolution merge/split operations. For exact matches and paraphrases, this typically means merging entity nodes or linking them with an owl:sameAs relationship. For conflicts, create a :conflictsWith edge with the conflict explanation as a property. For complementary facts, link them with a :complements relationship. Eval Harness: Before production deployment, run this prompt against a golden dataset of 200+ document pairs with human-annotated alignments. Measure precision and recall on each alignment type separately—conflict detection often has lower recall than exact match detection. Set acceptance thresholds per alignment type based on the downstream tolerance for missed conflicts versus over-flagged conflicts in your domain.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the strict JSON schema for the Cross-Document Fact Alignment Prompt. Each field must be validated before the output is accepted by downstream knowledge graph or entity resolution pipelines.

Field or ElementType or FormatRequiredValidation Rule

aligned_facts

Array of objects

Must be a non-empty array. If no facts align, return an empty array but do not omit the field.

aligned_facts[].fact_statement

String

Must be a single, atomic, decontextualized factual claim. Cannot be null or an empty string.

aligned_facts[].source_ids

Array of strings

Must contain at least two distinct source identifiers from the provided [SOURCE_MAP]. No duplicates allowed.

aligned_facts[].alignment_type

Enum: exact_match, paraphrase, granularity_shift, synonym_substitution

Must be one of the four specified enum values. Reject any other string.

aligned_facts[].confidence

Number

Must be a float between 0.0 and 1.0 inclusive. A value below [CONFIDENCE_THRESHOLD] should trigger a retry or human review.

aligned_facts[].conflicting_source_ids

Array of strings or null

If null, no conflict detected. If array, must contain source IDs from [SOURCE_MAP] that explicitly contradict this fact. Cannot overlap with source_ids.

unresolved_conflicts

Array of objects

Must be an array. If no conflicts exist, return an empty array. Each object must have claim_a, claim_b, source_id_a, source_id_b, and conflict_type fields.

processing_notes

String or null

If not null, must be a string summarizing alignment decisions, such as why a low-confidence alignment was kept or why a conflict was deemed unresolvable.

PRACTICAL GUARDRAILS

Common Failure Modes

Cross-document fact alignment is brittle when models confuse paraphrasing with contradiction, miss granularity mismatches, or silently drop low-confidence alignments. These cards cover the most frequent failure modes and how to prevent them before they corrupt your knowledge graph or entity resolution pipeline.

01

Paraphrase vs. Contradiction Confusion

What to watch: The model treats synonymous expressions or paraphrased claims as conflicting facts, flooding the output with false-positive contradictions. This happens most often with domain-specific terminology, numerical rounding, or temporal rephrasing. Guardrail: Include explicit paraphrase examples in few-shot prompts and add a pre-alignment deduplication step that normalizes units, dates, and entity names before conflict detection runs.

02

Granularity Mismatch Silently Dropped

What to watch: One source states a fact at a high level ('Company operates in Europe') while another states it at a finer grain ('Company has offices in Paris and Berlin'). The model either marks these as conflicting or ignores the finer-grained source entirely. Guardrail: Add a granularity-awareness instruction that requires the model to classify relationship types: 'same-fact-different-granularity', 'subset-relation', or 'genuine-conflict'. Validate with test cases that mix abstraction levels.

03

Low-Confidence Alignments Omitted Without Flagging

What to watch: When the model is uncertain whether two claims refer to the same underlying fact, it silently drops the alignment rather than surfacing the ambiguity. Downstream systems assume facts are unaligned when they should be treated as uncertain matches. Guardrail: Require a confidence field in the output schema with explicit 'uncertain' values. Add a post-processing rule that routes uncertain alignments to a human review queue rather than discarding them.

04

Entity Resolution Drift Across Documents

What to watch: The model aligns facts correctly but links them to different entity identifiers across documents because entity resolution was done upstream without context. Facts about 'Acme Corp' and 'Acme Corporation' are treated as separate entities. Guardrail: Run entity resolution with co-reference context before fact alignment. Include entity aliases and a canonical ID map in the prompt context so the alignment step inherits resolved identities.

05

Temporal Context Ignored in Alignment

What to watch: Two sources state different values for the same fact (e.g., revenue figures) but the model fails to check timestamps or effective dates. It reports a contradiction when the sources are simply reporting on different time periods. Guardrail: Require temporal context extraction as a prerequisite field before alignment. Add a rule: 'If effective dates differ and values differ, classify as temporal-variance, not contradiction.' Include date comparison logic in the prompt.

06

Alignment Exhaustiveness Failures on Long Documents

What to watch: When documents contain many factual claims, the model aligns the most salient ones but silently skips lower-salience facts, producing incomplete alignment matrices. Downstream consumers assume full coverage. Guardrail: Break long documents into claim-level chunks before alignment. Add an output field for 'claims-without-alignment' that explicitly lists claims the model could not match. Run a coverage check that compares input claim count to aligned claim count.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a labeled dataset of claim pairs with known alignment relationships. Each criterion targets a specific failure mode observed in cross-document fact alignment.

CriterionPass StandardFailure SignalTest Method

Alignment Label Accuracy

F1 score >= 0.85 on alignment label (aligned, conflicting, unrelated) against human-labeled ground truth

Model labels paraphrased claims as conflicting or misses genuine conflicts by labeling them as aligned

Compare model output labels to ground truth labels on a held-out test set of 200+ claim pairs

Paraphrase Detection

Recall >= 0.90 on detecting aligned claims that differ only in wording, synonymy, or sentence structure

Model fails to recognize that two claims express the same fact with different vocabulary

Test against a curated set of 50 paraphrase pairs with known alignment; measure false negative rate

Granularity Handling

Precision >= 0.80 when one claim is a specific instance and the other is a general statement

Model incorrectly labels a specific claim as conflicting with a general claim that subsumes it

Create test pairs where Claim A is a subset of Claim B; verify model outputs aligned or subsumed, not conflicting

Conflict Type Classification

Accuracy >= 0.80 on conflict subtype (direct contradiction, value mismatch, temporal, definitional)

Model detects conflict but assigns wrong subtype, causing downstream resolution logic to fail

Use a labeled set of 100 conflicting claim pairs with known conflict types; measure subtype accuracy

Null Handling

Model correctly outputs null or empty alignment when one or both claims are empty, malformed, or non-factual

Model hallucinates an alignment relationship for empty or nonsensical input

Pass empty strings, whitespace-only strings, and non-claim text; verify null or abstention output

Confidence Calibration

Model confidence score correlates with actual correctness; low-confidence predictions are more likely to be errors

Model assigns high confidence to incorrect alignment labels

Bin predictions by confidence decile; plot expected calibration error (ECE) across bins

Schema Compliance

100% of outputs parse as valid JSON matching the defined output schema with all required fields present

Missing fields, wrong types, or unparseable JSON in model output

Validate every output against the JSON schema; count parse failures and schema violations

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small set of 3–5 document pairs. Remove strict schema requirements initially—let the model output markdown or free text so you can observe alignment behavior. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with default temperature. Focus on whether the model correctly identifies paraphrased agreement vs. genuine conflict.

Prompt modification

Remove [OUTPUT_SCHEMA] and replace with: Output a bulleted list for each fact, noting whether sources agree or conflict.

Watch for

  • Model conflating paraphrased agreement with conflict
  • Missing granularity differences (one source more specific than the other)
  • Over-alignment: model forcing agreement where sources are ambiguous
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.