feat(scicode): per-rollout subtask_accuracy + across-run std of both headline metrics - #2070
Merged
Merged
Conversation
…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>
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>
Contributor
Author
|
/ok to test cf9a693 |
AdamRajfer
approved these changes
Jul 17, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related fixes to SciCode's aggregate metrics:
subtask_accuracygets real statistics. Today it is only a pooled scalar injected at aggregate time by the agent'scompute_metrics— it is never a per-rollout field, so the genericRewardProfilercomputes no statistics for it at all (nomean/,std/,min/,max/), unlikereward/problem_accuracy.ScicodeVerifyResponsenow carries a per-rolloutsubtask_accuracy(that rollout's sub-step pass fraction), so the profiler describes it like any other numeric field.Across-run (repeat-to-repeat) std for both headline metrics. With
num_repeats > 1(the benchmark config default is 3), the agent'scompute_metricsnow emits:mean/problem_accuracy/std_dev_across_runs— sample std-dev (ddof=1) over per-run means ofproblem_accuracysubtask_accuracy/std_dev_across_runs— sample std-dev over per-run sub-step-weighted pools, i.e. the exact micro-average definition of the headlinesubtask_accuracy, computed per runRepeats 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 aremean/problem_accuracyandsubtask_accuracy; neither had an across-run statistic, andsubtask_accuracyhad no statistics of any kind — a symptom of the pooled-scalar-only definition this PR fixes.Compatibility
subtask_accuracyvalue and its definition are unchanged (still sub-step-weighted micro-average, matching nemo-skills parity noted in the benchmark README).get_key_metricsmoves from an exact-key special case to a prefix match so the newsubtask_accuracy/*stats surface as headline metrics;mean/*behavior unchanged.mean/subtask_accuracy(a macro-average over rollouts), which is intentionally distinct from the pooled micro-averagesubtask_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.🤖 Generated with Claude Code