Scalable Vector Graphics (SVG) are the gold standard for web and UI design, prized for their resolution independence and structural editability. However, animating SVGs using artificial intelligence remains a formidable challenge. It requires bridging discrete code representations with continuous, fluid visual dynamics.
Existing approaches typically fall into two flawed paradigms. Optimization-based methods (like LiveSketch) often treat vector strokes as independent entities, leading to "topological collapse" where closed shapes break apart or flicker during motion. Conversely, general-purpose LLMs rely on rigid CSS or SMIL transformations. While this preserves structure, it limits motion to basic translations, rotations, and scaling, failing entirely at "non-rigid" deformations like a waving flag or a morphing droplet. Furthermore, generating verbose SVG code frame-by-frame quickly exhausts an LLM's context window and causes "identity drift," where an object's color or shape inadvertently changes.
To overcome these limitations, researchers have introduced VAnim, the first LLM-based framework specifically designed for open-domain text-to-SVG animation. VAnim achieves high-fidelity, non-rigid motion while maintaining perfect editability and topological consistency.
The VAnim Framework: Core Innovations
VAnim shifts the animation paradigm from generating sequences of images (or full code blocks) to modeling Sparse State Updates (SSU) on a persistent SVG Document Object Model (DOM) tree.
1. Sparse State Updates (SSU)
Redundancy is the enemy of efficient code generation; over 85% of SVG syntax remains unchanged between adjacent frames. Instead of rewriting the entire SVG for every frame, VAnim only predicts the attributes that change—such as a specific coordinate in a path or a transformation matrix. This "diff-based" approach compresses the sequence length by over 9.8×, solves the context explosion problem, and mathematically guarantees that non-moving parts of the graphic remain identical.
2. Identification-First Motion Planning
To ensure the model knows exactly what it is moving, VAnim employs a two-stage reasoning process. It first grounds textual instructions in explicit visual entities by identifying which SVG IDs correspond to the prompt (e.g., "ID 05 is the blue circle"). Only after mapping these semantic entities does it plan the motion for those specific IDs, preventing the "exploded view" look common in previous vector generation attempts.
3. Rendering-Aware Reinforcement Learning
SVG rendering is inherently non-differentiable, making it difficult to map pixel-level visual feedback back to discrete code. Initial experiments using standard Supervised Fine-Tuning (SFT) revealed a "conservative motion" bias, where models produced minimal, jittery updates.
To fix this, the authors implemented Group Relative Policy Optimization (GRPO). By rendering the generated code into a video and using a pre-trained video perception encoder (PE-Core) to provide a hybrid reward signal, VAnim "closes the loop." This reinforcement learning stage pushes the model to execute full, expressive deformations, aligning discrete code updates with high-fidelity visual feedback.
SVGAnim-134k: A New Benchmark
To train and evaluate VAnim, the researchers introduced SVGAnim-134k, the first large-scale dataset for vector animation. Sourced from industry-standard Lottie files, it contains 134,000 high-quality, professionally authored vector animations. The dataset spans UI components, loading indicators, and complex organic entities (like animals and nature) that require non-rigid motion, all paired with linguistically diverse prompts and structured reasoning chains.
Key Results
VAnim demonstrates a robust capacity for synthesizing high-fidelity non-rigid deformations without requiring explicit temporal consistency constraints. Key achievements include:
- 100% Code Validity: VAnim achieved a 100% success rate in generating valid, renderable code, significantly outperforming generalist models like GPT-5.2 (88.5%) and Gemini 3 Pro (86.2%).
- Semantic Alignment: It outperformed all baselines in matching the animation to the text prompt, particularly in complex scenarios involving multi-object interaction and sequential logic.
- Long-Horizon Efficiency: The SSU representation enabled the generation of long-horizon animations (24+ frames) that would typically crash a standard LLM's context window.
- Qualitative Superiority: VAnim successfully executes complex non-rigid tasks—like "folding" shapes, "flapping" wings, and "scrolling" elements—where rigid-motion baselines either fail to move or distort the object's identity.
Limitations and Future Directions
While VAnim represents a massive leap forward, it has limitations. The current model assumes a static topology, meaning it cannot handle animations that require adding or deleting DOM nodes (e.g., a firework exploding into new sparks). Additionally, it is primarily trained on cleanly structured Lottie-style graphics; its performance on messy, hand-authored SVGs with inconsistent naming conventions remains an open question. Finally, the rendering-aware RL stage is computationally expensive.
Future work will aim to extend the framework to handle interactive behaviors, such as animations triggered by JavaScript events, and to generate longer, multi-scene narrative illustrations.
Summary updated