Skip to content

feat(genrm_compare): mask only the two rollouts of a failed judge comparison - #5330

Open
yfw wants to merge 13 commits into
mainfrom
yifuw/genrm-drop-failed-comparisons
Open

yfw wants to merge 13 commits into
mainfrom
yifuw/genrm-drop-failed-comparisons

Conversation

@yfw

@yfw yfw commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Since #3351, one failed judge comparison fails the whole cohort. A failed comparison is one with no completed answer, or a judge HTTP request that fails (an HTTP error, a connection error or a reply that is not JSON, after any retries). All of the cohort's rollouts are then masked, even when every other comparison succeeded. With 16 rollouts and a long judge answer, one comparison that exhausts max_output_tokens on both attempts discards 15 good comparisons.

This PR masks only the two rollouts of a failed comparison, and scores every other rollout from all of its comparisons. There is no new configuration key.

  • Masking: both rollouts of a comparison that raises a JudgeError are masked through judge_failsafe (the server's placeholder reward, mask_sample, failure_kind: judge_failed). Under circular, one failed comparison (5, 6) masks rollouts 5 and 6, not all 16. Under all_pairs, or with several judge passes, a rollout with any failed comparison is masked.
  • Scoring: every other rollout is scored from all of its comparisons, including those against a masked rollout, which still measure it. So every scored rollout's reward averages the same number of comparisons. The group's length and style adjustments see only the scored rollouts.
  • Failing the group: only when every rollout is masked, for example when the judge is down, does the whole cohort fail as a judge failure, as today. Its reason says that every rollout was masked. The server now waits for every comparison to finish or fail, within cohort_evaluation_timeout_s.
  • Unchanged:
    • An error outside the judge request still fails a /verify group with HTTP 503 at once, and cancels the comparisons still running.
    • A completed but malformed answer keeps the default-score fallback.
    • cohort_evaluation_timeout_s still bounds the group. A judge_request_timeout_s expiry fails a comparison only if it comes before that deadline; both default to 1,800 seconds, so by default the group deadline fires first and the group fails.
    • /compare has no per-response mask, so its first failed comparison still returns 503 at once and cancels the comparisons still running.
  • Other paths: the fixed_baseline path follows the same rule: a rollout with a failed judge pass against the baseline is masked.
  • Checkpoints: a member masked alone is saved and restored as masked (masked_alone in its saved state); its siblings replay their rewards.
  • Failure reports: a masked member's failure has its failed comparison's Gym failure, such as the judge's HTTP error, as its cause, also after a checkpoint restore. The scored members' reports list that failure without selecting it. When every rollout is masked, the group's failure has the first failed comparison as its cause.
  • Late requests: a regenerated answer for a masked member gets its recorded judge failure, as a failed group's members do. So a --resume that reruns a masked row records it as masked again, instead of getting HTTP 409 and stopping the collection.
  • Length coefficient overrides (feat(genrm_compare): adaptive length penalties #6337): a request's group_answer_length_penalty_coeff and group_reasoning_length_penalty_coeff apply over the scored rollouts only, like the other group adjustments. A member masked alone has no saved result, so a replay with the group's overrides gets its recorded judge failure, not the 409 for a saved result without the requested pair.
  • Metrics and logs: new genrm_failed_comparison_rate_per_group and genrm_masked_rollout_rate_per_group metrics. Each failed comparison is logged when it fails, and each masked rollout is logged with its reason.
  • Why both rollouts, not a score from the comparison that is left: in a group-relative trainer, that would mix rewards averaged over two comparisons with rewards from one. Under circular, the comparison that is left also shows one rollout only as response_1 and the other only as response_2, so a judge that favors one position moves their scores in opposite directions.

Consumer requirement. A masked rollout carries a placeholder reward, not a GenRM score: the server's judge_failure_placeholder_reward() (#6675), which for this server is default_score (3.0 by default, #6673). It must stay out of the group's baseline and normalization, or it shifts its siblings' advantages. NeMo RL's default grpo.masked_reward_policy: exclude_infra (NVIDIA-NeMo/RL#4968) keeps it out, because judge_failed is not a policy failure kind, and so does exclude. include is an explicit choice that counts the placeholder. For example, under include: 16 rollouts, comparison (5, 6) fails, and the other 14 average 3.4. With the placeholder of 3.0 the group mean is 3.35, which moves every scored rollout's advantage, before the division by the std, up by 0.05. A placeholder of 0.0, the failsafe's default for other servers, would give a mean of 2.98 and a shift of 0.43. Under exclude_infra there is no shift. NeMo RL also needs env.should_mask_flagged_samples on, its default. With it off, NeMo RL trains the masked rows on their placeholder rewards.

Validation

Against the final diff at 8dfd93722 (merged with main at 10b2317a9, after #6675 and #6673), Python 3.13.14:

gym env test +entrypoint=resources_servers/genrm_compare +should_validate_data=true   # 414 passed
pre-commit run --files resources_servers/genrm_compare/**/*                         # passed

Earlier heads: at 91fe22c21 (merged with main at 1883e257f, after #3625 and #6337), 3bc59ad24 and eaa24ccd86, gym env test for genrm_compare gave 414 passed. The merge of main after #6675 and #6673 had one conflict, the README's placeholder sentence.

New tests in tests/test_failed_comparisons.py, tests/test_checkpoint.py and tests/test_http_lifecycle.py:

  • Masking, 16-rollout circular group:
    • One failed comparison: its two rollouts are masked, and the other 14 are scored with their own scores.
    • The neighbors of a masked rollout are still scored from both of their comparisons; the judge stub gives each position a different score, so a lost comparison would change their rewards.
    • Two non-adjacent failures: their four rollouts are masked.
  • Group of 4:
    • Two adjacent failures mask three rollouts. An exact retry replays the same outcomes without judging again.
    • The masked rollouts do not change the length adjustments of the scored rollouts.
    • all_pairs: one failed pair masks its two rollouts, and the other two are scored from all three comparisons; when every rollout is masked, the group fails.
    • Every comparison fails: the group fails.
  • Errors: a non-judge error gives 503 for every member and cancels the comparisons still running.
  • Logging: a failed comparison is logged when it fails, before a later non-judge error or the group deadline ends the group.
  • Late requests: a regenerated answer for a masked member gets its judge failure; a scored member still refuses a different answer with 409.
  • /compare: with one failing and one blocked judge call, the request returns 503 at once, and the blocked call is cancelled.
  • Fixed baseline: a failed judge pass masks its rollout, also through /verify.
  • Checkpoint: members masked alone and their scored siblings are exported and restored without judging again. A masked member's report names the judge failure as its cause before and after the restore. After the restore, a changed answer gets the masked member's judge failure and a scored member's 409.
  • main's failure-report test through collection: one failed comparison now gives two masked rows and two scored rows, and each masked row's report has the judge failure in its cause chain.
  • HTTP through /run and the failsafe, 16 rollouts: one failed comparison, and two adjacent failures, mask exactly their rollouts with judge_failed; the other rollouts return their rewards. Each masked row carries the server's placeholder, default_score (3.0).
  • Regression check: with main's server code, 15 of these 20 test cases fail. The other 5 cover behaviour that does not change, including the /compare case.

Rollouts

This PR's arm ran at 6aeff06e4. The next commit, 9ee859305, changes only the reply to a regenerated answer for a masked member, the reason text when every rollout is masked, docs and tests; scoring and masking are the same. The later merges of main and the /compare fix do not change how /verify scores or masks rollouts. The main arm ran at 5911d628c (the base of this PR) in an earlier run, with the same judge, policy, data and settings.

Setup

  • Judge: nvidia/Qwen3-Nemotron-235B-A22B-GenRM, served by vLLM 0.27.1 with tensor parallel size 4 on one GB200 node.
  • Policy: Qwen/Qwen3.5-4B with thinking off, served by vLLM on one GPU of a second node.
  • Data: the 4 tasks in resources_servers/genrm_compare/data/example.jsonl. Each run holds one task with a new _ng_group_id, so it makes one 16-rollout circular group.
  • Settings: the shipped genrm_compare settings, with two changes that cause real judge failures:
    • genrm_responses_create_params.max_output_tokens: 1341. We first ran 16 judge comparisons with a 16,384-token budget. The answers were 531 to 2,981 tokens long, and 1,341 is their 55th percentile. So some answers run out of budget before the verdict.
    • genrm_parse_retries: 1, so each comparison gets 2 attempts.

Commands. Each arm starts its servers once, and they stay up for all 4 tasks.

gym env start "+config_paths=[genrm_5330_run.yaml]" \
    +policy_base_url=http://<policy-host>:8001/v1 +policy_api_key=dummy +policy_model_name=policy \
    +genrm_base_url=http://<judge-host>:8000/v1 +genrm_model_name=genrm +genrm_max_output_tokens=1341 \
    ++genrm_compare_resources_server.resources_servers.genrm_compare.genrm_parse_retries=1

# Once per task, with a new _ng_group_id in task<k>.jsonl:
gym eval run --no-serve --agent genrm_simple_agent \
    --input task<k>.jsonl --output task<k>-results.jsonl \
    --num-repeats 16 --concurrency 16 +route_failures_to_sidecar=true
genrm_5330_run.yaml

genrm_compare_resources_server and genrm_simple_agent are the same as in configs/genrm_compare.yaml, with max_output_tokens: ${genrm_max_output_tokens}. The two model servers point at the external vLLM servers:

policy_model:
  responses_api_models:
    vllm_model:
      entrypoint: app.py
      base_url: ${policy_base_url}
      api_key: ${policy_api_key}
      model: ${policy_model_name}
      return_token_id_information: false
      uses_reasoning_parser: false
      chat_template_kwargs:
        enable_thinking: false

genrm_model:
  responses_api_models:
    genrm_model:
      entrypoint: app.py
      base_url: ${genrm_base_url}
      api_key: dummy_key
      model: ${genrm_model_name}
      return_token_id_information: false
      uses_reasoning_parser: false
      supports_principle_role: true
      hf_home: null
      vllm_serve_env_vars: {}
      vllm_serve_kwargs:
        tensor_parallel_size: 4
      debug: false

Results (one 16-rollout group per task and arm)

Task This PR (6aeff06e4) main (5911d628c)
1 4 of 16 comparisons failed: (8, 9), (9, 10), (10, 11) and (14, 15). Their rollouts, 8 to 11, 14 and 15, were masked. The other 10 were scored (3.0 to 4.5). Rates: 0.25 and 0.375. The first failed comparison failed the group. All 16 rollouts were masked.
2 No comparison failed. All 16 were scored (3.0 to 5.25). Rates: 0.0 and 0.0. No comparison failed. All 16 were scored (2.0 to 5.0).
3 4 of 16 comparisons failed: (0, 1), (10, 11), (12, 13) and (14, 15). Their rollouts, 0, 1 and 10 to 15, were masked. The other 8 were scored (3.5 to 5.25). Rates: 0.25 and 0.5. The first failed comparison failed the group. All 16 were masked.
4 1 of 16 comparisons failed: (15, 0). Rollouts 15 and 0 were masked. The other 14 were scored (2.0 to 5.0). Rates: 0.0625 and 0.125. The first failed comparison failed the group. All 16 were masked.

"Rates" are genrm_failed_comparison_rate_per_group and genrm_masked_rollout_rate_per_group, as reported on each scored row.

This PR scored 48 of the 64 rollouts, and main scored 16. On this PR, the masked rollouts are exactly the rollouts of the failed comparisons, and no group failed as a whole. On both arms, every masked row has mask_sample: true, failure_kind: judge_failed and reward 0.0 (the failsafe's placeholder before #6673), and lands in the collector's _failures.jsonl sidecar.

The two arms ran separately, and each sampled its own policy and judge answers. Tasks 1, 3 and 4 had failed comparisons on both arms, but not the same ones. On main, a group fails at its first failed comparison, so its log shows one failed comparison per masked group.

Server log lines

This PR, task 4 (one failed comparison, two rollouts masked):

GenRM output budget exhausted for pair (15, 0) (attempt 2/2, max_output_tokens=1341): response is incomplete (reason=max_output_tokens) and contains no verdict
GenRM dropped comparison (15, 0) (judge 0) of 16 after a judge failure: Judge returned no completed answer after 2 attempts (2 of them exhausted max_output_tokens=1341 without emitting a verdict; raise the budget or constrain the judge's reasoning)
GenRM masked one rollout of key='group_id::996c6e1f-f9ce-4ceb-86d6-d05f765bcdb0::group_attempt::0': GenRM rollout_index=15 lost a comparison to a judge failure (1 of 16 comparisons failed): Judge returned no completed answer after 2 attempts (...)
GenRM masked one rollout of key='group_id::996c6e1f-f9ce-4ceb-86d6-d05f765bcdb0::group_attempt::0': GenRM rollout_index=0 lost a comparison to a judge failure (1 of 16 comparisons failed): Judge returned no completed answer after 2 attempts (...)

main, task 1 (one failed comparison, group failed):

GenRM output budget exhausted for pair (7, 8) (attempt 2/2, max_output_tokens=1341): response is incomplete (reason=max_output_tokens) and contains no verdict
GenRM cohort disposition=failed key='group_id::d1c0ec60-46a2-4bd0-ba08-4757723b0524::group_attempt::0' attempt=0 members=16 kind=judge reason="Judge returned no completed answer after 2 attempts (2 of them exhausted max_output_tokens=1341 without emitting a verdict; raise the budget or constrain the judge's reasoning)"

Compatibility and benchmark impact

  • Default behavior changes. A group with a failed comparison is now scored, except the failed comparison's two rollouts, instead of being fully masked.
  • Trainer setting. The masked rollouts' placeholder reward must stay out of the group statistics. NeMo RL's default exclude_infra (feat(grpo): add exclude_infra masked-reward policy for infra-masked rollouts RL#4968) and exclude keep it out. A recipe that sets include counts it.
  • /compare. Unchanged: its first failed comparison returns 503 at once.
  • New fields. Two per-group metrics on /verify, and masked_alone in a checkpointed member's state.

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.
  • Documentation added or updated (resources_servers/genrm_compare/README.md).
  • Pre-commit checks pass locally (pre-commit run --all-files).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s).

🤖 Generated with Claude Code

…ly when a rollout has none left

Since #3351 one failed judge comparison (no completed answer, judge HTTP
error or request deadline) fails the whole cohort, so all of its rollouts
are masked even when every other comparison succeeded. With 16 rollouts
and a long judge answer, one comparison that exhausts max_output_tokens on
both attempts discards 15 good comparisons.

Drop each comparison that raises a JudgeError and score every rollout
from the comparisons it has left; nothing is masked per rollout. As soon
as a rollout has no comparison left that could succeed, fail the cohort
as a judge failure exactly as before (every member masked through the
judge failsafe) and cancel the comparisons still running, so an outage
still ends the group early. Under circular comparisons only two adjacent
failures leave a rollout uncovered. Non-judge errors still fail the group
with 503, malformed completed answers keep the default-score fallback,
and cohort_evaluation_timeout_s still bounds the group. The fixed-baseline
path and /compare follow the same rule; /compare leaves dropped
comparisons out of comparison_results. There is no configuration key.

Report genrm_failed_comparison_rate_per_group and log each drop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 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.

@yfw yfw added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work labels Oct 29, 2026
@yfw

yfw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f6d207d

…_pairs

- Log a dropped comparison when it fails, not after the loop. A later
  failure, a non-judge error or the group deadline can end the group
  first, and the group error carries only the last failure's text.
- README: a connection error or a non-JSON judge reply is dropped too.
  A request deadline drops a comparison only if it fires before the group
  deadline, and by default the group deadline fires first. HTTP 503
  applies to /verify.
- README: name the position effect of a dropped circular comparison.
- Test all_pairs, where each rollout has three comparisons, and test
  that an earlier failure is logged when the group fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a66283d

…comparison

A failed judge comparison is still dropped. A rollout whose comparisons
all failed is now masked alone through the judge failsafe (reward 0.0,
mask_sample, failure_kind judge_failed), and its siblings keep their
scores. Before, it failed the whole group. The masked rollout is left out
of the group's length and style adjustments. When every rollout is left
uncovered, the whole group fails as a judge failure, as before.

- The server now waits for every comparison to finish or fail, within
  cohort_evaluation_timeout_s. A non-judge error still fails the group at
  once and cancels the comparisons still running.
- The fixed_baseline path follows the same rule. /compare has no
  per-response mask, so it still returns 503 when a response keeps no
  comparison.
- Checkpoints save and restore a member masked alone (masked_alone).
- New metric: genrm_masked_rollout_rate_per_group.

The masked rollout's reward is a placeholder, so a trainer must keep it
out of the group statistics: in NeMo RL, grpo.masked_reward_policy
exclude_infra (NVIDIA-NeMo/RL#4968) or exclude.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d94066c

A failed judge comparison now masks its two rollouts, and every other
rollout is scored from all of its comparisons. Before, the two rollouts
were scored from their remaining comparison. In a group-relative trainer
that mixed rewards averaged over two comparisons with rewards from one,
and a judge that favors one position moved the two scores in opposite
directions.

- A masked rollout's successful comparisons still score its neighbors.
  The group's length and style adjustments see only the scored rollouts.
- The same rule covers all_pairs, several judge passes and the
  fixed_baseline path: a rollout with any failed comparison or pass is
  masked. The whole group fails only when every rollout is masked.
- /compare has no per-response mask, so any failed comparison returns 503
  there, as on main.
- The masked-member reason now reads "GenRM rollout_index=N lost a
  comparison to a judge failure (k of n comparisons failed): ...".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6aeff06

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Oct 30, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 2, 2026

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

Thanks for working on this, @yfw! I left one inline comment about returning promptly after a judge failure in /compare.

I also have an earlier performance PR, #3625, that touches some of the same scoring and checkpoint code. It already incorporates main’s newer failure reporting, so I’d recommend landing that first, then rebasing this PR and rechecking the combined changes. I think that would make the overlap easier to reconcile.

Would that order work for you, or would you prefer a different approach? Happy to coordinate. We’d still keep NVIDIA-NeMo/RL#4968 ahead of this PR, as you’ve documented.

Comment thread resources_servers/genrm_compare/app.py Resolved
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 4, 2026
yfw and others added 2 commits November 16, 2026 01:38
…ed-comparisons

Main added failure reports (#5072 and its follow-ups), which reach the same
GenRM code. The conflicts kept both sides: masked_alone next to
failure_report in the saved member state, member_failures next to
failure_report when a cohort is published, and the cohort failure next to
the restored report.

A member masked alone now fails with its failed comparison's Gym failure as
its cause, as a failed group does. The cohort's report keeps that failure, so
the cause survives a checkpoint restore: the member's saved report names it,
and the restore clears it for the cohort. When every member is masked, the
group's JudgeError is caused by the first failed comparison.

Tests: main's one_failed report test now expects two masked rows and two
scored ones; the masked-alone restore test uses main's export signature and
checks the restored report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
/compare has no per-response mask, so it cannot use a partial result. Since
this PR, it waited for every comparison before it failed the request, so one
quick judge failure and one slow judge call delayed the 503 until the slow
call finished, with no group deadline. Now its first failed comparison is
raised at once and the comparisons still running are cancelled, as before
this PR. /verify still waits for every comparison and masks only the
members of a failed one.

The regression test has one failing and one blocked judge call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@yuhezhang-ai Thanks for the review. Landing #3625 first works for me, and NVIDIA-NeMo/RL#4968 still goes before this PR.

I checked the overlap at the new head. I merged main into this branch (35ac9ba, a merge, not a rebase). Then I did a trial merge of #3625 at bdc6376 on top:

  • There are two small conflicts in app.py, and both keep both sides. In verify, your digest-scheme check goes before the masked-alone check. In _finished_member_state, the member's own digest scheme goes next to its own failure report.
  • With those two resolved, all 400 genrm_compare tests pass.
  • One note for perf(genrm): reduce response copying and group cleanup overhead #3625: 13 of its test cases call export(None) or export_session_states(sessions). Current main requires checkpoint_id= there, so these cases fail after a merge of main.

The main merge also connects main's failure reports to masking. A masked member's failure has its failed comparison's Gym failure as its cause, and a checkpoint keeps that cause. When #3625 lands, I will merge main into this branch again, resolve the two conflicts and run the tests again.

@yfw yfw changed the title feat(genrm_compare): drop failed judge comparisons; fail the group only when a rollout has none left feat(genrm_compare): mask only the two rollouts of a failed judge comparison Nov 17, 2026
@yfw

yfw commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5bf85a5

@yuhezhang-ai

Copy link
Copy Markdown
Contributor

@yfw Thanks for catching the missing checkpoint IDs. Fixed in #3625 at 0a1981d8460a42804687638ed966ba2f5f1b9a7e after merging current main (505a2afa; merge 9b8390aae).

I reproduced all 13 failures, then updated the nine export call sites to pass checkpoint_id=. The repeated-checkpoint digest test now uses distinct IDs for successive saves; its replay and saved-scheme assertions are unchanged. All 380 GenRM tests, example-data validation, and 182 focused core checkpoint/failure-report tests pass on the pushed tree. All-files pre-commit passed; the private guardwords catalog was unavailable locally. CI has been requested for this exact head.

Agreed on the order: #3625 lands before #5330, and NVIDIA-NeMo/RL#4968 must also land before #5330. The merge here preserves the digest-scheme check and each member's saved scheme for the two overlap points you identified. Please merge main and rerun the combined suite once #3625 lands; your 400-test trial remains separate from this validation.

…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]>
@yfw

yfw commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 91fe22c

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 21, 2026
@yfw

yfw commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

@yuhezhang-ai Thanks for fixing the checkpoint IDs. #3625 has landed, so I merged main into this branch (91fe22c, a merge, not a rebase). main now also has #6337.

The four conflict blocks in app.py keep both sides, including the two overlap points from my trial merge: the digest-scheme check goes before the masked-alone check, and each member's saved scheme goes next to its own failure report.

Two more changes were needed, because #6337 does not conflict with this PR in text but does in behavior:

  • _aggregate_results now passes the new length_coefficients keyword on to _score_results. So a request's coefficient overrides apply over the scored rollouts only, like the other group adjustments. Without it, every /verify group failed with a TypeError.
  • The saved-coefficient check reads cohort.results.get(...). A member masked alone has no saved result, so it has no recorded coefficients, and its replay gets its judge failure as before. Without it, the replay raised KeyError.

Combined suite on the merged tree: all 414 tests pass (gym env test +entrypoint=resources_servers/genrm_compare +should_validate_data=true), and pre-commit run --all-files passes. NVIDIA-NeMo/RL#4968 is still open, so this PR still waits for it.

…placeholder

A masked member's reward is the judge-failure placeholder. It is 0.0 on main
today; once Gym #6675 and #6673 land it is the server's judge_failure_reward(),
which for genrm_compare is default_score (3.0 by default). The README now says
this in the failsafe paragraph, the Masking bullet and the consumer note.

The failed-comparison /run test also checks that each masked member carries
the server's placeholder: judge_failure_reward() where the server has it,
else 0.0, so the test holds in either merge order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3bc59ad

…der_reward() and the exclude_infra default

#6675 renamed the hook judge_failure_reward() to
judge_failure_placeholder_reward(). The lifecycle test reads the hook by
name, so it now looks up the new name, and the README names it too.

NVIDIA-NeMo/RL#4968 makes masked_reward_policy: exclude_infra the
default. The README said that include is the default and that exclude is
the setting to choose. It now says that the default exclude_infra keeps a
judge-failure row out of the group baseline, and that include is an
explicit choice that counts the placeholder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test eaa24cc

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

Two nonblocking README documentation clarifications.

siblings. Also keep `env.should_mask_flagged_samples` on, its default. With it off, NeMo RL trains the
masked members on their placeholder rewards.
- **Reporting:**
- `/verify` reports `genrm_failed_comparison_rate_per_group` and `genrm_masked_rollout_rate_per_group` on

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.

Please document that run-level means of these group-rate fields are weighted by surviving scored rows and exclude fully masked groups. Point readers to group summaries and failure counts when estimating overall masking.

not enable individual judge-only reverification: reconstructing and retrying a full group remains the
caller's responsibility. The batch `/compare` endpoint returns HTTP 503 for judge failures.
A late request to a retained failed explicit-ID group, or to a member masked alone in a retained completed
group, receives its recorded failure, even if it contains a regenerated answer. To judge again, advance the

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.

Please qualify the checkpoint section’s changed-answer and slot-conflict wording. A restored masked_alone member intentionally replays its saved judge failure for a regenerated answer; scored members still reject changed answers.

yuhezhang-ai
yuhezhang-ai previously approved these changes Dec 1, 2026

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

The earlier /compare concern is addressed, and NVIDIA-NeMo/RL#4968 has merged. The two README suggestions are nonblocking. Looks good to me.

yfw and others added 2 commits December 2, 2026 15:38
…ed-comparisons

Brings in #6675 (a server chooses the placeholder reward of a judge
failure) and #6673 (genrm_compare's placeholder is default_score, 3.0).
One conflict block, in genrm_compare/README.md: this branch said the
placeholder is 0.0 until #6675 and #6673 land, and main said it is
default_score. Both have landed, so the sentence now names the server's
judge_failure_placeholder_reward() and its value for this server,
default_score (3.0 by default).

One more change: test_failed_comparisons_through_run no longer falls back
to 0.0 when the server has no judge_failure_placeholder_reward(). Main has
the hook, and assert_judge_failure already checks that each masked member
carries 3.0.

No silent clash in app.py: a member masked alone raises JudgeError with
the default judge_failed kind, which main's judge_failsafe keeps, and
/verify now gives it default_score as its placeholder reward.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
…mber's changed answer

Two README requests from the review:

- Only scored members carry genrm_failed_comparison_rate_per_group and
  genrm_masked_rollout_rate_per_group. A run-level mean of either field
  therefore weights each group by its scored members and leaves out groups
  whose members were all masked. The README now says so and points to the
  per-group rows of <rollouts>_reward_profiling.jsonl and the judge_failed
  rows in the failures sidecar for the run's overall masking.
- The checkpoint section said that a changed answer is refused and that a
  member started over from its input gets a conflicting response. That
  holds for scored members. A restored member masked alone answers a
  changed answer with its saved judge failure, on purpose, like a failed
  group's members. The checkpoint section and the transport retry list now
  say so.

test_members_masked_alone_get_their_judge_failure_back_after_a_restore now
also sends a changed answer after the restore: the member masked alone
gets its judge failure, and a scored member gets 409. Without the
masked-alone rule in verify, the check fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw

yfw commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8dfd937

@nemo-pr-automation
nemo-pr-automation Bot requested a review from a team December 2, 2026 23:46

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

Thanks, both README requests are addressed, and the new checkpoint assertions cover regenerated answers. I rechecked the main merge, /compare cancellation, and masked replies with the updated placeholder. Looks good to me.

This branch was previously deployed

1 inactive (outdated) deployment
public — 1f4ccf83 Deployed Oct 30, 2026 by copy-pr-bot[bot] via release / finalize / notify #8805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants