TRANSMISSION // 2612.00307v1
Giving Visual AI Feedback That Reaches the Right Code
Source published
Render attribution links parts of an image to the code that drew them, providing more targeted feedback for training image-to-code models and helping coding agents make edits.

When a generated diagram or webpage looks wrong, an overall similarity score may not show which code caused the mismatch. A new approach, tested on SVG, TikZ and HTML, traces rendered elements back to their code so feedback can be more specific.
Why a whole-image score can miss the point
Image-to-code systems turn a picture—such as a scientific diagram, icon or webpage—into a program that can recreate it. The program needs to look right, but its organization matters too: groups of shapes and shared styles can make later changes easier.
One way to improve these systems is reinforcement learning. A model generates code, the code is rendered, and the result is compared with a reference image. In the GRPO baseline studied here, each token in a rendered program receives the same advantage, or learning signal. That means code drawing a correct arrow can receive the same signal as code placing a box incorrectly. The paper describes special handling for programs that fail to render or are truncated, so the shared-token description does not apply to every case.
Hexuan Wang, Zixian Ma, Ranjay Krishna and Jaemin Cho propose render attribution: tracing visible elements back to the code responsible for drawing them. Their question is whether this link can provide more useful feedback when models learn to generate visual code and when coding agents edit it.
Making the link between pixels and code
The method uses the renderer to create an “ID render.” Each drawing unit is rendered in a distinct color, so the color at a pixel identifies the code that drew it. For SVG and HTML, the researchers recolor drawing units; for TikZ, they insert markers. The approach also traces shared definitions—such as a style used by several arrows—that affect how elements look without painting pixels themselves.
Next, the system matches elements in a generated image to elements in the reference. It uses geometric similarity and an optimal one-to-one matching procedure. This can pair shapes even when they do not overlap exactly, but the match is not a semantic guarantee: geometric similarity can lead to incorrect correspondences, particularly when elements have moved substantially. The system scores matched elements for appearance and geometry.
During training, element-level scores are routed to the code responsible for each element and combined with the usual whole-program advantage. The main experiments use this element credit with an appearance reward. A separate code-aware reward and structure-credit extension targets code organization, including shared definitions. It considers reference definitions controlling at least two elements and selects a generated definition that best preserves their grouping; this specific mechanism is not a guarantee of generally useful code structure.
The team trained three 4-billion-parameter starting models for SVG, TikZ and HTML. They evaluated them on five benchmarks: VFIG-Bench, VFIG-OOD, SVG-Bench Emoji, DaTikZ-v3 and Design2Code. They also tested attribution tools with coding agents that iteratively edit a draft and compare its rendering with a reference.
Improvements across the tested comparisons
The paper reports that RA-GRPO outperformed GRPO in all 28 benchmark–metric comparisons. On VFIG-Bench, LPIPS—a measure where lower values indicate greater perceptual similarity—was 23% lower than with GRPO. In the authors’ training setup, element-credit computation added at most 1.3% to training-step time.
With code-aware rewards and structure credit, the method also improved measures of preserved code organization and editability. Two programs can look similar while differing in how easily someone can move a group or change a shared color.
For agentic editing, the researchers added tools that identify which code drew a selected pixel, estimate values that would better match the reference, and propose edits checked by rendering. In an experiment on 100 VFIG-Bench images, Claude Code using Claude Sonnet 5.5 achieved 17–32% lower LPIPS with attribution tools at turn budgets of four or more, compared with the same agent setup without those tools. Results varied by budget. The paper also reports that Qwen3.8-27B, used through Claude Code, surpassed its 16-turn result without attribution in four turns with attribution, using 84% fewer tokens. These results concern the tested SVG reconstruction tasks and agent setup; they do not establish the same effect in other workflows.
What the evidence does—and does not—show
The results suggest that directing feedback to responsible code can help in the tested settings. But attribution has measurable limits. In a tracing check, the correct drawing unit was identified for 82% of ink pixels in SVG, 89% in TikZ and 95% in HTML. By element kind, pixel-level tracing accuracy was 45.7% for SVG text and 37.6% for SVG lines and arrows. Errors were concentrated near element edges, and the authors link some SVG weaknesses to thin strokes and text outlines.
Matching also depends on how far an element has shifted. In the paper’s test, matching recovered over 91% of true pairs for shifts up to half of the method’s tolerance parameter, τ, and 77–80% at a shift of τ. These figures come from a controlled test, not a guarantee for every image.
The evaluation covers three languages, specific starting models and five benchmarks, with 2,906 training images for SVG, 3,094 for TikZ and 2,908 for HTML. The main training comparisons use one run per method per language, although the paper reports paired bootstrap intervals for metric gains. The evidence does not establish how reliably the results would reproduce across other runs, models or datasets. The agent experiment is limited to SVG reconstruction in a particular coding environment.
This is an arXiv preprint. The supplied source does not establish peer review or independent replication. The findings are promising within the reported experiments, but broader tests are needed to determine how well render attribution transfers to other visual code and editing tasks.
- image-to-code
- render attribution
- reinforcement learning
- SVG
- TikZ
- HTML
- AI editing agents
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
Teaching image-to-code AI from its unfinished drawings
Supporting evidence: Both papers report gains from more localized feedback during image-to-code training: the origin paper assigns visual credit to rendered elements and reports improvements over GRPO, while IR4RL assigns render-progress rewards to tokens and reports improvements over outcome-only GRPO. This supports the bounded proposition that finer-grained visual feedback can help in the evaluated generation settings; the methods, tasks, and benchmarks differ, so it is not a direct comparison.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2612.00307v1 — Original paper
Excerpt reference:
static/papers/2612.00307v1.md:1195-1278
Basis: Paper text
Source file SHA-256:f026586fe002a45b6eea4eb07adec97feecc88245e892035c8ac4bc749bf3d492609.34587v2 — Original paper
Excerpt reference:
static/papers/2609.34587v2.md:102-162
Basis: Paper text
Source file SHA-256:9f2a33a049bd40cea08d5a93f228a7ca036a4de2ad3e1f30daec9ed52d6744ca
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Teaching image-to-code AI from its unfinished drawings
Source published
Shared keywords: image to code, reinforcement learning
WebCatalyst trains HTML generators to improve what happens after the first click
Source published
Shared keywords: reinforcement learning
Finding the Errors That Break AI’s Simulated Worlds
Source published
Shared keywords: reinforcement learning
A Better Timetable for Training Reasoning AI
Source published
Shared keywords: reinforcement learning
Why geometry matters in inverse reinforcement learning
Source published
Shared keywords: reinforcement learning