arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.23367cs.CV
收藏

FastVAR:通过缓存令牌剪枝实现线性视觉自回归建模

FastVAR: Linear Visual Autoregressive Modeling via Cached Token Pruning

Tsinghua University(清华大学);ETH Zürich(苏黎世联邦理工学院);Shenzhen University(深圳大学);Peng Cheng Laboratory(鹏城实验室)

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

AI总结:

FastVAR通过缓存令牌剪枝策略,仅处理关键令牌,实现线性视觉自回归建模加速,支持高分辨率图像生成,性能损失极小。

摘要:

视觉自回归(VAR)建模因其转向下一尺度预测而受到欢迎。然而,现有的VAR范式在每个尺度步骤处理整个令牌图,导致复杂度和运行时间随图像分辨率急剧增加。为解决这一挑战,我们提出了FastVAR,一种用于VAR高效分辨率缩放的后训练加速方法。我们的关键发现是,大部分延迟来自大规模步骤,此时大多数令牌已经收敛。利用这一观察,我们开发了缓存令牌剪枝策略,该策略仅转发关键令牌进行特定尺度的建模,同时使用来自先前尺度步骤的缓存令牌来恢复被剪枝的位置。这显著减少了转发的令牌数量,并提高了较大分辨率下的效率。实验表明,所提出的FastVAR可以进一步加速FlashAttention加速的VAR,速度提升2.7倍,性能下降可忽略不计(<1%)。我们进一步将FastVAR扩展到更高分辨率图像的零样本生成。特别是,FastVAR可以在单个NVIDIA 3090 GPU上以15GB内存占用在1.5秒内生成一张2K图像。代码可在https://github.com/csguoh/FastVAR获取。

英文摘要:

Visual Autoregressive (VAR) modeling has gained popularity for its shift towards next-scale prediction. However, existing VAR paradigms process the entire token map at each scale step, leading to the complexity and runtime scaling dramatically with image resolution. To address this challenge, we propose FastVAR, a post-training acceleration method for efficient resolution scaling with VARs. Our key finding is that the majority of latency arises from the large-scale step where most tokens have already converged. Leveraging this observation, we develop the cached token pruning strategy that only forwards pivotal tokens for scale-specific modeling while using cached tokens from previous scale steps to restore the pruned slots. This significantly reduces the number of forwarded tokens and improves the efficiency at larger resolutions. Experiments show the proposed FastVAR can further speedup FlashAttention-accelerated VAR by 2.7$\times$ with negligible performance drop of <1%. We further extend FastVAR to zero-shot generation of higher resolution images. In particular, FastVAR can generate one 2K image with 15GB memory footprints in 1.5s on a single NVIDIA 3090 GPU. Code is available at https://github.com/csguoh/FastVAR.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