UBC's PDE-SSM-DiT Beats Attention-Based Image Generation 40x Faster
Researchers swap self-attention in Diffusion Transformers for a learnable physics equation, cutting cost to O(N log N) while matching or beating quality.
ProTakeaways
- New PDE-SSM block replaces self-attention in Diffusion Transformers with a learnable convection-diffusion-reaction PDE.
- Solving the PDE in Fourier space gives O(N log N) complexity vs attention's O(N²).
- Drop-in swap inside the official DiT codebase keeps loss, schedules and samplers unchanged.
- Matches or beats DiT on CIFAR-10, ImageNet64, CelebA-HQ, LSUN-Churches and Oxford-Flowers.
- At 256x256 with patch size 2, training step drops from ~34s to under 1s.
- At large patches attention is still faster, so the win is mainly at high resolution with small patches.
Vision transformers keep hitting the same wall: self-attention scales quadratically with the number of tokens, and it has no built-in sense of what neighbor means. A new paper from the University of British Columbia and Cambridge tries a very different fix. Instead of computing attention between patches, it lets a learnable partial differential equation move information across the image, and solves it in the frequency domain for near-linear cost.
The block is called PDE-SSM, and when it is dropped into a Diffusion Transformer it produces PDE-SSM-DiT. Empirically, PDE-SSM-DiT matches or exceeds the performance of state-of-the-art Diffusion Transformers while substantially reducing compute.
Why attention is a poor fit for pixels
In 2D, the number of tokens grows quadratically compared to a 1D sequence, and self-attention is fundamentally permutation-invariant, so it does not inherently encode spatial locality or grid structure. Positional encodings help, but they are a patch on top of an operator that was never designed for a grid. Linear-attention variants exist, but they usually lose accuracy.
The authors point out an interesting parallel from the 1D world. State Space Models like S4 and Mamba beat attention on long sequences because they are grounded in a continuous-time linear ODE, which can be solved as a convolution with a Green's function and computed efficiently. The natural question: what is the 2D analog of that ODE?
The answer is a physics equation
Their answer is to replace the ODE with a partial differential equation whose parameters are learned. Specifically, a diffusion-convection-reaction PDE governs how a hidden state evolves over the image plane. Each term has a clean physical meaning:
- Diffusion (a learnable tensor K): smooths and aggregates local information, with anisotropic K allowing direction-dependent blurring.
- Convection (a learnable vector field b): directs the flow of information across the image, effectively a learned spatial translation.
- Reaction (a learnable scalar r): a local feature transformation that amplifies or suppresses responses.
- Integration time (τ): controls how far information propagates. Small τ gives a nearly identity operator, large τ covers the whole image.
By sampling the learnable parameters, PDE-SSM can represent a diverse family of convolutional kernels, including localized, directionally blurred, shifted, and combined effects. That single block spans everything from a small local filter to a global non-local mixer.

Fourier makes it cheap
Solving a PDE in the spatial domain would be expensive. The trick is that in Fourier space, spatial derivatives become multiplication by ik, so the PDE collapses into a simple linear ODE for each frequency. The Green's function has a closed form:
Ĝ(k) = exp(τ * (-kᵀ K k + r + i(b · k)))
Each forward pass therefore does an FFT, multiplies by this symbol in frequency space, and does an inverse FFT. The diffusion term acts as a low-pass filter that damps high frequencies, the convection term induces a phase shift corresponding to a spatial translation, and the reaction term uniformly scales responses across all frequencies.
Solving the PDE in the Fourier domain yields global coupling with near-linear complexity of O(N log N), delivering a principled and scalable alternative to attention. To couple channels, the scalar parameters K, b, r are promoted to C×C matrices, turning the operator into a coupled system of PDEs that are still solvable per-frequency.
Slotting into a Diffusion Transformer
The integration is intentionally minimal. The authors take the official DiT codebase and swap only the attention layer with a PDE-SSM block. Normalization, positional embeddings, the flow-matching loss, schedules, and samplers are unchanged, so any difference is attributable to the block itself.
This matters because DiT's patch size k is a compute knob. Small patches give better quality but blow up the token count and therefore attention cost. Because PDE-SSM scales as O(N_patch² log N_patch) instead of O(N_patch⁴), you can keep patches small without paying the attention tax.
What the numbers look like
On CIFAR-10 the models are essentially tied. On ImageNet64 PDE-SSM-DiT edges out DiT with fewer parameters. The gap widens on structure and texture heavy datasets: on CelebA-HQ64, LSUN-Churches and Oxford-Flowers, PDE-SSM-DiT improves FID relative to DiT, indicating benefits for long-range coherence with small patches. On CelebA-HQ 256, FID drops from 21.08 to 18.36 while parameter count also drops.
The efficiency gap is the more dramatic result. At 256×256 with patch size 2, a single training step takes about 34.2 seconds for attention and 0.85 seconds for PDE-SSM, roughly a 40x speedup. The XL-scale forward pass at patch 2 goes from 10.4 seconds to 2.3 seconds.
| Image size | Patch | Attention (s) | PDE-SSM (s) |
|---|---|---|---|
| 128 | 2 | 3.00 | 0.224 |
| 256 | 2 | 34.2 | 0.848 |
| 256 | 4 | 3.32 | 0.847 |
| 256 | 8 | 0.507 | 0.896 |
The catches
PDE-SSM is not a universal win. At large patches the token count is already small, and attention is competitive or slightly faster: at 256 image size with patch 8, attention is 0.51s vs PDE-SSM at 0.90s. The block also carries more parameters at small resolutions because the channel-coupling matrices are C_hid². And the reported ImageNet256 numbers at 300k iterations show PDE-SSM slightly behind DiT on FID (49.37 vs 48.44) though ahead on Inception Score and Precision. This is not a demonstration of state-of-the-art class-conditional generation, it is a fair architectural swap under a fixed budget.
The broader claim the authors make is more interesting than any single benchmark. Strong generators share nonlocal mixing: UNets achieve it through multiscale downsampling, attention through pairwise correlations, and PDE-SSM through dynamical evolution that couples distant states. Framed that way, attention is one implementation of a more general principle, not the destination.