All models

LLM4SVG

GPT-2 XL extended with learnable SVG tokens to understand and generate vector graphics.

Language · 1,944 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (6 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
1.6B
Operations
1,944
Framework
PyTorch
Recurrent
No
Published
CVPR 2025
Cited by
10 (as of 24 October 2026)
Authors
Ximing Xing, Juncheng Hu, Guotao Liang and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m17795
Graph hash
9ec2576fe1480336373b8b2d45b650fe5e5cc888feb7a0880378b3f5d39dd269
Skeleton hash
227ff53384c03fd40d0352bfdeb75eb384d524de0fa3ab3212378fa3185b1558
Architecture hash
e7fb41b4a23018a94e4059079b8fb345be2365874d81ecd3ccee776a393211b1
Diagram SHA-256
1d4a22f5b55e27f985e727cfdbfd9661324405cc3ef97d844e4b15deea5edbe1
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

LLM4SVG adapts existing large language models so that they can understand and generate scalable vector graphics (SVG). The paper argues that a language model's ambiguous tokenized representation of SVG can lead to hallucinated vector primitives, and that training without a notion of the rendering order of paths can lead to shapes that occlude one another.

The central change is a set of learnable SVG semantic tokens. The paper defines 55 of them, covering tags, attributes and path commands, and uses them to replace all tags and attributes in the SVG source code. A path tag, for example, becomes a single SVG semantic token instead of being encoded as regular text. Each new token is initialized from the semantic average of its descriptive text.

Training is instruction tuning with the language model's original auto-regressive objective, on the authors' SVGX-SFT dataset of human-designed SVGs and 580k instruction-following examples. It covers two tasks: describing a given SVG, and generating an SVG from a text prompt. The paper chose GPT2, Phi-2 and Falcon as base language models, and the official code also lists GPT2-XL, the base used for the model shown here.

Key idea. LLM4SVG adds learnable SVG semantic tokens and instruction tuning on the SVGX-SFT dataset so that existing large language models can understand and generate vector graphics.

  • LLM4SVG
  • SVG generation
  • vector graphics generation
  • text to SVG
  • SVG understanding
  • scalable vector graphics
  • SVG semantic tokens
  • SVGX-SFT
  • LLM for vector graphics

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{xing2025empoweringllmsunderstandgenerate,
      title={Empowering LLMs to Understand and Generate Complex Vector Graphics}, 
      author={Ximing Xing and Juncheng Hu and Guotao Liang and Jing Zhang and Dong Xu and Qian Yu},
      year={2025},
      eprint={2412.11102},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2412.11102}, 
}