Abstract
Traditional math word problem (MWP) solvers often treat numerical values as abstract symbols, replacing them with generic placeholders during preprocessing. This approach discards critical semantic information inherent in the numbers themselves, such as magnitude and category (e.g., percentage vs. integer). This paper introduces NumS2T, a model designed to explicitly encode numerical values and their properties. By incorporating a Numerical Properties Prediction Mechanism (NPPM), NumS2T achieves state-of-the-art accuracy on major benchmarks, demonstrating that numerical values are vital semantic features in mathematical reasoning.
Introduction
Solving math word problems requires more than just linguistic understanding; it requires an appreciation of the relationships between quantities. When humans solve these problems, the specific values provide essential cues. For instance, a "percentage" suggests a rate, while the relative magnitude of two prices dictates the order of subtraction.
However, most deep learning models for MWPs employ a "number mapping" preprocessing step. They replace every number in the text with a symbol based on its order of appearance. To such a model, the sentence "A shirt costs $15 and a hat costs $10" becomes "A shirt costs $v_1$ and a hat costs $v_2$." The authors argue that this abstraction loses vital information regarding magnitude, category, and relevance.
The Challenge of Numerical Abstraction
The standard practice of replacing numbers with placeholders strips away three vital pieces of information:
- Magnitude: Knowing whether $v_1 > v_2$ is crucial for non-commutative operations like subtraction and division.
- Category: The format of a number (integer, decimal, fraction, or percentage) often dictates the mathematical "template" required to solve the problem.
- Relevance: Distinguishing between functional numbers and descriptive "distractors" (e.g., "3 bags of rice weighing 60kg") is difficult without considering value-based context.
As shown in the figure above, the same problem structure with different numerical values requires distinct equation logic. A model that only sees $v_1 \dots v_5$ struggles to generalize across these variations because it lacks the semantic priors provided by the actual digits.
The NumS2T Model
To address these limitations, the authors propose NumS2T, a Sequence-to-Tree (S2T) model enhanced by a Numerical Properties Prediction Mechanism (NPPM).
1. Number-Aware Representations
Instead of just using placeholders, NumS2T uses a digit-to-digit number encoder. It processes the actual digits of a number (e.g., '1', '5', '.', '0') through a BiLSTM to create a unique vector for that value. It then uses a self-attention mechanism to let the model "compare" all numbers in the problem against each other.
2. Numerical Properties Prediction Mechanism (NPPM)
This is the core innovation. During training, the model is forced to solve three auxiliary tasks:
- Pairwise Comparison: The model predicts which of two numbers is larger. This helps it learn the "gap" or "difference" logic.
- Category Prediction: The model classifies each number into one of four categories: integer, decimal, fraction, or percentage.
- Global Relationship: The model predicts a scalar value for each number representing how likely it is to appear in the final solution. This acts as a filter for irrelevant data.
Experimental Evaluation
The model was evaluated on two large-scale benchmarks: Math23K (23,082 Chinese math word problems) and Ape210K (210,000 problems). NumS2T established new state-of-the-art (SOTA) results on both:
- Math23K: Achieved 78.1% accuracy (a significant jump from the previous best of 76.3%).
- Ape210K: Achieved 70.5% accuracy (improving on the previous SOTA of 68.7%).
Ablation studies confirmed that the NPPM was the primary driver of these gains. Specifically, adding magnitude comparison and category prediction consistently pushed accuracy higher than the base model.
Conclusion
NumS2T demonstrates that in the context of math word problems, numerical values are not merely data points but rich semantic features. By explicitly modeling magnitude, category, and relevance, MWP solvers can overcome the limitations of abstract placeholders and achieve more robust reasoning. Future work may involve expanding numerical categories to include physical units and improving the model's ability to handle complex, multi-step logic common in higher-level mathematics.
Summary updated