Source-linked AI summary
Reliable Reasoning in SVG-LLMs via Multi-Task Multi-Reward Reinforcement Learning
Haomin Wang, Qi Wei, Qianli Ma, Shengyuan Ding, Jinhui Yin, Kai Chen, Hongjie Zhang
TL;DR
Existing SVG vision-language methods face limited generalization, redundant paths, and insufficient explicit reasoning. CTRL-S combines chain-of-thought reasoning, group-level structured code, SVG-Sophia, and multi-task multi-reward GRPO training, achieving stronger visual quality, task performance, and code quality than prior approaches.
Problem
Existing SVG vision-language methods have limited generalization, redundant code paths, and insufficient explicit reasoning, while reinforcement-learning methods often optimize tasks separately.
Method
CTRL-S combines chain-of-thought reasoning aligned with group-level SVG code, the SVG-Sophia dataset, and unified multi-task multi-reward GRPO training.
Results
CTRL-S achieves state-of-the-art SVG generation with higher visual quality, faster inference, and highly readable and editable code than SFT baselines.
Takeaways & Limitations
Joint multi-task and multi-reward optimization improves SVG generation, code refinement, visual fidelity, and code readability within one framework.
Abstract
from arXiv · showhide
With the rapid advancement of vision-language models, an increasing number of studies have explored their potential for SVG generation tasks. Although existing approaches improve performance by constructing large-scale SVG datasets and introducing SVG-specific tokens, they still suffer from limited generalization, redundant paths in code outputs, and a lack of explicit reasoning. In this work, we present CTRL-S (Chain-of-Thought Reinforcement Learning for SVG), a unified framework that introduces a chain-of-thought mechanism to explicitly expose the model's reasoning process during SVG generation. To support this structured reasoning, we construct SVG-Sophia, a high-quality dataset containing 145K samples across SVG code refinement, Text-to-SVG, and Image-to-SVG tasks. By training the model to generate group-level structured SVG code, CTRL-S significantly improves structural coherence and visual fidelity. Furthermore, we adopt the GRPO algorithm and design a multi-reward optimization framework, incorporating DINO, image-text similarity, format, and code efficiency rewards. Through joint multi-reward optimization and multi-task training, our approach systematically enhances overall generation capabilities. Extensive experiments show that CTRL-S outperforms existing methods, achieving higher task success rates, superior SVG code quality, and exceptional visual fidelity.
1. Introduction
CTRL-S addresses limited generalization, redundant SVG paths, and weak structural transparency by combining chain-of-thought reasoning, grouped code, multi-task training, and multi-reward reinforcement learning.
- SVG represents 2D content with parameterized geometric primitives, providing compact storage, resolution independence, and fine-grained editability.
- Existing vision-language approaches improve Text-to-SVG and Image-to-SVG generation but remain limited by weak generalization, redundant paths, and reduced code readability after aggressive compression.
- CTRL-S aligns step-by-step chain-of-thought planning with corresponding group-level SVG code segments to improve structural transparency and editability.
- The unified framework jointly trains Text-to-SVG, Image-to-SVG, and code refinement, allowing the tasks to provide mutually reinforcing supervision.
- SVG-Sophia provides 131K SFT samples and 14.4K RL samples, while CTRL-S uses GRPO with format, DINO, image-text similarity, and code-efficiency rewards.
- CTRL-S reports higher visual quality, faster inference, and more readable and editable code than SFT baselines, achieving state-of-the-art SVG generation performance.
2. Related Work
Prior SVG modeling spans optimization-based and learning-based approaches, while recent reinforcement-learning methods add visual rewards but generally optimize tasks separately.
- Optimization-based SVG Modeling: Optimization-based methods directly tune Bézier control points and styling attributes through differentiable rasterization and reconstruction or image-text similarity objectives.
- Learning-based SVG Modeling: Learning-based methods evolved from sequence and latent-variable models toward vision-language systems with vision encoders and SVG-specific tokens for semantically grounded generation.
- Reinforcement Learning for SVG Generation: Recent SVG reinforcement-learning methods use GRPO and visual rewards, but remain confined to single-task optimization rather than unifying Text-to-SVG and Image-to-SVG generation.
3. SVG-Sophia
SVG-Sophia combines structured chain-of-thought annotations with group-level SVG code across generation and refinement tasks, supporting unified training data.
- SVG-Sophia is built from ColorSVG-100K files annotated with explicit chain-of-thought reasoning and group-level structured SVG code.
- Text-to-SVG generation produces a chain-of-thought planning sequence followed by executable SVG code.
- Image-to-SVG generation uses the same generation structure while additionally conditioning on a reference image.
- SVG code refinement conditions on textual instructions, a reference image, and a flawed SVG draft to support self-correction.
- The dataset normalizes SVGs to a 128×128 viewBox and uses annotated captions, refactored code, semantic hierarchies, and step-by-step planning.
- Moderately flawed refinement samples are selected using 0.30 ≤SSIM ≤0.95, then paired with discrepancy analysis and correction-oriented reasoning.
4. CTRL-S
CTRL-S formulates SVG generation as a unified multi-task sequence-to-sequence problem and trains it through supervised alignment followed by multi-task, multi-reward reinforcement learning.
- CTRL-S first uses two-stage supervised fine-tuning to align SVG-specific tokens and establish step-wise chain-of-thought reasoning.
- Its reinforcement-learning phase jointly optimizes Text-to-SVG, Image-to-SVG, and code refinement using comprehensive feedback signals.
- The framework models SVG generation as unified multi-task autoregressive sequence-to-sequence generation, with task-dependent inputs and a target sequence beginning with chain-of-thought reasoning.
I. Two-Stage Supervised Fine-Tuning
CTRL-S uses two-stage supervised fine-tuning to align SVG-specific tokens and teach explicit, step-wise chain-of-thought responses before reinforcement learning aligns visual, semantic, structural, and efficiency objectives.
- Stage 2: CoT-Structured Alignment: The second supervised fine-tuning stage uses SVG-Sophia to train CoT-structured responses with explicit step-wise planning.The framework aligns reasoning steps with grouped SVG code segments.
- Unified task formulation: CTRL-S unifies Text-to-SVG, Image-to-SVG, and SVG code refinement through task-specific contexts and executable SVG outputs.The context contains text alone, text plus image, or text, image, and draft SVG depending on the task.
- Reinforcement learning: GRPO samples groups of diverse trajectories and normalizes their multi-reward scores to compute relative advantages without a parameterized value model.The policy is optimized using group-relative reward normalization.
- Stage 1: SVG Token Alignment: 1M SAgoge samples stabilize SVG-specific token embeddings during the first supervised fine-tuning stage.This stage provides modality alignment before later training on SVG-Sophia.
5. Experiments
CTRL-S achieves leading quantitative performance across SVG generation and refinement, while qualitative and ablation studies support gains from multi-reward RL, CoT reasoning, and multi-task training.
- Quantitative Evaluations: CTRL-S attains the highest CLIP-T2I score of 25.944 on Text-to-SVG in the SArena-Icon benchmark.
- Quantitative Evaluations: CTRL-S achieves the best DINO, SSIM, and LPIPS results for Image-to-SVG against mainstream general VLMs and SVG-LLMs.
- Quantitative Evaluations: Compared with SFT, RL increases task success and reduces generated tokens, improving visual fidelity, semantic alignment, generalization, robustness, and code efficiency.
- Quantitative Evaluations: CTRL-S achieves the best performance across all metrics on the SVG-Sophia Code Refinement Benchmark, including comparisons with GPT-5.2, Claude-Sonnet-4.5, and Gemini-3-Pro.
- Qualitative Evaluations: Across Text-to-SVG and Image-to-SVG, CTRL-S produces more accurate layouts, faithful colors, and richer details as RL training steps increase.
- Ablation Studies: CoT improves SFT task success and generation robustness, while the full ablations show complementary benefits from reward design and joint training across three tasks.
6. Conclusion
CTRL-S combines explicit chain-of-thought reasoning, hierarchical SVG code alignment, and multi-task, multi-reward GRPO training across three SVG tasks. The framework and SVG-Sophia dataset support structured generation and code refinement, with reported state-of-the-art performance across multiple tasks.
- CTRL-S introduces chain-of-thought reasoning across Text-to-SVG, Image-to-SVG, and SVG code refinement tasks.
- Aligning planning steps with SVG code groups improves structural consistency, readability, and editability.
- Multi-task, multi-reward GRPO jointly optimizes complementary tasks using diverse reward signals to enhance visual fidelity, semantic alignment, and generation stability.
- SVG-Sophia provides a high-quality corpus with explicit CoT question–answer pairs for structured SVG generation and code refinement.
- CTRL-S achieves state-of-the-art performance across multiple tasks in extensive experiments.
A.1. Design of SVG-specific tokens
CTRL-S uses SVG-specific tokens to represent structural, graphical, attribute, and numeric elements more directly. These tokens are designed to reduce fragmentation and shorten SVG outputs.
- All SVGs are mapped to a normalized 128 × 128 coordinate space for consistent geometric parameterization.
- The vocabulary adds 49 tag-level tokens and 35 attribute-level tokens for common SVG structures, graphical elements, geometric fields, and styles.
- Table 4 documents the SVG-specific token vocabulary used in CTRL-S.
A.2. Examples of SVG-Sophia
SVG-Sophia includes representative examples for Text-to-SVG, Image-to-SVG, and SVG code refinement. The examples pair task-specific instructions with images or rasterized targets where applicable.
- Text-to-SVG examples provide detailed instructions for generating high-quality SVGs.
- Image-to-SVG examples supplement instructions with raster images to facilitate accurate vectorization.
- SVG code refinement examples supply a rasterized target image and instructions for refining SVG code.