Skip to content

[Eval] Robust CPU-based Efficient MATH grader - #95

Open
Nativeatom wants to merge 1 commit into
marin-community:mainfrom
Nativeatom:efficient_grader
Open

[Eval] Robust CPU-based Efficient MATH grader#95
Nativeatom wants to merge 1 commit into
marin-community:mainfrom
Nativeatom:efficient_grader

Conversation

@Nativeatom

Copy link
Copy Markdown

TL; DR

Extending the existing CPU-based MATH grader to more broader cases with larger testing samples (considering the string match nature of many libraries). Specifically

  • 1000 new MATH samples introduced (10x more).
  • White space insensitive to expressions. For example (1,2) = ( 1, 2 ), 1+2i = 1 + 2 i.
  • Robust interpretation of numerical value separators. For example, $1,000,000$, $1,\\!000\\!000$ and $1000000$ are identical.
  • Insensitive to leading zeros. For example, $.12$ = $0.12$.
  • Fraction and decimal with identical values. For example, $\frac{1}{2}$ = $0.5$.
  • Redundant symbol wrappers. For example, $$2$$ and $2$.
  • Insensitive to redundant text wrappers. For example, \\text{Amy}, $Amy$ are equivalent to Amy.
  • Latex equivalent variants. For example, \\dfrac and \\tfrac should be reduced and equivalent to \\frac.
  • The latex bracket wrapper. For example, \\left[ X, Y \\right], \\left(X, Y\\right) should be reduced to [X, Y] and (X, Y) respectively. Besides, it also obey the previous white-space insensitivity: \\left( X, Y \\right) is equivalent to (X, Y).
  • Extra multiple choice variants. For example, $E$, (E), $(E)$, \\text{E}, \\text{(E)} should be reduced and equivalent to E after extraction.
  • Tolerate the missing base if the value matches the reference. For example, $40$ is correct if the reference is $40_{9}$.

Performance

grader cold cache warm agreement
minerva 1438.06 ms 907.24 ms 999/1000
hendrycks 2002.91 ms 775.03 ms 999/1000

The missing agreement is due to evaluating answers with multiple values, see Notes

Notes

  • The order agnostic comparison of product is still missing due to the string-match limitation. For example, (a+2)(b+1) and (b+1)(a+2).
  • For answer with multiple values, due to the parse_latex design of sympy, the ANTLR parser parses the first valid sub-expression and silently ignores the trailing input. The grammar has no top-level comma production. And the remaining answer would be dropped.

Testing

New testing script in

python scripts/benchmarks/benchmark_math_graders_extend.py

Part of marin-community/marin#7463, extended from #58.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@penfever penfever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Requesting changes: the revised graders are not wired into shipped math benchmarks, which still import lm-eval graders. Integrate them into the intended task path, or narrow the PR to a non-production utility with accurate scope. Required code CI also has not run.

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