Swin DiT: Diffusion Transformer using Pseudo Shifted Windows

Jiafu Wu, Yabiao Wang, Jian Li, Jinlong Peng, Yun Cao, Chengjie Wang, Jiangning ZhangarXiv 2025 · DOI

Introduction

Diffusion Transformers (DiTs) have established themselves as a premier architecture for high-quality image synthesis. However, they suffer from two primary limitations: quadratic computational complexity due to global self-attention and low-frequency inertia, where models over-prioritize broad shapes and colors at the expense of fine textures and sharp edges.

This research introduces PiT (Progressive Diffusion Transformer), which re-evaluates the necessity of global attention. By implementing a "Pseudo Shifted Window" mechanism and a novel channel allocation strategy, PiT achieves a 54% improvement in image quality (FID) over standard DiT-XL/2 while significantly reducing computational overhead.

The Case for Local Attention

A fundamental question in DiT design is whether every token truly needs to attend to every other token across the entire image. Empirical analysis of attention patterns in standard DiTs reveals a surprising "short-sightedness."

Empirical analysis of attention distance in standard DiTs, showing that most tokens focus on neighbors within a 2–6 unit range.

As shown in the figure above, approximately 99% of tokens in a 16x16 latent map attend to neighbors within a distance of only 2–6 units. This suggests that global attention is largely redundant for the majority of the generation process, incurring unnecessary costs for minimal representational gain.

Methodology

To capitalize on this local dependency, PiT introduces two core innovations:

1. Pseudo Shifted Window Attention (PSWA)

PiT replaces expensive global attention with Static Window Attention, restricting token interaction to local neighborhoods. To prevent these windows from becoming isolated, the researchers utilize Depthwise Separable Convolutions (DWConv) as a high-frequency bridging branch. This "Pseudo" shifting captures fine details and connects neighboring windows without the physical overhead of overlapping regions found in traditional Swin Transformers.

2. Progressive Coverage Channel Allocation (PCCA)

Standard attention often relies on "first-order similarity" (comparing individual pixels), which can be semantically ambiguous. PiT addresses this by introducing Kth-order attention, which compares token neighborhoods. Through PCCA, the model progressively increases the number of channels dedicated to window attention in deeper layers. This allows the network to naturally aggregate information from surrounding areas, calculating higher-order semantic relationships as the data flows through the architecture.

Results and Performance

PiT demonstrates a rare synergy of efficiency and quality. In terms of raw performance, PiT-B (Base) outperforms the much larger DiT-XL/2 while utilizing only 23.2% of the FLOPs. On the throughput front, PiT-S/2 processes 1225 images/sec, nearly 2.5x faster than the standard DiT-S/2 baseline.

Beyond speed, the qualitative improvements are stark. PiT effectively solves the "low-frequency inertia" problem inherent in standard Transformers.

Comparison of learned feature maps between DiT (a) and PiT (b), illustrating PiT's superior capture of high-frequency details.

As illustrated in the comparison above, PiT produces significantly sharper textures and more complex patterns. While standard DiTs often produce slightly blurry outputs due to their low-frequency bias, PiT’s architectural refinements allow it to maintain high-fidelity details across diverse datasets like ImageNet-1K.

Conclusion

PiT proves that global computation is not a requirement for high-quality diffusion. By embracing local window attention and bridging it with targeted convolutions, the architecture achieves state-of-the-art results with a fraction of the computational cost. Future work remains to explore how these local-window strategies scale to complex text-to-image prompts and ultra-high-resolution video generation.

Summary updated

BibTeX
@misc{wu2025swin,
  author = {Jiafu Wu and Yabiao Wang and Jian Li and Jinlong Peng and Yun Cao and Chengjie Wang and Jiangning Zhang},
  title = {{Swin DiT: Diffusion Transformer using Pseudo Shifted Windows}},
  year = {2025},
  eprint = {2505.13219},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.13219},
}
Figure