Abstract
Math Word Problems (MWPs) require bridging the semantic gap between natural language and mathematical logic. While Sequence-to-Sequence models have shown promise, they often struggle with subtle linguistic variations that change the underlying formula. This paper introduces a "Teacher Module" framework that trains models to distinguish between correct and subtly incorrect mathematical expressions. By learning from "smart" distractors, the model develops more robust latent representations, leading to state-of-the-art performance on standard benchmarks like Math23k and MAWPS.
Introduction: The Semantic Gap in Math Word Problems
Solving Math Word Problems (MWPs) is a long-standing challenge in Natural Language Processing. A model must accurately map human language (e.g., "Bob has 10 apples and gives 2 away") to its logical mathematical counterpart ($10 - 2$).
Current Sequence-to-Sequence (Seq2Seq) models, while powerful, are often brittle. Minor changes in phrasing—such as swapping "more" for "less"—can drastically alter the required formula. However, standard models frequently map these distinct problems to nearly identical locations in their internal "latent space." This lack of discriminative power leads to incorrect outputs when the model fails to grasp the subtle logic of the text.
Methodology: The Teacher Module Framework
To address this brittleness, the researchers propose a framework that incorporates a Teacher Module into the standard encoder-decoder architecture.
The system consists of three main components:
- Encoder & Decoder: A standard Bi-GRU or Graph-based encoder transforms text into a vector, while a tree-based decoder generates the mathematical formula.
- Teacher Module: This novel component acts as a binary classifier during the training phase. It evaluates pairs of problem representations and mathematical expressions, predicting whether the formula correctly matches the problem.
- Negative Answer Generation: To train the teacher effectively, the authors developed an algorithm to create "smart" wrong answers. By perturbing the correct formula—swapping operators or numbers—the model is forced to learn the fine-grained differences between right and wrong logic.
The model is trained using a joint objective: the decoder aims for accuracy, while the encoder is pressured to produce representations that the Teacher Module can easily distinguish from distractors. Importantly, the Teacher Module is discarded after training, leaving a more robust solver for inference.
Key Insights: Learning through Contrast
The primary advantage of this approach is the improved separation of problem types within the model's internal memory.
As shown in the t-SNE visualizations above, problems requiring different operations (like $(a+b)/c$ vs. $(a-b)/c$) tend to overlap significantly in standard models. The Teacher Module pushes these clusters apart, making it significantly easier for the decoder to select the correct logic. This mirrors human learning, where understanding why a common mistake is wrong is as important as knowing the correct answer.
Results and Robustness
The "Teacher" approach was evaluated on two major benchmarks:
- Math23k: The
Graph2Tree + Teachermodel achieved 79.1% accuracy, a notable improvement over the 77.4% baseline. - MAWPS: The model reached 84.2% accuracy, setting a new state-of-the-art.
Beyond raw accuracy, the model demonstrated increased robustness. In case studies, it correctly identified variations that typically confuse standard solvers, such as distinguishing between $n_1/n_0$ and $n_0/n_1$ based on the specific question asked.
Conclusion
By introducing a supervision mechanism that focuses on contrastive learning, this research significantly enhances the ability of AI to solve math word problems. While the current implementation uses random perturbations for negative samples, future work may explore dynamic sampling to further challenge the model. This pedagogical approach—teaching a model to recognize its potential mistakes—paves the way for more reliable and logically sound mathematical reasoning in AI.
Summary updated