Skip to content

fix(inverse_if): grade with the policy model server, as the README documents - #4941

Merged
athitten merged 2 commits into
mainfrom
qiaochuz/nvb-6790320-inverse-if-judge-model
Nov 19, 2026
Merged

athitten merged 2 commits into
mainfrom
qiaochuz/nvb-6790320-inverse-if-judge-model

Conversation

@qiaochuz-nv

@qiaochuz-nv qiaochuz-nv commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

The Inverse IF README's start command (gym env start --resources-server inverse_if --model-type vllm_model) now starts. On main it exits 1 at config validation before any rollout: inverse_if.yaml references a judge_model server that nothing in the README's stack defines. The failure is the same on every model type.

Fixes NVBug 6790320. Closes #4503.

Cause

resources_servers/inverse_if/configs/inverse_if.yaml:24-26 points judge_model_server at judge_model, and the only definition of that server (:128-136) is commented out — both since the file was added in #1529. The config was derived from multichallenge.yaml, which ships name: policy_model with the same commented-out judge_model block; inverse_if flipped the name without shipping a definition. The README was written for policy-as-judge throughout: both start commands load only inverse_if and the policy model, "Basic Setup" names policy_model as the judge, and no judge_* value is documented anywhere. Config validation rejects the dangling reference (nemo_gym/global_config.py, ServerRefNotFoundError).

Fix

  • inverse_if.yaml: judge_model_server.name: policy_model. This is the only change to the parsed config; the README commands and its Basic Setup already match it. The header comment now says the policy model judges by default, and the commented judge_model block stays as the example for grading with a separate endpoint, together with the override that selects it (++inverse_if.resources_servers.inverse_if.judge_model_server.name=judge_model).
  • tests/unit_tests/test_inverse_if_readme_config.py: finds every gym env start block in the README (asserts there are two), replays each through the real CLI with dispatch intercepted, resolves the overrides offline with GlobalConfigDictParser and placeholder policy values (no env.yaml), and asserts the judge reference resolves to policy_model with the policy server defined. On main it fails with the NVBug's error.

Not chosen: an opt-in configs/judge_model.yaml loaded with --config (the terminus_judge shape from #4557). That README had documented a dedicated judge that a later config change broke; this README never described one, so that fix would have edited both README commands and started a second model server by default for an environment whose docs and sibling (multichallenge) are policy-as-judge. Also not chosen: defining judge_model inside inverse_if.yaml, which would stop a recipe that defines its own judge_model with another adapter from composing.

Before the fix

Gym 80ace9f0f:

gym env validate --strict --resources-server inverse_if --model-type vllm_model \
  ++policy_base_url=http://127.0.0.1:9/v1 ++policy_model_name=Qwen/Qwen3-8B '++policy_api_key='
Error: In server instance 'inverse_if', field 'judge_model_server' references
responses_api_models/'judge_model', which is not defined in the merged config.
Available responses_api_models: 'policy_model'

Exit 1. The QA run that filed the bug hit the same three lines in stack.log from the README's gym env start; no server started and no inference ran.

After the fix

Gym 0761237e2 (this branch, rebased on 69a514999; main's later inverse_if changes — #4953, #4837, #5108 — leave the judge reference untouched), same command:

✓ Config is valid.

Exit 0. QA testcase inverse_if (the README start command with a case-owned Qwen3-8B vLLM on one H100, all five example rows, per-criterion live judging, and four controlled /verify calls): PASS 1/1 on this branch (202 s on c434dc221, this same change on the c62f9cc67 base; an earlier run on the 80ace9f0f base also passed). On main the same case stops at startup with the error above (the NVBug's runs on 06123724, 804c12a7, and r0.7.0 rc1).

Validation

  • tests/unit_tests/test_inverse_if_readme_config.py: 2 failed / 1 passed on main, 3 passed on this branch.
  • Related core tests (test_global_config, test_cli_main, test_cli_resources_servers, test_checkpoint_server_declarations, test_environment_scaffold, test_ray_opt_out, test_task_data::TestSchemaPresence, the terminus_judge README test): 593 passed.
  • gym env test --resources-server inverse_if: 19 passed.
  • pre-commit run --all-files: passed, no changes.
  • Rollout evidence (H100, Qwen/Qwen3-8B as policy and, via policy_model, as judge; shipped judge params 8192/0.7/0.8): All 4 / 4 servers ready; gym eval run on the five committed example rows wrote 5/5 rollouts with an empty failures sidecar; every response completed, every row mask_sample: false; 15 judge calls, each with a parsed PASS/FAIL verdict and explanation; rewards 1.0, 1.0, 0.67, 1.0, 1.0 (run on c434dc221, the same diff on the c62f9cc67 base) (example_3, the letter-swap task, is the one the policy gets partly wrong; in the earlier run it rendered C++ as '+ + C' and the judge failed the "exactly five languages" and "first/last letter swapped" criteria with matching explanations); mean/reward 0.933, identical from the eval run's aggregate and from replaying the rows through /aggregate_metrics. Four controlled /verify calls on the same stack (reference answer, all-wrong answer, mixed, and reference wrapped in <thinking>) scored exactly their expected [1,1,1], [0,0,0], [1,0,1], [1,1,1].

Compatibility

A stack started from the shipped config goes from failing validation to grading with the policy model. A user config that defines its own judge_model and relied on the shipped reference now needs the one-line override above; nothing in this repo does (benchmarks/nemotron_3.5_super/reward_profiling already repoints inverse_if to nl2bash_judge_model). No data or scoring change.

@qiaochuz-nv qiaochuz-nv added bug Something isn't working QA_fix Fix implemented by a QA team member area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers needs-review PR is ready for code review and waiting on a reviewer complexity:low Localized change in one scope with a small, straightforward review surface labels Oct 22, 2026
@copy-pr-bot

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

@qiaochuz-nv
qiaochuz-nv requested a review from yaoyu-33 October 22, 2026 19:33
@qiaochuz-nv

Copy link
Copy Markdown
Contributor Author

/ok to test 4a8e9e8

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 22, 2026 19:36
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Oct 23, 2026
…cuments

Both README `gym env start` commands load only inverse_if and the policy
model, and the README's Basic Setup names `policy_model` as the judge,
but inverse_if.yaml referenced a `judge_model` server whose only
definition was commented out. Config validation rejected the dangling
reference (ServerRefNotFoundError) before any rollout, on every model.

Point judge_model_server at policy_model, matching multichallenge.yaml
that this config was derived from. Keep the commented judge_model block
as the example for grading with a separate endpoint, with the override
that selects it.

Add a regression test that replays each README start command through
the CLI and resolves it offline against placeholder policy values.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: qiaochuz <[email protected]>
@qiaochuz-nv
qiaochuz-nv force-pushed the qiaochuz/nvb-6790320-inverse-if-judge-model branch from 4a8e9e8 to 9a412c3 Compare November 7, 2026 07:22
@qiaochuz-nv

Copy link
Copy Markdown
Contributor Author

/ok to test 9a412c3

…test tree

#5589 mirrors nemo_gym packages under tests/unit_tests; the sibling README
config tests live in tests/unit_tests/benchmarks and import
nemo_gym.config.global_config (the nemo_gym.global_config path only
resolves through the moved-module shim, with a warning). Follow them.

Signed-off-by: qiaochuz <[email protected]>
@qiaochuz-nv

Copy link
Copy Markdown
Contributor Author

/ok to test 0761237

@yaoyu-33 yaoyu-33 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. The README launch now resolves the judge correctly, with explicit separate-judge overrides preserved. All 22 focused tests passed.

@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 18, 2026
@athitten
athitten 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/44431985655

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

Merged via the queue into main with commit ac4d20b Nov 19, 2026
70 checks passed
@athitten
athitten deleted the qiaochuz/nvb-6790320-inverse-if-judge-model branch November 19, 2026 01:23

This branch was previously deployed

1 inactive deployment
public — 0761237e Deployed Nov 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #10847
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 bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface QA_fix Fix implemented by a QA team member ready-to-merge PR is approved, current, and waiting for final CI or merge 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.

[NVBug 6790320] Fix Inverse IF quick-start: judge_model reference has no server definition

3 participants