Skip to content

fix(reward): strip LaTeX-escaped set braces without trailing backslash (#162)#216

Open
kiannidev wants to merge 1 commit into
mini-router:mainfrom
kiannidev:sn74-kiannidev-math-braces
Open

fix(reward): strip LaTeX-escaped set braces without trailing backslash (#162)#216
kiannidev wants to merge 1 commit into
mini-router:mainfrom
kiannidev:sn74-kiannidev-math-braces

Conversation

@kiannidev

@kiannidev kiannidev commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #162: normalize_math_answer left a trailing \ on LaTeX-escaped set braces \{...\}, so equal set answers graded as wrong.

Change

  • Make the outer-brace capture non-greedy so \{1,2,3\}1,2,3
  • Offline regression tests in tests/test_reward_math.py
  • JOURNAL entry

Test plan

  • pytest tests/test_reward_math.py — 16 passed

mini-router#162)

Make the outer \{...\} / {...} capture non-greedy so \{1,2,3\} normalizes
to 1,2,3 instead of 1,2,3\ and grades equal.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added docs Documentation changes miner Miner contribution PR train Training or routing changes labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation changes miner Miner contribution PR train Training or routing changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reward: normalize_math_answer leaves a trailing backslash on LaTeX-escaped set braces \{...\}

1 participant