Let GPT be a Math Tutor: Teaching Math Word Problem Solvers with Customized Exercise Generation

Zhenwen Liang, Wenhao Yu, Tanmay Rajpurohit, Peter Clark, Xiangliang Zhang, Ashwin Kalyan

Introduction

Large Language Models (LLMs) like GPT-4 have demonstrated remarkable proficiency in solving Math Word Problems (MWPs). However, their massive scale makes them computationally expensive and difficult to deploy in real-time or resource-constrained environments. Conversely, smaller "student" models are efficient but often lack the reasoning depth required to handle complex mathematical logic.

Previous attempts to bridge this gap through knowledge distillation typically utilized Chain-of-Thought (CoT) prompting, where a large model provides step-by-step explanations for a small model to mimic. This approach faces two primary hurdles: a comprehension gap, where small models struggle to digest complex reasoning, and a lack of feedback, as traditional distillation is a one-way transfer that ignores the student's specific conceptual weaknesses. To address these issues, researchers have developed CEMAL (Customized Exercise for MAth Learning), a framework that uses an LLM as a personalized tutor to generate targeted practice problems.

The CEMAL Framework

CEMAL mimics the iterative process of human tutoring by focusing on the student's unique failures rather than providing a generic dataset. The framework operates in two main phases:

  1. Knowledge Tracing: The system creates an "exercise book" (a validation set) generated by the LLM. The student model attempts these problems, allowing the system to identify exactly which mathematical concepts or linguistic patterns the student fails to grasp.
  2. Targeted Exercise Generation: For every problem the student misses, the LLM (GPT-3.5-turbo) generates customized "analogies." These include Problem Analogies (similar contexts but different mathematical solutions) and Solution Analogies (different contexts but the same underlying mathematical structure).
The CEMAL framework illustrates the iterative tutoring process between the LLM Teacher and the Student Model.

The student model, typically a RoBERTa encoder paired with a Goal-driven Tree-structured (GTS) decoder, is then fine-tuned on this personalized curriculum. This architecture represents mathematical expressions as trees, which helps the model better capture the hierarchical logic of operations.

Experimental Setup and Datasets

The researchers evaluated CEMAL across three standard MWP benchmarks:

  • MAWPS: A collection of 2,373 arithmetic problems.
  • ASDiv-a: A subset of the Academic Society Dataset focusing on diverse language patterns.
  • SVAMP: A challenging dataset designed to test robustness. It was used for both In-Distribution (ID) and Out-of-Distribution (OOD) testing to evaluate how well models generalize to unfamiliar problem formats.

Key Insights: Active Learning and Analogies

A central finding of the study is that what a model learns is as critical as how it learns. By employing active learning—focusing data augmentation specifically on the student's failures—CEMAL achieves significantly higher efficiency than random data augmentation.

Furthermore, the use of analogies helps the model decouple the "story" of a word problem from its mathematical "logic." This prevents the model from relying on shallow heuristics, such as assuming the word "total" always implies addition, and instead encourages a deeper understanding of the underlying principles. This approach proved particularly effective for Out-of-Distribution tasks, which are traditionally a major weakness for smaller models.

Results and Performance

The results demonstrate that CEMAL allows small models to "punch up" significantly against much larger baselines.

  • State-of-the-Art Accuracy: The CEMAL-trained 377M parameter model achieved 94.7% on MAWPS and 93.3% on ASDiv-a, outperforming previous fine-tuned baselines.
  • Efficiency vs. Power: On the difficult SVAMP (OOD) test, the CEMAL model reached 76.4% accuracy. Remarkably, this 377M parameter model nearly matched the performance of GPT-3 with few-shot CoT (175B+ parameters), which scores approximately 79.0%.
Comparison of accuracy and parameter counts shows CEMAL (Our Method) achieving LLM-level performance with 1/500th the parameters.

Limitations and Future Work

While CEMAL is highly effective, it remains sensitive to prompt design; generating high-quality exercises requires meticulous instruction for the LLM. Additionally, approximately 30% of LLM-generated problems are currently discarded due to formatting errors or invalid logic, suggesting that improving the "teacher's" reliability is a necessary next step. Future research will explore whether this tutor-student framework can be extended to other reasoning-heavy domains, such as legal analysis or code generation.

Summary updated

BibTeX
@inproceedings{liang2023let,
  author = {Zhenwen Liang and Wenhao Yu and Tanmay Rajpurohit and Peter Clark and Xiangliang Zhang and Ashwin Kalyan},
  title = {{Let GPT be a Math Tutor: Teaching Math Word Problem Solvers with Customized Exercise Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.889},
}
Figure