DaVinci: Reinforcing Visual-Structural Syntax in MLLMs for Generalized Scientific Diagram Parsing
Authors: Xingchen ZENG
Zhewei Su
Hengming Zhang
Juyong Jiang
Jiazhi Xia
Wei Zeng
Venue: ICLR 2026 Poster (2026)
Keywords: Scientific diagram parsing
multimodal large language model
Primary area: applications to computer vision, audio, language, and other modalities

Abstract: Parsing raster-based scientific diagrams into structured representations is critical for editability and reusability. However, existing multimodal LLMs (MLLMs) struggle with the diverse visual primitives, complex structural layouts, and strict syntax involved. To address this, we introduce DaVinci, a novel MLLM that learns diagram parsing based on a two-stage framework—supervised learning of visual primitives followed by reinforcement learning of their structural relationships. Our model learns visual-structural syntax through supervised training on TikZ30K, a newly curated dataset of high-quality diagram-TikZ code pairs that features abundant visual primitives and structurally optimized drawing sequences. We further refine the model via reinforcement learning, guided by a hybrid reward function that jointly optimizes for visual fidelity, structural consistency, and code correctness. Extensive experiments show that DaVinci significantly outperforms existing open-source MLLMs and surpasses leading proprietary models like GPT-5 and Claude-Sonnet-4.

Published as a conference paper at ICLR 2026
DAVINCI: REINFORCING VISUAL-STRUCTURAL SYN- TAX IN MLLMS FOR GENERALIZED SCIENTIFIC DIA- GRAM PARSING
Xingchen Zeng', Zhewei Su', Hengming Juyong , Jiazhi Xia", Wei Zeng"* 'he Hong Kong University of Science and Technology (Guangzhou) Central South University
ABSTRACT
Parsing raster-based scientific diagrams into structured representations is critical for editability and reusability. However, existing multimodal LLMs (MLLMs) struggle with the diverse visual primitives, complex structural layouts, and strict syntax involved. To address this, we introduce Da Vinci, novel MLLM that learns diagram parsing based on a two-stage framework: supervised learning of visual primitives followed by reinforcement learning of their structural relation- ships. Our model learns visual-structural syntax through supervised training on TikZ30K, a newly curated dataset of high-quality diagram-TikZ code pairs that features abundant visual primitives and structurally optimized drawing sequences. We further refine the model via reinforcement learning, guided by hybrid reward function that jointly optimizes for visual fidelity, structural consistency, and code correctness. Extensive experiments show that Da Vinci significantly outperforms existing open-source MILMSs and surpasses leading proprietary models like GPT- 5 and Claude-Sonnet-4, Code, datasets, and models are available"
Introduction
Diagram-to-Code
Code Editing
change the the light
Sutpeet The ALTOONETIY
Food
Feed
DaVinci
SVG Editing
comple
Switch from a dashed line to dynamic mand--rrew style
Pacoard
Pacts Lileea
SVA
Figure 1: Da Vinci parses scientific diagram images into structured TikZ. code, which can subse- quently be compiled into SVG (Left). The TikZ code enables LLMs to edit diagrams through code manipulation; SVG enables individual element editing using illustration software like ligel (Right).
Scientific diagrams are ubiquitous across research, engincering, and education, serving as essential visual tools for conveying complex concepts, relationships, and events (Kembhavi al. 2016 Hu
et al. 2024 Zeng et af. 2025). Automatically parsing rasterized diagrams into structured, program- crucial step toward unlocking their editability, reusability, and integration into downstream workflows (as illustrated in Figure I]. offering an alternative to time-consuming
matic representations
manual reconstruction (Belouadi al. 2024b).
Wai Zeng is the corresponding author. E-mail: www.:///wggggkkkttgg........mm
https://gi thub. com/ zengxi http://wwwaa..gggggaeeeaaaaaaaaa

---

Published as a conference paper at ICLR 2026
Among common diagram representations, TikZ is particularly well-suited for diagram-to-code gen- eration in the context of multimodal large language models (MLLMs). TikZ features declarative syntax that is mathematically expressive, closely mirrors the logical structure of scientific content, and remains both concise and semantically rich. These features have made it widely employed in Wang et al. 2025).
recent works (Belouadi al. 2024b 2025
Existing works have collected large-scale diagram-TikZ code datasets to support supervised fine- tuning (SFT) for improving MLLMs' diagram parsing capabilities. For example. [Belouadi et al. 2024a b 2025) collect DATIKZ series data features diagram-TikZZ code pairs from real-world sources such as arXiv papers and curated GitHub repositories. Detikzify (Belouadi et al. 2024b) further introduces an MCTS-buis based inference algorithm to improve the perceptual similarity ZZhagg ct al. 2018) of the output image. Despite the progress, current MLL.Ms still struggle with this task, primarily because parsing diagrams demands pixel-level precision in encoding geometric details. This requires the exact specification of diverse graphical primitives, such as lines, shapes, and text, along with their precise spatial relationships, all while adhering to TikZ's s strict syntactic constraints.
In this paper, we introduce DaVinci, a novel MLLM that learns diagram parsing based on a two-stage framework: supervised learning of visual primitives, followed by reinforcement learning of their structural relationships. Specifically, we identified two significant yet underexplored data features for diagram parsing: drawing order and comment annotations. We extend the DATıkZ series data collection pipeline with enhanced quality control and data enhancement.
Following initialization with SFT, we employ Group Relative Policy Optimization (GRPO) (Shao et al. 2024) to refine the model's ability to generate runnable and visually faithful TikZ codes from input diagram images. To construct accurate and explicit rewarding signals, we design a hybrid reward that constructs reward signals from the generated code, vectorized representation, and ren- dered image. Specifically, we innovatively employ the vectorized representation to extract textual and geometric primitives in an extraction-error-ffi erated diagrams' spatial-texte -eettalltextual alignment and geometric accuracy. Experimental results show that Da Vinci significantly outperforms existing open-source MILMS and even surpasses leading com- mercial models (e.g.. GPT--5, and Claude-Sonen Sonnet-4) in diagram parsing.
manner to provide precise feedback on the gen-
Our main contributions are summarized as follows:
We introduce DaVinci, a novel MILM that learns diagram parsing based on a two-stage framework: supervised learning of visual primitives followed by reinforcement learning of their structural relationships, which demonstrates superior performance.
We identify the significance of drawing order and comment annotations for diagram pars- ing, and construct high-quality diagram-code dataset TikZ-30K.
We design a novel Hybrid Reward function for reinforcement learning, leveraging the vec- torized representation construct spatio-textual and geometric rewards in an extraction- error-free manner, mitigating the errors introduced by OCR and other heuristic parsers.
2 Related Work
Image-to-Code Generation aims to reproduce visual inputs with editable and structurally faithful code (Jiang et al. (025b)) This growing field is exemplified by efforts targeting user interfaces (UI) (Si et al. 2024 Yun et al., 2024), charts (Li et al. 2025a Zhao et al. (202)). and diagrams (Be-) louadi al.] 2024b Wei al. 2025). each posing unique semantic and structural challenges. For instance, chart-ro-cae code operates over closed-set chart types and their constrained grammar spaces within plotting libraries such as Matplotlib (Shi et al., 2025). In contrast, UI and diagram code generation involve open-ended composition over diverse visual primitives. Specifically, the diagram code encodes geometric details with pixel-level precision, requiring the exact specification of diverse primitives (c.g., lines, shapes, text) and their spatial relationships (Belouadi et al., 2024b). To tackle this challenge, our work employs reinforcement learning with complementary feedback from image, vectorized representation, and codes for visual fidelity, geometric accuracy, and code correctness.
Diagram Generation. Diagram code spans several widely used formats, including TiAZ, SVG, and template-baseee based libraries (Mermaid 2025). SVG provides the most primitive representation among these formats, but offers limited semantic clarity. Moreover, existing research on SVG generation has primarily targeted icons and anime characters (Li et al. 2025b Yang al. 2025). likely due to
2

---

Published as a conference paper at ICLR 2026
the complexity of scientific diagrams and the scarcity of high-quality SVG diagram datasets Roo- driguez et al. 2025a). In contrast, TikZ strikes a balance between semantic clarity and visual ex- pressiveness, with native support for mathematical notation and seamless export to vector formats such as PDF and SVG. DATikZ series (Belouadi et al. 2024a b 2025) collects large-scale TikZ. pro- grams from real-world sources like arXiv papers, establishing foundational resources for diagram generation (Wang et al., 2002).. Our work builds upon their collection methods and further intro- duces enhanced quality control and key data enhancement specific to diagram generation problems, including drawing order and leveraging comments as planning scaffolds.
Reinforcement Learning Post- Training has demonstrated remarkable success in refining the rea- soning capabilities and alignment of LLMs (Chu et al., 22025; Chen et al.] 2025). Among RL ap- proaches, rule-based methods like GRPO (Guo et al., 2025) have gained prominence due to their simplicity and effectiveness. This paradigm has been extended to visual content generation, where reward signals can be derived from the generated images (Jiang et al. 2025a Xue et al.] 2025). Specifically, [Rodriguez et al. (2025b) introduces rewards based on pixel-level L2 loss, DreamSim- based feature similarity (Fu et al. (203),, and code compactness for SVG generation. ChartMas- ter (Tan et al., 2025) evaluates the visual fidelity of the generated charts using CNN-based features together with key visual attributes extracted directly from the code. However, these reward signals limited in their accuracy in capturing the spatial-textual alignment and geometric features of diagrams. We introduce extraction-error-fiee spatio-textual and geometric rewards derived directly from visual primitives extracted from the vectorized representation of diagrams.
DaVinci
3.1 Overview
We formulate the diagram parsing conditional sequence generation task in the MLLM context.
Given an input image Lin the goal is to generate a TikZ code sequence Gpred = (fI...., .,....,. (t) that can be rendered into image Iprdd that faithfully reconstructs Lin. Formally, we employ MLLM parameterized by to model the conditional distribution p( PCpreed [mn. The optimal code sequence C Cped is obtained via autoregressive decoding:
II :=1
Cp pred arg max p(Cpred Lin 0) arg max CreotE ET
p(tiltees
Gpred ET
Here, T represents the space of valid TikZ drawing commands. The fidelity of the rendered image
measures the ultimate success of the generation, Ipred = Render(C (Cirea), to the original input J..
We trained DaVinci with two-stage framework: 1) cold-start initialization with supervised learn- ing of visual primitives and grammar rules with our curated TikZ30K (Sect. [32p: followed by 2) reinforcement learning for refining output diagrams' spatial-textual alignment, geometric accuracy, overall visual fidelity, and code correctness (Sect. 3.3
3.2 Dataset Construction for Cold-start Initialization
TikZ-30K distinguishes itself through three fundamental considerations that enable effective cold- start: (1) high-quality images with semantic distribution, (2) drawing order normalization, and (3) comment-rich annotations. We provide an overview here and more details in Appendix C
Data Collection. Our data pipeline begins with reproducing the collection process of the DATIAZ series (Belouadi et al., 2024a by 2025), since the don-distributable licenses of some underlying data sources prevent the public release of their complete data. To ensure strict temporal separation from the DATikZ.,s test set, which includes data from January 2024 onward, our training data restricted to sources published by December 2023, thereby eliminating the risk of contamination. We initially source 366,075 runnable TiAZ snippets from TEX arXiv papers, and curated GitHub repositories, rendering them into images for downstream processing. However, the collected data still contains substantial noise regarding code syntax and visual content, and lacks labels for their categorical distribution. leaving the semantic distribution of TikZ programs unclear.
Data Filtering. Through manual inspection, we identify recurring patterns of low-quality samples to derive set of heuristic filtering rules, such as truncated images due to LTTE overfull errors, where
3

---

Published as a conference paper at ICLR 2026
content extends beyond the defined page margins and is consequently clipped during compilation. The rule-based filtering reduces the dataset to 258,421 samples. We then employ Swwen22.5-VL 32B (Bai et al., 2025 to automatically assign semantic class labels and 5-point quality scores to each image, retaining only those with scores of 4 or 5, yielding final 225,648 high-quality samples.
Full details of the data distribution and filtering criteria are provided in Appendix
Notably, we identify two underexplored yet critical features to diagram generation: code ordering and descriptive comments, which directly impact model training effectiveness.
m
11
IV
(Anm Q-4.0
Jucte
V
2
WI
(Amm
312 312
Figure 2: Drawing order visualization of collected sequential diagram. (Left) Original code label- ing six blocks (I-VI). (Right) Block-by-block rendering results, revealing the noisy drawing order.
Code Reordering. In general-purpose programming languages like Python, code order is tightly constrained by syntax and execution dependencies. However, the rendering of drawing language like SVG and TikZ is largely independent of code ordering, except for variable declaration, presenting special data noises. For example, Figure 2 illustraates the ordering noise with the block-by-bloce rendering of sequential diagram in our collected data. The original code drawing begins with the center node m along with its outgoing edge to the right (I). It then abruptly shifts to render node 3, followed by nodes 2 and 1 in right-to-left order (II, III). Notably, for the two rightmost m nodes, intermediate edges are drawn before the nodes themselves (IV, V). The noisy drawing order does not affect the rendering result but is detrimental to the autoregressive language model. Specifically, different training samples may map similar visual contents (e.g.. a graph layout) to multiple, arbitrarily permuted code sequences, largely degrading the training effectiveness.
To address the ordering issue, we employ to reorder the TikZ codes, following a semantics-guided logically constructive drawing protocol. I presents the optimized code and block-by- rendering result, aligning with human in- tuition and logical process. Post-verification is conducted to ensure the consistency of the rendering results before and after reordering.
--5--------nnttuucctt (Qwen Team 2025)
Injecting Comments Planning Scaffold. Raw TikZ. code is often dense sequence of low-level drawing commands, lacking explicit structural or semantic cues except for connection relationships. While some collected codes contain comment annotations. they are often incomplete and lack con- sistency. This poses a significant challenge for models' global planning capability over complex diagrams. Without such scaffolding, the model prone to logical inconsistencies and omitted com- ponents, especially for long code sequences.
To mitigate this, we leverage LLMs systematically enrich the training data with comments that decompose the drawing process into semantically meaningful sub-tasks. For instance, in the ex- ample in Figure [T comments such as Start from the far left: draw the first circle, label "I", and connect it rightwards or Add brace annotation visually indicate that the rightward exten- sion covers n-m nodes explicitly state the model's 's current drawing intent. These comments serve as planning anchors that guide the model to complete the drawing process step by step.
To enable efficient start training while preserving representativenesss, we perform stratified sam- pling by token length over the 225,648 filtered samples, yielding a balanced subset of 58,000 sam- ples. This subset is split into two parts: 30,000 for SFT and 28,000 for RL. Of the 30,000 SFT samples, 29,859 passed cest-verifiiation after code augmentation, denoted TikZ30K.
4

---

Published as a conference paper at ICLR 2026
3.3 Rewarding Design for Diagram Parsing
Hybrid Rewarding Function
Input
This is picture of scientific figure. Generate LaTeX code that draws this scientific figure using TikZ......
Policy Optimization
Rhybrid Rpass + Rrext +
Rgcom PRin
T
Rollout N Times
Compile
Vectorized Representation
Render
Rendered Image
DaVinci
TikZ Code
Diagram Images
Error-free element verification
12
Texts
Geometric (line, curve, etc ...)
The reinforcement learning framework of Vinci.. We construct complementarity reward signals from the generated code, vectorized representation, and rendered image. Specifically, we ex- tract the textual and geometric elements from the vectorized representation in error-free manner.
Figure 3:
Following SFT, apply reinforcement learning to refine the LLM's ability to generate runnable and visually faithful TikZ codes from input diagram images. Specifically, we employ Group Rel- ative Policy Optimization (GRPO) (Shao al., 2024), a variant of Proximal Policy Optimization (PPO) (Schulman et al. (017) that estimates advantages through group-relative comparisons, elim- inating the need for an explicit critic model.
Given a prompt 7', the current policy (initialized from the model after SFT) generates set of G diverse candidate sequences 10 where each Aş corresponds to the TikZ code Ck. For each candidate, we compute hybrid reward Ryybnd and derive its advantage Å relative to the group's empirical performance:
(k(k) A hybrid - mean ( IG
std (1R()) (yybard 10
The computed advantage is used to update the policy following the GRPO objective, detailed in Ap- pendix B To effectively guide the RL training, design novel hybrid reward function specifically designed for diagram generation. Specifically, we construct signals from image I, vectorization rep- resentation V. code C, three different modalities. For each generated candidate C₂ from prompt Ti. the total reward (b))
hybrid is defined as a weighted sum of four complementary components:
Rhybrid Reeset Vin, Vprea) Rgonm (Vin, Vprea) + Ring (Tim (prea) Reass (preed)
Spatio-Textual Textual Reward
Geometric Reward
Image Fidelity
Compile Success
where we do not set special weights for each reward component. Diagrams mainly consist of textual and geometric elements; thus, we separately design explicit and effective signals for both of them. The individual reward components are defined as follows.
Spatio-Textual Textual Similarity Reward Reoxt. Optical Character Recognition (OCR) is commonly used to extract text contents and their corresponding bounding boxes from both images. However, OCR is error-prone for diagrams that contain diverse symbols and involve easily misrecognized graphi- cal elements, and thus may propagate errors the final rewarding signal. Appendix E.4 provides common failure cases we found when using the state-of-the-aa OCR models.
To address this, leverage the PDF-format vectorization representation generated by TikZ to tract the text content (Tp (Tpred, Tg:) and their corresponding bounding boxes (B Byx) in a error- free manner. Unlike rasterized images that rely visual recognition for text extraction, PDFs
5

---

Published as a conference paper at ICLR 2026
generated by TikZ retain the exact geometric and typographic metadata of every text object as tive vector elements. We exploit this property using the PyMuPDF (2024) library to directly access the text objects that contain the ground-truth text characters and corresponding bounding boxes. We then employ a two-step exact-then-vaguely approach. First, it greedily matches elements with iden- tical recognized text. Second, for the remaining elements, it uses the Levenshtein distance with an adaptive threshold to pair texts with minor OCR errors. In any case where one-to-many matches occur, the conflict is resolved by selecting the pair with the highest Distance-IoU (drot) (Zheng et al. 2020), ensuring geometric plausibility. Finally, the total reward R is calculated from all suc- cessful matches from both stages. The dioU' of each matched pair, originally the range [-1, 1], is transformed into a score of [0, I]. These scores are summed and then normalized by the maxi- mum number of elements in either the predicted or ground-truth set, yielding a comprehensive and bounded reward score:
diau (bp: bg) +
Rtext
(3)
max
B Spreal. Bgel)
2
(0p.by]EMann Matchbss
The full procedure is outlined in Algorithm Textual match results.
Figure
presents qualitative examples of the Spatio-
Geometric Similarity Reward Rgeom- Directly comparing rendered images using pixel-wise met- rics (e.g., Mean Squared Error SSIM (Wang al., 2004)) inadequate capture the underlying structural correspondence of geometric primitives.
To overcome these limitations, Rgeom assesses structural fidelity by directly comparing geometric elements. First, similar to the processing of textual elements, we use the P (2024) library to access the geometric primitives (Epred: Ege) from predicted and ground- PDFs, such as lines, rectangles, and circles, along with their attributes. Second, for each geometric type, we formulate a bipartite matching problem establish the optimal one-to-one correspondence between predicted and ground-truie truth elements. The matching is solved using the Hungarian algorithm, guided by type-specific cost function Clep, Eg) that measures the dissimilarity between a pair of elements. This cost is weighted sum of differences in key geometric attributes, including the normalized centroid distance, the relative size (area or length), and the orientation or aspect ratio.
Finally, the total reward is computed by aggregating the quality of all successful matches. The cost of each matched pair is transformed into a similarity score via an exponential decay function, rewarding pairs with lower geometric dissimilarity. These scores then summed and normalized by the maximum number of elements in either set to ensure the reward is bounded within [o, 1]. This formally defined as:
Recmm max
Σ E
exp(-k C(ep; eg)
( [Fprred EEgel)
where Matches is the set of optimal pairings, C'ep, eg) is the cost function for a pair of elements, and & is scaling constant. The complete procedure is detailed in Algorithm Figure 18 presents qualitative examples of the geometric element match results.
Image Fidelity Reward Rimg. We combine DreamSim (Fu et al. 2023) and Mean Squared Error (MSE) for measuring image fidelity in both feature and pixel space. DreamSim is a perceptual metric trained on human judgment data, making it well-suited for assessing overall visual similarity for diagrams. MSE is simple but effective in capturing absolute details.
Ring= = DreamSimmT, Iprea) + clip (1 (1-3)
1 Imorm 52
|
prod
||2- 11,
(5)
where / m = (1 - w represents the normalized image, and clip(æ, a, b) = minl min(maxxa (z, a), bounds the MSE signal within [11,
Compile Success Reward Rpase. We do not explicitly integrate a bonus value for compilation success. Instead, if generated TikZ program fails compile, we assign the minimum possible value to the other three reward components. This design ensures that non-rumnable code receives the lowest possible hybrid reward.

---

Published as a conference paper at ICLR 2026
4 Experiments
4.1 Experimental Setup
To rigorously evaluate the performance of various vision-language models Image-to-Tike TikZ trans- lation tasks, we conduct a series of controlled experiments comparing both proprietary and open- weight models. The evaluation focuses the models' ability generate syntactically correct, semantically faithful, and visually accurate TikZ code from input diagrams.
Cold start with supervised fine-tuning. We train the base model Owen2.5-VL-7B-- et al. 2025) on the TikZ-30K dataset for 2 epochs, yielding Da Danici-SFF--7B.
Bai
RL Post-training. We initialize the policy model with DaVinci-SF1-7B. We the GRPO algo- rithm with global batch size of 512 and rollout batch size of 256. We use rollout number of 10. The training performed 8 H100-80G for 500 steps, yielding DaVinci-7B, Detailed training settings are in Appendix E.3
4.2 Automatic Evaluation
Baselines. We compare VaVinci against a diverse set of baselines, including:1) Proprietary MLLMs;
2emini-2..-PPro [Comanici et al., 2025), GPT-5-Default (self-control the thinking efforts) (Ope-
nAl 2025), and Blaude-Sonneter
(Anthropic) 2025 2) Open Sourced
MLLMs: Qwen2.5-VL. (Bai et al., 2025) and GLM4.5V series (Team 2025): 3) Specialized TikZ-
generation models: DetikZiify-22-88 (Belouadi et al. 2025). DiagramAgent (Wei et al. 2025
Benchmarks. We report results the official test set of DATIKZEs (Belouadi et al.
2025 542
visually complex and diverse graphics selected from the whole dataset.
Metrics.
We evaluate performance at both code and image levels. At the code level, report the Pass@1 1 compile rate, Text Edit Distance (TED), and CrystalBI_EU (cBLEUU) (Eghbali & Pradel
2022 At the image level, we assess visual fidelity using DreamSim (Fu al. 2023). SigLIP (Zhai et al. 2023), Structural Similarity Index Measure (SSIM) (Wang et al. 2004). Mean Squared Error
(MSE). ) and LPIPS (Zhang et al. 2018). Additional metrics evaluating code efficiency are provided in Table due to space limitations.
Table 1:
Evaluation results of DaVinci against different models. Bold and underlined values denote the best and second-best scores. Arrows 1J indicate metric directionality.
Code
Image
Model
@ass@1
TED
cBLEU1 DSIM t SigLIP
SSIM MSE
LPIPS
Proprietary MLLMs
Gemini-2.5 2.5--i--..-Po---
1..5-Pro-Thinkiie Thinking
69.93
53.77
6.17
88.20
95.59
75.86
66.62
21.64
GPT-5-Defaull
72.88
53.17
3.22
83.78
93.79
73.73
73.57
25.37
Claude-Sonnet-4
84.87
54.33
3.90
83.81
92.64
73.45
72.69
24.93
Claude Sonud---Soneet-4Thiiinngg
86.90
54.38
3.31
82.89
92.87
72.21
73.89
25.80
Open Sourced MILLMs
Qwen2.5-VL-7B
59.59
$7.35
5.28
74.37
89.12
71.61
82.55
29,00
Qwen2,5-VL-32B
76.20
54.80
4.71
76.17
89.12
73.73
78.36
27.28
Qwen2.5-VL-72B
80.04
54.80
4.18
79.35
91.52
72.42
77.63
27.24
GLM-4,5V-106B-1122
67.90
54.72
3.42
79.33
91.36
73.87
77.52
26.37
GLM--.5V-Thinking
62.92
54.75
3.08
78.05
90.77
72.59
78.71
27.53
Specialized TikZ-generation MLLMS
DetikZify-V2-8B
78.60
$5.66
7.19
82,63
91.99
74.30
68.42
23,30
DiagramAgent-7B
57.75
56.85
5.55
70.60
87.39
72.30
84.34
29.28
DaVinci-SFT-7B
84.50
56.21
7.52
81.15
92.27
72.65
73.90
26.10
DaVinci-7B
97.60
55.13
6.57
84.83
93.93
73.65
61.81
22.32
4.3 Result Analysis
DaVinci-77 overtakes the best scores across all open-sourced models, and surpasses the leading commercial models like GPT-5 and Claude-Sonnet-4, Gemini-2.5-Pro presents better performance

---

Published as a conference paper at ICLR 2026
Input
DaVinci-7B
GPT-S-Defautt
Dlaude4-Sonn-Thiee Gemini-2.5-PPP 5-Pro-Think.
180
123
C-q-400
PUTT
Wineorell Francie
Eibauaced D bauiks
Larron
Figure 4:
Examples of model inputs and generated outputs from DaVinci-7B and the advanced commercial models.
than Da Vavci--B regarding certain metrics such as DreamSim and LIPIS, but with a significant gap in compile rate. We detail below the analysis of the results.
Compile Rate. DaVinii-SFT-1 achieves the third hirdht compile rate (84.50%), slightly below Maude-Sonnee-4-Thhee
(86.90%). Since the base model of DaVinci-FFT-7B is stronger than DetikZify- V2-8B (78.66) (78.60%) ) we conduct an isolated ablation study Sect. 4.5 to investigate the im- pact of our data strategy on compile rate improvements. After RL, post-training, DaVinci-7B attains a near-perfect compile rate (97.60%). The few remaining failure cases are mainly dense visualiza- tions like scatter plots, where the model over-produces data points, leading the output to exceed the context limit, In contrast, Gemini-2.5- strong performance other metries. Inspection of its compilation logs reveals frequent omissions of essential ыТTX library imports (c.g., decorations. groupplots, s sloped, shapes) and missing basic symbols (e.g., parentheses, math delimiters), which prevent successful rendering.
exhibits a notably lower compile rate (69.9 (999 despite its
8

---

Published as a conference paper at ICLR 2026
High Code Similarity Is Not Necessary. We find that specialized SFT models, DaVinci-SFT-7B and SrrkkZiff-V2-882 achieve the highest cBLEU scores, indicating greater lexical similarity to reference code. However, after RL training, DaVinci-7B's cBLEU score decreases while all other metrics improve, including visual fidelity and compile rate. This observation underscores a key insight: visually equivalent outputs be produced by syntactically diverse TiKZ. code. Thus, strict code-level similarity is neither necessary nor always desirable for high-quality diagram parsing.
To Think or Not to Think (Jiang al., 2025c). Unlike models that generate explicit reasoning traces before code output, DaVinii-7B uses inline code comments as lightweight planning scaffolds rather than separate reasoning steps. To assess the impact of explicit thinking, we compare thinking- enabled and non- non-thinking variants of models that support both modes, i.e., Claude-Sonnet-4 and GLM-4455V. Gemini-2.5-Prro and GPT-5 are only available their thinking variants. Surprisingly, we find that enabling explicit reasoning does not consistently improve diagram parsing performance. In fact,
shows significant drop in compile rate (62.92%) compared to its non- thinking counterpart (67. (67.90%). This suggests that for structured code generation tasks like diagram parsing, the act of producing code itself may serve as an implicit reasoning process, with each drawing command attending to specific visual elements in the input. We leave deeper investigation of this phenomenon to future work.
4.4 Human Evaluation
Settings. We perform human evaluation studies using Best-Wors Scaling (BWS) (Flynn & Marley, 2014), evaluating 100 items randomly sampled from the test set, in line with prior work (Belouadi ct al. 2024b) 2025). For each reference figure, four output images generated by different models are displayed side-by-side; students aged 23 to 29 years (y==2.883, std=2.23; 2 male, 4 female), are tasked to select the sin- gle best and single worst output from each set. Each evaluator compensated with approximately US$15 for their time. These pairwise selections are aggregated and converted into normalized scores ranging from- -1 (worst)
Figure 16 for the annotation interface. Six human evaluators, graduate
(best), computed as the difference between the proportion of times a model's output is chosen as best (Pbest) and the proportion chosen as worst (Pworst). Specifi- cally, we conduct two groups of human evaluations to ensure comprehensiveness: 1) Da VBn and the top three nonprropryy models according to automatic metric evaluation, i.e. DetikZify- V2-8B, Qwen2.5-V1L-7221 and DaVinei-SFT-7B; 2) DaVinci-7B and three proprietary models, i.e. Seeee-SSonntt---nniiee
Gemini2.5-Pro. Trinkiinninng..... GPTS-Default, and
Results. Table 2 and present the two groups of human evaluation results, which generally align with the automatic evaluation metrics. In the non-proprietary model group, DaVinci-7B (μ=0.365) achieves the highest score, outperforming all models. DaVinci-SFT-7B and Detikzify-V2-88 exhibit comparable performance, while Qwen2.5-VL-722 performs the worst, highlighting the potential improvement by scaling TikZ-specialliee models. Consistent with automatic evaluation, Gemini- ..-PPro-Tinkking (μ=0050) significantly outperforms all other models in both groups, showing its superior capability in this task. Notably, DaVinci-7B also demonstrates stronger performance than GPT-5-Default and Soauud-Soonet--thhnneee agreement among annotators using split-half reliability (SHR) (Flynn & Marley] 2014). The re- sulting SHR values (PGroup 1 =0.7227 and PGroup 2=0.7878) indicate strong inter-annotator agreement, supporting the reliability of our human evaluation results; see Appendix D.4 for calculation details.
in terms of Poest and Pworst. We further measure the
Model
Pbest Pwerst score std
Model
Pres Pwoest score std
Qwen2.5-
0.13 0.39 -0.26 0.06
0.58 0.08 0.50 0.10
DVtkkZ
0.25
0.30
-0.05 0.06
GPT-S-Default
0.13 0.26
-0.13 0.03
DaVinci-SFT-7B
0.16
0.21
-0.05 0.04
Sonrdd-Sonnet---Theee
0.10 0.45
-0.35 0.05
DaVinci-7B
0.47 0.11 0.36 0.03
DaVinci-7B
0.20 0.21 -0.01 0.06
Table 2: Human evaluation results of Group 1.
Table 3: Human evaluation results of Group 2.
4.5
Ablation Study
Code Reordering and Comments Injection. We first validate the effectiveness of code reordering and comment injection. We perform a full parameeer SFT on the base model Qwen2.5- --v VL-7B- Instruct for two epochs with different data settings: 1) OriginaI30K: the original codes of TiKZ-30K

---

Published as a conference paper at ICLR 2026
that not optimized regarding ordering and comment annotations; 2) Reordering30K: remove comments in TiKZ-30K while the optimized code ordering remains; 3) TikZ-30K. The training set- tings the same the cold start stage.
Our results show that reordering alone increases the compilation success rate by 9.04%f over the baseline (Original3OK), and additional comment annotations provide a further gain of 5.72% These findings underscore the critical role of both structural reordering and semantic annotations diagram parsing.
Model
Pass I
Baseline: Qwen2.5-VL-77
59.59
Original30K
69. 79.74
Reordering30K
78.78
TiAZ30K
84.50
Table 4: Comparison of Pass 1(%) across dif- ferent SFT datasets settings.
Ablation of Rewards. We validate the impact of different reward settings based on Da DaVinii-SFT-778 The baseline is combining MSE and DSIM rewards. The results are shown in Table showcasing the effectiveness of each reward component.
Table 5: Comparison of different rewarding settings.
Image
(sward(s)
DSIM
SigLIP
SSIM
MSE
LPIPS
Texual
Geometry 1
Base imig + pass))
85.00
93.67
73.07
64.58
22.94
37.23
41.44
Base + SSIM
84.67
93.47
73.58
64.89
23.03
37.45
41.87
Base + Rtex
84.85
93.91
73.61
63.35
22.44
41.58
42.12
Base + Reext + +R Rgeom
84.75
93.93
74.01
62.30
22.32
42.28
44.10
4.6 Case Studies
Figure presents qualitative comparisons between DaVinci-7B and leading commercial models. DaVinci-7B demonstrates superior precision in text placement, geometric alignment, and structural coherence. Additional visual results are provided in Appendix D.2
5 Conclusion
In this work, we introduced VaVinci, a novel multimodal large language model that advances sci- entific diagram parsing through two-stage framework combining supervised learning of visual primitives and reinforcement learning of structural syntax. We curated the high-quality TikZ33K dataset, featuring optimized drawing order and comments annotations as planning anchors to enable MLLMs to learn the visual-structural syntax of scientific diagrams more effectively. For reinforce- ment learning, designed hybrid reward function that leverages vectorized representations to provide signals for geometric accuracy and textual alignment during reinforcement learning. To- gether, these innovations enable DaVinci achieve state-of-the-art performance, outperforming both open-source MLLMs and leading proprietary models such as GPT-5 and Claude-Sonnet-4,
Data Release and License Information
Our data release strictly adheres to the licensing terms of the original sources from which ex- tract the TikZ code snippets. For code snippets sourced from permissively licensed platforms that allow redistribution and adaptation, directly release the original and optimized code, including the Creative Commons Attribution Licenses the GNU Free Documentation License or the MIT license for websites, GitHub repositories, and part of arXiv sources, with clear data source attribu- tion per code snippet. For the data where the original license limits redistribution (i.e., the arXiv.org perpetual, non-exclusive license]). we not redistribute the raw source. Instead, we provide diff files and reproducible scripts that enable researchers to locally reconstruct the optimized code in full compliance with their licensing terms, without extra time or financial costs for code optimization. This approach ensures both legal compliance and research reproducibility.
httpp::/www.cr httes///ww..gm..rrr/iemmee////..
html
10

---

Published as a conference paper at ICLR 2026
Acknowledgment
This paper is partially supported by National Natural Science Foundation of China (NO. 62572415, U23A20313, 62372471) and The Science Foundation for Distinguished Young Scholars of Hunan Province (NO. 2023JJ10080).
References
Anthropic. Claude sonnet. http://ppppp/......t..o.ooooo/oa
2025.
Shuai Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin Ge, Sibo Song, Kai Dang, Peng Wang, Shijie Wang, Jun Tang, et al. Qwen2.5-VL technical report. arXiv preprint 1ath:2502.13925. 2025.
Jonas Belouadi, Anne Lauscher, and Steffen Eger. AutomaTikZ: Text-guided synthesis of scientific vector graphics with TikZ. In Proc. ICLR, 2024a.
Jonas Belouadi, Simone Paolo Ponzetto, and Steffen Eger. DeTikZify: grams for scientific figures and sketches with TikZ. In Proc. NeurlPS, 2024b.
Synthesizing graphics pro-
Jonas Belouadi, Eddy 1lg, Margret Keuper, Hideki Tanaka, Masao Utiyama, Raj Dabre, Steffen Eger, and Simone Paolo Ponzetto. Tikzero: Zero-shot text-guided graphics program synthesis. In Proc. ICCV, 2025.
Hardy Chen, Haoqin Tu, Fali Wang. Hui Liu, Xianfeng Tang, Xinya Du, Yuyin Zhou, and Cihang Xie. Sft or rI? an early investigation into training rl rl-like reasoning large vision-language models. arXiv preprint 250iv:2504. 1468, 2025.
Tianzhe Chu, Yuexiang Zhai, Jihan Yang, Shengbang Tong, Saining Xie, Dale Schuurmans, Quoc V Le, Sergey Levine, and Yi Ma. Sft memorizes, generalizes: comparative study of foundation model post-training. arXiv preprint arXi::2501. 2025.
Gheorghe Comanici, Eric Bieber, Mike Schaekermann, Ice Pasupat, Noveen Sachdeva, Inderjit Dhillon, Marcel Blistein, Ori Ram, Dan Zhang, Evan Rosen, et al. Gemini 2.5: Pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capa- bilities. arXiv preprint arXiv:2507.06261. 2025.
Aryaz Eghhali and Michael Pradel. Crystalblew: precisely and efficiently measuring the similarity of code. Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering, pp. 1-12, 2022.
Figma. Figma. https: www. figma.com
Terry N Flynn and Anthony AJ Marley. Best-worst scaling: theory and methods. In Handbook of choice modelling, pp. 178-201. Edward Elgar Publishing, 2014.
Stephanie Fu, Netanel Tamir, Shobhita Sundaram, Lucy Chai, Richard Zhang, Tali Dekel, and Phillip Isola. Dreamsim: Learning dimensions of human visual similarity using synthetic data. arXiv preprint arXiv:2306.0934. 2023.
Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang. Xiao Bi, et al. Deepseek-RI: Incentivizing reasoning capability in 1lms via reinforcement learning. arXiv preprini 2501. 12948, 2025.
Anwen Hu, Yaya Shi, Haiyang Xu, Jiabo Ye, Qinghao Ye, Ming Yan, Chenliang Li. Qi Qian, Ji Zhang, and Fei Huang. mplug-paperowl: Scientific diagram analysis with the multimodal large language model. In Proceedings of the 32nd ACM International Conference on Multimedia, pp. 6929-6938 2024.
Dongzhi Jiang, Ziyu Guo, Renrui Zhang, Zhuofan Zong, Hao Li. Le Zhuo, Shilin Yan, Pheng-Ann Heng, and Hongsheng Li. T2i-r1: Reinforcing image generation with collaborative semantic-level and token-level cot. arXiv preprint arXiv:2505.00703, 2025a.

---

Published as a conference paper at ICLR 2026
Lingjie Jiang, Shaohan Huang, Xun Wu, Yixia Li, Dongdong Zhang, and Furu Wei. Viscodex: Unified multimodal code generation via merging vision and coding models. arXiv preprint 05t1:25508009445.. 2025b.
Lingji Jiang, Xun Wu, Shaohan Huang. Qingxiu Dong, Zewen Chi, Li Dong, Xingxing Zhang. Tengchao Lv, Lei Cui, and Furu Wei. Think only when you need with large hybrid-reasoning models. Xrviv preprint MrXXi::5505.46311 2025c.
Aniruddha Kembhavi, Mike Salvato, Eric Kolve, Minjoon Seo, Hannaneh Hajishirzi, and Ali Farhadi. A diagram is worth a dozen images. European conference on computer vision, pp- 235-251. Springer, 2016.
Bingxuan Li, Yiwei Wang. Jiuxiang Gu, Kai-We Chang, and Nanyun Peng. Metal: multi-agent framework for chart generation with test-time scaling. In Proc. ACL, 2025a.
Jinke Li, Jiarui Yu, Chenxing Wei, Hande Dong, Qiang Lin, Liangjing Yang, Zhicai Wang, and Yanbin Hao. Unisvg: A unified dataset for vector graphic understanding and generation with multimodal large language models. In Proc. ACM MM, 2025b.
Mermaid. Mermaid chart. [ttpess/www...erma...ccaaatt.t..
2025.
OpenAl. hopp://teeeeeeeeeaacco///////err 2025.
PyMuPDF. Pymupdf, /ttpp/////tttuu..oooo//////////p 2024.
Qwen Team. Qwen3 rechnicll /R/tttppsr///x/////////////////
Juan A Rodriguez, Abhay Puri, Shubham Agarwal, Issam H Laradji, Pau Rodriguez, Sai Rajeswar, David Vazquez, Christopher Pal, and Marco Pedersoli. Starvector: Generating scalable vector graphics code from images and text. In Proc. CVPR. pp. 16175-16186, 2025a.
Juan Rodriguez, Haotian Zhang, Abhay Puri, Aarash Feizi, Rishav Pramanik, Pascal Wichmann, Arnab Mondal, Mohammad Reza Samsami, Rabiul Awal, Perouz Taslakian, et al. Rendering- aware reinforcement learning for vector graphics generation. In Proc. NeurlPS, 2025b.
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford. and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06344 2017.
Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, al. DeepSeekMath: Pushing the limits of mathemati- cal reasoning in open language models. arXiv preprint arXiv:2402.033000 2024.
Chufan Shi, Cheng Yang, Yaxin Liu, Bo Shui, Junjie Wang, Mohan Jing, Linran Xu, Xinyu Zhu, Siheng Li, Yuxiang Zhang, et al. ChartMimic: Evaluating Imm't 's cross- modal reasoning capability via chart-to-code generation. In Proc. ICLR, 2025.
Chenglei Si, Yanzhe Zhang, Ryan Li, Zhengyuan Yang, Ruibo Liu, and Diyi Yang. Design2code: Benchmarking multimodal code generation for automated front-end engineering, arXiv preprint arXiv:2403.33163, 2024.
Wentao Tan, Qiong Cao, Chao Xue, Yibing Zhan, Changxing Ding, and Xiaodong He. Chartmas- ter: Advancing chart-to-code generation with real-world charts and chart similarity reinforcement learning, arXiv preprint arXiv:2508.17608 2025.
GLM-V Team. Glm-4.5v and glm-441 v-thinking: Towards versatile multimodal reasoning with scalable reinforcement learning, 2025.
Ke Wang, Junting Pan, Linda Wei, Aojun Zhou, Weikang Shi, Zimu Lu, Han Xiao, Yunqiao Yang. Houxing Ren, Mingjie Zhan, et al. Mathcoder-vl: Bridging vision and code for enhanced multi- modal mathematical reasoning. Proc. ACL Findings, pp. 2505-2534, 2025.
Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero Simoncelli. Image quality assessment: from error visibility structural similarity. IEEE TIP, 1344)6600-612, 2004.
12

---

Published as a conference paper at ICLR 2026
Jingxuan Wei, Cheng Tan, Qi Chen, Gaowei Wu, Siyuan Li, Zhangyang Gao, Linzhuang Sun, Bihui Yu, and Ruifeng Guo. From words to structured visuals: A benchmark and framework for text- to-diagram generation and editing. In Proc. CVPR, pp. 13315-13325, 2025.
Zeyue Xue, Jie Wu, Yu Gao, Fangyuan Kong, Lingting Zhu, Mengzhao Chen, Zhiheng Liu, Wei Liu, Qiushan Guo, Weilin Huang, et al. Dancegrpo: Unleashing grpo on visual generation. arXiv preprint arXiv:2505.0788
2025.
Yiying Yang, Wei Cheng, Sijin Chen, Xianfang Zeng, Fukun Yin, Jiaxu Zhang, Liao Wang, Gang Yu, Xingjun Ma, and Yu-Gang Jiang. Omnisvg: A unified scalable vector graphics generation model. arXiv preprint urXiv:2504.06266 2025.
Sukmin Yun, Rusiru Thushara, Mohammad Bhat, Yongxin Wang. Mingkai Deng, Jinhong Wang, Tianhua Tao, Junbo Li, Haonan Li, Preslav Nakov, et al. Web2code: A large-scale webpage-to- code dataset and evaluation framework for multimodal 1lms. Proc. NeurIPS, 37:112134-12157, 2024.
Xingchen Zeng, Haichuan Lin, Yilin Ye, and Wei Zeng. Advancing multimodal large language models in chart question answering with visualization-referrned instruction tuning. IEEE TVCG, 31(1):525-535 2025. doi: 10.1 1..10//VCC..222444555555
Xiaohua Zhai, Basil Mustafa, Alexander Kolesnikov, and Lucas Beyer. Sigmoid loss for language image pre-training. In Proc. ICCV, pp. 11975-11986, 2023.
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as perceptual metric. In Proc. CVPR, pp. 586-595, 2018.
Xuanle Zhao, Xianzhen Luo, Qi Shi, Chi Chen, Shuo Wang, Zhiyuan Liu, and Maosong Sun. Chart- Coder: Advancing multimodal large language model for chart-to-code generation. arXiv preprint arXiv:2501.06558, 2025.
Zhaohui Zheng, Ping Wang, Wei Liu, Jinze Li. Rongguang Ye, and Dongwei Ren. Distance-iou loss: Faster and better learning for bounding box regression. Proc. AAAI, volume 34, pp. 12993-13000, 2020.
13

---

Published as a conference paper at ICLR 2026
Contents of Appendix
LLM Usage
15
GRPO Formalization
15
Data
15
Data Collection
16
C.2 Data Filtering
16
Data Category Distribution
18
Code Augmentation
21
C.4.1
Example 1
22
C.4.2 Example 2
23
C.4.3 Example 3
24
D
Evaluation Details
26
Evaluation Prompt
26
D.2
Results Showcase
26
D.3
Code Efficiency Metric
27
D.4
Additional Human Evaluation Details
28
D4.11
Interface for Human Evaluation
28
D.4.2
Agreement Analysis
28
D.5
Additional Automatic Evaluation
29
D.6
Additional Data Ablation Study
29
Reward Design
30
E.
Spatio-Textual Similarity Rewarding
30
Geometrie Similarity Rewarding
32
E.3
Training Details
35
OCR Recognition Missing Cases
35
14

---

A
LLM Usage
Large language models (LLMs) were employed solely for auxiliary purposes, including language polishing, minor code debugging, synthetic data generation, and assistance with experiment eval- uation. They were not involved in the research design, the methodological development, or the substantive writing of the article. Consequently, the use of LLMs does not constitute an intellectual contribution to the core content of this work.
B
GRPO Formalization
Group Relative Policy Optimization (GRPO) (Shao et al. (024) overcomes a key limitation of tra- ditional reinforcement learning methods, such as PPO (Schulman al. 2017). which rely on sep- arate, computationally expensive critic model to estimate value functions. Instead of using critic, GRPO evaluates policy performance by comparing responses within groups, enabling reward-based learning without explicit value estimation and thereby simplifying the training pipeline.
Given an input query g, GRPO samples G candidate responses {01, o2 from the current (old) policy Taw Each response is scored using predefined reward function, yielding rewards (ri, ...). To capture relative performance within the group, GRPO normalizes these rewards into advantages:
A, Ti mean (Fi...
std fr rc])
where mean(-) and std(.) denote the empirical mean and standard deviation of the group rewards, respectively. During training, GRPO maintains trainable policy me and frozen reference model The. The policy is updated by maximizing the following group-based objective:
(e(0))))
JGRPO (0)
Σ
Ai K.C (TT((:l4) mor((rll)) Taa (0:
N
where N is the number of responses per group (i.e., N = G), and / is hyperparameter controlling strength of the KL penalty. This objective encourages the policy to assign higher probabilities to responses with above-average rewards within each group, while constraining deviations from the reference model to ensure stable training.
C
Data
Data Collection
Data Filtering
Data Augmentation
+ TEX.SE
Rule-based filtering Overfull
Normalization
Redundant packages
Decimal truncation
compilation check
LLM-as-a-Judge 5-likert score Discard 1--3
Optimization
valid Tikz- image pairs
Reordering
Failed
Comments rewrite
Figure 5: The overall data processing pipeline for constructing the dataset. It consists of three stages: Data Collection, Data Filtering, and Data Augmentation.
Back to Table of Contents
15
Back to the First Page

---

C.I Data Collection
Our data collection pipeline builds upon the DATIKZ series (Belouadi et al., 2024a b 2025), which collects TikZ code from TEX.SE, arXiv papers, and curated GitHub repositories. For arxiv papers, we crawl their source ISTEX files and only save those that contain tikz cru environments. We then extract the corresponding TikZ code blocks via regex matching. Beyond arXiv, our scripts also include routines for collecting data from other sources (TEX.SE, and curated GitHub repositories), ensuring a unified and reproducible pipeline. All extracted snippets are compiled into figures, and samples that fail to compile or render blank images are discarded, yielding an initial dataset of 366,075 valid image-TikZ code pairs (306,691 from arXiv, 4,961 from curated repositories, and 54,423 from TF).
C.2 Data Filtering
Tikz is a widely adopted drawing language that is not only integrated into ETEX editors but also supported by various graphics platforms and tools. Due to its rich library ecosystem and extensibil- ity, TikZ can generate figures far beyond regular SVG-like graphics, finding applications in slides, animations, posters, and other contexts. This versatility, however, also leads broad spectrum of categories and structural variations in TikZ-generated images. Such diversity inevitably introduces substantial challenges in data quality control.
In this work, we focus exclusively on static, single-page TikZ figures, and therefore apply series of filtering steps to discard irrelevant or unsuitable cases. Our data filtering pipeline, illustrated in Fig. 5, proceeds as follows:
Rule-based filtering: We exclude low-quality or unsuitable samples according to the fol- lowing rules:
(a) Code containing dynamic renderings such as animations, or multi-page layouts out- side the target scope;
(b) Template-base
figures with unresolved references (e.g., empty figure placehold- ers) that may mislead models during training;
(c) Overly cluttered outputs, identified by pdflatex logs reporting overfull boxes or oft-ge-range errors;
(d) Figures violating density constraints, i.c., more than 16 points per addplot series or more than 96 points single axis.
After rule-based filtering, the initial collected dataset is reduced from 366,075 to 258,421 samples.
2. LLM-based filtering: After the rule-based stage. we further use the Qwen2.5-VL-322 model to score each figure a scale of 1-5, considering information density, structural clarity, stylistic richness, and suitability as training samples. The score distribution demon- strates the high quality of our dataset: 0.07% of samples receive score of 1, 1.47% score 2, and 11. 14% score 3, while the vast majority are rated highly, with 87.14% scoring 4 and 0.17% scoring 5. We filter out all figures with scores 1-3 and retain only those rated 4 or 5, resulting in 225,648 high-quality samples. We also provide the evaluation prompt in Fig, 6
We now provide an overview of how the initial 366,075 valid TikZ-image pairs were progressively refined into the final optimized TIKZ-30K dataset, accompanied by statistical analysis at each stage. Token statisties are reported separately for pure code tokens (excluding comments) and pure com- ment tokens. For each stage, we report the minimum and maximum token lengths per sample. Although we not apply token-length-
filtering before stratified sampling, as even extremely long samples (up to 1,634,716 tokens) can be syntactically valid and compilable, we exclude sam- ples exceeding 14,096 tokens when computing the average, minimum, and maximum token lengths to reduce distortion from outliers.
The results Table MableG indicate that:
The stages of 1. Forbidden- -eyword filtering 4. Decimal-rounding refinement, 5. LLM- based quality scoring, and 7. 30K randomly sampled from 58K show minimal impact average token counts, indicating that these steps primarily filter subsample without
Back to Table of Contents
16
Back to the First Page

---

Table Statistical evolution across refinement stages. Note: #Samp. number of samples; Code/-
Comm. tok. average pure code/comment tokens; #Long samples >> 14,096 tokens (excluded from mean/min/max calc.).
Stage
#Samp.
Code tok.
Comm tok.
Min/Max tok.
#Long
0. Initial extraction
366,075
731.15
11.89
25/14,094
3,269
1. Forbidden-key filtering
303,673
732.04
10.46
25/14.094
2,947
Density-constrale filtering
298,699
696.10
9.57
25/14.087
1,650
3. Filtering via pdflat pdflatex compilation logs
258,421
625.91
8.48
25/14.087
890
4. Decimal-rounding refinement
258,421
617.29
8.48
25/14,087
888
5. LLM-based quality scoring
225,648
617.97
8.47
25/14,087
746
6. Unequally spaced token-bin samp, (58K)
58,000
758.44
11.58
32/4,092
7. Random samp. (30K)
30,000
758.71
11.40
35/4,091
8. Final TiAZ30K
29,859
777.85
84.56
60/4,178
substantially altering the underlying code complexity distribution. This aligns with expectations.
2. Density-constrale filtering significantly reduces the average code token length (from ~732 ~696), while 3. Filtering via pdflatex compilation logs causes further sub- stantial decrease (to ~~626 tokens). These notable changes are compliant with our ex- pectations, the removed samples often represent data points that exceed the reasonable scope of the diagram-to-cott -o-coddettooeeeeeee task. For instance, the density filter removes diagrams with overly dense coordinate data (e.g., attempting accurately reconstruct positions for log filtering eliminates cases leading to truncated
100 points). Similarly, the pdflatee images due LaTeX overfull errors, where content extends beyond the defined page mar- gins and is consequently clipped during compilation. Removing these overly complex technically flawed samples ensures the dataset's focus on learnable and reproducible diagram -o-cdde mappings.
6. Unequally spaced token-bin sampling intentionally reshapes the token-length distribu- tion, which explains the increase in average pure code tokens from ~-688 to 758.
8. Final optimized TikZ30K results in dramatic increase in comment token length (from
~11. to 84.6 on average), as intended.
Overall, no unexpected data distortion was introduced throughout the pipeline: all observed changes in token statistics are consistent with our design intentions, reflecting targeted filtering of overly complex or invalid samples beyond the scope of the diagram-to-code task.
Back to Table of Contents
17
Back to the First Page

---

Prompt for Figure Quality Score Judgment
System Prompt:
You are an expert image quality evaluation and LLM training data curation. Your task is to rate the visual quality of technical figures (rendered from TikZ code). Your evaluation will be used to construct high-quality dataset for improving multimodal LLMs' performance on Image-to- TikZ code generation. Focus only on the image itself. Do assume the ligure must follow specific type (chart, math diagram, flowchart, etc.).
User Prompt:
Here is a figure. Please analyze and give a score from to according to the following rules:
I (Very Poor
Not usable for training):
The figure visually incoherent severely degraded. Key elements (text, shapes, lines, labels) unreadable, missing, or cluttered that no meaningful structure can be perceived. May appear as random fragments, noise, or broken rendering. No reliable visual cues for an MLLM to learn from.
2 (Poor - Marginal training value):
The figure is structurally incomplete, visually confusing, overly simplistic. - If overly simple (e.g., single shape, minimal text, trivial layout), it provides meaningful structural stylistic patterns for an MILM learn from, even if rendered correctly. elements, unreadable text, broken layout). it lacks sufficient reliable cues for the model to reconstruct the underlying TikZ. structure. In either case, the image fails to serve as a useful training sample: it is either too trivial to he instructive too corrupted to be recoverable.
If visually degraded (e.g., overlapping
3 (Fair Acceptable but needs improvement):
The figure conveys a clear structure and contains readable elements, suffers from noticeable visual flaws: Text is cramped or low-contrast; Layout is crowded or unbalanced: Some components are ambiguous or poorly spaced. Suitable for training only with caution - visual cues exist, but are suboptimal.
4 (Good Strong training sample)
The figure is visually clear, well-organized,, and complete. Minor imperfections may exist (e-g.. slightly tight spacing, non-optimal label placement), but all key elements are legible and logically arranged. Provides sufficient, unambiguous visual information for an MLLM to learn structural and stylistic patterns from.
5 (Excellent Ideal training sample)
The figure visually polished, highly legible, and structurally exemplary. All elements (text, lines, shapes, labels) are crisp, well-spaced, and harmoniously arranged. Color, contrast, and layout support immediate comprehension. Represents the gold standard for what an Image-to- TikZ model should aim reconstruct.
Output Format (always follow this structure): Description: 1-2 sentences what the figure shows.
Overall evaluation: Write to 4 sentences explaining the overall quality and why you assigned this score.
Score: Final rating the format Score: X
Figure 6: Prompt template for figure quality score judgment.
C.3 Data Category Distribution
To better characterize the dataset after filtering, we employ the Qwen2.5-VL-322 model to perform large-scale categorization of all rendered figures. The resulting distribution, presented in Fig. 7 demonstrates that our collection spans broad spectrum of TikZ figure types, including flowcharts. scientific diagrams, plots, and graph structures. This categorical diversity ensures that the dataset not only captures a wide variety of visual and structural patterns but also provides richer supervision signals. Consequently, such heterogeneity is expected enhance the robustness and generaliza- tion capacity the downstream model. We provide image examples of different categories in the collected TikZ dataset in Fig. and the complete classification prompt in Fig. 9
Back to Table of Contents
18
Back to the First Page

---

Geometry
Physica (4.20%)
Buclidean Geometry (3.28))
Analytic Geomeby
Commutative (6.58%)
Machines (3.11%)
Chart (8.06%)
Mixed (3,77%)
Calculus 10 99%)
Herrarchica structure 11 (1.76%)
Flawwharts 93-3351
Algorithim Graphs (1.72)
Group Theory Diagrams (0.82%)
Graphs
Chemistry 11.27%)
NNtworrs (0.71K)
Dircuits (1:205)
Trigonometry (0, (0.24%)
Laycur Ui (0.99%)
Figure 7: Overall category distribution of the collected TikZ dataset.
solid geometry
trigonometry
analytic geometry
euclidean geometry
calculus diagrams
commutative diagrams
networks
chart
layouts ui
physics
circuits
chemistry
H C C
H
This is wrong!
state machines
algorithmic graphs
abstract graph
start
(4]
hierarchical structures
group theory
flow chart
Bail
Bui
B
D
D1
Figure 8: Examples of different categories in the collected TikZ dataset.
Back to Table of Contents
19
Back to the First Page

---

Prompt for Category Classification
System Prompt:
You are an expert classifier for technical figures. Given ONE image, your task is to assign to exactly ONE of the most specific categories from the predefined taxonomy. Focus only on the image itself without making assumptions about its context.
User Prompt:
Here a figure. Please determine the most appropriate category according the following taxonomy:
Categories with guidance:
analytic geometry: coordinate systems, function plots, vectors, points
calculus diagrams: limits, derivatives, tangents, integrals, Riemann sums
cuclidean geometry: constructions with shapes, angles, proofs
solid geometry: 3D solids, polyhedra, cones, spheres
trigonometry: unit circle, triangles, trigonometric functions
abstract graphs: nodes and edges, connectivity, theoretical graphs
algorithmic graphs: shortest paths, spanning trees, flows
state machines: finite automata, states, laheled transitions
commutative diagrams: category theory objects and arrows group theory diagrams: Cayley graphs, subgroup lattices
flowcharts: process steps, decision diamonds, arrows, sequences
hicrarchical structures: trees, org charts, syntax trees
networks: computer data network topologies
chemistry: chemical structures, rcactions, mechanisms
circuits: electronic schematics, logic gates
layouts ui: UI wireframes, document layouts, dashboards
physics: free-body diagrams, optics rays, electromagnetiimm, Feymman/tensors
chart: scientific charts with axes, ticks, legends
mixed: ambiguous or multi-type diagrams combining categorics
Decision Rules:
Choose the single most specific category; prefer domain-specific (e.g., physics, chemistry) over generic (e.g., graphs); mixed if multiple distinct types coexist.
Output Format:
("labol": "<category>", "bricf": "<=20 words"}
Figure 9: Prompt template for category classification.
Back to Table of Contents
20
Back to the First Page

---

C.4 Code Augmentation
We tokenize all TikZ code snippets from the filtered dataset using the Qwen-2.5-VL. series tokenizer and analyze their token-length distribution. As shown Figure [0] the majority of figures contain fewer than 600 tokens. To ensure balanced representation across different complexity levels, we apply stratified sampling based on predefined token-count bins: (0, 200], (200. 400], (400, 600), (600, 800], (800, 2000], and (2000, 4096]. This process yields total of 58,000 training samples. These are then randomly divided into 30,000 samples for SFT and 28,000 samples for RI..
Normalization. We perform a manual audit of the collected TikZ code snippets, focusing draw- ing order, organizational structure, and the presence of redundant or unnecessary package or style declarations. Our analysis reveals several recurring issues: (1) disorganized code structure lacking clear modularity, with node declarations and drawing commands arranged in ways inconsistent with human cognitive expectations; (2) redundant package imports and style definitions; and (3) insuffi- cient or absent annotations, which obscure the intended purpose and functionality of the code; and (4) excessively long decimal representations. To normalize the decimal representations, we round each decimal number to four decimal places. For example, 10 0 000000001 rounded to 10. 00.
Optimization. To further enable model internalize code organization and drawing sequences that mirror human reasoning habits, we leverage the Swwe3--Coder-48B -350B--33BInnttruce model to systematically reorder and refine code samples. During the process, redundant references are moved to reduce noise, and scaffold-like comments are inserted a natural, incremental style. These comments act as both inline explanations and cognitive signposts of human drawing intent. This combination of structural refinement and reasoning- cassening-oriented oriented commentary yields clearer exem- plars for training and helps bridge the gap between raw TiKZ code and the natural planning patterns humans follow when constructing figures.
Post- vest-verification. After optimization, the refined code is re-rendered to generate a new image. We then compare this rendered output against the original figure using the mean squared error (MSE) to quantify similarity. For cases where rendering fails or where the visual discrepancy exceeds pre- defined threshold, the code is passed back to the model for iterative correction. This loop continues until the code compiles successfully and the rendered image aligns with, or closely approximates, the original, with a maximum of three iterations. For example, after three rounds of iterative refine- ment on 30000 samples, the overall success rate improved from 94. 94.45% to 98.28%, and finally to 99.53%, yielding final high-quality dataset of 29,859 samples. This post- resifieriiiatioo stage ensures consistency between optimized code and the intended visual semantics of the original figure.
As discussed in main results, the incorporation of reordered and annotated code samples, which serve as implicit "planning scaffolds", leads to substantial improvements in model performance. Examples of code augmentation are shown in Fig. II Fig. 12 and Fig. 13 to illustrate our approach. The exact prompting strategy is provided in Fig.
Thkion length disoribution
JMh
2.0
1
T5
Figure 10: Token length distribution the dataset after filtering. The distribution strongly domi- nated by short sequences (fewer than 600 tokens), leading to skewed and imbalanced dataset. Such an imbalance may bias the model toward short inputs that typically represent simpler visual patterns.
Back to Table of Contents
21
Back to the First Page

---

C.4.1
Example 1
Vaempankage adpaperi [article)
It afsaowrl (artioln)
Aupepachage larmathh
Remove
Vueee tbebbbary decorasions. wwt.soopspspspaiiigggg..
Yaaepachape (tkke)
Vapettkke Lirray accowe)
redundant
Mbegini document)
packages
(csepachape (1kc waclldde de)
(begini ttkepiitt (acalenb.7C)
Sueet sboaaryy deecaras iontarsttonn.... warkingg arroct.
Lseet, Jike library ou owly clapeos buclecoundss Vameet Libeaay decosatiion www.spp Laciigg
stazt Zoom: the for leftr dice the liese cicele,
connect ziptitmasta
Vdraw
luset:teslbbbaryy cale, tceen, pasttioning, aecons, stapes, shapes apw.t.
Idzaw (-4.3, (.... node (1footsotentsw (210))
Idzaw (-4,3) (-4-4,3)
12
13 shadows, alt decoratioons wat.sseppepppaingggg.
neat cirate cte obain, labeled 12% 3200
poo.ppor:..gg scapes.819c)
connected
right
Vdzae
Adzaw 6-3.8,-0.5 mode [1teetsoteeteee120/1
26
Ubeginl oo cocument)
Vdzaw 6-2.3/01
2-2,2,217
16
Iben thizd ciecie, zabeled 137, contincing the
Voegin
28
vdeaw 00.4.00 10.3 10.3,01
Enhanced
Vdzau (-3.4,01 strete 10.40m3
Vizaw (-2.4,-0,5 99 mode [Xfoetiottoleee155511
19
21
Udeaw 20.01 elecic 10 s
with clearer
Vdeaw < (1.8201
2 2,
3.81 made /Ktootonteniia
Use dota augpert LoV auquence Avapa going
(dotall;
(deaw (32200 nade /Vfoetnotariza
doca
Adzaw (-2.4,51
3,2,2,3);
25
Ideaw (-2-4,01 cicole 10.4
comments
elaos the cencral oicole as posatiio this aoce
26
Udeam (-2:4,-0.30) node (Voortntess 12
the anolor of the diagrae
(-2-5.01
(0.01 eteste 13, femiy
29 Vdeaw (-2.8,-0.95 nods /Vfootnotestee 12
Vdzao (0.4.0)
3)r
30 Ideam (-4,3) (-4.4,0);
Ha Above tada cantral ciacie, edd anall acaba to hint
(deam (-4-3,0) ctente 20.-4
suztipla upoard connect
(-1.9,-0.99)
Vdeae 00.08,5.41
20.05,0.81,
36 vdraw 02.8,0.011 - 03.4,0.081,
Vdeaw (0.0.4) 10,0.80x
35 ideam (2.8, 0.05) 12.4, 0.080;
Idzes (0.0.3)
1..2.0.772
(deaM (2.01 13.2,0.2):
Ideas (0.0.3)
10.2,3.13;
(3:2,-8.21;
rop, aepharizing
Vdeaw (2.4,0) oisole (0.4
zole, Jabel *J*
19 Udeaw 22-5.00
oirote 10.40m)
Vdeas 1.30 1eos Lili-reatst1 oirote 20.00231
25
40 Udeam (2-4.-0.81 zode (Voomiteeese bn811s
Vdeaw (0,21 zode Moootnoessiee (8131))
(2.8.-b.1 zode (Voootnobassee 0o811s
aa Add brace amootation
that the
41 ideaH (-1-2,0) mode (VZootnoteaize (dotally
Idzaw [decszace, decorationn traae, [coda
46 (deam (-1-6,8) -- (-2,4))
(0-23)3.21 sn (2.4,0.33
45
uuras edge
yazaw (1-36,3.31 made (NEostndeasis (dn-ad))
again,
Vdeaw 08.04.0.41
00.02.0.817
48
ideam (S.0.4)
10,0.4):
Idzaw (1.2.0) nods //Bootnotesioe/ (ddoaa
49
(deaw (C.Du5) 1-D:2,0.71;
Idzaw (3.4,0) 12,0):
(draM (6.0-5) 10.2,0.312
Now conatrune the doible-1ink seructures ctrate
(6.4-2)
Vdeaw co co
"Mfottotassien
Vdeaw (2.4,00 oirole (3,03))
53
Vaeaw 62.4,-5.88 mede (Atootmetsnite
54
(deaw (ocooratee, decocat lonmi ocace, anp sooeengge 11
Vaees 8, 0-0 18.4,0.08)
(2.22,3.51 so 22.300
(2.0.-8.003)
(2.4,
(Afootnsbaaize (53
diagunal affect
12-
17 Land [tkrpp
IdzaN (2,0) 13,2,0,20
49
Vdeaw (3,0) 13.2,-0.91)
(endidoccment)
Finisn with sightmose claete, also labeled
Idzaw (5.0,0) pinsle (2.4e91;
idzaw (3.0,-6.0) 6.00 mode (MBootnccasssee
tenditikepictueel
Original Code
Vend docomant)
Reordered Code
Original Code Drawing Order
N
IN
m
I
V
VI
Augmented Code Drawing Order
IN
IV
Vl
Figure 11: Comparison before and after data augmentation. by-kkby-block rendering of the se- quential diagram after reordering, showing the resolved ordering issuc.
Back to Table of Contents
22
Back to the First Page

---

C.4.2 Example 2
Adocument class 12pt] (articie) Ausepackage cate, ansmath, amseymb]
\deemeentelass is istpapor, (ersicio)
\usepackage (tikk
Ausegackage bike
dbcuunt document;
\begin/t (i cture//ree///i Iscalee lenO, byautolleft,evay node/ .etylll leciiii scc1c-0.2]1
\bogin (
[scalcn0, autoor 0.7]1
Start with the botcon zow placo a sequence of
+ sodd//styloo/coeo
4 black circios as the roundetton
10
Anode (dras, circlers.s (b) (1 111
\node (dsay, circlo....]
(e) (2 117
Anode (draw, circle,.... (e) at (-0.75,4) IN
12
Anode| daaa, cipcio.....
[n] at (1,3, 177
Anode (drax, circley...] (e) st (0,4) 193
11
13
Vnode (arax, circle,
(q) at 10.75,4) 139
12
14
Anade
cirele.....
(3,4)
13
15
Anode| diaa,cccolss ...]
(W2) 13.2,4) (17
Add midale layer abpve: light blus circies, b some cazzying $hotines3 synbols
16
Aoode (draw, ci cilo......
[2] at (4.2,41 117
17
Anode (aaa,, circle,
(22; at (4.8,4) 133
\aode (drax, circle,.... (2) at [-1,51 (8totincss
15
18
\node (dras, circle,
193: (5.4,9)
Anode draa, circle....]
10.6,3) (9tetimes9))
16
Amode (draw, ciwcle, -..1 (y91 as (6,4) 11r
/noda (draw, circle, (n) at (1.7,3) (Srotimes8)
17
20
|nade,dsaw, circle, .] (n) at 11.2,3) ...]
18
21
Anode owwa, c..l (1) at (3,5) (flotimes8s;
19
22
Vode ciclo......
61.5,51 ....
connectora with Shoups and 4 dlociness to exphasize branching roice
Place the
20
Anode (draw, circle, (y2) as (3.4,5) .--/
24
Aodde eiw.yeirclee.......
(k) at. 61 (8houp51;
Anoda [dras, ciscl,, (e) at [0, 18houpS12
21
25
Node (dzaw, circle,
[1: az (2,61 [8sousSly
Aode [drax, circle,...] ( at (2,6) 18Noup8ly
22
26
Aode www.w.i.ccce..........o.
(9lotincs8))
Anode draa, circle, ...)
(0.6,6) (9Xcup8))
23
Nodde Idsaw, circle, .... [gt as (0,61 [8houp8];
28
Anode baddedd:awwdr cizcae.
(2) at 10.6,5) ...)
29
Anode cocavccccclo
[a] at (-1,2) (Sletimes1))
Connect node: to reveal the intended structure
26
30
Noeda
circle,
1-1.4.4) 13s
Apath
Anode daaa,, cizclo. . (e) (-0.75,4) 1))
lanks downward and aidoways to
32
Anode| draw, circie....c............
[c] at (C,4) E17
[3] odge (bl
29
35
(a] edge fer
30
34
Apath
0, do and also
31
35
(4) wdde mode [Im[t] 1) (b)
[1] edge [+]
36
(a] adga node [balow] () (c)
(2) adga (ql
33
37
(2) 2dge [qr
34
38
5 2nops back into
35
121 edge node (balcwl 1) (0)
[2] adge (at
40
(K) edge noda [eeicv 1) (2)
5. K. branches to and y2, which extend further
37
41
(2) edge node [bwlow] {1 1y2)
4 Co: the zight
42
adga node [balow] (2)
[k] adga
38
43
(y) wdge node (below] 13 (x21
[k] edge (y2)
39
44
ly2) wdge mnde [below]]] 11 ly31
[y] edge (st
40
45
1921 edge node [below] 13 (y4)
41
edge node
(9)
5
desouarr to and
42
[1] edge node [belowll] [] (-2)
[11 edge [v]
48
(2) adea node [xioht] ta:
[1) adga (v2)
44
49
edge node [[=ft]
5 h c- Logetheer 5n and à ae hob
45
50
edge node [1e[[]]] (g)
edge (ji
46
[h] edge mode [right| 13]
[h] edge (g1
47
52
[b] edge node [[=ft]]] [1 (g)
[h] edge (k1
48
55
[b] edge node [[w[C] [1 (k)
5 beldgws Lowaed 1 and also deops into
49
54
edge [right] 11:
131 edge
50
55
[j] edge node [bwlow] () [s]
(3] edge (ms
56
[m] edge node [below] () In)
5 ar anchora back down inco the baseline at a and
52
57
edge node |right 19)
4
58
[n] edge
53
59
[m] edge (al
60
55
6]
\end 3
(t (kxpiouueu
56
Original Code
/and (document
Revndered Code
Original Code Code Drawing Order
Augmented Code Drawing Order
J
JIT
IV
11/
V
VI
V
VI
Figure 12: Comparison before (left) and after (right) reordering.
Back to Table of Contents
23
Back to the First Page

---

C.4.3 Example 3
edocument.case aneart)
\documentolase (ansact) lusepackage Jensaynb, amsnsth)
Ausegackage syee, enurerate anemath)
Nusepackage [soloriinks linkcoloz bluc,
\usepackage [cik2]
-> citecolor-bluel thyper retl
Nusegackage (traaggeettteee kon
\begin ddcument
/beganidocoment)
/begin/ti tikpglctore (x- pxtp. yapt. xsccale=]]
10
First drew backgrouno ellipse the crone
10
\draw [zolor"....
(185.99,203.33)
\draw [solor.... I ... cycle 7
- (392.3,202.21
12
12
Adraw [zolor"...
1395 00,, 202.199
Then place the main red horizonta: Line acroes the eliiese
13
13
\draw [zolor....
110.93,3.29)
Adraw [20lor"...
... 31,29 (237.78,202,74
\draw 1... J...-- 1292,3,202.2) )
14
15
\draw [zolor....
15
-+ (237.98,
Again add the greon curved path abeve the bascline
16
16
Adraw [shiet [color.... [[ine
\draw [cslot ...
17
xLdth=0.75) ... 3..2)
17
\draw [zolor"...
..... 1215,03,002
New drax arzowa radiating out fron the Jefe anchor
19
18
Adraw [shiet
[color.... [1ine
4 point
xidth=0_75;
... (1C, 3.29)
\draw lesior....] ... (221.14, 220.111
20
\draw [zolor"...
.... 1219.7,186.82
\draw jchift jeclor"... )... (10.92,3.29)
20
\deaw [chico....]
Icolore... 1[line 92, ][fill
22
- x.6th=0.75;
\drav jealoge...
(237.38,
23
21
Adraw [cclor
cycle
Vdraw [ehift [cclor ]... (.0.9
24
22
Adraw [oclor [e1ll....
cycle
/draw [colore...] ... (216.02, 202. B3)
26
23
Adraw [cclor.... [[fil1
cycle
\draw [shift [oclorr... )..- (10.91,3.29)
27
28
Adraw [oclor.... ... cycla
/draw [csiore...] -..-- (,19.7,186.0
1
29
25
/draw [chift /octoo..///ccorr.... [oclorr....l...................l ... [10, 9.29) J
30
26
5 Text Rode Adraw 12.8.01,77.017 mode Fiast Nade
31
27
verticsl arrow tho right for belance
32
28
\deaw [uploce...] ... 1667.49,15,.225 \draw [shaft=... [eclore... ... (10.92,
29
\draw (202. 185. code
34
30
Text Hode
35
Adraw (228.46,22..76) code
Next highTight key points with filled cizclea cyole
36
32
Text Node
\draw jealore...]
33
\draw (206.8,211.45) mode ...
\draw jcolor \dzaw [colocm...]
cycle cycl=
34
5 Fiext. Nadle
39
35
\draw (33..24,64.44) mode
40
36
Teext
-iineil and text labels near the arrows and pointe \draw (288.5.,170.47 node
37
\deaw 1270.17,153.11 node ....
42
38
5 Text Hode
\draw (202. 72, 185.79) node
43
39
Adraw (3,.9,54,206... rode
\dzaw 1228.45,
...?
44
40
Fisst Nade
45
41
\draw (284.81,204.95 mode ....
46
42
Vend (t: t-logiiioouuuee
47
45
Vend| (
48
\end documentt I
45
\end (docurent)
Original Code
Reandered Code
Original Code Drawing Order
Augmented Code Drawing Order
=
Seat
Bes
1V
111
IV
P
Figure 13: Comparison before (left) and after (right) reordering. For clarity, we omit parts of the original code and focus only on the drawing order.
Back to Table of Contents
24
Back to the First Page

---

Prompt for Code Augmentation
System Prompt:
You are an expert TikZ. code refinement and ordering. Your task is to adjust the TikZ. code to follow a natural and intuitive plotting sequence while preserving the rendered image content.
User Prompt:
Here is a TikZ code snippet. Please refine it according to the following rules:
Code order:
Change the TikZ code order the plotting sequence not natural or intuitive. not impact rendered image content when altering the code.
Variables and macros:
Pay attention variable and macro declarations. No variable macro may be referenced before it is defined. If reordering changes reference, carcfully transform the position expressions. You need understand coordinate rules TikZ.
Coordinate rules:
When you define an object at (x, y), the coordinate refers to the center of the object. However, when you relative positions such as 'left' 'right' of an object, it refers to the edge of the object.
Styles:
the code defines styles using tikzset or tikzstyle, check if they are used. Remove unused styles, just as you would remove unused imports.
Output Format:
Thinking: Briefly explain your reasoning (1-2 sentences).
Code: Return the refined TikZ code wrapped in triple backticks.
Figure 14: Prompt template for code augmentation.
Back to Table of Contents
25
Back to the First Page

---

D Evaluation Details
D.1 Evaluation Prompt
Here we present the evaluation prompt for the Image-to- TikZ. generation task.
Prompt for Evaluating Image-to- TikZ Generation (Belouadi et al., 2024b)
This is picture of a scientific figure. Generate LaTeX code that draws this scientific figure using TikZ. Ensure that the LaTeX code is self-contained and does not require any packages except TikZ-related imports. Don't forget include !usepackage (tikz)) your answer, 'aatte code block wrap the code part.
D.2 Results Showcase
Here we present a subset of the onput-output pairs from our Image-to-Tikee TikZ generation task. These examples illustrate the effectiveness of approach in converting scientific diagrams into self- contained ВTT code with TikZ.
input
output
input
output
input
output
input
output
R1
www
mm0
L...
1/2
1/2
(5.4) (9.9)
17.3]
4X9.9
644.8)
Mi
[.3
(2.6) (0.7)
11 2.
633.7
X
X
N
Figure 15: Showcase of Image-to- Monge-to-TikZ generation results. Each pair shows the input figure (left) and the corresponding generated TikZ output (right).
Back to Table of Contents
26
Back to the First Page

---

D.3 Code Efficiency Metric
Here, we report two code efficiency metrics in Table 7 supplementing the Table D in the main content. We present the 10% winsorized mean token and character length, following the previous study (Belouadi et al. 2024b) to maintain consistency. Winsorization replaces the top and bottom 10% of values with the 10th and 90th percentiles, reducing outlier influence while keeping the sample size.
We observe that the most capable models in Image-to-TikZ generation, (1640 chars, 914 tokens) and DaVinci-7B (1618 chars, 983 tokens), exhibit similar code efficiency. Notably, the other three proprietary MILMs all produce shorter outputs, indicating higher code ef- ficiency, with GPT-5-Default (1081 chars, 604 tokens) achieving the most concise results. Among specialized TikZ-generation MILMs, DaVinci-7B achieves the highest code efficiency and sim- ilar to its base model, Dwen2.55VL--7. Morcover, code efficiency improves with model scale, as demonstrated by the Qwen2.5-VL series (7B, 32B,72B). This trend suggests that scaling up model size may enhance code efficiency.
Table 7: Compile results of DaVinci against different models.
Model
Average character length Average token count
Proprietary MLLMs
Gemini2.5-Pro-Thinneee
1640.07
914.24
GPT-5-Default
1081.45
603.93
Claude-Sonnete
1320.93
778.69
Shuude-Somnett-tthininngg
1243.53
727.16
Open-Sourced Sounned MLLMs
Qwen2.5-VL-7B
1687.20
1132.25
Qwen2.5-VL-32B
1186.80
653.85
Qwen2.5-VL-72B
1107.85
615.94
Specialized TiKZ-generation MILMS
DetikZify-V2-8B
2357.65
1337.33
DiagramAgent-7B
1955.69
1191.66
DaVinci-SFT-77
1722.87
984.38
DaVicii-BB
1618.04
983.01
Back to Table of Contents
27
Back to the First Page

---

D.4 Additional Human Evaluation Details
D.4.1 Interface for Human Evaluation
We developed simple online annotation interface for conducting human evaluation, as shown in Figure [6] We invited six graduate students as external annotators male and female), each of whom is tasked to finish two groups of annotations.
BWS Image Similarity Annotation Group1
Reference (GT)
Please select the most similar / most dissimilar image (cannot select the same one)
Most
Dissirilke
Moat
Disimbarr
Dissimiler
Submit Next Question
Sample: 1)
Figure 16: The interface used for human evaluation.
D.4.2 Agreement Analysis
measure agreement among annotators using split-half reliability (SHR). For each study, we ran- domly split annotators into two groups. For each image, we aggregate the Best-Worst Scaling anno- tations within each group to obtain vectors of model scores, compute the Spearman rank correlation between the groups, and report the mean correlation across all images. The resulting SHR values of p = 0.7227 for Group and p = 0.7878 for Group 2 indicate strong inter- annotator agreement, supporting the reliability of our human evaluation results.
We further evaluate the agreement between image similarity metrics and human judgments. Specif- ically, derive rankings from image similarity metric scores and compute Spearman rank correla- tions against human-derived rankings. Following Belouadi et al. (2024b), we report these correlation values both the instance level and the group level. At the group level, find that the employed metrics exhibit strong alignment with aggregated human judgments, indicating their effectiveness in evaluating overall model performance.
Table 8: Correlations of image similarity metrics with humans at the instance and group level.
Instance-level Group
Group-level
Metric
Group
Mean
Group
Group
Mean
LPIPS
0.368
0.333
0.350
0.949
1.000
0.974
DSIM
0.350
0.507
0.428
0.949
1,000
0.974
SigLIP
0.352
0.520
0.436
0.949
1,000
0.974
MSE
0.358
0.209
0.284
0.949
0.800
0.874
SSIM
0.152
0.438
0.295
0.633
0,800
0.716
Back to Table of Contents
28
Back to the First Page

---

D.5 Additional Automatic Evaluation
We construct an additional test set comprising 2,000 randomly sampled samples from newly col- lected data sourced from arXiv, restricted papers published after January 2025, and licensed for redistribution. This part of the data source not considered in our previous data construction pro- cess. The results are presented in Table The overall performance consistent with findings on the official test set, though this new set appears to be somewhat easier, likely due to its random sampling process, in contrast the curated, seleneee nature of the DAT1KZe3 test set.
Table 9: Evaluation results of 2000 additional test samples. Bold values denote the best scores.
Arrows 1 indicate metric directionality.
Code
Image
Model
Pass 1 f TED J cBLEUT DSIM SigLIP SSIM MSE | LPIPS
Open Sourced MLLMs
Qwen2.5-VL-7B
78.20
54.45
6.52
77.05
90.30
74.44
82.62
27.40
Qwen2.5-VL-325
83.20
52.97
77.92
90.66
75.06
80.02
26.65
Qwen2.5-VL-72B
86.30
52.71
7.66
80.52
92.12
74.52
78.09
26.17
76.75
53.51
6.25
80.78
91.95
75.45
77.72
24.97
GLM-4.5V-Thinking
67.10
54.92
3.59
81.15
92.43
77.13
77.58
23.72
Specialized TikZ-generation MILMs
DetikZify-V2-4 -2-B2
86.30
51.46
10.28
85.78
93.13
76.95
67.32
22.00
DiagramAgent-72
71.85
53.45
8.57
73.60
88,51
73.97
84.59
28.39
DaVinci-SFT-7B
89.80
50.48
11.25
85.32
93.87
76.24
69.77
22.86
DaVinci-7B 99.36
52.33
9.42
86.88
94.50
75.90
61.44
20.80
D.6
Additional Data Ablation Study
To further validate the effectiveness of our data curation strategy, we conduct controlled ablation study on the public version of DATIKZZe:3 which contains 145,366 samples. Applying our filtering and optimization pipeline, we derive refined subset of 112,177 samples, denoted as DATIKZo3- optimized. We perform supervised fine-tuning (SFT) on both datasets using the same configuration as DaVinii-BB-SFTT with Qwen2.5-VL-7B as the base model.
The evaluation results on the test set of -aTulz are presented in Table TO demonstrating that our curation strategy significantly improves Pass 1, increasing from 67.7% to 84.9%, while maintaining or slightly enhancing other key metrics, with a 22.83% reduction in dataset size.
Table 10: Results the additional ablation study on the impact of our data curation strategy.
Model
Pass
cBLEU
DSIM
SigLIP
SSIM
MSE
Qwen2.5- DATukZ.3-public
67.7%
3.98
82.56
93.17
73.85
71.13
Qwen2.5-VL-7B + DATIÁZ DaETiiZaa-opttiiin optimized
84.9%
7.19
82.95
93.90
72.75
72.01
Back to Table of Contents
29
Back to the First Page

---

Reward Design
Spatio-Textual Similarity Rewarding
Algorithm
D describes the complete calculation process of spatio-textual similarity rewarding.
Algorithm Spatio-Textual Similarity Rewarding
1: Input: Predicted boxes Bpred, predicted texts T pred-
2: Input: Ground-truth boxes Byt, ground-truth texts T Tgt-
3: Output: Scalar reward score R.
4: Initialize set of matches M +- 0.
5:
Initialize remaining indices Prem {1,..., Bpred I Grem < {1,..., BBtl)-
b Stage 1: Exact Text Matching
6: for Grem do Find candidates Poand < {i E Prem lower(Tpreed [i)) = lower(Tge(i))
7:
8: if Peondll > 0 then
9:
Find best match p¹ + arg maxiePeand diou [ prred(d), Bgt [il).
M M {(p", j)}.
11:
Prem <- Prem {p"}. Grem Grem \ (5).
end
13:
end for
Stage 2: Approximate Text Matching
14:
E Grem do 15: Find candidates Pcand t
for
16: for i Prem do
17:
dr. +- Levenshtein (T Preed Tge (i).
18:
<- Adaptive/Threshold pred (1), (g)))))
19:
if dz < T then
Add (i, dr) Peand.
21:
end if
end for
23: if Peondl > 0 then
24:
dmii +- min dr.
Pbesteond + {i (i, dmii) Poondł.
26:
pd +- arg Baxma PagieePPaarooo Pregronn diou (preddi), Byt (i))
M t MUf(r ..)..
28:
Prem f Prem fp Grem Grem \ {i}.
29:
end
30:
end for
b Final Reward Calculation
31: total score + O.
32: for each matched pair (p,g) in M do
33:
< (drou (prred[p], Byt (g]) 1)/2.
34: total_score + total_score + score.
35: end for
36: R +- total score/ max( B Bpreal. Byrl)
return R.
Figure presents visualizations Spatio- Textual match results between the ground truth and model output during training, spanning cases from simple to complex.
Back to Table of Contents
30
Back to the First Page

---

Output Image
Ground Truth
grarion
spans (ml
8
Pun
11.2
12
945
17
1000
Figure 17: Visualization of the Spatio-Textus match between the ground truth and model output during training. Matched text elements are displayed with bounding boxes and connected by lines; text elements without bounding boxes indicate unmatched.
Back to Table of Contents
31
Back to the First Page

---

E.2 Geometric Similarity Rewarding
The reward function Rgrom relies on a type-specific cost function, denoted as C(ep, Eg) CalculateCost((p> Eg) Algorithm 2 to measure the dissimilarity between predicted element ep and ground-truth element Eg. This cost is a weighted sum of differences in normalized geometric attributes. Below, we detail the formulation for each primary geometric type.
Common Notation. To maintain consistency, we first define several common terms used across the cost functions:
Cp. Cgi The centroids (center points) of elements Ep and Eg-
Deanvas: The diagonal of the bounding box enclosing all elements on the page, used for normalization. A small epsilon is used to prevent division by zero.
(ep: ey): The normalized Euclidean distance between the centroids of two elements, given by:
||cp Cgll2
(eos(ep: Eg)
Deanvss
(ep: eg): The normalized difference in the primary measure of size (c.g., area or length) of two elements:
App Agl
duize (Ep: Eg) max mnax(Ap: Ag,
Lines. A line element defined by its centroid, length (as its primary size metric, At), and orienta- tion. The orientation [0, T)) represents the angle of the line. The cost function balances position, length, and angular alignment.
Ciie (ep: eg) 0.4 dgos Eg) 0.3 daizo (ep: eg) + 0.3 dorient Eg)
where the normalized orientation difference dorient is defined as:
(orient(ep: eg)= min( 00p 0gb π
10p 0gl)
x/2
Rectangles. A rectangle is defined by its centroid, area (An), and aspect ratio & width/height. The cost function considers position, area, and shape similarity via aspect ratio.
Creeuange eg) 0.4 dpos (ep: Eg) 0.3 deize (ep: eg) 0.3 d dospect (eps
where the normalized aspect ratio difference daspect is:
1pp Pgl
duspect(Ep. eg)
max(ppp Pg. E)
Circles. A circle is defined by its center (centroid) and radius r. The cost function heavily weights positional alignment, with secondary consideration for radius similarity.
Cainte Cg) = 0.6 dpoo (Cp; eg) + 0.4 dradius (ep, Cg)
(8)
where the normalized radius difference dradéus is:
1rp rgl
dradius (ep: eg) max(r Tg.
Polygons. A polygon compared based on its centroid, area (Ap), and the number of vertices V. This provides basic measure of its overall shape and complexity.
Opolygon eg) = 0.4 deoo Eg) + 0.3 daize (Epr Eg) + 0.3 Seertee eg)
(9)
where the normalized vertex count difference dwertez is:
IV, Vg
dverter (ep. eg) max Vp, Vg.
Back to Table of Contents
32
Back to the First Page

---

27: end for Curves. General curves compared using their centroid, total are length (as the size metric, Ac), and the area of their bounding box (Abboz) as a rough proxy for their overall shape and extent.
Ceurve (Cps Eg) = 0.4 dpos (Cp: (g) + 0.3 daize (cp (gg) + 0.3 dobou (Cps Cgg)
(10)
where daboz is the normalized difference in bounding box areas:
Abbor.p Abbox.g
dibon (Eps Eg) max (Abbor.pp pr A Abbor.g: 6)
Algorithm Geometric Similarity Rewarding
Input: Predicted geometric elements Eyred.
2: Input: Ground-truth geometric elements Figt
3: Parameter: Scaling constant k.
4: Output: Scalar reward score Rgeom-
5: Initialize set of matches M 0.
Stage 1: Type-wise Optimal Matching
6: Group elements in Epred and Egt by type (e.g.. line, circle, rectangle).
7: Let T be the set of all unique element types present.
8: for each type in T do
9: Let E. and F be the sets of predicted and ground-truth elements of type l.
if LE > and LEg > 0 then
11:
Construct cost matrix O of size [E |E/]- for i E {I...., 1 l. j E {l,.... E }
12:
do C + Calculateeostt E L.). end for Matched indices (Pidar Gidz) + Hung for each matched pair of indices (i. in (Pidz: Gide) do ep + 5 [i] Eg + EyLi).
13:
b Type-specific cost function
15:
17:
18:
M + M U ((ep)
end for
20: end if
end for
Stage 2: Final Reward Calculation
22: total_score 6 0.
23: for each matched pair (ep, eg) in M do
24: cost +- CClccllateoss((e, Cy).
25: score ( cost).
26: total_score t totallscore score + score.
28: if max( Epreat, EEg > 0 then
Rgeom total tscore- max( Epreed) Egg)))
30: else
R Rgcom 1.0.
32: end if
return R Ryeom-
Figure 18 presents visualizations of the geometric element matches between the ground truth and model output, spanning cases from simple to complex.
Back to Table of Contents
33
Back to the First Page

---

Preckced
011
10'1
70g
Lieearta
Oreeral Tresh
R.101
Predicse
Srow WAE
Ag1Ra
R,007
2r
XX NÑ NN V
2
12
NN NN W
Predicedd
Ground Truth
SLADPT Bi NLNEP
NLJOPT Compleo8
mill
Proguctes
Formilar www.ggmmmmeeeeaaaamme.....
Srwend Truik thoweds
101
10
2331
Figure 18: Visualization of geometric element matches. Each sample comprises four sub-images. The top row shows the output (left) and ground truth (right) images. The bottom row displays the extracted geometric elements from the output (left) and ground truth (right). Successfully matched geometric elements are labeled with identical numbers to indicate correspondences between the predicted and ground truth outputs.
Back to Table of Contents
34
Back to the First Page

---

E.3
Training Details
Table IT and [2ble|12shww the training settings for the SFT and GRPO training stages, respectively. We freeze the vision encoder and MLP projector during the SFT stage, this leads lower training loss variance and smoother convergence compared to unfreezing these components, as shown in
Fig. 19
Table 12: GRPO Training Settings.
Configuration
Setting
Table 11: SFT Training Settings.
LLM Training
Unfreeze
Configuration
Setting
VIT Training
Unfreeze
MLP Projector Training
Unfreeze
LLM Training
Unfreeze
Max Response Length
6144
ViT Training
Freeze
KL. Coefficient
le-2
MLP Projector Training
Freeze
Low Clip Threshold
0.01
Finetuming Type
Full
High Clip Threshold
0.99
Cutoff Length
6144
Rollout Number
8
Learning Rate
5e -5
Rollout Temperature
1.0
Epochs
Rollout Top
0.99
Batch Size
128
Training Steps
300
Per Device Train Batch Size
Optimizer
Adam
Gradient Accumulation Steps
Learning Rate
1e-6
LR Scheduler
Cosine
Weight Decay
Warmup Ratio
0.1
Per Device Train Batch Size
4
GPUs
8*
H1000-80
Rollout Batch Size
256
GPU Hours
Global Batch Size
128
GPUs
8 H100-80G
GPU Hours
60
Ueetning Le0e
445-
430
166
230
359
400
Training Steps
Figure 19: Loss comparison when freeze and unfreeze the vision encoder and the MLP projector during SFT training.
E.4 OCR Recognition Missing Cases
As shown in Fig. 20 OCR recognition may face incomplete recognition and frequently omits textual content.
Back to Table of Contents
35
Back to the First Page

---

X7
M
Figure 20: OCR error: missing recognition resulting in omitted textual content.
Back to Table of Contents
36
Back to the First Page


Reviews:
[{"review_id": "ZyFh9QIpNt", "reviewer": "Reviewer_modw", "summary": "This paper presents a two-stage learning framework for diagram generation using TikZ, consisting of supervised fine-tuning (SFT) followed by reinforcement learning (RL).\nIn the first stage, the authors investigate the effects of drawing order and comment placement, aspects that have not been thoroughly examined in previous studies.\nIn the second stage, they introduce a composite reward function in the RL phase that incorporates multiple factors, including image quality, code correctness, and structural consistency, and demonstrate its effectiveness through experimental results.", "questions": "- In Section E.3 of the paper, which describes the training details, it is mentioned that the ViT and MLP projector are frozen during the SFT stage but unfrozen during the GRPO stage. Did you experiment with both configurations—freezing and unfreezing—in the GRPO stage, and find that unfreezing these components led to better performance?\n- Will the model, code, and dataset be released to the public?\n- The dataset is referred to as TikZ30K, but according to Appendix C.4, there are 58,000 training samples. Were the data further filtered during the optimization or post-verification steps? Does this mean that the final dataset actually consists of 30,000 samples?\n- The code augmentation process does not seem trivial for an LLM. The paper mentions that the procedure was repeated when rendering failed or when the rendered image was dissimilar to the original. On average, how many attempts were required per sample to obtain a valid code conversion? Moreover, were all samples successfully converted into valid code, or were some data filtered out due to unsuccessful conversions?\n- Could you please clarify which specific tools or libraries were used to extract the elements from the PDF files when computing the geometric similarity reward?\n- In the computation of the geometric similarity reward, I assume that matching the corresponding elements is not a trivial task. Could you please elaborate on how reliable the matching results are when inspected by humans? In other words, to what extent does the proposed algorithm produce visually or semantically reasonable correspondences between elements?", "limitations": "", "rating": 6, "confidence": 4, "soundness": 2, "presentation": 3, "contribution": 3, "strengths": "- The authors analyze previously overlooked properties of the data itself—specifically, the order in which data are generated and the use of comments within the code—and demonstrate their positive effects.\n- They further propose a method for defining the RL reward that incorporates text alignment, bounding-box consistency, and element matching directly extracted from the vector images.", "weaknesses": "- Although a new dataset has been constructed, there is no description of its license information, making the details of the dataset’s licensing unclear.\n- The evaluation relies solely on automatic metrics, and no human evaluation is conducted. Since the proposed automatic metrics partially overlap with the reward function used in RL, verifying through human evaluation whether the improvement is genuinely meaningful—or merely a result of metric hacking—would greatly enhance the credibility and reliability of the results.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "YqrevOhI2d", "reviewer": "Reviewer_1soJ", "summary": "This work addresses the problem of parsing raster-based scientific figures into TikZ code. The authors introduce TikZ30K, a high-quality dataset constructed through extensive preprocessing using large language models (LLMs) and vision-language models (VLMs). The data curation pipeline includes low-quality data removal via VLMs, code reordering via LLMs, and comment injection to enhance planning capabilities. A Qwen2.5-VL multimodal LLM is fine-tuned using a two-step training pipeline consisting of supervised fine-tuning (SFT) followed by reinforcement learning (RL). The authors design novel reward functions evaluating textual information, geometric elements, image fidelity, and rendering success rate. The trained model is evaluated on a range of proprietary and open-source MLLMs, demonstrating that the SFT+RL approach outperforms baselines such as GPT-5 on automatic metrics.", "questions": "- What is the exact difference between Reorder30K and TikZ30K? Is it simply the inclusion of comments introduced during data curation?\n- For DaTikZ-V3, is the preprocessing pipeline the same as TikZ30K? Also, is TikZ30K a subset of DaTikZ-V3, or was it sourced independently? Clarifying the dataset relationships and data collection process in the main paper would improve transparency.", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The data preprocessing pipeline is novel and intuitive. The use of VLMs for labeling and filtering, LLMs for code reordering, and comment injection for planning is well-motivated. Ablation studies confirm that reordering improves performance.\n- The reward design is comprehensive, capturing textual, geometric, and rendering aspects. The inclusion of ablations on different reward settings is appreciated.\n- The analysis provides interesting insights, particularly regarding reasoning vs. non-reasoning behavior and the observation that code similarity decreases while performance improves after RL. Evaluation includes both proprietary and open-source MLLMs.", "weaknesses": "- It would be helpful to include a code efficiency metric, such as average token or character length, to better understand the complexity and verbosity of the generated TikZ code.\n- There is no information about the data timeframe or sourcing, which raises potential concerns about data contamination or leakage.\n- The lack of human evaluation is a major limitation. Relying solely on automatic metrics makes it difficult to assess the real-world quality and fidelity of generated figures. Even a small-scale human evaluation would substantially increase the credibility of the results and help correlate human judgments with automatic metrics.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "kwln1kRxUm", "reviewer": "Reviewer_jdjw", "summary": "This paper addresses the timely topic of diagram-to-code generation by proposing a two-stage learning method: a supervised fine-tuning (SFT) \"cold start\" followed by GRPO post-training. It also explores two overlooked features, code ordering and descriptive comments. However, the paper's key findings lack support from rigorous experimental data, leading to ungrounded claims about the technical method's efficacy. Moreover, the dataset construction and evaluation methodology present a potential risk of bias, indicating that the work requires further improvement before its conclusions can be considered reliable.", "questions": "See weaknesses", "limitations": "", "rating": 4, "confidence": 4, "soundness": 2, "presentation": 2, "contribution": 2, "strengths": "S1. The proposed two-stage learning approach with SFT + GRPO is a timely fit for the field.\n\nS2. This work draws attention to the often-overlooked features of code ordering and descriptive comments in diagram-to-code generation.\n\nS3. The paper is well written, and the methodology is solid.", "weaknesses": "W1. The main concern lies in the data construction process, which contains only 30k samples, whereas previous work (DATIkZ v1: 117k, v2: 360k, v3: 456k) used much larger datasets. Though the authors provide more details in Appendix C, key information is still missing. In line 795, they refer to 225k samples, but after stratified sampling by token length, only 58k remain (line 978), and it is unclear how the final 30k samples (line 149) were selected. Moreover, stratified sampling by token length may introduce bias, making the proposed dataset focus more on the long-tail data of the original dataset.\n\nW2. We encourage the authors to provide a concise and clear description of the data construction process in the main content, showing how 366,075 (line 764) valid pairs were reduced to the final TikZ-30k dataset. It is also necessary to provide comprehensive statistical analyses of the dataset at each step to ensure that no bias is introduced.\n\nW3. Bias in the evaluation method is another critical weakness. In line 338, the authors mention sampling 542 instances from 456,000 instances in DATIkZ v3. This small-scale test set cannot provide statistically convincing results, and the unclear sampling method raises concerns about potential distortion. Moreover, the authors should include evaluation metrics consistent with previous studies for better performance comparison.\n\nW4. The reviewer is curious about the “error-free precise feedback” (line 076); however, the authors only introduce it as “a method” (line 263) without experimental support or technical details.\n\nW5. Format/typos: \n- In Figure 1, the Tikz code is changing from “yellow” to “red” while the text is describing “from green to light red” in the top right part.\n- In Table 1, did not bold the best score for SigLIP", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "IkS2920yAB", "reviewer": "Reviewer_zdpU", "summary": "This work introduces a new MLLM for synthesizing scientific figures as TikZ graphics programs conditioned on raster images. To facilitate this, the authors introduce a highly curated dataset of 30k TikZ images. Compared to related work, this dataset might seem small, but the automated curation process yields higher-quality training examples that lead to better downstream performance. The authors also introduce a new set of task-specific reward functions that can further improve the model via GRPO. Their final model outperforms both proprietary and open-weight baselines on a wide range of automated metrics.", "questions": "* In l.61, Belouadi et al. use the MCTS algorithm primarily to find outputs with higher perceptual similarity, not to improve the compile success rate.", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "* The central contribution of the work is the dataset and its curation pipeline. Through manual analysis, the authors identify shortcomings of existing datasets and improve their training examples through automated methods. These findings will be useful for future work (such as injecting comments as an \"inline\" reasoning trace).\n* Likewise, the defined reward functions seem effective and scalable and will be useful for future work.\n* In general, the paper is well-written and easy to follow.", "weaknesses": "* The comparison between DaVinci and DeTikZify is not entirely fair, as DaVinci is based on a stronger base model. This means that conclusions about the effectiveness of the data curation strategy (l.375f) could also be due to this difference.\n* Even though the dataset is a central contribution, its creation is not entirely clear. For example, in l.154, the authors mention that they originally collect 360k TikZ snippets. It is not clear at which step these examples are filtered down to only 30k examples.\n* While the findings are interesting, there are few technical novelties presented.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)