Skip to content

feat: Port GDPO length adjustment features to GitHub main - #3604

Closed
arendu wants to merge 9 commits into
mainfrom
adithyare/gdpo-lenpen-no-truncation-main
Closed

arendu wants to merge 9 commits into
mainfrom
adithyare/gdpo-lenpen-no-truncation-main

Conversation

@arendu

@arendu arendu commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

*Adds length penalty functionality for RL

Issues

List issues that this PR closes (syntax):

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

@copy-pr-bot

copy-pr-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@arendu
arendu force-pushed the adithyare/gdpo-lenpen-no-truncation-main branch from 867cb52 to 4718b22 Compare August 12, 2026 18:50
@arendu
arendu force-pushed the adithyare/gdpo-lenpen-no-truncation-main branch from 4718b22 to f5d1240 Compare August 12, 2026 18:52
arendu and others added 3 commits August 12, 2026 13:09
Token ids are tokenizer-specific, so defaulting the think_close token id
to 13 could count unrelated tokens (e.g. newlines) on other tokenizers
and silently inject large spurious think_count_delta penalties. Token
counting now only runs when the id is configured; when no counting
method is available the feature stays neutral instead of guessing.

Also aligns kwargs at the rollout call site and documents the Phase-3
profiled-penalty gate in length_adjustments.py.

Co-Authored-By: Claude Fable 5 <[email protected]>
@arendu arendu changed the title Port GDPO length adjustment features to GitHub main feat: Port GDPO length adjustment features to GitHub main Aug 12, 2026
@arendu
arendu marked this pull request as ready for review August 18, 2026 17:51
@arendu
arendu requested review from a team as code owners August 18, 2026 17:51
@arendu arendu self-assigned this Aug 18, 2026
arendu and others added 3 commits August 24, 2026 12:32
…try, judge fleet trimmed to nl2bash)

Co-Authored-By: Claude Fable 5 <[email protected]>
AsyncTrajectoryCollector called run_async_nemo_gym_rollout without
length_adjustment_config, so async_grpo_train silently skipped all
configured length bonuses/penalties (both grpo.length_bonus mode and
GDPO reward_features mode). Pass master_config.grpo like the sync
grpo_train and validate paths already do.

Co-Authored-By: Claude Fable 5 <[email protected]>
…to 0

Previously the linear slope from (a, 1.0) through (b, f) continued past b
until the multiplier hit 0, fully wiping rewards for long-but-correct
rollouts. Now the multiplier floors at f for all lengths >= b, so the
maximum penalty is bounded by the configured f.

Co-Authored-By: Claude Fable 5 <[email protected]>
New config block length_bonus.profile_band with enabled + defaults holding
per-channel {a, b, f}. Channels listed under defaults are implicitly
enabled; per-row profile_band metadata still wins per-channel when present.
The global band also feeds the profile-gated group-relative penalty.
Malformed channel blocks (missing keys or b <= a) are ignored with a
warning. Previously profile_band silently no-oped when the dataset lacked
per-prompt metadata.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants