paper-with-me

Papers

Sinkformers: Transformers with Doubly Stochastic Attention

2021-10-22 · Michael E. Sander, Pierre Ablin, Mathieu Blondel, Gabriel Peyré

Attention based models such as Transformers involve pairwise interactions between data points, modeled with a learnable attention matrix. Importantly, this attention matrix is normalized with the SoftMax operator, which makes it row-wise stochastic. In this paper, we propose instead to use Sinkhorn's algorithm to make attention matrices doubly stochastic. We call the resulting model a Sinkformer. We show that the row-wise stochastic attention matrices in classical Transformers get close to doubly stochastic matrices as the number of epochs increases, justifying the use of Sinkhorn normalization as an informative prior. On the theoretical side, we show that, unlike the SoftMax operation, this normalization makes it possible to understand the iterations of self-attention modules as a discretized gradient-flow for the Wasserstein metric. We also show in the infinite number of samples limit that, when rescaling both attention matrices and depth, Sinkformers operate a heat diffusion. On the experimental side, we show that Sinkformers enhance model accuracy in vision and natural language processing tasks. In particular, on 3D shapes classification, Sinkformers lead to a significant improvement.

📄 PDF Abstract BibTeX arXiv:2110.11773

Code (2)

michaelsdr/sinkformers 공식 구현 pytorch
MindSpore-scientific/code-14/tree/main/stochastic-attention-head-removal-a-simple mindspore

Tasks

Image Classification

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

Quantum Doubly Stochastic Transformers

2025-04-22 · Jannis Born, Filip Skogh, Kahn Rhrissorrakrai, Filippo Utro 외

At the core of the Transformer, the Softmax normalizes the attention matrix to be right stochastic. Previous research has shown that this often destabilizes training and that enforcing the attention matrix to be doubly s…

Inductive BiasObject Recognition

LOTFormer: Doubly-Stochastic Linear Attention via Low-Rank Optimal Transport

2025-09-27 · Ashkan Shahbazi, Chayne Thrash, Yikun Bai, Keaton Hamm 외 arxiv

Transformers have proven highly effective across modalities, but standard softmax attention scales quadratically with sequence length, limiting long context modeling. Linear attention mitigates this by approximating atte…

The Impact of LoRA on the Emergence of Clusters in Transformers

2024-02-23 · Hugo Koubbi, Matthieu Boussard, Louis Hernandez

In this paper, we employ the mathematical framework on Transformers developed by \citet{sander2022sinkformers,geshkovski2023emergence,geshkovski2023mathematical} to explore how variations in attention parameters and init…

Your Attention Matters: to Improve Model Robustness to Noise and Spurious Correlations

2025-07-28 · Camilo Tamayo-Rousseau, Yunjia Zhao, Yiqun Zhang, Randall Balestriero arxiv

Self-attention mechanisms are foundational to Transformer architectures, supporting their impressive success in a wide range of tasks. While there are many self-attention variants, their robustness to noise and spurious …

Sinkhorn doubly stochastic attention rank decay analysis

2026-04-09 · Michela Lapenna, Rita Fioresi, Bahman Gharesifard arxiv

The self-attention mechanism is central to the success of Transformer architectures. However, standard row-stochastic attention has been shown to suffer from significant signal degradation across layers. In particular, i…

Image ClassificationSentiment Analysis