Repository navigation
feat(eval): report completion token confidence intervals - #3855
Merged
Merged
Conversation
Contributor
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 1, 2026 08:38
fad91be to
c431f6f
Compare
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 1, 2026 08:45
c431f6f to
562f50f
Compare
6 tasks done
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 1, 2026 11:03
562f50f to
9be01c5
Compare
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 2, 2026 10:16
99660a5 to
43c5072
Compare
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 2, 2026 10:23
43c5072 to
3c8e10d
Compare
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 2, 2026 10:28
3c8e10d to
cb41485
Compare
mpatel31415
force-pushed
the
codex/completion-token-welch-ci
branch
from
October 2, 2026 10:53
cb41485 to
1d3dc80
Compare
Signed-off-by: Martyna Patelka <[email protected]>
marta-sd
reviewed
Oct 8, 2026
marta-sd
left a comment
Contributor
There was a problem hiding this comment.
My agent flagged some unintended effects outside of the diff:
- Spurious "incomplete or unequal task coverage" warning (nemo_gym/reward_profile.py, _add_completion_token_metrics)
- Cause: when a repeat has ng_perf but no scored rows (all masked), the function creates a new repeat row holding only _ng_rollout_index and the token values. That row has no
sample_count or missing_count; those keys are set only at reward_profile.py:287-288.- Effect: _warn_if_repeat_samples_differ (diff.py:98) collects sample_count across repeat rows. The new row contributes None, so the set has more than one value. Comparing any run
with a masked-only repeat then emits "has incomplete or unequal task coverage across repeats; delta confidence intervals may mix task-difficulty differences with repeat variance".
That warning is about quality coverage and is wrong here.- Test gap: test_masked_only_repeat_contributes_usage_but_not_quality produces such a row but never goes through compare, so it doesn't catch this.
- Fix: make the warning ignore rows without sample_count, or keep token rows out of repeat_level_metrics. The second option would need a separate field for the Welch step.
- Token placeholder rows always appear, and the empty-state message is now dead (diff.py, report.py)
- compare_runs appends two key-metric rows (mean_completion_tokens, mean_tokens_per_turn) to every comparison, even for benchmarks and runs with no ng_perf. Every report then shows
two all-"—" rows in "Key metrics", and render_key_metrics_tables shows them too (the test change at test_compare.py:1246-1255 encodes this).- The "No key metrics were recorded for this agent." branch can no longer be reached for comparisons.
- This is deliberate (the PR says it keeps both rows visible when usage is unavailable), but I'd drop the placeholders when neither side has data, or at least remove the dead branch.
Other than that looks good 👍
Signed-off-by: Martyna Patelka <[email protected]>
marta-sd
approved these changes
Oct 9, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37910445169 |
This branch was previously deployed
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.
Issue that would simplify this implementation.
What does this PR do?
Compute completion tokens and tokens per turn from
ng_perffor each observed repeat, then use the existing repeat aggregator for their across-repeat means and confidence intervals. Comparison reads those means directly for point values and Welch differences, while keeping both rows visible when usage is unavailable.Validation
RAY_TMPDIR=/tmp /Users/mpatelka/Projects/Gym/.venv/bin/pytest -q -o cache_dir=/tmp/gym-pytest-cache tests/unit_tests/test_aggregate_metrics.py tests/unit_tests/test_compare.py tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_fern_docs_links.pypassed (541 tests, 17 subtests), and/Users/mpatelka/Projects/Gym/.venv/bin/pre-commit run --all-filespassed. The Fern CLIcheckcould not resolve its version in this local runtime (fetch failed); the documentation-link tests passed, and CI will run the Fern check.Rollouts
Two live
example_single_tool_callruns of five tasks × three repeats produced 30 healthy rollouts with zero failures; all 15 rollouts in each run recordedng_perfcompletion tokens and turn counts. I reran aggregation and comparison using those saved real rollouts, and the Markdown and JSON reports contain numeric Welch difference intervals for both token metrics.Compatibility and benchmark impact
No benchmark recipe, agent harness, or observability collector changes are needed; both metrics use the same observed
ng_perftoken evidence and may be partial when model-call usage is missing. The path supports FN100 Sprint, MRCR-1M, RULER-128k, and RULER-1M when runs emitng_perfand have at least two observed repeats; SciCode and Tau3 rely on the announced upstream observability work, and the named benchmark suite was not run locally.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).