Skip to content

feat(gdp-pdf): training reward modes and opt-in masking of failed attempts - #5529

Merged
yaoyu-33 merged 1 commit into
NVIDIA-NeMo:mainfrom
trintamaki:gdp-pdf-training-rewards
Nov 10, 2026
Merged

yaoyu-33 merged 1 commit into
NVIDIA-NeMo:mainfrom
trintamaki:gdp-pdf-training-rewards

Conversation

@trintamaki

@trintamaki trintamaki commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Two options for training on GDP.pdf-style tasks. Both default to the current behaviour, so the benchmark is unchanged.

  • reward_mode on the gdp_pdf resources server chooses what reward is: mean_criteria (default, the fraction of criteria passed), strict_pass (all-pass), or mixed: (1 - mixed_reward_alpha) * mean_criterion_pass + mixed_reward_alpha * all_pass, with mixed_reward_alpha defaulting to 0.5. In GRPO runs on GDP.pdf-style tasks that compared all-pass weights of 0.3, 0.5 and 0.65 from the same start, 0.5 scored best on the benchmark. all_pass and mean_criterion_pass are reported the same way in every mode, and the response records reward_mode. All-pass alone gives a sparse signal on long rubrics; the fraction passed alone rewards near-misses that the benchmark scores as zero. The mixture lets a run set the balance.
  • mask_failed_attempts on gdp_pdf_agent (off by default). An attempt whose input still does not fit after the DPI backoff (a context, image-count or payload limit) scores 0 with a failure_reason. That zero is right for evaluation but says nothing about an answer in training. With the option on, such an attempt gets mask_sample: true, a failure_kind from the shared vocabulary (model_context_limit for a context limit, model_request_error for an image-count or payload limit), and instance_config.mask_sample for NeMo RL versions that predate the top-level field, so the trainer leaves it out of the loss. A failed policy call or /verify is already masked on main in either mode, and rows whose judge call failed are masked by judge_failsafe.

Validation

Run on the branch rebased onto main after #5524 merged.

  • pytest resources_servers/gdp_pdf/tests: 100 passed, 1 skipped, including the new TestRewardMode (default mode, strict pass, mixed at alpha 0, 0.5, 0.8 and 1, the 0.5 default, empty answers scoring zero without judge calls in every mode, rejection of an unknown mode and an out-of-range alpha).
  • pytest responses_api_agents/gdp_pdf_agent/tests: 67 passed, 14 skipped (tests that need the example manifests, which were not rendered in this checkout). The new TestMaskFailedAttempts builds a text-only manifest, so it runs without them: off by default, masking a context limit and a payload limit, a failed /verify masked with the option on or off, a graded answer left alone.
  • ruff check, ruff check --select I and ruff format --check (v0.9.9, as in pre-commit) on both directories: clean.

Rollouts

N/A for evaluation: both options default to the current behaviour. The mixed reward (alpha 0.5) and the masking have been used in GRPO training runs on GDP.pdf-style tasks built on an earlier Gym version.

Compatibility and benchmark impact

None with the defaults. Training configs opt in with, for example, env.nemo_gym.gdp_pdf.resources_servers.gdp_pdf.reward_mode=mixed and env.nemo_gym.gdp_pdf_simple_agent.responses_api_agents.gdp_pdf_agent.mask_failed_attempts=true in NeMo RL.

Rebased onto main after #5524 merged; no overlap with it remains in the diff.

Proposed labels: enhancement, area:training.

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 server and agent READMEs, default config).
  • Pre-commit ruff checks pass locally on the changed files.
  • New source files include the required Apache-2.0 SPDX header (no new files).
  • All commits have DCO sign-off (git commit -s).

🤖 Generated with Claude Code

@copy-pr-bot

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

@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 4, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers needs-review PR is ready for code review and waiting on a reviewer labels Nov 7, 2026
…empts

reward_mode on the GDP.pdf resources server chooses what reward is:
mean_criteria (the default, unchanged) uses the fraction of criteria passed,
strict_pass uses all-pass, and mixed uses
(1 - mixed_reward_alpha) * mean_criterion_pass + mixed_reward_alpha * all_pass,
with mixed_reward_alpha defaulting to 0.5. In GRPO runs on GDP.pdf-style
tasks that compared all-pass weights of 0.3, 0.5 and 0.65 from the same
start, 0.5 scored best on the benchmark. all_pass and mean_criterion_pass are
reported the same way in every mode, and the response records the mode.

mask_failed_attempts on the GDP.pdf agent (off by default) marks an attempt
whose input never fit after the backoff (a context, image-count or payload
limit) with mask_sample, a failure_kind (model_context_limit or
model_request_error) and instance_config.mask_sample for NeMo RL versions
that predate the top-level field, so training leaves it out of the loss.
Evaluation keeps it off, so such an attempt still counts as a zero. A failed
policy call or /verify is already masked on main in either mode.

The agent tests build a text-only manifest, so they run without the
committed example manifests. Both READMEs and the default config describe
the options.

Co-authored-by: Dylan Lu <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tuomas Rintamaki <[email protected]>
@trintamaki
trintamaki force-pushed the gdp-pdf-training-rewards branch from 9953b83 to 0528ba1 Compare November 10, 2026 16:56
@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Nov 10, 2026
@yaoyu-33
yaoyu-33 enabled auto-merge November 10, 2026 17:01
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test 0528ba1

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 10, 2026 17:02
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 10, 2026
@yaoyu-33
yaoyu-33 added this pull request to the merge queue Nov 10, 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/42864386642

@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/42865615384

Merged via the queue into NVIDIA-NeMo:main with commit 11dac9d Nov 10, 2026
59 of 62 checks passed

This branch was previously deployed

1 inactive deployment
public — 0528ba11 Deployed Nov 10, 2026 by copy-pr-bot[bot] via release / finalize / notify #11482
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 ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants