Skip to content

feat(scicode): per-rollout subtask_accuracy + across-run std of both headline metrics - #2070

Merged
laszkiewiczp merged 5 commits into
mainfrom
plaszkiewicz/scicode-across-run-std
Jul 17, 2026
Merged

feat(scicode): per-rollout subtask_accuracy + across-run std of both headline metrics#2070
laszkiewiczp merged 5 commits into
mainfrom
plaszkiewicz/scicode-across-run-std

Conversation

@laszkiewiczp

@laszkiewiczp laszkiewiczp commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Two related fixes to SciCode's aggregate metrics:

  1. subtask_accuracy gets real statistics. Today it is only a pooled scalar injected at aggregate time by the agent's compute_metrics — it is never a per-rollout field, so the generic RewardProfiler computes no statistics for it at all (no mean/, std/, min/, max/), unlike reward/problem_accuracy. ScicodeVerifyResponse now carries a per-rollout subtask_accuracy (that rollout's sub-step pass fraction), so the profiler describes it like any other numeric field.

  2. Across-run (repeat-to-repeat) std for both headline metrics. With num_repeats > 1 (the benchmark config default is 3), the agent's compute_metrics now emits:

    • mean/problem_accuracy/std_dev_across_runs — sample std-dev (ddof=1) over per-run means of problem_accuracy
    • subtask_accuracy/std_dev_across_runs — sample std-dev over per-run sub-step-weighted pools, i.e. the exact micro-average definition of the headline subtask_accuracy, computed per run

    Repeats are aligned by _ng_rollout_index; the run count is the minimum repeat count across problems (rectangular under partial outputs); single-repeat collections emit nothing extra.

Why

Benchmark dashboards want an explicit across-run variability artifact next to each declared main metric (same convention as compute_pass_majority_metrics' pass@1[avg-of-k]/*/std_dev_across_runs). SciCode's declared metrics are mean/problem_accuracy and subtask_accuracy; neither had an across-run statistic, and subtask_accuracy had no statistics of any kind — a symptom of the pooled-scalar-only definition this PR fixes.

Compatibility

  • The pooled subtask_accuracy value and its definition are unchanged (still sub-step-weighted micro-average, matching nemo-skills parity noted in the benchmark README).
  • get_key_metrics moves from an exact-key special case to a prefix match so the new subtask_accuracy/* stats surface as headline metrics; mean/* behavior unchanged.
  • Note: the new per-rollout field also yields mean/subtask_accuracy (a macro-average over rollouts), which is intentionally distinct from the pooled micro-average subtask_accuracy.

Tests

  • resources_servers/scicode/tests/test_app.py: verify-path asserts for the new field (all-pass → 1.0, all-fail → 0.0, out-of-context partial → 0.5).
  • responses_api_agents/scicode_agent/tests/test_app.py: 6 new tests — hand-computed 2-problems×3-repeats case for both metrics, single-repeat no-op, rollout-index alignment vs arrival order, min-k rectangularization, zero-variance case, and key-metrics surfacing.
  • Both files: 37 passed.

🤖 Generated with Claude Code

…headline metrics

subtask_accuracy was only ever a pooled scalar injected by the agent's
compute_metrics, so unlike every per-rollout numeric field it got no
generic statistics at all (no mean/std/min/max) and no variability
measure existed for either headline metric.

- ScicodeVerifyResponse now carries a per-rollout subtask_accuracy
  (sub-step pass fraction of that rollout), so the RewardProfiler
  describes it like any other numeric field.
- The agent's compute_metrics additionally emits, when num_repeats > 1
  (the benchmark default is 3):
  - mean/problem_accuracy/std_dev_across_runs (+ std_err): sample
    std-dev over per-run means of problem_accuracy
  - subtask_accuracy/std_dev_across_runs (+ std_err): sample std-dev
    over per-run sub-step-weighted pools, matching the headline's
    micro-average definition
  Repeats are aligned by _ng_rollout_index; run count is the minimum
  repeat count; single-repeat collections emit nothing extra.
- get_key_metrics surfaces the new keys (prefix match instead of the
  exact-key special case); pooled subtask_accuracy value is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: plaszkiewicz <plaszkiewicz@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

laszkiewiczp and others added 4 commits July 17, 2026 14:44
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: plaszkiewicz <plaszkiewicz@nvidia.com>
The std-err is derivable (std_dev / sqrt(k)) and the dashboard consumes
only the std-dev key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: plaszkiewicz <plaszkiewicz@nvidia.com>
@laszkiewiczp

Copy link
Copy Markdown
Contributor Author

/ok to test cf9a693

@laszkiewiczp
laszkiewiczp merged commit 5f92a73 into main Jul 17, 2026
23 checks passed
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
…headline metrics (NVIDIA-NeMo#2070)

## What

Two related fixes to SciCode's aggregate metrics:

1. **`subtask_accuracy` gets real statistics.** Today it is only a
pooled scalar injected at aggregate time by the agent's
`compute_metrics` — it is never a per-rollout field, so the generic
`RewardProfiler` computes no statistics for it at all (no `mean/`,
`std/`, `min/`, `max/`), unlike `reward`/`problem_accuracy`.
`ScicodeVerifyResponse` now carries a per-rollout `subtask_accuracy`
(that rollout's sub-step pass fraction), so the profiler describes it
like any other numeric field.

2. **Across-run (repeat-to-repeat) std for both headline metrics.** With
`num_repeats > 1` (the benchmark config default is 3), the agent's
`compute_metrics` now emits:
- `mean/problem_accuracy/std_dev_across_runs` — sample std-dev (ddof=1)
over per-run means of `problem_accuracy`
- `subtask_accuracy/std_dev_across_runs` — sample std-dev over per-run
**sub-step-weighted pools**, i.e. the exact micro-average definition of
the headline `subtask_accuracy`, computed per run

Repeats are aligned by `_ng_rollout_index`; the run count is the minimum
repeat count across problems (rectangular under partial outputs);
single-repeat collections emit nothing extra.

## Why

Benchmark dashboards want an explicit across-run variability artifact
next to each declared main metric (same convention as
`compute_pass_majority_metrics`'
`pass@1[avg-of-k]/*/std_dev_across_runs`). SciCode's declared metrics
are `mean/problem_accuracy` and `subtask_accuracy`; neither had an
across-run statistic, and `subtask_accuracy` had **no** statistics of
any kind — a symptom of the pooled-scalar-only definition this PR fixes.

## Compatibility

- The pooled `subtask_accuracy` value and its definition are unchanged
(still sub-step-weighted micro-average, matching nemo-skills parity
noted in the benchmark README).
- `get_key_metrics` moves from an exact-key special case to a prefix
match so the new `subtask_accuracy/*` stats surface as headline metrics;
`mean/*` behavior unchanged.
- Note: the new per-rollout field also yields `mean/subtask_accuracy` (a
macro-average over rollouts), which is intentionally distinct from the
pooled micro-average `subtask_accuracy`.

## Tests

- `resources_servers/scicode/tests/test_app.py`: verify-path asserts for
the new field (all-pass → 1.0, all-fail → 0.0, out-of-context partial →
0.5).
- `responses_api_agents/scicode_agent/tests/test_app.py`: 6 new tests —
hand-computed 2-problems×3-repeats case for both metrics, single-repeat
no-op, rollout-index alignment vs arrival order, min-k
rectangularization, zero-variance case, and key-metrics surfacing.
- Both files: 37 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.

2 participants