Inferensys

Prompt

Multi-Turn Grounding Score Prompt Template

A practical prompt playbook for using Multi-Turn Grounding Score Prompt Template in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Determine whether your RAG chat evaluation pipeline needs multi-turn grounding scoring instead of single-turn checks.

This prompt is for RAG chat evaluation teams who need to measure whether each assistant turn is grounded in provided source material across a full multi-turn session. Single-turn groundedness checks miss the compounding effect of unsupported claims that get repeated, extended, or contradicted in later turns. If your product ships conversational AI backed by retrieval—customer support copilots, research assistants, clinical documentation tools—you need to know not just whether one response was faithful, but whether the entire session stayed anchored to evidence or drifted into fabrication.

Use this prompt when you have access to the full conversation transcript and the source context provided to the model at each turn. The prompt expects turn-indexed source material and produces per-turn grounding scores, extracted unsupported claims with turn indices, and a session-level grounding trend line. It is designed for automated, model-graded evaluation in regression testing pipelines, pre-release QA gates, and ongoing production monitoring. The output schema includes both granular claim-level evidence and aggregate scores, so you can feed results into dashboards, alerting systems, or human review queues.

Do not use this prompt when you lack per-turn source context—if you only have final answers without the retrieval results that informed them, grounding cannot be reliably assessed. Do not use it for single-turn evaluation; simpler groundedness prompts exist for that purpose and will be cheaper and faster. Do not treat the LLM judge's scores as ground truth without calibration against human ratings on a sample of your own data. In regulated domains such as healthcare or finance, always route low-grounding sessions to human review and maintain audit trails of both the scores and the source evidence used to produce them. Start by running this prompt against a golden dataset of conversations where you already know the grounding quality, calibrate the judge's thresholds, and only then promote it to automated gating.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Multi-Turn Grounding Score Prompt works, where it fails, and what you must provide before running it.

01

Strong Fit: RAG Chat Regression Suites

Use when: You have a golden dataset of multi-turn RAG conversations with known source documents per turn. Guardrail: Run this prompt as a gate in CI/CD before shipping RAG pipeline or prompt changes to detect grounding regressions across full sessions, not just single-turn slices.

02

Weak Fit: Open-Domain Creative Chat

Avoid when: Conversations have no provided source material or the assistant is expected to use general world knowledge. Guardrail: This prompt requires explicit source context per turn. Without it, every claim will be flagged as unsupported, producing a useless score of zero.

03

Required Input: Per-Turn Source Evidence

Risk: Running the prompt without attaching the specific retrieved documents or context chunks for each assistant turn. Guardrail: Your harness must pair every assistant message with its retrieval context. Missing source context produces false unsupported-claim flags and invalidates the session-level trend line.

04

Operational Risk: Long-Context Judge Drift

Risk: In sessions exceeding 20+ turns, the LLM judge may lose track of early-turn source material, causing inconsistent grounding scores in later turns. Guardrail: Implement a sliding window or chunk the session into overlapping segments for evaluation. Monitor score variance between windows as a judge reliability signal.

05

Not a Replacement: Human Spot Checks

Risk: Treating the automated grounding score as ground truth without verifying edge cases where the judge misclassifies paraphrased or implicit grounding. Guardrail: Periodically sample low-confidence or borderline turns for human review. Use disagreement cases to calibrate the judge's grounding threshold.

06

Integration Point: Unsupported Claim Extraction

Risk: Ignoring the extracted unsupported claims and only using the numeric score, missing actionable debugging data. Guardrail: Pipe the per-turn unsupported claim list into your observability stack. Use it to trigger retrieval quality alerts when specific source chunks repeatedly fail to ground claims.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready LLM judge prompt for scoring per-turn grounding in multi-turn RAG conversations, ready to paste and adapt.

This prompt template is designed to be pasted directly into your LLM judge. It instructs the model to evaluate every assistant turn in a multi-turn conversation for grounding against provided source material. The judge will produce per-turn scores, extract unsupported claims, and generate a session-level trend line. Before using it, ensure you have assembled the full conversation transcript and the corresponding source context for each turn where the assistant referenced external information.

text
You are an expert evaluation judge for Retrieval-Augmented Generation (RAG) chat systems. Your task is to evaluate a multi-turn conversation between a user and an AI assistant. For each assistant turn, you will receive the source context that was provided to the assistant for that turn. Your job is to score how well each assistant response is grounded in its corresponding source material.

## INPUT DATA

### Conversation Transcript
[CONVERSATION_TRANSCRIPT]

### Source Context Per Turn
[SOURCE_CONTEXT_PER_TURN]

## SCORING CRITERIA

For each assistant turn, assign a grounding score from 1 to 5:

- **5 (Fully Grounded):** Every factual claim in the assistant response is directly supported by the provided source context. No information is added beyond the sources.
- **4 (Mostly Grounded):** The vast majority of claims are supported. Minor, non-material details may be inferred but do not contradict sources.
- **3 (Partially Grounded):** Some claims are supported, but the response includes unsupported statements, overgeneralizations, or information not present in the sources.
- **2 (Weakly Grounded):** The response contains significant unsupported claims or misinterprets the source material. Only a small portion is verifiable.
- **1 (Not Grounded):** The response is entirely unsupported, hallucinated, or contradicts the provided source context.

If a turn has no source context provided, score it as "N/A" and note that grounding cannot be assessed.

## OUTPUT FORMAT

Return a valid JSON object with the following structure:

[OUTPUT_SCHEMA]

## CONSTRAINTS

[CONSTRAINTS]

## EXAMPLES

[EXAMPLES]

After pasting this template, replace the square-bracket placeholders with your actual data. The [CONVERSATION_TRANSCRIPT] should contain the full multi-turn dialogue, clearly labeling each user and assistant message with turn indices. The [SOURCE_CONTEXT_PER_TURN] must map each assistant turn index to the specific documents, passages, or chunks retrieved for that turn. The [OUTPUT_SCHEMA] placeholder should be replaced with your exact JSON schema, which must include fields for per_turn_scores (an array of objects with turn_index, score, unsupported_claims, and rationale), session_grounding_trend (a summary of how grounding changes across turns), and overall_session_score. The [CONSTRAINTS] section is where you add any domain-specific rules, such as "if a claim is a direct quote from the source, it is grounded" or "inferred background knowledge is not considered grounded unless explicitly stated." Finally, replace [EXAMPLES] with one or two worked examples showing a turn, its source context, and the expected score with rationale. This calibration is essential for consistent judge behavior.

Before deploying this prompt in a production evaluation pipeline, run it against a golden dataset of 20-50 conversations that have been manually scored by human raters. Measure inter-rater reliability between the LLM judge and your human baseline. Pay particular attention to edge cases: turns where the assistant correctly answers but cites the wrong source, turns where the source context is partially irrelevant, and turns where the assistant abstains due to insufficient context. These cases often reveal scoring inconsistencies that require prompt tuning. If the judge's scores diverge from human ratings by more than one point on average, revisit your [EXAMPLES] and [CONSTRAINTS] to tighten the scoring guidance.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Multi-Turn Grounding Score Prompt Template. Each variable must be supplied per evaluation run to produce reliable per-turn grounding scores and unsupported claim extraction.

PlaceholderPurposeExampleValidation Notes

[CONVERSATION_HISTORY]

Full multi-turn chat log with speaker labels and turn indices

TURN_0 USER: What is the return policy? TURN_1 ASSISTANT: Our policy allows returns within 30 days... TURN_2 USER: Does that include sale items?

Parse check: must contain at least 2 turns with alternating speaker labels. Reject if only one speaker present or turn indices missing.

[SOURCE_CONTEXT_PER_TURN]

Retrieved source material mapped to each assistant turn that requires grounding

{TURN_1: [source_id: doc_42, text: Returns accepted within 30 days of purchase...], TURN_3: [source_id: doc_17, text: Sale items are final sale...]}

Schema check: must be a map of turn index to array of source objects with source_id and text fields. Null allowed for user-only turns. Reject if source text is empty string.

[GROUNDING_RUBRIC]

Scoring criteria defining what counts as grounded, partially grounded, or ungrounded

1-5 scale: 5=Every factual claim has direct source support with citation, 3=Most claims supported but one unsupported minor claim, 1=Multiple unsupported factual claims or fabricated details

