English

Attention's forward pass and Frank-Wolfe

Optimization and Control 2025-08-14 v1

Abstract

We study the hardmax limit of self-attention dynamics for token embeddings obtained in the zero-temperature (β+\beta\to+\infty) regime, and relate it to the finite-β\beta setting. In this limit, the update rule can be viewed as a Frank-Wolfe step for a quadratic objective over the convex hull of the current token embeddings. When the key-query matrix is negative semidefinite, the method linearly contracts all tokens to a single cluster at the origin. When it is positive semidefinite, extending the hardmax rule to the entire convex hull induces a Voronoi diagram: vertices are stationary, interior points remain in their initial cells, and each token moves along a straight line toward its cell's vertex, yielding (super-)exponential convergence. As a byproduct, we also establish well-posedness of the associated ODE limit in this regime. Returning to the finite-β\beta regime, we model self-attention dynamics as a Markov chain and prove dynamic metastability: with high probability, interior tokens reach near-vertex configurations in a constant number of steps and remain within a small neighborhood for times that grow exponentially in the inverse temperature β\beta, before ultimately collapsing to the origin. Thus, the hardmax dynamics accurately approximate the finite-β\beta process over exponentially long time horizons.

Cite

@article{arxiv.2508.09628,
  title  = {Attention's forward pass and Frank-Wolfe},
  author = {Albert Alcalde and Borjan Geshkovski and Domènec Ruiz-Balet},
  journal= {arXiv preprint arXiv:2508.09628},
  year   = {2025}
}
R2 v1 2026-07-01T04:47:48.293Z