RefGrader: Automated Grading of Mathematical Competition Proofs using Agentic Workflows

Hamed Mahdavi, Pouria Mahdavinia, Samira Malek, Pegah Mohammadipour, Alireza Hashemi, Majid Daliri, Alireza Farhadi, Amir Khasahmadi, Niloofar Mireshghallah, Vasant Honavar

TL;DR

While state-of-the-art Large Language Models (LLMs) have become remarkably adept at solving complex, Olympiad-level math problems, using them to grade mathematical proofs remains a significant challenge. This paper introduces RefGrader, an agentic workflow that automatically designs problem-specific rubrics from reference solutions to grade proofs. By breaking down grading into a multi-step verification and rubric-matching process, RefGrader substantially improves an LLM's ability to accurately award partial credit and detect subtle logical fallacies.

What Problem Does This Paper Address?

Recent breakthroughs have enabled frontier models like Gemini 2.5 Pro and DeepSeek-R1 to solve gold-medal-level International Mathematical Olympiad (IMO) problems. However, evaluating a mathematical proof is fundamentally harder than verifying a final numerical answer. A proof can be incomplete, contain subtle logical leaps, or follow an entirely unexpected but valid alternative path.

When standard LLMs are asked to grade these proofs in a single turn, they exhibit a strong "optimistic bias." They routinely over-score low-quality or zero-progress solutions because they struggle to calibrate the severity of errors or consistently apply a 0–7 Olympiad scale. If AI is to be used reliably as an automated judge—whether for evaluating human students or providing reward signals for reinforcement learning—it must be capable of nuanced, calibrated partial credit assignment.

Methods

To overcome the limitations of single-turn grading, the authors propose RefGrader, a 5-step agentic framework grounded in correct reference solutions:

  1. Reference Solution Clustering: The model groups a set of known correct reference solutions based on their underlying mathematical strategies.
  2. Solution Matching: The student's submitted solution is analyzed and matched to the closest reference solution cluster to ensure it is evaluated against the correct strategic path.
  3. Solution Analysis: The matched reference solution is deconstructed into its core "aha moments" (main strategic steps) and actionable substeps.
  4. Rubric Design: The model automatically generates a customized 7-point rubric. The authors experiment with different design choices here:
  5. Approachability-based: Weights points inversely to how obvious or difficult a step is to discover.
  6. Milestone-based: Focuses on solution-agnostic logical milestones (e.g., proving a specific bound).
  7. Hybrid: Combines both difficulty weighting and milestone tracking.
  8. Grading: The model systematically checks the student's work for direct errors or contradictions against the reference, maps the valid steps to the induced rubric, and outputs a final score alongside structured feedback.

Datasets

The framework was evaluated using two primary datasets:

  • IMO Shortlist Data: A newly curated corpus of 90 challenging problems from the IMO Shortlists (2017–2023). The solutions were generated by Gemini 2.5 Pro and meticulously annotated by human experts on a 1–4 scale, complete with precise fallacy tags (e.g., Circular Reasoning, Inventing Wrong Facts).
  • MathArena Data: A dataset consisting of 385 solutions to IMO/USAMO 2025 problems generated by a diverse suite of modern LLMs (including Grok 3, DeepSeek-R1, and OpenAI o1/o4-mini), pre-graded by human experts on the standard 0–7 scale.

Key Insights and Ideas

  • The Reference is Not Enough; You Need a Rubric: Simply providing a reference solution to an LLM (a 3-step workflow) improves performance, but explicitly forcing the model to induce a structured rubric before grading yields the largest performance leap.
  • Single-Turn Graders Can't See "Zero Progress": Confusion matrices reveal that single-turn LLM graders almost never assign scores below 3. They are easily fooled by correct-sounding mathematical jargon, even when the student has made zero actual progress toward a solution.
  • Approachability vs. Milestones: Weighting rubrics by the difficulty of the "aha moment" (Approachability) and focusing purely on mathematical outcomes rather than specific algebraic steps (Milestones) both yield highly robust, human-aligned grades. However, combining them into a Hybrid model actually hurts performance, as step-specific difficulty scores clash with solution-agnostic milestones.

Key Results

RefGrader significantly outperformed single-turn LLM grading across all statistical alignment metrics, including Pearson/Spearman correlations, Mean Absolute Error (MAE), and Quadratic Weighted Kappa (QWK).

  • On the MathArena Dataset (0-7 scale): The standard single-turn grader achieved an MAE of 2.32 and a QWK of 0.36. The 5-step Milestone variant slashed the MAE to 1.26 and boosted the QWK to 0.73.
  • On the IMO Shortlist Dataset: The Approachability variant reduced MAE from 1.76 to 1.19 and increased the QWK from 0.43 to 0.72.
  • Ensembling: Averaging the predictions of the top RefGrader variants yielded a Pearson correlation of 0.80 on the IMO Shortlist, matching or exceeding any individual method.

Additionally, as shown in the normalized confusion matrices, the agentic workflows successfully restored the diagonal pattern, demonstrating a vastly superior ability to distinguish between zero-progress, partial-progress, and nearly complete proofs.

Normalized confusion matrices showing the shift from optimistic bias in single-turn grading to a well-calibrated diagonal in RefGrader workflows.

Limitations and Future Work

The primary drawback of RefGrader is its computational overhead. Running a 5-step agentic workflow requires significantly more input and output tokens than a single prompt. However, the authors note a practical mitigation: because the reference solution clustering, analysis, and rubric design steps depend solely on the problem and its reference solutions—not the student's input—they can be cached offline. Only the matching and final grading steps need to be executed online.

For future work, the authors point toward a more systematic exploration of ensembling strategies across different rubric generation methods to further close the gap with human expert judges.

Summary updated

Abstract

State-of-the-art (SOTA) LLMs have progressed from struggling on proof-based Olympiad problems to solving most of the IMO 2025 problems, with leading systems reportedly handling 5 of 6 problems. Given this progress, we assess how well these models can grade proofs: detecting errors, judging their severity, and assigning fair scores beyond binary correctness. We study proof-analysis capabilities using a corpus of 90 Gemini 2.5 Pro-generated solutions that we grade on a 1-4 scale with detailed error annotations, and on MathArena solution sets for IMO/USAMO 2025 scored on a 0-7 scale. Our analysis shows that models can reliably flag incorrect (including subtly incorrect) solutions but exhibit calibration gaps in how partial credit is assigned. To address this, we introduce agentic workflows that extract and analyze reference solutions and automatically derive problem-specific rubrics for a multi-step grading process. We instantiate and compare different design choices for the grading workflows, and evaluate their trade-offs. Across our annotated corpus and MathArena, our proposed workflows achieve higher agreement with human grades and more consistent handling of partial credit across metrics. We release all code, data, and prompts/logs to facilitate future research.
BibTeX
@misc{mahdavi2025refgrader,
  author = {Hamed Mahdavi and Pouria Mahdavinia and Samira Malek and Pegah Mohammadipour and Alireza Hashemi and Majid Daliri and Alireza Farhadi and Amir Khasahmadi and Niloofar Mireshghallah and Vasant Honavar},
  title = {{RefGrader: Automated Grading of Mathematical Competition Proofs using Agentic Workflows}},
  year = {2025},
  eprint = {2510.09021},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.09021},
}
Figure