Skip to content

fix(rolemrc): correct BLEU/METEOR + judge wiring, report published roll-ups; add gym-native RAGTruth/RoleMRC benchmarks - #2822

Merged
bxyu-nvidia merged 10 commits into
NVIDIA-NeMo:mainfrom
pachmu:mbagdasarova/rolemrc-ragthuth-conf-fix
Sep 15, 2026
Merged

bxyu-nvidia merged 10 commits into
NVIDIA-NeMo:mainfrom
pachmu:mbagdasarova/rolemrc-ragthuth-conf-fix

Conversation

@pachmu

@pachmu pachmu commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

RoleMRC's numbers didn't reproduce the published report, and the judge config
graded the model under test with itself. Also adds benchmarks/ entries so
RAGTruth and RoleMRC run via gym env start --benchmark …, not only through an
external harness hitting *_serve.yaml.

Fixes

Area Before After
BLEU smoothed, 0-100, never a hard 0; severalΓ— upstream evaluate.load("bleu") reimplemented β€” 13a tok, max_order=4, unsmoothed
METEOR concurrent WordNet lookups corrupted a shared file handle β†’ silent 0s serialized behind a lock, loaders warmed at startup
Metrics only mean_reward (= ROUGE-L) + per-dimension means auto/*/mean + judge/avg_simple{,_no_mt} / avg_weighted
Judge model policy_model β€” self-grading dedicated judge_model
Empty judge reply parsed as 0 judge failure, with reason

Plus: rolemrc_judge_serve.yaml (judge /verify, no agent β€” rolemrc_judge.yaml
fails validation there on its agent's policy_model ref); null judge params are
dropped so reasoning models can omit temperature/top_p; prepare_rolemrc.py
asserts the upstream task histogram; RAGTruth's pinned commit had a trailing
space that malformed the download URL.

Judge fixes (resources_servers/rolemrc/)

Conversation β€” prepare_rolemrc.py writes
verifier_metadata: {"conversation": messages} on judge rows (reference rows
unchanged); app.py adds _normalize_turns() and _conversation_messages(),
which prefers that and falls back to responses_create_params.input.
data/example_judge.jsonl regenerated.

API surface β€” new judge_api + judge_chat_completion_create_params config
fields (judge_responses_create_params kept for judge_api: responses);
model_post_init validates the field the surface needs; _judge_payload() and
_call_judge_aspect() build and unwrap either dialect. Both judge configs
switched to the chat body (messages: [], n: 1, temperature: 0.0,
max_tokens: 2048).

Text handling β€” _strip_reasoning_for_judge() replaces _strip_think() on
the policy response; _extract_nested_content() replaces lead-ins anywhere and
falls back to the full string without a ". "; _parse_judge_score() returns
(score, is_bad), requires a bare integer, does not clamp; _NESTED_INSTRUCTION
keeps a significant trailing space as \x20. requirements.txt: +regex.

Testing

gym env test --resources-server rolemrc.

Fill in the Testing line β€” I couldn't verify you ran real rollouts.## 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, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format/copyright pass).
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

pachmu added 2 commits August 27, 2026 11:28
- BLEU: sacrebleu.sentence_bleu is smoothed and 0-100, so it never emits a hard 0 and ran several times above upstream. Reimplement evaluate.load("bleu") (13a tok, max_order=4, unsmoothed).
- METEOR: concurrent NLTK WordNet lookups corrupted a shared file handle and _safe_call turned the failures into silent 0s. Serialize behind a lock and warm wordnet/punkt at startup.
- compute_metrics: emit auto/<metric>/mean corpus means and the judge roll-ups  avg_simple / avg_weighted / avg_simple_no_mt (the headline). These aggr
  per aspect, so they are not recoverable from a mean of per-row rewards.
  42 -refused rows; avg_simple* are count-independent and match.
- Judge ran on policy_model, i.e. graded its own output. Wire a dedicated judge_model via ${judge_*}, and add rolemrc_judge_serve.yaml for harnesses
  that own generation (rolemrc_judge.yaml fails validation there on its a policy_model reference).
- Send only judge params set in config, dropping nulls, so reasoning mode that reject temperature/top_p can omit them. An empty judge reply is now a judge failure with a reason, not a parsed 0.
- prepare_rolemrc.py asserts the upstream task histogram  (ROLEMRC_ALLOW_DATASET_DRIFT=1 overrides) and prints per-aspect call co
- ragtruth: strip trailing space from pinned _PUBLIC_COMMIT (malformed URL).

Tests: TestJudgeFailureReporting, TestJudgeSamplingParams.
Signed-off-by: mbagdasarova <mbagdasarova@nvidia.com>
… wiring only; each chains to the resources server's config and inherits its *_simple_agent. Scoring and aggregation stay in the resources server.

- ragtruth: all three slices in one file, so the headline is the upstream all-slice accuracy while compute_metrics still splits by task_type.
- rolemrc: config.yaml (reference mode, no model server needed for scoring) and config_judge.yaml (5-aspect judge, requires a separate judge endpoint via +judge_base_url / +judge_api_key / +judge_model_name) prompt_config: null throughout β€” rows already carry a built responses_create_params.input.

Signed-off-by: mbagdasarova <mbagdasarova@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 27, 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 Aug 28, 2026
pachmu added 3 commits August 31, 2026 14:22
- Carry the conversation in `verifier_metadata`. A caller that only POSTs
  /verify may not deliver `responses_create_params`, which dropped the system
  instruction and earlier turns from the judge prompt.
- Add `judge_api` (`chat_completions` default, `responses` opt-in) with a
  matching `judge_chat_completion_create_params`. Not cosmetic: on identical
  prompts the same judge scored `judge/avg_simple_no_mt` 0.55 through
  /v1/chat/completions vs 0.31 through /v1/responses.
- Reasoning traces are stripped by splitting on `</think>` / `<channel|>`;
  nested-instruction lead-ins are removed anywhere, not just as a prefix; a
  verdict must be a bare integer, anything else is a bad aspect scored 0.
- Judge budget to `max_tokens: 2048` β€” a reasoning judge spends it before
  emitting the score.

Also a comment pass over rolemrc, ragtruth, spartqa: comments
explain the code instead of comparing it to the original benchmark, and no
longer name the external runner that drives the Gym servers.

Signed-off-by: mbagdasarova <mbagdasarova@nvidia.com>
…ragthuth-conf-fix

# Conflicts:
#	resources_servers/ragtruth/prepare_ragtruth.py
#	resources_servers/rolemrc/configs/rolemrc_judge.yaml
@pachmu

pachmu commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

@cmunley1 could you please take a look? The changes are minor but important to run correctly with gym.

bxyu-nvidia
bxyu-nvidia previously approved these changes Sep 4, 2026
@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 04b72fb

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Sep 4, 2026
… in verifier_metadata

Signed-off-by: mbagdasarova <mbagdasarova@nvidia.com>
@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test ed61ca0

@bxyu-nvidia
bxyu-nvidia merged commit 842b777 into NVIDIA-NeMo:main Sep 15, 2026
38 checks passed

This branch was previously deployed

1 inactive deployment
public β€” ed61ca0f Deployed Sep 15, 2026 by copy-pr-bot[bot] via release / finalize / notify #2988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants