Introduction
Autoregressive (AR) models have long defined the state-of-the-art in natural language processing. However, in the realm of high-resolution image synthesis, they have historically struggled to compete with diffusion models. The primary bottleneck is the token count. While a typical sentence requires only a few dozen tokens, a 1024×1024 image necessitates over 4,000 tokens. Given that the computational complexity of the Transformer’s attention mechanism grows quadratically with sequence length, training and inference for high-resolution images quickly become prohibitively expensive. Consequently, most Multimodal Large Language Models (MLLMs) are restricted to lower resolutions, sacrificing the fine-grained details essential for high-fidelity generation.
Methodology: Token-Shuffle and Unshuffle
To overcome the resolution barrier, this work introduces Token-Shuffle, a "plug-and-play" operation pair designed to exploit dimensional redundancy in MLLM vocabularies. The core insight is that visual codebooks (e.g., VQGAN) often utilize low-dimensional embeddings (e.g., 256), while LLM embeddings are significantly larger (e.g., 4096). This "empty space" allows multiple spatial tokens to be packed into a single high-dimensional language vector.
The Operation Pair
- Token-Shuffle (Input): This operation aggregates a local window of tokens (e.g., a $2 \times 2$ grid) and shuffles them along the channel dimension to create a single fused token. This reduces the sequence length by a factor of $s^2$ (where $s$ is the shuffle window size), effectively achieving a $4\times$ reduction in training FLOPs and inference time when $s=2$.
- Token-Unshuffle (Output): After processing by the Transformer blocks, the unshuffle operation restores the original spatial arrangement for image reconstruction.
Training Stability and Guidance
Generating images at 2048×2048 resolution introduces significant training instabilities. The authors employ z-loss and QK-Norm to prevent logit drift and gradient explosions. Additionally, a "half-linear" Classifier-Free Guidance (CFG) scheduler is introduced, which gradually increases the guidance scale across the token sequence to enhance text alignment without introducing visual artifacts.
Experimental Results
Token-Shuffle represents a significant milestone as the first AR model to successfully achieve high-quality 2048×2048 text-to-image generation.
Performance Benchmarks
A 2.7B parameter model utilizing Token-Shuffle achieved an overall score of 0.77 on the GenAI-bench (hard prompts), significantly outperforming existing AR models like LlamaGen (0.59) and even established diffusion models like LDM (0.62). Human evaluation studies further confirm these findings, with participants consistently preferring Token-Shuffle for its superior text alignment and visual appearance.
Efficiency Gains
By reducing the effective token count, Token-Shuffle enables 1024×1024 generation at a computational cost comparable to 512×512 generation in standard AR frameworks. This efficiency makes ultra-high-resolution synthesis feasible on standard hardware without specialized optimizations.
Conclusion and Future Work
Token-Shuffle demonstrates that the quadratic complexity of Transformers can be mitigated by leveraging the inherent redundancy of visual data within high-dimensional LLM spaces. While the current 2.7B parameter model sets new benchmarks for AR image generation, future work will explore scaling laws for 7B and 30B models, as well as supporting flexible aspect ratios. Although some fundamental AR challenges like occasional structural flaws remain, Token-Shuffle significantly narrows the gap between autoregressive and diffusion-based image synthesis.
Summary updated