feat(v1): add Trace.reward_shaping for trainer reward-shaping terms - #2436
Draft
hallerite wants to merge 1 commit into
Draft
feat(v1): add Trace.reward_shaping for trainer reward-shaping terms#2436hallerite wants to merge 1 commit into
hallerite wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hallerite
force-pushed
the
feat/trace-reward-shaping
branch
from
August 24, 2026 23:13
e084c75 to
fd50b58
Compare
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
Adds
Trace.reward_shaping: dict[str, float]— additive training-reward terms a consumer's reward shapers record on a trace, keyed by shaper name (e.g.{"length_penalty": -0.1}).This is a training annotation in the same sense as
MessageNode.advantages: verifiers holds the field, the trainer fills it.Trace.rewardstays the env's verdict; the trainer scores againstreward + sum(reward_shaping.values()). Keeping the two apart means task-success metrics, curricula and evals keep reading the unshaped reward while credit assignment sees the shaped one.Companion: PrimeIntellect-ai/prime-rl#3376 moves prime-rl's length penalty out of GRPO into a reward-shaping layer and writes its terms here.
🤖 Generated with Claude Code
Note
Add
reward_shapingfield toTracemodel for trainer reward-shaping termsAdds a
reward_shaping: dict[str, float]field to theTracepydantic model, defaulting to an empty dict. It stores additive training-reward terms keyed by shaper name. The field is included in JSON output fromto_record()since it is not excluded.Macroscope summarized e084c75. (Automatic summaries will resume when PR exits draft mode or review begins).