[Paper Review] Solving Math Word Problems with Double-Decoder Transformer
This paper proposes a Double-Decoder Transformer model for math word problem solving that generates equations without copy or align mechanisms, using two decoders—one left-to-right and one right-to-left—jointly trained with a shared encoder. The model achieves 21.7% accuracy (MLE) and 22.1% (RL), outperforming RNNs and single-decoder Transformers, demonstrating that bidirectional decoding improves training and generalization even without ensemble inference.
This paper proposes a Transformer-based model to generate equations for math word problems. It achieves much better results than RNN models when copy and align mechanisms are not used, and can outperform complex copy and align RNN models. We also show that training a Transformer jointly in a generation task with two decoders, left-to-right and right-to-left, is beneficial. Such a Transformer performs better than the one with just one decoder not only because of the ensemble effect, but also because it improves the encoder training procedure. We also experiment with adding reinforcement learning to our model, showing improved performance compared to MLE training.
Motivation & Objective
- To develop a neural sequence-to-sequence model that generates accurate mathematical equations from word problems without relying on copy or align mechanisms.
- To investigate whether training a Transformer with two decoders operating in opposite directions improves performance over a single decoder.
- To evaluate the impact of joint training with bidirectional decoders on encoder representation learning and overall equation generation quality.
- To assess whether reinforcement learning can further improve performance beyond maximum likelihood estimation (MLE) in this task.
- To compare the proposed model’s performance against state-of-the-art retrieval-based and hybrid RNN models on the Dolphin18K dataset.
Proposed method
- Employs a Transformer-based sequence-to-sequence architecture with two decoders: one generating equations left-to-right and the other right-to-left, both sharing the same encoder.
- Uses three types of number tokens—negative numbers, floats in (0,1), and others—to represent numerical values in both input and output sequences, avoiding direct token copying.
- Trains the model using maximum likelihood estimation (MLE) with cross-entropy loss, where the encoder is optimized based on the combined loss from both decoders.
- Applies reinforcement learning (REINFORCE) after MLE training, using equation correctness (via SymPy) as the reward signal to fine-tune the model.
- Implements beam search with beam size 10 for inference and beam size 6 during RL sampling, with rewards computed as the mean accuracy over N sampled outputs.
- Uses GloVe 840B 300d word embeddings for input text, with a 512-dimensional feed-forward layer after embedding to match Transformer dimensions.
Experimental results
Research questions
- RQ1Does a Transformer model with two decoders (left-to-right and right-to-left) improve equation generation performance compared to a single-decoder Transformer without copy or align mechanisms?
- RQ2Can joint training with bidirectional decoders enhance encoder representation learning, even when only one decoder's output is used at inference time?
- RQ3To what extent does reinforcement learning improve the performance of a Transformer-based equation generator beyond MLE training?
- RQ4How does the proposed model compare in accuracy to state-of-the-art retrieval-based and hybrid RNN models on the Dolphin18K dataset?
- RQ5Does the absence of copy and align mechanisms hinder performance, or can the model generalize well enough to outperform more complex RNN-based models with such mechanisms?
Key findings
- The Double-Decoder Transformer achieves 21.7% accuracy using MLE training, significantly outperforming a single-decoder Transformer (19.4%) and all RNN-based models without copy/align mechanisms.
- Even when only one decoder's output is used (without ensemble voting), the two-decoder model achieves 20.6% accuracy (L-to-R) and 20.2% (R-to-L), indicating improved encoder training from bidirectional supervision.
- Reinforcement learning boosts performance to 22.1% accuracy, showing that RL fine-tuning further improves generalization beyond MLE.
- Despite not using copy or align mechanisms, the model outperforms RNNs with such modules, including the best-performing RNN model (23.3% with RL and copy/align).
- The model does not surpass the best retrieval-based systems (e.g., 33.2% with hybrid GRU+copy+align+RL), which is attributed to low-quality ground-truth equations in the dataset.
- The results suggest that better-structured equation annotations could significantly improve performance of generative models, as current equations often lack derivation clarity or contain untraceable values.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.