ESPFormer: Doubly-Stochastic Attention with Expected Sliced Transport Plans

Ashkan Shahbazi, Elaheh Akbari, Darian Salehi, Xinran Liu, Navid Naderializadeh +1 more
2/14/2026

Official code: dariansal/ESPFormer (6 stars, last commit 2025-04-01).

Abstract

While self-attention has been instrumental in the success of Transformers, it can lead to over-concentration on a few tokens during training, resulting in suboptimal information flow. Enforcing doubly-stochastic constraints in attention matrices has been shown to improve structure and balance in attention distributions. However, existing methods rely on iterative Sinkhorn normalization, which is computationally costly. In this paper, we introduce a novel, fully parallelizable doubly-stochastic attention mechanism based on sliced optimal transport, leveraging Expected Sliced Transport Plans (ESP). Unlike prior approaches, our method enforces doubly stochasticity without iterative Sinkhorn normalization, significantly enhancing efficiency. To ensure differentiability, we incorporate a temperature-based soft sorting technique, enabling seamless integration into deep learning models. Experiments across multiple benchmark datasets, including image classification, point cloud classification, sentiment analysis, and neural machine translation, demonstrate that our enhanced attention regularization consistently improves performance across diverse applications. Our implementation code can be found at https://github.com/dariansal/ESPFormer.

View on arXivView PDF

Code Implementations(1)

60Shell, PythonJan 30, 20251 years ago

Similar Papers

Cite this paper

@article{shahbazi2026espformer,
  title  = {ESPFormer: Doubly-Stochastic Attention with Expected Sliced Transport Plans},
  author = {Ashkan Shahbazi and Elaheh Akbari and Darian Salehi and Xinran Liu and Navid Naderializadeh and Soheil Kolouri},
  year   = {2026},
  eprint = {2502.07962},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2502.07962},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.07962.svg)](https://codeofpaper.com/paper/2502.07962)

Discussion