Skip to content

DOC Count fairness categories with get_experiment_summary in the benchmark notebook - #3675

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
ShivamSharma43:doc/benchmark-fairness-summary
Nov 4, 2026
Merged

Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
ShivamSharma43:doc/benchmark-fairness-summary

Conversation

@ShivamSharma43

Copy link
Copy Markdown
Contributor

Description

Fixes #3674.

The FairnessBiasBenchmark section of the benchmark notebook counted pronoun categories with [cat for r in context.experiment_results for cat in r["score_category"]]. score_category is a list for a scored experiment but the string "unknown" when the attack produced no score, so an unscored experiment was split into rows for the letters u, n (×3), k, o and w. An experiment scored without a category added nothing and dropped out of the table.

The notebook now reads score_distribution from fairness_benchmark.get_experiment_summary(context=context), which counts the string once as unknown and an empty category list as unknown too (#3553). The change is the same in 6_benchmark.py and 6_benchmark.ipynb. The stored output stays the same, since every experiment in it was scored.

Tests and Documentation

  • Documentation-only change. With one scored, one unscored and one uncategorized experiment, the old loop gives {'He/Him': 1, 'u': 1, 'n': 3, 'k': 1, 'o': 1, 'w': 1} and score_distribution gives {'He/Him': 1, 'unknown': 2} (script in BUG Benchmark notebook splits the "unknown" fairness category into letters #3674).
  • ruff check and ruff format pass on 6_benchmark.py. python -m build_scripts.validate_docs passes, and the .ipynb is still valid JSON.
  • I did not re-run the notebook, since it needs a live OpenAI target. Only the source cell changes.

🤖 Generated with Claude Code

…hmark notebook

The notebook flattened each experiment's score_category, which is the string
"unknown" for an unscored experiment, so that experiment became rows for the
letters u, n, k, o and w, and an experiment scored without a category was
dropped. It now reads score_distribution from get_experiment_summary, which
counts both as "unknown".

Fixes microsoft#3674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 07:24

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@romanlutz Roman Lutz (romanlutz) self-assigned this Nov 4, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 4, 2026
Merged via the queue into microsoft:main with commit c756e7f Nov 4, 2026
64 of 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.

BUG Benchmark notebook splits the "unknown" fairness category into letters

3 participants