MARché: Fast Masked Autoregressive Image Generation with Cache-Aware Attention
Abstract
Masked autoregressive (MAR) models unify the strengths ofmasked and autoregressive generation by predicting tokens in a fixed or-der using bidirectional attention for image generation. Although effective,MAR models incur substantial computational overhead because they re-compute attention and feed-forward representations for every token ateach decoding step, even though the majority of tokens remain seman-tically unchanged across steps. We propose a training-free generationframework MARché to address this inefficiency through two key com-ponents: cache-aware attention and selective KV refresh. Cache-awareattention partitions tokens into active and cached sets, enabling sepa-rate computation paths that allow efficient reuse of previously computedkey/value projections without compromising full-context modeling. How-ever, a cached token cannot be used indefinitely without recomputationdue to the changing contextual information over multiple steps. MARchérecognizes this challenge and applies a technique called selective KV re-fresh. Selective KV refresh identifies contextually relevant tokens basedon attention scores from newly generated tokens and updates only thosetokens that require recomputation, while preserving image generationquality. MARché significantly reduces redundant computation in MARwithout modifying the underlying architecture. Empirically, MARchéachieves up to 1.7× speedup with negligible impact on image quality,offering a scalable and broadly applicable solution for efficient maskedtransformer generation.