fix: use mean().mean() for console metrics to match wandb#2056
Merged
mikasenghaas merged 1 commit intomainfrom Mar 20, 2026
Merged
fix: use mean().mean() for console metrics to match wandb#2056mikasenghaas merged 1 commit intomainfrom
mikasenghaas merged 1 commit intomainfrom
Conversation
Console reward was using results_df.reward.mean() (flat mean across all rollouts) while wandb logged by_example.reward.mean().mean() (mean per example, then across examples). These diverge when rollouts_per_example varies across problems. Now both use the same aggregation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d42me
approved these changes
Mar 20, 2026
samsja
approved these changes
Mar 20, 2026
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.
Summary
results_df.reward.mean()(flat mean across all rollouts), while wandb loggedby_example.reward.mean().mean()(mean per example, then across examples)rollouts_per_examplevaries across problems (e.g. due to filtering or errors)mean().mean()aggregationby_examplegroupby instead of re-computing it🤖 Generated with Claude Code
Note
Low Risk
Low risk: only changes how step-level console metrics are aggregated and formatted, without affecting training, logging payloads, or model behavior.
Overview
Console step logging in
orchestrator.pynow computes train and validation reward as mean per example, then mean across examples (groupby("example_id").mean().mean()), matching the aggregation used for W&B/monitor logging when rollout counts vary.It also reuses the existing
by_examplegroupby for train reward/sequence length and builds the validation string separately to simplify the step message.Written by Cursor Bugbot for commit 387afac. This will update automatically on new commits. Configure here.