[Paper Review] Styleformer: Transformer based Generative Adversarial Networks with Style Vector
Styleformer proposes a Transformer-based generator for GANs that uses style vectors and a novel Attention Style Injection module to model long-range dependencies and global object structures, outperforming state-of-the-art models on both single-object and compositional scene generation. It achieves SOTA results via a linear-complexity variant (Styleformer-L) and a hybrid architecture (Styleformer-C) combining Transformer efficiency with StyleGAN2 detail refinement.
We propose Styleformer, which is a style-based generator for GAN architecture, but a convolution-free transformer-based generator. In our paper, we explain how a transformer can generate high-quality images, overcoming the disadvantage that convolution operations are difficult to capture global features in an image. Furthermore, we change the demodulation of StyleGAN2 and modify the existing transformer structure (e.g., residual connection, layer normalization) to create a strong style-based generator with a convolution-free structure. We also make Styleformer lighter by applying Linformer, enabling Styleformer to generate higher resolution images and result in improvements in terms of speed and memory. We experiment with the low-resolution image dataset such as CIFAR-10, as well as the high-resolution image dataset like LSUN-church. Styleformer records FID 2.82 and IS 9.94 on CIFAR-10, a benchmark dataset, which is comparable performance to the current state-of-the-art and outperforms all GAN-based generative models, including StyleGAN2-ADA with fewer parameters on the unconditional setting. We also both achieve new state-of-the-art with FID 15.17, IS 11.01, and FID 3.66, respectively on STL-10 and CelebA. We release our code at https://github.com/Jeeseung-Park/Styleformer.
Motivation & Objective
- To address the limitations of CNN-based GANs in modeling long-range dependencies and global structure in complex scenes.
- To overcome the quadratic computational cost of standard Transformers in image generation by introducing a linear-complexity variant.
- To enable high-fidelity, high-resolution image generation with improved control over global composition and local details.
- To demonstrate the effectiveness of self-attention in capturing structural relationships in multi-object and compositional scenes.
- To provide a scalable, efficient, and stable alternative to CNN-based generators in GANs using attention-based style modulation.
Proposed method
- Adapts the Transformer encoder with increased multi-head attention and pre-layer normalization for improved training stability and long-range modeling.
- Introduces the Attention Style Injection module, a style modulation and demodulation mechanism specifically designed for self-attention operations.
- Applies Linformer to reduce self-attention complexity from quadratic to linear, enabling high-resolution image generation (Styleformer-L).
- Combines Styleformer at low resolution with StyleGAN2 at high resolution (Styleformer-C), leveraging the Transformer for global structure and StyleGAN2 for fine-grained detail refinement.
- Uses style mixing and attention map visualization to analyze and validate the model's ability to disentangle global structure from texture/color.
- Employs singular value decomposition on attention maps to confirm low-rank structure, justifying the use of Linformer in visual synthesis.

Experimental results
Research questions
- RQ1Can a Transformer-based generator with style vectors effectively model long-range dependencies and global object structures in image generation?
- RQ2Can the computational cost of self-attention in high-resolution image generation be reduced to linear complexity without sacrificing performance?
- RQ3Does combining a Transformer-based generator with a CNN-based refinement head improve generation quality on compositional scenes?
- RQ4Can attention maps and style mixing demonstrate that the model disentangles global structure from local texture and color?
- RQ5How does the proposed method compare to state-of-the-art GANs in terms of FID and IS on both single-object and multi-object datasets?
Key findings
- Styleformer achieves FID 2.82 and IS 10.00 on CIFAR-10 under unconditional generation, outperforming all GAN-based models including StyleGAN2-ADA.
- Styleformer-L reduces memory usage by ~3x and improves inference speed by 1.3x compared to standard Styleformer on CelebA, while improving FID from 3.92 to 3.36.
- On the CLEVR dataset, Styleformer-C achieves FID 11.67 and IS 2.27, outperforming StyleGAN2 (FID 16.05) in multi-object scene generation.
- On Cityscapes, Styleformer-C achieves FID 5.99 and IS 2.56, significantly outperforming StyleGAN2 (FID 8.35) in compositional scene synthesis.
- Style mixing results show that the low-resolution style vector controls object layout and structure, while the high-resolution style vector controls color and texture, confirming disentanglement.
- Attention map visualizations confirm that self-attention focuses on object locations, demonstrating effective long-range interaction and global structure modeling.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.