Inferensys

Prompt

Claim Deduplication and Near-Duplicate Merging Prompt

A practical prompt playbook for using Claim Deduplication and Near-Duplicate Merging 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

Define the job, the user, and the operational constraints for claim deduplication before evidence matching.

This prompt is designed for verification engineers and AI pipeline builders who need to reduce redundant claims before evidence matching to control pipeline costs and prevent duplicate work. The job-to-be-done is taking a batch of extracted claims—often from multiple documents or extraction runs—and producing a deduplicated set where semantically equivalent or near-duplicate claims are merged into a single canonical representation. The ideal user is someone operating a production verification pipeline who understands that downstream fact-checking accuracy depends on clean, non-redundant claim sets, and who needs merge provenance tracking to maintain audit trails back to original source claims.

Use this prompt when you have already extracted atomic claims from source content and need to collapse duplicates before sending them to evidence retrieval or human review. The prompt expects a structured input of claims with unique IDs, claim text, and source provenance. It outputs a deduplicated claim set with merge groups, canonical claim text, and provenance arrays showing which original claims were merged. Do not use this prompt when claims are still embedded in source documents (use an extraction prompt first), when you need to verify claims against evidence (this is a pre-verification cleanup step), or when claims contain domain-specific terminology that requires specialized equivalence rules not captured in the general deduplication criteria. The prompt is also inappropriate for merging claims that are related but semantically distinct—false merges that collapse different factual assertions will silently drop verifiable claims from your pipeline.

Before deploying this prompt, define your deduplication tolerance. Near-duplicate merging requires a judgment call about what counts as 'the same claim.' Two claims might assert the same fact with different wording, different granularity, or different numerical precision. Your prompt constraints should specify whether claims with different dates, different numerical values, or different attribution sources should be treated as duplicates or kept separate. Always implement eval checks for false merges—cases where the prompt collapses semantically distinct claims—and false duplicates—cases where it keeps separate claims that should have been merged. These evals should run against a golden dataset of claim pairs with known merge/don't-merge labels before the prompt enters production. For high-stakes verification pipelines, route merge decisions with low confidence scores to human review.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works in a production verification pipeline and where it introduces unacceptable risk.

01

Good Fit: Pre-Evidence Retrieval Deduplication

Use when: you have a large batch of extracted claims and need to reduce redundant queries before sending them to an evidence retrieval or matching service. Guardrail: Run deduplication strictly before evidence matching to avoid merging claims that are factually similar but supported by different sources.

02

Bad Fit: Final Truth Determination

Avoid when: the goal is to determine if a claim is true or false. This prompt merges semantically similar claims; it does not verify them. Guardrail: Keep deduplication as a cost-control step in the pipeline. Verification must happen downstream on the deduplicated set with full evidence grounding.

03

Required Inputs

What you need: a structured list of atomic claims, each with a unique claim_id and the original claim_text. Guardrail: Never feed raw, unstructured documents directly into this prompt. Claims must be extracted and decomposed first to prevent the model from hallucinating merge candidates from narrative text.

04

Operational Risk: False Merges

What to watch: the model collapsing claims that share keywords but differ in entity, timeframe, or numerical value (e.g., 'Revenue grew 10% in Q1' vs. 'Revenue grew 10% in Q2'). Guardrail: Implement a post-merge validation step that flags merges where key entities or temporal expressions differ, routing them for human review.

05

Operational Risk: Provenance Loss

What to watch: losing track of which original claim IDs were merged into a single representative claim, breaking downstream audit trails. Guardrail: Require the output schema to include a merged_claim_ids array for every deduplicated claim. Reject any output that drops this field.

06

Cost vs. Accuracy Trade-off

What to watch: aggressive deduplication that reduces evidence-matching API costs but introduces false merges that hide contradictory evidence. Guardrail: Set a conservative similarity threshold in the prompt instructions and use a model-graded eval on a golden set to measure the false-merge rate before scaling up.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for deduplicating and merging near-duplicate claims with merge provenance tracking.

This prompt template is designed to take a list of extracted claims and identify which ones are duplicates or near-duplicates, then merge them into a canonical set. It is intended for verification pipeline engineers who need to reduce redundant claims before evidence matching to control API costs and prevent duplicate work. The template uses square-bracket placeholders that you must replace with your actual inputs, output schema, constraints, and examples before use. The prompt instructs the model to produce a deduplicated claim set where each merged claim retains a list of its source claim IDs, enabling full provenance tracking.

text
You are a claim deduplication engine. Your task is to analyze a list of claims and identify duplicates and near-duplicates. Two claims are near-duplicates if they assert the same factual proposition, even if they use different wording, different granularity, or different sentence structures. Claims that are semantically distinct must NOT be merged, even if they share a topic.

[INPUT]

[EXAMPLES]

[OUTPUT_SCHEMA]

[CONSTRAINTS]

[RISK_LEVEL]

To adapt this template, replace each placeholder with concrete content. [INPUT] should contain the list of claims, each with a unique ID and the claim text. [EXAMPLES] should provide 2-4 few-shot examples showing correct deduplication decisions, including both merge and non-merge cases. [OUTPUT_SCHEMA] must specify the exact JSON structure you expect, including fields for the canonical claim text, a list of merged source claim IDs, and a confidence score for each merge decision. [CONSTRAINTS] should define rules such as 'never merge claims that differ in numerical values' or 'preserve the most specific wording when merging.' [RISK_LEVEL] should be set to high for regulated domains, which will instruct the model to flag uncertain merges for human review rather than silently merging them. After copying the template, test it against a golden dataset of known duplicates and distinct claims to calibrate merge behavior before production use.

IMPLEMENTATION TABLE

Prompt Variables

Inputs required for the claim deduplication and near-duplicate merging prompt to produce reliable, traceable results.

PlaceholderPurposeExampleValidation Notes

[CLAIM_LIST]

The complete set of extracted claims to deduplicate, each with a unique claim ID and full text.

{"claims": [{"id": "c1", "text": "Revenue grew 15% in Q3."}, {"id": "c2", "text": "Q3 revenue increased by 15%."}]}

Must be valid JSON array. Each object requires 'id' and 'text' fields. Reject if empty or contains duplicate IDs.

[MERGE_THRESHOLD]

The semantic similarity score above which two claims are considered candidates for merging.

0.85

Must be a float between 0.0 and 1.0. Values below 0.70 risk false merges; values above 0.95 risk under-merging. Log threshold in audit trail.

[OUTPUT_SCHEMA]

The exact JSON schema the merged output must conform to, including merge provenance fields.

{"type": "object", "properties": {"merged_claims": {"type": "array"}, "merge_log": {"type": "array"}}}

Validate output against this schema post-generation. Schema must require 'merged_claims', 'merge_log', and 'discarded_claim_ids' arrays.

[DOMAIN_CONTEXT]

Optional domain or subject matter context to disambiguate claims that are lexically similar but semantically distinct in a specific field.

"Financial earnings reports, Q3 FY2024"

Null allowed. If provided, must be a non-empty string. Use to prevent false merges of domain-specific terms (e.g., 'margin' in finance vs. manufacturing).

[CONSTRAINTS]

Hard rules for the deduplication process, such as preserving the most specific claim or never merging claims from different sources.

"Never merge claims from different source documents. Preserve the claim with the most specific numerical value."

Must be a non-empty string. Each constraint should be testable. Log any constraint violations in the merge log.

[MAX_RETURN_CLAIMS]

The maximum number of deduplicated claims to return, used to control token costs in downstream evidence matching.

50

Must be a positive integer. If input claims exceed this after deduplication, prioritize by claim specificity or user-defined salience score. Warn if truncation occurs.

[CONFIDENCE_THRESHOLD]

The minimum confidence score a merge decision must have to be applied automatically. Merges below this threshold are flagged for human review.

0.90

Must be a float between 0.0 and 1.0. Merges with confidence below this value must appear in a 'review_required' array in the output, not applied silently.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the claim deduplication prompt into a production verification pipeline with validation, retries, and human review gates.

The claim deduplication prompt is designed to sit between claim extraction and evidence matching in a verification pipeline. Its job is to reduce redundant claims before they hit expensive retrieval and LLM-based verification steps. The harness must accept a batch of extracted claims (typically as a JSON array of claim objects with IDs, text, and source provenance), pass them through the deduplication prompt, and produce a deduplicated claim set with merge provenance tracking. The prompt is not a real-time user-facing component—it runs as a batch processing step where latency tolerance is higher but correctness is critical because false merges silently drop semantically distinct claims from downstream verification.

Input assembly starts by constructing the prompt with the [INPUT_CLAIMS] placeholder populated from the upstream claim extraction output. Each claim must carry a stable claim_id, the claim_text, and any source context fields needed for deduplication reasoning. The [SIMILARITY_THRESHOLD] placeholder should be set based on your tolerance for false merges—start at 0.85 for high-recall deduplication and lower only after evaluating merge quality on a labeled dataset. The [DOMAIN_CONTEXT] placeholder should describe the subject domain (e.g., 'clinical trial results', 'financial earnings reports') to help the model distinguish domain-specific near-duplicates from genuinely distinct claims. Model choice matters: use a model with strong semantic comparison capabilities (GPT-4o, Claude 3.5 Sonnet, or equivalent). Smaller models often struggle with the nuanced boundary between near-duplicate and semantically distinct claims, leading to higher false-merge rates.

Output validation is the most critical harness component. The prompt outputs a JSON object with a deduplicated_claims array and a merge_log array. Before accepting the output, validate that: (1) every claim_id in the input appears exactly once across the deduplicated set and merge log combined—missing claims indicate silent drops; (2) merge log entries reference only valid input claim_id values; (3) the merged_claim_text in each deduplicated entry preserves all factual content from its source claims without introducing new assertions; (4) the merge_rationale field is non-empty and explains the semantic overlap. Implement a schema validator (Pydantic, Zod, or JSON Schema) that rejects malformed outputs and triggers a retry. For high-stakes pipelines, add a semantic drift check: embed both the original claims in a merge group and the merged output, compute cosine similarity, and flag groups below 0.9 for human review.

Retry and fallback logic should handle three failure modes. First, schema validation failures: retry up to two times with the validation error message appended to the prompt as feedback. Second, incomplete coverage: if the output doesn't account for all input claim IDs, retry with an explicit instruction listing the missing IDs. Third, low-confidence merges: if the model's self-reported confidence (if you include a [CONFIDENCE_THRESHOLD] constraint) falls below your threshold, route those specific claim groups to a human review queue rather than retrying. Human review integration is essential for any merge where the model's confidence is below 0.9 or where the semantic drift check flags a potential issue. Package the original claims, the proposed merged claim, and the merge rationale into a review task. Track reviewer decisions (accept merge, reject merge, split claims) to build an eval dataset for prompt improvement.

Logging and observability should capture: input claim count, output deduplicated count, merge group sizes, retry count, validation failures, and human review outcomes. Log the full prompt and response for any retry or human review event. This data feeds into eval runs where you compare deduplication decisions against a golden dataset of known duplicates and known distinct pairs. Key metrics: false merge rate (distinct claims incorrectly merged), false split rate (duplicates incorrectly kept separate), and merge provenance accuracy (whether the merge log correctly traces which claims were combined). Run these evals on every prompt change before deployment. Cost control is the primary motivation for this step—track the claim reduction ratio (deduplicated count / input count) and compare against the cost of running evidence matching on the full claim set to confirm the deduplication step is paying for itself.

What to avoid: Do not run deduplication on claims from different source documents unless you have a cross-document deduplication requirement—the risk of false merges increases significantly when claims lack shared context. Do not skip the merge log validation; silent claim loss is the most dangerous failure mode because it removes claims from the verification pipeline without any audit trail. Do not treat the model's merge decisions as authoritative without human spot-checking, especially in regulated domains where missed claims have compliance implications. Start with a conservative similarity threshold, build an eval dataset from production decisions, and only relax thresholds after you have measured false merge rates against ground truth.

