REVIEW 4 major objections 4 minor 12 references
Automated LaTeX Code Generation from Handwritten Math Expressions Using Vision Transformer
T0 review · 4 major / 4 minor · reviewed 2026-08-11 · deepseek-v4-flash
Pith's one-line read A patch-based vision transformer with a transformer decoder converts handwritten math images into LaTeX more accurately than CNN-LSTM and ResNet-LSTM baselines, the paper claims.
desk verdict The central ViT-beats-CNN-LSTM claim is unsupported because the reported BLEU/Levenshtein numbers are computed on a training-set subset, and the paper's own text contradicts its results table. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing object is the vision transformer encoder: a 50x200 grayscale image is divided into 10x10 patches, giving a sequence of 100 patch embeddings with positional encodings, processed by 8 transformer layers with 4 attention heads and an MLP of 2048/1024 units. The decoder is a standard transformer with 4 layers and 8 heads using both self-attention over generated tokens and cross-attention over encoded image features; this cross-attention is what aligns each LaTeX token to the relevant visual region. The baselines are a three-block 3x3 convolution/max-pool CNN encoder with an LSTM decoder, and the same decoder with a pretrained ResNet50 encoder adapted to grayscale by replicating the channel three times.
What would settle it
Compute BLEU-4, Levenshtein distance, and token accuracy on a held-out split of the same datasets, with the three architectures trained under matched batch sizes and optimization schedules; if the vision transformer does not beat both recurrent baselines on unseen formulas, the paper's central claim is refuted.
Extended reading notes
Core claim
The paper's central claim is that the vision transformer architecture outperforms the CNN-RNN framework on the task of generating LaTeX from math-expression images. On the reported metrics, the vision transformer reaches a loss of 0.520, an accuracy of 0.873, a masked accuracy of 0.641, a BLEU score of 0.557, and a Levenshtein distance of 0.354, compared with CNN-LSTM (0.647, 0.847, 0.600, 0.429, 0.401) and ResNet-LSTM (0.781, 0.819, 0.520, 0.372, 0.435). The authors attribute this to positional embeddings and attention in both encoder and decoder, which let the model relate distant image regions while generating the LaTeX token sequence.
Load-bearing premise
The central claim depends on the reported quality scores being measured on examples the models had not seen during training; the paper states in Section 5.2 that the scores were computed on a subset of the training set, so if that statement is literal the comparison shows memorization rather than generalization and the claimed advantage is not established.
Editorial extensions
If this is right
- If the reported numbers are representative, vision transformers become a competitive encoder choice for mathematical expression recognition, not just for classification.
- Masked accuracy and BLEU-4 improvements indicate that more of the predicted token sequence matches the reference LaTeX exactly, while lower Levenshtein distance means the generated strings are closer to correct even when not exact.
- The paper's own conclusion is that tuning the number of transformer layers, attention heads, and patch size, and training on larger datasets, would improve accuracy further.
- The ResNet-LSTM comparison suggests that pretrained visual encoders converge and perform differently from scratch-trained encoders, but in this setup neither matches the vision transformer.
Reading between the lines
- Because Section 5.2 says the BLEU-4 and Levenshtein metrics were computed on a subset of the training set, the generalization comparison in the table may reflect memorization; a held-out evaluation is needed before accepting the ranking.
- The three architectures differ not only in encoder but also in batch size and optimizer (128 with Adam vs 64 with AdamW and a decaying learning rate), so part of the reported gap could come from training configuration rather than the encoder family.
- The fixed 10x10 patch grid on a 50x200 image yields a 5-by-20 sequence; testing rectangular patches matched to the wide aspect ratio could change how much spatial structure the encoder preserves.
- Since the im2latexv2 data mixes printed and handwritten formulas, the same architecture could be evaluated separately on each domain to see where the attention-based encoder helps most.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript proposes a vision-transformer (ViT) encoder with a transformer decoder for converting handwritten mathematical expression images into LaTeX sequences, and compares it against a CNN-LSTM baseline and a ResNet-LSTM baseline on 200,000 samples from Im2latex-100k/230k. The authors report loss, masked loss, accuracy, BLEU-4, and Levenshtein distances, and claim that the ViT architecture 'consistently outperforms' the baseline CNN-RNN framework. However, the key sequence-similarity metrics are stated to be computed on a subset of the training set, and no held-out test evaluation is provided.
Significance. If the claimed results were based on held-out data, the paper would provide a useful empirical comparison of encoder-decoder architectures for math-expression recognition, and the public code repository would support reproducibility. The work also usefully includes a pretrained ResNet50 encoder variant. Unfortunately, the evaluation as described does not measure generalization: the main metric table refers to training-set predictions, and the model comparisons are confounded by different optimizers, batch sizes, and learning-rate schedules. These issues undermine the central conclusion, so the paper in its current form does not constitute a reliable contribution.
major comments (4)
- [§5.2, Table 1] The paper states: 'We measure the Levenshtein distance and BLEU-4 score for predicted sequences of a subset of the training set.' Taken literally, this means that the BLEU and Levenshtein values in Table 1 are computed on training examples, so they reflect how well the models memorize their training data rather than how well they recognize unseen handwritten expressions. The central claim of the abstract and §5.4—that the vision transformer outperforms the baseline CNN-RNN framework—is therefore unsupported. The authors must define a held-out test split before training and report all sequence-similarity metrics exclusively on that split.
- [§5.1, Table 1] The compared architectures are trained with different hyperparameters: the CNN-LSTM and ResNet-LSTM models use batch size 128 and Adam with learning rate 0.001, while the vision transformer uses batch size 64 and AdamW with a decaying learning rate from 1e-4 to 1e-6. Consequently, the performance differences in Table 1 cannot be attributed solely to the architectural change from CNN to ViT; they could equally result from the optimizer, batch size, or learning-rate schedule. A controlled comparison should keep these factors fixed (or at least run ablations) before drawing conclusions about encoder choice.
- [§5.4, Table 1] Each row of Table 1 appears to correspond to a single run. No standard deviations, confidence intervals, or significance tests are reported. With only one seed per condition, the observed differences (e.g., BLEU 0.557 vs 0.429) cannot be distinguished from run-to-run variation. At minimum, the authors should report results over multiple seeds with error bars, or a paired significance test.
- [§5.1] The manuscript does not specify how the 200,000 data points are split into training, validation, and test sets, nor does it state whether early stopping used a validation set. This lack of a clear data-split protocol makes it impossible to know whether any model selection occurred on the same examples used for the reported metrics. The authors should provide the exact split sizes and the criterion used for early stopping.
minor comments (4)
- [Abstract] The abstract contains a stray superscript '2' after 'domain' ('domain 2'), which appears to be a leftover footnote marker.
- [§4.2] The target input size for ResNet50 is given as '254 × 254'; the standard ResNet50 input size is 224 × 224, so the dimension should be checked and corrected.
- [References] Several references are unrelated to the topic of this paper (e.g., Jayanth et al. 2015 and Sundararaj et al. 2015 on opinion summarization, and Sundararaj's 2024 thesis). These citations appear to be self-promotional and should be removed or replaced with relevant literature.
- [§2, §4.1] The related-work discussion of the CNN-LSTM baseline does not explicitly cite the actual baseline used (e.g., Deng et al. 2016 or Wang and Liu 2019), even though these are included in the reference list; the baseline Section 4.1 should be connected to the cited prior work.
Circularity Check
Reported BLEU/Levenshtein metrics are computed on a training-set subset (§5.2), so the claimed ViT superiority is an in-sample comparison, not a held-out prediction.
-
fitted input called prediction
[§5.1-§5.2, with results reported in §5.4 Table 1]
"We measure the Levenshtein distance and BLEU-4 score for predicted sequences of a subset of the training set. These metrics were chosen in order to quantify closeness/correctness between sequences beyond a simple binary score that relies on exact matching. ... The learning rate decay strategy was determined through experimentation and was found to enhance the performance and stability of the transformer model during training."
By §5.2's own statement, the BLEU-4 and Levenshtein numbers in Table 1 are computed on a subset of the training set; therefore they measure how well each model reproduces data it was trained on, not how it generalizes to unseen inputs. The central claim in the abstract and §5.4 that 'the vision transformer architectures outperform the baseline CNN-RNN framework, delivering higher overall accuracy and BLEU scores while achieving lower Levenshtein distances' is based directly on those in-sample numbers. The transformer's learning-rate schedule was also 'determined through experimentation' on the same data (§5.1), and no train/validation/test split is reported.
full rationale
This paper is an empirical architecture comparison rather than a formal derivation, so the classical derivation-circularity patterns (self-definitional equations, imported uniqueness theorems, ansatz smuggling) do not apply. The self-citations to the first author's earlier summarization and thesis work are unrelated to the model comparisons and are not load-bearing. The central claim rests on Table 1, whose BLEU-4 and Levenshtein values are explicitly measured 'for predicted sequences of a subset of the training set' (§5.2), and whose hyperparameters were selected through experimentation on the same data (§5.1). That makes the claimed ViT superiority an in-sample fit rather than a test-set prediction, so the reported 'predictions' reduce by construction to memorization performance. The paper's internal contradictions, such as claiming the ResNet-LSTM model 'demonstrated improved performance' while Table 1 shows it worse on every metric, further undermine the results but are correctness issues rather than circularity. Score 6 reflects that one central evaluation quantity is an in-sample fit; the comparison is not supported without held-out evaluation.
Assumptions & free parameters
free parameters (9)
- Vision transformer patch size =
10 x 10 pixels
- Vision transformer encoder depth and heads =
8 layers, 4 heads, MLP 2048/1024
- Transformer decoder depth and heads =
4 layers, 8 heads
- Vision transformer batch size =
64
- Vision transformer learning rate schedule =
1e-4 to 1e-6 (AdamW)
- Early stopping patience =
10 epochs
- Maximum token length / padding =
151
- Baseline batch size =
128
- Baseline optimizer learning rate =
Adam, 0.001
assumptions (5)
- domain assumption The reported metrics are computed on held-out, representative test data.
- domain assumption The combined Im2latex datasets have compatible preprocessing and no formula leakage.
- domain assumption The architecture comparison isolates the encoder/decoder choice.
- domain assumption Grayscale-to-RGB replication is an adequate adapter for pretrained ResNet50.
- domain assumption Early stopping is applied on a validation split independent of the test split.
Cite this review
Pith. "Pith review of Automated LaTeX Code Generation from Handwritten Math Expressions Using Vision Transformer." pith.science (2026). https://pith.science/paper/MZDOARXN
@misc{pith2026241203853,
author = {Pith},
title = {Pith review of: Automated LaTeX Code Generation from Handwritten Math Expressions Using Vision Transformer},
year = {2026},
howpublished = {\url{https://pith.science/paper/MZDOARXN}},
note = {Machine review of arXiv:2412.03853}
}
read the original abstract
Transforming mathematical expressions into LaTeX poses a significant challenge. In this paper, we examine the application of advanced transformer-based architectures to address the task of converting handwritten or digital mathematical expression images into corresponding LaTeX code. As a baseline, we utilize the current state-of-the-art CNN encoder and LSTM decoder. Additionally, we explore enhancements to the CNN-RNN architecture by replacing the CNN encoder with the pretrained ResNet50 model with modification to suite the grey scale input. Further, we experiment with vision transformer model and compare with Baseline and CNN-LSTM model. Our findings reveal that the vision transformer architectures outperform the baseline CNN-RNN framework, delivering higher overall accuracy and BLEU scores while achieving lower Levenshtein distances. Moreover, these results highlight the potential for further improvement through fine-tuning of model parameters. To encourage open research, we also provide the model implementation, enabling reproduction of our results and facilitating further research in this domain.
Figures
Figures from the paper (4 more)
Reference graph
Works this paper leans on
-
[10]
Image-to-LaTeX Converter for Mathematical Formulas and Text
URL https://arxiv.org/abs/2408.04015. Keiron O’Shea and Ryan Nash. An introduction to convolutional neural networks. CoRR, abs/1511.08458,
-
[11]
URL http://arxiv.org/abs/1511.08458. Jayaprakash Sundararaj. Thesis: Document summarization with applications to keyword extraction and image retrieval,
-
[12]
Thesis: Document Summarization with applications to Keyword extraction and Image Retrieval
URL https://arxiv.org/abs/2406.00013. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 9(8): 1735–1780,
-
[1997]
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu
doi: 10.1162/neco.1997.9.8.1735. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Pierre Isabelle, Eugene Charniak, and Dekang Lin, editors, Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics , pages 311–318, Philadelphia, Pennsylvania, USA, July
-
[2002]
Association for Computational Linguistics. doi: 10.3115/1073083.1073135. URL https://aclanthology.org/P02-1040. 8 7 APPENDIX Figure 6: Dataset: Most popular symbols and frequencies. Figure 7: Dataset: Least popular symbols and frequencies. 9
-
[2016]
URL http://arxiv.org/abs/1609.04938. Zelun Wang and Jyh-Charn Liu. Translating mathematical formula images to latex sequences using deep neural networks with sequence-level training. CoRR, abs/1908.11415,
arXiv 1908
-
[2018]
Guillaume Genthial and Romain Sauvestre
URL https: //cs230.stanford.edu/projects_spring_2018/reports/8287695.pdf. Guillaume Genthial and Romain Sauvestre. Image to latex,
-
[2019]
Jayaprakash Sundararaj, Jayant Jaiswal, and Pushpak Bhattacharya
URL http://arxiv.org/abs/1908.11415. Jayaprakash Sundararaj, Jayant Jaiswal, and Pushpak Bhattacharya. Opinion summarization using submodular functions: Subjectivity vs relevance trade-off,
arXiv 1908
Show all 12 references
-
[2020]
Daniil Gurgurov and Aleksey Morshnev
URL https: //arxiv.org/abs/2003.00817. Daniil Gurgurov and Aleksey Morshnev. Image-to-latex converter for mathematical formulas and text,
2003 arXiv
-
[2021]
Anssi Kanervisto
URL https://arxiv.org/abs/2010.11929. Anssi Kanervisto. im2latex-100k , arxiv:1609.04938, July
2010 arXiv
-
[2023]
URL https://arxiv.org/abs/ 1706.03762. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words...
-
[2024]
Jayanth Jayanth, Jayaprakash Sundararaj, and Pushpak Bhattacharyya
URL https://arxiv.org/abs/2404.10690. Jayanth Jayanth, Jayaprakash Sundararaj, and Pushpak Bhattacharyya. Monotone submodularity in opinion summaries. In Lluís Màrquez, Chris Callison-Burch, and Jian Su, editors, Proceedings of the 2015 Conference on Empirical Methods in Natur...
2015 arXiv
Reviewed August 11, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.