FastVAR: Linear Visual Autoregressive Modeling via Cached Token Pruning

Hang Guo, Yawei Li, Taolin Zhang, Jiangshan Wang, Tao Dai, Shu-Tao Xia, Luca Benini

TL;DR

This paper introduces FastVAR, a novel post-training acceleration technique for Visual Autoregressive (VAR) models that significantly speeds up high-resolution image generation. By intelligently pruning tokens at later, less critical stages of generation and caching information from earlier stages, FastVAR achieves substantial speedups with minimal quality degradation, enabling efficient generation of large images like 2K on consumer hardware.

What Problem Does This Paper Address?

Visual Autoregressive (VAR) models have emerged as a powerful alternative to diffusion models for image generation, offering a "next-scale" prediction paradigm that reduces the number of generation steps. However, a critical bottleneck for VAR models is their computational complexity and runtime latency, which scale quadratically with image resolution. This is because, at each generation step, VAR models process the entire token map, leading to an O(n^4) complexity in attention layers for an n x n image. This makes generating high-resolution images (e.g., 2K) prohibitively slow and memory-intensive, even with optimizations like FlashAttention. The paper aims to bridge this gap by making VAR models scale efficiently to higher resolutions.

Methods

FastVAR is a post-training acceleration method, meaning it doesn't require retraining the VAR model. Its core innovation lies in "cached token pruning," which leverages two key observations:

  1. Large-scale steps are speed bottlenecks but robust: The later stages of VAR generation, where the image resolution is high, contribute most to the runtime. These stages are also more resilient to token pruning without significant performance drops.
  2. High-frequency modeling matters at large scales: Analysis shows that in later stages, VAR models focus on generating high-frequency details (textures), while low-frequency components (outlines) have largely converged.

Based on these insights, FastVAR employs:

  • Pivotal Token Selection (PTS): This technique identifies and retains only the most important (high-frequency) tokens at large-scale steps. It approximates frequency characteristics by calculating the difference between the input token map and its spatially global average (DC component), then using the L2 norm of the high-frequency component as a score to select the top-K pivotal tokens.
  • Cached Token Restoration (CTR): To compensate for the pruned tokens and maintain the 2D image structure, FastVAR caches the output of the last "Structure Construction Stage" (early, low-resolution steps). When restoring pruned tokens, it upsamples this cached map and uses it to fill in the pruned slots. This leverages the observed cross-scale attention correlations.

FastVAR applies these techniques only to the "Texture Filling Stage" (large-scale steps), keeping the early "Structure Construction Stage" as is to preserve structural integrity.

Datasets

The paper evaluates FastVAR on standard text-to-image generation benchmarks. Specific datasets mentioned for evaluation include:

  • GenEval [20]: Used for evaluating quality-efficiency trade-offs at 1024x1024 resolution.
  • MJHQ30K [29]: Used for validating perceptual quality across different categories (landscape, people, food) at 1024x1024 resolution.

The paper does not introduce new datasets.

Key Insights and Ideas

  • The "late-stage, high-frequency" hypothesis: The observation that later generation stages primarily refine high-frequency details is crucial. This allows for aggressive pruning of less informative tokens without sacrificing overall image quality.
  • Cross-scale attention as a restoration guide: The strong diagonal sparsity in cross-scale attention maps reveals that tokens are correlated with their counterparts in previous scales. This insight justifies the use of cached tokens for restoration, enabling efficient compensation for pruned information.
  • Training-free acceleration: The fact that FastVAR is a post-training method makes it highly practical, as it can be applied to existing pre-trained VAR models without the need for costly retraining.
  • Orthogonal acceleration: FastVAR can be combined with other acceleration techniques like FlashAttention, leading to synergistic speedups.

Key Results

  • Significant Speedup: FastVAR can accelerate FlashAttention-accelerated VAR models by 2.7x with a negligible performance drop of <1%.
  • High-Resolution Generation: FastVAR enables zero-shot generation of larger images. For example, it can generate a 2K image with a 15GB memory footprint in 1.5s on a single NVIDIA 3090 GPU.
  • Quality Preservation: Experiments show that FastVAR maintains high perceptual quality, with FID scores comparable to or even better than baselines in some categories (e.g., HART+FastVAR achieved FID reduction of 2.42 on the "people" category on MJHQ30K).
  • Memory Reduction: Combining FastVAR with FlashAttention reduces GPU memory usage by 20.4% compared to FlashAttention alone.
  • Comparison with ToMe: FastVAR outperforms token merging methods like ToMe in terms of speedup and quality preservation, achieving 1.7x higher speedup with better FID performance.

Limitations and Future Work

  • Pruning Ratio Sensitivity: The paper notes that an "over-large pruning ratio" can lead to performance degradation due to information loss. They propose a moderate pruning ratio (40%-75%) and a progressive schedule for optimal balance.
  • Cache Choice: While they mention providing further details on the choice of the caching step (K-N) in the supplement, the paper itself doesn't deeply explore alternative caching strategies.
  • Future Work: The authors suggest that FastVAR's ability to approximate linear complexity opens doors for even larger resolutions and more efficient VAR generation. The orthogonal combination with other acceleration techniques also points towards further optimization possibilities.

Summary updated

BibTeX
@inproceedings{guo2025fastvar,
  author = {Hang Guo and Yawei Li and Taolin Zhang and Jiangshan Wang and Tao Dai and Shu-Tao Xia and Luca Benini},
  title = {{FastVAR: Linear Visual Autoregressive Modeling via Cached Token Pruning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure