Inferensys

Prompt

Multi-Model Citation Accuracy Regression Prompt Template

A practical prompt playbook for using Multi-Model Citation Accuracy Regression Prompt Template in production AI workflows.
ML engineer managing model versions on laptop, version history visible, technical Git-like workflow.
PROMPT PLAYBOOK

When to Use This Prompt

Standardize citation faithfulness evaluation into a repeatable regression test before any model migration, provider switch, or RAG pipeline change.

This playbook is for RAG system owners and AI infrastructure teams who need to verify that generated answers remain faithfully grounded in provided source documents across different models. When you change foundation models, upgrade a model version, or switch providers, citation behavior can silently degrade. A model might start attributing claims to the wrong source, invent plausible-sounding references, or drop citations entirely. This prompt template standardizes the evaluation of citation accuracy into a repeatable regression test. It takes a question, a set of retrieved passages, and a generated answer with citations, then produces a structured citation faithfulness report per model.

Use this prompt before any model migration, provider switch, or RAG pipeline change that could affect grounded generation quality. It is designed for teams that already have a working RAG system and need to quantify whether a new model maintains or degrades citation discipline. The prompt works best when you have a curated set of test cases—each containing a question, retrieved passages, and a reference answer with known-good citations—that you can run across your current and candidate models. Do not use this prompt for evaluating retrieval quality itself; it assumes the retrieved passages are already provided and only assesses whether the model's citations faithfully map to those passages. For retrieval evaluation, use a separate retrieval quality prompt from the RAG pillar.

The output is a structured report with a per-claim faithfulness analysis, a citation accuracy score, and categorized error types: unsupported attribution, hallucinated source, missing citation, and correct citation. Wire this into your CI/CD pipeline as a regression gate. If the citation faithfulness score drops below your threshold after a model change, block the migration until you investigate. For high-stakes domains like legal, medical, or financial applications, always include human review of flagged citation errors before accepting the report as final. The prompt includes a [RISK_LEVEL] parameter that adjusts the strictness of the evaluation and whether borderline cases are flagged for human review.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Multi-Model Citation Accuracy Regression Prompt works and where it introduces operational risk.

01

Good Fit: RAG System Migration

Use when: migrating a RAG pipeline to a new foundation model and you need to verify that citation accuracy does not silently degrade. Guardrail: run the prompt against a static golden dataset of source documents and known claim-to-citation mappings before cutting over traffic.

02

Good Fit: Multi-Provider Evaluation

Use when: comparing grounded generation quality across two or more model providers for an RFP or architecture decision. Guardrail: normalize the retrieval step so that all models receive identical context; the prompt measures citation faithfulness, not retrieval quality.

03

Bad Fit: Retrieval Quality Debugging

Avoid when: the root cause of poor citations is the retriever returning irrelevant chunks. This prompt evaluates the generator's use of provided context, not the upstream search pipeline. Guardrail: run a separate retrieval precision/recall eval before blaming the model.

04

Bad Fit: Open-Ended Creative Generation

Avoid when: outputs are not expected to be factually grounded in provided sources. Applying citation accuracy checks to creative or opinion-based tasks produces noisy, unactionable scores. Guardrail: gate the eval with a task classifier; only run citation regression on tasks labeled as grounded QA or summarization.

05

Required Inputs

Risk: incomplete inputs produce misleading scores. Guardrail: ensure every test case includes the source document chunk, the model-generated claim, and the expected citation span. Missing any of these makes the faithfulness score unreliable.

06

Operational Risk: Judge Model Bias

Risk: using a single LLM judge to score citation accuracy can introduce systematic bias, especially if the judge model shares a provider with one of the models under test. Guardrail: cross-validate with a second judge model from a different provider and flag cases where judges disagree by more than a threshold.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready template for evaluating citation faithfulness across multiple models, designed to be wired into a regression testing harness.

This template provides the core instruction set for a multi-model citation accuracy regression test. It is designed to be executed against a golden dataset of question-answer pairs, each grounded in a set of provided source passages. The prompt instructs the model to act as an evaluator, comparing a generated answer against the sources to identify unsupported claims, hallucinated citations, and missing attributions. The output is a structured JSON report, making it suitable for automated comparison across different models or model versions.

text
You are a citation faithfulness evaluator. Your task is to compare a generated answer against the provided source passages and assess the accuracy of its citations.

## INPUT
**Question:** [QUESTION]
**Generated Answer:** [GENERATED_ANSWER]
**Source Passages:**
[SOURCE_PASSAGES]

