Inferensys

Prompt

Source-Answer Alignment Rubric Prompt

A practical prompt playbook for using Source-Answer Alignment Rubric Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the job-to-be-done, ideal user, required context, and when not to use the source-answer alignment rubric prompt.

This prompt is an LLM-as-judge evaluation tool for teams that need to measure how faithfully a generated answer aligns with its cited source material. Use it when you are building an automated evaluation pipeline, comparing two model outputs against the same evidence, or running regression tests on a RAG system. The prompt produces a structured rubric assessment across three dimensions: faithfulness (are claims supported?), coverage (are all source-relevant points included?), and contradiction detection (does the answer conflict with the evidence?). It is designed for evaluation engineers, AI quality teams, and RAG pipeline builders who need a repeatable, score-based alignment check before answers reach users.

This prompt assumes you already have a generated answer and the full text of its cited sources. It does not retrieve sources, verify citation formatting, or check source authority. Pair it with a citation verification prompt if you need to validate that citations point to real documents. The rubric output is structured for downstream automation: you can threshold the scores to gate deployment, route low-faithfulness outputs for human review, or feed pairwise comparison results into a model selection decision. For high-risk domains such as healthcare or legal, always include human review of rubric results before acting on them.

Do not use this prompt when you need real-time answer generation, source retrieval, or user-facing explanations. It is an offline evaluation tool, not a production guardrail. If your goal is to detect hallucinated citations rather than assess answer-source alignment, use the hallucinated citation detection prompt instead. For span-level claim-to-source mapping, use the claim-to-source linking prompt. This rubric prompt works best as part of a broader evaluation suite that includes regression tests, human annotation spot checks, and output validation guardrails.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Source-Answer Alignment Rubric Prompt delivers reliable evaluation and where it introduces risk.

01

Good Fit: LLM-as-Judge Evaluation Pipelines

Use when: you need automated, scalable evaluation of RAG answer faithfulness against a fixed set of cited sources. The rubric excels at detecting unsupported claims and contradictions across model versions. Guardrail: calibrate rubric scores against human-annotated ground truth before relying on automated metrics for release decisions.

02

Good Fit: Pairwise Model Comparison

Use when: comparing two model outputs against the same source set to determine which is more faithful. The structured rubric provides consistent criteria for side-by-side judgment. Guardrail: randomize output order and run multiple comparison passes to control for position bias in LLM judges.

03

Bad Fit: Real-Time Guardrails

Avoid when: you need sub-second hallucination detection before a response reaches the user. This rubric prompt performs deep multi-dimensional analysis that adds latency unsuitable for synchronous guardrails. Guardrail: use lightweight claim extraction and regex-based citation checks for real-time filtering, reserving this rubric for offline evaluation.

04

Required Inputs

What you need: a complete generated answer, the full set of cited source passages, and a defined rubric with faithfulness, coverage, and contradiction dimensions. Guardrail: validate that source passages are complete and unaltered before evaluation. Truncated or pre-summarized sources produce misleading alignment scores.

05

Operational Risk: Judge Model Bias

What to watch: the LLM judge may favor outputs from the same model family, inflating scores for familiar response patterns. Guardrail: rotate judge models across evaluation runs and track score distributions by judge model to detect systematic bias before it affects release decisions.

06

Operational Risk: Ambiguous Source Boundaries

What to watch: when source passages contain multiple claims or span broad topics, the rubric may penalize answers that synthesize correctly but don't map cleanly to a single passage. Guardrail: pre-segment sources into claim-level chunks and include a partial-support category in the rubric to avoid false negatives on legitimate synthesis.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A ready-to-use prompt for evaluating how well an answer aligns with its cited sources using a structured rubric.

This prompt template implements a detailed source-answer alignment rubric for LLM-as-judge evaluation. It assesses faithfulness, coverage, and contradiction between a full answer and its cited sources. The template supports both single-answer evaluation and pairwise comparison for model selection or regression testing. Replace the square-bracket placeholders with your specific answer text, source documents, and evaluation parameters before running it in your harness.

text
You are an expert evaluator assessing how well an answer aligns with its cited sources. Your task is to produce a detailed alignment assessment using the structured rubric below.

## INPUT

**Answer to Evaluate:**
[ANSWER_TEXT]

**Cited Sources:**
[SOURCE_DOCUMENTS]

**Evaluation Context (optional):**
[EVALUATION_CONTEXT]

## RUBRIC DIMENSIONS

For each dimension, assign a score from 1 (poor) to 5 (excellent) and provide a brief justification with specific evidence.

### 1. Faithfulness
Does the answer only make claims that are directly supported by the cited sources? Penalize any statement not grounded in the provided sources.
- Score 5: Every claim is directly traceable to a specific source passage.
- Score 3: Most claims are supported, but some minor extrapolations or embellishments exist.
- Score 1: Multiple unsupported claims or fabrications present.

### 2. Coverage
Does the answer incorporate all relevant information from the cited sources, or does it omit material facts?
- Score 5: All material facts from sources are represented accurately.
- Score 3: Key facts are included, but some relevant details are missing.
- Score 1: Critical information from sources is omitted or misrepresented.

### 3. Contradiction Detection
Does the answer contain any statements that directly contradict the cited sources?
- Score 5: No contradictions found; answer is fully consistent with all sources.
- Score 3: Minor inconsistencies in phrasing or emphasis, but no factual contradictions.
- Score 1: Direct factual contradictions with one or more sources.

### 4. Source Utilization
Are the cited sources used appropriately? Check for cherry-picking, out-of-context quotes, or ignoring source qualifiers.
- Score 5: Sources are used faithfully with appropriate context and qualifiers preserved.
- Score 3: Sources are generally used well, but some context or nuance is lost.
- Score 1: Sources are misrepresented, quoted out of context, or key qualifiers are stripped.

## OUTPUT FORMAT

Return a JSON object with this exact structure:

{
  "overall_score": <float between 1.0 and 5.0>,
  "dimension_scores": {
    "faithfulness": {"score": <int 1-5>, "justification": "<specific evidence>"},
    "coverage": {"score": <int 1-5>, "justification": "<specific evidence>"},
    "contradiction_detection": {"score": <int 1-5>, "justification": "<specific evidence>"},
    "source_utilization": {"score": <int 1-5>, "justification": "<specific evidence>"}
  },
  "unsupported_claims": ["<list any claims lacking source support>"],
  "contradictions_found": ["<list any contradictions with source references>"],
  "missing_information": ["<list material facts from sources not in answer>"],
  "summary": "<2-3 sentence overall assessment>"
}

## PAIRWISE COMPARISON (if applicable)

[PAIRWISE_INSTRUCTIONS: If comparing two answers, evaluate both independently using the rubric above, then add a "comparison" field with "winner": "A" or "B" or "tie" and "rationale": "<explanation>". Provide both answers as [ANSWER_A] and [ANSWER_B] with the same source set.]

## CONSTRAINTS

- Only use the provided sources as ground truth. Do not bring in external knowledge.
- If a source contains uncertainty language (e.g., "may," "suggests," "unclear"), the answer must preserve that uncertainty.
- Flag any claim that appears factual but cannot be located in the sources.
- For pairwise comparison, evaluate each answer independently before comparing.

Adapt this template by adjusting the rubric dimensions to match your domain's requirements. For regulated industries, add dimensions for compliance language preservation or disclaimer inclusion. For technical documentation, add a dimension for procedural accuracy. The output schema can be extended with domain-specific fields such as regulatory_flags or technical_accuracy_notes. Always test the rubric against a golden dataset of known alignments and misalignments before deploying to production evaluation pipelines. For high-stakes assessments, route low-scoring outputs to human review rather than relying solely on the automated score.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Source-Answer Alignment Rubric Prompt. Each variable must be populated before the prompt is sent. Missing or malformed inputs are the most common cause of rubric failure.

PlaceholderPurposeExampleValidation Notes

[ANSWER]

The full generated answer to evaluate for source alignment

The patient's blood pressure was 140/90, indicating stage 1 hypertension per the cited guidelines.

Must be non-empty string. Truncate if >4000 tokens to avoid rubric drift. Check for null or whitespace-only input.

[SOURCES]

Array of cited source documents with identifiers and full text

[{"source_id": "src-01", "title": "JNC 8 Guidelines", "text": "Stage 1 hypertension is defined as systolic 140-159 or diastolic 90-99 mmHg."}]

Must be valid JSON array with at least one source object. Each object requires source_id, title, and text fields. Reject if text field is empty or source_id is duplicated.

[RUBRIC_DIMENSIONS]

List of alignment dimensions to score, drawn from faithfulness, coverage, contradiction, specificity, and citation precision

["faithfulness", "coverage", "contradiction"]

Must be a JSON array of strings from the allowed set: faithfulness, coverage, contradiction, specificity, citation_precision. Reject unknown dimension names. Minimum one dimension required.

[SCORING_SCALE]

Numerical scale definition for each dimension score

{"min": 1, "max": 5, "labels": {"1": "No support", "3": "Partial support", "5": "Full support"}}

Must define min, max, and at least three label anchors. Max must be greater than min. Reject scales without labeled anchors, as unlabeled numeric scores produce inconsistent rubric application.

[PAIRWISE_COMPARISON]

Optional second answer and source set for comparative evaluation

{"answer_b": "...", "sources_b": [...]}

Null allowed. If provided, must contain both answer_b and sources_b fields matching the same schema as [ANSWER] and [SOURCES]. Reject if only one field is populated.

[OUTPUT_SCHEMA]

Expected JSON structure for the alignment assessment output

{"dimensions": [{"name": "faithfulness", "score": 4, "rationale": "..."}], "overall_alignment": 0.85}

Must be a valid JSON Schema or example object. Validate that schema includes dimension-level scores, rationales, and an overall alignment field. Reject schemas missing rationale requirements.

[CONTRADICTION_THRESHOLD]

Minimum severity level for flagging contradictions in output

{"level": "partial", "action": "flag_and_continue"}

Must specify level from: direct, partial, implicit. Must specify action from: flag_and_stop, flag_and_continue, ignore. Reject if action is flag_and_stop but pairwise comparison is active, as this creates an unrecoverable eval state.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Source-Answer Alignment Rubric prompt into an evaluation pipeline with validation, retries, and model selection.

This prompt is designed for an LLM-as-judge evaluation harness, not a user-facing chatbot. It expects a structured input containing a full answer and its cited sources, and it produces a detailed rubric assessment. The primary integration point is an automated evaluation pipeline that runs after answer generation, comparing model outputs against a golden dataset or performing pairwise model comparisons. The harness must enforce the input schema, validate the output structure, and log results for analysis.

Input assembly requires merging the generated answer with its retrieved sources into the [ANSWER] and [SOURCES] placeholders. If your RAG pipeline produces citations inline, extract and normalize them into a list of source objects with id and content fields before calling this prompt. Output validation should parse the JSON response and verify that all required rubric dimensions (faithfulness, coverage, contradiction) are present with numeric scores and textual justifications. Reject malformed responses and retry with a stricter format instruction appended to the prompt. For pairwise comparison mode, ensure both [ANSWER_A] and [ANSWER_B] are populated and validate that the output includes a comparison object with a winner field and per-dimension breakdown.

Model selection matters: use a model with strong instruction-following and structured output capabilities, such as GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro. Avoid smaller models that may drift on the rubric scale or omit required justification fields. Retry logic should handle JSON parse failures (up to 2 retries with escalating format constraints) and refusal responses where the model declines to evaluate. Logging must capture the raw prompt, the full output, parse success/failure, and the extracted scores for dashboarding. For high-stakes evaluations (e.g., model release gates), route a sample of assessments to human review to calibrate the LLM judge against human annotators and detect rubric drift over time. Never treat the rubric scores as ground truth without periodic calibration checks.

PRACTICAL GUARDRAILS

Common Failure Modes

When using an LLM to judge source-answer alignment, these failures surface first. Each card explains the symptom, the root cause, and a concrete guardrail to add before production.

01

Surface-Level Lexical Matching

What to watch: The judge scores an answer as 'fully supported' simply because it shares keywords with the source, ignoring semantic contradictions or fabricated details. Guardrail: Add a rubric dimension that explicitly penalizes 'keyword-only support' and requires the judge to identify the specific claim each source sentence proves.

02

Hallucinated Source Attribution

What to watch: The judge confirms that a source supports a claim when the source text is missing, truncated, or about a different topic entirely. This is common with long contexts. Guardrail: Require the judge to extract a verbatim quote from the source for each 'supported' verdict. If no quote can be found, the verdict must flip to 'unsupported'.

03

Overlooking Contradictions

What to watch: The judge correctly identifies that Source A supports the answer but misses that Source B directly contradicts it, producing a misleadingly high alignment score. Guardrail: Add a dedicated 'contradiction detection' pass before the final score. Instruct the judge to compare every claim against all provided sources, not just the most relevant one.

04

Coverage Blindness

