Self-consistent Reasoning For Solving Math Word Problems

Jing Xiong, Zhongwei Wan, Xiping Hu, Min Yang, Chengming Li

This paper presents a novel approach to one of the trickiest hurdles in Natural Language Processing: solving Math Word Problems (MWPs) without falling into the trap of "spurious correlations."

TL;DR

The authors introduce SCR (Self-Consistent Reasoning), a framework that uses network pruning and mutual learning to force models to learn the underlying logic of math problems rather than relying on shallow text shortcuts. By training a full "source" network and a pruned "sub-network" to be consistent with each other, the model achieves state-of-the-art accuracy on major benchmarks like Math23k and Ape210k.

What Problem Does This Paper Address?

Current models for solving Math Word Problems often suffer from a lack of true logical reasoning. Instead of understanding the math, they often learn spurious correlations—shortcuts where specific keywords (like "bank," "account," or "money") trigger a specific mathematical formula regardless of the actual problem logic.

For example, if a training set contains many problems about bank accounts that use the formula $a \div b \times c$, a model might incorrectly apply that same formula to a new bank problem that actually requires $a \div (b + c)$. The challenge is to move the model away from these "shallow hints" and toward a robust understanding of mathematical logic.

Methods

The authors propose the SCR framework, which is built on a standard encoder-decoder backbone (specifically, a RoBERTa encoder and a tree-based decoder). The core innovation lies in how the model is trained:

  1. Dual-Network Architecture: The framework consists of a Source Network (the full model) and a Sub-network (created by pruning the source network).
  2. Pruning as a Filter: Research suggests that pruning helps models "forget" hard-to-memorize or long-tailed samples, which are often the ones where the model relies on spurious shortcuts. By comparing the output distributions of the full and pruned networks, the framework can identify and correct these problematic samples.
  3. Mutual Learning via KL Divergence: The two networks are trained collaboratively. They use a symmetric Kullback-Leibler (KL) divergence loss to encourage prediction consistency. Essentially, each network "teaches" the other, forcing both to converge on a distribution that represents the true logic of the problem rather than noise.
  4. Learnable Quantity Embeddings: To better handle numbers within the text, the authors replace specific quantities with learnable tokens ($t_i$), similar to position embeddings in BERT, helping the model maintain the correct relationship between different numerical values.
Fig. 1. Overview of the proposed framework SCR

Datasets

The model was evaluated on two large-scale, standard benchmarks for MWPs:

  • Math23k: A dataset containing 22,162 problems for training and 1,000 for testing.
  • Ape210k: A significantly larger and more complex dataset with over 160,000 training questions, designed to be "template-rich" and challenging.

Key Insights and Ideas

  • Pruning Exposes Weakness: The most interesting insight is that pruning isn't just for efficiency; it’s a diagnostic tool. The gap in output distribution between a full model and its pruned version highlights where the model is relying on fragile shortcuts.
  • Logical Equivalence: The SCR framework encourages the model to generate mathematically equivalent expressions (e.g., $50 \times 25 \div 20$ vs. $25 \div 20 \times 50$). This demonstrates that the model is capturing the logic of the text rather than just memorizing a specific formula string.
  • The "Lottery Hypothesis" in MWPs: The results showed that the sub-network often outperformed the source network (e.g., 86.8% vs 85.5% on Math23k). This supports the idea that within a large network, there exists a smaller "winning" sub-network that generalizes better.

Key Results

The SCR framework achieved significant performance gains over strong baselines like GTS, GenerateRank, and DeductReasoner.

  • Accuracy: On the Math23k public test set, the SCR sub-network reached 86.8% accuracy, outperforming the previous best baseline (GenerateRank) by 1.4%.
  • Generalization: On the much larger Ape210k dataset, SCR achieved 76.7% accuracy, a substantial jump over the 70.5% achieved by NumS2T.
Solution accuracy of SCR and various baselines

Ablation studies (shown in the table below) confirmed that both the pruning strategy and the mutual learning (MT) components were essential to these gains.

Table 4. Ablation study on Math23k.

Limitations and Future Work

While SCR effectively handles equivalent expressions, the authors note that the model could still be improved in distinguishing between expressions that are "similar but not equivalent."

Future work will focus on introducing negative samples during training. By showing the model examples of formulas that look similar but are mathematically incorrect for a given context, the researchers hope to further sharpen the model's logical boundaries and reasoning capabilities.

Summary updated

BibTeX
@misc{xiong2022self,
  author = {Jing Xiong and Zhongwei Wan and Xiping Hu and Min Yang and Chengming Li},
  title = {{Self-consistent Reasoning For Solving Math Word Problems}},
  year = {2022},
  eprint = {2210.15373},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.15373},
}
Figure