Skip to main content

Answer Faithfulness

Available

rag.faithfulness

Measures how well the answer sticks to the retrieved sources, penalising claims the context does not support.

Contract​

FieldValue
version1.0.0
metric_typepointwise
scorer_contractper_row
directionhigher_is_better
entrypointaip_metrics_rag.unanswered.faithfulness
target_kindNone

Required columns​

  • input_id
  • prompt
  • sut_response
  • retrieved_context

Accepted schemas​

[
{
"name": "gdi_text_v1",
"task_types": [
"multi_turn_rag",
"single_turn_rag"
]
}
]

Methodology​

  1. An LLM judge (custom Ragas-based faithfulness metric) decomposes the answer into atomic claims.
  2. A relevance filter drops claims that are not relevant to the question.
  3. Each surviving claim is checked against the retrieved context with a natural-language-inference verdict of supported vs not-supported (a failing claim also carries a finer reason of unsupported, contradicted, wrong_entity, or overclaim).
  4. The score is the mean of the per-claim verdicts, normalised to 0-1 (0.0 if no claims survive).

Score semantics​

Scores range 0-1, the fraction of relevant answer claims that are supported by the retrieved context. A high score means every claim is grounded; a low score means the answer hallucinated or contradicted the sources. Higher is better.

Worked example​

An answer yields 5 claims; 1 is filtered as irrelevant, and of the 4 judged, 3 are supported and 1 contradicts the context -> 3/4 = 0.75.

Configuration schema​

{
"properties": {
"concurrency_limit": {
"default": 10,
"title": "Concurrency Limit",
"type": "integer",
"x-aip-param-role": "operational"
},
"inverted": {
"default": false,
"title": "Inverted",
"type": "boolean",
"x-aip-param-role": "scoring_metadata"
},
"lang": {
"default": "en",
"enum": [
"en",
"de",
"fr"
],
"title": "Lang",
"type": "string"
},
"max": {
"default": 1.0,
"title": "Max",
"type": "number",
"x-aip-param-role": "scoring_metadata"
},
"metric_name": {
"default": "faithfulness",
"title": "Metric Name",
"type": "string",
"x-aip-param-role": "scoring_metadata"
},
"min": {
"default": 0.0,
"title": "Min",
"type": "number",
"x-aip-param-role": "scoring_metadata"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "gpt-4o",
"title": "Model"
},
"system_type": {
"const": "rag",
"default": "rag",
"title": "System Type",
"type": "string",
"x-aip-param-role": "judge_wiring"
},
"weight": {
"default": 1.0,
"title": "Weight",
"type": "number",
"x-aip-param-role": "scoring_metadata"
}
},
"title": "InitializationConfig",
"type": "object"
}

Execution​

{
"emits_metric_family": false,
"function_name": null,
"max_concurrency": 8,
"processing_kind": "network",
"stream_batch_size": 5000,
"timeout_seconds": 21600
}

Complete manifest​

accepts:
- name: gdi_text_v1
task_types:
- multi_turn_rag
- single_turn_rag
config_schema:
properties:
concurrency_limit:
default: 10
title: Concurrency Limit
type: integer
x-aip-param-role: operational
inverted:
default: false
title: Inverted
type: boolean
x-aip-param-role: scoring_metadata
lang:
default: en
enum:
- en
- de
- fr
title: Lang
type: string
max:
default: 1.0
title: Max
type: number
x-aip-param-role: scoring_metadata
metric_name:
default: faithfulness
title: Metric Name
type: string
x-aip-param-role: scoring_metadata
min:
default: 0.0
title: Min
type: number
x-aip-param-role: scoring_metadata
model:
anyOf:
- type: string
- type: 'null'
default: gpt-4o
title: Model
system_type:
const: rag
default: rag
title: System Type
type: string
x-aip-param-role: judge_wiring
weight:
default: 1.0
title: Weight
type: number
x-aip-param-role: scoring_metadata
title: InitializationConfig
type: object
dependencies: []
description: How well does the answer stick to the retrieved sources without unsupported
claims?
direction: higher_is_better
display_name: Answer Faithfulness
entrypoint: aip_metrics_rag.unanswered.faithfulness
execution:
emits_metric_family: false
function_name: null
max_concurrency: 8
processing_kind: network
stream_batch_size: 5000
timeout_seconds: 21600
kind: metric
manifest_version: '1'
max_prompt_slots: 0
metric_metadata:
methodology:
- An LLM judge (custom Ragas-based faithfulness metric) decomposes the answer into
atomic claims.
- A relevance filter drops claims that are not relevant to the question.
- Each surviving claim is checked against the retrieved context with a natural-language-inference
verdict of supported vs not-supported (a failing claim also carries a finer reason
of unsupported, contradicted, wrong_entity, or overclaim).
- The score is the mean of the per-claim verdicts, normalised to 0-1 (0.0 if no
claims survive).
score_semantics: Scores range 0-1, the fraction of relevant answer claims that are
supported by the retrieved context. A high score means every claim is grounded;
a low score means the answer hallucinated or contradicted the sources. Higher
is better.
summary: Measures how well the answer sticks to the retrieved sources, penalising
claims the context does not support.
worked_example: An answer yields 5 claims; 1 is filtered as irrelevant, and of the
4 judged, 3 are supported and 1 contradicts the context -> 3/4 = 0.75.
metric_type: pointwise
name: rag.faithfulness
partition_types: []
required_columns:
- input_id
- prompt
- sut_response
- retrieved_context
required_kinds: []
scorer_contract: per_row
target_kind: null
unsupported_trace_shapes: []
version: 1.0.0