Repository navigation
fix(agentic): normalize GiGPO step rewards with the configured mean/std types - #512
Open
flyingdoubleG wants to merge 1 commit into
Open
flyingdoubleG wants to merge 1 commit into
flyingdoubleG wants to merge 1 commit into
Conversation
…td types compute_response_level_rewards builds the step-level normalization as RewardNormalizationConfig(grouping="state_group_id", method=cfg.method). `method` is deprecated and defaults to "identity", so a config that sets only the recommended norm_mean_type / norm_std_type (and no method) gets episode rewards normalized per group but step rewards not normalized at all, unlike GiGPO, which normalizes both the same way. Derive the step config from the resolved norm_mean_type / norm_std_type (per anchor-state group), keeping method for the warning path; configs that set `method` behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
What
For
adv_estimator: gigpo,compute_response_level_rewardsnormalizes episode rewards with the user'sreward_normalization, then builds the step-level normalization from the deprecatedmethodonly:methoddefaults to"identity", andRewardNormalizationConfigasks users to setnorm_mean_type/norm_std_typeinstead. With a config that does that, e.g.episode rewards are normalized per group, but the step config resolves
method="identity"tonorm_mean_type=None, norm_std_type=None, so step rewards are not normalized at all before being mixed withstep_reward_weight. GiGPO normalizes both levels the same way (in the reference implementationepisode_norm_rewardandstep_norm_rewardshareremove_std). The bundled gigpo examples setmethod, so they are not affected.Change
A small helper,
step_reward_normalization, builds the step config from the resolvednorm_mean_type/norm_std_type(each one mapped to"group", i.e. the anchor-state group, or keptNone) and passesmethodalong. This reproduces whatmethodgives today for everymethodvalue and grouping (checked in the tests), and fixes configs that only use the new fields.Tests
tests/utils/test_agentic_reward_norm.py: the step config for the deprecatedmethodvalues is unchanged, the new-field configs getgroupnormalization, andagentic_reward_normwith the step config normalizes within each state group (CPU).🤖 Generated with Claude Code