TL;DR
This paper introduces Compilable Academic Document Parsing (CADP), a novel paradigm that shifts document parsing from flat text extraction to dual-code generation. By reconstructing full academic pages as contextual $\LaTeX$ combined with executable Python code for charts, CADP preserves complex document structures and underlying data logic in a directly verifiable format. Along with the paradigm, the authors present CADP-Bench, a rigorous expert-verified benchmark that reveals even state-of-the-art multimodal large language models (MLLMs) still struggle to achieve high-fidelity, compilable page reconstructions.
What Problem Does This Paper Address?
While academic papers are the bedrock of scientific knowledge, most of this data remains trapped in human-optimized PDFs. Current document parsing tools typically convert these pages into Markdown. However, Markdown inherently suffers from three major flaws when handling complex scientific layouts:
- Structural Collapse: Flat syntax cannot faithfully represent merged table cells, aligned equations, or nested pseudocode.
- Chart Opacity: Charts are treated as static raster images, completely discarding the underlying data arrays and rendering logic.
- Non-Verifiability: There is no way to programmatically compile and visually validate the parsed text against the original document.
To bridge this gap, the authors ask: Can we parse page pixels into a machine-actionable program that can be compiled back into a perfect visual replica of the original page?
Methods
The authors formalize the CADP task as a page-level reconstruction problem under limited compilation context. Given a raw page image, a model must jointly generate a Dual-Code representation:
- Contextual $\LaTeX$ Block: Reconstructs the continuous prose, tables, math formulas, and pseudocode algorithms.
- Executable Python Programs: Reconstructs the data trends and aesthetic rendering logic behind any charts on the page.
Re-injection Compilation Protocol
To evaluate performance, the generated code undergoes a strict verification pipeline. First, the Python scripts are executed to render charts as SVG files. Next, the generated $\LaTeX$ block is structurally re-injected into the original document's source context (preserving the original preamble, macros, and bibliography). Finally, a standard $\LaTeX$ compiler ($\text{pdf}\LaTeX$) compiles the document. If the code contains syntax errors, unclosed environments, or hallucinated macros, compilation fails entirely, providing a rigorous check on structural fidelity.
The authors also designed an exploratory Multi-Agent Baseline consisting of four specialized agents (Planner, $\LaTeX$ Coder, Python Coder, and Reviewer) equipped with tools like OCR parsers, code executors, and color pickers to test the limits of current agentic workflows.
Datasets
The paper introduces CADP-Bench, an expert-verified benchmark consisting of 1,630 full academic pages sourced from arXiv.
Unlike existing datasets that evaluate elements like tables or formulas in isolation, CADP-Bench enforces a "multi-element coupling principle." Every page in the benchmark contains a mix of continuous text and at least two distinct types of Structured Academic Elements (SAEs), such as a table paired with a chart, or a formula alongside pseudocode. The dataset spans five diverse scientific sub-domains: Computer Science, Physics, Economics, Quantitative Biology, and Statistics.
Key Insights and Ideas
- Decoupling of Code Execution and Visual Fidelity: Frontier models are highly capable of writing runnable plotting code (achieving chart execution rates above 96%), but they struggle to accurately capture the exact data distributions, labels, and visual aesthetics of the original charts.
- The Pseudocode Bottleneck: Algorithmic pseudocode formatting remains an unsolved challenge. Even top-tier models experience severe performance drops when trying to maintain strict indentation and control-flow logic in $\LaTeX$.
- The Double-Edged Sword of Visual Feedback: While multi-agent collaboration and iterative feedback generally improve layout and chart parsing, visual feedback can actually degrade formula parsing. Pixel-based visual critics often misinterpret dense, tiny math symbols, leading them to override correct $\LaTeX$ code with hallucinated "fixes."
- Structure Imparts Understanding: Providing downstream QA models with structured $\LaTeX$+Python code significantly boosts their scientific comprehension compared to flat Markdown, particularly for medium-tier models.
Key Results
The benchmark evaluated several state-of-the-art MLLMs, revealing a clear performance hierarchy:
- Gemini-3-Pro emerged as the top-performing model, achieving the highest overall pixel similarity (47.28%) and leading in strict table reconstruction (63.09% VRF-S) and pseudocode parsing (56.52% VRF-S).
- Qwen3.5-397B-A17B demonstrated impressive open-weight capabilities, rivaling proprietary models like GPT-4 in layout and chart visual fidelity, though it struggled significantly on complex pseudocode.
- Stricter metrics like VRF-S (which awards a perfect score only if all visual dimensions match perfectly) revealed a steep performance drop across all models, proving that partial structural recovery remains a major issue.
Limitations and Future Work
While CADP-Bench sets a high bar, the authors note that even the best frontier models fail to achieve flawless high-fidelity reconstructions. Because the dual-code output provides a deterministic environment (it either compiles correctly or it doesn't), the authors suggest that Reinforcement Learning (RL) is a highly promising avenue for future work, where compilation success and rendering metrics can serve as direct reward signals. Additionally, preserving explicit structural signals (like \ref and \cite) opens the door for more robust, graph-based Retrieval-Augmented Generation (Graph-RAG) pipelines in scientific domains.
Summary updated