## EVALUATION CRITERIA
For each claim in the Generated Answer that references a source, determine if the claim is fully supported, partially supported, or contradicted by the cited passage. Also, flag any factual claims that lack a citation and any citations that reference a non-existent source.

## OUTPUT_SCHEMA
Return a single JSON object with the following structure:
{
  "citation_faithfulness_score": <float 0.0 to 1.0>,
  "claims_analysis": [
    {
      "claim_text": "<string>",
      "cited_source_id": "<string or null>",
      "verdict": "<supported|partially_supported|contradicted|no_citation|hallucinated_source>",
      "explanation": "<string>"
    }
  ],
  "overall_assessment": "<string>"
}

## CONSTRAINTS
- Base your evaluation strictly on the provided Source Passages. Do not use outside knowledge.
- If a claim is a direct quote, it must be an exact match to the source text to be considered 'supported'.
- A 'hallucinated_source' verdict means the cited source ID does not exist in the provided passages.
- The 'citation_faithfulness_score' should be the proportion of supported claims out of all claims that should have a citation.

To adapt this template, replace the placeholders with your test data. [QUESTION] and [GENERATED_ANSWER] form the test case, while [SOURCE_PASSAGES] should be a clearly delimited list of text blocks, each with a unique ID. For automated regression testing, iterate this prompt over a golden dataset and execute it against each target model. Compare the citation_faithfulness_score and the distribution of verdicts across models to detect regressions. A drop in the score or an increase in hallucinated_source verdicts on a new model version is a clear failure signal that should block a release.

IMPLEMENTATION TABLE

Prompt Variables

Placeholders required by the Multi-Model Citation Accuracy Regression Prompt Template. Replace each placeholder with concrete values before executing the test run.

PlaceholderPurposeExampleValidation Notes

[MODEL_LIST]

Array of model identifiers to test citation accuracy across

["gpt-4o", "claude-3.5-sonnet", "gemini-2.0-flash"]

Must contain at least 2 model identifiers. Each identifier must match the provider API model name exactly.

[SOURCE_DOCUMENTS]

Ground-truth document set with known, verifiable content used as the retrieval corpus

[{"doc_id": "doc-001", "text": "Q3 revenue was $12.4B, up 8% YoY.", "source": "earnings-press-release.pdf"}]

Each document must have a unique doc_id. Text must be the exact source content. Minimum 5 documents required for meaningful regression.

[TEST_QUESTIONS]

Set of questions designed to probe citation accuracy across the source documents

[{"question_id": "q-001", "question": "What was Q3 revenue?", "relevant_doc_ids": ["doc-001"]}]

Each question must map to at least one relevant_doc_id. Include questions with single-source answers, multi-source synthesis, and questions with no supporting evidence.

[CITATION_SCHEMA]

Expected format for how the model should cite sources in its response

{"format": "inline", "style": "[doc_id]:[span_start]-[span_end]", "required": true}

Schema must define format type, citation style pattern, and whether citations are required. Validate that the schema is parseable by your downstream citation extractor.

[FAITHFULNESS_THRESHOLD]

Minimum acceptable citation faithfulness score per model before flagging a regression

0.85

Value must be a float between 0.0 and 1.0. Scores below this threshold trigger a regression alert. Calibrate against your golden dataset baseline.

[HALLUCINATION_SEVERITY_LEVELS]

Taxonomy for categorizing citation failures by severity

{"critical": "Fabricated source or doc_id", "major": "Claim attributed to wrong document", "minor": "Citation span does not contain the claim"}

Must define at least 3 severity levels. Each level must have a clear, mutually exclusive definition. Used for per-model failure categorization.

[OUTPUT_SCHEMA]

Structured output contract for the regression report

{"model_id": "string", "question_id": "string", "answer": "string", "citations": [{"doc_id": "string", "span": "string", "claim_supported": "boolean"}], "faithfulness_score": "float", "hallucinated_citations": "array", "missing_required_citations": "boolean"}

Schema must be valid JSON Schema or a typed object definition. Every field must have a type. Include fields for both per-question and aggregate results.

[EVAL_JUDGE_CONFIG]

Configuration for the LLM judge that evaluates citation faithfulness

{"model": "gpt-4o", "temperature": 0, "rubric": "citation-faithfulness-v2", "require_span_verification": true}

Judge model should be a high-capability model with temperature set to 0 for deterministic evaluation. Rubric reference must point to a defined evaluation rubric. Span verification should be true for citation accuracy testing.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the multi-model citation accuracy regression prompt into an automated evaluation pipeline with validation, retries, and structured result capture.

This prompt is designed to run inside an automated regression harness, not as a one-off manual check. The typical integration pattern is a Python or TypeScript evaluation runner that iterates over a golden dataset of RAG responses, sends each test case to multiple target models, collects the structured citation accuracy reports, and writes results to a database or CSV for analysis. Each test case should include the original user query, the full retrieved context provided to the model, and the model's generated answer with its inline citations. The harness must track metadata for every run: model identifier, model version, provider, timestamp, prompt template version, and the raw input/output payloads for auditability.

Validation is critical because the prompt's output is a structured JSON report. Implement a post-response validation layer that checks: (1) the response is valid JSON, (2) the citations array contains only citation IDs that exist in the provided context, (3) the claims array is non-empty and each claim references only valid citation IDs, (4) the citation_faithfulness_score is a float between 0.0 and 1.0, and (5) the unsupported_claims and hallucinated_sources arrays are present even if empty. If validation fails, retry the prompt once with the validation error message appended as a [CORRECTION_FEEDBACK] field. If the retry also fails validation, flag the test case as VALIDATION_FAILED and log the raw response for manual inspection. Do not silently accept malformed outputs as zero scores—this masks real model failures.

For model selection, run this prompt against every model in your deployment matrix. At minimum, include your current production model, any candidate upgrade models, and at least one baseline model for comparison. Use the same prompt template, same temperature (recommend 0.0 for reproducibility), and same context window across all models. If a model has a shorter context window, truncate the retrieved context consistently using a documented truncation strategy rather than silently dropping passages, which would invalidate cross-model comparisons. Log any truncation events in the run metadata.

The harness should produce a per-model citation faithfulness score aggregated across the full test suite, plus per-claim accuracy rates. Store results in a structured format that supports trend analysis: model, test_case_id, faithfulness_score, claim_count, supported_claim_count, unsupported_claim_count, hallucinated_source_count, and validation_status. Use these metrics to set regression gates—for example, a model upgrade must not decrease the aggregate faithfulness score by more than 2 percentage points and must not introduce new hallucinated source patterns on previously clean test cases. Wire these gates into your CI/CD pipeline so that model migrations are blocked if citation accuracy regresses.

Human review is required for any test case where the LLM judge's faithfulness assessment conflicts with a known ground-truth label in your golden dataset. If your dataset includes human-verified citation accuracy annotations, automatically flag cases where the model-assigned score deviates from the human label by more than 0.3. These discrepancies often reveal either annotation errors in your dataset or systematic blind spots in the evaluation prompt itself. Schedule a recurring review of flagged cases to improve both the golden dataset and the evaluation rubric over time.

IMPLEMENTATION TABLE

Expected Output Contract

Structured output fields, types, and validation rules for the multi-model citation accuracy regression report. Use this contract to build a parser and validator before running the prompt across models.

Field or ElementType or FormatRequiredValidation Rule

model_id

string

Must match one of the [MODEL_IDS] provided in the prompt input. Non-matching values trigger a schema rejection.

citation_faithfulness_score

number (0.0-1.0)

Must be a float between 0.0 and 1.0 inclusive. Values outside this range or non-numeric types fail validation.

claim_verification_summary

array of objects

Each object must contain 'claim_text' (string), 'cited_source_id' (string or null), 'verdict' (enum: 'supported', 'unsupported', 'contradicted', 'no_citation'), and 'explanation' (string). Array must not be empty.

unsupported_attribution_count

integer

Must be a non-negative integer. Must equal the count of claim_verification_summary entries where verdict is 'unsupported' or 'contradicted'. Mismatch triggers a consistency error.

hallucinated_source_ids

array of strings

Each string must match the pattern of a valid source ID from [SOURCE_ID_FORMAT]. If no hallucinations detected, use an empty array. Null is not allowed.

missing_citation_count

integer

Must be a non-negative integer. Must equal the count of claim_verification_summary entries where 'cited_source_id' is null or verdict is 'no_citation'. Mismatch triggers a consistency error.

model_specific_notes

string or null

If provided, must be a non-empty string. Null is allowed. Used for model-specific behavior observations that don't fit the structured fields.

evaluation_timestamp

string (ISO 8601)

Must be a valid ISO 8601 datetime string. Parse check required. Missing or malformed timestamps fail validation.

PRACTICAL GUARDRAILS

Common Failure Modes

Citation accuracy regressions are among the most dangerous failures in RAG systems because they erode user trust silently. These are the most common failure modes when testing multi-model citation accuracy and how to guard against them.

01

Hallucinated Source Identifiers

What to watch: The model generates plausible-looking but non-existent document titles, URLs, or section numbers to support a claim. This is more common when the retrieved context is sparse or the model is forced to answer. Guardrail: Implement a strict citation schema that requires exact string matching against the provided context IDs. Add a post-generation validator that rejects any citation reference not found in the source list.

