TL;DR
Locality-aware Parallel Decoding (LPD) significantly accelerates autoregressive image generation by reducing the required sampling steps by over 10x (e.g., from 256 to 20 steps). By combining a flexible architecture that allows tokens generated in the same step to "see" each other with a smart, locality-based generation schedule, LPD achieves a 3.4x latency reduction over previous state-of-the-art parallel models without sacrificing image quality.
Introduction: The Autoregressive Bottleneck
Autoregressive (AR) models, the backbone of LLMs like GPT-4, have shown immense promise in visual generation. However, they suffer from a major efficiency bottleneck: they typically generate images one "patch" at a time in a fixed raster-scan order (top-left to bottom-right).
For a standard 256x256 image, this means 256 sequential steps. Because these models are massive, each step is "memory-bound"—the GPU spends more time moving model weights from memory to the processor than it does actually calculating the next pixel. Previous attempts to parallelize this process (generating multiple patches at once) often struggled with "generation inconsistencies" (where parallel patches don't match up) or were forced into rigid, multi-scale formats that aren't compatible with standard vision backbones.
Methods: Breaking the Sequential Barrier
The authors introduce two primary innovations to break the sequential bottleneck:
- Flexible Parallelized Autoregressive Modeling: Standard AR models use the last generated token to predict the next. LPD decouples this. It uses learnable position query tokens to tell the model where to generate next. Crucially, they implement a specialized attention mask that ensures mutual visibility: tokens being generated in the same parallel step can see each other. This prevents the "independent prediction" problem where parallel patches don't harmonize.
- Locality-aware Generation Ordering: Instead of a random or raster order, LPD uses a schedule based on two principles derived from analyzing attention maps:
- High Proximity to Context: New tokens should be spatially close to already generated ones to receive strong conditioning.
- Low Proximity to Peers: Tokens generated in the same step should be spatially distant from each other to minimize mutual dependency and avoid "clashing" during simultaneous prediction.
Key Insights
- The "Aha!" of Spatial Locality: By visualizing attention maps, the authors proved that image tokens primarily attend to their immediate neighbors. This confirmed that "raster order" is actually quite inefficient for parallelization; a "locality-aware" order that grows clusters of pixels is mathematically more sound for maintaining quality.
- Decoupling Roles: In standard AR, a token is both the "result" of the current step and the "context" for the next. By using position queries, LPD treats "providing context" and "generating content" as separate operations that can be fused into a single efficient inference step.
- Memory-Bound vs. Compute-Bound: The paper provides a great analysis of why reducing steps matters. In small-batch scenarios (common in real-time apps), the system is memory-bound. In these cases, reducing steps leads to a near-linear reduction in latency.
Key Results
- Speed: LPD reduces generation steps for 256x256 images from 256 to just 20. It achieves at least 3.4x lower latency than previous parallelized AR models like ARPG or RandAR.
- Quality: On ImageNet 256x256, LPD-XL achieved an FID (Fréchet Inception Distance) of 2.10 with only 20 steps, outperforming many models that take hundreds of steps.
- Efficiency: In memory-bound settings, LPD achieves nearly 12x higher throughput than traditional raster-order models.
- Versatility: Because the model supports arbitrary generation orders, it can perform zero-shot image editing (inpainting and outpainting) out of the box by simply "filling in" missing coordinates in any order.
Limitations and Future Work
- Batch Size Scaling: The authors note that as batch sizes increase (e.g., >16), the system shifts from being memory-bound to compute-bound. At this point, the overhead of processing extra position query tokens begins to diminish the speedup relative to simpler models.
- Tokenizer Reliance: Like most AR image models, LPD depends on a pre-trained discrete tokenizer (VQ-VAE). Improvements in tokenization would likely yield even better results.
- Future Directions: The authors suggest extending this locality-aware parallel approach to video generation, where the "spatio-temporal" locality is even more critical and the sequential bottleneck is even more severe.
Summary updated