Abstract
Solving Math Word Problems (MWPs) requires more than just numerical calculation; it necessitates a deep understanding of the underlying mathematical logic. Traditional deep learning models often function as "black boxes," achieving high accuracy through shallow heuristics rather than genuine reasoning. This paper introduces LogicSolver, a framework that enhances interpretability by requiring models to predict both the solution and the corresponding algebraic logic (e.g., area = length * width). Supported by the new InterMWP dataset, LogicSolver utilizes a prompt-enhanced learning approach to ground problem-solving in real-world mathematical concepts, significantly improving both answer accuracy and transparency.
Introduction: The Interpretability Gap in MWP
The core challenge in automated math problem solving is translating natural language into structured mathematical logic. While current state-of-the-art models can often produce the correct final equation, they lack the ability to explain why specific operations were chosen. For instance, if a model outputs 180 * 0.5 * 1.2, it remains unclear whether it understands it is calculating the cost of a parallelogram plaque or simply multiplying available constants.
Existing datasets have historically lacked the "linguistic logic" annotations necessary to train models for explanation. Without these anchors, models are prone to relying on statistical patterns that may fail when faced with novel or slightly altered problem structures.
The LogicSolver Framework
To address these issues, the researchers developed LogicSolver, a tripartite framework designed to solve and explain simultaneously.
1. Logic Formula Retriever
The process begins with a BERT-based retriever that scans a "Logic Set" containing 210 predefined algebraic formulas across domains like Finance, Geometry, and Physics. It identifies the top-$K$ most relevant formulas to serve as logical prompts for the model.
2. Logical Prompt-enhanced Encoder
These retrieved formulas are concatenated with the problem text. This provides the encoder with a conceptual "cheat sheet," grounding the linguistic input in established mathematical relationships before the decoding process begins.
3. Logic Generator and Tree Decoder
As the tree-structured decoder constructs the solution equation, a specialized Logic Generator predicts which linguistic logic formula applies to each operator node. This transforms the task into a dual-objective of generating the correct equation and the correct logical explanation.
The InterMWP Dataset
A significant contribution of this work is the InterMWP benchmark. It consists of 11,495 problems where every solution step is explicitly mapped to one of 210 unique logic formulas. This dataset allows for the evaluation of Logic Accuracy—a metric that only considers a solution correct if both the numerical equation and the predicted logic are accurate. InterMWP also addresses "variable disambiguation," helping models distinguish between identical constants that serve different roles (e.g., distinguishing between "2 meters" and "2 circles").
Key Results and Performance
LogicSolver demonstrated superior performance over standard baselines like GTS and Graph2Tree:
- Accuracy Improvements: On the InterMWP dataset, LogicSolver reached an 82.4% answer accuracy, outperforming standard BERT-enhanced tree models (80.3%).
- High Interpretability: The model achieved a 76.0% logic accuracy, indicating it can successfully explain its reasoning for the vast majority of solved problems.
- Cross-Dataset Generalization: When tested on the standard Math23K benchmark, the logical prompts derived from InterMWP still provided a performance boost (from 82.8% to 83.4%), proving the portability of the learned logic.
Conclusion and Future Directions
LogicSolver represents a move away from opaque "black-box" solvers toward systems that can "show their work." While highly effective, the framework currently faces limitations regarding the breadth of its 210-formula Logic Set and the complexity of very large equation trees. Future research will focus on expanding the formula library and developing more robust symbolic generation mechanisms to handle increasingly complex mathematical scenarios.
Summary updated