This prompt is for content verification teams and evaluation engineers who need to determine which of two AI-generated outputs is more factually accurate when compared against a known reference or source material. The job-to-be-done is not to judge style, tone, or helpfulness in a vacuum, but to produce a structured, evidence-linked preference based on claim-level accuracy, error severity, and the quality of any corrections present. The ideal user is someone running a champion-challenger test for a RAG pipeline, auditing a summarization model against source documents, or curating preference data for fine-tuning where factual reliability is the primary axis of improvement.
Prompt
Side-by-Side Factual Accuracy Comparison Prompt

When to Use This Prompt
Defines the job, ideal user, and operational constraints for the Side-by-Side Factual Accuracy Comparison Prompt.
Use this prompt when you have a single, authoritative reference text and two candidate outputs that should be grounded in that reference. The prompt requires you to supply the reference material, the two outputs, and a defined output schema that captures the preference verdict, a justification, a list of factual errors with severity ratings, and explicit links to the evidence in the source. Do not use this prompt when the reference material is absent, when the outputs are creative or subjective (e.g., marketing copy, poetry), or when you are comparing stylistic elements without a factual ground truth. In those cases, a general pairwise preference prompt or a tone-and-style comparison prompt is more appropriate.
The primary constraint is that this prompt performs a verification task, not a generation task. It assumes the reference is correct and complete. If the reference itself contains errors, the comparison will be systematically flawed. Before wiring this into an automated evaluation pipeline, you must validate that your reference data is accurate and that both candidate outputs are intended to be grounded in it. For high-stakes domains such as healthcare, legal, or finance, always route outputs flagged with high-severity errors for human review, and log the evidence links for auditability. The next step is to copy the prompt template, replace the placeholders with your reference and outputs, and run it against a small set of known cases to calibrate the judge's severity before scaling to production.
Use Case Fit
Where the Side-by-Side Factual Accuracy Comparison Prompt delivers reliable, evidence-backed preferences—and where it introduces risk. Use these cards to decide if this prompt fits your evaluation pipeline before you wire it into production.
Good Fit: Ground-Truth Verification
Use when: You have a known reference document, golden dataset, or authoritative source against which both outputs can be fact-checked claim by claim. Why it works: The prompt excels at extracting discrete claims, linking each to evidence, and flagging unsupported statements. This produces a defensible, auditable preference based on factual correctness rather than stylistic preference.
Bad Fit: Subjective Quality or Creative Writing
Avoid when: The task is evaluating prose style, narrative engagement, brand voice, or creative merit without a factual anchor. Risk: The prompt will force a factuality lens onto subjective work, penalizing stylistic choices as 'unsupported claims' and producing misleading preference verdicts. Use a tone-and-style pairwise prompt instead.
Required Inputs: Evidence and Source Mapping
What you must provide: Two outputs to compare, plus a single shared reference text or structured evidence set that contains the ground truth. Guardrail: The prompt requires explicit evidence linking—every claim must be traceable to a source passage. If your reference data is fragmented, conflicting, or missing, the comparison will degrade into low-confidence ties or hallucinated justifications.
Operational Risk: Evidence Drift and Staleness
What to watch: The reference evidence used for comparison can become stale, incomplete, or contradicted by newer information that one of the outputs correctly incorporates. Guardrail: Version your evidence sets alongside your prompts. Run periodic evidence-freshness checks and flag comparisons where the reference data is older than a defined threshold. Stale evidence produces false 'hallucination' flags against outputs that are actually more current.
Operational Risk: Claim Extraction Fragility
What to watch: The prompt's accuracy depends on correctly extracting all factual claims from both outputs before comparison begins. Missing a claim means missing a potential error. Guardrail: Implement a claim-recall check—spot-check whether the prompt extracted every verifiable statement. For high-stakes use cases, run a separate claim extraction step and feed the claim list into the comparison prompt rather than relying on inline extraction.
Not a Replacement for Human Review in Regulated Domains
What to watch: In healthcare, legal, financial, or safety-critical contexts, an LLM judge comparing factual accuracy is an accelerator, not an approver. Guardrail: Route all comparisons in regulated workflows through a human review queue. The prompt's preference and error-severity ratings should populate a review dashboard, not trigger automated decisions. Log every verdict with the evidence links for auditability.
Copy-Ready Prompt Template
A reusable prompt template for comparing two outputs against reference facts and producing a structured preference verdict with evidence linking.
This template is designed for content verification teams who need to compare two AI-generated outputs against known facts or reference data. The prompt forces the model to evaluate each output at the claim level, link claims to evidence, assess error severity, and produce a justified preference. Use this when you have authoritative reference material and need a traceable, auditable comparison rather than a subjective quality judgment.
textYou are a factual accuracy evaluator. Your task is to compare two outputs against provided reference facts and determine which output is more factually accurate. ## REFERENCE FACTS [REFERENCE_FACTS] ## OUTPUT A [OUTPUT_A] ## OUTPUT B [OUTPUT_B] ## EVALUATION CRITERIA [EVALUATION_CRITERIA] ## INSTRUCTIONS 1. Extract every factual claim from Output A and Output B separately. 2. For each claim, determine whether the reference facts support it, contradict it, or provide no evidence either way. 3. Classify each contradiction by severity: - CRITICAL: Reverses a key fact, introduces dangerous misinformation, or materially changes the meaning. - MAJOR: States a wrong value, date, name, or figure that changes the factual record. - MINOR: Imprecise wording, rounding errors, or omissions that do not change the core meaning. 4. For supported claims, cite the specific reference fact that supports them. 5. For contradicted claims, cite the specific reference fact that contradicts them. 6. For claims with no evidence, mark them as UNSUPPORTED and explain why the reference facts are silent. 7. Do not penalize an output for including true information that the other output omitted, unless the omitted information was explicitly required by [EVALUATION_CRITERIA]. 8. Do not penalize stylistic differences, word choice, or formatting unless they introduce factual errors. ## OUTPUT FORMAT Return a JSON object with this exact structure: { "output_a_claims": [ { "claim": "exact claim text", "verdict": "SUPPORTED|CONTRADICTED|UNSUPPORTED", "severity": "CRITICAL|MAJOR|MINOR|null", "evidence_reference": "specific reference fact or null", "explanation": "brief explanation" } ], "output_b_claims": [ { "claim": "exact claim text", "verdict": "SUPPORTED|CONTRADICTED|UNSUPPORTED", "severity": "CRITICAL|MAJOR|MINOR|null", "evidence_reference": "specific reference fact or null", "explanation": "brief explanation" } ], "comparison_summary": { "output_a_contradictions": {"critical": 0, "major": 0, "minor": 0}, "output_b_contradictions": {"critical": 0, "major": 0, "minor": 0}, "output_a_unsupported": 0, "output_b_unsupported": 0 }, "preference": "OUTPUT_A|OUTPUT_B|TIE", "preference_justification": "explain why one output is preferred based on factual accuracy, not style or completeness", "confidence": 0.0_to_1.0, "tie_breaker_applied": "if TIE, explain which tie-breaking dimension was used from [TIE_BREAKING_CRITERIA]" } ## CONSTRAINTS [CONSTRAINTS] ## TIE-BREAKING CRITERIA [TIE_BREAKING_CRITERIA]
Adaptation guidance: Replace [REFERENCE_FACTS] with your ground-truth document, structured data, or verified source text. Replace [OUTPUT_A] and [OUTPUT_B] with the two model outputs under comparison. Use [EVALUATION_CRITERIA] to specify what factual dimensions matter most for your use case—for example, 'accuracy of financial figures takes priority over narrative fluency.' Use [CONSTRAINTS] to add domain-specific rules such as 'do not flag rounding differences under 1% as errors' or 'treat missing mandatory disclosures as CRITICAL contradictions.' Use [TIE_BREAKING_CRITERIA] to define how ties should be resolved, such as 'prefer the output with fewer unsupported claims' or 'prefer the output that cites more reference facts.' The output schema is intentionally verbose to support downstream audit trails and evidence linking. If you need a lighter-weight version for high-throughput pipelines, remove the per-claim arrays and keep only the comparison summary and preference fields.
Before deploying this prompt into a production pipeline, validate that the JSON output matches the expected schema on at least 20 test pairs with known accuracy differences. Common failure modes include the model conflating style preferences with factual accuracy, failing to extract implicit claims, or producing evidence references that are paraphrases rather than direct citations. For high-risk domains such as healthcare, legal, or financial content, always route outputs with confidence below 0.8 or CRITICAL contradictions to human review. Wire the prompt into an evaluation harness that logs every comparison, tracks inter-rater agreement when multiple judges evaluate the same pair, and alerts on score drift over time.
Prompt Variables
Required inputs for the Side-by-Side Factual Accuracy Comparison Prompt. Each variable must be populated before the prompt is assembled and sent to the model. Missing or malformed inputs are the most common cause of unreliable preference verdicts.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[OUTPUT_A] | First candidate output to evaluate for factual accuracy | The capital of France is Paris. It was founded in the 3rd century BC. | Must be non-empty string. Truncate if longer than model context window allows after accounting for other variables. Strip any model-identity markers before insertion. |
[OUTPUT_B] | Second candidate output to compare against Output A | Paris has been the capital of France since 1944. It was established by the Romans. | Must be non-empty string. Apply same truncation and identity-stripping rules as [OUTPUT_A]. Position bias mitigation requires randomizing which output fills this slot versus [OUTPUT_A] across evaluation runs. |
[REFERENCE_FACTS] | Ground-truth facts or source material against which both outputs are verified | Paris is the capital of France. The city was settled in the 3rd century BC by the Parisii tribe. It became the capital in 987 AD under Hugh Capet. | Must contain at least one verifiable claim. Accepts structured JSON array of facts or unstructured text. Each fact should be independently verifiable. Null or empty triggers abstention—prompt should refuse comparison without evidence. |
[FACT_CHECKING_INSTRUCTIONS] | Rules for claim extraction, evidence linking, and error severity classification | Extract every factual claim. Link each to a reference fact or mark as unsupported. Classify errors as minor (date off by <1 year), major (wrong entity), or critical (fabricated event). | Must define error severity tiers. Should specify whether unsupported claims count as errors or require separate flagging. Ambiguous instructions produce inconsistent verdicts across runs. |
[PREFERENCE_CRITERIA] | Weighted dimensions that determine which output is preferred | Accuracy: 0.6, Completeness: 0.2, Conciseness: 0.1, Source fidelity: 0.1 | Weights must sum to 1.0. Accepts JSON object with dimension names as keys and float weights as values. Missing dimensions default to zero weight. Overlapping dimensions cause double-counting. |
[OUTPUT_SCHEMA] | Expected structure for the comparison verdict | JSON with fields: preferred_output (A or B), confidence (0-1), error_summary (array of {claim, source, severity, output}), justification (string) | Must be a valid JSON schema or field specification. Required fields should be marked. Schema mismatch between prompt instruction and downstream parser is a common production failure. |
[TIE_BREAKING_RULES] | Logic for resolving cases where both outputs are equally accurate | If error counts are equal, prefer the output with fewer unsupported claims. If still tied, prefer the more concise output. If still tied, mark as true tie with confidence 0.5. | Must define an ordered sequence of tie-breakers. Final rule should specify whether true ties are allowed or if forced choice is required. Missing tie-breaking rules cause inconsistent behavior on borderline cases. |
[EVIDENCE_LINKING_REQUIREMENT] | Specification for how claims must be mapped to reference facts | Each claim must cite the exact reference fact ID or quote the supporting text. Unsupported claims must be explicitly flagged with evidence_status: missing. | Must define citation format. Accepts inline citation markers, reference IDs, or quoted text spans. Vague requirements lead to hallucinated citations. Set to null only if evidence linking is intentionally omitted. |
Implementation Harness Notes
How to wire the Side-by-Side Factual Accuracy Comparison Prompt into a production verification pipeline with validation, retries, and human review gates.
This prompt is designed to operate as a stateless comparison function inside a larger fact-checking pipeline. It expects two pre-generated outputs and a structured evidence payload. The application layer is responsible for assembling these inputs, calling the model, parsing the structured verdict, and routing the result. Do not use this prompt as a standalone chatbot interaction; it must be wrapped in an API call with strict output validation before the result is trusted downstream.
Input assembly is the critical pre-call step. The [OUTPUT_A] and [OUTPUT_B] fields should be the raw text responses from the two systems under comparison. The [REFERENCE_FACTS] field must contain the ground-truth evidence, formatted as a list of atomic claims with source citations. If your evidence comes from a RAG pipeline, extract and deduplicate the supporting passages before populating this field. Position bias mitigation requires two calls per comparison pair: one with Output A in the first position and one with Output B in the first position. If the verdicts disagree, flag the pair for human review. Log the raw position-swapped results for inter-rater reliability analysis over time.
Output validation must happen before the verdict is accepted. Parse the model response as JSON and verify: (1) the preferred_output field contains exactly A or B, (2) the confidence field is a float between 0.0 and 1.0, (3) the claim_level_accuracy object contains numeric counts that sum correctly, and (4) every entry in error_instances includes a non-empty claim, error_type, severity, and evidence_citation. If validation fails, retry once with the same inputs and a stronger format reminder appended to the prompt. If the retry also fails, route the pair to a human review queue with the raw model output attached for diagnosis.
Model choice matters for this workflow. Use a model with strong instruction-following and structured output capabilities, such as gpt-4o or claude-3-5-sonnet. Set temperature=0 to maximize reproducibility. If you are comparing outputs from a smaller or less capable model, be aware that the judge model's own factual limitations can introduce bias—it may penalize correct but obscure claims it doesn't recognize. For high-stakes domains (healthcare, finance, legal), always include a human review gate for pairs where confidence is below 0.8 or where error severity is critical. Log every verdict with the full input payload, model response, validation result, and human override for auditability.
Integration pattern: wrap this prompt in a function compare_factual_accuracy(output_a, output_b, reference_facts, domain_risk_level) that handles position swapping, validation, retries, and escalation. Return a structured result object that downstream systems can act on: {winner, confidence, error_summary, requires_human_review, audit_log}. Never expose raw model output directly to end users or automated decision systems without this validation layer. For continuous monitoring, track the rate of validation failures, position-swap disagreements, and human overrides—these metrics will surface judge drift or evidence quality problems before they corrupt your comparison pipeline.
Expected Output Contract
Defines the structured output fields, types, and validation rules for the Side-by-Side Factual Accuracy Comparison Prompt. Use this contract to parse and validate the LLM's preference verdict before it enters downstream pipelines.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
preferred_output_id | string enum: 'A' | 'B' | 'TIE' | Must match exactly one of the allowed values. Reject if null, empty, or any other value. | |
confidence_score | float (0.0-1.0) | Must be a number between 0.0 and 1.0 inclusive. Reject if out of range or non-numeric. If TIE, must be >= 0.8 to confirm indistinguishability. | |
claim_comparisons | array of objects | Must be a non-empty array. Each object must contain claim_text, output_a_verdict, output_b_verdict, and evidence_reference fields. | |
claim_comparisons[].claim_text | string | Must be a non-empty string representing a distinct factual claim extracted from the source material. | |
claim_comparisons[].output_a_verdict | string enum: 'SUPPORTED' | 'UNSUPPORTED' | 'CONTRADICTED' | Must match one of the three allowed values. Reject if null or any other string. | |
claim_comparisons[].output_b_verdict | string enum: 'SUPPORTED' | 'UNSUPPORTED' | 'CONTRADICTED' | Must match one of the three allowed values. Reject if null or any other string. | |
claim_comparisons[].evidence_reference | string or null | Must be a non-empty string quoting or paraphrasing the source evidence, or null if no evidence was found. Reject if empty string. | |
error_summary | object | Must contain total_claims, output_a_errors, output_b_errors, and severity fields. Reject if any field is missing or of wrong type. | |
error_summary.total_claims | integer | Must be a positive integer matching the length of claim_comparisons array. Reject on mismatch. | |
error_summary.output_a_errors | integer | Must be a non-negative integer <= total_claims. Sum of UNSUPPORTED and CONTRADICTED counts for output A. | |
error_summary.output_b_errors | integer | Must be a non-negative integer <= total_claims. Sum of UNSUPPORTED and CONTRADICTED counts for output B. | |
error_summary.severity | string enum: 'NONE' | 'MINOR' | 'MAJOR' | 'CRITICAL' | Must match one of the four allowed values. Derive from error counts and type: CRITICAL if any CONTRADICTED claims exist. | |
tie_justification | string or null | conditional | Required if preferred_output_id is 'TIE'. Must be a non-empty string explaining why outputs are indistinguishable. Reject if TIE and null or empty. |
Common Failure Modes
Side-by-side factual accuracy comparisons break in predictable ways. Here are the most common failure modes and how to guard against them before they reach production.
Position Bias Skews Preference
What to watch: The judge consistently prefers the first or second output regardless of quality. This is especially common when outputs are similar in length or when the judge defaults to the first option under uncertainty. Guardrail: Randomize output order for every comparison pair and log the original position. Run a position-bias check by comparing identical outputs swapped between positions—any preference indicates bias.
Verbose Outputs Win on Perceived Completeness
What to watch: Longer outputs with more claims appear more authoritative, even when those claims are incorrect or unsupported. The judge confuses quantity with quality and rewards hallucinated detail. Guardrail: Add explicit instruction to penalize unsupported claims and reward precision over length. Include a claim-count normalization step that flags outputs where claim density exceeds evidence density.
Stylistic Fluency Masks Factual Errors
What to watch: Well-written, confident prose receives higher accuracy scores than awkward but factually correct outputs. The judge conflates writing quality with factual correctness, especially when the evaluator is not a domain expert. Guardrail: Separate style evaluation from accuracy evaluation into distinct passes. Require claim-level evidence linking before scoring, and use a structured output schema that forces the judge to list each claim and its verification status independently.
Shared Errors Go Undetected
What to watch: Both outputs contain the same factual error, so the comparison reveals no difference. The judge correctly identifies that the outputs agree but fails to notice they are both wrong. This is common when both models share training data biases or when the reference material itself contains errors. Guardrail: Always include a ground-truth or authoritative reference as a third input to the comparison. Require the judge to verify claims against the reference before comparing outputs, not after.
Error Severity Miscalibration
What to watch: The judge treats all errors as equal, so an output with three minor date errors loses to an output with one critical safety misstatement. Without severity weighting, the comparison produces misleading preferences. Guardrail: Define an error severity taxonomy in the prompt rubric—for example, critical (safety, legal), major (key fact wrong), minor (date off by one day), and cosmetic (formatting). Require the judge to classify each error before computing preference.
Evidence Linking Is Superficial or Circular
What to watch: The judge claims an output is supported by evidence but provides vague references like 'the source material confirms this' without specific citations. In worse cases, the judge treats the output itself as evidence, creating a circular verification loop. Guardrail: Require the judge to output explicit source-to-claim mappings with direct quotes or section references. Add a validation step that checks whether each cited source actually contains the claimed information. Flag any evidence link that paraphrases the output rather than the source.
Evaluation Rubric
Use this rubric to evaluate the quality of a side-by-side factual accuracy comparison prompt's output. Each criterion targets a specific failure mode in claim-level verification, evidence linking, or preference justification. Run these checks on a golden dataset of 20-50 comparison pairs before shipping the prompt to production.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Claim Extraction Completeness | All factual claims from both [OUTPUT_A] and [OUTPUT_B] are extracted with no omissions | Extracted claim count is zero or fewer than 3 claims when source texts contain verifiable facts | Parse extracted claims list; assert count >= 3; spot-check 10 random pairs for missed claims against human annotation |
Evidence Linking Accuracy | Every extracted claim is linked to a specific [REFERENCE_DATA] source with a direct quote or data point | Any claim marked as 'supported' lacks a source citation or the citation does not contain the claimed fact | For each claim, verify the linked evidence contains the claim's subject and predicate using substring or semantic match; flag any unlinked claims |
Error Severity Classification | Each discrepancy is classified as CRITICAL, MAJOR, or MINOR using the defined severity taxonomy | A fabricated statistic is labeled MINOR or a typo in a non-material word is labeled CRITICAL | Run 20 known error cases with pre-labeled severities; assert classification accuracy >= 90% against human labels |
Preference Verdict Consistency | The preferred output is the one with fewer and less severe factual errors, with ties broken by [TIE_BREAKING_RULES] | Preference is declared for an output with more CRITICAL errors than the alternative, or a tie is declared when one output has clearly fewer errors | Compare verdict against ground-truth error counts in 50 pairs; assert verdict matches error-count logic in >= 95% of cases |
Justification Traceability | The justification text references specific claims, evidence, and error counts that support the verdict | Justification is generic (e.g., 'Output A is more accurate') without citing any specific claim or evidence | Parse justification for claim IDs or evidence references; assert at least one specific reference per verdict; flag generic text |
Position Bias Neutralization | Verdict distribution is within 45-55% for each position when identical outputs are compared with swapped positions | One position wins > 60% of the time when comparing identical outputs in a position-swapped test set | Run 100 identical-output pairs with randomized positions; assert each position wins 45-55% of the time; chi-square test p > 0.05 |
Confidence Score Calibration | Reported confidence score correlates with actual error-count difference between outputs | High confidence (>= 0.8) is assigned when error counts are equal, or low confidence (<= 0.3) when one output has 5+ more CRITICAL errors | Bin confidence scores into low/medium/high; assert mean error-count difference increases monotonically across bins on 50 test pairs |
Output Schema Compliance | Response contains all required fields: [VERDICT], [CONFIDENCE_SCORE], [ERROR_COUNT_A], [ERROR_COUNT_B], [JUSTIFICATION], [CLAIMS_LIST] | Missing required field, extra unsanctioned field, or field type mismatch (e.g., string instead of number for confidence) | Validate against JSON schema; assert all required fields present and correctly typed; reject responses with extra top-level keys |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single model call. Replace [SOURCE_A] and [SOURCE_B] with inline text snippets. Skip the evidence-linking harness and use a simple preference output: {"preferred_output": "A" or "B", "reason": "..."}. Run 5-10 test pairs manually.
Watch for
- Position bias: swap A/B order and re-test
- Missing evidence: the judge may prefer fluent but wrong text
- Overly broad instructions without claim-level granularity

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us