Inferensys

Prompt

Claim Extraction and Source Mapping Prompt

A practical prompt playbook for extracting discrete factual claims from model output and mapping each to the best supporting source passage, flagging unmapped claims for review.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
PROMPT PLAYBOOK

When to Use This Prompt

Understand when claim extraction and source mapping is the right recovery step and when it adds unnecessary latency or cost.

This prompt is a post-generation audit tool, not a first-pass answer generator. Use it after a model has already produced an answer from retrieved context, and you need to verify that every factual claim in that answer can be traced back to a specific source passage. The primary job-to-be-done is structured accountability: you want a machine-readable report that maps claims to evidence, flags unsupported statements, and identifies coverage gaps before the answer reaches a user or reviewer. The ideal user is an AI engineer or platform developer building a citation recovery harness, a compliance reviewer who needs audit artifacts, or a product manager who must prove grounding quality to stakeholders.

This prompt belongs in post-generation validation pipelines, not in the hot path of a real-time chat experience. It is designed for workflows where latency is acceptable in exchange for thoroughness—think batch processing, nightly compliance checks, or human-in-the-loop review queues. You should not use this prompt when the original answer is already fully cited with inline references, when the evidence set is empty or trivially small, or when the generated text contains no factual claims to audit (e.g., purely conversational or procedural outputs). It is also the wrong tool when you need to fix the answer itself; this prompt only diagnoses grounding, it does not regenerate corrected text.

Before wiring this into production, define what counts as a 'discrete factual claim' for your domain. A claim might be a single numeric value, a relationship between entities, a temporal assertion, or a causal statement. The prompt works best when you provide an explicit output schema that enforces claim boundaries—otherwise, the model may merge multiple facts into one claim or split a single fact into fragments. Pair this prompt with a downstream validation step that checks whether every source passage cited in the mapping actually exists in your evidence set, because the model can hallucinate source references even during an audit task. If your use case is regulated or high-stakes, route unmapped claims to a human reviewer and log the full mapping output as an audit record.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Claim Extraction and Source Mapping Prompt works, where it fails, and the operational preconditions required before integrating it into a production evidence-grounding harness.

01

Good Fit: RAG Output Audit Pipelines

Use when: you have a generated answer and the original retrieved context chunks and need to verify that every factual claim is traceable to a source. Guardrail: run this prompt before the answer reaches the user; treat unmapped claims as blocking defects.

02

Bad Fit: Real-Time Chat Without Retrieval Context

Avoid when: the model is generating freeform conversation without a fixed evidence corpus. Guardrail: this prompt requires a closed set of source passages; without them, it will hallucinate mappings or flag everything as unmapped.

03

Required Inputs: Claims, Sources, and Mapping Schema

What to watch: the prompt needs the original generated text, the retrieved source passages with identifiers, and a clear output schema for claim-source pairs. Guardrail: validate that source IDs are stable and unique before invoking the prompt; duplicate IDs cause mapping ambiguity.

04

Operational Risk: Coverage Gap Blind Spots

What to watch: the prompt may miss claims that are implied rather than stated, or map claims to tangentially related sources. Guardrail: pair this prompt with a coverage gap detection step that flags answers where fewer than 80% of claims are mapped with high confidence.

05

Operational Risk: Source Passage Granularity Mismatch

What to watch: if source passages are too long, the prompt may map a claim to a 2,000-word chunk without specifying the exact sentence. Guardrail: pre-chunk sources into paragraph-level or sentence-level units before extraction; reject mappings that cite entire documents as evidence.

06

Escalation Path: Unmapped Claim Thresholds

What to watch: some answers will always have a few unmappable claims due to retrieval gaps or model synthesis. Guardrail: define a threshold for acceptable unmapped claims per answer; escalate to human review or trigger re-retrieval when the threshold is exceeded.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt that extracts discrete factual claims from model output and maps each to the best supporting source passage, flagging unmapped claims for review.

This prompt template is the core instruction set for a claim extraction and source mapping harness. It takes a block of generated text and a set of source documents, then decomposes the text into atomic factual claims. Each claim is mapped to the most specific supporting passage in the provided sources. Claims that cannot be matched to any source are flagged as unmapped, giving your pipeline a clear signal for coverage gaps, hallucination risk, or retrieval insufficiency. Use this template when you need to verify that every assertion in a generated answer is traceable to evidence before the answer reaches a user or auditor.

text
You are a precise claim extraction and evidence mapping engine. Your job is to decompose a provided text into discrete, verifiable factual claims and map each claim to the best supporting passage from the provided source documents.

## INPUT

**TEXT TO ANALYZE:**
[GENERATED_TEXT]

**SOURCE DOCUMENTS:**
[SOURCE_DOCUMENTS]

## INSTRUCTIONS

1. **Extract Claims:** Break the TEXT TO ANALYZE into the smallest discrete factual claims that can be independently verified. Each claim must be a single, self-contained assertion. Do not combine multiple facts into one claim. Do not include opinions, interpretations, or rhetorical statements unless they assert a verifiable fact.

2. **Map to Sources:** For each extracted claim, search the SOURCE DOCUMENTS for the passage that most directly and specifically supports the claim. The supporting passage must contain the factual content of the claim, not merely related or adjacent information.

3. **Flag Unmapped Claims:** If no source passage adequately supports a claim, mark it as UNMAPPED. Do not stretch or infer support where it does not exist.

4. **Handle Conflicts:** If multiple sources provide conflicting evidence for the same claim, note the conflict and include both passages.

## OUTPUT FORMAT

Return a JSON object with the following structure:

```json
{
  "claims": [
    {
      "claim_id": "C1",
      "claim_text": "The exact factual claim extracted from the text.",
      "status": "MAPPED",
      "source_id": "SOURCE_DOC_ID",
      "supporting_passage": "The verbatim passage from the source that supports this claim.",
      "passage_location": "Section or paragraph identifier within the source.",
      "mapping_confidence": "HIGH",
      "mapping_rationale": "Brief explanation of why this passage supports the claim."
    },
    {
      "claim_id": "C2",
      "claim_text": "Another factual claim.",
      "status": "UNMAPPED",
      "source_id": null,
      "supporting_passage": null,
      "passage_location": null,
      "mapping_confidence": null,
      "mapping_rationale": "No source passage found that supports this claim."
    },
    {
      "claim_id": "C3",
      "claim_text": "A claim with conflicting source evidence.",
      "status": "CONFLICT",
      "source_id": "SOURCE_A, SOURCE_B",
      "supporting_passage": "Passage from Source A that supports the claim. ||| Passage from Source B that contradicts the claim.",
      "passage_location": "Source A Section 2, Source B Paragraph 4",
      "mapping_confidence": "CONFLICT",
      "mapping_rationale": "Source A supports the claim while Source B provides contradictory evidence."
    }
  ],
  "coverage_summary": {
    "total_claims": 0,
    "mapped_claims": 0,
    "unmapped_claims": 0,
    "conflict_claims": 0,
    "coverage_ratio": 0.0
  }
}

CONSTRAINTS

  • Every claim must be a single, independently verifiable fact.
  • Do not fabricate or infer source support. If the evidence is not present, mark the claim as UNMAPPED.
  • Use verbatim source text for supporting passages. Do not paraphrase.
  • If the TEXT TO ANALYZE contains no verifiable factual claims, return an empty claims array with an explanation.
  • Mapping confidence must be one of: HIGH, MEDIUM, LOW. Use MEDIUM when the passage partially supports the claim but requires some inference. Use LOW when the connection is tenuous.
  • [ADDITIONAL_CONSTRAINTS]

Adaptation notes: Replace [GENERATED_TEXT] with the model output you need to verify. Replace [SOURCE_DOCUMENTS] with your retrieved context, including document IDs and passage text. The [ADDITIONAL_CONSTRAINTS] placeholder lets you inject domain-specific rules, such as requiring exact quote boundaries, enforcing a minimum passage length, or adding a confidence threshold for automatic rejection. If your sources are long documents, consider chunking them before insertion and including chunk identifiers in the passage_location field. For high-stakes workflows, route UNMAPPED and CONFLICT claims to a human review queue before the output reaches end users. Run this prompt as a post-generation verification step in your RAG pipeline, not as a replacement for retrieval quality checks.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Claim Extraction and Source Mapping Prompt. Each placeholder must be populated before the prompt is assembled and sent. Validation notes describe how to programmatically verify the input before execution.

PlaceholderPurposeExampleValidation Notes

[MODEL_OUTPUT]

The full generated text to audit for claims and source alignment

The Acme 3000 reduces latency by 40% compared to the previous generation (Source: Acme Performance Whitepaper, p.12).

Must be a non-empty string. Check length > 0. If output was truncated due to token limits, flag with a partial_output warning before extraction.

[SOURCE_DOCUMENTS]

The retrieval corpus or document set that the model was instructed to use

[{"doc_id": "acme_whitepaper_2024", "title": "Acme Performance Whitepaper", "content": "...", "section": "Benchmarks"}]

Must be a valid JSON array of objects. Each object requires doc_id and content fields. Reject if array is empty or any content field is null. Validate JSON parse before prompt assembly.

[EXTRACTION_GRANULARITY]

Controls whether claims are extracted at sentence, clause, or atomic fact level

atomic_fact

Must be one of: sentence, clause, atomic_fact. Default to atomic_fact if not provided. Reject unknown values with a configuration error.

[CONFIDENCE_THRESHOLD]

Minimum confidence score for a claim-to-source mapping to be considered valid

0.7

Must be a float between 0.0 and 1.0. Values below 0.5 produce noisy mappings; values above 0.95 may cause excessive unmapped claims. Validate range and type before use.

[UNMAPPED_CLAIM_ACTION]

Instruction for how to handle claims that cannot be mapped to any source

flag_for_review

Must be one of: flag_for_review, abstain, omit, generate_warning. Default to flag_for_review. Reject unknown values. If set to omit, downstream consumers must be notified that claims were dropped.

[MAX_CLAIMS]

Upper bound on the number of claims to extract to prevent runaway extraction on long outputs

50

Must be a positive integer. Set a hard cap in the harness; if the model output exceeds a token threshold, consider chunking before extraction. Validate as integer > 0.

[OUTPUT_SCHEMA_VERSION]

Schema version identifier for the expected output format to enable migration handling

2.1

Must match a known schema version in the harness registry. If the version is unsupported, reject with a schema_mismatch error and list supported versions. Use string format to allow semver.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Claim Extraction and Source Mapping prompt into a production evidence grounding pipeline.

This prompt is a pre-verification step, not a final answer generator. It should be called after a model produces a draft response and before that response is shown to a user or logged in an audit trail. The harness sends the draft text and the retrieved source passages to the prompt, receives a structured claim-to-source mapping, and then uses that mapping to decide whether to approve, regenerate, or escalate the answer. The prompt itself does not modify the answer; it produces a diagnostic artifact that downstream logic acts on.

Wire the prompt into a validation gateway with three clear paths. If all claims are mapped to a source with a confidence score above your threshold (e.g., 0.8), pass the answer through. If unmapped claims exist but are low-risk boilerplate, route for lightweight human review. If high-severity claims are unmapped or mapped to low-confidence sources, trigger a regeneration loop with stricter evidence constraints, or escalate to a human reviewer with the mapping report attached. Log the full mapping artifact—including claim text, source passage ID, confidence score, and coverage gap flags—as structured metadata alongside the final answer for auditability.

Implement schema validation on the prompt's JSON output before acting on it. The expected schema includes a claims array where each object has claim_text, source_id, confidence, and mapping_status fields. If the model returns malformed JSON, missing required fields, or a claims array that doesn't cover the input text, retry the prompt once with a repair instruction. If the second attempt fails, log the raw output and escalate. Do not silently accept a broken mapping artifact—it defeats the purpose of the grounding check.

For model selection, prefer a model with strong instruction-following and structured output capabilities. This task requires precise extraction and disciplined mapping, not creative generation. If using a model that supports constrained decoding or structured output modes, enforce the claims array schema directly rather than relying on prompt instructions alone. For high-throughput pipelines, consider batching multiple draft answers into a single extraction call, but keep each answer's claims isolated with clear document IDs to prevent cross-contamination.

Build coverage gap detection into the harness, not just the prompt. After receiving the mapping, programmatically compare the set of extracted claims against the set of provided source passages. If the prompt flags gaps but your retrieval system has additional passages it didn't send, trigger a targeted re-retrieval for those specific gaps before regenerating. If gaps persist after re-retrieval, the harness should force an abstention or explicit uncertainty disclosure in the final answer. Never let an answer with known evidence gaps reach the user without a clear signal.

Finally, treat this prompt as a drift detector. Over time, track the rate of unmapped claims, low-confidence mappings, and coverage gaps. A rising trend often signals retrieval degradation, prompt drift in the answer generator, or source corpus staleness. Wire the mapping metrics into your observability stack alongside answer quality scores so that grounding failures surface before users report them.

IMPLEMENTATION TABLE

Expected Output Contract

Define the exact shape, types, and validation rules for the model response when extracting claims and mapping them to source passages. Use this contract to build a parser and validator before integrating the prompt into a pipeline.

Field or ElementType or FormatRequiredValidation Rule

claims

Array of objects

Must be a non-empty JSON array. If no claims are extractable, return an empty array, not null.

claims[].claim_id

String

Must be a unique identifier within the response, formatted as 'claim-<index>' starting from 1.

claims[].claim_text

String

Must be a non-empty string representing a single, discrete factual assertion extracted from the model output.

claims[].source_passage_id

String or null

Must be a valid ID from the provided [SOURCE_PASSAGES] list, or null if no supporting passage is found.

claims[].source_quote

String or null

If source_passage_id is not null, this must be a verbatim substring from the corresponding source passage. If null, this field must be null.

claims[].mapping_confidence

Number

Must be a float between 0.0 and 1.0. A value of 0.0 is only valid when source_passage_id is null.

unmapped_claims

Array of strings

Must be a JSON array of claim_id strings for all claims where source_passage_id is null. Used for coverage gap detection.

coverage_score

Number

Must be a float between 0.0 and 1.0, calculated as (total_claims - len(unmapped_claims)) / total_claims. If total_claims is 0, score must be 1.0.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when extracting claims and mapping them to sources, and how to guard against it.

01

Phantom Citations

What to watch: The model fabricates source references or maps claims to passages that don't contain the asserted fact. This is the most dangerous failure mode because it creates false confidence in unsupported output. Guardrail: Implement a provenance verification step that checks each mapped passage for the exact claim text. Flag any claim where the source passage cannot be independently verified to contain the assertion.

02

Over-Stretching Source Meaning

What to watch: The model maps a claim to a source that is tangentially related but doesn't actually support the specific assertion. A passage about 'increased revenue' gets cited for a claim about 'record profits.' Guardrail: Add an alignment distance check that requires the source passage to contain the core entities and predicates of the claim. Score alignment on a scale and flag low-confidence mappings for human review.

03

Coverage Gap Blindness

What to watch: The model fails to detect that some claims have no supporting source at all, leaving them unmapped and unflagged. The output looks complete but contains orphan claims. Guardrail: Require a mandatory coverage report that explicitly lists every extracted claim and its mapping status. Any claim without a source must be surfaced as an uncovered gap, not silently omitted.

04

Claim Fragmentation Drift

What to watch: When extracting discrete claims, the model fragments a single supported assertion into multiple sub-claims, some of which lose their evidential anchor. The mapping becomes incomplete because the extraction step broke the fact-to-source relationship. Guardrail: Preserve the original sentence or paragraph context with each extracted claim. Validate that the full claim set can be reconstructed from the mapped sources without introducing new assertions.

05

Source Boundary Confusion

What to watch: The model maps a claim to the correct document but the wrong passage, or to a passage that spans a document boundary incorrectly. This is common with chunked retrieval where passage boundaries are arbitrary. Guardrail: Include passage boundary markers in the source material and require the mapping to specify exact start and end positions. Validate that the mapped span is contiguous and within a single source unit.

06

Confidence Inflation on Weak Matches

What to watch: The model assigns high confidence to source mappings that are semantically weak or rely on inference rather than direct evidence. The mapping looks valid but wouldn't survive audit. Guardrail: Require a confidence score for each claim-to-source mapping with explicit criteria: direct quote match, paraphrase match, inference required, or no match. Set a threshold below which mappings are flagged for human review rather than accepted.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to evaluate the quality of the claim extraction and source mapping output before integrating it into a production pipeline. Each criterion includes a concrete pass standard, a failure signal to watch for, and a test method that can be automated.

CriterionPass StandardFailure SignalTest Method

Claim Completeness

All discrete factual assertions from [INPUT_TEXT] are extracted as separate claim objects

A verifiable fact in the source text is missing from the extracted claims array

Human review of a 20-sample golden set; automated count comparison against a reference extraction

Source Mapping Accuracy

Every mapped claim has a [SOURCE_ID] that contains the exact supporting passage; no stretched attributions

A claim is mapped to a source that does not contain the supporting evidence or only partially supports it

Automated semantic similarity check between the claim text and the cited source passage; flag if similarity < 0.7

Unmapped Claim Flagging

Claims with no supporting source in [SOURCE_LIST] are placed in the unmapped_claims array with a null source_id

A claim with no evidence is incorrectly assigned a source_id or is omitted entirely from the output

Schema validation: assert unmapped_claims exists and contains all claims where source_id is null

Coverage Gap Detection

The coverage_gaps array lists specific topics or questions from [INPUT_TEXT] that have zero supporting sources

A clear question from the input is answered with claims but no coverage gap is reported when sources are absent

Check that for every question in the input, either a mapped claim exists or a corresponding coverage gap is logged

Output Schema Validity

The output is valid JSON that strictly conforms to [OUTPUT_SCHEMA] with all required fields present

JSON parsing fails, required fields like claim_id or source_id are missing, or data types are incorrect

Automated JSON Schema validation in the application harness; fail the response on any schema violation

Claim Atomicity

Each claim object contains exactly one verifiable fact; no compound claims with multiple assertions

A single claim string contains multiple facts joined by 'and' or 'but' that could be verified independently

Automated check for coordinating conjunctions splitting claims; manual spot-check on a 10% sample of outputs

Source Passage Fidelity

The source_text field in each mapping is a verbatim quote from the source, not a paraphrase or summary

The source_text field contains text that does not appear in the original source document

Automated substring match against the source document; flag any mapping where the quoted text is not found

Confidence Scoring Consistency

Each mapping has a confidence score between 0.0 and 1.0 that correlates with the strength of the evidence match

High-confidence scores (e.g., 0.9) are assigned to claims with weak or tangential source support

Calibration check: compare confidence scores against human ratings on a 50-pair sample; acceptable if rank correlation > 0.8

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single model call and manual review of the output JSON. Skip strict schema enforcement in code—just paste the prompt into a playground or early harness. Focus on whether claims are correctly identified and mapped, not on edge-case coverage.

Prompt modification

  • Remove or comment out the [OUTPUT_SCHEMA] constraint and ask for free-text claim-to-source pairs first.
  • Replace [CONFIDENCE_THRESHOLD] with a simple instruction: "Flag any claim you're unsure about."
  • Use a smaller [CONTEXT] window with 2–3 source passages instead of a full retrieval set.

Watch for

  • Claims that are paraphrases rather than discrete factual assertions
  • Source mappings that point to the wrong passage number
  • Unmapped claims silently dropped instead of flagged
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.