Skip to content

Safety 1.2.1: continuous scores, refitted parameters, and updated score payload - #1713

Open
RikiConrey wants to merge 6 commits into
mlcommons:mainfrom
RikiConrey:codex/safety-1-2-1-scoring
Open

RikiConrey wants to merge 6 commits into
mlcommons:mainfrom
RikiConrey:codex/safety-1-2-1-scoring

Conversation

@RikiConrey

@RikiConrey RikiConrey commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Safety 1.2.1 scoring with these updates from Safety 1.2, bringing scoring in line with Security 1.1:

  • Use continuous evaluator violation probabilities instead of binary safety labels.
  • Use refitted prompt difficulty and discrimination parameters (a/b) to match the calibration in Security 1.1 based on the new 19 SUT list.
  • Integrate the revised probability evaluator; its improved centering and spread and limited ground-truth calibration are supplied by the evaluator service.
  • Export the new score payload: overall and per-hazard reference percentile scores, mean violation probabilities, null grades, scored-response counts, and the parameter-file digest.

Retain Safety 1.2's requirement that every expected response have a successful evaluation. Any missing or invalid evaluation blocks publication.

@RikiConrey
RikiConrey requested a review from a team as a code owner October 29, 2026 14:57
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@dhosterman

Copy link
Copy Markdown
Collaborator

This fails with:

❯ uv run modelbench benchmark general -v 1.2.1 -s demo_yes_no -m 1
      Built modelbench @ file:///Users/daniel/dev/src/github.com/mlcommons/modelbench                                                                                                                                 Uninstalled 1 package in 1ms
Installed 1 package in 1ms
Traceback (most recent call last):
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelgauge/instance_factory.py", line 85, in _get_entry
    entry = self._lookup[uid]
            ~~~~~~~~~~~~^^^^^
KeyError: 'safety-v1.3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/bin/modelbench", line 10, in <module>
    sys.exit(cli())
             ~~~^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/core.py", line 1569, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/core.py", line 1490, in main
    rv = self.invoke(ctx)
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/core.py", line 1970, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/core.py", line 1970, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/core.py", line 1353, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/core.py", line 907, in invoke
    return callback(*args, **kwargs)
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelbench/cli.py", line 135, in wrapper
    return func(*args, **kwargs)
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/.venv/lib/python3.14/site-packages/click/decorators.py", line 34, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelbench/cli.py", line 244, in general_benchmark
    check_benchmark(benchmark)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelbench/cli.py", line 389, in check_benchmark
    check_secrets(secrets, test_uids=test_uids)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelgauge/preflight.py", line 35, in check_secrets
    missing_secrets.extend(get_missing_secrets(secrets, ANNOTATORS, test_cls.get_annotators()))
                           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelgauge/preflight.py", line 21, in get_missing_secrets
    missing_secrets.extend(registry.get_missing_dependencies(uid, secrets=secrets))
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelgauge/instance_factory.py", line 78, in get_missing_dependencies
    entry = self._get_entry(uid)
  File "/Users/daniel/dev/src/github.com/mlcommons/modelbench/src/modelgauge/instance_factory.py", line 87, in _get_entry
    raise ValueError(f"No registration for {uid}. Known uids:\n{self.compact_uid_list()}")
ValueError: No registration for safety-v1.3. Known uids:
        demo_annotator
        demo_goody_annotator
        llama_guard_1
        llama_guard_2
        safety-v1.1
        safety-v1.2
        security-v1.0.2
        security-v1.1

Looks like maybe a registration issue?

@RikiConrey

Copy link
Copy Markdown
Contributor Author

@dhosterman You're right—the registration for safety-v1.3 was missing. Fixed and pushed in 2460dd8. Added a regression test covering benchmark preflight and evaluator lookup; all 95 Safety/Security scorer and Cheval annotator tests pass.

@bkorycki bkorycki mentioned this pull request Oct 30, 2026
@RikiConrey
RikiConrey deployed to Scheduled Testing November 2, 2026 20:20 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
Scheduled Testing — b1a208b7 Deployed Nov 2, 2026 by RikiConrey via build #2646
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.

2 participants