[Paper Review] Translating Math Formula Images to LaTeX Sequences Using Deep Neural Networks with Sequence-level Training
This paper proposes a deep neural network with an encoder-decoder architecture that translates math formula images into LaTeX sequences using sequence-level training. The model employs a CNN encoder with 2D positional encoding and a bidirectional LSTM decoder with soft attention, trained via policy gradient to mitigate exposure bias and achieve state-of-the-art performance on the IM2LATEX-100K dataset.
In this paper we propose a deep neural network model with an encoder-decoder architecture that translates images of math formulas into their LaTeX markup sequences. The encoder is a convolutional neural network (CNN) that transforms images into a group of feature maps. To better capture the spatial relationships of math symbols, the feature maps are augmented with 2D positional encoding before being unfolded into a vector. The decoder is a stacked bidirectional long short-term memory (LSTM) model integrated with the soft attention mechanism, which works as a language model to translate the encoder output into a sequence of LaTeX tokens. The neural network is trained in two steps. The first step is token-level training using the Maximum-Likelihood Estimation (MLE) as the objective function. At completion of the token-level training, the sequence-level training objective function is employed to optimize the overall model based on the policy gradient algorithm from reinforcement learning. Our design also overcomes the exposure bias problem by closing the feedback loop in the decoder during sequence-level training, i.e., feeding in the predicted token instead of the ground truth token at every time step. The model is trained and evaluated on the IM2LATEX-100K dataset and shows state-of-the-art performance on both sequence-based and image-based evaluation metrics.
Motivation & Objective
- To develop a neural network model that accurately translates math formula images into LaTeX markup sequences.
- To address the exposure bias problem in sequence generation by closing the feedback loop during training.
- To improve sequence-level performance using policy gradient-based optimization instead of only maximum-likelihood estimation.
- To enhance spatial understanding of mathematical symbols through 2D positional encoding in the encoder.
- To achieve state-of-the-art results on both image-based and sequence-based evaluation metrics for formula translation.
Proposed method
- The encoder uses a convolutional neural network (CNN) to extract feature maps from input formula images.
- Feature maps are enhanced with 2D positional encoding to preserve spatial relationships between symbols.
- The encoder output is unfolded into a sequence of vectors for input to the decoder.
- The decoder is a stacked bidirectional LSTM with soft attention to generate LaTeX tokens step-by-step.
- The model is first trained via maximum-likelihood estimation (MLE) at the token level.
- Sequence-level training is then applied using a policy gradient algorithm, feeding predicted tokens instead of ground truth during decoding to reduce exposure bias.
Experimental results
Research questions
- RQ1Can a deep neural network with sequence-level training outperform standard MLE training in translating math formula images to LaTeX?
- RQ2How effective is the integration of 2D positional encoding in capturing spatial structure of mathematical symbols?
- RQ3To what extent does closing the feedback loop in the decoder reduce exposure bias during sequence generation?
- RQ4Does policy gradient fine-tuning improve sequence-level metrics such as BLEU and ROUGE?
- RQ5What is the performance of the model on the IM2LATEX-100K benchmark compared to prior state-of-the-art methods?
Key findings
- The model achieves state-of-the-art performance on both sequence-based and image-based evaluation metrics on the IM2LATEX-100K dataset.
- Sequence-level training with policy gradient significantly improves generation quality compared to token-level MLE training alone.
- Closing the feedback loop during sequence-level training effectively mitigates the exposure bias problem.
- The use of 2D positional encoding enhances the model's ability to capture spatial relationships among symbols in mathematical expressions.
- The model demonstrates strong generalization on unseen formula images, achieving high BLEU and ROUGE scores.
- The combination of CNN encoder, bidirectional LSTM decoder with attention, and sequence-level optimization leads to robust and accurate LaTeX sequence generation.
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.