NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Semantically-Aligned Universal Tree-Structured Solver for Math Word Problems

Jinghui Qin, Lihui Lin, Xiaodan Liang, Rumin Zhang, Liang Lin

Introduction

Solving Math Word Problems (MWPs) has long been a benchmark for artificial intelligence, requiring a sophisticated blend of natural language understanding and symbolic reasoning. While specialized solvers have shown promise in simple, single-unknown linear problems, they often struggle with more complex "generalist" tasks involving multiple unknowns or non-linear logic. This paper introduces the SAU-Solver, a novel deep learning architecture designed to bridge these gaps through a unified representation and semantic grounding.

The Challenge of Generalist Math Word Problems

Existing MWP solvers face three primary obstacles:

  1. Representation Gap: There is no standardized method to represent diverse problem types—such as simple arithmetic versus complex equation sets—within a single neural framework.
  2. Hallucination: Decoders often generate "fake numbers" or misplace values because the mathematical symbols are not strictly anchored to the problem's textual context.
  3. Lack of Global Logic: Models frequently fail to capture the overarching semantic relationship between the generated equations and the original narrative.

Methodology: The SAU-Solver

To address these issues, the authors propose two core innovations: the Universal Expression Tree (UET) and a semantically-aligned decoding process.

Universal Expression Tree (UET)

The UET provides a unified structure for representing both single equations and equation sets. By introducing a "separator" operator (denoted as ;), the model can treat multiple equations as branches of a single, comprehensive tree. This allows a standard tree-structured decoder to process complex systems of equations with the same logic used for basic arithmetic.

Comparison between standard Expression Trees and the proposed Universal Expression Trees (UET).

Architecture and Semantic Alignment

The SAU-Solver utilizes an encoder-decoder framework:

  • Encoder: A Bidirectional Gated Recurrent Unit (Bi-GRU) generates contextual representations of the problem text.
  • Tree-Structured Decoder: Instead of a flat sequence, the decoder generates a tree. It employs a "problem-specific vocabulary" to ensure that numbers are sourced directly from the text, preventing the generation of irrelevant constants.
  • Subtree-level Semantically Aligned Regularization (SSAR): This mechanism serves as the "secret sauce" of the architecture. As the model constructs mathematical subtrees, it enforces an alignment between the subtree's mathematical meaning and the corresponding segments of the source text. This ensures that the generated math is logically grounded in the problem's story.

Experimental Evaluation

The model was rigorously tested on four benchmarks, including a newly introduced dataset:

  • Math23K: A standard dataset for one-unknown linear problems.
  • Alg514 & Dolphin18K-Manual: Datasets featuring higher complexity.
  • HMWP (Hybrid Math Word Problems): A new dataset containing 5,491 problems across three categories: one-unknown linear, two-unknown linear (equation sets), and one-unknown non-linear. HMWP is notably more challenging, featuring longer equations and a wider variety of operators.

Key Results

The SAU-Solver established a new state-of-the-art (SOTA) across all evaluated datasets:

  • HMWP Performance: The model achieved 44.83% accuracy, a significant improvement over the previous best, StackDecoder (27.4%).
  • Math23K Performance: It reached 74.84% accuracy, surpassing the GTS model.
  • Ablation Studies: Removing the SSAR component led to a measurable drop in accuracy (e.g., 1.95% on Alg514), confirming the importance of semantic alignment.
  • Robustness: Qualitative analysis showed that the SAU-Solver consistently produces mathematically valid trees, whereas traditional Seq2Seq models often hallucinate numbers or generate syntactically incorrect expressions.

Conclusion and Future Work

The SAU-Solver represents a significant step toward a universal solver for math word problems. By unifying problem representation through UETs and grounding mathematical logic via SSAR, the model demonstrates superior performance on complex, multi-equation tasks. However, challenges remain; accuracy declines as expression tree size increases, particularly for trees with more than 13 nodes. Future research will likely focus on enhancing commonsense reasoning and handling even more diverse mathematical operations.

Summary updated

BibTeX
@inproceedings{qin2020semantically,
  author = {Jinghui Qin and Lihui Lin and Xiaodan Liang and Rumin Zhang and Liang Lin},
  title = {{Semantically-Aligned Universal Tree-Structured Solver for Math Word Problems}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.309},
}
Figure