LazyMAR: Accelerating Masked Autoregressive Models via Feature Caching

Feihong Yan, Qingyan Wei, Jiayi Tang, Jiajun Li, Yulin Wang +3 more
3/16/2025
14 citations
cs.CV

Official code: feihongyan1/LazyMAR (46 stars, Python, MIT, last commit 2025-10-24).

Abstract

Masked Autoregressive (MAR) models have emerged as a promising approach in image generation, expected to surpass traditional autoregressive models in computational efficiency by leveraging the capability of parallel decoding. However, their dependence on bidirectional self-attention inherently conflicts with conventional KV caching mechanisms, creating unexpected computational bottlenecks that undermine their expected efficiency.

Show full abstract

To address this problem, this paper studies the caching mechanism for MAR by leveraging two types of redundancy: Token Redundancy indicates that a large portion of tokens have very similar representations in the adjacent decoding steps, which allows us to first cache them in previous steps and then reuse them in the later steps. Condition Redundancy indicates that the difference between conditional and unconditional output in classifier-free guidance exhibits very similar values in adjacent steps. Based on these two redundancies, we propose LazyMAR, which introduces two caching mechanisms to handle them one by one. LazyMAR is training-free and plug-and-play for all MAR models. Experimental results demonstrate that our method achieves 2.83 times acceleration with almost no drop in generation quality. Our codes will be released in https://github.com/feihongyan1/LazyMAR.

View on arXivView PDF

Code Implementations(1)

MIT

[ICCV2025]LazyMAR: Accelerating Masked Autoregressive Models via Feature Caching

463PythonMar 16, 20251 years agoMIT
feature-cachingmar

Similar Papers

Cite this paper

@article{yan2025lazymar,
  title  = {LazyMAR: Accelerating Masked Autoregressive Models via Feature Caching},
  author = {Feihong Yan and Qingyan Wei and Jiayi Tang and Jiajun Li and Yulin Wang and Xuming Hu and Huiqi Li and Linfeng Zhang},
  year   = {2025},
  eprint = {2503.12450},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.12450v1},
  journal = {ICCV 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.12450.svg)](https://codeofpaper.com/paper/2503.12450)

Discussion