Sequence to General Tree: Knowledge-Guided Geometry Word Problem Solving (2021)

Abstract: With the recent advancements in deep learning, neural solvers have gained promising results in solving math word problems. However, these SOTA solvers only generate binary expression trees that contain basic arithmetic operators and do not explicitly use the math formulas. As a result, the expression trees they produce are lengthy and uninterpretable because they need to use multiple operators and constants to represent one single formula. In this paper, we propose sequence-to-general tree (S2G) that learns to generate interpretable and executable operation trees where the nodes can be formulas with an arbitrary number of arguments. With nodes now allowed to be formulas, S2G can learn to incorporate mathematical domain knowledge into problem-solving, making the results more interpretable. Experiments show that S2G can achieve a better performance against strong baselines on problems that require domain knowledge.

## introduction math word problem (mwp) solving is a special subfield of question answering. it requires machine solvers to read the problem text, understand it, and then compose the numbers and operators into a meaningful equation (as shown in as with any qa task, solving an mwp requires the introduction of external knowledge or domain knowledge @xcite . however, current state-of-the-art solvers @xcite @xcite do not address this 1 data and code are available at the github repository: https://github.com/doublebite/sequence-to-general-tree/ problem: the outer radius and the inner radius of a circular annulus are 5m and 3m repsectively. find the area of this circular annulus. with formula: @xmath0: example problem that requires geometry knowledge. figure 1 : (a). binary expression tree and (b). operation tree along with formulas for the problem in to address this issue, we propose a sequenceto-general tree (s2g) architecture where the nodes can be arbitrary math concepts or formulas with arbitrary number of arguments. in this way, our s2g model can learn to map the problem text into executable operation trees that contain different formulas across different domains. for example, s2g can learn to generate tree nodes that contain the required geometry formula for circles, as shown in figure 1 (b), making the result more intuitive and explainable. in addition, we propose a knowledge-guided mechanism to guide tree-decoding using a mathematical knowledge graph (kg). to evaluate our model, we also construct a middle-sized dataset consisting of 1,398 geometry word problems which require a diversified set of formulas. experimental results show that our s2g model can provide better performance and more interpretable results against strong baselines on problems that require domain knowledge. the main contributions of this paper are: ## seq2seq v.s. seq2tree v.s. seq2general our goal is to design a sequence-to-general tree model that learns to map the problem text into its corresponding operation tree. before diving into the model, we first compare the decoding mechanisms between seq-to-seq, seq-to-tree and our seqto-general tree solvers. figure 2 illustrates the tree decoding process of these three types of model, respectively. for seq2seq models, their decoder basically does two things: (1) predicting the current output and (2) generating the next state. these two steps can be conditioned on different information including the current state, the current input, or a context vector calculated using attention. the decoder would repeat these two steps until it outputs an end token. for seq2tree models, however, this process is slightly different. the decoder predicts the current output as in seq2seq, but it will decide whether to generate the next state based on the current output. if the current output is a arithmetic operator, the decoder knows it should produce two child states, and these states are used to expand into its left and right children. if the current output is a number, then the decoder would end the decoding process, so the current node becomes a leaf node. as a result, the whole decoding process resembles generating an expression tree in a top-down manner. in our work, we generalize the decoding process by making the decoder produce a variable number of children based on the type of the current output. if the output is a number or operator, the decoder would produce zero or two child states as before. if the output is a formula, the decoder will generate the pre-specified number of child states for this formula. ## sequence-to-general tree model in this section, we give a detailed description for each part of our s2g model. ## conclusion in this work, we proposed a sequence-to-general tree model (s2g) that aims to generalize previous seq2tree architectures. our s2g can learn to generate executable operation trees where the nodes can be formulas with arbitrary number of arguments. by explicitly generating formulas as nodes, we make the predicted results more interpretable. besides, we also proposed a knowledge-guided mechanism to guide the tree decoding using kgs and constructed a dataset in which problems are annotated with associated formulas. experimental results showed that our s2g model can achieve better performance against strong baselines.