Skip to content

FIX Make scorer batch evaluation eligibility explicit - #4013

Open
hannahwestra25 wants to merge 4 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-scorer-batch-eligibility
Open

hannahwestra25 wants to merge 4 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-scorer-batch-eligibility

Conversation

@hannahwestra25

@hannahwestra25 hannahwestra25 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #3832. Skip unconfigured raw Decision in batch benchmarks; retain its threshold wrapper. Partial scores can mislead rankings: rank objective F1 only with known, positive, complete coverage; preserve and diagnose configured fallbacks. Metrics remain unchanged.

Follow-up: paired/shared-subset comparisons using stable per-example response-objective IDs and retained outcomes, alongside coverage. Aggregates cannot reconstruct them; small/nonrepresentative intersections need an explicit coverage policy. Richer abstention accounting and backfills remain deferred.

Tests and Documentation

189 tests passed; one pre-existing ty-warning failure. Ruff/docs passed; typing warning-only. Notebook synchronized, unexecuted; outputs preserved. Benchmarks not rerun.

Exclude the raw Decision scorer from automatic batch evaluation while keeping its threshold wrapper eligible. Preserve strict failures for unconfigured candidates and empty selections, and document the generic batch-only policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 17:01

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.

🟢 Approval recommended

No active review issues are reported for the changes that make batch-evaluation eligibility explicit.

No open issues 🎉

What changed in this PR

Following #3832, this PR makes batch-evaluation eligibility explicit in PyRIT without changing metric semantics or scorer availability for normal use.

Changes:

  • Adds skip_batch_evaluation tagging to exclude the raw Decision scorer while keeping its threshold wrapper eligible.
  • Makes empty eligible selections fail while preserving failures for missing mappings and evaluation errors.
  • Adds regression tests and updates batch-evaluation documentation.
File Description
tests/​unit/​setup/​test_scorer_initializer.py Verifies Decision scorer mappings and exclusion tagging.
tests/​unit/​build_scripts/​test_evaluate_scorers.py Tests wrapper evaluation, failure handling, and empty selections.
pyrit/​setup/​initializers/​scorers.py Defines the exclusion tag and applies it to the raw Decision scorer.
doc/​contributing/​10_release_process.md Documents batch eligibility and failure behavior for releases.
doc/​code/​scoring/​4_scorer_metrics.py Updates batch-evaluation guidance.
doc/​code/​scoring/​4_scorer_metrics.ipynb Synchronizes notebook documentation with the paired Python file.
build_scripts/​evaluate_scorers.py Filters excluded scorers, reports skips, and rejects empty selections.

Review effort: Balanced

Copilot AI and others added 3 commits November 6, 2026 12:35
Rank F1 only with known positive complete coverage. Preserve configured fallback choices and tags with explicit diagnostics, and document the selection boundary without changing persisted metrics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep batch exclusion, complete-coverage ranking, and configured fallback guidance concise in paired notebook sources. Preserve code cells and saved outputs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
from pyrit.registry import ScorerRegistry
from pyrit.setup import IN_MEMORY, initialize_pyrit_async
from pyrit.setup.initializers import ScorerInitializer, TargetInitializer
from pyrit.setup.initializers.scorers import ScorerInitializerTags

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.

I'd hope we can shorten this import

This branch has not been deployed

No deployments
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.

4 participants