TL;DR
ZipAR is a training-free, "plug-and-play" framework that accelerates autoregressive (AR) image generation by up to 91% without sacrificing visual quality. By exploiting the spatial locality of images—the fact that a pixel depends more on its immediate neighbors than on distant ones—ZipAR allows models to decode multiple rows of an image in parallel rather than strictly sequentially.
What Problem Does This Paper Address?
Autoregressive models, like the visual versions of GPT (e.g., LlamaGen, Emu3), generate images by predicting one "visual token" at a time in a strict sequence—usually from left-to-right, top-to-bottom (raster order). While this approach produces high-quality, high-resolution images, it is incredibly slow. A single high-res image might require thousands of sequential forward passes through a massive neural network, creating a significant bottleneck for real-time applications.
Existing acceleration methods borrowed from Large Language Models (LLMs), such as speculative decoding or Jacobi decoding, often struggle with images. They either require expensive retraining of "draft" models or fail to exploit the unique 2D structure of visual data. ZipAR addresses this by asking a simple question: Do we really need to finish the entire first row before we start the second?
Methods
The core innovation of ZipAR is Inter-row Parallel Decoding based on Spatial Locality.
- Spatial Locality Exploitation: In text, a word's meaning can depend on a word much earlier in the sentence. In images, a token's value is primarily influenced by its immediate neighbors. The authors observed that a token in row $i$ is highly correlated with the token directly above it in row $i-1$, but has almost zero dependence on tokens far to the right in that previous row.
- Parallel Row Generation: Instead of waiting for row $i$ to finish, ZipAR starts generating row $i+1$ as soon as a small "window" of tokens in row $i$ is completed. This allows multiple rows to be processed in a single forward pass of the model, creating a diagonal or staircase-like decoding pattern.
- Adaptive Window Assignment: Because different parts of an image (like a complex face vs. a simple blue sky) require different amounts of context, ZipAR uses an adaptive scheme. It employs a rejection sampling mechanism—similar to speculative decoding—to dynamically determine if the current window is large enough to produce a valid token. If the model's prediction is confident enough compared to a slightly larger window, the token is accepted; otherwise, it is resampled.
- Training-Free Integration: ZipAR requires no new parameters or fine-tuning. It works directly with the original model's weights and decoding head.
Datasets
The authors evaluated ZipAR across several standard benchmarks and state-of-the-art models:
- ImageNet 256x256: Used for class-conditional image generation (e.g., generating an image based on a label like "golden retriever").
- MS-COCO & Parti: Used for text-to-image evaluation, where the model generates images based on complex descriptive prompts.
- Models Tested: LlamaGen-L/XL, Lumina-mGPT (768 and 1024 resolutions), and Emu3-Gen.
Key Insights and Ideas
- The "Slash" Pattern in Attention: By analyzing the attention maps of AR visual models, the authors found distinct "slash" lines. These lines prove that tokens consistently allocate high attention to tokens in the same column of previous rows, confirming that vertical spatial proximity is a dominant factor in generation.
- Breaking the 1D Bottleneck: By treating the image as a 2D grid rather than a flattened 1D string of tokens, ZipAR bypasses the sequential limitations of standard AR decoding.
- Efficiency vs. Resolution: A key finding is that ZipAR provides greater efficiency gains as image resolution increases. Higher resolution means more tokens per row, which provides more opportunities for parallelization.
Key Results
ZipAR achieves massive speedups while maintaining or even slightly improving image quality metrics (like FID and VQAScore):
- Emu3-Gen: Reduced the number of forward steps by up to 91%.
- Lumina-mGPT-768: Achieved a 54.8% reduction in steps while actually improving the Aesthetic Score and VQAScore compared to standard decoding.
- LlamaGen-XL: Outperformed previous parallel methods like SJD (Speculative Jacobi Decoding), requiring fewer steps (331 vs 335) and achieving a better FID score (3.67 vs 3.87).
- Latency: On a LlamaGen-L model, ZipAR reduced the wall-clock latency from 15.20 seconds to 9.31 seconds per image.
Limitations and Future Work
- Dependency on Model Architecture: While training-free, the effectiveness of ZipAR depends on how the underlying model handles "end-of-row" tokens. Models that don't use explicit row markers require a small heuristic to estimate the value of the last token in a row to kickstart the next one.
- Potential for Artifacts: If the window size is forced too small, spatial inconsistencies could theoretically appear, though the rejection sampling mechanism is designed to prevent this.
- Future Directions: The authors suggest that ZipAR could be combined with other "next-set" prediction paradigms (like Medusa) to achieve even higher acceleration ratios by predicting multiple tokens both horizontally and vertically at once.
Summary updated