Skip to content

DOC: Explain the combined and gold-vs-model Krippendorff alphas - #4270

Merged
hannahwestra25 merged 3 commits into
microsoft:mainfrom
Allan-dq:docs/alpha-gold-model-followup
Nov 23, 2026
Merged

hannahwestra25 merged 3 commits into
microsoft:mainfrom
Allan-dq:docs/alpha-gold-model-followup

Conversation

@Allan-dq

Copy link
Copy Markdown
Contributor

Description

Follow-up to #4181, as agreed on #4129. krippendorff_alpha_combined counts every scoring trial as a rater, so it rises with num_scorer_trials, but the docs page, its docstring and the GUI presented it as agreement between humans and the model.

  • Docstring of krippendorff_alpha_combined: say that trials count as raters, and point to krippendorff_alpha_gold_model.
  • Scorer metrics doc page (.py and .ipynb): describe both alphas.
  • GUI: rename the registry's "Agreement" column to "Combined alpha", with a tooltip saying what it pools; add a label and description for krippendorff_alpha_gold_model, which the metrics details show when it is recorded.

The registry column still shows the combined alpha, because the published registry entries were computed before krippendorff_alpha_gold_model existed. Once they are regenerated, the column could switch to the gold-vs-model value; I left that for you to decide.

Follow-up to microsoft#4181 (microsoft#4129), agreed with the maintainer on microsoft#4129. The
combined alpha counts every scoring trial as a rater, so it rises with
num_scorer_trials; the docs, the docstring and the GUI presented it as
agreement between humans and the model.

- Docstring of krippendorff_alpha_combined: say that trials count as
  raters and point to krippendorff_alpha_gold_model.
- Scorer metrics doc page (.py and .ipynb): describe both alphas.
- GUI: rename the "Agreement" column to "Combined alpha" with a tooltip
  that says what it pools, and add a label and description for
  krippendorff_alpha_gold_model. The column keeps the combined value,
  since the published registry entries predate the new field.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:57
@Allan-dq

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The alpha description incorrectly promises trial-count independence and needs to clarify across the documentation, frontend text, and test that only repeating identical trial results does not inflate it.

1 open issue
What changed in this PR

This follow-up to #4181 clarifies how PyRIT’s combined and gold-vs-model Krippendorff alphas differ, addressing the misleading presentation reported in #4129. Metric calculations remain unchanged.

Changes:

  • Explain both metrics in the docstring and paired documentation.
  • Rename the registry column to “Combined alpha” and add gold-vs-model display text, while retaining existing registry values.
  • Update frontend tests for the revised labels and descriptions.
File Description
pyrit/​score/​scorer_evaluation/​scorer_metrics.py Clarifies the combined-alpha docstring.
frontend/​src/​utils/​scorerPresentation.ts Updates alpha labels and descriptions.
frontend/​src/​utils/​scorerPresentation.test.ts Adds assertions for both alpha descriptions and labels.
frontend/​src/​components/​Scorers/​ScorerEvaluationDetails.test.tsx Updates the expected combined-alpha label.
frontend/​src/​components/​Registry/​ScorerRegistry.tsx Renames the registry column to “Combined alpha.”
frontend/​src/​components/​Registry/​ScorerRegistry.test.tsx Updates header and sorting checks for the renamed column.
doc/​code/​scoring/​4_scorer_metrics.py Explains combined and gold-vs-model alpha.
doc/​code/​scoring/​4_scorer_metrics.ipynb Mirrors the explanation in the notebook.

Review effort: Balanced

Comment thread doc/code/scoring/4_scorer_metrics.py Resolved
More trials can still move the per-response median when the trials disagree, as the krippendorff_alpha_gold_model docstring says. Only repeating the same scores leaves it unchanged.
@hannahwestra25 hannahwestra25 self-assigned this Nov 19, 2026
@hannahwestra25

Copy link
Copy Markdown
Collaborator

The combined-alpha explanation should say repeated trials can inflate the value, rather than that it necessarily rises. Using this PR's evaluator with three human raters each returning [0, 1] and every model trial returning [1, 0], combined alpha decreases from 0.125 at one trial to -0.080 at two and -0.100 at three, while the model answers and MAE stay unchanged.

Suggested replacement for the frontend tooltip, metrics docstring, and both notebook formats:

Agreement among human raters and all model scoring trials pooled together. Each trial counts as a separate rater, so repeating identical model answers changes the relative weight of model and human ratings and can inflate this value. It is not guaranteed to increase with trial count. Use krippendorff_alpha_gold_model to compare gold labels with the model's per-response median score.

Update the frontend assertion accordingly:

expect(scorerMetricDescription('krippendorff_alpha_combined'))
  .toContain('can inflate this value')

Keep the gold-vs-model explanation: repeating identical scores leaves its two-row comparison unchanged. No calculation changes are needed.

Repeated identical trials change the weight of model against human
ratings in the combined alpha, which can raise it but can also lower it:
with three raters scoring [0, 1] and every trial scoring [1, 0], it goes
from 0.125 at one trial to -0.080 at two and -0.100 at three. Use the
suggested wording in the docstring, the doc page (both formats) and the
GUI description, and say the gold-vs-model alpha does not change, rather
than does not rise, when trials repeat the same scores.
@Allan-dq

Copy link
Copy Markdown
Contributor Author

Thanks hannahwestra25, you're right. I reproduced your example (0.125 → -0.080 → -0.100), and it isn't monotonic either: with five identical trials it is back up to -0.004. I've used your wording in the docstring, both notebook formats and the GUI tooltip, updated the frontend assertion to can inflate this value, and changed the gold-vs-model text from "does not rise" to "does not change" when trials repeat the same scores, so the two descriptions match.

@hannahwestra25 hannahwestra25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for contributing!

@hannahwestra25
hannahwestra25 added this pull request to the merge queue Nov 23, 2026
Merged via the queue into microsoft:main with commit 9ab573b Nov 23, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants