Repository navigation
Description
Queue rank 27/48 · Difficulty 3/5 · Status on main: not_fixed
NVBug: https://nvbugspro.nvidia.com/bug/6847526 · Priority: Unprioritized · ARB: Ananth Subramaniam
GitHub: none found (no Gym PR; Jira NMGYM-75 "In Review", no linked PR)
Summary
The MCQA verifier's custom-regex path returns a captured letter even when non-empty option metadata excludes it, contradicting the README which says letters are validated against options keys. A reply "ANSWER IS Z" with options A/B yields extracted_answer="Z" (expected null). By code inspection, the invalid capture also blocks the strict-boxed fallback, so "ANSWER IS Z\n\boxed{B}" scores ("Z", 0.0) instead of ("B", 1.0), and counts as answered in no_answer.
Reproduction
Start the README MCQA/simple_agent/openai_model stack and POST to /verify: options [{"A":"Circle"},{"B":"Square"}], expected_answer="B", template_metadata.output_regex="ANSWER IS\\s*([A-Za-z])", text "ANSWER IS Z". Returns HTTP 200 extracted_answer="Z", reward 0.0. Repro offline via MCQAResourcesServer.verify() (CPU, no model).
Root cause
resources_servers/mcqa/app.py:315-317: in _parse_answer_with_custom_regex, when allowed_letters is non-empty and the captured letter is not in it, the else: branch still return captured. Introduced in PR #128 (6dd02fc). verify() runs the regex path first (app.py:392-394) and only falls back if pred is None (:397), so a bad capture suppresses recovery. README.md:14/23/266 say letters are validated against option keys.
Status on main (not_fixed)
HEAD 75bb53e: defect branch verbatim at app.py:315-317. Only app.py commit since the bug rev (399e678) is b4d3fbc, a Ray-declaration chore; README unchanged. reward_profile.py:591 treats non-None "Z" as answered. No Gym PR found.
Proposed fix
Design decision with the dataset owner (ARB). (a) Enforce option keys: return None at app.py:315-317 (fall through to option-text match, then grading_mode). Caution: 1,886 rows of nvidia/Nemotron-RL-knowledge-mcqa train (gold not among non-null option keys) currently score 1.0 only via this branch; (a) drops them to 0.0 unless repaired, so (a) must ship with a dataset fix. (b) Keep behavior; document the exception at README.md:14/23/266 and the custom-regex section (45-63). Docs-only. Either way add tests in tests/test_app.py: complete A/B options + captured "Z"; gold outside its options. Preserve test_template_metadata_without_options (line 503).
Validation
QA testcases/environments/mcqa.py control 16 (line 166) and oracle prediction() (defined at line 66; its in-options validation statement is line 74) encode the validated-letter rule. Re-run ./run.sh test mcqa. If (a): flip mcqa to pass once fix is on main + released. If (b): update control 16 and the oracle to the documented contract.
Triage
Difficulty 3/5 — root cause pinpointed, CPU-unit-testable, but the fix is a contract choice needing dataset-owner agreement with 0.31% train-split blast radius. Needs GPU/model: no.
Reviewer notes
Verifier confirmed not_fixed (defect verbatim at app.py:315-317) and difficulty 3. Corrections: oracle prediction() is defined at mcqa.py:66 (line 74 is its in-options validation statement; control 16 at 166 is correct); the boxed-fallback and no_answer impacts are code-inspection inferences, so phrased "by code inspection"; the empty-options test to preserve is test_template_metadata_without_options at line 503.
Activity