TLDR: This paper introduces Table2LaTeX-RL, a new method for converting table images into high-quality LaTeX code. It uses a fine-tuned multimodal large language model combined with a unique dual-reward reinforcement learning strategy. This strategy optimizes for both the structural correctness of the LaTeX code and the visual appearance of the rendered table, leading to state-of-the-art performance, especially for complex tables found in scientific documents.
In the world of scientific and technical documentation, tables are indispensable for presenting complex data clearly. However, digitizing these documents and making their content reusable often hits a roadblock: converting table images back into editable, high-quality code. While many tools can turn table images into HTML, HTML often falls short when it comes to the intricate structures and precise typography required for professional scientific tables, especially those with nested headers, merged cells, or mathematical content. This is where LaTeX, the standard for scientific publishing, comes in, offering the flexibility and fidelity needed.
A recent research paper, titled “Table2LaTeX-RL: High-Fidelity LaTeX Code Generation from Table Images via Reinforced Multimodal Language Models,” addresses this very challenge. Authored by Jun Ling, Yao Qi, Tao Huang, Shibo Zhou, Yanqin Huang, Jiang Yang, Ziqi Song, Ying Zhou, Yang Yang, Heng Tao Shen, and Peng Wang, this work introduces a novel approach to automatically generate publication-ready LaTeX code directly from table images.
The core difficulty lies in handling “complex tables” – those that are large, deeply nested, and contain rich or irregular cell content. Existing methods often struggle with these, leading to errors or malformed outputs. The researchers began by thoroughly analyzing these challenges and identifying limitations in current evaluation methods.
A Reinforced Multimodal Approach
To overcome these issues, the paper proposes a reinforced multimodal large language model (MLLM) framework. This framework starts with a pre-trained MLLM, which is then fine-tuned on a massive dataset of table-to-LaTeX pairs collected from scientific documents on arXiv. This initial fine-tuning gives the model a foundational understanding of both visual recognition and LaTeX code generation.
The real innovation, however, comes with a dual-reward reinforcement learning strategy called VSGRPO, based on Group Relative Policy Optimization (GRPO). Unlike traditional methods that only optimize based on the text output, VSGRPO incorporates two types of rewards:
- Structure-level reward: This evaluates the accuracy of the generated LaTeX code’s structure using a metric called TEDS-Structure.
- Visual fidelity reward: This is a groundbreaking addition. The generated LaTeX code is actually rendered into an image, and its visual similarity to the original table image is assessed using CW-SSIM. This “visual-in-the-loop” approach directly optimizes for the quality of the final visual output.
By combining these two rewards, the model learns to produce LaTeX code that is not only structurally correct but also visually faithful to the original table, even for highly complex designs.
Dataset and Evaluation
Recognizing the scarcity of large-scale LaTeX table datasets, the researchers developed a pipeline to scrape LaTeX source files from arXiv, creating a dataset of over 1.2 million table-LaTeX pairs. They also categorized tables into simple, medium, and complex subsets to allow for more granular evaluation, with complex tables being the focus for reinforcement learning.
For evaluation, a hybrid protocol was adopted, combining TEDS-Structure for structural accuracy and CW-SSIM for visual similarity. This comprehensive approach ensures that both the underlying code and the rendered appearance are accurately judged.
Impressive Results
The proposed VSGRPO method achieved state-of-the-art performance, particularly on structurally complex tables. For instance, the Qwen2.5-VL-3B-VSGRPO model significantly outperformed commercial tools like Mathpix and larger general-purpose MLLMs like GPT-4o and Qwen2.5-VL-72B in terms of both visual fidelity (CW-SSIM) and structural correctness (TEDS-Structure). It even achieved a high compile success rate for complex tables, demonstrating its robustness.
A human evaluation study further confirmed these findings, with Qwen2.5-VL-3B-VSGRPO receiving the highest number of votes for visual and structural fidelity across all table complexity levels.
Also Read:
- Improving Text-to-Image Spatial Understanding Through Structured Information
- Enhancing Multimodal AI Understanding by Tackling Superficial Biases
Key Contributions and Future Outlook
This research makes several significant contributions:
- A deep dive into the challenges of table image to LaTeX generation, especially for complex tables.
- Development of a reinforced MLLM framework that effectively bridges visual input and LaTeX code generation.
- Introduction of VSGRPO, a novel dual-reward reinforcement learning strategy that optimizes both structure-level accuracy and visual fidelity.
- A hybrid evaluation strategy combining TEDS-Structure and CW-SSIM for a more comprehensive assessment.
While the method shows remarkable promise, the authors acknowledge a limitation: the computational overhead during training due to the LaTeX rendering process for visual reward calculation. This aspect suggests an area for future optimization.
This work represents a significant step forward in automating the reconstruction of high-quality, publication-ready tables from visual inputs, promising to enhance content reuse and document digitization in scientific and technical fields. You can find the full research paper here: Table2LaTeX-RL: High-Fidelity LaTeX Code Generation from Table Images via Reinforced Multimodal Language Models.


