LiteVAR: Compressing Visual Autoregressive Modelling with Efficient Attention and Quantization

Rui Xie, Tianchen Zhao, Zhihang Yuan, Rui Wan, Wenxi Gao, Zhenhua Zhu, Xuefei Ning, Yu Wang

TL;DR

LiteVAR is a training-free compression framework designed to accelerate Visual Autoregressive (VAR) generative models without sacrificing image quality. By exploiting redundancy across attention maps, classifier-free guidance (CFG) branches, and numerical precision, LiteVAR cuts attention computation by up to 90% and model memory by 50%, achieving a ~1.5× latency speedup with negligible change in FID.

What Problem Does This Paper Address?

Visual Autoregressive (VAR) models have emerged as competitive alternatives to diffusion models by generating visual tokens scale-by-scale (from coarse to fine resolutions). However, their iterative generation across multiple scales makes them computationally demanding and memory-intensive, especially as resolution grows and attention costs scale quadratically. Deploying VAR on resource-constrained devices requires compression, yet existing visual generation acceleration techniques predominantly focus on diffusion models rather than the autoregressive paradigm.

Methods

LiteVAR tackles redundancy across three complementary dimensions without requiring retraining or fine-tuning:

  1. Multi-Diagonal Window Attention (MDWA): VAR attention maps exhibit a distinct "multi-diagonal" structure where tokens attend predominantly to local spatial neighborhoods within each scale. MDWA divides the attention map into scale-wise segments and sets an adaptive local window width $w$ to preserve a target percentage (e.g., 95%) of the attention weight mass ($R_w \ge R_0$). It retains full attention only on the first three scale stages to accommodate the initial "attention sink" phenomenon.
  2. Attention Sharing across CFG (ASC): Classifier-Free Guidance requires evaluating two forward passes: conditional and unconditional. The authors observe high attention-pattern similarity between these branches and reuse the conditional attention output in the unconditional branch, bypassing its attention computation entirely.
  3. Mixed-Precision Dynamic Quantization: Naive post-training quantization (PTQ) to lower bit-widths (such as W4A8 or W6A6) severely degrades visual fidelity. LiteVAR utilizes dynamic min-max quantization for activations and pinpoints an architectural bottleneck: the feed-forward projection layer (ffn.fc2). By keeping ffn.fc2 in FP16 while quantizing the remaining layers to W4A8 or W6A6, the model avoids catastrophic generation quality drops.
+-----------------------------------------------------------------------------+
|                                  LiteVAR                                    |
|                                                                             |
|  [Attention Map]       [CFG Inference]           [Weight / Activation]      |
|         │                     │                            │                |
|         ▼                     ▼                            ▼                |
|    Multi-Diagonal      Attention Sharing         Mixed-Precision PTQ        |
|    Window Attention       across CFG             (W4A8 / Dynamic Act.,      |
|    (MDWA, saves 70-80%)  (ASC, reuses cond.)     ffn.fc2 kept in FP16)      |
+-----------------------------------------------------------------------------+

Datasets

  • Evaluation: Standard ImageNet 256×256 class-conditional benchmark, generating 8,000 images evaluated using Fréchet Inception Distance (FID), Inception Score (IS), and ImageReward.
  • Calibration: 80 training images from ImageNet sampled offline to calibrate the attention window sizes and quantization parameters.
  • No new benchmarks or datasets were introduced.

Key Insights and Ideas

  • VAR Attention is Spatially Concentrated and Multi-Diagonal: Over 80% of cross-token attention values to spatially distant tokens are near zero. Unlike standard language autoregression, the scale-wise progression produces multiple diagonal bands that can each be compressed using separate window widths.
  • CFG Attention Output Redundancy: Just as observed in diffusion transformers, the conditional and unconditional passes in visual autoregression share nearly identical attention maps across layers and heads, making full attention recomputation for the unconditional branch largely unnecessary.
  • Layer Sensitivity Bottleneck in Quantization: Quantization errors do not distribute uniformly across VAR layers. Sensitivity analysis reveals that the second linear layer of the feed-forward block (ffn.fc2) is the single critical bottleneck. Protecting only this layer in FP16 completely prevents blurriness and restores generation quality.

Key Results

  • Attention Computation: Combining MDWA and ASC slashes attention FLOPs by 85% to 90% and reduces attention-map activation memory by ~80%.
  • Quantization Quality Restoration: Naive W4A8 quantization crashes generation fidelity (FID degrades from 13.39 to 54.29, and Inception Score drops from 257.34 to 40.71). With LiteVAR’s mixed-precision strategy, W4A8 achieves an FID of 12.82, matching the uncompressed baseline.
  • End-to-End Trade-off: Fully combining MDWA, ASC, and W4A8+MP yields an FID of 13.34 (compared to the 13.39 FP16 baseline), cutting model weight memory in half and achieving approximately 1.5× latency speedup on hardware.

Limitations and Future Work

  • Kernel Requirements: Achieving practical speedups with MDWA requires custom sparse/banded CUDA kernels rather than standard off-the-shelf GEMM routines.
  • Uniform CFG Sharing: ASC currently reuses attention outputs across all transformer blocks uniformly. The authors note that selective, layer-specific reuse based on similarity thresholds could yield better efficiency-fidelity trade-offs.
  • Resolution Scope: Empirical validation was conducted on 256×256 images. While the authors present analytical projections showing dramatic attention savings for 2K generation (up to 31 GB activation memory saved), physical end-to-end evaluations on high-resolution VAR models remain for future exploration.

Summary updated

BibTeX
@inproceedings{xie2024litevar,
  author = {Rui Xie and Tianchen Zhao and Zhihang Yuan and Rui Wan and Wenxi Gao and Zhenhua Zhu and Xuefei Ning and Yu Wang},
  title = {{LiteVAR: Compressing Visual Autoregressive Modelling with Efficient Attention and Quantization}},
  booktitle = {Compression @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=qPhmWkr6JO},
}
Figure