feat(research): add native turn-level credit assignment - #3543
Closed
nvegesna-netizen wants to merge 8 commits into
Closed
nvegesna-netizen wants to merge 8 commits into
nvegesna-netizen wants to merge 8 commits into
Conversation
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
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 does this PR do?
Adds a self-contained
research/turn_level_creditproject that preservesnative per-turn environment rewards and composes token-aligned auxiliary
credit with NeMo-RL's existing trajectory-level GRPO advantage.
This follows the research-incubation direction discussed on #1606. It does
not change files under
nemo_rl/, does not claim a task-quality improvement,and does not implement TRACE. The project supplies the reusable plumbing and
strict validation needed for controlled long-horizon experiments.
The implementation:
environment transition;
flattening;
and equality between raw turn sums and raw trajectory reward;
when
turn_weight=0;path; and
Issues
Related to #1326. Supersedes neither #1606 nor NVIDIA-NeMo/Gym#1298; the
latter remains the coordination point for a versioned NeMo Gym step-reward
contract.
Usage
cd research/turn_level_credit uv run run_grpo_turn_credit.py \ --config configs/grpo_math_0.5b_turn_credit.yamlStrict macro-only control with trace plumbing enabled:
Multi-turn pilot result
The included 2x2 sliding-puzzle recipe was evaluated with three matched seeds,
ten optimizer steps per arm, and 32 final validation rollouts per seed. The
control used
turn_weight=0; the treatment used immediate environment creditwith
turn_weight=0.2.The mean seed-level difference was
-0.010417, with a 95% t interval of[-0.205779, 0.184946]. The fully paired final outcomes retained for seeds43-44 also showed no significant difference (exact McNemar
p=0.663624).This establishes that the mechanism runs in a genuine multi-turn training
loop, but it does not establish a task-quality gain. The environment returns
zero reward until the puzzle is solved, so this pilot primarily tests
terminal-turn emphasis rather than dense process credit. No default credit
weight is recommended from these results.
Validation
matching NeMo-RL's nightly dependencies.
uv lock --checkresolved all 549 packages against the recorded submodules.turn_weight=0.2passed all preflightchecks, activated native turn-level credit, completed one optimizer step,
and reached the configured max-step boundary.
configuration, and preflight; its only semantic experiment difference was
turn_weight=0.0. It also completed one optimizer step successfully.Limitations
The bundled one-turn math recipe validates engineering plumbing only. A task
quality claim requires a genuinely long-horizon environment and controlled
outcome-only, zero-weight, immediate-credit, and return-to-go comparisons with
matched prompts, seeds, model, and compute budget.