Repository navigation
feat(gdp-pdf): training reward modes and opt-in masking of failed attempts - #5529
Merged
Merged
Conversation
…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
force-pushed
the
gdp-pdf-training-rewards
branch
from
November 10, 2026 16:56
9953b83 to
0528ba1
Compare
yaoyu-33
approved these changes
Nov 10, 2026
yaoyu-33
enabled auto-merge
November 10, 2026 17:01
Contributor
|
/ok to test 0528ba1 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42864386642 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42865615384 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_modeon thegdp_pdfresources server chooses whatrewardis:mean_criteria(default, the fraction of criteria passed),strict_pass(all-pass), ormixed:(1 - mixed_reward_alpha) * mean_criterion_pass + mixed_reward_alpha * all_pass, withmixed_reward_alphadefaulting 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_passandmean_criterion_passare reported the same way in every mode, and the response recordsreward_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_attemptsongdp_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 afailure_reason. That zero is right for evaluation but says nothing about an answer in training. With the option on, such an attempt getsmask_sample: true, afailure_kindfrom the shared vocabulary (model_context_limitfor a context limit,model_request_errorfor an image-count or payload limit), andinstance_config.mask_samplefor NeMo RL versions that predate the top-level field, so the trainer leaves it out of the loss. A failed policy call or/verifyis already masked on main in either mode, and rows whose judge call failed are masked byjudge_failsafe.Validation
Run on the branch rebased onto main after #5524 merged.
pytest resources_servers/gdp_pdf/tests: 100 passed, 1 skipped, including the newTestRewardMode(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 newTestMaskFailedAttemptsbuilds a text-only manifest, so it runs without them: off by default, masking a context limit and a payload limit, a failed/verifymasked with the option on or off, a graded answer left alone.ruff check,ruff check --select Iandruff 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
mixedreward (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=mixedandenv.nemo_gym.gdp_pdf_simple_agent.responses_api_agents.gdp_pdf_agent.mask_failed_attempts=truein NeMo RL.Rebased onto main after #5524 merged; no overlap with it remains in the diff.
Proposed labels:
enhancement,area:training.Checklist
git commit -s).🤖 Generated with Claude Code