IMPLEMENTATION TABLE

Expected Output Contract

Schema and validation rules for the deduplicated claim set. Use this contract to validate the model's output before merging claims into downstream evidence matching pipelines.

Field or ElementType or FormatRequiredValidation Rule

deduplicated_claims

array of objects

Array length must be less than or equal to input claim count. Empty array allowed only if input was empty.

deduplicated_claims[].claim_id

string

UUID v4 format. Must be unique within the array. No reuse of input claim IDs unless the claim is a retained original.

deduplicated_claims[].claim_text

string

Non-empty string. Must be a self-contained factual assertion. No markdown or formatting artifacts.

deduplicated_claims[].source_claim_ids

array of strings

Array of input claim IDs that were merged into this claim. Minimum 1 entry. All IDs must reference claims present in the input.

deduplicated_claims[].merge_type

string

One of: 'exact_duplicate', 'near_duplicate', 'subsumed', 'retained_original'. 'retained_original' requires source_claim_ids length of exactly 1.

deduplicated_claims[].merge_rationale

string

Brief explanation of why claims were merged. Must cite specific semantic overlap. Required for all merge types except 'retained_original'.

deduplicated_claims[].representative_claim_id

string

The input claim ID whose text was closest to the final merged claim_text. Must be present in source_claim_ids.

deduplicated_claims[].confidence

number

Float between 0.0 and 1.0. Represents model confidence in the merge decision. Values below 0.7 should trigger human review routing.

PRACTICAL GUARDRAILS

Common Failure Modes

Deduplication prompts fail silently and expensively. A false merge drops a distinct claim from the verification pipeline. A false duplicate wastes compute on redundant evidence retrieval. These failure modes and guardrails help you catch both before they reach production.

01

False Merges of Semantically Distinct Claims

What to watch: The prompt collapses two claims that share surface-level keywords but assert different facts—for example, 'Company X reported Q3 revenue of $2.1B' and 'Company X reported Q4 revenue of $2.1B' merged into one claim, losing the temporal distinction. Guardrail: Include a semantic-difference check in the prompt that requires the model to articulate why two claims differ before merging them. Add an eval that measures false-merge rate on a golden set of near-duplicate pairs with known distinctions.

02

Over-Aggressive Normalization Destroying Meaning

What to watch: Numeric rounding, unit conversion, or entity normalization strips qualifiers that change claim truth value—for instance, normalizing 'approximately 10,000 units' to '10,000 units' removes the tolerance that makes the claim verifiable. Guardrail: Require the prompt to preserve original qualifiers, tolerances, and hedging language in the merged claim output. Add a normalization-fidelity eval that checks whether merged claims retain all original modifiers.

03

Provenance Chain Collapse During Merging

What to watch: The merged claim retains only one source reference, dropping the other source locations that independently support or contradict the claim. Downstream evidence matching then operates on incomplete provenance. Guardrail: Require the output schema to include a merge-provenance array that lists every source claim ID, document, and location that contributed to the merged claim. Validate provenance completeness in eval.

04

Threshold Sensitivity Causing Inconsistent Deduplication

What to watch: Small changes in similarity threshold or prompt wording cause the same claim pair to be merged in one run and kept separate in another, creating non-deterministic pipeline behavior. Guardrail: Pin the similarity criteria in the prompt with explicit rules and examples rather than relying on the model's implicit judgment. Run the deduplication prompt multiple times on the same input set and measure merge-decision stability as an eval metric.

05

Silent Dropping of Low-Confidence Claims

What to watch: The prompt treats a claim it cannot confidently classify as duplicate or distinct as noise and omits it from the output entirely, rather than flagging it for human review. Guardrail: Add an explicit 'uncertain' classification path in the prompt with a required confidence score. Route uncertain claims to a human review queue rather than dropping them. Include a recall eval that measures what fraction of input claims appear in the output.

06

Batch Boundary Artifacts in Large Claim Sets

What to watch: When processing claims in batches due to context window limits, near-duplicates that span batch boundaries are never compared and remain as duplicates in the final output. Guardrail: Implement a two-pass architecture: first-pass intra-batch deduplication, second-pass cross-batch deduplication with a sliding window of claims from adjacent batches. Add a cross-batch duplicate detection eval that specifically tests claim pairs split across batch boundaries.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the deduplication prompt before shipping. Each criterion targets a known failure mode in claim merging. Run these checks against a golden set of 20-30 claim pairs that include exact duplicates, near-duplicates, semantically distinct but lexically similar claims, and edge cases.

CriterionPass StandardFailure SignalTest Method

Exact Duplicate Detection

All claims with identical text and source are merged into a single claim with a merge provenance list.

Duplicate claims remain as separate entries in the output set.

Inject 5 pairs of identical claims from the same source. Assert output count decreases by exactly 5 and each merged claim lists both original claim IDs.

Near-Duplicate Merging (Paraphrase)

Claims expressing the same fact with different wording are merged. The representative claim preserves the most precise or complete phrasing.

Semantically equivalent claims remain unmerged, or the representative claim loses critical qualifiers from one of the originals.

Inject pairs like 'Revenue grew 12%' and 'Revenue increased by 12 percent'. Assert merge occurs and the representative claim retains the numerical value and unit.

False Merge Prevention (Semantic Distinction)

Claims that are lexically similar but semantically distinct are NOT merged.

Claims with different subjects, objects, numerical values, or temporal scopes are incorrectly collapsed.

Inject pairs like 'Revenue grew 12% in Q1' and 'Revenue grew 12% in Q2'. Assert these remain separate claims. Check that no merge provenance is created.

Numerical Precision Preservation

Merged claims retain the most precise numerical value from the source set. No rounding or truncation occurs.

A precise value like 12.4% is replaced by a less precise value like 12% from a different source claim.

Inject claims with varying precision: '12.4%' and '12%'. Assert the representative claim uses 12.4% and the merge notes document the precision difference.

Merge Provenance Tracking

Every merged claim includes a complete, auditable list of all source claim IDs that were collapsed into it.

A merged claim is missing one or more source claim IDs, or the provenance field is null or empty.

After merging a set of 3 near-duplicate claims, assert the output claim's [MERGE_SOURCE_IDS] field contains exactly 3 IDs and they match the input claim IDs.

Context Window Preservation

The merged claim's context attachment includes the union of non-redundant context from all source claims.

Context from one of the merged claims is dropped, altering the meaning or losing a qualifier present only in that source.

Inject claims where one has a crucial context qualifier like 'according to the unaudited report'. Assert the merged claim's [CONTEXT] field includes this qualifier.

Confidence Score Recalculation

The merged claim's confidence score reflects the increased corroboration from multiple sources, not a simple average.

The output confidence score is lower than the highest individual source confidence, or is an unweighted average that dilutes strong evidence.

Inject two claims with confidence 0.9 and 0.8. Assert the merged confidence is >= 0.9. Check that the merge rationale explains the upward adjustment.

Edge Case: Negation Handling

A claim and its negation are NEVER merged. They are flagged as a contradiction for downstream resolution.

A claim like 'The system is secure' and 'The system is not secure' are merged, losing the contradiction signal.

Inject a positive and negated claim pair. Assert they remain separate and the output includes a contradiction flag or separate entries with a cross-reference note.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small claim set (10-20 claims). Remove strict output schema requirements initially. Use a simple JSON array of claim objects with claim_id, claim_text, and merged_into_id fields. Run interactively in a playground to observe merge behavior before wiring into a pipeline.

Add a lightweight instruction: If uncertain whether two claims are truly identical, keep them separate and flag with "review_needed": true.

Watch for

  • Over-merging semantically distinct claims that share keywords but differ in scope, attribution, or temporal context
  • Missing merge provenance: the prompt should always explain why two claims were merged
  • Silent drops: claims that disappear from output without appearing in any merge group
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.