Repository navigation
Conversation
Signed-off-by: Igor Gitman <[email protected]>
…ontract Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add optional per-task
answer_format_regexcontracts tomath_with_judgeandstem_judge. Templates can require an answer tag or line while keeping correctness grading in the existing resources server. For example, a task requiring only<answer>2</answer>receives zero forThe answer is <answer>2</answer>, even if the answer is correct.The regex must match the entire final assistant text and contain a nonempty named
answercapture. A mismatch returns zero without calling a correctness checker. Valid matches send only the captured answer to the existing grader and retain the original response.answer_format_validdistinguishes format compliance from correctness. Both task-data schemas and verifier requests reject malformed regexes and missing named captures.STEM applies the contract to answer and rubric rows, overriding boxed/free selection and
boxed_judge_input. Its truncation and empty-answer gates run first;max_answer_charsapplies to the capture. Saved results preserve their original boxed/free setting and regex for reverification. Rows without a regex retain existing behavior and omit the new optional output fields.Math preserves the complete capture for judge fallback. Captures with nested boxes or unmatched braces bypass symbolic grading to avoid grading a fragment; without a judge they receive zero. PolyMath, UGPhysics, and finance task schemas explicitly reject this optional setting until their own verifier paths implement it.
This extends the STEM row schema and gating behavior introduced in #6518. No separate issue is needed for this focused, optional environment feature. No changes to judge prompts or training preparation. Rows without a contract retain their existing scoring paths.
Validation
gym env test --resources-server math_with_judge +should_validate_data=truepassed example-data validation.gym env test --resources-server stem_judge +should_validate_data=truepassed example-data validation.pre-commit run --all-filespassed, including package layering and guardword checks.nvidia/moonshotai/kimi-k3.1-pro.ed6e351734ae4cea07689800c016ff73383675d0. Review was static, with test and live rollout evidence inspected; it does not replace human review or hosted CI.Compatibility
The regex is opt-in task configuration. Template authors must encode permitted whitespace, surrounding text, and answer cardinality in the pattern. The syntax is Python
re; patterns should be simple and bounded. Existing datasets are not migrated automatically. Regex format failures cannot be rescued by a judge.