Abstract
Non-autoregressive transformers (NATs) are gaining traction in image synthesis for their efficiency compared to autoregressive models. However, current NATs treat all tokens—visible and masked—uniformly, leading to substantial spatial and temporal computational redundancies. We present EfficientNAT (ENAT), which addresses these inefficiencies through spatial disentanglement and temporal computation reuse. ENAT achieves state-of-the-art image quality, such as a 2.79 FID on ImageNet-256, with an 8x reduction in GFLOPs compared to top-tier diffusion models.
1. Introduction
Token-based models like MaskGIT represent images as a grid of discrete visual tokens. The generation process typically begins with a grid of [MASK] tokens, which are iteratively replaced by predicted visual tokens until the image is complete. While effective, standard Non-autoregressive Transformers (NATs) process every token in every layer at every step, ignoring the evolving information density of the grid.
2. Methodology: Addressing Redundancy
The authors identify two primary sources of inefficiency in traditional NATs:
- Spatial Redundancy: Visible tokens (already predicted) and
[MASK]tokens (to be predicted) serve different purposes. Standard models fail to exploit this asymmetry. - Temporal Redundancy: Between steps, most token representations change minimally. Only the newly revealed "critical tokens" require significant re-computation.
2.1 The ENAT Architecture
ENAT introduces three key innovations to optimize these interactions:
Spatial Disentanglement: ENAT utilizes an asymmetric encoder-decoder structure. An encoder processes only visible tokens to establish context, while a lightweight decoder predicts [MASK] tokens. Research revealed that visible tokens do not require information from [MASK] tokens to build effective representations, allowing for a significant reduction in decoder complexity.
SC-Attention (Self-Cross Attention): This mechanism allows [MASK] tokens to perform self-attention among themselves while simultaneously performing cross-attention with the encoder's visible token features.
Temporal Computation Reuse: Instead of re-encoding the entire grid at each step, ENAT only re-encodes newly revealed tokens. Features from previous steps are reused and updated via a lightweight projection module, drastically lowering total GFLOPs.
3. Key Results and Insights
ENAT was evaluated on ImageNet (256² and 512²) and MS-COCO benchmarks, setting a new bar for the "quality-per-watt" metric in image synthesis.
- Efficiency vs. Quality: On ImageNet-256, ENAT-L achieved an FID of 2.79 using only 0.3 TFLOPs. In comparison, the U-ViT-H diffusion model requires 2.4 TFLOPs to reach an FID of 3.37—representing an 8x reduction in computational cost.
- Text-to-Image Performance: On MS-COCO, ENAT-B significantly outperformed diffusion baselines, reaching an FID of 6.82 compared to 16.20 for similar computational budgets.
- Asymmetric Importance: A counter-intuitive finding was that allocating more layers to the visible-token encoder and as few as one layer to the mask-token decoder actually improved synthesis quality.
4. Conclusion
ENAT demonstrates that rethinking spatial-temporal interactions can lead to massive efficiency gains without sacrificing image quality. By prioritizing the processing of "known" information and reusing temporal features, the model achieves state-of-the-art results on consumer-grade hardware. Future work will focus on scaling the model beyond 1 billion parameters and testing on more diverse datasets.
Summary updated