Skip to content

docs(swerl_llm_judge): document lenient as the grading_mode default - #5098

Merged
athitten merged 1 commit into
mainfrom
qiaochuz/nvb-6790282-swerl-grading-mode-default
Nov 19, 2026
Merged

athitten merged 1 commit into
mainfrom
qiaochuz/nvb-6790282-swerl-grading-mode-default

Conversation

@qiaochuz-nv

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes the swerl_llm_judge README match the server's actual grading_mode default. The README said a request that omits grading_mode is graded strict; the server grades it lenient, so <solution>B because this patch fixes it</solution> with gold B earns reward 1.0, where the README promises None / 0.0. This PR keeps the shipped behavior and corrects the docs.

Fixes NVBug 6790282. Closes #4512.

Cause

The disagreement dates from when the server was added in #561: the README said default: "strict" and strict (default), while SWEJudgeRunRequest.grading_mode (app.py:40) defaulted to "lenient". #2800 copied the lenient default into TaskData (task_data.py:52) and described lenient as "also accepts bare letters". That is wrong: lenient also needs a <solution> block. No config overrides the default.

Fix

  • README: grading_mode is documented as default: "lenient", and the Grading modes section marks lenient as the default. Lenient is now described the way the code works: it reads the last solution block, takes the first letter that stands alone (not part of a word), and extracts nothing if that letter is not an option. An example is added.
  • task_data.py: corrected the grading_mode field description.
  • Tests: test_readme_documents_schema_default_grading_mode checks that the README's field default and section default both equal the request and TaskData defaults. test_verify_omitted_grading_mode_uses_lenient checks that an omitted mode verifies leniently.

Why the docs change instead of switching the code default to strict: lenient is what the server has always done. Every shipped row sets grading_mode: "strict" explicitly (example.jsonl 5/5, registry swe_rl_llm_judge 0.0.1 train 1969/1969 and validation 88/88), so this PR changes no reward on shipped data.

Before the fix

Gym 691655492 (main):

pytest resources_servers/swerl_llm_judge/tests -q
>       assert field_default.group(1) == schema_default
E       AssertionError: assert 'strict' == 'lenient'
FAILED resources_servers/swerl_llm_judge/tests/test_app.py::TestApp::test_readme_documents_schema_default_grading_mode
========================= 1 failed, 3 passed =========================

On the same main, the QA case swerl_llm_judge runs the README stack with a live policy. Its omitted-mode control, which expects the README's strict default, fails:

FAIL (55.0s): independent SWE choice extracted_answer: expected None, got 'B'
swerl_llm_judge: 0/1 passed in 55.0s

After the fix

Gym 39be07f31 (this branch), same command:

============================== 4 passed ==============================

The QA case uses the control that expects the documented lenient default:

PASS    52.2s  evaluate five complete README patch-choice prompts and both deployed grading modes with mixed controls
swerl_llm_judge: 1/1 passed in 52.3s

Validation

  • QA testcase swerl_llm_judge (real README stack, live policy, 5 generations, 120 explicit-mode HTTP controls + the omitted-mode control): before 0/1, after 1/1.
  • gym env test --resources-server swerl_llm_judge: 4 passed (server venv).
  • pre-commit run --all-files: passed.
  • Rollout evidence: N/A beyond the QA run above. Runtime behavior does not change; this is docs plus tests.

Compatibility

No runtime change. Readers of the README now see the default the server has always used. Callers that want strict grading must keep sending grading_mode: "strict", as all shipped data already does.

🤖 Generated with Claude Code

@qiaochuz-nv qiaochuz-nv added QA_fix Fix implemented by a QA team member docs Documentation-only updates or documentation debt 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 26, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 26, 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 26, 2026 21:29
@qiaochuz-nv

Copy link
Copy Markdown
Contributor Author

/ok to test 39be07f

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 26, 2026 21:36
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Oct 27, 2026
The README said an omitted grading_mode means strict, but SWEJudgeRunRequest and
TaskData have defaulted to lenient since the server was added (#561), and no config
overrides it. Document the shipped default, describe lenient extraction as the code
does it (first standalone letter in the last solution block), and correct the TaskData
field description, which said lenient accepts bare letters outside a solution block.

Add a test that the README default matches both schema defaults, and one that an
omitted grading_mode verifies leniently.

NVBug 6790282, GYM-1037, closes #4512.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: qiaochuz <[email protected]>
@qiaochuz-nv

Copy link
Copy Markdown
Contributor Author

/ok to test 9f2c693

@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 documentation now matches the existing lenient default without changing grading behavior. All 4 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
@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label 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/44431915619

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

Merged via the queue into main with commit fb5c1bf Nov 19, 2026
64 checks passed
@athitten
athitten deleted the qiaochuz/nvb-6790282-swerl-grading-mode-default branch November 19, 2026 01:21

This branch was previously deployed

1 inactive deployment
public — 9f2c6935 Deployed Nov 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #10837
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 complexity:low Localized change in one scope with a small, straightforward review surface docs Documentation-only updates or documentation debt QA_fix Fix implemented by a QA team member 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.

[NVBug 6790282] Reconcile swerl_llm_judge grading_mode default with README strict

3 participants