02

Mismatched Claim-to-Evidence Pairing

What to watch: The model cites a real source, but the cited passage does not actually support the claim being made. This often happens when the model confuses similar documents or draws inferences beyond what the text states. Guardrail: Run an LLM judge as a second pass that takes each claim-citation pair and verifies entailment. Flag any pair where the evidence does not logically support the claim for human review.

03

Citation Omission Under Confidence Pressure

What to watch: When a model is uncertain or the context is ambiguous, it may drop citations entirely rather than admit uncertainty. The output reads fluently but lacks grounding. Guardrail: Add an explicit instruction in the prompt template requiring a citation for every factual assertion. Use a regex-based post-check to count claims versus citations and flag outputs where the ratio drops below a defined threshold.

04

Cross-Model Citation Style Drift

What to watch: Different models interpret citation formatting instructions differently. One model uses inline brackets, another uses footnotes, and a third embeds markdown links. This breaks downstream parsers that expect a consistent format. Guardrail: Define a strict citation output schema with a JSON structure for citations, including required fields like source_id, quote_snippet, and relevance_score. Validate schema compliance before accepting any model output.

05

Selective Citation Bias

What to watch: The model preferentially cites sources that appear first in the context window or sources with higher retrieval scores, ignoring equally valid later passages. This skews the answer toward recency or retrieval-order bias rather than evidentiary quality. Guardrail: Shuffle the order of retrieved passages across test runs and measure citation distribution entropy. A healthy system should cite across the context window, not just the top results.

06

Over-Citation of Irrelevant Passages

What to watch: The model cites many sources to appear thorough, but several citations point to passages that are tangentially related at best. This creates an illusion of rigor while diluting the signal. Guardrail: Add a relevance threshold to the evaluation rubric. Each citation must pass a binary relevance check: does this specific passage directly support the claim it's attached to? Report a precision score alongside the recall score.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of the multi-model citation accuracy regression prompt before shipping. Each criterion defines a pass standard, a failure signal, and a test method to embed in your CI/CD pipeline.

CriterionPass StandardFailure SignalTest Method

Citation Faithfulness Score

Score >= 0.9 for each model on a golden dataset of 50 grounded claims

Score drops below 0.9 for any model or varies by more than 0.1 between models

Run prompt across golden dataset; compute per-model faithfulness score using an LLM judge calibrated on human-annotated citation pairs

Hallucinated Source Detection

Zero hallucinated sources (fabricated DOIs, URLs, or titles) across all models

Any model generates a source identifier not present in the provided context

Parse output for source fields; cross-reference each source against the input context list using exact and fuzzy matching

Unsupported Attribution Flagging

All claims marked as 'unsupported' are correctly identified when no source passage directly supports them

A claim is marked as 'supported' but the cited passage does not contain the factual basis for the claim

For each claim-citation pair, use a separate NLI model or LLM judge to verify entailment between the cited passage and the claim

Missing Citation Recall

Recall >= 0.95 for identifying claims that lack any citation

A factual claim is present in the output but has no associated citation marker or source reference

Extract all factual claims from output; verify each has a non-null citation field; compute recall against human-annotated claim spans

Cross-Model Score Consistency

Citation faithfulness scores across models have a standard deviation <= 0.05

One model scores > 0.95 while another scores < 0.80 on the same dataset

Compute per-model faithfulness scores; calculate standard deviation; flag if any pairwise difference exceeds 0.15

Output Schema Compliance

All required fields present and correctly typed in every output across all models

Missing [CITATION_FAITHFULNESS_SCORE], malformed [CLAIM_CITATION_PAIRS], or null required fields

Validate each output against the JSON schema; count field-level errors per model; fail if any model has > 0 schema violations

Refusal Boundary Stability

No model refuses to evaluate a valid input that other models process successfully

One model returns a refusal or content policy block while others return a valid evaluation

Include 5 borderline but valid inputs in the test suite; compare refusal rates across models; flag if any model's refusal rate differs by > 20% from the group mean

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with a single model and a small set of 10-15 claim-evidence pairs. Use the base prompt without strict schema enforcement. Focus on getting the citation faithfulness categories right before scaling.

Simplify the output schema to a flat list of claims with supported, unsupported, or partial labels. Skip the per-model comparison matrix and just run one model at a time.

Watch for

  • The model marking unsupported claims as supported because the evidence sounds plausible
  • Citation spans that don't actually map to the claim they're supposed to support
  • Overly generous scoring when the model paraphrases evidence loosely
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.