On Inductive Biases That Enable Generalization of Diffusion Transformers

Jie An, De Wang, Pengsheng Guo, Jiebo Luo, Alexander Schwing

TL;DR

This paper reveals that Diffusion Transformers (DiTs) generalize through a fundamentally different mechanism than traditional UNets: while UNets rely on "harmonic bases," DiTs depend on the locality of their attention maps. By explicitly enforcing this locality through restricted attention windows in early layers, the authors demonstrate that DiT performance and generalization can be significantly improved, especially when training data is scarce.

What Problem Does This Paper Address?

In the world of generative AI, Diffusion Transformers (DiTs) have rapidly overtaken UNet architectures as the state-of-the-art backbone for high-quality image and video synthesis. However, we don't fully understand why they work so well.

Recent research suggested that UNet-based diffusion models generalize by learning "geometry-adaptive harmonic bases"—essentially oscillatory patterns that help the model understand structure. But when researchers looked at DiTs, they found a mystery: DiTs generalize even better than UNets, yet they show no sign of these harmonic bases. This paper sets out to find the "missing" inductive bias that allows Transformers to generalize so effectively in diffusion tasks.

Methods

The authors employ several analytical techniques to peek under the hood of these models:

  • Jacobian Eigendecomposition: They analyze the eigenvectors of the denoiser's Jacobian matrix to visualize the internal "bases" the model uses to process information.
  • PSNR Gap Analysis: To quantify generalization, they measure the "PSNR gap"—the difference between the model's performance on training data versus unseen test data. A smaller gap indicates better generalization.
  • Attention Map Visualization: They extract and visualize self-attention maps across different layers and training stages to see how tokens interact.
  • Local Attention Injection: As a controlled experiment, they replace standard global attention (where every pixel looks at every other pixel) with local attention windows (restricting pixels to look only at their neighbors) to see how it affects the model's ability to generalize.

Datasets

The study evaluates models across a variety of standard benchmarks:

  • CelebA: For human face generation.
  • ImageNet: A large-scale diverse object dataset.
  • LSUN: Specifically the Bedroom, Church, Tower, and Bridge subsets.

To test generalization under pressure, they specifically look at "low-data" regimes, training models on subsets as small as 1,000 ($N=10^3$) and 10,000 ($N=10^4$) images.

Key Insights and Ideas

  • The Harmonic Discrepancy: The most surprising finding is that DiTs simply do not use the harmonic bases that drive UNet generalization. As seen in Figure 1, while UNets show clear oscillatory patterns, DiT eigenvectors appear as random sparse patterns.
Figure 1: Jacobian eigenvectors of (a) a simplified one-channel UNet, (b) the UNet introduced in improved diffusion (Nichol & Dhariwal, 2021), and (c) a DiT (Peebles & Xie, 2023). Kadkhodaie et al. (2024) find that the generalization of a UNet-based diffusion model is driven by geometry- adaptive harmonic bases (a), which display oscillatory patterns whose frequency increases as the eigenvalue λk decreases. We observe similar harmonic bases in split-channel eigenvectors (b) with standard UNets (Nichol & Dhariwal, 2021). However, a DiT (Peebles & Xie, 2023) does not ex- hibit such harmonic bases (c), motivating our investigation to find the inductive bias that enables generalization in a DiT. The RGB channels of the split-channel eigenvectors are outlined with red,
  • Locality is the Key: The authors discovered that as a DiT is trained on more data, its attention maps naturally become more "local." In a well-generalized model, each output token is primarily influenced by its immediate neighbors (forming a sparse diagonal pattern in the attention map).
Attention maps showing increasing locality with more training data
  • Early Layers Matter Most: Not all layers are equal. The inductive bias of locality is most potent when applied to the early layers (the "head") of the transformer. Restricting attention in later layers (the "tail") can actually hurt performance by limiting the model's ability to fit the data.
  • Window Size Trade-off: There is a direct knob for generalization: smaller attention windows lead to stronger generalization (better performance on new data), while larger windows allow for better data fitting (memorization).

Key Results

  • Superior Generalization: When training data is limited ($N=10^3$ or $10^4$), DiTs naturally exhibit a much smaller PSNR gap than UNets with equivalent computational costs (FLOPs), proving they are inherently better at generalizing from small samples.
PSNR gap comparison showing DiT's better generalization
  • Quantitative Boost: By manually injecting local attention windows into the first six layers of a DiT, the authors reduced the FID (Fréchet Inception Distance, a measure of image quality) by significant margins—often 10% to 28%—when training with only 10,000 images.
  • Robustness: This improvement was consistent across all six datasets and two different DiT model sizes (DiT-XS and DiT-S).

Limitations and Future Work

The authors acknowledge that while local attention is a powerful inductive bias for generalization, it can be a double-edged sword. When training data is extremely abundant ($N=10^5$), the restricted windows can slightly limit the model's peak generation quality compared to a fully global attention model.

Future work could explore adaptive attention windows that start local to build a strong generalization foundation and gradually expand to global attention to capture fine-grained details as more data becomes available. Additionally, while this study focused on pixel-space models for scientific clarity, extending these insights to latent-space models (like Stable Diffusion) is a logical next step.

Summary updated

Abstract

Recent work studying the generalization of diffusion models with UNet-based denoisers reveals inductive biases that can be expressed via geometry-adaptive harmonic bases. However, in practice, more recent denoising networks are often based on transformers, e.g., the diffusion transformer (DiT). This raises the question: do transformer-based denoising networks exhibit inductive biases that can also be expressed via geometry-adaptive harmonic bases? To our surprise, we find that this is not the case. This discrepancy motivates our search for the inductive bias that can lead to good generalization in DiT models. Investigating the pivotal attention modules of a DiT, we find that locality of attention maps are closely associated with generalization. To verify this finding, we modify the generalization of a DiT by restricting its attention windows. We inject local attention windows to a DiT and observe an improvement in generalization. Furthermore, we empirically find that both the placement and the effective attention size of these local attention windows are crucial factors. Experimental results on the CelebA, ImageNet, and LSUN datasets show that strengthening the inductive bias of a DiT can improve both generalization and generation quality when less training data is available. Source code will be released publicly upon paper publication. Project page: dit-generalization.github.io/.
BibTeX
@inproceedings{an2025inductive,
  author = {Jie An and De Wang and Pengsheng Guo and Jiebo Luo and Alexander Schwing},
  title = {{On Inductive Biases That Enable Generalization of Diffusion Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=lE2cD7C9fk},
}
Figure