Abstract
Solving Math Word Problems (MWP) is a complex task where traditional Sequence-to-Sequence (Seq2Seq) models often struggle due to the "brittle" nature of mathematical expressions. A single character error—like swapping a '+' for a '-'—leads to a completely incorrect answer. This paper introduces Generate & Rank, a multi-task framework that leverages a shared BART-based architecture to both generate candidate solutions and rank them based on their likelihood of correctness, achieving a significant 7% accuracy boost on standard benchmarks.
The Challenge of Mathematical Brittleness
In natural language processing, small errors often do not destroy the semantic meaning of a sentence. However, in mathematical reasoning, expressions are highly sensitive to minor perturbations. Current state-of-the-art models typically use a Seq2Seq approach, trained to maximize the likelihood of a single ground-truth equation. This approach suffers from two main drawbacks: a lack of discriminative power between "nearly correct" and correct expressions, and a sharp decline in accuracy as equations grow in length and complexity.
The Generate & Rank Framework
The authors propose a multi-task framework built on BART, a powerful pre-trained encoder-decoder model. The system consists of two primary modules that share the same underlying parameters:
- The Generator: This module takes the problem text and generates a set of candidate mathematical expressions using beam search.
- The Ranker: This module acts as a "judge," taking the problem text and a candidate expression to output a score indicating the likelihood of correctness.
Training with Tree-Based Disturbance
To train a high-quality ranker, the model requires "hard" negative examples—equations that appear plausible but are mathematically incorrect. The authors developed a Tree-based Disturbance strategy, converting correct equations into Abstract Syntax Trees (ASTs) and applying four types of mutations: expanding nodes, editing operators, deleting branches, or swapping children (e.g., changing $A - B$ to $B - A$).
By combining these perturbed trees with the generator's own errors in an online update process (refreshing the "expression bank" every training epoch), the ranker constantly learns to spot increasingly subtle errors, preventing it from simply memorizing static negative examples.
Key Results and Performance Analysis
The framework was evaluated on the Math23k (Chinese) and MAWPS (English) benchmarks. The results demonstrate a significant performance leap over previous state-of-the-art models.
As shown in the table above, the framework reached 85.4% accuracy on Math23k, a substantial jump from the previous best of 78.4%. One of the most striking findings is the model's performance on complex problems; for expressions with five or more operators, the Generate & Rank framework improved accuracy by over 17% compared to the base mBART model. Additionally, the model showed particular strength in "Circle Geometry" and "Solid Geometry" problems, which often require more rigid logical steps that the ranker is better at verifying.
Conclusion
By treating MWP as both a generation and a discrimination task, the Generate & Rank framework provides a more robust solution for mathematical reasoning. The joint training objective helps the encoder learn more robust representations of problem logic, while the ranking mechanism effectively mitigates the performance degradation typically seen in generative models as output length increases. This "Generate & Rank" philosophy could potentially be applied to other NLP tasks where precision is critical, such as text summarization or machine translation.
Summary updated