Code as Representation: A Compilable Parsing Paradigm for Academic Documents
Authors: Rihui Jin, Jun Wang, chengyuan zhu, Liang Mingyu, Yue Gao, Li Yunxuan, Kuicai Dong, Guilin Qi, Lin Ren, Yongrui Chen, Xinbang Dai, Jiaqi Li, Tongtong Wu, Gholamreza Haffari
Organizations: Southeast University School of Computer Science and Engineering Nanjing, Jiangsu, China · Nanyang Technological University Singapore, Singapore · Nanjing University State Key Laboratory for Novel Software Technology Nanjing, Jiangsu, China · Monash University Clayton, Victoria, Australia
Academic papers are a primary carrier of scientific knowledge, yet most of this knowledge remains locked in PDFs that are optimized for human reading rather than machine use. For Multimodal Large Language Models (MLLMs), the core challenge is not only perception, but representation: scientific pages interleave text with Structured Academic Elements (SAEs) such as tables, formulas, charts, and pseudocode, whose structure, data, and logic are poorly preserved by common surrogates like Markdown. We therefore propose Compilable Academic Document Parsing (CADP), a paradigm that reconstructs a full page as contextual \LaTeX{} plus executable Python, so that structure-preserving elements and executable chart representations can be reconstructed, recompiled, and directly verified against the source page. To support this setting, we introduce CADP-Bench, an expert-verified benchmark of full academic pages containing tightly coupled text and multiple SAE types, evaluated through a re-injection compilation protocol. We further study current capabilities using SOTA MLLMs and an exploratory multi-agent baseline that incorporates common agentic techniques. Results show that even frontier models still struggle to produce high-fidelity executable reconstructions, highlighting substantial room for improvement in structure-aware scientific document parsing. CADP-Bench is released for future research.
Figures & tables
Figure 1. Comparison of three representations for machine reading of academic papers. (a) A raw page screenshot preserves the full visual layout but leaves structure implicit. (b) Markdown-based parsing linearizes the page into plain text, flattened tables, and raster chart crops, leading to structural collapse and opaque visual elements. (c) Our compilable parsing paradigm reconstructs the same page as contextual L a T e X plus executable Python, which can be compiled back into a preview PDF, preserving document structure, recovering chart logic, and enabling direct verification.
Benchmarks
Input Type
Output Type
Re-renderable Reconstruction
#Samples
Annotation Type
Page
Table
Chart
Formula
Pseudocode
Markdown
Python
L a T e X
TabLeX ( Desai et al., 2021 )
✗
✓
✗
✗
✗
✗
✗
✓
✓
4M+
Auto-extracted
Tab-To-Tex ( Kayal et al., 2023 )
✗
✓
✗
✗
✗
✗
✗
✓
✓
40k+
Auto-extracted
TAB2LATEX ( Jiang et al., 2025 )
✗
✓
✗
✓
✗
✗
✗
✓
✓
5,000
Auto-extracted
Table2LaTeX ( Ling et al., 2025 )
✗
✓
✗
✗
✗
✗
✗
✓
✓
1,211
Auto-extracted
Im2LaTeX-100K ( Li et al., 2025d )
✗
✗
✗
✓
✗
✗
✗
✓
✓
100K
Auto-extracted
Table 1. Comparison of representative document parsing benchmarks across key dimensions. ✓ : fully matches this category; √ – : partially matches this category; ✗ : does not match this category.
Figure 2. Construction workflow of CADP-Bench. We collect and filter arXiv source files to identify pages containing dense SAEs. Gemini-3-Pro generates candidate Python programs from raster charts, which are rendered as SVGs and retained only after expert verification of their visual content, data trends, and layout. The verified programs serve as executable chart references rather than the original plotting code. Together with the corresponding L a T e X source, they form the final benchmark.
Type
Metric
Notes
Code
Exec. Rate
Layout/Chart: re-injected L a T e X and Python must be able to be compiled and rendered.
TEDS
Table: structure&content similarity.
PRS
Pseudocode: combines text and structure fidelity.
Reading Order
Layout: reading-order error (lower is better).
Visual
PageIoU
Layout: page-level overlap between prediction and ground truth.
CDM
Formula: character-level matching score.
Table 2. Summary of the evaluation metrics.
Sub-domain
Computer Science
Physics
Economics
Quantitative Biology
Statistics
Total
Count
1047
251
45
222
65
1630
Element
Simple
Medium
Hard
Count
Table
803
644
395
1842
Formula
340
536
147
1023
Pseudocode
40
71
27
138
Chart
316
975
200
1491
Table 3. Statistical overview of CADP-Bench, including total scale, per-sub-domain sample counts, and element-level difficulty distribution. Difficulty levels are annotated as Simple , Medium , and Hard .
Figure 3. An exploratory multi-agent system used to study common agentic techniques on CADP-Bench.
Models
Formula
Table
Chart
Pseudocode
Layout
Overall
Visual
Code
Visual
Code
Visual
Code
Visual
Code
Visual
Visual
CDM ↑
TEDS ↑
VRF-S ↑
Exec. Rate ↑
VRF-A ↑
PRS ↑
VRF-S ↑
Exec. Rate ↑
Reading Order ↓
PageIoU ↑
VRF-A ↑
Pixel Sim. ↑
Claude Haiku 4.5
27.71
44.10
9.46
49.57
4.75
10.82
0.00
42.33
75.50
23.17
25.75
20.32
Claude Sonnet 4.6
52.10
72.80
38.28
93.59
27.75
47.74
21.74
86.33
46.03
46.34
50.50
41.48
Claude Opus 4.6
60.61
71.32
35.43
78.63
35.00
49.50
17.39
84.00
49.97
49.45
48.50
39.76
Qwen3.5-35B-A3B
63.69
72.35
16.50
72.65
11.50
59.77
8.70
69.70
57.52
35.60
42.75
33.01
Table 4. Overall model performance across layout, formula, table, chart, and Pseudocode parsing tasks under code- and visual-based metrics (higher is better except Reading Order). Light green: Visual; light blue: Code.
Figure 4. Performance across element-level difficulty (easy, medium, hard) for three representative models at different performance tiers: Gemini-3-Pro (strong), Qwen3.5-Plus (medium), and Qwen3.5-35B-A3B (weak). Table reconstruction is the most robust, while formula, chart, and pseudocode performance degrades with increasing complexity.
Figure 5. Case study of CADP on a challenging sample: the source screenshot (left panel) v.s. the parsed result by Gemini-3-Pro (right panel). VRF-A scores: Layout 75.00, Table 58.33, Chart 43.75 and Pseudocode 100.
Setting
Avg. Calls
Layout
Formula
Table
Chart
Pseudocode
(VRF-A)
(CDM)
(VRF-S)
(VRF-A)
(VRF-S)
Base (Gemini-3-Pro)
1.0
73.00
70.83
66.09
60.00
56.52
w/ Self-reflection
2.0
71.00
68.80
63.99
58.50
52.17
Full MA System
6.0
77.20
74.20
71.40
66.50
61.80
w/o Visual Feedback
4.5
74.10
75.30
66.80
62.00
58.50
w/o Tools
5.0
76.50
73.40
68.20
61.80
61.10
Table 5. Ablation study for RQ3, designed to quantify how agentic components contribute to reconstruction quality.
Figure 6. Format-sensitive QA performance across three input representations.