Introduction
While Transformers have revolutionized natural language processing and computer vision tasks like classification, they have historically struggled in the realm of high-resolution image generation. The primary culprit is the quadratic scaling problem: standard self-attention compares every pixel to every other pixel. For a $1024 \times 1024$ image, this results in a sequence of one million tokens, making the computational cost and memory requirements astronomical.
Furthermore, generating images from noise requires a high degree of spatial coherency in structure and texture. Existing "pure" Transformer GANs were often limited to low-resolution datasets (like CIFAR-10 at $32 \times 32$) and couldn't compete with state-of-the-art convolutional models like StyleGAN2. To address this, researchers have introduced HiT (High-Resolution Transformer), a novel, completely convolution-free generator for Generative Adversarial Networks (GANs).
Methodology: The HiT Architecture
HiT overcomes the quadratic complexity of standard Transformers by utilizing a hierarchical structure that divides the generative process into two distinct phases.
- Low-Resolution Stages (Feature Decoding): These stages use a modified version of Nested Transformers. To capture both local and global dependencies without the $O(N^2)$ cost, the authors propose Multi-Axis Blocked Self-Attention.
- The image is divided into non-overlapping blocks.
- Regional Attention allows pixels to attend to neighbors within their block (local).
- Dilated Attention allows pixels to attend to corresponding pixels in other blocks (global), similar to a dilated convolution.
- This reduces complexity from $O(N^2)$ to $O(N\sqrt{N})$.
- High-Resolution Stages (Pixel Generation): The authors observe that once the global structure is "decoded" in low-res stages, self-attention becomes redundant and expensive for fine details. They drop self-attention entirely in these stages, using only Multi-Layer Perceptrons (MLPs). This effectively treats the final layers as an Implicit Neural Function (INR), which has linear complexity $O(N)$ relative to the number of pixels.
- Self-Modulation via Cross-Attention: Instead of using standard normalization techniques like AdaIN, HiT uses a cross-attention module. The intermediate features (queries) attend to a small tensor projected from the input latent code (keys/values). This allows the latent code to directly modulate features across all stages, improving stability and mode coverage.
Key Insights
- Attention is not always necessary: One of the most striking findings is that self-attention is only critical in the early, low-resolution stages of generation. For high-frequency details, simple MLPs (INRs) are sufficient and much more efficient.
- Blocking provides Inductive Bias: While "axial attention" (attending only to rows/columns) exists, the authors found that "blocking" the image first provides a better inductive bias for visual data, leading to significantly better FID scores.
- Transformers are Data-Hungry GANs: HiT benefits much more from strong regularization (like Balanced Consistency Regularization or bCR) than its convolutional counterparts. This suggests that as we move toward Transformer-based generators, data augmentation and regularization will play an increasingly vital role.
Key Results
The model was evaluated on several standard high-resolution benchmarks, including ImageNet ($128 \times 128$ and $256 \times 256$), FFHQ ($256 \times 256$ and $1024 \times 1024$), and CelebA-HQ ($256 \times 256$ and $1024 \times 1024$).
- State-of-the-Art Performance: HiT achieved an FID of 30.83 on unconditional ImageNet $128 \times 128$ and 2.95 on FFHQ $256 \times 256$, outperforming previous convolution-free models and narrowing the gap with StyleGAN2.
- Scalability: HiT successfully synthesized $1024 \times 1024$ images with a throughput (images per second) comparable to StyleGAN2, proving that Transformers can indeed scale to high definition.
- Versatility: Beyond GANs, the authors showed that HiT can serve as a powerful decoder for other architectures, such as VQ-VAE, achieving a reconstruction FID of 6.37 on ImageNet $256 \times 256$ (beating VQGAN's 8.00).
Limitations and Future Work
While HiT is highly competitive, it still slightly trails StyleGAN2 at the highest resolutions (e.g., an FID of 8.83 vs 5.17 on CelebA-HQ $1024 \times 1024$). Furthermore, this paper focused almost entirely on the generator, utilizing a standard ResNet-based discriminator. A promising future direction is designing a "pure" Transformer discriminator that can match the generator's capabilities. Finally, like many Transformer models, HiT requires careful tuning of regularization and learning rates to avoid training collapse in the adversarial setting.
Summary updated