Compositional Mathematical Encoding for Math Word Problems (2023)

Abstract: Solving math word problem (MWP) remains a challenging task, as it requires to understand both the semantic meanings of the text and the mathematical logic among quantities, i.e., for both semantics modal and quantity modal learning. Current MWP encoders work in a uni-modal setting and map the given problem description to a latent representation, then for decoding. The generalizability of these MWP encoders is thus limited because some problems are semantics-demanding and others are quantity-demanding. To address this problem, we propose a Compositional Math Word Problem Solver (C-MWP) which works in a bi-modal setting encoding in an interactive way. Extensive experiments validate the effectiveness of C-MWP and show its superiority over state-of-the-art models on public benchmarks.

## introduction the task of math word problem (mwp) solving aims to map natural language problem descriptions into executable solution equations to get the correct answer, which is a sub-area of neuro-symbolic reasoning. it requires perceptual abilities such as comprehending the question, identifying the quantities and corresponding attributes, as well as complex semantics understanding skills like performing logical inference, making comparisons and leveraging external mathematical knowledge. while mwp encoders have been sophisticatedly designed to understand the natural language problem description, the difference on understanding diverse types of problems has not been aware of. we find that mwp can generally be grouped into three categories based on the keywords in @xcite , i.e., "story problem", "algebra problem" and "knowledge problem". "story problem" often includes significant amount of background information like characters, objectives and behaviors. "algebra problems" involves math notations or is composed of elementary concepts. "knowledge problem" asks for external knowledge like geometry and number sequence, as shown in figure 1 . these types of problems can be compositionally understood at the different level attention to the semantics modal and quantity modal, where rnns and pre-trained language models usually focus on the textual information and gcn with quantitycentered graphs capture the relationship between quantities and contexts. however, the encoders in existing mwp solvers either model only the semantics modality or utilize quantity modal priors to refine the mwp encoding @xcite . although the quantity centered refinement can particularly make improvements on quantity-demanding problems, its semantics understanding is weakened (evidence can be found in contributions. (i) a novel and effective bimodal approach is proposed for the first time to enable mwp compositional understanding. (ii) a joint reasoning module is designed for our bimodal architectures to flexibly incorporate different modalities. (iii) extensive experiments and ablative studies on two large-scale mwp benchmarks -math23k @xcite and mawps @xcite show the superiority of the proposed approach over related works. text : 348 teddy bears are sold for @xmath017 each. how much did the store earn after selling all the teddy bears? quantities: @xcite ; @xcite ; @xcite ; @xcite . ## conclusion and future work the semantic meaning and quantity information are important intrinsic properties of a math word problem. aiming at dealing with uni-modal bias and achieve better generalization, we make the first attempt to propose a compositional mwp solver, c-mwp. multi-layer reasoning and specified training methods are leveraged to enhance the generalizability of the model. as the method could be applied in a broader range of neuro-symbolic learning problems, we will keep exploring the adaptiveness of this compositional encoding method.