Schema check: must define at least 3 score levels with clear behavioral anchors. Reject if rubric uses only binary grounded/ungrounded without gradation.

[UNSUPPORTED_CLAIM_THRESHOLD]

Confidence threshold below which a claim is flagged as unsupported

0.7

Range check: must be float between 0.0 and 1.0. Default 0.5 if not specified. Lower values increase false negatives, higher values increase false positives.

[SESSION_GROUNDING_TREND_CONFIG]

Parameters for computing the session-level grounding trend line

{window_size: 3, min_turns_for_trend: 5, trend_direction_labels: [improving, stable, degrading]}

Schema check: window_size must be integer >= 1, min_turns_for_trend must be integer >= 3. Reject if window_size exceeds total turn count.

[OUTPUT_SCHEMA]

Expected JSON structure for per-turn scores and session-level summary

{per_turn_scores: [{turn_index, grounding_score, unsupported_claims: [{claim_text, source_search_result}]}], session_grounding_trend: {direction, mean_score, score_variance}}

Schema check: must include per_turn_scores array and session_grounding_trend object. Reject if unsupported_claims field is missing from per-turn score objects.

[CITATION_FORMAT_REQUIREMENT]

Expected citation format that the assistant should have used in its responses

[source_id: doc_42] or footnote-style [1]

Parse check: must be a non-empty string describing the expected format. Used to detect missing or malformed citations in assistant turns. Null allowed if citations are not required.

[HALLUCINATION_SEVERITY_LEVELS]

Severity classification tiers for unsupported claims based on potential harm

{critical: fabricated policy terms or legal obligations, major: invented statistics or dates, minor: unsupported descriptive detail that does not change meaning}

Schema check: must define at least 2 severity levels with distinguishing criteria. Reject if all levels have identical descriptions. Used to weight session-level grounding trend.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the multi-turn grounding score prompt into an evaluation pipeline with per-turn source injection, structured output parsing, and session-level aggregation.

The multi-turn grounding score prompt is designed to run as a post-hoc evaluation pass over a complete conversation log, not as a real-time guardrail during generation. Each turn in the conversation must be paired with its corresponding retrieved source context before the prompt is assembled. The harness is responsible for aligning turn indices, injecting the correct source material per turn, and collecting the structured per-turn scores and unsupported claim extractions that the prompt produces. This is a batch evaluation workflow, not a streaming one.

Input assembly is the most error-prone step. Build a pre-processing function that takes the conversation array and a parallel array of retrieval results per turn. For each assistant turn, inject the source context into the [TURN_SOURCE_CONTEXT] placeholder. If a turn has no retrieved sources, inject an explicit [NO_SOURCES_PROVIDED] marker rather than leaving the field empty—this prevents the judge from hallucinating source presence. The [CONVERSATION_LOG] should include the full turn history up to and including the turn being evaluated, with clear User: and Assistant: prefixes. For session-level trend analysis, run the prompt once per assistant turn (or sample turns for long sessions) and collect results into an array keyed by turn index.

Output parsing must handle the structured JSON the prompt requests. Define a validation schema that checks: turn_index is an integer matching the evaluated turn, grounding_score is a float between 0.0 and 1.0, unsupported_claims is an array of strings (empty if score is 1.0), and claim_source_mapping is an object where each claim string maps to a source citation or null. Reject and retry any response where unsupported_claims contains claims not present in the assistant turn text—this indicates the judge hallucinated a claim. Use a JSON schema validator in your harness, not a loose regex check.

Retry logic should be conservative. If the output fails schema validation, retry once with the same prompt plus the validation error message appended as a [CORRECTION] block. If the second attempt also fails, log the raw output and flag the turn for human review. Do not retry more than twice; a judge that can't produce valid JSON after correction is likely confused by the input and will not self-repair. For high-stakes evaluation pipelines, route all turns with grounding scores below a configurable threshold (e.g., 0.7) to a human review queue before accepting the score.

Session-level aggregation happens after all per-turn scores are collected. Compute the grounding trend line by plotting grounding_score against turn_index. Flag sessions where the trend line shows a downward slope exceeding your threshold—this indicates grounding decay across the conversation, a common failure mode in long RAG chats. Store per-turn scores, unsupported claims, and the trend slope as structured evaluation artifacts. These artifacts feed into dashboards, regression test reports, and model comparison pipelines. Do not rely on a single session-level average score; the trend and the specific unsupported claims are the actionable signals.

