Skip to content

docs: add multi-reward verification - #1665

Merged
cwing-nvidia merged 3 commits into
mainfrom
cwing/docs-multireward-tutorial
Jun 26, 2026
Merged

cwing-nvidia merged 3 commits into
mainfrom
cwing/docs-multireward-tutorial

Conversation

@cwing-nvidia

@cwing-nvidia cwing-nvidia commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a how-to, Multi-Reward Verification, covering how a verifier returns multiple reward components β€” the reward_components dict, per-objective top-level fields, and the summed scalar reward β€” for per-objective evaluation and multi-objective RL (e.g. GDPO).
  • Links it from the root README tutorials table and the example_tool_call_multireward server README, and aligns that README's wording with the tutorial.

Status of each path

  • Evaluation is fully supported today (aggregate-metrics reports a per-objective pass rate from the top-level fields).
  • The multi-objective RL (GDPO) section is intentionally conceptual and defers "how reward_components reaches the trainer" to the framework-integration docs, since consuming components end-to-end depends on per-framework NeMo Gym integration

Test plan

  • fern check passes
  • Docs preview renders correctly (links, callouts, tables, code blocks)

@copy-pr-bot

copy-pr-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@cwing-nvidia cwing-nvidia changed the title docs: add multi-reward verification tutorial docs: add multi-reward verification Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

@cwing-nvidia cwing-nvidia linked an issue Jun 23, 2026 that may be closed by this pull request
3 tasks
@anwithk
anwithk requested a review from ffrujeri June 23, 2026 16:19
@cwing-nvidia cwing-nvidia added the documentation Improvements to documentation label Jun 23, 2026
@cwing-nvidia

Copy link
Copy Markdown
Contributor Author

TODO: update the comments in app.py for documentation consistency

@ffrujeri ffrujeri 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 this β€” a clear, well-cross-referenced walkthrough of the multi-reward pattern. A team review (docs-only, 3 files) verified the load-bearing technical claims against the code: reward = sum(components), the Pydantic field-drop rationale for subclassing BaseVerifyRequest, and the "aggregate metrics only surfaces top-level numeric fields, not nested dicts" behavior (confirmed in nemo_gym/reward_profile.py). All internal links, the GDPO arXiv reference, and the code snippets check out.

Two small, non-blocking suggestions are left inline. One housekeeping note: the branch is currently behind main (draft, auto-sync disabled), so a routine rebase before merge would be good.

Generated by Claude Code

`reward_components` and normalizes each component independently, rather than collapsing
them into one number. A GRPO baseline instead reads the summed `reward` and therefore
cannot distinguish rollouts with the same total but different composition β€” the advantage
collapse GDPO is designed to fix. How `reward_components` reaches the trainer depends 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.

README.md:27

The README/tutorial now frame this for both evaluation and multi-objective RL and soften the trainer wording to "depends on the training framework's NeMo Gym integration." The app.py module docstring (L14-33) and the reward_components field comment (L62-64) still describe it as "intended for GDPO" and assert the specific "NeMo-RL exposes them as reward1, reward2, … ordered by component name" ordering. Would it be worth aligning those app.py comments in this PR so the code and docs tell one story? (Looks like it matches your TODO above.)

@@ -0,0 +1,182 @@
---
title: "Multi-Reward Verification"

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.

multi-reward-environment.mdx:2

Nice addition! Every other tutorial has a <Card> in the Environment Tutorials Overview grid β€” would it make sense to add one for Multi-Reward too, so readers browsing the Overview can discover it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

intentionally didn't add those nav elements previously since I was waiting on another PR, this is going to move to a new Build Verifiers section

ffrujeri
ffrujeri previously approved these changes Jun 25, 2026

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

Just left a few small suggestions

@cwing-nvidia
cwing-nvidia force-pushed the cwing/docs-multireward-tutorial branch from 8d0e4d6 to d1a0e9e Compare June 26, 2026 05:50
@cwing-nvidia
cwing-nvidia changed the base branch from main to cwing/docs-build-verifiers June 26, 2026 05:50
@cwing-nvidia
cwing-nvidia marked this pull request as ready for review June 26, 2026 05:51
@cwing-nvidia

Copy link
Copy Markdown
Contributor Author

@ffrujeri stacked this on top of another PR that introduces the Build Verifiers docs section #1751

@cwing-nvidia
cwing-nvidia changed the base branch from cwing/docs-build-verifiers to main June 26, 2026 17:18
@cwing-nvidia
cwing-nvidia force-pushed the cwing/docs-multireward-tutorial branch from d1a0e9e to c7ffa26 Compare June 26, 2026 17:26
@cwing-nvidia
cwing-nvidia requested a review from sephmard June 26, 2026 17:34
sephmard
sephmard previously approved these changes Jun 26, 2026

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

This is great. A few small nits worth consideration before merge - but approving as is:

1. Step 3 wording. "The sum of your components is the usual default" reads like a contract. Worth softening to "a common convention" since weighted sums or non-additive combinations are valid too.
2. Split verify() snippet. the "Score each objective" and "Return all three forms" sections each show part of the verify() method body, but it's not obvious they're meant to be one continuous method. Someone copying the code would have to manually stitch them together. A # ... between the two blocks, or merging them into one, would make the continuity explicit.
3. predicted_calls on the response class it appears in the code block but isn't mentioned in the surrounding text. Worth a one-liner clarifying it's for debugging/inspection and not required by the pattern.

Merge order note: this PR and #1781 both modify build-verifiers/index.mdx (both remove the Resources Server card, but in different ways). Whichever lands second will need a quick rebase to confirm the index ends up with Verification Patterns + Multi-Reward cards and nothing else.

Approved.

Add a how-to for returning multiple reward components from a verifier,
useful for per-objective evaluation and multi-objective RL (e.g. GDPO).
Link it from the README tutorials table and the
example_tool_call_multireward server README.

Signed-off-by: Chris Wing <cwing@nvidia.com>
- Move the Multi-Reward Verification page from Environment Tutorials into the
  Build Verifiers section and add it as a card on the section index
- Point README and example-server README links at the new URL
- Fix the aggregate-metrics link to /evaluation/aggregate-metrics
- Align example_tool_call_multireward app.py comments with the docs: framed for
  both evaluation and multi-objective RL, with trainer consumption described as
  framework-integration dependent

Signed-off-by: Chris Wing <cwing@nvidia.com>
- Soften the scalar reward wording: summing components is "a common
  convention" rather than a default contract
- Make the split verify() snippet's continuity explicit with
  continuation markers across the scoring and return blocks
- Drop the unexplained predicted_calls field from the response class
  snippet (example-specific debug output, not part of the pattern)

Signed-off-by: Chris Wing <cwing@nvidia.com>
@cwing-nvidia

Copy link
Copy Markdown
Contributor Author

@sephmard rebased to latest main and addressed your feedacbk

@sephmard
sephmard self-requested a review June 26, 2026 19:01

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

lgtm

@cwing-nvidia
cwing-nvidia merged commit 9284c5b into main Jun 26, 2026
10 checks passed
@cwing-nvidia
cwing-nvidia deleted the cwing/docs-multireward-tutorial branch June 26, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: multi-reward verification

3 participants