new

Get trending papers in your email inbox!

Subscribe

Daily Papers

byAK and the research community

Dec 2

TikZilla: Scaling Text-to-TikZ with High-Quality Data and Reinforcement Learning

Large language models (LLMs) are increasingly used to assist scientists across diverse workflows. A key challenge is generating high-quality figures from textual descriptions, often represented as TikZ programs that can be rendered as scientific images. Prior research has proposed a variety of datasets and modeling approaches for this task. However, existing datasets for Text-to-TikZ are too small and noisy to capture the complexity of TikZ, causing mismatches between text and rendered figures. Moreover, prior approaches rely solely on supervised fine-tuning (SFT), which does not expose the model to the rendered semantics of the figure, often resulting in errors such as looping, irrelevant content, and incorrect spatial relations. To address these issues, we construct DaTikZ-V4, a dataset more than four times larger and substantially higher in quality than DaTikZ-V3, enriched with LLM-generated figure descriptions. Using this dataset, we train TikZilla, a family of small open-source Qwen models (3B and 8B) with a two-stage pipeline of SFT followed by reinforcement learning (RL). For RL, we leverage an image encoder trained via inverse graphics to provide semantically faithful reward signals. Extensive human evaluations with over 1,000 judgments show that TikZilla improves by 1.5-2 points over its base models on a 5-point scale, surpasses GPT-4o by 0.5 points, and matches GPT-5 in the image-based evaluation, while operating at much smaller model sizes. Code, data, and models will be made available.

  • 2 authors
·
Mar 3

Who Drew That Pixel? Fine-Grained Visual Attribution for Image-to-Code Generation and Editing

Reinforcement learning for image-to-code generation typically rewards the overall visual similarity between rendered outputs and reference images. However, methods such as GRPO assign the same advantage to every token in a program, giving code that draws an element correctly the same learning signal as code that draws it incorrectly. To address this, we introduce render attribution, which traces rendered elements back to their source code, enabling fine-grained visual feedback. During training, we decompose the reference and rendered images into individual elements, match them one-to-one based on geometric similarity, and assign element-specific advantages to the responsible code tokens, even across shared definitions. Across five benchmarks (VFIG-Bench, VFIG-OOD, SVG-Bench Emoji, DaTikZ-v3, and Design2Code) spanning SVG, TikZ, and HTML with three different starting models, our method outperforms GRPO (e.g., 23% lower LPIPS on VFIG-Bench), improving all 28 benchmark-metric comparisons with at most 1.3% additional training-step time. With an additional code-aware reward and corresponding credit assignment, it also better preserves code structure and improves editability. As an agent tool, render attribution improves LPIPS by 17% at the same turn budget even for a frontier agent (Claude Sonnet 5.5), and lets an open 27B agent surpass its 16-turn result in four turns with 84% fewer tokens. By linking rendered elements to their code, render attribution turns visual feedback into precise guidance for learning and editing.

  • 4 authors
·
Nov 29