Model choice matters for judge reliability. Use a model with strong instruction-following and structured output capabilities. Avoid models known to drift on long-context tasks, since multi-turn evaluation prompts can be token-heavy. If cost is a concern, sample every Nth turn for sessions longer than 20 turns rather than switching to a weaker judge model. Log the model version, prompt template version, and evaluation timestamp alongside every score so that judge drift can be detected over time. When you update the prompt template, re-run it against a golden dataset of scored conversations and compare score distributions before deploying the change.

IMPLEMENTATION TABLE

Expected Output Contract

Parse and validate the JSON output from the Multi-Turn Grounding Score prompt before storing scores or surfacing them in a dashboard.

Field or ElementType or FormatRequiredValidation Rule

session_id

string

Must match the [SESSION_ID] input exactly. Reject on mismatch or empty string.

overall_grounding_score

number

Must be a float between 0.0 and 1.0 inclusive. Reject if outside range or non-numeric.

grounding_trend

string

Must be one of: 'improving', 'degrading', 'stable', 'fluctuating'. Reject on unknown enum value.

per_turn_scores

array of objects

Array length must equal the number of turns in [TURN_CONTEXT_LIST]. Reject on length mismatch.

per_turn_scores[].turn_index

integer

Must be a zero-based index matching the turn order. Reject on gaps, duplicates, or out-of-range values.

per_turn_scores[].grounding_score

number

Must be a float between 0.0 and 1.0 inclusive. Reject if outside range or non-numeric.

per_turn_scores[].unsupported_claims

array of strings

Each string must be a non-empty excerpt from the assistant turn. Reject if claim text is not a substring of the corresponding turn in [TURN_CONTEXT_LIST].

per_turn_scores[].citation_gaps

array of strings

Each string must reference a specific source ID from [SOURCE_CONTEXT_LIST] or the literal 'none'. Reject on fabricated source IDs.

PRACTICAL GUARDRAILS

Common Failure Modes

Multi-turn grounding evaluation breaks in predictable ways. These are the most common failure modes when scoring RAG chat sessions for source fidelity, and the practical guardrails that keep scores trustworthy.

01

Source Context Drift Across Turns

What to watch: The judge loses track of which source context belongs to which turn, especially when retrieval results change mid-conversation. Turn 3 claims get scored against Turn 1 sources, producing false groundedness failures or false passes. Guardrail: Structure the prompt input so each turn carries its own [SOURCE_CONTEXT] block with an explicit turn index. Instruct the judge to only evaluate claims against sources tagged with the matching turn ID. Add a pre-check that rejects cross-turn source comparisons.

02

Cumulative Claim Contamination

What to watch: An unsupported claim in Turn 2 gets repeated or paraphrased in Turn 4, and the judge scores Turn 4 as grounded because the claim now appears in the conversation history—even though it was never sourced. Hallucinations become self-referencing. Guardrail: Require the judge to trace every factual claim back to the original [SOURCE_CONTEXT] for that turn, not to prior assistant responses. Add a specific instruction: 'A claim repeated from an earlier unsupported turn remains unsupported unless new source evidence is provided.'

03

Partial Grounding Scored as Full

What to watch: A response makes three claims—two are well-sourced, one is fabricated. The judge gives a high grounding score because the majority looks good, missing the single unsupported claim that could be high-risk. Guardrail: Score per-claim, not per-turn. Structure the output schema to require a list of extracted claims with individual grounding verdicts. Set the turn-level score to the minimum claim score, not the average. Flag any turn with at least one unsupported claim for human review.

04

Plausible-Sounding Fabrications Pass Through

What to watch: The assistant generates a claim that sounds consistent with the source material but isn't actually stated. The judge, relying on semantic similarity rather than strict entailment, marks it as grounded. This is the most dangerous failure mode because it looks correct. Guardrail: Instruct the judge to apply a strict entailment standard: 'The source must explicitly state or directly imply the claim. Consistency is not enough—the claim must be supported by the text, not merely not contradicted by it.' Include few-shot examples showing the difference between supported and merely consistent claims.

05

Session-Level Score Masking Turn-Level Failures

What to watch: A single catastrophic grounding failure in Turn 3 gets averaged into a session-level score that still looks acceptable. The trend line hides the spike. Teams ship with a false sense of safety because the aggregate metric is green. Guardrail: Always report per-turn scores alongside the session trend. Set a critical threshold: if any single turn falls below a minimum grounding score, flag the entire session for review regardless of the average. Surface the worst turn prominently in the output.

06

Citation Format Confused with Grounding Quality

What to watch: The assistant includes properly formatted citations that point to irrelevant or non-supporting source passages. The judge rewards the presence of citations without verifying that the cited text actually supports the claim. Guardrail: Add a citation verification step: for each cited source, extract the referenced passage and check whether it entails the claim it's attached to. Score citation accuracy separately from citation presence. Flag 'hollow citations'—properly formatted but non-supporting—as grounding failures.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test whether the Multi-Turn Grounding Score Prompt produces reliable, actionable results before integrating it into an automated evaluation pipeline.

CriterionPass StandardFailure SignalTest Method

Per-Turn Score Presence

Every assistant turn in [CONVERSATION_LOG] receives a numeric grounding score between 0.0 and 1.0

Missing score for any turn, or score outside 0.0-1.0 range

Parse output JSON and assert score field exists and is a float for each turn index

Unsupported Claim Attribution

Every claim flagged as unsupported in [UNSUPPORTED_CLAIMS] includes the exact text snippet and the turn index where it appeared

Unsupported claim listed without a turn index, or claim text does not appear in the referenced turn

Extract each unsupported claim, verify turn index exists, and substring-match claim text against the specified turn in [CONVERSATION_LOG]

Source Evidence Mapping

Each grounded claim references at least one [SOURCE_DOCUMENT_ID] present in the provided [SOURCE_CONTEXT] for that turn

Citation references a document ID not provided in the source context for that turn, or citation is missing when claim is marked as grounded

Collect all cited document IDs, diff against the set of IDs provided in [SOURCE_CONTEXT] per turn, and flag any foreign IDs

Session-Level Trend Calculation

The [SESSION_GROUNDING_TREND] field contains a valid numeric array equal in length to the number of assistant turns

Trend array length does not match turn count, or array contains non-numeric values

Count assistant turns in [CONVERSATION_LOG], assert trend array length matches, and validate each element is a number

Hallucination Propagation Detection

If an unsupported claim from turn N reappears in turn N+1 without new evidence, the [PROPAGATION_FLAGS] array records the originating turn index and the repeated turn index

Repeated unsupported claim is not captured in propagation flags, or propagation flag references a turn where the claim does not appear

Cross-reference unsupported claims across turns, identify repeated substrings, and verify each repetition appears in propagation flags with correct indices

Output Schema Conformance

The full JSON output validates against the expected [OUTPUT_SCHEMA] with all required fields present and correctly typed

Schema validation fails due to missing required field, incorrect type, or extra fields not in schema

Run JSON Schema validator against output using the defined [OUTPUT_SCHEMA] and assert no validation errors

Abstention Handling

When [SOURCE_CONTEXT] is empty for a turn, the grounding score is null and the turn is flagged with reason 'NO_SOURCE_CONTEXT_PROVIDED'

Non-null score assigned when source context is empty, or abstention reason is missing or incorrect

Provide a test conversation with one turn that has empty source context, assert score is null and abstention reason matches expected string

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single conversation log. Remove the per-turn source context requirement initially—just score grounding against the provided [SOURCE_CONTEXT] block for the whole session. Use a simple 1–5 scale without detailed justification to reduce output length and speed up iteration.

Prompt modification

  • Replace the detailed scoring rubric with: Score each turn 1 (fully ungrounded) to 5 (fully grounded). Return JSON: { "turn_scores": [ { "turn_index": int, "score": int } ] }
  • Drop the unsupported claim extraction and session trend line requirements.
  • Use a single [FULL_CONVERSATION] input instead of per-turn [TURN_i] blocks.

Watch for

  • Scores that look plausible but don't match manual review
  • Missing turn indices when the conversation has system messages or tool calls
  • Overly generous scores when the model paraphrases source material 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.