Recent large language models have shifted SVG generation from differentiable rendering optimization to autoregressive program synthesis. However, existing approaches still rely on generic byte-level tokenization inherited from natural language processing, which poorly reflects the geometric structure of vector graphics. Numerical coordinates are fragmented into discrete symbols, destroying spatial relationships and introducing severe token redundancy, often leading to coordinate hallucination and inefficient long-sequence generation. To address these challenges, we propose HiVG, a hierarchical SVG tokenization framework tailored for autoregressive vector graphics generation. HiVG decomposes raw SVG strings into structured atomic tokens and further compresses executable command--parameter groups into geometry-constrained segment tokens, substantially improving sequence efficiency while preserving syntactic validity. To further mitigate spatial mismatch, we introduce a Hierarchical Mean--Noise (HMN) initialization strategy that injects numerical ordering signals and semantic priors into new token embeddings. Combined with a curriculum training paradigm that progressively increases program complexity, HiVG enables more stable learning of executable SVG programs. Extensive experiments on both text-to-SVG and image-to-SVG tasks demonstrate improved generation fidelity, spatial consistency, and sequence efficiency compared with conventional tokenization schemes. Our code is publicly available at https://github.com/ximinng/HiVG
Figures & tables
Figure 1: Sequence-length compression, token-efficient scaling, and human evaluation. (a) HiVG tokenization compresses SVG sequences by 62.7%–63.8% (2.68 × –2.76 × ). (b) HiVG reaches comparable quality with approximately 2.7 × fewer training tokens. (c) HiVG achieves the best human evaluation results, scoring 4.06 in usability and winning 58.9%–70.8% in pairwise comparisons against baselines.
Figure 2: Comparison of SVG tokenization strategies. (a) A generic LLM tokenizer [ 42 , 2 ] treats SVG as plain text and splits it into subword tokens, producing long token sequences. (b) An SVG-aware tokenizer [ 37 , 32 ] improves structural awareness by tokenizing SVG elements and attributes, but geometric primitives remain fragmented into many numeric coordinate tokens. (c) Our HiVG tokenizer introduces a hierarchical representation that groups drawing commands together with their associated coordinates into reusable segment tokens, enabling substantial sequence compression (10 → 7 → 2).
Figure 3: Overview of HiVG. (a) Hierarchical SVG Tokenization ( Sec. 3.1 ). Raw SVG strings are first decomposed into atomic tokens and further compressed into executable segment tokens via structure-aware merging. Only complete command–parameter units are merged to ensure geometric validity. (b) Structure Segment Learning . Segment tokens are learned from a large SVG corpus by discovering renderable command–coordinate groups while discarding merges that violate syntactic or geometric constraints. (c) Model Architecture . Atomic and Segment tokens extend the embedding space of the base LLM, while training progressively increases program depth to stabilize structural abstraction and global composition.
Figure 4: Learned segment tokens as renderable geometric primitives . Segment-level merging preserves syntactic validity and geometric coherence while shortening token sequences and improving efficiency.
Figure 5: HMN initialization for structured SVG tokens . Each new token is initialized by combining a global mean-noise prior with a semantic embedding from its textual description; for coordinate tokens, an additional numeric embedding derived from the normalized value through Gaussian–Polynomial basis encoding is added, while non-numeric tokens omit the numeric branch.
Figure 6: Image-to-SVG generation results. For each example, the raster input image is shown on the right and the generated SVG rendering on the left. The examples include icons, logos, typography, UI elements, and emoji-style graphics.
Figure 8: Text-to-SVG comparison. Each row corresponds to a text prompt (left). Columns show SVG renderings generated by different methods. Compared with existing models, HiVG produces SVG outputs with more consistent layout structure and better alignment with the prompt description.
Method
Img2SVG
Text2SVG
SSIM ↑
LPIPS ↓
CLIP-S ↑
PickS ↑
HPS ↑
Aes ↑
CLIP ↑
PickS ↑
HPS ↑
Aes ↑
DeepSeekv3.2 [ 5 ]
-
-
-
-
-
-
0.272
20.331
0.192
4.594
Qwen3.5 Plus [ 21 ]
0.775
0.228
0.896
22.019
0.175
4.672
0.291
20.972
0.206
4.671
Gemini-2.5-pro [ 9 ]
0.790
0.215
0.904
22.346
0.185
4.732
0.284
20.943
0.210
4.765
GPT-5.2 [ 18 ]
0.780
0.205
0.930
23.977
0.222
4.841
0.291
21.268
0.214
4.806
Claude-Sonnet-4.5 [ 1 ]
0.669
0.292
0.842
22.012
0.164
4.435
0.281
20.562
0.195
4.711
Table 1: Quantitative comparison on Img2SVG and Text2SVG tasks. ‘-’ denotes the method can only accept text input.
Variant
Text-to-SVG
Image-to-SVG
CLIP ↑
DINO ↑
HPS ↑
PickS ↑
Aes ↑
SSIM ↑
LPIPS ↓
CLIP-S ↑
HPS ↑
PickS ↑
Aes ↑
AR baseline †
0.2146
0.1520
0.162
19.628
4.548
0.301
0.396
0.797
0.179
19.793
4.553
Ours
0.2392
0.2795
0.194
20.576
4.632
0.896
0.114
0.957
0.221
21.652
4.681
Improvement
+11.5%
+83.9%
+19.8%
+4.8%
+1.8%
+197.7%
-39.3%
+20.1%
+23.5%
+9.4%
+2.8%
Table 2: Impact of structured SVG modeling. ↑ higher is better, ↓ lower is better. † AR baseline trains on raw SVG string. “Aes” denotes the Aesthetic score.
Scale
Tokenization Stats
Text-to-SVG
Image-to-SVG
Avg Toks
Raw → AT
AT → ST
CLIP ↑
DINO ↑
HPS ↑
PickS ↑
Aes ↑
SSIM ↑
LPIPS ↓
CLIP-S ↑
HPS ↑
PickS ↑
Aes ↑
D50k
317
2.59x
1.03x
0.2158
0.4072
0.157
19.398
4.412
0.696
0.313
0.803
0.174
19.710
4.398
Δ50k→500k
+301
+0.04 ×
+0.01 ×
+4.6%
-3.3%
+9.6%
+3.0%
+2.4%
+9.1%
-26.5%
+10.7%
+13.8%
+5.5%
+3.5%
D500k
618
2.63x
1.04x
0.2257
0.3938
0.172
19.981
4.518
0.759
0.230
0.889
0.198
20.791
4.551
Δ500k→1.5M
-66
0.00 ×
+0.01 ×
+1.2%
-2.3%
+3.5%
+0.7%
+1.0%
+2.4%
-9.6%
+2.4%
+3.5%
+1.3%
+0.8%
D1.5M
552
2.63x
1.05x
0.2283
0.3848
0.178
20.113
4.564
0.777
0.208
0.910
0.205
21.056
4.587
Table 3: Effect of Structure Segment Learning (SSL) corpus scale. Dataset statistics and evaluation metrics are reported on both Text-to-SVG and Image-to-SVG tasks. All models use M=500 merges. AT: Atomic Token, ST: Segment Token. Delta rows show changes from previous scale.
#
Method
Components
Img2SVG
Text2SVG
Semantic
Numeric
LPIPS ↓
SSIM ↑
CLIP-S ↑
CLIP ↑
PickScore ↑
HPS ↑
Aes ↑
1
Noise
✗
✗
0.226
0.440
0.795
0.207
19.831
0.144
4.250
2
Mean
✗
✗
0.242
0.244
0.755
0.195
20.110
0.142
4.830
3
Mean+Noise
✗
✗
0.237
0.523
0.821
0.205
19.645
0.137
4.785
4
Semantic
✓
✗
0.236
0.477
0.811
0.205
19.535
0.132
4.675
5
Semantic+Noise
✓
✗
0.233
0.550
0.830
0.206
19.585
0.135
4.715
Table 4: Ablation on token embedding initialization strategies. We report image-to-SVG reconstruction metrics and text-to-SVG generation quality after 1 epoch of training. Bold : best result; underline : second best. All methods use the same ∼3,000 SVG tokens and identical training hyperparameters. † Lerp: linear interpolation between text embeddings of “0” and “784”, which does not preserve numeric semantics due to character-level BPE tokenization of digit strings.
Validity / Efficiency
Visual Similarity
Preference / Aesthetic
Method
Render ↑
TokCnt
PathCnt
CmdCnt
SSIM ↑
LPIPS ↓
CLIP-S ↑
ImgR ↑
HPS ↑
PickS ↑
Aes ↑
Stage1-L1
95.20%
273
3.5
54.8
0.8052±0.13
0.1716±0.09
0.9360±0.07
-0.0764
0.2110
21.348
4.6159
Stage1-L2
94.20%
489
5.9
107.2
0.7223±0.13
0.2392±0.09
0.8884±0.10
-0.1836
0.2026
20.945
4.6175
Stage1-L3
90.09%
656
6.7
144.2
0.7015±0.13
0.2405±0.10
0.8750±0.11
-0.2500
0.2050
21.015
4.6285
Δ S1 → S2
+0.2%
+27.0%
+15.3%
+19.5%
+4.1%
-19.7%
+4.9%
+151.7%
+5.9%
+21.0%
+1.3%
Stage2-L1
93.50%
335
4.8
70.4
0.8152±0.12
0.1611±0.08
0.9540±0.06
0.0294
0.2150
21.522
4.6226
Table 5: Effect of three-stage curriculum training on Image-to-SVG with stage-to-stage changes. ↑ higher is better, ↓ lower is better. Delta rows show changes from previous stage (positive values indicate improvement for ↑ metrics).
Validity / Efficiency
Semantic
Diversity
Preference / Aesthetic
Method
Render ↑
TokCnt ↓
PathCnt ↓
CmdCnt ↓
CLIP ↑
DINO ↑
ImgR ↑
HPS ↑
PickS ↑
Aes ↑
Stage1-L1
95.60%
288
3.1
60.9
0.2346
0.2949
-0.4789
0.1909
20.552
4.5891
Stage1-L2
95.37%
403
4.3
89.7
0.2322
0.3535
-0.7787
0.1751
20.046
4.5663
Stage1-L3
94.08%
446
5.3
104.9
0.2305
0.4015
-0.8520
0.1730
19.895
4.5580
Δ S1 → S2
-0.8%
+58.1%
+37.2%
+52.4%
+0.6%
-1.3%
+19.3%
+5.1%
+1.2%
+0.6%
Stage2-L1
95.45%
428
4.3
87.6
0.2356
0.2931
-0.3768
0.1953
20.643
4.6279
Table 6: Effect of three-stage curriculum training on Text-to-SVG with stage-to-stage changes. ↑ indicates higher is better, ↓ indicates lower is better. Delta rows show changes from previous stage (positive values indicate improvement for ↑ metrics).
Figure 10: Analysis of structural noise and learned segment properties. (a) Cleaning statistics: Commands removed per sample across data scales; noise is primarily concentrated in l , c , and h types. (b) Redundancy patterns: Frequency mass of strictly degenerate patterns, where <d_0><d_0> pairs represent the most prevalent redundant structure. (c) Command distribution: Relative share of command types within segments across frequency buckets; complex commands like cubic Béziers ( c ) and arcs ( a ) are well-captured. (d) Token length: Atomic token length distribution shows a stable median of ∼ 9 tokens, indicating consistent segment complexity regardless of frequency.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Semantic Layering ↑
Editability ↑
Redundancy Control ↑
Overall Code Usability ↑
SVGen-7B [ 31 ]
2.88
2.83
2.74
2.82
InternSVG-8B [ 32 ]
3.22
3.18
3.09
3.16
Gemini-2.5-pro [ 4 ]
3.39
3.34
3.23
3.32
GPT-5.2 [ 18 ]
3.56
3.49
3.37
3.47
HiVG-3B
4.11
4.05
3.96
4.06
Appendix
Table S1 : Expert review of SVG code usability in Adobe Illustrator. Eight professional SVG practitioners import the generated SVGs into Adobe Illustrator and score their structural usability on a 1–5 Likert scale. Higher is better for all metrics.
Figure S1 : Text-to-SVG generation results. For each example, we show the text prompt together with the rendered SVG output generated by HiVG.
Figure S2 : Image-to-SVG generation results. For each example, the raster input image is shown on the right and the generated SVG rendering on the left.
Figure S3 : Additional Image-to-SVG comparison.
Figure S4 : Additional Text-to-SVG comparison.
Hyperparameter
HiVG
Architecture / Tokenization
Backbone model
Qwen2.5-VL-3B-Instruct
Canvas size
784×784
Atomic token range
30 – 1000
Number of curriculum stages
3
Context length scaling
progressive across stages
Appendix
Table S2 : Hyperparameter settings of HiVG.
Figure S5 : Training templates for text- and image-conditioned SVG token generation. For text-to-SVG Token generation (T2ST), the model takes a textual description as input and autoregressively predicts hierarchical SVG tokens. For image-to-SVG Token generation (I2ST), an image placeholder ( <image> ) is inserted into the user turn, and the model outputs the corresponding SVG token sequence under the same conversational format. Using unified templates across both tasks simplifies multi-task training and keeps the supervision interface consistent.
Figure S6 : Structural noise patterns in raw SVGs. Redundant command groups and zero-move operations contribute no meaningful geometry to the rendered image, yet they artificially inflate token length and degrade computational efficiency.
Scalable Vector Graphics (SVGs) power much of the modern visual ecosystem, yet state-of-the-art generative models focus almost entirely on rasterized images. We explore whether inference-time methods can unlock SVG generation capabilities in off-the-shelf vision-language models (VLMs). We systematically evaluate a constrained iterative refinement harness that combines visual feedback, structured editing, and constrained decoding to characterize the capabilities and limitations of current VLMs for SVG generation. Across multiple VLMs and generation settings, we find that constrained decoding improves compilation success rates, while iterative refinement reveals a deficit in visual reasoning and self-correction. Our results highlight both the promise and current limitations of using inference-time methods to adapt general-purpose VLMs for SVG generation.
Matthew Perlman, James Beetham, Niels Da Vitoria Lobo +2
University of Massachusetts Amherst · University of Central Florida
Scalable Vector Graphics are a fundamental medium for resolution-independent visual content, yet the deep learning community lacks a continuous, dense, and invertible latent space for vector representations, the kind of foundational building block that Variational Autoencoders and their descendants have long provided for raster images. We introduce SLS (SVG Latent Space), a Transformer-based autoencoder that learns compact dense representations of individual SVG paths, the atomic visual elements from which any SVG image can be composed. By modeling SVG commands, coordinate data, and visual properties within a unified BPE-based token vocabulary, SLS learns fixed-size latent representations that jointly capture structure and appearance, and can be decoded back into valid, style-consistent SVG paths with high fidelity. The resulting embedding space is robust, invertible, and structured: embeddings lie on a unit hypersphere, enabling efficient similarity search, composition, and downstream conditioning through simple vector-space operations. Finally, we demonstrate that SLS generalizes across diverse tasks reducing their FLOPs by over 150 times compared to token-based approaches, and establishing a general-purpose latent foundation for vector graphics research.
Autoregressive large models have recently advanced Text-to-SVG generation from simple icons to complex, long-context graphics, yet standard autoregressive decoding often fails to maintain global consistency across geometry, layout, occlusion, and composition. We introduce CANVAS (Consistency-Aware Navigation via Visual Adaptive Sampling), a training-free, render-aware inference framework that combines power-sharpened trajectory likelihood with visual feedback from rendered futures and derives a stroke-wise navigation rule. It effectively estimates each candidate stroke's future value under a limited generation and rendering budget and adaptively allocates samples according to candidate uncertainty, decision influence, and rollout cost. Experiments across multiple autoregressive SVG backbones and complementary benchmarks demonstrate improvements in global consistency, which includes sound geometric relationships, spatial layouts, occlusion ordering, and overall composition, without additional training, demonstrating the effectiveness and generalization ability of our framework.
Yichen Wu, Haoxuan Qu, Yihang Lou +2
University of Nottingham · Lancaster University · Peking University