Shiva-DiT: Residual-Based Differentiable Top-$k$ Selection for Efficient Diffusion Transformers

Jiaji Zhang, Hailiang Zhao, Jiaju Wu, Ruichao Sun, Xinkui Zhao, Shuiguang Deng

Abstract

Diffusion Transformers (DiTs) are costly at high resolution because self-attention scales quadratically with token sequence length. Existing pruning methods do not jointly provide end-to-end learnability, low training overhead, and deterministic token counts for predictable token-dependent computation. We propose Shiva-DiT, based on Residual-Based Differentiable Top-$k$ Selection. Its forward pass executes hard top-$k$ selection, while a residual-aware straight-through estimator propagates gradients to both token scores and the budget $k$ without evaluating a second backbone path. A Context-Aware Router and Adaptive Ratio Policy learn layer- and timestep-dependent retention schedules under a target average budget. Experiments on SD3-Medium, Flux.1-dev, and PixArt-$\Sigma$ show consistent reductions in FLOPs and measured latency. On SD3-Medium, Shiva-DiT provides four fidelity-latency operating points and reaches a 1.54$\times$ wall-clock speedup with competitive fidelity.
BibTeX
@article{zhang2026shiva,
  author = {Jiaji Zhang and Hailiang Zhao and Jiaju Wu and Ruichao Sun and Xinkui Zhao and Shuiguang Deng},
  title = {{Shiva-DiT: Residual-Based Differentiable Top-$k$ Selection for Efficient Diffusion Transformers}},
  journal = {Accepted by TMLR},
  year = {2026},
  url = {https://openreview.net/forum?id=uAAaT1KajI},
}
Figure