Abstract: Solving Math Word Problems (MWPs) requires mapping natural language descriptions to mathematical expressions. A significant challenge in this task is the non-deterministic nature of mathematical notation, where multiple equivalent equations can represent the same problem. This paper, presented at EMNLP 2018, introduces Equation Normalization (EN), a technique that maps equivalent equations to a unique expression tree. By training models to predict the postorder traversal of these trees, the authors significantly reduce noise in the output space. Experiments on the Math23K dataset demonstrate that EN consistently improves the performance of various neural architectures, achieving a state-of-the-art accuracy of 68.4%.
Introduction
Solving Math Word Problems (MWPs) requires a system to read a natural language description (e.g., "Dan has 5 pens...") and produce a mathematical expression to find the answer. The authors identify a major bottleneck in existing Sequence-to-Sequence (Seq2Seq) approaches: non-deterministic transduction.
In plain English, math is flexible. The problem "Dan has 5 pens and 3 pencils; Jessica has 4 more pens and 2 fewer pencils" can be solved by $x = 5 + 4 + 3 - 2$ or $x = 4 + (5 - 2) + 3$. To a computer being trained via Maximum Likelihood Estimation (MLE), these look like completely different target strings. This "duplication problem" creates noise in the output space, making it much harder for a model to converge on a correct strategy.
Methodology: Equation Normalization
The authors propose a two-stage framework to eliminate this ambiguity and ensure every problem has exactly one "correct" target string:
- Number Mapping: Numbers in the text are replaced with tokens ($n_1, n_2, \dots$) based on their order of appearance. This allows the model to learn general "templates" rather than specific calculations.
- Equation Normalization (EN): Three rules are applied to standardize the target equations:
- Rule 1 (Length): If two equations are equivalent, always pick the shorter one.
- Rule 2 (Order): Use the commutative property to ensure number tokens appear in the equation in the same order they appeared in the text.
- Rule 3 (Expression Trees): To handle brackets and associativity, equations are converted into a canonical Expression Tree. In this tree, internal nodes are operators and leaves are numbers. The model is then trained to predict the postorder traversal of this tree (e.g., $n_1 n_2 + n_3 + n_4 -$).
Experimental Setup
The researchers evaluated their approach on the Math23K dataset, which contains 23,162 labeled math word problems in Chinese. These problems generally involve linear algebra with a single unknown variable. They compared three primary architectures:
- BiLSTM: Robust and less likely to produce malformed equations.
- Convolutional Seq2Seq (ConvS2S): Excellent at capturing local context to identify relationships between numbers and objects.
- Transformer: Capable of complex inference but occasionally generates mathematically "illegal" templates due to a lack of structural bias.
Finally, an Ensemble Model was implemented to select the output with the highest generation probability across all three architectures.
Key Results and Analysis
The results show that Equation Normalization (EN) is a "rising tide that lifts all boats," providing a massive performance boost without changing the underlying neural architectures.
As shown in the table above, the BiLSTM model's accuracy jumped from 59.6% to 66.7% with EN. By combining the models into an ensemble, the authors achieved a state-of-the-art 68.4% accuracy.
An ablation study confirmed that "Rule 2" (ordering numbers by their appearance in text) was particularly effective for the BiLSTM model, likely because it aligns the mathematical logic with the sequential nature of the input text. Conversely, the Transformer underperformed compared to the BiLSTM, possibly because the Math23K dataset is still too small to fully train the multi-head self-attention mechanisms required to outperform simpler models.
Conclusion
The core insight of this work is that math should be treated as a structured tree rather than a flat string of characters. By forcing the model to target a unique structural representation, the "alias" problem—where models are penalized for mathematically correct but syntactically different answers—is effectively removed. While currently limited to single-variable problems, this approach provides a strong foundation for future work in multi-variable and geometric reasoning.
Summary updated