A multiscale analysis of mean-field transformers in the moderate interaction regime

Giuseppe Bruno, Federico Pasqualotto, Andrea Agazzi
9/1/2025
transformer-attention

No confident code implementation found for this paper.

Abstract

In this paper, we study the evolution of tokens through the depth of encoder-only transformer models at inference time by modeling them as a system of particles interacting in a mean-field way and studying the corresponding dynamics. More specifically, we consider this problem in the moderate interaction regime, where the number $N$ of tokens is large and the inverse temperature parameter $\beta$ of the model scales together with $N$.

Show full abstract

In this regime, the dynamics of the system displays a multiscale behavior: a fast phase, where the token empirical measure collapses on a low-dimensional space, an intermediate phase, where the measure further collapses into clusters, and a slow one, where such clusters sequentially merge into a single one. We provide a rigorous characterization of the limiting dynamics in each of these phases and prove convergence in the above mentioned limit, exemplifying our results with some simulations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{bruno2025multiscale,
  title  = {A multiscale analysis of mean-field transformers in the moderate interaction regime},
  author = {Giuseppe Bruno and Federico Pasqualotto and Andrea Agazzi},
  year   = {2025},
  eprint = {2509.25040},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2509.25040},
  url    = {https://doi.org/10.48550/arXiv.2509.25040},
  journal = {Neural Information Processing Systems}
}

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/2509.25040.svg)](https://codeofpaper.com/paper/2509.25040)

Discussion