TL;DR
The paper introduces IR4RL (Intermediate Renders for Reinforcement Learning), a framework that uses partial renders of graphics code (SVG/TikZ) to provide dense, step-by-step feedback during model training. By rewarding incremental progress toward a target image rather than just the final result, the authors achieve new state-of-the-art performance for open-source image-to-code models while significantly reducing code length.
What Problem Does This Paper Address?
Generating code from an image (e.g., creating an SVG file from a logo) is a complex task for Vision-Language Models (VLMs). Standard Reinforcement Learning (RL) approaches typically rely on outcome rewards: the model generates a full program, renders it, and receives a single score based on how well the final image matches the target.
This creates a massive credit assignment problem. A generated program might contain 50 lines of perfect code followed by 5 lines of errors. In an outcome-only setup, every token in that program receives the same (potentially mediocre) reward. This "sparse" feedback makes it difficult for the model to learn which specific decisions were helpful and which were harmful.
Methods
The authors propose IR4RL, which leverages the fact that graphics code is often incremental. You can render a partial SVG path and see a "work-in-progress" version of the image.
Key components of the method include:
- Closure Operator: Since a raw code prefix (like an unclosed
<path>tag) isn't executable, the authors use a "closure operator" to automatically append the necessary closing syntax to make partial code renderable at any point. - Render-Progress Reward ($\Delta_j$): Instead of looking at absolute similarity, the model is rewarded for the change in visual similarity between two consecutive segments. If a new line of code makes the render look more like the target, it gets a positive reward; if it introduces an error, it gets a negative one.
- Token-level Propagation: These segment-level rewards are propagated backward to individual tokens using an exponentially decaying weight ($\lambda$), ensuring that the tokens immediately preceding a render receive the most credit/blame.
- Hybrid Objective: The final reward combines this dense "process" signal with the traditional "outcome" signal, optimized using Group Relative Policy Optimization (GRPO).
Datasets
The researchers evaluated their method on two primary tasks:
- Image-to-SVG: Trained on the
svg-stackdataset and evaluated onMMSVGBench(split into Illustrations and Icons). - Image-to-TikZ: Trained and evaluated on the
DaTikZ-v3dataset, which focuses on scientific diagrams and figures.
Key Insights and Ideas
- Process Supervision is the Primary Driver: Ablation studies showed that the process-level reward alone accounts for the vast majority of the performance gains over standard RL. Combining it with outcome rewards provides the best results, but the "dense" signal is the real game-changer.
- Granularity Matters: The best performance was achieved by rendering after every completed drawing command. As the frequency of intermediate renders decreases (becoming "sparser"), performance drops significantly.
- Locality is Crucial: The authors found that a decay factor of $\lambda=0.9$ worked best. Propagating the reward too far back (e.g., $\lambda=1.0$) actually hurt performance, suggesting that visual feedback is most effective when tightly coupled to the local code that produced it.
- Efficiency as a Side Effect: Interestingly, the model learned to produce much shorter, more efficient code. By rewarding progress at every step, the model is discouraged from generating "dead" code or redundant operations that don't improve the visual score.
Key Results
IR4RL established new state-of-the-art results for open-source models across both SVG and TikZ tasks:
- Visual Fidelity: On
MMSVGBench-Illustrations, the IR4RL-trained 4B model achieved a DINO score of 97.48, outperforming the 8B base model (88.81) and even large proprietary models like GPT-5.2 (94.71) and Gemini 3 Flash (96.66). - Code Efficiency: The method reduced the average token count for SVG icons from 8.4k (SFT base) to just 2.1k, a 4x reduction in program length while improving accuracy.
- Human Preference: In a user study, humans preferred IR4RL's outputs over the SFT base model 92.7% of the time.
Limitations and Future Work
The primary limitation is applicability. IR4RL requires that intermediate code prefixes can be converted into meaningful, executable states. While this is natural for graphics languages like SVG, TikZ, or potentially CAD and HTML, it is not easily applicable to general-purpose programming (like Python) where a partial script often does nothing until it is complete.
Additionally, rendering at every step increases training-time computation. While inference remains fast (the model is just a standard VLM), the training loop is slowed down by the need to render and score multiple times per rollout. The authors suggest that future work could explore extending this to other incrementally rendered domains like 3D scene programs or Lottie animations.
Summary updated