arXiv:2604.05072cs.LG2026-04

提出分层令牌化方法,让矢量图生成更高效准确

Hierarchical SVG Tokenization: Learning Compact Visual Programs for Scalable Vector Graphics Modeling

  • 将SVG分解为原子与几何约束片段令牌,提升结构表达
  • 在文本和图像转矢量图任务中,生成精度与空间一致性显著提升
  • 适合需要高质量矢量图生成的AI设计与自动化工具开发者

近年来大语言模型将SVG生成从可微渲染优化转向自回归程序合成。但现有方法仍沿用自然语言处理中的字节级令牌化,无法反映矢量图形的几何结构。数值坐标被拆分为离散符号,破坏空间关系并引入严重冗余,常导致坐标幻觉和长序列生成效率低下。为此,我们提出面向自回归矢量图生成的分层令牌化框架HiVG。HiVG将原始SVG字符串分解为结构化的原子令牌,并将可执行命令-参数组压缩为几何约束的片段令牌,显著提升序列效率同时保持语法有效性。为缓解空间错位,引入分层均值-噪声(HMN)初始化策略,在新令牌嵌入中注入数值排序信号与语义先验。结合逐步增加程序复杂度的课程训练范式,使可执行SVG程序的学习更加稳定。在文本到SVG和图像到SVG任务上的大量实验表明,相比传统令牌化方案,本方法在生成保真度、空间一致性和序列效率上均有显著提升。代码已公开于https://github.com/ximinng/HiVG。

原文摘要 · Abstract (English)

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 \textit{atomic tokens} and further compresses executable command--parameter groups into geometry-constrained \textit{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

矢量生成令牌化结构建模

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。