Skip to content

feat(mcqa): Add custom answer extraction via template_metadata to support STEM MCQA dataset - #128

Merged
banghuaz-nvidia merged 6 commits into
mainfrom
psgundecha/rl-templates-mcqa
Oct 21, 2025
Merged

banghuaz-nvidia merged 6 commits into
mainfrom
psgundecha/rl-templates-mcqa

Conversation

@psgundecha-nv

Copy link
Copy Markdown
Contributor

Adds support for custom answer extraction in MCQA resources server via the optional template_metadata.output_regex field. This enables handling STEM datasets with custom prompt formats that don't match the standard grading modes.

- Add template_metadata field to MCQARunRequest for custom output regex
- Implement _parse_answer_with_custom_regex function for flexible answer extraction
- Update verify function to prioritize template_metadata.output_regex over grading_mode
- Maintain full backward compatibility with existing grading modes
- Support both letter matching and option text matching with custom regex patterns

Signed-off-by: Pritam Gundecha <[email protected]>
Signed-off-by: Pritam Gundecha <[email protected]>
Add 6 test cases covering template_metadata feature including edge cases,
priority handling, and fallback behavior. Update README with feature docs,
examples, and fix incorrect input schema. Include example files with
verified rollouts.

Signed-off-by: Pritam Gundecha <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 10, 2025

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.

Signed-off-by: Pritam Gundecha <[email protected]>
@psgundecha-nv
psgundecha-nv force-pushed the psgundecha/rl-templates-mcqa branch 2 times, most recently from 35c49e6 to ab82c29 Compare October 14, 2025 20:34
@psgundecha-nv
psgundecha-nv force-pushed the psgundecha/rl-templates-mcqa branch from 4205884 to fdeccd6 Compare October 21, 2025 21:29

@banghuaz-nvidia banghuaz-nvidia 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.

Can confirm this works and synced with Pritam offline on the remaining questions.

@banghuaz-nvidia
banghuaz-nvidia merged commit 6dd02fc into main Oct 21, 2025
@banghuaz-nvidia
banghuaz-nvidia deleted the psgundecha/rl-templates-mcqa branch October 21, 2025 21:46
abubakaria56 pushed a commit to abubakaria56/Gym that referenced this pull request Mar 2, 2026
…port STEM MCQA dataset (NVIDIA-NeMo#128)

Adds support for custom answer extraction in MCQA resources server via
the optional `template_metadata.output_regex` field. This enables
handling STEM datasets with custom prompt formats that don't match the
standard grading modes.

---------

Signed-off-by: Pritam Gundecha <[email protected]>
abubakaria56 pushed a commit to abubakaria56/Gym that referenced this pull request Mar 2, 2026
…port STEM MCQA dataset (NVIDIA-NeMo#128)

Adds support for custom answer extraction in MCQA resources server via
the optional `template_metadata.output_regex` field. This enables
handling STEM datasets with custom prompt formats that don't match the
standard grading modes.

---------

Signed-off-by: Pritam Gundecha <[email protected]>
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