TL;DR
LINA is a novel autoregressive image generation framework that replaces standard, computationally expensive attention with efficient linear attention. By combining a specific normalization strategy, depthwise convolutions for local detail, and a new "KV gate" for memory management, LINA generates high-fidelity 1024px images with a 61% reduction in FLOPs compared to full-attention models, while maintaining competitive state-of-the-art performance.
What Problem Does This Paper Address?
Autoregressive (AR) models have recently emerged as a powerful alternative to pure diffusion models for image generation. By treating images as sequences of tokens, they can leverage the scaling properties of Transformers. However, standard Transformers rely on "full attention," which has a computational cost that grows quadratically ($O(N^2)$) with the number of tokens.
As we move toward high-resolution images (1024px and beyond) or video, the sequence length ($N$) becomes massive, making full attention a crippling bottleneck. While "linear attention" ($O(N)$) exists, it has mostly been optimized for classification or language modeling. The authors of LINA set out to find the optimal design for linear attention specifically for image generation with continuous tokens, where the model must balance global structure with fine-grained local textures.
Methods
LINA (Linear Autoregressive) builds upon the Masked Autoregressive (MAR) paradigm but introduces three critical architectural refinements:
- Division-Based Normalization: The authors compared two ways to normalize linear attention: division-based (standard) and subtraction-based (designed to prevent "semantic confusion"). Surprisingly, they found that division-based normalization scales much better for generative tasks.
- Locality Augmentation (DWC): Linear attention lacks the "softmax" operation that helps standard attention focus on specific local pixels. To fix this, LINA adds a $5 \times 5$ Depthwise Convolution (DWC) module to the image features in the decoder. This provides the "inductive bias" needed to capture local patterns and textures.
- KV Gate Mechanism: The authors introduced a simple, data-independent learnable gate for the Key (K) and Value (V) states. This acts as a flexible memory management system, allowing the model to learn which parts of the sequence are most important to "remember" or "emphasize" during the generation process.
The overall pipeline uses a Connector to process text/class prompts, an Encoder to handle known tokens, and a Decoder (featuring LINA’s linear attention) to predict the next set of tokens via a flow-matching head.
Datasets
The model was trained and evaluated on several industry-standard benchmarks:
- ImageNet (256×256): Used for class-conditional image generation (C2I) and extensive scaling studies (comparing 0.4B, 0.6B, and 1.4B parameter versions).
- GenEval: A comprehensive benchmark for text-to-image (T2I) generation that evaluates how well a model follows complex user instructions (e.g., counting, spatial relations, and color attribution).
- High-Resolution Data: The T2I models were fine-tuned on 512px and 1024px datasets to demonstrate high-fidelity generation.
Key Insights and Ideas
- Generation vs. Perception: A major "aha" moment was finding that design choices that work for image classification (like subtraction-based normalization) don't necessarily translate to image generation. Generation seems more robust to "semantic confusion" but more sensitive to how the normalization term scales.
- The Locality Gap: The paper conceptually demonstrates that softmax attention is essentially a "sharpening" filter that naturally favors locality. Linear attention is "blurry" by comparison. Adding a small DWC module is a mathematically cheap way to restore that sharpness without losing the $O(N)$ efficiency.
- Synergistic Gating: Ablation studies showed that the K-gate and V-gate must work together. Using only one or the other actually hurts performance, suggesting they perform a joint "handshake" to manage the model's internal memory.
- Efficiency at Scale: At 1024px resolution (sequence length of 5120), LINA reduces the FLOPs of the attention module by ~61%.
Key Results
- State-of-the-Art Performance: On ImageNet 256×256, LINA-H (1.4B) achieved an FID of 2.18, outperforming many full-attention AR models and diffusion models of similar scale.
- Strong Text-to-Image Alignment: On GenEval, LINA achieved an overall score of 0.74, beating the 1.6B SANA model and performing on par with the much larger 10.5B Fluid model.
- Efficiency: Despite the massive reduction in FLOPs, LINA maintains a sampling latency comparable to highly optimized FlashAttention implementations, proving that linear attention is a viable path for "green" AI and high-res generation.
Limitations and Future Work
- Theoretical Explanation: While the empirical results favor division-based normalization, the authors acknowledge they lack a rigorous theoretical proof for why it outperforms subtraction-based methods in a generative context.
- Hardware Optimization: The current implementation is built on standard PyTorch. The authors note that developing custom CUDA or Triton kernels for their specific linear attention/DWC/KV-gate combo could unlock even greater wall-clock speedups.
- Video Generation: The paper focuses on static images. Given the $O(N)$ complexity, extending LINA to the even longer sequences required for high-resolution video is the most obvious and promising next step.
Summary updated