Skip to main content

Perturbation Robustness (External)

Available

llm.perturbation_robustness_external

Measures how consistently the system stays correct across meaning-preserving variants of a question, from a pre-scored dataset with off-platform SUT responses.

Contract​

FieldValue
version1.0.0
metric_typepointwise
scorer_contractfull_dataset
directionhigher_is_better
entrypointaip_metrics_llm.unanswered.perturbation_robustness_external
target_kindNone

Required columns​

  • input_id
  • prompt
  • sut_response

Accepted schemas​

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

Methodology​

  1. This metric is pure scoring; it does not generate perturbations or call the system under test. Generation lives in the aip_sdg_llm.augmentation.perturbation_robustness_external SDG recipe; SUT inference happens off-platform.
  2. Rows are grouped by metadata.original_query; the baseline row (query equals original_query) and its perturbed variants are identified within each group.
  3. The judge scores base correctness, perturbed correctness, and a per-pair robustness score, reusing the hosted perturbation_robustness metric's judges and aggregation.
  4. Combine as 0.5 times mean robustness plus 0.5 times max(0, 1 minus mean correctness drop); the group score is replicated to every row in the group.

Score semantics​

Scores range 0-1, blending consistency across variants with the drop in correctness. A high score means answers stay correct and stable under rewording; a low score means correctness degrades. Higher is better.

Worked example​

Mean robustness 0.9 with a small correctness drop of 0.1 -> 0.50.9 + 0.50.9 = 0.9.

Configuration schema​

{
"properties": {
"groundtruth_context": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Groundtruth Context"
},
"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": "perturbation_robustness_external",
"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"
},
"reference_answer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reference Answer"
},
"sub_call_concurrency_limit": {
"default": 5,
"maximum": 64,
"minimum": 1,
"title": "Sub Call Concurrency Limit",
"type": "integer",
"x-aip-param-role": "operational"
},
"timeout_seconds": {
"default": 60.0,
"exclusiveMinimum": 0,
"title": "Timeout Seconds",
"type": "number",
"x-aip-param-role": "operational"
},
"weight": {
"default": 1.0,
"title": "Weight",
"type": "number",
"x-aip-param-role": "scoring_metadata"
}
},
"title": "PerturbationRobustnessExternalConfig",
"type": "object"
}

Execution​

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

Complete manifest​

accepts:
- name: gdi_text_v1
task_types:
- multi_turn_llm
- multi_turn_rag
- single_turn_llm
- single_turn_rag
config_schema:
properties:
groundtruth_context:
anyOf:
- type: string
- type: 'null'
default: null
title: Groundtruth Context
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: perturbation_robustness_external
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
reference_answer:
anyOf:
- type: string
- type: 'null'
default: null
title: Reference Answer
sub_call_concurrency_limit:
default: 5
maximum: 64
minimum: 1
title: Sub Call Concurrency Limit
type: integer
x-aip-param-role: operational
timeout_seconds:
default: 60.0
exclusiveMinimum: 0
title: Timeout Seconds
type: number
x-aip-param-role: operational
weight:
default: 1.0
title: Weight
type: number
x-aip-param-role: scoring_metadata
title: PerturbationRobustnessExternalConfig
type: object
dependencies: []
description: How consistently does the system stay correct across equivalent question
variants, scored from off-platform SUT responses?
direction: higher_is_better
display_name: Perturbation Robustness (External)
entrypoint: aip_metrics_llm.unanswered.perturbation_robustness_external
execution:
emits_metric_family: false
function_name: null
max_concurrency: 8
processing_kind: network
stream_batch_size: null
timeout_seconds: 900
kind: metric
manifest_version: '1'
max_prompt_slots: 0
metric_metadata:
methodology:
- This metric is pure scoring; it does not generate perturbations or call the system
under test. Generation lives in the aip_sdg_llm.augmentation.perturbation_robustness_external
SDG recipe; SUT inference happens off-platform.
- Rows are grouped by metadata.original_query; the baseline row (query equals original_query)
and its perturbed variants are identified within each group.
- The judge scores base correctness, perturbed correctness, and a per-pair robustness
score, reusing the hosted perturbation_robustness metric's judges and aggregation.
- Combine as 0.5 times mean robustness plus 0.5 times max(0, 1 minus mean correctness
drop); the group score is replicated to every row in the group.
score_semantics: Scores range 0-1, blending consistency across variants with the
drop in correctness. A high score means answers stay correct and stable under
rewording; a low score means correctness degrades. Higher is better.
summary: Measures how consistently the system stays correct across meaning-preserving
variants of a question, from a pre-scored dataset with off-platform SUT responses.
worked_example: Mean robustness 0.9 with a small correctness drop of 0.1 -> 0.5*0.9
+ 0.5*0.9 = 0.9.
metric_type: pointwise
name: llm.perturbation_robustness_external
partition_types: []
required_columns:
- input_id
- prompt
- sut_response
required_kinds: []
scorer_contract: full_dataset
target_kind: null
unsupported_trace_shapes: []
version: 1.0.0