用连续数值建模提升SVG生成效率与质量
From Tokens to Numbers: Continuous Number Modeling for SVG Generation
- 将数字直接作为连续值建模,避免离散化编码
- 训练速度提升30%以上,视觉保真度更高
- 适合需要高质量矢量图生成的研究者与开发者
在某些图像生成任务中,矢量图形(如SVG)具有灵活性强、尺寸高效和易编辑等优势,但相较于基于像素的方法仍较少被研究。核心挑战在于,构成SVG的大量数值几何参数若以长序列标记符编码,会导致训练缓慢、精度下降且泛化能力差。为此,我们提出连续数字符号建模(CNM),将数字作为第一类连续值直接建模,而非离散标记符。该方法恢复了表示的数学优美性,消除了标记编码引入的离散化误差。我们在200万张栅格到SVG样本上训练多模态Transformer,并通过感知反馈的强化学习进行微调,进一步提升视觉质量。实验表明,该方法训练速度提升超过30%,同时保持更高的感知保真度。本工作证明了CNM在高质量矢量生成中的实用性和高效性,具备广泛应用潜力。代码已开源:http://github.com/mikeogezi/CNM。
原文摘要 · Abstract (English)
For certain image generation tasks, vector graphics such as Scalable Vector Graphics (SVGs) offer clear benefits such as increased flexibility, size efficiency, and editing ease, but remain less explored than raster-based approaches. A core challenge is that the numerical, geometric parameters, which make up a large proportion of SVGs, are inefficiently encoded as long sequences of tokens. This slows training, reduces accuracy, and hurts generalization. To address these problems, we propose Continuous Number Modeling (CNM), an approach that directly models numbers as first-class, continuous values rather than discrete tokens. This formulation restores the mathematical elegance of the representation by aligning the model's inputs with the data's continuous nature, removing discretization artifacts introduced by token-based encoding. We then train a multimodal transformer on 2 million raster-to-SVG samples, followed by fine-tuning via reinforcement learning using perceptual feedback to further improve visual quality. Our approach improves training speed by over 30% while maintaining higher perceptual fidelity compared to alternative approaches. This work establishes CNM as a practical and efficient approach for high-quality vector generation, with potential for broader applications. We make our code available http://github.com/mikeogezi/CNM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。