Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Scorer stability across presentations

An attack success rate rests on a scorer answering true or false, one response at a time. Scorer metrics measure how often those answers agree with human labels. ScorerStabilityEvaluator measures something that needs no labels: whether the scorer gives the same answer when the same question is put to it another way.

A presentation is one way of asking. The order the options are listed in, the wording of a label, a paraphrase of the rubric, whether the objective comes before or after the response, and formatting of the prompt all leave the question unchanged. A scorer that measures the response should not move with them. When it does, the same attack on the same target reports a different success rate, depending on a detail that is rarely written down.

Rewording a judge’s rubric has been shown to flip its verdicts beyond what reruns alone do Weng et al., 2026, and so have formatting and paraphrase changes to what the judge is shown Dev et al., 2026. The evaluator measures such changes for any PyRIT true/false scorer that can be configured for them.

What moves the reported rate

For an attack success rate, read positive_rate_shift first:

A presentation can also change many verdicts without moving the reported rate, by moving as many one way as the other. That is measured separately, below.

Why a flip rate is not enough

Counting the responses whose verdict differs between two presentations overstates the effect, because a scorer that samples also disagrees with itself when nothing changes. The evaluator therefore scores every presentation more than once and splits what it sees:

flip rate = repeat flip rate + presentation effect

With a single run (num_repeats=1) the noise cannot be measured, so repeat_flip_rate, presentation_effect and its p-value are None; the shift is still reported and tested.

Running an evaluation

The scorer under test is the reference. Each ScorerPresentation names another way of asking and carries a scorer already configured for it. Anything a scorer’s constructor accepts can be a presentation. For SelfAskRefusalScorer and SelfAskGeneralTrueFalseScorer, prompt_format_string decides the field order, the field labels and the formatting of the prompt:

from pyrit.common.path import SCORER_EVALS_PATH
from pyrit.score import (
    HumanLabeledDataset,
    MetricsType,
    ScorerPresentation,
    ScorerStabilityEvaluator,
    SelfAskRefusalScorer,
)

evaluator = ScorerStabilityEvaluator(
    scorer=SelfAskRefusalScorer(chat_target=chat_target),
    presentations=[
        ScorerPresentation(
            name="response_first",
            scorer=SelfAskRefusalScorer(
                chat_target=chat_target,
                prompt_format_string="response_to_evaluate_input: {response}\nconversation_objective: {objective}",
            ),
        ),
        ScorerPresentation(
            name="short_labels",
            scorer=SelfAskRefusalScorer(
                chat_target=chat_target,
                prompt_format_string="objective: {objective}\nresponse: {response}",
            ),
        ),
        ScorerPresentation(
            name="trailing_newline",
            scorer=SelfAskRefusalScorer(
                chat_target=chat_target,
                prompt_format_string="conversation_objective: {objective}\nresponse_to_evaluate_input: {response}\n",
            ),
        ),
    ],
)

dataset = HumanLabeledDataset.from_csv(
    csv_path=SCORER_EVALS_PATH / "refusal_scorer" / "refusal.csv",
    metrics_type=MetricsType.OBJECTIVE,
)
metrics = await evaluator.evaluate_dataset_async(labeled_dataset=dataset, num_repeats=3)

for effect in metrics.effects:
    print(
        effect.name,
        f"rate moves {effect.positive_rate_shift:+.1%} (p={effect.positive_rate_shift_p_value:.3f})",
        f"flips {effect.flip_rate:.1%}",
        f"noise {effect.repeat_flip_rate:.1%}",
        f"effect {effect.presentation_effect:.3f} (p={effect.presentation_effect_p_value:.3f})",
        f"accuracy {effect.metrics.accuracy:.1%} vs {metrics.reference_metrics.accuracy:.1%}",
    )

For SelfAskTrueFalseScorer, a system_prompt_template that lists the false description before the true one gives an option-order presentation, and a reworded TrueFalseQuestion gives a paraphrase.

Every presentation must differ from the reference in configuration, and must use the same judge model, temperature and top_p. The evaluator checks both when it is built, because a judge change would read as a presentation effect. A run makes (presentations + 1) x num_repeats x responses scoring calls. Each round scores every response once under every presentation, so a change in the judge model over time falls on all of them alike.

On a labeled dataset, reference_metrics and each effect’s metrics hold that scorer’s ObjectiveScorerMetrics, computed as ObjectiveScorerEvaluator computes them with num_repeats trials. accuracy, f1_score and the rest therefore mean what they mean in the scorer metrics registry. num_repeats defaults to 3, the number of trials Scorer.evaluate_async records.

Stability needs no labels. evaluate_conversations_async takes conversations and a ScoringExpectation for each directly, so it also runs on the responses of an attack, and on scorers that need typed conditions. The conversations must already be in memory, as an attack’s are, because each score refers to the stored response; nothing else is added to memory. With an objective scorer, each positive_rate_shift is then how far the attack success rate of that run would move under that presentation.

Deciding whether an effect is real

Each presentation carries two permutation p-values, which make no assumption about the scorer:

Both are Holm-adjusted across the presentations of one evaluation, each kind separately, so comparing more presentations does not raise the chance of a false finding.

What to check before trusting a result

Working from recorded verdicts

metrics.to_json() writes every recorded verdict with the metrics. compute_scorer_stability computes the same stability metrics from recorded verdicts without calling a scorer, which also covers verdicts collected by another tool:

from pyrit.score import compute_scorer_stability

metrics = compute_scorer_stability(
    verdicts={
        "reference": [[True, True, False, False], [True, True, False, False]],
        "options_swapped": [[True, False, False, False], [True, False, False, True]],
    },
)

Each presentation maps to its runs, one row per run and one column per response, and every presentation needs the same number of runs. Use None for a run that reached no verdict.

References
  1. Weng, S., Feng, Y., & Xie, X. (2026). Beyond Accuracy: Policy Invariance as a Reliability Test for LLM Safety Judges. arXiv Preprint arXiv:2605.06161. https://arxiv.org/abs/2605.06161
  2. Dev, S., Sloan, A., Kavner, J., Kong, N., & Sandler, M. (2026). Judge Reliability Harness: Stress Testing the Reliability of LLM Judges. arXiv Preprint arXiv:2603.05399. https://arxiv.org/abs/2603.05399