Skip to content

feat: add rubric mean and fixed baseline comparison for RLHF - #4346

Merged
yfw merged 10 commits into
super-v3.5-posttrainingfrom
jveronvialar/rlhf-rubric-mean-fixed-baseline
Oct 1, 2026
Merged

yfw merged 10 commits into
super-v3.5-posttrainingfrom
jveronvialar/rlhf-rubric-mean-fixed-baseline

Conversation

@jveronvialard

Copy link
Copy Markdown
Contributor

What does this PR do ?

Adds support for rubric mean and fixed baseline comparison for RLHF. Logs rubric/overall rewards, reasoning and response token counts, reward ties and variance, parse failures, and GenRM token usage.

Issues

N/A

Usage

env:
    nemo_gym:
        genrm_compare_resources_server:
            resources_servers:
                genrm_compare:
                    num_rollouts_per_prompt: 32
                    comparison_mode: fixed_baseline
                    score_source: rubric_mean

Each dataset row must provide the baseline and expected rubric IDs.

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

Depends on NVIDIA-NeMo/Gym#3775

Signed-off-by: Julien Veron Vialard <[email protected]>
Signed-off-by: Julien Veron Vialard <[email protected]>
Signed-off-by: Julien Veron Vialard <[email protected]>
Signed-off-by: Julien Veron Vialard <[email protected]>
Signed-off-by: Julien Veron Vialard <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Sep 29, 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.

@jveronvialard
jveronvialard changed the base branch from main to super-v3.5-posttraining September 29, 2026 21:05
@github-actions

Copy link
Copy Markdown

❌ Submodule Fast-Forward Check Failed

Check based on commit: bfaeae9 (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline)

❌ Submodules that need attention:

Automodel: ❌ PR branch is BEHIND main branch
TARGET (main branch): https://github.com/NVIDIA-NeMo/Automodel/commits/72daceffa54d77783e1f73a5ac165eb39b6b5ea1/
CURRENT (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline): https://github.com/NVIDIA-NeMo/Automodel/commits/24b47e856263d313b942f0ed666c63fff83306b4/

Gym: ❌ Commits have DIVERGED from a common ancestor
TARGET (main branch): https://github.com/NVIDIA-NeMo/Gym/commits/9fc05c0ffb38740a00dd82326a464bc7bd2ceb50/
CURRENT (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline): https://github.com/NVIDIA-NeMo/Gym/commits/81bbfcbdd9d3e77ae681766a6692fb6f68ced0ec/

Megatron-Bridge: ❌ Commits have DIVERGED from a common ancestor
TARGET (main branch): https://github.com/NVIDIA-NeMo/Megatron-Bridge/commits/1f8873bb00a8ddf3af811649f0a7efdb2363570c/
CURRENT (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline): https://github.com/NVIDIA-NeMo/Megatron-Bridge/commits/3961f399ef181bca689de8e984110b85c4df00fe/

Please ensure all submodule commits are fast-forwards of the main branch before merging.

Signed-off-by: Julien Veron Vialard <[email protected]>
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: d8fc4cb (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of super-v3.5-posttraining branch (fast-forward)

All submodule changes look good! ✨

Signed-off-by: Julien Veron Vialard <[email protected]>
@jveronvialard
jveronvialard marked this pull request as ready for review September 29, 2026 21:50
@jveronvialard
jveronvialard requested review from a team as code owners September 29, 2026 21:50
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 7d039e3 (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of super-v3.5-posttraining branch (fast-forward)

All submodule changes look good! ✨

"genrm_max_output_tokens_hit_rate_per_group",
)

group_reward_metrics = _group_reward_diagnostics(results, reward_group_size)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking follow-up for the main port: could we compute these diagnostics after apply_group_length_penalties?

With grpo.length_penalty enabled, I reproduced rewards [1, 1] becoming [1.05, 0.95], while zero_advantage_group_pct remained 100 and total_reward/std_in_group remained 0. The expected values for the final rewards are 0% and approximately 0.07071.

Training uses the correctly shaped rewards; only these diagnostics are computed too early.

),
default=0,
),
"reasoning_tokens": r["reasoning_token_count"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking test follow-up for the main port: please update the remaining mock rollout results with reasoning_token_count, response_token_count, and token_extraction_valid.

These three existing tests fail with KeyError: reasoning_token_count at this access:

  • tests/unit/experience/test_rollouts.py::test_postprocess_nemo_gym_group_reports_per_agent_live_metrics
  • tests/unit/experience/test_reward_penalties.py::TestMaskEnvFlaggedSamplesBatchedGate::test_gate_on_carries_mask_sample
  • tests/unit/experience/test_reward_penalties.py::TestMaskEnvFlaggedSamplesBatchedGate::test_gate_off_omits_mask_sample

All three passed when rerun against the base postprocessing function. The focused CPU test run bypassed unrelated Ray-startup fixtures.

Real NemoGym postprocessing always supplies these fields, so this is a stale-fixture regression, not a demonstrated production crash; updating the fixtures should be sufficient.

Point Gym to e24db4e6 after merging NVIDIA-NeMo/Gym#3775. Its tree is identical to the previously pinned 81bbfcbd; no runtime or dependency changes.

Signed-off-by: Yi-Fu Wu <[email protected]>
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 2d9221d (PR #4346 from jveronvialar/rlhf-rubric-mean-fixed-baseline)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of super-v3.5-posttraining branch (fast-forward)

All submodule changes look good! ✨

@yfw yfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved for super-v3.5-posttraining. Left a few comments we should address when merging to main

@yfw
yfw merged commit cfca199 into super-v3.5-posttraining Oct 1, 2026
11 checks passed
@yfw
yfw deleted the jveronvialar/rlhf-rubric-mean-fixed-baseline branch October 1, 2026 19:07
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