Skip to main content

Exact Match

Available

llm.exact_match

Checks whether the response is word-for-word identical to the reference answer.

Contract​

FieldValue
version1.0.0
metric_typepointwise
scorer_contractper_row
directionhigher_is_better
entrypointaip_metrics_llm.answered.exact_match
target_kindNone

Required columns​

  • input_id
  • prompt
  • expected_output
  • sut_response

Accepted schemas​

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

Methodology​

  1. Deterministic - no LLM. Pure string comparison.
  2. Optionally strip surrounding whitespace (default on) and lowercase both strings (default case-insensitive).
  3. Return 1.0 if the response equals the reference, else 0.0.

Score semantics​

The score is binary - 1.0 if the response exactly matches the reference, otherwise 0.0. Higher is better.

Worked example​

Reference 'Paris' with response ' paris ' matches after strip/lowercase -> 1.0; 'Paris, France' -> 0.0.

Configuration schema​

{
"properties": {
"case_sensitive": {
"default": false,
"title": "Case Sensitive",
"type": "boolean"
},
"concurrency_limit": {
"default": 10,
"title": "Concurrency Limit",
"type": "integer",
"x-aip-param-role": "operational"
},
"huggingface_config_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Huggingface Config Name"
},
"huggingface_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Huggingface Path"
},
"inverted": {
"default": false,
"title": "Inverted",
"type": "boolean",
"x-aip-param-role": "scoring_metadata"
},
"max": {
"default": 1.0,
"title": "Max",
"type": "number",
"x-aip-param-role": "scoring_metadata"
},
"metric_name": {
"default": "exact_match",
"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"
},
"strip": {
"default": true,
"title": "Strip",
"type": "boolean"
},
"system_type": {
"default": "llm",
"enum": [
"llm",
"vlm",
"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": null,
"processing_kind": "cpu",
"stream_batch_size": null,
"timeout_seconds": 60
}

Complete manifest​

accepts:
- name: gdi_text_v1
task_types:
- multi_turn_llm
- multi_turn_rag
- single_turn_llm
- single_turn_rag
config_schema:
properties:
case_sensitive:
default: false
title: Case Sensitive
type: boolean
concurrency_limit:
default: 10
title: Concurrency Limit
type: integer
x-aip-param-role: operational
huggingface_config_name:
anyOf:
- type: string
- type: 'null'
default: null
title: Huggingface Config Name
huggingface_path:
anyOf:
- type: string
- type: 'null'
default: null
title: Huggingface Path
inverted:
default: false
title: Inverted
type: boolean
x-aip-param-role: scoring_metadata
max:
default: 1.0
title: Max
type: number
x-aip-param-role: scoring_metadata
metric_name:
default: exact_match
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
strip:
default: true
title: Strip
type: boolean
system_type:
default: llm
enum:
- llm
- vlm
- 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: Is the response word-for-word identical to the reference answer?
direction: higher_is_better
display_name: Exact Match
entrypoint: aip_metrics_llm.answered.exact_match
execution:
emits_metric_family: false
function_name: null
max_concurrency: null
processing_kind: cpu
stream_batch_size: null
timeout_seconds: 60
kind: metric
manifest_version: '1'
max_prompt_slots: 0
metric_metadata:
methodology:
- Deterministic - no LLM. Pure string comparison.
- Optionally strip surrounding whitespace (default on) and lowercase both strings
(default case-insensitive).
- Return 1.0 if the response equals the reference, else 0.0.
score_semantics: The score is binary - 1.0 if the response exactly matches the reference,
otherwise 0.0. Higher is better.
summary: Checks whether the response is word-for-word identical to the reference
answer.
worked_example: Reference 'Paris' with response ' paris ' matches after strip/lowercase
-> 1.0; 'Paris, France' -> 0.0.
metric_type: pointwise
name: llm.exact_match
partition_types: []
required_columns:
- input_id
- prompt
- expected_output
- sut_response
required_kinds: []
scorer_contract: per_row
target_kind: null
unsupported_trace_shapes: []
version: 1.0.0