Abstract
Math Word Problem (MWP) solvers often struggle with the non-deterministic output space created by multiple mathematically equivalent expressions. This paper introduces the Structure-Unified M-Tree Coding Solver (SUMC-Solver), which unifies diverse expressions into a single M-Tree structure. By reframing the task as a sequence-to-code labeling problem, the SUMC-Solver reduces structural noise and improves performance, particularly in data-scarce scenarios. Experimental results on the Math23K dataset show a state-of-the-art accuracy of 82.5%.
Introduction
When solving a math word problem, humans often arrive at the same answer through different but equivalent mathematical expressions. For instance, the total of 2, 3, and 4 can be represented as $(2+3)+4$ or $4+(3+2)$. Standard machine learning models, particularly sequence-to-tree (seq2tree) architectures, treat these as distinct targets. Because binary trees are structurally rigid, these equivalent expressions result in different tree structures, creating a "non-deterministic output space." This ambiguity forces models to memorize many different structures for the same underlying logic, making learning inefficient and data-intensive.
Methodology
The SUMC-Solver addresses this by introducing the M-Tree, a structure that moves away from binary constraints to allow any number of branches ($M$ branches) at each node.
1. The M-Tree Structure
To unify expressions, the researchers redefined standard operations to eliminate structural diversity:
- Horizontal Unification: Addition and multiplication are treated as commutative operations that can take an arbitrary number of arguments.
- Vertical Unification: Subtraction is converted into "adding a negative" and division into "multiplying by a reciprocal." This flattens the tree; for example, $a - b + c$ becomes a single addition node with three children: $a$, $-b$, and $c$.
2. Seq2Code Framework
Instead of generating a mathematical expression token-by-token, the SUMC-Solver treats the problem as a coding task. Each number identified in the problem text is assigned a "code" representing the path from the root of the M-Tree to that specific leaf node. The model uses a sequence-to-code (seq2code) architecture (utilizing BiLSTM or Pre-trained Language Models like RoBERTa) to predict these codes for all numbers simultaneously in a non-autoregressive fashion. This anchors reasoning directly to the quantities in the text, preventing the hallucination of invalid syntax.
Experimental Results
The model was evaluated on the Math23K (23,162 Chinese problems) and MAWPS (2,373 English problems) datasets.
Key Performance Metrics
- State-of-the-Art Accuracy: On Math23K, the SUMC-Solver achieved 82.5% accuracy using a PLM encoder, significantly outperforming previous leaders like GTS-PLM (79.5%).
- Structural Compression: The M-Tree approach reduced the unique target code set size from 1,290 in a binary tree setup to just 153, while maintaining 100% test set coverage.
- Low-Resource Dominance: The model is exceptionally sample-efficient. In experiments with limited training data (2,000 to 6,000 samples), the SUMC-Solver maintained a lead of approximately 5% over competing models like SAU-Solver and Graph2Tree.
Conclusion and Future Work
By unifying the "many paths to one answer" into a single M-Tree, the SUMC-Solver effectively reduces the complexity of the MWP output space. While the current model unifies the majority of expressions, approximately 10% of cases still involve complex logic not yet captured by the current rules. Future work will focus on integrating M-Tree coding into more advanced architectures, such as graph-based encoders, to further enhance reasoning capabilities.
Summary updated