Semantically-Aligned Universal Tree-Structured Solver for Math Word Problems (2020)

Abstract: A practical automatic textual math word problems (MWPs) solver should be able to solve various textual MWPs while most existing works only focused on one-unknown linear MWPs. Herein, we propose a simple but efficient method called Universal Expression Tree (UET) to make the first attempt to represent the equations of various MWPs uniformly. Then a semantically-aligned universal tree-structured solver (SAU-Solver) based on an encoder-decoder framework is proposed to resolve multiple types of MWPs in a unified model, benefiting from our UET representation. Our SAU-Solver generates a universal expression tree explicitly by deciding which symbol to generate according to the generated symbols’ semantic meanings like human solving MWPs. Besides, our SAU-Solver also includes a novel subtree-level semanticallyaligned regularization to further enforce the semantic constraints and rationality of the generated expression tree by aligning with the contextual information. Finally, to validate the universality of our solver and extend the research boundary of MWPs, we introduce a new challenging Hybrid Math Word Problems dataset (HMWP), consisting of three types of MWPs. Experimental results on several MWPs datasets show that our model can solve universal types of MWPs and outperforms several state-of-the-art models.

## introduction math word problems (mwps) solving aims to automatically answer a math word problem by understanding the textual description of the problem and reasoning out the underlying answer. a typical mwp is a short story that describes a partial state of the world and poses a question about an in our uet representation, multiple expression trees underlying a mwp will be integrated as an universal expression tree (uet) via symbol extension. uet can enable a solver to handle multiple types of mwps in an unified manner like a single expression tree of an equation. to address the above issues, we propose a simple yet efficient method called universal expression tree (uet) to make the first attempt to represent the equations of various mwps uniformly like the expression tree of one-unknown linear word problems with considering unknowns. specifically, as shown in fig. 1 , uet integrates all expression trees underlying in an mwp into an ensemble expression tree via math operator symbol extension so that the grounded equations of various mwps can be handled in a unified manner as handling one-unknown linear mwps. thus, it can significantly reduce the difficulty of modeling equations of various mwps. then, we propose a semantically-aligned universal tree-structured solver (sau-solver), which is based on our uet representation and an encoder-decoder framework, to solve multiple types of mwps in a unified manner with a single model. in our sau-solver, the encoder is designed to understand the semantics of mwps and extract number semantic representation while the tree-structured decoder is designed to generate the next symbol based on the problem-specific target vocabulary in a semantically-aligned manner by taking full advantage of the semantic meanings of the gener-ated expression tree like a human uses problem's contextual information and all tokens written to reason next token for solving mwps. the problemspecific target vocabulary can help our solver to mitigate the problem of fake numbers generation as much as possible. besides, to further enforce the semantic constraints and rationality of the generated expression tree, we also propose a subtree-level semanticallyaligned regularization to further improve subtreelevel semantic representation by aligning with the contextual information of a problem, which can improve answer accuracy effectively. finally, to validate the universality of our solver and push the research boundary of mwps to math real-word applications better, we introduce a new challenging hybrid math word problems dataset (hmwp), consisting of one-unknown linear word problems, one-unknown non-linear word problems, and equation set problems with two unknowns. experimental results on hwmp, alg514, math23k, and dolphin18k-manual show the universality and superiority of our approach compared with several state-of-the-art methods. ## related works numerous methods have been proposed to attack the mwps task, ranging from rule-based methods @xcite , statistical machine learning methods @xcite @xcite @xcite ,semantic parsing methods @xcite @xcite , and deep learning methods @xcite @xcite @xcite @xcite . due to space limitations, we only review some recent advances on deep leaning-based methods. @xcite made the first attempt to generate expression templates using seq2seq model. seq2seq method has achieved promising results, but it suffers from generating spurious numbers, predicting numbers at wrong positions, or equation duplication problem @xcite . to address them, @xcite proposed to add a copy-and-alignment mechanism to the standard seq2seq model. @xcite proposed equation normalization to normalize the duplicated equations by considering the uniqueness of an expression tree. different from seq2seq-based works, @xcite proposed a tree-structured decoder to generate an expression tree inspired by the goaldriven problem-solving mechanism. @xcite proposed a two-stage template-based solution based on a recursive neural network for math expression construction. however, they do not model the unknowns underlying in mwps, resulting in only handling one-unknown linear word problems. besides, they also lack an efficient mechanism to handle those mwps with multiple unknowns and multiple equations, such as equation set problems. therefore, their solution can not solve other types of mwps that are more challenging due to larger search space, such as equation set problems, non-linear equation problems, etc. (chiang and chen, 2019) is a general equation generator that generates expression via the stack, but they did not consider the semantic transformation between equations in a problem, resulting in poor performance on the multiple-unknown mwps, such as equation set problems. ## hybrid math word problem dataset most public datasets for automatic mwps solving either are quite small such as alg514 (kushman et al., 2014), draw-1k (upadhyay and chang, 2017), mawps @xcite or exist some incorrect labels such as dol-phin18k @xcite ). an exception is the math23k dataset which contains 23161 problems labeled well with structured equations and answers. however, it only contains one-unknown linear mwps, which is not sufficient to validate the ability of a math solver about solving multiple types of mwps. therefore, we introduce a new high-quality mwps dataset, called hmwp, in which each sample is extracted from a chinese k12 math word problem bank, to validate the universality of math word problem solvers and push the research boundary of mwps to match real-world scenes better. our dataset contains three types of mwps: arithmetic word problems, equations set problems, and non-linear equation problems. there are 5491 mwps, including 2955 one-unknownvariable linear mwps, 1636 two-unknown-variable linear mwps, and 900 one-unknown-variable nonlinear mwps. it should be noticed that our dataset is sufficient for validating the universality of math word problem solvers since these problems can cover most cases about mwps. we labeled our data with structured equations and answers as math23k @xcite . the data statistics of our dataset and several publicly available datasets are shown in ## conclusion we propose an sau-solver, which is able to solve multiple types of mwps, to generate the universal express tree explicitly in a semantically-aligned manner. besides, we also propose a subtree-level semantically-aligned regularization to improve subtree semantic representation. finally, we introduce a new mwps datasets, called hmwp, to validate our solver's universality and push the research boundary of mwps to math real-world applications better. experimental results show the superiority of our approach.