Skip to content

feat(genrm_compare): adaptive length penalties - #6337

Merged
yfw merged 7 commits into
mainfrom
jveronvialard/genrm-adaptive-length-penalty
Nov 19, 2026
Merged

yfw merged 7 commits into
mainfrom
jveronvialard/genrm-adaptive-length-penalty

Conversation

@jveronvialard

@jveronvialard jveronvialard commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Add optional group_answer_length_penalty_coeff and group_reasoning_length_penalty_coeff to /verify so they can be set per rollout group.
Also preserve user images in judge requests and add default_rubric_ids so /verify and /compare can use the judge's baked-in rubric when use_principle is false.

Validation

12 focused tests passed.

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest \
    -p no:cacheprovider -p pytest_asyncio.plugin -q \
    resources_servers/genrm_compare/tests/test_app.py \
    resources_servers/genrm_compare/tests/test_checkpoint.py \
    -k 'coefficients or coefficient_echo or image_in_conversation_order or media_message or selected_rubric or singleton'

Rollouts

Ran two /verify groups with fixed candidate answers and a live judge. All four calls returned HTTP 200 with zero judge parse failures.

  • Text. For “What is 2 + 2?”, we supplied two correct answers: “4” and a longer explanation. Both replies echoed the requested answer and reasoning coefficients of 0.12 and 0.09. The short response received a +0.105 length adjustment and the long response received -0.105.
  • Image. For “What color is the square?”, we supplied a red-square image and two answers, “The square is red” and “The square is blue.” Both judge requests included the image. The judge scored each answer on a 1–5 scale, giving the correct answer 5 and the incorrect answer 1.

Compatibility and benchmark impact

Existing callers can omit the new parameters. Overrides require at least two generated responses per group. Passing user images to the judge may change multimodal scores.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

@copy-pr-bot

copy-pr-bot Bot commented Nov 18, 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

Copy link
Copy Markdown
Contributor Author

/ok to test 8b72714

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 18, 2026 06:05
@yaoyu-33
yaoyu-33 requested a review from agronskiy November 18, 2026 06:35
@jveronvialard
jveronvialard requested a review from yfw November 18, 2026 06:46
@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters needs-review PR is ready for code review and waiting on a reviewer labels Nov 18, 2026

@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.

SHIP WITH CARE. No bug blocks this PR. The PR body does not show a smoke rollout with a real judge model yet, and that needs a decision before merge.

The README now documents the coefficient rules and the media behavior, and only user turns send media to the judge. With the new fields unset, judge requests and prompt digests for text-only rows do not change. All 391 genrm_compare tests pass at this head, and CI is green.

Please add a short smoke rollout with a real judge model to the Rollouts section, as AGENTS.md asks for behavior-changing environment work. The section lists only mocked-judge tests now. One image group with a vision judge and one text group with coefficient overrides are enough.

Generated by Claude Code

Comment thread resources_servers/genrm_compare/app.py Resolved
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 19, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 19, 2026
@jveronvialard

Copy link
Copy Markdown
Contributor Author

/ok to test 00eaac9

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 19, 2026 18:15
@yfw
yfw added this pull request to the merge queue Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44632652990

Merged via the queue into main with commit 222ecf4 Nov 19, 2026
64 checks passed
@yfw
yfw deleted the jveronvialard/genrm-adaptive-length-penalty branch November 19, 2026 23:09
yfw added a commit that referenced this pull request Nov 21, 2026
…ed-comparisons

Brings in #3625 (response compaction and retention) and #6337 (per-request
length coefficients). Four conflict blocks in genrm_compare/app.py, each
resolved by keeping both sides:

- typing imports: the union of both lists.
- verify: main's digest-scheme check runs first, then this branch's rule that
  a member masked alone gets its recorded failure even for a regenerated
  answer.
- verify: a completed cohort still answers through _completed_member_response,
  so a member masked alone gets its judge failure.
- _finished_member_state: the member's own digest scheme from main, next to
  the member's own failure report from this branch.

Two more changes keep the merged code working:

- _aggregate_results takes main's length_coefficients keyword and passes it
  to _score_results, so the per-request coefficients apply over the scored
  members. Without it, every /verify group failed with a TypeError.
- main's saved-coefficient check reads cohort.results with .get: a member
  masked alone has no saved result, so it has no recorded coefficients.
  Without it, a replay of a masked member raised KeyError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants