Reliable Reasoning in SVG-LLMs via Multi-Task Multi-Reward Reinforcement Learning¶
Conference: ECCV2026
Paper: ECCV Original Paper
Code: https://github.com/hmwang2002/CTRL-S
Area: Vision-Language Reasoning
Keywords: SVG generation, chain-of-thought, group-level structure, multi-task learning, reinforcement learning
TL;DR¶
CTRL-S trains Qwen3-VL-8B to plan drawing steps before generating corresponding SVG groups and jointly learns text-conditioned generation, image reconstruction, and code refinement, improving SArena-Icon Image-to-SVG DINO from 0.903 after SFT to 0.980 and success rate from 90.12% to 99.93%.
Background & Motivation¶
SVG represents images through geometric primitives, paths, and attributes, supporting resolution independence and local object editing. Direct SVG code generation with a vision-language model faces two different problems: syntactically valid code can render incorrect shapes or layouts, while visually plausible outputs can still contain repetitive paths or compressed, difficult-to-edit sequences. Token-level supervision alone does not directly evaluate the rendered image.
SVGen and SVGThinker already introduce chain-of-thought (CoT) before drawing, but explaining a plan does not automatically connect its objects to editable code segments. SVG's native <g> structure provides a way to group the paths belonging to a semantic object. Meanwhile, RLRF and Reason-SVG use rendering rewards for reinforcement learning, but this paper argues that single-task optimization underuses complementary supervision from descriptions, reference images, and defective drafts.
The proposal therefore does more than append reasoning text: it restructures training targets around semantic groups and adds visual correction of flawed SVG programs. Core Idea: align drawing steps with SVG groups, then jointly reward renderability, visual similarity, instruction alignment, and code efficiency across three tasks to produce vector programs that are both accurate and easier to inspect and modify.
Method¶
Overall Architecture¶
CTRL-S is a unified autoregressive model based on Qwen3-VL-8B-Instruct. Text-to-SVG takes a drawing instruction; Image-to-SVG adds a reference image; code refinement also receives a defective SVG draft. All three tasks produce a plan or correction analysis followed by executable SVG, rather than relying on separately trained task-specific models.
Training builds SVG-Sophia, performs SVG token alignment followed by CoT-to-group alignment through two-stage supervised fine-tuning (SFT), and finishes with multi-task, multi-reward GRPO. Inference uses the resulting model alone. Reference images and reference code lengths used for training rewards are not additional inputs required at deployment for Text-to-SVG.
%%{init: {'flowchart': {'rankSpacing': 24, 'nodeSpacing': 28, 'padding': 6, 'wrappingWidth': 400}}}%%
flowchart TD
source["ColorSVG-100K"] --> data["SVG-Sophia Construction"]
data --> align["Two-Stage Structural Alignment"]
sagoge["SAgoge + Qwen3-VL"] --> align
align --> rl["Multi-Task Multi-Reward GRPO"]
rl --> model["Unified CTRL-S Model"]
inputs["Instruction / Reference / Draft"] --> model
model --> output["Plan or Correction Analysis<br/>Grouped SVG Code"]
Key Designs¶
1. SVG-Sophia Construction: annotate visual semantics, drawing steps, and code groups together
The authors obtain SVG programs from ColorSVG-100K and normalize them to a \(128\times128\) viewBox. Claude-Sonnet-4.5 first captions the rendered image, then uses that caption and the original code to restructure the SVG into semantic groups with descriptive comments and a corresponding drawing plan. Refactoring must preserve appearance, so samples are retained only when the refactored and original renderings have SSIM of at least 0.95. The paper also reports review by 100 human annotators for caption accuracy and step-to-group correspondence.
Text and image generation share underlying SVG programs but differ in input modality, each contributing 50K SFT and 5.5K RL samples. The refinement task supplies 31K SFT and 3.4K RL samples through a separate pipeline: train Qwen3-VL-8B to produce drafts, retain moderately flawed examples satisfying \(0.30\leq\mathrm{SSIM}\leq0.95\) against the target, and ask Claude to compare defective and target renderings to write discrepancy analyses and correction reasoning. Rule-based filtering removes irrelevant analyses or claims of complete consistency, followed by human review.
The selection interval avoids filling the refinement data with either correct drafts or almost unrecoverable failures. SVG-Sophia contains 131K SFT and 14.4K RL samples, approximately 145K in the paper's rounded description. Its refinement test set contains another 934 samples with underlying SVG programs disjoint from training; defective drafts come from the SFT model and several general-purpose models to reduce dependence on one error distribution.
2. Two-Stage Structural Alignment: learn SVG representations before connecting plans to editable objects
The first stage adopts InternSVG's SVG-specific token design and samples 1M training instances from SAgoge to stabilize their embeddings. The second stage uses the 131K SVG-Sophia SFT examples to teach a response format consisting of a plan inside <think> followed by hierarchically grouped SVG code. Each reasoning step should correspond to a <g> block instead of leaving all drawing operations in an undifferentiated path sequence.
For example, drawing the balloon body, adding stripes, and placing the basket should leave identifiable structural boundaries in the program. A missing basket can then be understood in terms of a semantic component. This editability originates in the organization of the training targets; the presence of reasoning text alone does not establish faithful internal reasoning or guarantee precise local edits.
The two stages also clarify the data accounting: the 131K/145K entries for CTRL-S in Table 1 describe the SVG-Sophia stages, not the entire training data budget, since the pipeline also uses 1M SAgoge alignment instances.
3. Multi-Task Multi-Reward GRPO: jointly optimize executability, visual fidelity, instruction alignment, and concision
For each task input, the model samples multiple plan-plus-SVG candidates and attempts to render them with CairoSVG. The format reward requires exactly one <think>...</think> block followed by a single successfully rendered SVG code block. Violating these conditions zeros the candidate's entire reward, preventing invalid code from receiving credit through other proxy scores.
Valid candidates receive three additional signals. DINO compares DINOv2 features of the rendering and target image to assess visual structure. Long-CLIP compares the rendering and instruction embeddings to assess textual requirements. Long-CLIP is used because SVG-Sophia instructions often contain several detailed sentences, whereas standard CLIP's 77-token limit can truncate important information. Matching a target appearance and satisfying a description are related but distinct objectives.
The code efficiency reward compares generated and reference SVG lengths to discourage the repetitive, overly long outputs observed after SFT. There is an important reproducibility boundary: equation (9) is corrupted in the local text extraction, so its complete length-reward expression cannot be recovered reliably here. This note does not invent the missing formula; the precise clipping, sign, and normalization require checking the original PDF or implementation. The surrounding prose clearly identifies length comparison and redundancy reduction as its mechanism and purpose.
The gating and weighted aggregation follow equation (10):
GRPO compares rewards within the candidate group for the same input, with advantage \(\hat A_i=(r_i-\mu_{\mathcal G})/(\sigma_{\mathcal G}+\epsilon)\). It uses a clipped policy objective and a KL penalty against the SFT reference policy without training a separate value network. This candidate group is different from an SVG <g> code group.
All three tasks update a shared model. Refinement supplies explicit supervision about what is wrong and how to correct it, rather than merely changing the input format. In Table 3d, adding refinement to joint text-and-image training increases Image-to-SVG DINO from 0.966 to 0.980, consistent with complementary supervision across tasks.
A Worked Example¶
Consider the hot-air-balloon scene in Figure 3, whose description includes a striped balloon, surrounding clouds, and a basket underneath. The model plans the main body, stripes, and accompanying objects before producing corresponding SVG groups. These component names illustrate the workflow rather than reproduce an original reasoning trace.
During training, the same input produces 16 candidates. Malformed candidates receive zero reward; valid ones are rendered and evaluated against the target image, textual requirements, and code length before group-relative policy updates. For refinement, the input additionally contains a defective draft, and analysis focuses on missing or misplaced objects. The final output remains a corrected SVG program, not merely a natural-language suggestion.
Loss & Training¶
The two SFT stages use learning rates of \(10^{-4}\) and \(5\times10^{-5}\), respectively, with a global batch size of 96 on 48 H200 GPUs. RL uses GRPO implemented in verl on 32 GPUs; the main text does not repeat the GPU model for this stage.
RL uses a global batch size of 128, a learning rate of \(10^{-5}\), and 16 responses per prompt for 2 epochs, taking approximately 12 hours. This duration covers RL only, not annotation and the preceding two SFT stages.
Key Experimental Results¶
Main Results¶
The following selection comes from Table 1 on SArena-Icon. T2S denotes Text-to-SVG and I2S denotes Image-to-SVG. SR is generation success rate, not perfect semantic or geometric correctness. Higher DINO and SSIM are better; lower FID and LPIPS are better. Tokens follow the source table and should not be treated as tokenizer-independent computational cost across models.
| Model | T2S FID | T2S CLIP-T2I | T2S SR | T2S Tokens | I2S DINO | I2S SSIM | I2S LPIPS | I2S SR | I2S Tokens |
|---|---|---|---|---|---|---|---|---|---|
| InternSVG-8B | 8.715 | 23.916 | 97.24% | 1.0k | 0.949 | 0.811 | 0.127 | 94.45% | 1.3k |
| Gemini-3-Pro | 13.203 | 25.731 | 96.91% | 397 | 0.940 | 0.723 | 0.198 | 97.14% | 769 |
| CTRL-S (SFT) | 18.154 | 23.655 | 92.02% | 1.1k | 0.903 | 0.717 | 0.187 | 90.12% | 1.4k |
| CTRL-S (SFT+RL) | 11.584 | 25.944 | 99.85% | 346 | 0.980 | 0.835 | 0.098 | 99.93% | 512 |
CTRL-S does not lead every metric in this table. InternSVG-8B has lower T2S FID, while Gemini-3-Pro has CLIP-I2I of 84.157 versus CTRL-S's 82.291. The traditional optimization method LIVE also achieves better I2S SSIM and LPIPS, at 0.986 and 0.024. The supported conclusion is competitive generation efficiency and strong performance on several quality measures, not universal superiority over vectorization methods.
The next table selects refinement results from Table 2, evaluated on 934 test samples.
| Model | DINO | SSIM | LPIPS | SR | Tokens |
|---|---|---|---|---|---|
| GPT-5.2 | 0.911 | 0.640 | 0.342 | 99.26% | 975 |
| CTRL-S (SFT) | 0.888 | 0.665 | 0.236 | 84.37% | 2.9k |
| CTRL-S (SFT+RL) | 0.951 | 0.765 | 0.180 | 99.79% | 866 |
Direct subtraction of the SFT and RL rows gives a DINO increase of 0.063, an SSIM increase of 0.100, and an LPIPS reduction of 0.056. The source table's improvement row instead reports 0.067, 0.126, and 0.104, which do not match these rows. This note uses the original result rows rather than that improvement row.
Ablation Study¶
Table 3b compares reward configurations for T2S. The full reward uses \(2:1:1\) weights; the first two configurations below follow the source labels and should not be interpreted as a perfectly controlled addition of one term with all other weights fixed.
| Reward Configuration | FID | CLIP-T2I | CLIP-I2I | Tokens | Seconds/SVG |
|---|---|---|---|---|---|
| Format gate + DINO | 12.443 | 24.573 | 80.897 | 606 | 6.151 |
| Format gate + DINO + Long-CLIP | 11.831 | 25.444 | 82.070 | 701 | 7.121 |
| Full total reward | 11.584 | 25.944 | 82.291 | 346 | 4.439 |
Key Findings¶
- Relative to the configuration without the efficiency term, Table 3b's full reward reduces tokens from 701 to 346 and latency from 7.121 to 4.439 seconds/SVG, while CLIP-T2I rises from 25.444 to 25.944. Shorter code need not sacrifice the visual quality measured in this experiment.
- In Table 3a, RL with/without CoT obtains I2S DINO of 0.980/0.961 and T2S token counts of 346/274. CoT is not a free speed improvement, and this comparison also removes Claude-refactored structured code, so the entire difference cannot be attributed to reasoning text alone.
- Table 4 evaluates SArena-Illustration without illustration training data: CTRL-S achieves T2S FID of 21.832 and I2S DINO of 0.952. I2S outputs contain 1.4k tokens versus InternSVG-8B's 7.7k. This generalization claim is limited to the evaluated illustration benchmark.
Highlights & Insights¶
- Aligning reasoning steps with
<g>blocks attaches explanations to manipulable code objects. Compared with merely appending CoT, it creates a clearer structural entry point for later local edits. - Renderability gates the reward instead of supplying another additive bonus. For executable-artifact generation, this excludes invalid candidates with high proxy scores, although it does not resolve every form of reward gaming.
- Refinement teaches visual differences through failed examples. Its benefit to generation suggests that controlled defective drafts may provide more targeted supervision than simply adding more correct examples.
Limitations & Future Work¶
- The main paper has no dedicated limitations section. The concerns here follow from evaluation scope and reproducibility: training centers on ColorSVG icons, and illustration transfer does not establish performance on complex engineering drawings, animated SVG, or complete interactive editing workflows.
- The CoT ablation changes both reasoning supervision and code refactoring. A cleaner comparison would keep grouped code fixed and vary only CoT output; readability and editability claims also lack dedicated human editing-efficiency measurements.
- DINO and Long-CLIP are proxy metrics, so high scores cannot guarantee every geometric detail or instruction constraint. Local object matching, topology constraints, and real editing-task evaluations are useful next steps.
- The pipeline includes 1M alignment instances, human review, and multi-GPU RL; 145K samples and 12 hours do not describe its full cost. The corrupted extraction of equation (9) and inconsistent Table 2 improvement row should also be checked against the original PDF and implementation before reproduction.
Related Work & Insights¶
- vs InternSVG: CTRL-S adopts its SVG-specific tokens and uses SAgoge for alignment. Its main additions are structured CoT data and multi-task, multi-reward post-training, not a wholly new SVG representation.
- vs SVGen / SVGThinker: All use explicit planning; CTRL-S emphasizes correspondence between steps and SVG groups and jointly trains image-conditioned generation and refinement.
- vs RLRF / Reason-SVG: All use rendering feedback and GRPO. CTRL-S integrates visual, long-text, format, and length signals in one multi-task pipeline; the transferable idea is to reward the final executable artifact, not to copy the exact reward weights.
- vs LIVE / DiffVG: Instance-level optimization retains stronger results on some reconstruction metrics. CTRL-S targets unified conditional generation and code refinement, so its position should consider speed, input modality, and editable structure rather than a single visual score.
Rating¶
- Novelty: 4/5. SVG group alignment and three-task post-training form a targeted combination, although GRPO and rendering rewards have precedents.
- Experimental Thoroughness: 4/5. Generation, refinement, illustration transfer, and several ablations are included, but clean CoT causal controls and editing user studies are missing.
- Writing Quality: 3/5. The pipeline is clear, but Table 2 has inconsistent improvement values and some best-performance claims require a narrower comparison scope.
- Value: 4/5. Structured training for executable visual code is useful, subject to training cost and untested complex-scene boundaries.