What to watch: The judge gives a perfect faithfulness score because every stated claim is supported, but ignores that the answer omits a critical risk or limitation clearly stated in the source. Guardrail: Include a 'coverage' dimension in the rubric that asks: 'Does the answer omit any material fact present in the source that would change a reader's understanding?'

05

Position Bias in Pairwise Comparison

What to watch: When comparing Answer A vs. Answer B, the judge consistently favors the first answer presented, regardless of quality. Guardrail: Run every pairwise comparison twice with the answer order swapped. Flag the result as unreliable if the judge's preference flips. Use the average score or escalate to a human reviewer.

06

Drift from Rubric Definitions

What to watch: Over many evaluations, the judge starts applying its own internal definition of 'faithful' instead of the specific operational definition in your rubric, causing score drift. Guardrail: Include 2-3 calibration examples with known scores in the system prompt. Run a static golden set weekly and trigger a prompt review if the judge's scores deviate by more than a defined threshold.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Source-Answer Alignment Prompt before shipping it into your evaluation pipeline. Each criterion targets a specific failure mode in faithfulness, coverage, or contradiction detection.

CriterionPass StandardFailure SignalTest Method

Faithfulness: Supported Claims

All claims marked 'Supported' have a direct source quote that substantiates the claim.

A claim is marked 'Supported' but the linked quote is tangential or discusses a different entity.

Spot-check 10 supported claims. For each, verify the quote independently contains the claim's subject and predicate.

Faithfulness: Unsupported Detection

All claims without a matching source span are correctly flagged as 'Unsupported'. No false negatives.

A claim that invents a statistic or date is marked 'Supported' because a source mentions the general topic.

Inject 5 claims with fabricated numbers into a test answer. Confirm all 5 are flagged 'Unsupported'.

Coverage: Completeness

Every factual assertion in the answer is extracted as a discrete claim. No omissions.

The answer contains a key finding from the source that is missing from the claims list.

Compare the claims list against a human-generated list of all factual statements in the answer. Measure recall.

Contradiction Detection

Any claim that logically conflicts with another claim or a source passage is flagged with a 'Contradiction' label.

Two claims state different dates for the same event but neither is flagged.

Construct a test case with a deliberate date contradiction between two sources. Verify the rubric output flags it.

Source Span Accuracy

Extracted evidence spans match the source text exactly and include enough context to be interpretable.

A span is truncated mid-sentence, altering the meaning, or includes text from a different section.

Validate 10 spans with string matching against the source document. Check that each span is a contiguous substring.

Pairwise Comparison Consistency

When comparing two answers, the rubric correctly identifies which has higher faithfulness and coverage.

The rubric assigns a higher faithfulness score to an answer with a hallucinated claim over a fully grounded one.

Run the rubric on a pair where Answer A is fully grounded and Answer B contains a known hallucination. Verify A wins.

Confidence Calibration

High confidence scores (>=0.9) are only assigned to claims with explicit, unambiguous source support.

A claim paraphrasing a complex legal clause receives a 0.95 confidence score despite ambiguous wording.

Review all claims with confidence >=0.9. Manually verify that the source text is unambiguous and directly supports the claim.

Refusal Handling

If the provided sources are empty or entirely irrelevant, the rubric outputs a null or empty assessment rather than hallucinating an evaluation.

With zero sources provided, the rubric fabricates source quotes or assigns 'Supported' labels.

Pass an empty sources array with a valid answer. Assert that the output contains no supported claims and no fabricated quotes.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Wrap the rubric prompt in a structured eval harness with JSON schema enforcement, retry logic, and logging. Add few-shot calibration examples with known scores. Run pairwise comparison across model versions and log score distributions.

Add to the prompt:

  • [OUTPUT_SCHEMA]: Strict JSON schema with faithfulness, coverage, contradiction, overall_alignment, and per_claim_scores fields.
  • [CALIBRATION_EXAMPLES]: 3–5 scored examples with explanations.
  • [CONSTRAINTS]: "Return only valid JSON. No additional text."

Wire into application:

  • Validate JSON on receipt; retry once on parse failure.
  • Log every score with model version, timestamp, and source document IDs.
  • Trigger human review when overall_alignment < 3 or contradiction > 0.

Watch for

  • Silent format drift under high load or long context.
  • Score inflation when the judge model shares lineage with the evaluated model.
  • Missing human review for borderline cases that pass automated thresholds.
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.