Emergence of meta-stable clustering in mean-field transformer models

## Abstract

Abstract. We model the evolution of tokens within a deep stack of Transformer layers as a continuous-time flow on the unit sphere, governed by a mean-field interacting particle system, building on the framework introduced in [ GLPR23 ] . Studying the corresponding mean-field Partial Differential Equation (PDE), which can be interpreted as a Wasserstein gradient flow, in this paper we provide a mathematical investigation of the long-term behavior of this system, with a particular focus on the emergence and persistence of meta-stable phases and clustering phenomena, key elements in applications like next-token prediction. More specifically, we perform a perturbative analysis of the mean-field PDE around the iid uniform initialization and prove that, in the limit of large number of tokens, the model remains close to a meta-stable manifold of solutions with a given structure (e.g., periodicity). Further, the structure characterizing the meta-stable manifold is explicitly identified, as a function of the inverse temperature parameter of the model, by the index maximizing a certain rescaling of Gegenbauer polynomials.

###### 2020 Mathematics Subject Classification:

## 1. Introduction

The transformers architecture [], through its widespread use in large language models, has played a pivotal role in fueling the artificial intelligence revolution we have witnessed in recent years. A key role in this architecture is played by self-attention modules [], a structure allowing to capture long-range relationships within the data, e.g., word relationships in sentences where, typically, the number of tokens is large. However, despite the revolutionary impact of transformers and the key role played by this mechanism, the theoretical understanding of these models in the machine learning community is still in an embryonic stage. In particular, a mathematical description of the representations developed by these neural network models, and of the effect of different choices of hyperparameters on such representations is still lacking.

Recently, the works [, ] introduced a simplified model for the dynamics of tokens through the layers of the transformer architecture. This model consists of a nonlinear Partial Differential Equation (PDE) modeling the evolution of the tokens – interpreted as $N$ interacting particles – through the layers of the network. As showcased by the authors in their work, this model displays clustering dynamics of the tokens through the layers, a feature indicating the emergence of representations in the network (e.g., the emergence of concepts/consensus in next-word predictions).

Despite its simplicity, this model – which, in its simplest form, results from the choice of specific value, key and query matrices in the self-attention mechanism – displays a number of dynamical properties that have not been fully understood yet. In particular, while the mathematical description of the emergence of clusters was proven by studying the long-time (infinite depth) behavior of the token dynamics, which can be shown to generically converge to a single cluster as time (depth) goes to infinity, numerical simulations show that this phase of total collapse is preceded by several phases of partial clustering, which long-time results fail to characterize.
Characterizing this phenomenon is crucial for understanding how representations develop in deep models:
on the one hand, deep models are expected to produce more diverse and rich representations of the data, leading to improved generalization and performance. On the other hand, due to the finite depth of transformer models and the prohibitive computational and memory cost required to reach the single-cluster regime, these intermediate clustering phases are likely to play a crucial role in the model’s effectiveness, highlighting the need for a deeper understanding of their meta-stable behavior.

#### Contributions

In this paper we study the clustering dynamics of the model developed in [] in the intermediate time range, i.e., between initialization and the emergence of the first set of clusters. To do so, we give a detailed mathematical description of the dynamics of the network in the large-context regime, i.e., when the number of tokens on which the transformer acts is large, characterizing the intermediate, meta-stable phase of the network before it collapses to the single-cluster limit. More specifically we prove the following:

- (1)
We rigorously prove the convergence, as the number of tokens $N$ becomes large, to the dynamics of the limiting law under the mean-field PDE. We further show that this convergence is non-uniform in time.
- (2)
We characterize the evolution of the $N$-particle measure close to initialization, identifying an initial phase where a certain number of clusters starts to form. We explicitly characterize the structure of the solution forming in this first phase – e.g., its periodicity – as a function of the temperature parameter of the model, the number of tokens and the dimension $d$ of the embedding space.
- (3)
We perform an in-depth analysis of the dynamics on longer time scales to prove that the periodicity developed in the first phase is maintained over exponentially long time intervals. This proves the existence of a meta-stable phase where the network learns a richer and more complex representation of the data, preceding the total collapse phase predicted by [].

We note that the above characterization has important practical implications, as it clarifies the relationship between hyperparameters such as the temperature parameter, the number of tokens or the embedding dimension and the emergence of representations in transformers by providing quantitative estimates on the “richness” of such representation in, e.g., next token prediction tasks, as well as on the depth required to achieve such representation.

#### Related works

This paper is closely related to the works [, ] that first introduced the model we investigate here. In successive preprint versions of [], the authors highlight a series of open problems on the mean-field models they develop. One of these problems is to investigate the dynamic meta-stability developed by such models.
Progress in this sense was recently made in [], where the metastability of the family of mean-field transformers models was studied in the limit of large values of the inverse temperature. However, for general values of the inverse temperature parameter, to the best of our knowledge, characterizing the metastability properties for this class of models remains, to this day, largely open.

Furthermore, in the setting of [], the long-time clustering phenomenon was studied in
[]
in $d>2$ and more recently in [] for $d=2$. These works give sufficient conditions for the occurrence of the collapse of the dynamics for finite number $N$ of tokens to a single cluster, which occurs with probability $1$ over the initial conditions of the system. These results, however, only hold in the $t\to\infty$ limit, while our work provides a more detailed analysis – in the large $N$ limit – capturing the meta-stable properties of the dynamics as it approaches slow manifolds of intermediate representations in the form of highly structured solutions before reaching the ultimate single-mode collapse.

The approach taken in this paper is closely connected to the one developed in [, ], where the dynamics of the network’s state through its depth are modeled by a differential equation. In our case, however, the state of the network can be broken down in $N$ “particles” (as opposed to one in []) that interact weakly in a nonlinear, mean-field way through a nonlinear PDE. More generally, this paper connects to a vast literature on mean-field models for neural networks, pioneered by the papers [, , ], later extended to more general results
and more quantitative estimates []. While those papers also model the state of the network as an empirical measure and whose evolution is described by a mean-field PDE, the origin of this model is radically different, as in this series of works the dynamics describe the training of the model and not the evolution of the model’s state through its depth. Furthermore, in these cases the propagation of chaos estimates are established on bounded time intervals, while we extend these estimates on $\mathcal{O}(\log N)$ time intervals.

Another line of related works studies the fluctuations around the mean-field limit of nonlinear PDEs such as the one discussed in this work. In a more general setting, results similar to ours were obtained in [],
where the connection between Fourier coefficients of a given potential and the stability of the homogeneous steady state was analyzed for general McKean-Vlasov equations on the torus, in [], where the characterization of the fluctuations was only carried out in the linear regime, and in [] where a general method was devised for investigating the instability of the Euler and Prandtl equations.

#### Structure of the paper

In Section 2 we introduce the framework and some notation. In Section 3 we present the large-$N$ convergence results. In Section 4 we discuss the long-time analysis of the dynamics and the corresponding meta-stability results. In Section 5 we present some numerical simulations and in Section 6 the conclusions.

## 2. Framework and notation

We start by introducing the models under consideration in this paper. These were first derived in [], by considering the transformer architecture as a discrete-time dynamical system describing the evolution of $N$ *tokens* $\{x_{i}(t)\}_{i=1,\ldots,N}$, given by

$$ (1) $\begin{cases}x_{i}(k+1)=\mathcal{N}\left(x_{i}+\frac{1}{Z_{\beta,i}}\sum_{j=1} ^{N}e^{\beta\langle Qx_{i}(k),Kx_{j}(k)\rangle}Vx_{j}(k)\right),&k=0,...,L-1\\ x_{i}(0)=x_{i}&\end{cases},$ $$

where $\mathcal{N}:\mathbb{R}^{d}\to\mathbb{S}^{d-1}$ denotes the normalization operator and $Z_{\beta,i}$ is a normalization factor.
The dynamics depend on (matrix) parameters $Q,K,V$ (query, key, value) whose significance is inherited from the transformer architecture. For simplicity, [] set $Q=K=V=Id$ and introduce the following continuous-time, simplified model problem describing the dynamics of $x_{i}(t):[0,\infty)\to\mathbb{S}^{d-1}$ as a (layer-wise) limit of (1) in the spirit of []:

$$ (SA) $\dot{x}_{i}(t)=P_{x_{i}(t)}\left(\frac{1}{Z_{\beta,i}(t)}\sum_{j=1}^{N}e^{ \beta\left\langle x_{i}(t),x_{j}(t)\right\rangle}x_{j}(t)\right).$ $$

Here, $P_{x}y$ is the projection onto $T_{x}\mathbb{S}^{d-1}$ given by $P_{x}y=y-\langle x,y\rangle x$, $\langle\cdot,\cdot\rangle$ denotes the Euclidean inner product in $\mathbb{R}^{d}$, $Z_{\beta,i}(t)$ is a layer-wise normalization term defined by $Z_{\beta,i}(t)=\sum_{k=1}^{n}e^{\beta\left\langle x_{i}(t),x_{k}(t)\right\rangle}$
and $\beta>0$ is a positive constant, identified throughout as the *inverse temperature*. They also introduce a related model problem(^1^11Which has the advantage of having a gradient flow structure.)

$$ (USA) $\dot{x}_{i}(t)=P_{x_{i}(t)}\left(\frac{1}{N}\sum_{j=1}^{N}e^{\beta\langle x_{i }(t),x_{j}(t)\rangle}x_{j}(t)\right)\,,$ $$

modifying the normalization factor of the sum in (SA).

It is convenient to parametrize the dynamics (SA) and (USA) by “modding out” permutation invariance. This is classical and can be achieved by setting $\mu(t):=\frac{1}{N}\sum_{i=1}^{N}\delta_{x_{i}(t)}$, where we denote by $\delta_{x}$ the Dirac delta distribution at the point $x$. This yields the continuity equation(^2^22For these specific (non-absolutely continuous with respect to Lebesgue) measures $\mu$, this equation needs to be interpreted with the weak formulation. Further, note that div here and throughout indicates the divergence intrinsic to $\mathbb{S}^{d-1}$, i.e. the covariant divergence induced by the standard metric on $\mathbb{S}^{d-1}$.):

$$ (2) $\begin{cases}\partial_{t}\mu+\text{div}(\chi[\mu]\mu)=0&\text{ on }\mathbb{R}_ {\geq 0}\times\mathbb{S}^{d-1},\\ \mu_{|t=0}=\mu(0)&\text{ on }\mathbb{S}^{d-1}.\end{cases}$ $$

In the above formula, $\chi[\mu]:\mathbb{S}^{d-1}\to T\mathbb{S}^{d-1}$ is given by either $\chi_{\text{SA}}$ or $\chi_{\text{USA}}$, respectively defined as

$$ (SA-MF) $\displaystyle\chi_{\text{SA}}[\mu](x)=P_{x}\left(\frac{1}{Z_{\beta,\mu}(x)} \int e^{\beta\langle x,y\rangle}y\mathrm{~{}d}\mu(y)\right)$ (USA-MF) $\displaystyle\chi_{\text{USA}}[\mu](x)=P_{x}\left(\frac{1}{N}\int_{\mathbb{S}^ {d-1}}e^{\beta\langle x,y\rangle}y\ d\mu(y)\right).$ $$

where we used $Z_{\beta,\mu}(x)=\int e^{\beta\langle x,y\rangle}{d}\mu(y)$.

Note that the dynamics are then interpreted as a flow map between probability measures on $\mathbb{S}^{d-1}$. In addition, as shown in [], (2) admits a Wasserstein gradient flow structure.

Noting that (2) evolves both empirical and absolutely continuous measures, it is reasonable to guess that the continuous dynamics (2) approximate the particle dynamics (USA) in the limit of an infinite number of particles, at least in a certain timescale. In the following section, we show a propagation of chaos result, which puts this consideration on a rigorous footing and is a prelude to our results on dynamical metastability.

## 3. Propagation of chaos results and mean field limit

In this section, we establish the rigorous statements for the mean field limit of models (USA) and (SA). In what follows, we denote by $W_{1}(\cdot,\cdot)$ the 1-Wasserstein distance(^3^33See Appendix A.1 the precise definition.) on $\mathcal{P}(\mathbb{S}^{d-1})$ (the space of probability measures on $\mathbb{S}^{d-1}$).

Consider a cloud of $N$ points on $\mathbb{S}^{d-1}$,
$\Xi^{(N)}:=\left(x_{1}^{(N)},\ldots,x_{N}^{(N)}\right)\in\left(\mathbb{S}^{d-1
}\right)^{N}$
which we think of as initial conditions for either (SA) of (USA). Let the associated evolution be $\Xi^{(N)}(t):=\left(x_{1}^{(N)}(t),\ldots,x_{N}^{(N)}(t)\right)$, and consider its empirical measure

$$ $\mu_{\Xi^{(N)}}(t):=\frac{1}{N}\sum_{j=1}^{N}\delta_{x^{(N)}_{j}(t)}.$ $$

The following theorem proves that the convergence of a sequence of empirical measures $\Xi^{(N)}$ to a limiting one $\mu_{0}$ (e.g., if $\{x_{j}\}$ are drawn *iid* from $\mu_{0}$) is preserved by the flow of the PDE for any finite time $t$, i.e., that the $N$-particles measure remains close to the dynamics of the particles’ law as described by the PDE.

###### Theorem 3.1 (Mean field limit) .

Assume that there exists $\mu_{0}\in\mathcal{P}(\mathbb{S}^{d-1})$ such that $W_{1}(\mu_{\Xi^{(N)}}(0),\mu_{0})\to 0$ as $N\to\infty$. Let $\mu(t)$ be the unique weak solution of the associated mean field dynamics (2) with initial condition $\mu(0)=\mu_{0}$.
Then, for any fixed $t\geq 0$, as $N\to\infty$,

$$ $W_{1}(\mu_{\Xi^{(N)}}(t),\mu(t))\to 0.$ $$

###### Remark 3.2 .

Global existence of weak solutions to (2) in $\mathcal{P}(\mathbb{S}^{d-1})$ is classical, and follows from a-priori estimates on the kernel $\chi[\mu]$.

The proof of the above theorem is provided for completeness in Appendix A. Following classical references [], we prove the desired estimate by propagating the error estimate at time $t=0$ to any given positive time by using an exponential (in $t$) bound on the rate of separation of trajectories, also called Dobrushin’s bound [], summarized in A.4.

To conclude this section, we highlight the fact that the estimate presented in the above theorem only holds on finite time intervals. This is a result of the exponential degeneration in time of Dobrushin’s bound, which is expected to hold in general (as it is a form of Cauchy stability). This degeneration is indeed inevitable for the system at hand (i.e., this system does not obey uniform in time propagation of chaos) as proven in a counterexample in Appendix B.

As we shall see in the upcoming section, despite the above exponential degeneration, estimates on longer time intervals may still be established, providing insight on the qualitative behavior of the system beyond the finite-time horizon.
This is a necessary step to characterize the emergence of meta-stable phases, i.e., states existing for long – in $N$ – time intervals.

###### Theorem 3.1 (Mean field limit) .

###### Remark 3.2 .

## 4. Dynamic meta-stability results

In [], it is observed that the tokens $x_{i}(t)$ in models (SA) and (USA) exhibit exponential convergence to a single clustered configuration in certain regimes, as time goes to infinity.
In an intermediate time range, however, the authors observe the existence of long-time meta-stable states. Their simulations reveal a two-phase dynamic: an initial phase characterized by the formation of multiple clusters, followed by a pairwise merging of these clusters, ultimately leading to a single point mass distribution. In this section, we rigorously describe both the onset and the development of such dynamical metastability phenomenon.

### 4.1. Meta-stability: setup and discussion

We restrict our attention to a class of models which arise as a generalization of (USA):

$$ (3) $\begin{cases}\partial_{t}\mu_{t}+\operatorname{div}(\mu_{t}\nabla(W*\mu_{t}))= 0&\text{for }(t,x)\in\mathbb{R}_{\geq 0}\times\mathbb{S}^{d-1},\\ \mu_{|t=0}=\mu_{0}&\text{for }x\in\mathbb{S}^{d-1}.\end{cases}$ $$

Here, the convolution operator $*$ is defined canonically as follows(^4^44We recall the definition for integrable functions, however it is standard to extend this to the convolution of a smooth $W$ with a measure $\mu$.):

$$ (4) $(f*g)(x)=\int_{\mathbb{S}^{d-1}}f(\langle x,y\rangle)g(y)\mathrm{d}\sigma_{ \mathbb{S}^{d-1}}(y),$ $$

where $f:[-1,1]\to\mathbb{R}$, $g:\mathbb{S}^{d-1}\to\mathbb{R}$ and $\mathrm{d}\sigma_{\mathbb{S}^{d-1}}$ is the standard Lebesgue measure on $\mathbb{S}^{d-1}$. In addition div and $\nabla$ are the intrinsic divergence and gradient in $\mathbb{S}^{d-1}$, induced by the standard metric on $\mathbb{S}^{d-1}$.

Note that, setting $W(q):=\beta^{-1}\exp(\beta q)$ we recover the case of the (mean-field) dynamics (USA-MF).
However, in the spirit of keeping our discussion general, we analyze the above equation for more general kernels $W$, making the following assumptions about its properties.

###### Assumption 1 .

$W$ is a smooth ($C^{\infty}$) function on $[-1,1]$.

###### Assumption 2 .

Let $\hat{W}_{k}$ be the $k-$th Gegenbauer coefficient of $W$ (see (C.1.2) for the definition), and $\gamma_{k}:=k(k+d-2)\hat{W}_{k}$. The sequence $\{\gamma_{k}\}_{k\geq 0}$ has a finite maximum $\gamma_{max}>0$. Moreover, this maximum is attained only at a single value $k_{max}>0$.

###### Remark 4.1 .

Note that Assumption 1 is trivially satisfied in the transformers model. Furthermore, for $d=2$ the coefficients $\hat{W}_{k}$ are simply given by $\frac{k^{2}}{\beta}I_{k}(\beta)$, where $I_{k}$ is the $k$-th order modified Bessel funcion of the first kind. The finiteness of the maximum holds by classical asymptotic estimates on Bessel functions [, p. 360, 9.1.10], while the maximum is non-unique only on a set of points $\beta$ of Lebesgue measure 0 0.

Assumption 2 is related to the concept of H-stability introduced by [] and, as discussed in [] for the torus, determines the instability of the uniform measure and the properties of phase transitions in the presence of noise. We will in particular show that $\hat{W}_{k_{max}}$ also controls the time scale and the type of emerging symmetries.

In what follows, motivated by the absence of a preferential direction in embedding space, we consider as the initial condition the empirical measure associated with $N$ tokens sampled independently and uniformly on $\mathbb{S}^{d-1}$.
Although there is an extensive body of work on fluctuations of the mean-field limit ([, ]), these studies generally focus on a finite time interval $[0,T]$, which is insufficient for observing the meta-stable phase. Indeed, in our setting, the size of the perturbation scales as $O(N^{-1/2})$, vanishing at any finite time $T$ in the $N\to\infty$ limit. To observe the effect of fluctuations at initialization at macroscopic scales, a much more refined analysis is required. To carry out such analysis, we decompose the meta-stable phase in three parts: the *linear phase*, the *quasi-linear phase*, and the *clustering phase*, as depicted in Figure 1:

Figure: Figure 1. Schematic representation of our decomposition of the dynamics. Here, $\mu$ represents the “true” evolution of the system, while $\mu_{L}$ represents the linearized evolution around the uniform measure $\mu_{\infty}$; $f^{\alpha}$ denotes the evolution of the mean-field PDE with initial conditions $f_{0}^{\alpha}$ on the invariant manifold selected by $k_{max}$, and $f^{\alpha,K}$ is the approximation by Grenier’s iterative scheme.

- •
Linear phase. Starting from a very small neighborhood of the uniform measure, the perturbation coalesces towards the dominant mode determined by $k_{max}$ until it reaches roughly size $\epsilon\sim O(N^{-1/4})$. We describe the dynamics in this phase in a precise fashion, providing quantitative estimates for the distance between the solution to the nonlinear PDE in (3) and its linearization around the uniform measure.
- •
Quasi-linear phase. After exiting the ball of radius $\epsilon\sim O(N^{-1/4})$, the perturbation remains close to the nonlinear evolution of the dominant mode sufficiently long so that its size exceeds a small threshold $\delta>0$ independent of the number of particles. Moreover, when exiting the quasi-linear phase, the solution is arbitrarily close (as $N\to\infty$) to the invariant manifold selected by $k_{max}$. This manifold is characterized by measures invariant under $\frac{2\pi}{k_{max}}$ rotations for $d=2$. For $d\geq 3$, the description of the above manifold is provided in Section 4.4.
- •
Nonlinear and collapsing phase. This phase consists of any finite-time interval after the quasi-linear phase. In this phase, the solution preserves the structure (e.g., periodicity) that emerged during the preceding phases. The exact evolution in this phase depends on the specific form of the interaction potential $W$. In the case of Transformers, for $W(q)=\beta^{-1}e^{\beta q}$, numerical simulations show that, after exiting the quasi-linear phase, the dominant mode collapses into $k_{max}$ clusters.

After the three phases described above, a final phase occurs, which we refer to as the *late-time phase*. During this phase, as shown in [] and [], the multiple clusters eventually converge to a single point, possibly going through several meta-stable phases with an intermediate number of clusters.

###### Assumption 1 .

###### Assumption 2 .

###### Remark 4.1 .

### 4.2. Meta-stability: precise statements

To avoid technical complications and to improve clarity of exposition, we restrict our attention to the system (3) in dimension $d=2$. The analysis conducted here for the linear and quasi-linear phase can be immediately generalized to the case $d>2$ as we outline in Section 4.4.

We start by recalling our setup. We draw $N$ tokens $x_{i}(0)$ at initialization, independently and uniformly at random on $\mathbb{S}^{d-1}$, and consider the resulting (random) evolution under (USA). Let $\mu_{t}$ be the empirical measure associated to the tokens $\{x_{i}(t)\}_{i=1,...,N}$, and let $\mu_{0}$ be $\mu$ at time $t=0$. We define the perturbation $\rho_{t}:=\mu_{t}-\mu_{\infty}$ and the corresponding characteristic time for the linear phase by:

$$ $T_{1}:=\frac{1}{\gamma_{max}}\ln\Big{(}\frac{N^{-1/4}}{\|\rho_{0}\|_{H^{-1}}} \Big{)}.$ $$

where here and throughout $\|\cdot\|_{H^{-1}}$ denotes the Sobolev norm with $p=2$ and negative exponent $k=-1$ defined in (14).

###### Theorem 4.2 (Linear phase) .

The measure $\mu(T_{1})$ can be decomposed as:

$$ (5) $\mu(T_{1})=\mu_{\infty}+N^{-1/4}\frac{(\hat{\rho}_{0})_{k_{max}}}{\|\rho_{0}\| _{H^{-1}}}\cos(k_{max}\theta)+R,$ $$

where $R$ is a remainder which satisfies $\|R\|_{H^{-1}}=o(N^{-1/4})$ in probability. Thus, as $N\to\infty$, the evolution at time $T_{1}$ is $k_{max}$ periodic and has typical size $N^{-1/4}$ away from the uniform measure.

From $T_{1}$ onwards, the dynamics are well-approximated by the mean-field PDE with initial data at $T_{1}$:

$$ (6) $\begin{cases}\partial_{t}f^{\alpha}=-\partial_{\theta}\left(f^{\alpha}\nabla W *f^{\alpha}\right)\\ f^{\alpha}_{0}(0)=\mu_{\infty}+\alpha\cos(k_{max}\theta),\end{cases}$ $$

where $\alpha=N^{-1/4}\frac{(\hat{\rho}_{0})_{k_{max}}}{\|\rho_{0}\|_{H^{-1}}}$. Importantly, since the first equation in display (6) is invariant under rotation (i.e., translation in $\theta$), it will preserve the periodicity (if any) of its initial condition. Consequently, we note that the function $f^{\alpha}$ will be $k_{max}$-periodic for all times.

Let $\delta>0$ be a fixed small parameter, independent of $N$. As the following theorem shows, the characteristic time to reach the end of the quasi-linear phase is given by:

$$ (7) $T_{2}:=\frac{1}{\gamma_{\text{max}}}\ln(\delta/\alpha).$ $$

###### Theorem 4.3 (Quasi-linear phase) .

Let $f^{\alpha}$ be the solution to the initial value problem (6) and $\delta>0$ small enough. Then, we have

$$ $\displaystyle W_{1}(\mu(T_{1}+T_{2}),f^{\alpha}(T_{2}))\to 0\,,$ $$

in probability as $N\to\infty$ and

$$ $\displaystyle W_{1}(\mu(T_{1}+T_{2}),\mu_{\infty})>\delta\,.$ $$

###### Remark 4.4 .

Recalling that $f^{\alpha}$ has periodicity $k_{max}$, Theorem 4.3 states that the evolution in the mean field limit, when exiting the quasi-linear phase, converges to a $k_{\text{max}}$-periodic function, while being a fixed amount $\delta$ away from the equilibrium measure. In other words, this result proves that when exiting the quasi-linear phase, $\mu$ (approximately) displays a very specific structure.

Finally, after the quasi-linear phase, we establish the mean-field limit in the clustering phase. To do so we require the following assumption:

###### Assumption 3 .

Let $f_{*}:=\lim_{\alpha\to 0}f^{\alpha}(T_{2})$, and consider the initial value problem (6) with initial data $f_{*}$ imposed at time $T_{2}$. Then, as $t\to\infty$,

$$ (8) $W_{1}(f_{*}(t),\mu_{\text{cluster}})\to 0\qquad\text{where}\qquad\mu_{\text{ cluster}}:=\frac{1}{k_{max}}\sum_{j=0}^{k_{max}-1}\delta_{\frac{2\pi j}{k_{max }}}.$ $$

Let us motivate Assumption 3. Indeed, it is relatively straightforward (using the gradient flow structure) to show that, as time goes to infinity, $f_{*}(t)$ converges (in the weak sense) to a sum of a number of delta masses located at several points (see Lemma E.5). Moreover, again by translation invariance in $\theta$, the limit will be $k_{max}$ periodic. Thus, Assumption 3 is true if we only require the limit to be a $k_{max}$ periodic superposition of a number of delta masses.

To motivate why $\mu_{\text{cluster}}$ should have the specific form (8), let us focus our attention on the dynamics of equation (6) on each interval of periodicity (for simplicity, consider the interval $I:=[-\pi/k_{\text{max}},\pi/k_{\text{max}}]$). Following an analogous reasoning as in [] it can be shown that the evolution under the dynamics of (6) (restricted to $I$ via periodicity) of almost every empirical measure will tend, as time goes to infinity, to a single delta function. Thus, Assumption 3 holds for almost every empirical measure, which leads us to believe that it should hold for the particular $f_{*}$ under consideration.

Under Assumption 3, we obtain the following statement.

###### Theorem 4.5 (Clustering phase) .

Let $T_{3}>0$ be a finite time. As $N$ tends to infinity, $\mu_{(T_{1}+T_{2}+T_{3})}$ is approximated by $f^{\alpha}(T_{2}+T_{3})$ in Wasserstein 1-distance, with an error vanishing in probability as $N$ tends to infinity. In particular, provided that Assumption 3 holds, and picking the time $T_{3}$ sufficiently large, as $N$ goes to infinity, $\mu_{(T_{1}+T_{2}+T_{3})}$ is arbitrarily close (in the Wasserstein 1-distance and in probability) to the measure $\mu_{\text{cluster}}$ defined in display (8).

###### Remark 4.6 .

Note that, without requiring assumption 3, an analogous rigorous statement can be obtained in which the limiting measure is a $k_{\text{max}}$ periodic superposition of delta masses. However, in this case a number $k\geq k_{max}$ of clusters, possibly of different intensity, may emerge.

###### Theorem 4.2 (Linear phase) .

###### Theorem 4.3 (Quasi-linear phase) .

###### Remark 4.4 .

###### Assumption 3 .

###### Theorem 4.5 (Clustering phase) .

###### Remark 4.6 .

### 4.3. Description of the proof

The technical machinery which enables us to achieve the proof of the above Theorems is contained in Appendix C. First, we introduce key technical definitions and statements in Section C.1, and the linearization of our problem in Section C.2.

Linear phase. Section C.3 is devoted to the proof of Proposition C.10, the quantitative statement of Theorem 4.2. First, we improve, via Lemma C.7, the Lyapunov exponent on times smaller than $T_{1}$, by studying explicitly the linearized operator around $\mu_{\infty}$. This Lemma employs a duality argument to avoid derivative loss, and allows us to show a quantitative improvement of Dobrushin’s estimate, which in turn is enough to show propagation of chaos for times comparable to $T_{1}$. These ingredients are enough to conclude the proof of Proposition C.10.

Quasi-linear phase. In Section C.4, we construct a genuinely nonlinear solution which arises from the unstable mode $\cos(k_{max}\theta)$ after time $T_{1}$. The main technical issue in this regard is that we only have a poor estimate of the nonlinear growth rate $C>0$ of solutions to the mean-field equation (appearing in Dobrushin’s estimate). In particular, a direct approach would work if $2\gamma_{max}>C$ (i.e., the nonlinear growth rate is slower than twice the growth rate of the unstable mode) for the relevant times $t<T_{1}+T_{2}$, but this estimate does not seem to be available. By employing Grenier’s scheme [], we consider a higher-order approximation to the dynamics, which allows us to relax the above condition to $nk_{max}>C$, where $n>1$ is the order of our approximation. This reasoning allows us to prove Proposition C.15 on the quasi-linear phase.

Collapse phase. At time $T_{2}$, as $N\to\infty$, the evolution concentrates around the $k_{\text{max}}$ periodic function $f_{*}$ considered in assumption 3. We then use Dobrushin’s estimates, together with the specific form of the infinite time limit provided by assumption 3 to conclude the statement of Theorem C.23. Note in particular that, after time $T_{2}$, the time required for clustering to occur does not depend on $N$. Consequently, Dobrushin’s estimates apply directly here.

### 4.4. Meta-stable Phase in Higher Dimensions

In higher dimensions, a similar analysis of the meta-stable phase can be carried out as in the lower-dimensional case (see D for details). The definitions and arguments from the previous sections naturally extend to the case $d\geq 2$ due to the properties of spherical harmonics and Gegenbauer coefficients. The uniform measure remains an unstable equilibrium. The key difference is that the dominant mode $f^{\alpha}$, which emerges in the linear phase as described in Theorem 4.2, is now a superposition of spherical harmonics of degree $k_{max}$, solving:

$$ (9) $\begin{cases}\partial_{t}f^{\alpha}=-\partial_{\theta}\left(f^{\alpha}\nabla W *f^{\alpha}\right)\\ f^{\alpha}_{0}(T_{1})=\mu_{\infty}+\sum_{j=0}^{Z_{k_{max}}^{d}}\alpha_{j}Y_{k_ {max},j},\end{cases}$ $$

where $Z_{k_{max}}^{d}$ is the multiplicity of spherical harmonics of degree $k_{max}$ in dimension $d$.

This function belongs to the subspace $\mathcal{H}_{k_{max}}$, invariant for the continuity equation (3), defined as:

$$ $\mathcal{H}_{k}:=\{\mu\in\mathcal{P}(\mathbb{S}^{d-1}):\ \langle\mu,Y_{l,j} \rangle=0\quad\forall l\text{ not divisible by }k\},$ $$

that generalizes the invariance under $\frac{2\pi}{k_{max}}$-rotations. Hence, Theorem 4.3 can be reformulated in this higher-dimensional context as:

###### Theorem 4.7 (Quasi-linear phase) .

Let $f^{\alpha}$ be the solution to the initial value problem (9) and $\delta>0$ small enough. Then, we have

$$ $\displaystyle W_{1}(\mu(T_{1}+T_{2}),f^{\alpha}(T_{2}))\to 0\,,$ $$

in probability as $N\to\infty$ and

$$ $\displaystyle W_{1}(\mu(T_{1}+T_{2}),\mu_{\infty})>\delta\,.$ $$

Again, Theorem 4.7 states that the evolution in the mean field limit, when exiting the quasi-linear phase, converges to a function in $\mathcal{H}_{k_{max}}$, while being a fixed amount $\delta$ away from the equilibrium measure. This proves that the measure displays a very specific structure at the end of the quasi-linear phase.
A natural extension of the analysis is to characterize the stable equilibria of the dynamics when restricted to the subspace $\mathcal{H}_{k_{max}}$, excluding the uniform measure. These equilibria must be finite unions of submanifolds of dimension at most $d-2$ (see Lemma E.5). Furthermore, if the measure is the empirical measure representing a set of points, being in $\mathcal{H}_{k_{max}}$
([]) implies that these points form a spherical $k_{max}-1$-design.
This condition indicates specific properties regarding the minimum number of clusters, their geometric structure, and the distribution of tokens, which have been extensively explored in the literature and are an active area of research.

###### Theorem 4.7 (Quasi-linear phase) .

## 5. Numerical experiments

The first experiment aims to illustrate the relationship between the parameter $\beta$ and the number of clusters formed: an immediate manifestation of the symmetry described in Theorem 4.3 and the clustering tendency of the dynamics. Specifically, the left column of Figure 2 illustrates the values of the coefficients $\gamma_{k}$ for the Transformer model USA with $\beta$ set to 5 and 7. Assumption 2 is satisfied with $k_{max}$ values of 3 and 4, respectively. According to our theoretical analysis, in particular by Theorem 4.2 and Proposition C.20, these values correspond to the expected number of clusters observed during the meta-stable phase. To confirm this, we simulate in Figure 2 the trajectories of $10^{4}$ particles on $\mathbb{S}^{1}$, whose initial conditions are sampled uniformly at random. The angular ODEs system (10), equivalent to Eq. (USA), is numerically solved using the Euler method with a time step $dt=5\times 10^{-4}$. Notice the different timescales of the two simulations, the meta-stable phase and the emergence of the predicted $3$ and $4$ clusters. The computation is performed using PyTorch in double precision on a Nvidia Tesla T4 GPU.

Figure: Figure 2. On the left, the plots of $\gamma_{k}$ as a function of $k$ for $\beta=5$ (top) and $\beta=7$ (bottom) are shown. The dashed blue line represents the value of $\gamma_{k}$ generalized to real $k$. From these graphs, we observe that the corresponding values of $k_{\text{max}}$ are $3$ and $4$, respectively, representing the predicted number of clusters in the large-$N$ limit. In the center, numerical simulations depict particle trajectories for $\beta=5$ (top) and $\beta=7$ (bottom), with $10^{4}$ particles whose initial conditions are sampled uniformly at random. On the right, the histograms of particle distributions at the end of the simulations are displayed, showcasing the formation of $3$ and $4$ clusters respectively.
Refer to caption: x1.png

Figure: Figure 3. Plot of the average time required for the empirical measure to exceed a fixed threshold. Note the logarithmic scale on the $x$-axis.
Refer to caption: extracted/5966015/images/N_plot.png

With the second experiment we demonstrate the decomposition of Eq. (5) and the emergence of periodicity in the token distribution.
To further investigate the asymptotic limit on the number of tokens, and given the computational constraints on simulating a large number of particles, we chose to examine the limiting case of an absolutely continuous initial condition.
Given that the results in Theorem 4.2 about the linear and quasi-linear phases apply to general perturbations of uniform measures, we consider as initial condition, $\mu_{0}$, the uniform measure slightly perturbed by white noise. Figure 4 illustrates the evolution of $\mu_{t}$ starting from $\mu_{0}$.
The continuity equation (3), more precisely its angular counterpart Eq.(11), is numerically solved by discretizing the spatial domain into $10^{4}$ grid points over the interval
$[0,2\pi]$, with a spatial step $dx=2\pi\times 10^{-4}$ and a time step $dt=0.05dx$. The solution employs the Lax–Friedrichs method for time evolution. The resulting dynamics consistently confirm our theoretical expectations.

Figure: Figure 4. Evolution of the initial condition given by the uniform measure perturbed by random white noise ($\sigma=0.01$) with $\beta=5$. We notice the emergence of $3$-periodic solution as predicted by Theorem 4.3.
Refer to caption: extracted/5966015/images/beta5/pde_1.png

In the third experiment, we demonstrate that the duration of the meta-stable phase is $O(ln(N))$, as predicted by Theorem 4.2 and Theorem 4.3. We fix $\beta=2$ and run multiple simulations with the same setup of the first experiment, with the number of particles ranging from $N=1000$ to $N=16000$. The simulations are terminated when the approximate total variation distance between the uniform distribution and the token distribution (computed using 100 bins for the histogram) exceeds a fixed threshold. Figure 4 shows the average results from 20 simulations per particle number. We observe a clear logarithmic dependence in $N$ of the exit time from the quasi-linear regime, aligning with the theoretical expectations. Code is available at this [].

## 6. Conclusions and future works

In this paper we rigorously investigate the dynamics of $N$ tokens, interpreted as exchangeable particles, through the depth of a simple transformer model in the limit of a large $N$. In this limit, the dynamic meta-stability of the system can be captured by studying the emergence of symmetry at initialization through a careful analysis of the evolving fluctuations in the systems. In particular, it is possible to show that, after a time that depends logarithmically on $N$, the system exits from a ball containing the uniform measure displaying, approximately, a specific structure (a certain periodicity in the case $d=2$) that depends explicitly on the inverse temperature parameter
$\beta$ and on the dimension $d$. Since the equation describing the dynamics of this model preserves such structure, this observation allows to capture the emergence of dynamically meta-stable solutions and to characterize them explicitly. In practice, this translates in a detailed understanding of the representations produced by the network at finite but large depths, and to control how these representations vary as the depth is increased as a function of $N$.

While $10^{4}$ tokens might seem a large number, many modern models can handle significantly larger context lengths. For instance, ChatGPT can process up to 128k tokens, and Gemini 1.5 Pro supports up to 2 million tokens. As the context lengths and the depth of large language models continue to expand, the large-$N$ limit and the meta-stable effects discussed here will become increasingly relevant. Indeed, we demonstrated the existence of a strong interconnection among the main hyper-parameters of a Transformer model: number of tokens, temperature, embedding dimension, and model depth. These hyper-parameters cannot be adjusted independently of one another.

This work hints at a number of interesting questions. First, an interesting avenue of future research consists of proving that Assumption 3 holds, i.e., that the solution to the PDE (2) as it exits the quasi-linear phase indeed converges to a certain number of delta measures. This result goes well beyond the ones presented in [], as it requires characterising the solution of the PDE with a specific initial condition that may fall in the set of measure 0 0 in the previously established result.
Secondly, it would be interesting to investigate the effect of the addition of noise to the ODEs (SA) and (USA) and, as a consequence, on the emergence of symmetry and clustering in the resulting system. The presence of noise in these models can be motivated by considering randomly initialized linear layers between attention layers before training [].
Lastly, as indicated in [] an important avenue of future research consists of investigating the effect on the particle dynamics of various choices of key, query and value matrices in the transformer structure, as well as the effect of training in the selection of these matrices and, in turn on the representations elaborated by the network.

## Acknowledgements

We thank Philippe Rigollet for discussions that motivated this work. AA is member of INdAM (GNAMPA group), and acknowledges partial support of
Dipartimento di Eccellenza, UNIPI, the Future of Artificial Intelligence Research (FAIR) foundation (WP2),
PRIN 2022 project ConStRAINeD (2022XRWY7W), PRA Project APRISE, and GNAMPA Project CUP_E53C22001930001.

## Appendix A Propagation of chaos

### A.1. Preliminaries: Wasserstein distance

Let $(X,d)$ be a compact metric space and let $\mathcal{P}(X)$ be the set of probability measures on $X$. The $p-$Wasserstein distance is defined as:

$$ $W_{p}(\mu,\nu):=\left(\min_{\gamma\in\Pi(\mu,\nu)}\int d(x,y)^{p}d\gamma(x,y) \right)^{1/p}.$ $$

It is a well defined distance and in compact spaces satisfies for all $p\geq 1$:

$$ $W_{1}(\mu,\nu)\leq W_{p}(\mu,\nu)\leq\text{diam}(X)^{\frac{p-1}{p}}W_{1}(\mu, \nu)^{\frac{1}{p}}.$ $$

Moreover, under the compactness assumption, for $p\in[1,+\infty[$, we have $\mu_{n}\rightharpoonup\mu$ if and only if $W_{p}(\mu_{n},\mu)\to 0$.

Another common characterization of the distance $W_{1}$ is a consequence of the duality theorem of Kantorovich and Rubinstein: when $\mu$ and $\nu$ have bounded support,

$$ $W_{1}(\mu,\nu)=\sup\left\{\int_{X}f(x)d(\mu-\nu)(x)\big{|}f:X\to\mathbb{R} \text{ continuous },\text{Lip}(f)\leq 1\right\}.$ $$

For other properties and results related to the Wasserstein distance, the reader can refer to [, ].

### A.2. Angular equation and mean-field PDE convergence

In this section we provide a proof of the Dobrushin’s estimate for the Transformers model. For clarity we restrict our attention to the case where $d=2$ for the model USA. Nevertheless, the same arguments can be extended to prove the estimate for $d\geq 3$ and for the model SA.

An interacting particle system on $\mathbb{S}^{1}$ can be equivalently described by associating the particles $x_{i}(t)\in\mathbb{S}^{1}$ with the corresponding angles $\theta_{i}(t)\in\mathbb{T}$. The angular representation of the system of ODEs for the model USA can be expressed as follow:

$$ (10) $\dot{\theta}_{i}=-\frac{1}{N}\sum_{j=1}^{N}{e^{\beta\cos(\theta_{i}-\theta_{j} )}\sin(\theta_{i}-\theta_{j})}.$ $$

Then the empirical measure of the angles, $\nu(t)=\frac{1}{N}\sum_{j=1}^{N}\delta_{\theta_{j}(t)}$, is a solution of the continuity equation:

$$ (11) $\partial_{t}\nu(t)+\partial_{\theta}(\chi[\nu(t)]\nu(t))=0,$ $$

where:

$$ $\chi[\nu](\theta)=\int h_{\beta}^{\prime}(\theta-\omega)\ d\nu(\omega)$ $$

and $h_{\beta}(\theta)=\frac{1}{\beta}e^{\beta\cos(\theta)}$. With this notation and these definitions, Dobrushin’s estimate can be formulated as follows:

###### Theorem A.1 .

Let $\mu_{t},\ \nu_{t}$ be two solutions of Eq. (11), with initial conditions respectively $\mu_{0},\nu_{0}\in\mathcal{P}(\mathbb{S}^{1})$. Then $\forall t\geq 0$:

$$ $W_{1}(\mu_{t},\nu_{t})\leq e^{2Ct}W_{1}(\mu_{0},\nu_{0}),$ $$

with $C=\|h_{\beta}^{\prime\prime}\|_{L^{\infty}}$.

We denote $T_{t}[\mu](x)$ the flow of our system with initial condition $x\in\mathbb{S}^{1}$ and vector field $\chi[\mu_{t}]$. Furthermore, given a generic measurable map $f$, we denote the push-forward of the measure $\mu$ under the map $f$ as $f\#\mu$.
In particular Eq. (11) is equivalent to $\nu_{t}=T_{t}[\nu]\#\nu_{0}$.

The proof of Theorem A.1 is a consequence of the Lipschtzianity of the vector field $\chi[\mu_{t}]$ and of the flow $T_{t}[\mu]$, which are shown in the next two lemmas:

###### Lemma A.2 .

Let $\mu,\nu\in\mathcal{P}(\mathbb{S}^{1})$, then:

$$ $\left\|\chi[\mu]-\chi[\nu]\right\|_{L^{\infty}}\leq\|h_{\beta}^{\prime\prime} \|_{L^{\infty}}W_{1}(\mu,\nu).$ $$

###### Proof.

By definition of $\chi$:

$$ $\begin{split}\left\|\chi[\mu]-\chi[\nu]\right\|_{L\infty}&=\sup_{\theta\in \mathbb{S}^{1}}\left|\int h_{\beta}^{\prime}(\theta-\omega)[d\mu(\omega)-d\nu( \omega)]\right|\leq\\ &\leq\|h_{\beta}^{\prime\prime}\|_{L^{\infty}}\sup_{\theta\in\mathbb{S}^{1}} \left|\int\frac{h_{\beta}^{\prime}(\theta-\omega)}{\|h_{\beta}^{\prime\prime} \|_{L^{\infty}}}[d\mu(\omega)-d\nu(\omega)]\right|.\end{split}$ $$

Since $\frac{h_{\beta}^{\prime}(\theta-\omega)}{\|h_{\beta}^{\prime\prime}\|_{L^{
\infty}}}$ is 1-Lipschitz we can conclude by definition of $W_{1}$.
∎

###### Lemma A.3 .

Let $\mu\in\mathcal{P}(\mathbb{S}^{1})$, then:

$$ $\|\chi[\mu]\|_{Lip}\leq C,\quad\|T_{t}[\mu]\|_{Lip}\leq e^{Ct}.$ $$

where $C=\|h_{\beta}^{\prime\prime}\|_{L^{\infty}}$.

###### Proof.

For the first part:

$$ $\begin{split}\left\|\chi[\mu](\theta_{1})-\chi[\mu](\theta_{2})\right\|&\leq \int|h_{\beta}^{\prime}(\theta_{1}-\omega)-h_{\beta}^{\prime}(\theta_{2}- \omega)|d\mu(\omega)\leq\|h_{\beta}^{\prime\prime}\|_{L^{\infty}}(\theta_{1}- \theta_{2}).\end{split}$ $$

For the second part:

$$ $\begin{split}\frac{d}{dt}\left|T_{t}[\mu](\theta_{1})-T_{t}[\mu](\theta_{2}) \right|&\leq\left|\frac{d}{dt}T_{t}[\mu](\theta_{1})-\frac{d}{dt}T_{t}[\mu]( \theta_{2})\right|=\\ &=\left|\chi[\mu_{t}](T_{t}(\theta_{1}))-\chi[\mu_{t}](T_{t}(\theta_{2})) \right|\leq C\left|T_{t}(\theta_{1})-T_{t}(\theta_{2})\right|.\end{split}$ $$

The conclusion follows as a consequence of Gronwall’s lemma.
∎

Now we can return to the theorem:

###### Proof of Theorem A.1 .

$$ (12) $\begin{split}W_{1}(\mu_{t},\nu_{t})&=W_{1}(T_{t}[\mu]\#\mu_{0},T_{t}[\nu]\#\nu _{0})\leq\\ &\leq W_{1}(T_{t}[\mu]\#\mu_{0},T_{t}[\mu]\#\nu_{0})+W_{1}(T_{t}[\mu]\#\nu_{0} ,T_{t}[\nu]\#\nu_{0})\end{split}$ $$

For the first term:

$$ $\begin{split}W_{1}(T_{t}[\mu]\#\mu_{0},T_{t}[\mu]\#\nu_{0})&=\sup_{\|\phi\|_{ Lip}\leq 1}\int_{\mathbb{S}^{1}}\phi\ d[T_{t}[\mu]\#\mu_{0}-T_{t}[\mu]\#\nu_{0 }]=\\ &=\sup_{\|\phi\|_{Lip}\leq 1}\int_{\mathbb{S}^{1}}(\phi\circ T_{t}[\mu])\ d[ \mu_{0}-\nu_{0}]=\\ &=e^{Ct}\sup_{\|\phi\|_{Lip}\leq 1}\int_{\mathbb{S}^{1}}(e^{-Ct}\phi\circ T_{t }[\mu])\ d[\mu_{0}-\nu_{0}]\leq\\ &\leq e^{Ct}\sup_{\|\psi\|_{Lip}\leq 1}\int_{\mathbb{S}^{1}}\psi\ d[\mu_{0}- \nu_{0}]=e^{Ct}W_{1}(\mu_{0},\nu_{0}),\end{split}$ $$

where the last row follow from Lemma (A.3).

For the second term:

$$ $\begin{split}W_{1}(T_{t}[\mu]\#\nu_{0},T_{t}[\nu]\#\nu_{0})&=\sup_{\|\phi\|_{ Lip}\leq 1}\int_{\mathbb{S}^{1}}\left(\phi\circ T_{t}[\mu]-\phi\circ T_{t}[\nu ]\right)\ d\nu_{0}\leq\\ &\leq\int_{\mathbb{S}^{1}}\left|T_{t}[\mu]-T_{t}[\nu]\right|\ d\nu_{0}:= \lambda(t).\end{split}$ $$

Now,

$$ $\begin{split}\frac{d\lambda(t)}{dt}&\leq\int\left|\frac{d}{dt}T_{t}[\mu]-\frac {d}{dt}T_{t}[\nu]\right|d\nu_{0}=\\ &=\int\left|\chi[\mu_{t}]\circ T_{t}[\mu]-\chi[\nu_{t}]\circ T_{t}[\nu]\right| d\nu_{0}\leq\\ &\leq\int\left|\chi[\mu_{t}]\circ T_{t}[\mu]-\chi[\mu_{t}]\circ T_{t}[\nu] \right|d\nu_{0}+\int\left|\chi[\mu_{t}]\circ T_{t}[\nu]-\chi[\nu_{t}]\circ T_{ t}[\nu]\right|d\nu_{0}.\end{split}$ $$

By Lemma (A.3) for the first term, and by the properties of $T_{t}$ for the second term (in particular $\mu_{t}=T_{t}[\mu]\#\mu_{0}$), we get:

$$ $\begin{split}\frac{d\lambda(t)}{dt}&\leq C\int\left|T_{t}[\mu]-T_{t}[\nu] \right|d\nu_{0}+\int\left|\chi[\mu_{t}]-\chi[\nu_{t}]\right|d\nu_{t}\leq\\ &\leq C\lambda(t)+\|\chi[\mu_{t}]-\chi[\nu_{t}]\|_{L^{\infty}}\leq C[\lambda(t )+W_{1}(\mu_{t},\nu_{t})].\end{split}$ $$

where the last step follows by Lemma (A.2). As a consequence of Gronwall’s inequality it holds:

$$ $\lambda(t)\leq C\int_{0}^{t}e^{C(t-\tau)}W_{1}(\mu_{\tau},\nu_{\tau})d\tau.$ $$

Going back to Equation (12) we get:

$$ $W_{1}(\mu_{t},\nu_{t})\leq e^{Ct}W_{1}(\mu_{0},\nu_{0})+C\int_{0}^{t}e^{C(t- \tau)}W_{1}(\mu_{\tau},\nu_{\tau})d\tau.$ $$

And to conclude we just need to apply another time Gronwall’s lemma:

$$ $W_{1}(\mu_{t},\nu_{t})\leq e^{2Ct}W_{1}(\mu_{0},\nu_{0}).$ $$

∎

An analogous reasoning in the higher dimensional case, for the dynamics (SA-MF) and (USA-MF) yields the following more general result.

###### Theorem A.4 (Dobrushin’s estimate in $d$ dimensions) .

There exists a constant $C>0$ depending on $\beta$ such that the following holds. Suppose that $\mu_{t},\nu_{t}$ are two solutions of (2) in the class $C(\mathbb{R}_{\geq 0},\mathcal{P}(\mathbb{S}^{d-1}))$, with initial conditions respectively $\mu_{0},\nu_{0}\in\mathcal{P}\left(\mathbb{S}^{d-1}\right)$. Then $\forall t\geq 0$ :

$$ $W_{1}\left(\mu_{t},\nu_{t}\right)\leq e^{2Ct}W_{1}\left(\mu_{0},\nu_{0}\right).$ $$

Moreover, $C$ can be computed explicitly. In the case of (SA-MF),

$$ $C=\left\|\nabla_{x}K_{\beta}(x,y)\right\|_{L^{\infty}\left(\mathbb{S}^{d-1} \times\mathbb{S}^{d-1}\right)},\qquad\text{where}\qquad K_{\beta}(x,y):=e^{ \beta\langle x,y\rangle}P_{x}(y).$ $$

Finally, Theorem 3.1 is a direct consequence of Theorem A.4 and we omit the proof here.

###### Theorem A.1 .

###### Lemma A.2 .

###### Proof.

###### Lemma A.3 .

###### Proof.

###### Proof of Theorem A.1 .

###### Theorem A.4 (Dobrushin’s estimate in d 𝑑 d italic_d dimensions) .

## Appendix B On the exponential in time dependence

In this section, we demonstrate through a straightforward counterexample that the exponential time-dependence in Dobrushin’s estimate for the Transformers model cannot generally be improved. The time control is not only non-uniform but must also exhibit exponential growth.

Let’s consider for simplicity the case $\beta=1$ and $N=2$. The ordinary differential equations system obtained from Eq. (SA) is:

$$ $\begin{cases}\dot{x}_{1}&=P_{x_{1}}\left(\frac{1}{Z_{\beta,1}}(e^{\langle x_{1 },x_{1}\rangle}x_{1}+e^{\langle x_{1},x_{2}\rangle}x_{2})\right)\\ \dot{x}_{2}&=P_{x_{2}}\left(\frac{1}{Z_{\beta,2}}(e^{\langle x_{2},x_{1} \rangle}x_{1}+e^{\langle x_{2},x_{2}\rangle}x_{2})\right).\end{cases}$ $$

It’s easier to examine the angle version of the previous ODE system:

$$ $\begin{cases}\dot{\theta}_{1}=&-\frac{1}{Z_{\beta,1}}e^{\cos(\theta_{1}-\theta _{2})}\sin(\theta_{1}-\theta_{2})\\ \dot{\theta}_{2}=&-\frac{1}{Z_{\beta,2}}e^{\cos(\theta_{2}-\theta_{1})}\sin( \theta_{2}-\theta_{1}).\end{cases}$ $$

Using that $Z_{\beta,1}=Z_{\beta,2}=:Z$, then $\omega:=\theta_{2}-\theta_{1}$ satisfies:

$$ $\dot{\omega}=-2\frac{e^{\cos(\omega)}}{Z}\sin(\omega).$ $$

Since $\omega(t)=0$ and $\omega(t)=\pi$ are constant solutions, then for every $\omega_{0}\in[0,\pi]$ the corresponding trajectory $\omega(t)$ is confined in $[0,\pi]\ \forall t\geq 0$, and this implies $\sin(\omega(t))\geq 0$. Moreover,
$\frac{1}{e^{2}}\leq\frac{e^{\cos(\omega)}}{Z}$, hence:

$$ $\dot{\omega}\leq-\frac{2}{e^{2}}\sin(\omega),$ $$

which implies, by an ODE comparison theorem:

$$ (13) $\omega(t)\leq 2\cot^{-1}(e^{c+2t/e^{2}})$ $$

where the right-hand side is the solution of $\dot{\gamma}=-\frac{2}{e^{2}}\sin(\gamma)$ and $c$ depends on the initial condition.

Now consider the initial conditions $\theta_{1}^{\epsilon}:=\epsilon$ and $\theta_{2}^{\epsilon}:=\pi-\epsilon$. The corresponding empirical measure is:

$$ $\mu_{\epsilon}(0):=\frac{1}{2}(\delta_{\epsilon}+\delta_{\pi-\epsilon})$ $$

We want a bound of this kind:

$$ $\frac{W^{1}(\mu_{\epsilon}(t),\mu_{0}(t))}{W^{1}(\mu_{\epsilon}(0),\mu_{0}(0)) }\leq f(t)\quad\forall\epsilon>0\quad\forall t\geq 0.$ $$

for some function $f$.

Notice that $\mu_{0}(0)$ is a constant solution of our system.
The Wasserstein distance w.r.t. the geodesic distance on $\mathbb{S}^{1}$ is given by:

$$ $W^{1}(\mu_{\epsilon}(t),\mu_{0}(t))=\frac{1}{2}(\theta_{1}(t)+\pi-\theta_{2}(t ))=\frac{\pi}{2}-\frac{\omega(t)}{2},$ $$

hence the function $f$ must satisfy:

$$ $\frac{\frac{\pi}{2}-\frac{\omega(t)}{2}}{\epsilon}\leq f(t)\quad\forall \epsilon>0\quad\forall t\geq 0,$ $$

with initial condition $\omega(0)=\pi-2\epsilon$. Using the bounds in Eq. (13):

$$ $\frac{\frac{\pi}{2}-\frac{\omega(t)}{2}}{\epsilon}\geq\frac{1}{\epsilon}\left( \frac{\pi}{2}-\cot^{-1}(e^{c+2t/e^{2}})\right)$ $$

with $c$ s.t. $2\cot^{-1}(e^{c})=\pi-2\epsilon$, i.e. $e^{c}=\tan(\epsilon)$. Hence it must hold:

$$ $f(t)\geq\frac{1}{\epsilon}\left(\frac{\pi}{2}-\cot^{-1}(\tan(\epsilon)e^{2t/e^ {2}})\right)\quad\forall\epsilon>0.$ $$

Passing to the limit as $\epsilon\to 0$, using a first order Taylor expansion in 0 0 for $\cot^{-1}(x)\approx\frac{\pi}{2}-x$, we get:

$$ $\begin{split}f(t)\geq&\lim_{\epsilon\to 0}\frac{1}{\epsilon}\left(\frac{\pi}{2 }-\cot^{-1}(\tan(\epsilon)e^{2t/e^{2}})\right)=\\ =&\lim_{\epsilon\to 0}\frac{\tan(\epsilon)}{\epsilon}e^{2t/e^{2}}=e^{2t/e^{2}} .\end{split}$ $$

This implies that we cannot improve the exponential time dependence for the stability.

## Appendix C Appendix: metastability

### C.1. Preliminary definitions

#### C.1.1. Sobolev spaces of negative order

Given a domain $\Omega\subset\mathbb{R}^{d}$, we define
for every $s\in\mathbb{N}$ and $p\in[1,+\infty[$ the corresponding Sobolev space of negative order as the dual:

$$ $W^{-s,p^{\prime}}(\Omega):=W_{0}^{s,p}(\Omega)^{\prime},$ $$

where $p^{\prime}=p/(p-1)$ and $W_{0}^{s}(\Omega)$ denotes the closure of $C^{\infty}_{c}(\Omega)$ in the usual Sobolev space $W^{s,p}(\Omega)$. The corresponding dual norm for $W^{-s,p^{\prime}}(\Omega)$ is given by:

$$ (14) $\|u\|_{W^{-s,p^{\prime}}(\Omega)}:=\sup\left\{\langle u,v\rangle:v\in W_{0}^{s ,p}(\Omega),\|v\|_{W^{s,p}(\Omega)}=1\right\}.$ $$

For any $s\in\mathbb{N}$ and $p\in[1,+\infty[$ the space $W^{-s,p^{\prime}}(\Omega)$ is a Banach space. Moreover, if $1<p<+\infty$, $W^{-s,p^{\prime}}(\Omega)$ is separable and reflexive.

These definitions can be naturally extended to compact Riemannian manifolds, while the non-compact case is more subtle (the reader can find a reference in []).

Most of our discussion is set within the space $W^{-s,2}(\Omega)$, also referred to as $H^{-s}(\Omega)$. These spaces can be conveniently characterized using Fourier series:

$$ $H^{s}(\mathbb{T}^{d})=\left\{u\in C^{\infty}(\mathbb{T}^{n}):\|u\|_{H^{s}( \mathbb{T}^{d})}<\infty\right\},$ $$

where the norm on $H^{s}(\mathbb{T}^{d})$ is defined as:

$$ $\|u\|^{2}_{H^{s}_{\mathbb{T}^{d}}}=\sum_{k\in\mathbb{Z}^{d}}|\hat{u}_{k}|^{2}( 1+|k|^{2})^{s}.$ $$

Additionally, note that the Dirac delta $\delta$ is an element of $H^{s}(\mathbb{R}^{d})$ for every $s<-d/2$.

#### C.1.2. Spherical harmonics and Gegenbauer polynomials

The classical spherical harmonics can be generalized to higher-dimensional spheres $\mathbb{S}^{d-1}$ in the following way. Consider $\mathbb{P}_{l}$ the space of homogeneous polynomials $p(x):\mathbb{R}^{d}\to\mathbb{C}$ of degree $l$ in $d$ variables, and let $\mathbb{A}_{l}$ denote the subspace $\mathbb{P}_{l}$ of harmonic polynomials. Then the spherical harmonics of degree $l$ are an orthogonal basis for:

$$ $\mathbb{H}_{l}:=\left\{Y_{l}:\mathbb{S}^{d-1}\to\mathbb{C}|\text{ exists }p\in \mathbb{A}_{l}\text{ such that }Y_{l}(x)=p(x)\text{ for all }x\in\mathbb{S}^{d -1}\right\}.$ $$

While explicit formulas can be given by induction, we will just need the following:

###### Theorem C.1 .

If $\Delta$ is the Laplace-Beltrami operator on $\mathbb{S}^{d-1}$, then for all $Y_{l}\in\mathbb{H}_{l}$, one has:

$$ $\Delta Y_{l}=-l(l+d-2)Y_{l}.$ $$

Furthermore, we recall here the definition of convolution on spheres:
Furthermore, spherical harmonics have a strict relationship with the convolution defined in Eq. (4), through the so called Gegenbauer polynomials $P_{k}^{\alpha}$.

These polynomials, also known as ultraspherical, are orthogonal on $[-1,1]$ with respect to the probability measure with density $\frac{\Gamma(\alpha+1)}{\sqrt{\pi}\Gamma(\alpha+\frac{1}{2})}(1-t^{2})^{\alpha
-\frac{1}{2}}$. An useful definition is through Rodrigues formula:

$$ $P^{\alpha}_{k}(t)=\frac{(-1)^{k}\Gamma(\alpha+\frac{1}{2})}{2^{k}\Gamma(k+ \alpha+\frac{1}{2})}(1-t^{2})^{-\alpha+\frac{1}{2}}\frac{d^{k}}{dt^{k}}\left[( 1-t^{2})^{k+\alpha-\frac{1}{2}}\right].$ $$

They generalize Legendre polynomials and Chebyshev polynomials, and satisfy the so called Funk-Hecke formula:

###### Theorem C.2 .

Let $f:[-1,1]\to\mathbb{R}$ such that $t\to(1-t^{2})^{\frac{d-3}{2}}f(t)$ is integrable. Then the Funk-Hecke formula holds:

$$ $\int_{\mathbb{S}^{d-1}}f(\langle x,y\rangle)Y_{l}(y)d\sigma(y)=\lambda_{l}Y_{l }(x),$ $$

with the constant $\lambda_{l}$ given by:

$$ $\lambda_{l}=\int_{-1}^{1}P_{l}^{\frac{d-2}{2}}(t)f(t)\frac{2\pi^{\frac{d-1}{2} }}{\Gamma(\frac{d-1}{2})}(1-t^{2})^{\frac{d-3}{2}}dt,$ $$

where $\Gamma(\cdot)$ is the gamma function and $Y_{l}$ is any spherical harmonics on $\mathbb{S}^{d-1}$ of degree $l$.

Other properties are discussed in [, ].
Although the nomenclature may not be standardized in the literature, we refer to $\lambda_{l}$ as Gegenbauer coefficent of $f$ of degree $l$.

###### Theorem C.1 .

###### Theorem C.2 .

### C.2. The emergence of symmetry

For clarity, the following discussion is restricted to $\mathbb{S}^{1}$ (refer to Section 4.4 for adaptations to higher dimensions). Specifically, notice that identifying each pair of points $x,y\in\mathbb{S}^{1}$ with the corresponding angle $\theta,\gamma\in[0,2\pi]$ and using the relation $W(\langle x,y\rangle)=W(\cos(\theta-\gamma))$, the definition of convolution provided in Eq. (4) aligns with the classical notion of convolution on $\mathbb{S}^{1}$. Furthermore, thanks to this change of variable, the Gengenbauer coefficients $\hat{W}_{k}$ correspond to the Fourier cosine expansion of $W\circ\cos$.
Thus, for simplicity of notation we will continue using the notation $W$ to represent the composition $W\circ\cos$.

###### Remark C.3 .

In the case of Transformers, both Assumption 1 and Assumption 2 are satisfied since $W(\theta):=\frac{1}{\beta}e^{\beta\cos(\theta)}=\sum_{k=0}^{\infty}\frac{2}{
\beta}I_{k}(\beta)\cos(k\theta)$, where $I_{k}(\beta)$ are the modified Bessel functions of the first kind.

Consider $\mu_{\infty}$ as the uniform measure on $\mathbb{S}^{1}$, and let the intial perturbation be $\mu_{0}:=\mu_{\infty}+\rho_{0}$ in $\mathcal{P}(\mathbb{S}^{1})$. If $\mu_{t}$ evolves according to the following PDE (consequence of Eq. (3)):

$$ (15) $\begin{cases}\partial_{t}\mu_{t}=-\partial_{\theta}(\mu_{t}\nabla W*\mu_{t}), \\ \mu(0)=\mu_{0},\end{cases}$ $$

then the perturbation $\rho_{t}$ satisfies:

$$ (16) $\begin{cases}\partial_{t}\rho_{t}=\mathcal{L}_{\mu_{\infty}}(\rho_{t})- \partial_{\theta}(\rho_{t}\nabla W*\rho_{t}),\\ \rho(0)=\rho_{0},\end{cases}$ $$

where $\mathcal{L}_{\mu_{\infty}}(\rho):=-\mu_{\infty}\Delta W*\rho$ denotes the PDE’s linearized operator around $\mu_{\infty}$.

###### Remark C.4 .

Since $\nabla W*\mu_{\infty}=0$, the uniform measure is an equilibrium of the system.

The objective of this section is to demonstrate that the dynamics of the system near $\mu_{\infty}$ are governed by the maximal eigenvalue of $\mathcal{L}_{\mu_{\infty}}$.

The core estimate is provided by the following lemma:

###### Lemma C.5 .

Let $n\geq 0$.
For any $g\in H^{n}(\mathbb{S}^{1})$ and $f\in W^{n,\infty}(\mathbb{S}^{1})$, the following inequality holds:

$$ $\langle f\partial_{\theta}g,g\rangle_{H^{n}}\leq C_{n}\|f\|_{W^{n,\infty}}\|g \|_{H^{n}}^{2}.$ $$

###### Proof.

For every $k\leq n$:

$$ $\begin{split}\langle\partial^{k}(f\partial g),\partial^{k}g\rangle_{L^{2}}&= \sum_{j=0}^{k}\binom{k}{j}\langle\partial^{k-j}f\ \partial^{j+1}g,\partial^{k} g\rangle=\\ &=\sum_{j=0}^{k-1}\binom{k}{j}\langle\partial^{k-j}f\ \partial^{j+1}g,\partial ^{k}g\rangle+\langle f\partial^{k+1}g,\partial^{k}g\rangle\leq\\ &\leq\sum_{j=0}^{k-1}\binom{k}{j}\|\partial^{k-j}f\|_{L^{\infty}}\|\partial^{j +1}g\|_{L^{2}}\|\partial^{k}g\|_{L^{2}}+\langle f,\frac{1}{2}\partial(\partial ^{k}g)^{2}\rangle\leq\\ &\leq C_{k}\|f\|_{W^{k,\infty}}\|g\|_{H^{k}}^{2}.\end{split}$ $$

∎

For sufficiently small time intervals, the evolution of $\mu_{t}$ can be approximated by the solution of the linearized operator. The deviation from this approximation will be estimated in the next paragraph.

###### Remark C.3 .

###### Remark C.4 .

###### Lemma C.5 .

###### Proof.

### C.3. The linear phase

Dobrushin’s estimate applies globally on $\mathbb{S}^{1}$ and may be suboptimal in the vicinity of the equilibrium $\mu_{\infty}$. While in general is not possible to have a uniform or polynomial dependence with respect to time (see Appendix B),
this estimate can be locally refined by considering the singular values of the linear operator $\mathcal{L}_{\mu_{\infty}}:H^{k}(\mathbb{S}^{1})\to H^{k}(\mathbb{S}^{1})$. Specifically, under Assumption (1) and Assumption (2), for every $f\in H^{k}(\mathbb{S}^{1})$ with $k\in\mathbb{Z}$ (refer to Lemma E.2):

$$ $\|\mathcal{L}_{\mu_{\infty}}f\|_{H^{k}}\leq\frac{1}{2\pi}\gamma_{max}\|f\|_{H^ {k}}.$ $$

###### Remark C.6 .

Hereafter, $\frac{1}{2\pi}\gamma_{k}$ will be denoted simply as $\gamma_{k}$.

Utilizing the Lagrangian flow, it’s possible to bound the growth of the perturbation $\rho_{t}$ in a small neighborhood of $\mu_{\infty}$ using $\gamma_{max}$. In particular, the following lemma can be proved:

###### Lemma C.7 .

Let $k\geq 0$. There exists $\epsilon>0$ such that, if $\|\rho_{0}\|_{H^{-k}}<\epsilon$, then

$$ $T_{1}(\epsilon,\rho_{0}):=\frac{1}{\gamma_{max}}\ln\left(\frac{\epsilon}{\| \rho_{0}\|_{H^{-k}}}\right)$ $$

is well-defined, and for every $t\in[0,T_{1}(\epsilon,\rho_{0})]$, the following inequality holds:

$$ $\|\rho_{t}\|_{H^{-k}}\leq 3\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}t}.$ $$

###### Remark C.8 .

The constant $\epsilon$ is independent of $\rho_{0}$. Furthermore,
this lemma implies that, within the time interval $[0,T_{1}]$ the evolution of the measure $\mu_{t}$ remains within $B_{H^{-k}}(\mu_{\infty},3\epsilon)$.

###### Proof.

Given a test function $\bar{\psi}\in H^{k}(\mathbb{S}^{1})$, let $\psi_{s}$ be the solution of:

$$ (17) $\begin{cases}\partial_{s}\psi_{s}=-\mathcal{L}_{\mu_{\infty}}(\psi_{s})-( \nabla W*\rho_{s})\partial_{\theta}\psi_{s}&s\in[0,t],\\ \psi_{t}=\bar{\psi}.\end{cases}$ $$

Hence, by construction:

$$ $\displaystyle\partial_{s}\langle\rho_{s},\psi_{s}\rangle$ $\displaystyle=\langle\partial_{s}\rho,\psi\rangle+\langle\rho,\partial_{s}\psi\rangle=$ $\displaystyle=\langle\mathcal{L}_{\mu_{\infty}}(\rho_{s})-\partial_{\theta}( \rho_{s}\nabla W*\rho_{s}),\psi_{s}\rangle-\langle\rho_{s},\mathcal{L}_{\mu_{ \infty}}(\psi_{s})+(\nabla W*\rho_{s})\partial_{\theta}\psi_{s}\rangle=$ $\displaystyle=0.$ $$

This implies:

$$ (18) $\begin{split}\|\rho_{t}\|_{H^{-k}}&=\sup_{\|\bar{\psi}\|_{H^{k}}=1}\langle\rho _{t},\bar{\psi}\rangle=\sup_{\|\psi_{t}\|_{H^{k}}=1}\langle\rho_{t},\psi_{t} \rangle=\\ &=\sup_{\|\psi_{t}\|_{H^{k}}=1}\langle\rho_{0},\psi_{0}\rangle\leq\\ &\leq\|\rho_{0}\|_{H^{-k}}\sup_{\|\psi_{t}\|_{H^{k}}=1}\|\psi_{0}\|_{H^{k}}. \end{split}$ $$

Next, we need an estimate for $\|\psi_{0}\|_{H^{k}}$. The energy of the time-reversed Eq. (17) satisfies:

$$ $\begin{split}\frac{1}{2}\frac{d}{ds}\|\psi_{t-s}\|_{H^{k}}^{2}&=\langle \mathcal{L}_{\mu_{\infty}}\psi_{t-s},\psi_{t-s}\rangle_{H^{k}}+\langle\nabla W *\rho_{t-s}\partial_{\theta}\psi_{t-s},\psi_{t-s}\rangle_{H^{k}}\leq\\ &\leq\gamma_{max}\|\psi_{t-s}\|_{H^{k}}^{2}+C\|\psi_{t-s}\|_{H^{k}}^{2}\| \nabla W*\rho_{t-s}\|_{W^{k,\infty}}\leq\\ &\leq\gamma_{max}\|\psi_{t-s}\|_{H^{k}}^{2}+C\|\psi_{t-s}\|_{H^{k}}^{2}\| \nabla W\|_{H^{2k}}\|\rho_{t-s}\|_{H^{-k}}\leq\\ &\leq(\gamma_{max}+C\|\rho_{t-s}\|_{H^{-k}})\|\psi_{t-s}\|_{H^{k}}^{2},\end{split}$ $$

where the second row is an application of Lemma C.5. Hence, by Gronwall’s lemma:

$$ $\|\psi_{0}\|_{H^{k}}\leq\|\psi_{t}\|_{H^{k}}e^{\gamma_{max}t+C\int_{0}^{t}\| \rho_{s}\|_{H^{-k}}ds}.$ $$

Substituting this bound into Eq. (18), we obtain for all $t\geq 0$:

$$ (19) $\|\rho_{t}\|_{H^{-k}}\leq\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}t+C\int_{0}^{t}\| \rho_{s}\|_{H^{-k}}ds}.$ $$

The conclusion follows from a standard continuation argument: assume $\|\rho_{s}\|_{H^{-k}}\leq 3\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}s}$. Then, by Eq. (19), in the interval $\left[0,T_{1}(\epsilon,\rho_{0})\right]$, it holds:

$$ $\begin{split}\|\rho_{t}\|_{H^{-k}}&\leq\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}t+C \int_{0}^{t}\|\rho_{s}\|_{H^{-k}}ds}\leq\\ &\leq\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}t+3C\|\rho_{0}\|_{H^{-k}}\frac{1}{ \gamma_{max}}e^{\gamma_{max}t}}\leq\\ &\leq\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}t+3C\|\rho_{0}\|_{H^{-k}}\frac{1}{ \gamma_{max}}e^{\gamma_{max}T_{1}(\epsilon,\rho_{0})}}\leq\\ &\leq\|\rho(0)\|_{H^{-k}}e^{\gamma_{max}t+\frac{3C\epsilon}{\gamma_{max}}}. \end{split}$ $$

If $\epsilon$ is such that $\frac{3C\epsilon}{\gamma_{max}}\leq 1$, then $\|\rho_{t}\|_{H^{-k}}<3\|\rho_{0}\|_{H^{-k}}e^{\gamma_{max}t}$ in the interval $[0,T_{1}(\epsilon,\rho_{0})]$. This concludes the continuation argument.
∎

Now we want to control the distance between $\rho$ and the solution $\rho^{L}$ of the linearized PDE:

$$ (20) $\begin{cases}\partial_{t}\rho^{L}=\mathcal{L}_{\mu_{\infty}}(\rho^{L}),\\ \rho^{L}_{0}=\rho_{0}.\end{cases}$ $$

By considering a loss of regularity we derive the following estimate:

###### Lemma C.9 .

Let $k\geq 0$. For all $t\in[0,T_{1}(\epsilon,\rho_{0})]$, the following holds:

$$ $\|\rho_{t}-\rho^{L}_{t}\|_{H^{-k-1}}\leq C\|\rho_{0}\|_{H^{-k}}^{2}e^{2\gamma_ {max}t}.$ $$

###### Proof.

The difference $\rho-\rho^{L}$ satisfies the PDE:

$$ $\partial_{t}(\rho-\rho^{L})=\mathcal{L}_{\mu_{\infty}}(\rho_{t}-\rho^{L}_{t})- \partial_{\theta}(\rho_{t}\nabla W*\rho_{t}).$ $$

Thus,

$$ $\begin{split}\frac{d}{dt}\|\rho_{t}-\rho^{L}_{t}\|_{H^{-k-1}}&\leq\gamma_{max} \|\rho_{t}-\rho^{L}_{t}\|_{H^{-k-1}}+\|\rho_{t}\nabla W*\rho_{t}\|_{H^{-k}} \leq\\ &\leq\gamma_{max}\|\rho_{t}-\rho^{L}_{t}\|_{H^{-k-1}}+\|\rho_{t}\|_{H^{-k}}\| \nabla W*\rho_{t}\|_{W^{k,\infty}}\leq\\ &\leq\gamma_{max}\|\rho_{t}-\rho^{L}_{t}\|_{H^{-k-1}}+C\|\rho_{t}\|_{H^{-k}}^{ 2}.\end{split}$ $$

Applying Lemma C.7, we obtain:

$$ $\frac{d}{dt}\|\rho_{t}-\rho^{L}_{t}\|_{H^{-k-1}}\leq\gamma_{max}\|\rho_{t}- \rho_{L}\|_{H^{-k-1}}+C\|\rho_{0}\|^{2}_{H^{-k}}e^{2\gamma_{max}t}.$ $$

The conclusion is a consequence of Gronwall’s lemma (Lemma E.1).
∎

We can conclude this section with the following proposition, which describe the measure $\mu_{t}$ at the exit point from $B_{H^{-k}}(\mu_{\infty},3\epsilon)$. In particular, we prove that after a time $T_{1}$, defined as:

$$ (21) $T_{1}(\epsilon,\rho_{0}):=\frac{1}{\gamma_{max}}\ln\left(\frac{\epsilon}{\| \rho_{0}\|_{H^{-k}}}\right)$ $$

the perturbation of the uniform measure consists of a dominant mode characterized by $k_{max}$, along with a remainder made up of two components: the error from discarding the other modes and the error resulting from linearizing the PDE.

###### Proposition C.10 .

Let $k\geq 0$. There exists $\epsilon_{0}>0$ such that if $\|\rho_{0}\|_{H^{-k}}<\epsilon<\epsilon_{0}$, then:

$$ $\mu_{T_{1}(\epsilon,\rho)}=\mu_{\infty}+\epsilon\frac{(\hat{\rho}_{0})_{k_{max }}}{\|\rho_{0}\|_{H^{-k}}}\cos(k_{max}\theta)+R(\epsilon,\|\rho_{0}\|_{H^{-k}}),$ $$

where $T_{1}(\epsilon,\rho_{0})$ is defined in Eq. (21). Furthermore, let $\gamma^{-}:=\max_{k\neq\pm k_{max}}\gamma_{k}$, then:

$$ $R(\epsilon,\|\rho_{0}\|_{H^{-k}})=O_{H^{-k-1}}\left(\|\rho_{0}\|_{H^{-k}}\left (\frac{\epsilon}{\|\rho_{0}\|_{H^{-k}}}\right)^{\frac{\gamma^{-}}{\gamma_{max} }}+\epsilon^{2}\right).$ $$

###### Proof.

Notice that the solution to Eq. (20) can be explicitly expressed in terms of the Fourier coefficients of the initial condition:

$$ (22) $\rho^{L}_{t}=\sum_{k\in\mathbb{Z}}(\hat{\rho}_{0})_{k}e^{\gamma_{k}t}e^{ikx}.$ $$

Let $\gamma^{-}:=\max_{k\neq k_{max}}\gamma_{k}$. By substituting Eq. (22) into Lemma C.9 and using the definition of $T_{1}$, we get:

$$ $\begin{split}\rho_{T_{1}}=&\rho^{L}_{T_{1}}+O_{H^{-k-1}}\left(\|\rho_{0}\|_{H^ {-k}}^{2}e^{2\gamma_{max}T_{1}}\right)=\\ =&(\hat{\rho}_{0})_{k_{max}}e^{\gamma_{max}T_{1}}\cos(k_{max}x)+\sum_{k\neq\pm k _{max}}(\hat{\rho}_{0})_{k}e^{\gamma_{k}T_{1}}e^{ikx}+O_{H^{-k-1}}\left(\|\rho _{0}\|_{H^{-k}}^{2}e^{2\gamma_{max}T_{1}}\right)=\\ =&\epsilon\frac{(\hat{\rho}_{0})_{k_{max}}}{\|\rho_{0}\|_{H^{-k}}}\cos(k_{max} x)+\sum_{k\neq\pm k_{max}}(\hat{\rho}_{0})_{k}\left(\frac{\epsilon}{\|\rho_{0} \|_{H^{-k}}}\right)^{\frac{\gamma^{-}}{\gamma_{max}}}e^{ikx}+O_{H^{-k-1}}\left (\epsilon^{2}\right)=\\ =&\epsilon\frac{(\hat{\rho}_{0})_{k_{max}}}{\|\rho_{0}\|_{H^{-k}}}\cos(k_{max} x)+O_{H^{-k-1}}\left(\|\rho_{0}\|_{H^{-k}}\left(\frac{\epsilon}{\|\rho_{0}\|_{ H^{-k}}}\right)^{\frac{\gamma^{-}}{\gamma_{max}}}+\epsilon^{2}\right).\end{split}$ $$

∎

We turn to our discussion of the subsequent “quasi-linear” phase.

###### Remark C.6 .

###### Lemma C.7 .

###### Remark C.8 .

###### Proof.

###### Lemma C.9 .

###### Proof.

###### Proposition C.10 .

###### Proof.

### C.4. The quasi-linear phase

When the measure $\mu_{t}$ exits the ball $B_{H^{-k}}(\mu_{\infty},3\epsilon)$, the estimates based on the linearized equation are no longer sufficient to describe the system’s evolution. To address this, we build a nonlinear approximation following Grenier’s iterative scheme ([, ]).

In the preceding paragraph, we isolated the dominant mode $\cos(k_{max}\theta)$. Let $\alpha>0$ and consider the solution of the following nonlinear PDE:

$$ (23) $\begin{cases}\partial_{t}f^{\alpha}=-\partial_{\theta}\left(f^{\alpha}\nabla W *f^{\alpha}\right)\\ f^{\alpha}_{0}=\mu_{\infty}+\alpha\cos(k_{max}\theta).\end{cases}$ $$

We will demonstrate the existence of $\delta>0$, independent of $\alpha$, such that the evolution of $f^{\alpha}$ within the ball $B_{H^{-k}}(\mu_{\infty},\delta)$ is still controlled by $\gamma_{max}$.
In particular, we prove in Proposition C.15 that after a time $T_{2}$:

$$ (24) $T_{2}(\delta,\alpha):=\frac{1}{\gamma_{\text{max}}}\ln(\delta/\alpha),$ $$

the nonlinear evolution of the dominant mode moves outside a neighborhood of the uniform measure, with the radius of this neighborhood $\delta$ being independent of $\alpha$. Moreover, in Proposition C.17, we provide a bound on the distance between $f^{\alpha}$ and any distribution close to it at time 0 0, valid over the time horizon $[0,T_{2}]$.

Let’s introduce the following definitions essential for Grenier’s scheme:

$$ $\begin{split}g_{1}(t,\theta)&:=e^{\gamma_{max}t}\cos(k_{max}\theta),\\ f^{\alpha,K}(t,\theta)&:=\mu_{\infty}+\sum_{j=1}^{K}\alpha^{j}g_{j},\\ \end{split}$ $$

where the functions $g_{k}$ are defined recursively by:

$$ (25) $\begin{cases}(\partial_{t}-\mathcal{L}_{\mu_{\infty}})g_{k}=-\sum_{j=1}^{k-1} \partial_{\theta}\left(g_{j}\nabla W*g_{k-j}\right)\\ g_{k}(0)=0\quad\forall k\geq 2.\end{cases}$ $$

Notice that:

$$ (26) $\partial_{t}f^{\alpha,K}+\partial_{\theta}(f^{\alpha,K}\nabla W*f^{\alpha,K})= R^{\alpha,K}:=-\sum_{\begin{subarray}{c}1\leq j,l\leq K\\ j+l\geq K+1\end{subarray}}\alpha^{j+l}\partial_{\theta}(g_{j}\nabla W*g_{l}).$ $$

###### Lemma C.11 .

Let $K>0$ and $s\geq 0$. Then $\forall k\leq K$:

$$ $\|g_{k}\|_{H^{s}}\leq C_{K}e^{k\gamma_{max}t}.$ $$

###### Proof.

The proof proceeds by induction, showing that $\|g_{k}\|_{H^{n-k}}\leq C_{k}e^{k\gamma_{max}t}$, where $n:=K+s$.

By definition, we immediately get $\|g_{1}\|_{H^{n}}\leq Ce^{\gamma_{max}t}$.

For the inductive step, consider $k>0$ and assume the hypothesis holds up to $k-1$. Then by Eq. (25):

$$ $\begin{split}\frac{d}{dt}\|g_{k}\|_{H^{n-k}}&\leq\|\mathcal{L}_{\mu_{\infty}}g _{k}\|_{H^{n-k}}+\sum_{j=1}^{k-1}\|\partial_{\theta}(g_{j}\nabla W*g_{k-j})\|_ {H^{n-k}}\leq\\ &\leq\gamma_{max}\|g_{k}\|_{H^{n-k}}+\sum_{j=1}^{k-1}\|g_{j}\nabla W*g_{k-j}\| _{H^{n-k+1}}\leq\\ &\leq\gamma_{max}\|g_{k}\|_{H^{n-k}}+\sum_{j=1}^{k-1}\|g_{j}\|_{H^{n-k+1}}\| \nabla W*g_{k-j}\|_{W^{n-k+1,\infty}}\leq\\ &\leq\gamma_{max}\|g_{k}\|_{H^{n-k}}+\sum_{j=1}^{k-1}\|g_{j}\|_{H^{n-k+1}}\| \nabla W\|_{L^{2}}\|g_{k-j}\|_{H^{n-k+1}}\leq\\ &\leq\gamma_{max}\|g_{k}\|_{H^{n-k}}+C\sum_{j=1}^{k-1}\|g_{j}\|_{H^{n-j}}\|g_{ k-j}\|_{H^{n-(k-j)}}\leq\\ &\leq\gamma_{max}\|g_{k}\|_{H^{n-k}}+C_{k}e^{k\gamma_{max}t}.\end{split}$ $$

Therefore, by Gronwall’s lemma (Lemma E.1):

$$ $\begin{split}\|g_{k}\|_{H^{n-k}}&\leq C_{k}e^{k\gamma_{max}t}.\end{split}$ $$

To conclude, recall the definition of $n$ as $K+s$.
∎

###### Remark C.12 .

This lemma implies that if $\alpha e^{\gamma_{max}t}\leq\delta<1$, then:

$$ $\|f^{\alpha,K}-\mu_{\infty}\|_{H^{s}}\leq C_{K}\sum_{j=1}^{K}(\alpha e^{\gamma _{max}t})^{j}\leq\tilde{C}_{K}(\alpha e^{\gamma_{max}t}),$ $$

and similarly:

$$ $\|f^{\alpha,K}-\mu_{\infty}\|_{H^{s}}\geq\|\alpha g_{1}\|_{H^{s}}-C_{K}\sum_{j =2}^{K}(\alpha e^{\gamma_{max}t})^{j}\geq\bar{C}_{K}\alpha e^{\gamma_{max}t}.$ $$

We now need to estimate the remainder $R^{\alpha,K}$ that appears in Eq. (26):

###### Lemma C.13 .

Let $K>0$, $s\geq 0$ and $\delta<1$. If $\alpha e^{\gamma_{max}t}\leq\delta$, then:

$$ $\|R^{\alpha,K}\|_{H^{s}}\leq\tilde{C}_{K}\left(\alpha e^{\gamma_{max}t}\right) ^{K+1}.$ $$

###### Proof.

By definition of $R^{\alpha,K}$:

$$ $\begin{split}\|R^{\alpha,K}\|_{H^{s}}&\leq\sum_{\begin{subarray}{c}1\leq j,l \leq K\\ j+l\geq K+1\end{subarray}}\alpha^{j+l}\|\partial_{\theta}(g_{j}\nabla W*g_{l}) \|_{H^{s}}\leq\\ &\leq\sum_{\begin{subarray}{c}1\leq j,l\leq K\\ j+l\geq K+1\end{subarray}}\alpha^{j+l}\|g_{j}\nabla W*g_{l}\|_{H^{s+1}}\leq\\ &\leq C_{K}\sum_{\begin{subarray}{c}1\leq j,l\leq K\\ j+l\geq K+1\end{subarray}}\alpha^{j+l}\|g_{j}\|_{H^{s+1}}\|g_{l}\|_{H^{s+1}}. \end{split}$ $$

Finally, Lemma C.11 and the assumption imply:

$$ $\|R^{\alpha,K}\|_{H^{s}}\leq C_{K}\sum_{\begin{subarray}{c}1\leq j,l\leq K\\ j+l\geq K+1\end{subarray}}\alpha^{j+l}e^{(j+l)\gamma_{max}t}\leq\tilde{C}_{K} \left(\alpha e^{\gamma_{max}t}\right)^{K+1}.$ $$

∎

Now, we can compare the evolution of the dominant mode $f^{\alpha}$ defined in Eq. (23) and Grenier’s approximation $f^{\alpha,K}$. Let $r^{\alpha,K}:=f^{\alpha}-f^{\alpha,K}$.

###### Lemma C.14 .

Given $s\geq 0$, there exist constants $K_{0}$ and $\delta>0$ (independent of $\alpha$) such that, for every $K\geq K_{0}$ and for every $t$ such that $\alpha e^{\gamma_{max}t}<\delta$, the following bound holds:

$$ $\|r^{\alpha,K}_{t}\|_{H^{s}}\leq C(\alpha e^{\gamma_{max}t})^{K},$ $$

where the constant $C$ depends only on $s,K$ and $W$.

###### Proof.

Combining Eq. (23) and Eq. (26), $r^{\alpha,K}$ solves:

$$ $\partial_{t}r^{\alpha,K}+\partial_{\theta}\left(f^{\alpha,K}\nabla W*r^{\alpha ,K}\right)+\partial_{\theta}\left(r^{\alpha,K}\nabla W*f^{\alpha,K}\right)+ \partial_{\theta}\left(r^{\alpha,K}\nabla W*r^{\alpha,K}\right)=R^{\alpha,K}.$ $$

To study its energy:

$$ (27) $\begin{split}\frac{1}{2}\frac{d}{dt}\|r^{\alpha,K}\|^{2}_{H^{s}}=&-\langle \partial_{\theta}\left(f^{\alpha,K}\nabla W*r^{\alpha,K}\right),r^{\alpha,K} \rangle_{H^{s}}+\\ &-\langle\partial_{\theta}\left(r^{\alpha,K}\nabla W*f^{\alpha,K}\right),r^{ \alpha,K}\rangle_{H^{s}}+\\ &-\langle\partial_{\theta}\left(r^{\alpha,K}\nabla W*r^{\alpha,K}\right),r^{ \alpha,K}\rangle_{H^{s}}+\\ &+\langle R^{\alpha,K},r^{\alpha,K}\rangle_{H^{s}}.\end{split}$ $$

The three terms can be estimated separately:

- •
first term:
$\begin{split}-\langle\partial_{\theta}\left(f^{\alpha,K}\nabla W*r^{\alpha,K}
\right),r^{\alpha,K}\rangle_{H^{s}}=&-\langle\left(\partial_{\theta}f^{\alpha,
K}\right)\nabla W*r^{\alpha,K},r^{\alpha,K}\rangle_{H^{s}}+\\
&-\langle f^{\alpha,K}\Delta W*r^{\alpha,K},r^{\alpha,K}\rangle_{H^{s}}\leq\\
\leq&C\|f^{\alpha,K}\|_{H^{s+1}}\|r^{\alpha,K}\|^{2}_{H^{s}}.\end{split}$
- •
second term (using Lemma C.5):
$\begin{split}-\langle\partial_{\theta}\left(r^{\alpha,K}\nabla W*f^{\alpha,K}
\right),r^{\alpha,K}\rangle_{H^{s}}\leq C\|f^{\alpha,K}\|_{H^{s}}\|r^{\alpha,K
}\|_{H^{s}}^{2}.\end{split}$
- •
third term (again by Lemma C.5):
$\begin{split}-\langle\partial_{\theta}\left(r^{\alpha,K}\nabla W*r^{\alpha,K}
\right),r^{\alpha,K}\rangle_{H^{s}}\leq C\|r^{\alpha,K}\|_{H^{s}}^{3}.\end{split}$

Combining these estimates, and utilizing Lemma C.12 and Lemma C.13:

$$ $\begin{split}\frac{d}{dt}\|r^{\alpha,K}\|_{H^{s}}\leq&C(\|f^{\alpha,K}\|_{H^{s +1}}+\|r^{\alpha,K}\|_{H^{s}})\|r^{\alpha,K}\|_{H^{s}}+\|R^{\alpha,K}\|_{H^{s} }\\ \leq&C(\|\mu_{\infty}\|_{H^{s}}+C_{K}\alpha e^{\gamma_{max}t}+\|r^{\alpha,K}\| _{H^{s}})\|r^{\alpha,K}\|_{H^{s}}+\\ +&C_{K}(\alpha e^{\gamma_{max}t})^{K+1}.\end{split}$ $$

The conclusion follows via the standard continuation argument.

Assume $\|r^{\alpha,K}\|_{H^{s}}\leq C\left(\alpha e^{\gamma_{max}t}\right)^{K}$ and $t\in\left[0,\frac{1}{\gamma_{max}}\ln\left(\frac{\delta}{\alpha}\right)\right]$. If $\delta$ is sufficiently small such that $C_{K}\delta<1$, and $K$ is sufficiently large such that $3C<K\gamma_{max}$, then:

$$ $\begin{split}\frac{d}{dt}\|r^{\alpha,K}\|_{H^{s}}&\leq C(\|\mu_{\infty}\|_{H^{ s}}+C_{K}\alpha e^{\gamma_{max}t}+C_{K}\left(\alpha e^{\gamma_{max}t}\right)^{ K})\|r^{\alpha,K}\|_{H^{s}}+\\ &+C_{K}(\alpha e^{\gamma_{max}t})^{K+1}\leq\\ &\leq 3C\|r^{\alpha,K}\|_{H^{s}}+C_{K}(\alpha e^{\gamma_{max}t})^{K+1}.\end{split}$ $$

By applying Lemma E.1, which requires the assumption $3C<K\gamma_{max}$, we obtain:

$$ $\|r^{\alpha,K}\|_{H^{s}}\leq\frac{C_{K}\alpha^{K+1}}{\gamma_{max}}e^{(K+1) \gamma_{max}t}\leq\delta C_{K}e^{K\gamma_{max}t}.$ $$

Since $\delta<1$, the solution remains within the desired bound and can be continued.
∎

The results presented in this section lead to the following proposition, which provides a lower bound on the growth rate of the dominant mode.

###### Proposition C.15 .

Let $f^{\alpha}$ be the solution of Eq. (23). Given $s\geq 0$, there exists $\delta>0$ (independent of $\alpha$) such that for $T_{2}(\delta,\alpha)$ defined as in Eq. (24), the following holds:

$$ (28) $\|f^{\alpha}_{T^{2}_{\alpha}}-\mu_{\infty}\|_{H^{s}}\geq C\delta.$ $$

###### Proof.

By Lemma C.12 and Lemma C.14, we have:

$$ $\begin{split}\|f^{\alpha}-\mu_{\infty}\|_{H^{s}}&\geq\|f^{\alpha,K}-\mu_{ \infty}\|_{H^{s}}-\|f^{\alpha}-f^{\alpha,K}\|_{H^{s}}\geq\\ &\geq C_{K}\alpha e^{\gamma_{max}t}-C_{K}(\alpha e^{\gamma_{max}t})^{K}\geq\\ &\geq C_{K}\alpha e^{\gamma_{max}t}.\end{split}$ $$

To conclude, observe that the maximum $t$ for which the assumption in Lemma C.14 holds is precisely $T_{2}(\delta,\alpha)$.
∎

###### Remark C.16 .

Note that the same estimate holds for $s<0$. Indeed, the only lower bound is needed for $g_{1}$, which grows as $e^{\gamma_{max}t}$ in every $H^{s}$ space.

To conclude this section, we need to establish an estimate on the distance between a given solution $\mu_{t}$ and the evolution of the dominant mode $f^{\alpha}_{t}$.

###### Proposition C.17 .

Consider a solution $\mu$ of Eq. (15) with initial condition $\mu_{0}$, and define $h_{t}:=\mu_{t}-f^{\alpha}_{t}$. If $\|h_{0}\|_{H^{-k}}=\|\mu_{0}-f^{\alpha}_{0}\|_{H^{-k}}\leq C\alpha$, then there exists $\delta>0$ (independent of $\alpha$), such that:

$$ $\|h_{t}\|_{H^{-k}}\leq 3\|h_{0}\|_{H^{-k}}e^{\gamma_{max}t},$ $$

for every $t\in\left[0,T_{2}(\delta,\alpha)\right]$.

###### Remark C.18 .

We will apply this proposition to $\mu_{0}=\mu_{\infty}+\rho(T_{1})$.

###### Proof.

Using Eq. (15) and Eq. (23), the distribution $h$ satisfies:

$$ $\begin{split}\partial_{t}h=&-\partial_{\theta}(\mu\nabla W*\mu)+\partial_{ \theta}(f^{\alpha}\nabla W*f^{\alpha})\\ =&-\partial_{\theta}(h\nabla W*f^{\alpha})-\partial_{\theta}(f^{\alpha}\nabla W *h)-\partial_{\theta}(h\nabla W*h)\\ =&-\mu_{\infty}\Delta W*h\\ &-\partial_{\theta}(h\nabla W*(f^{\alpha}-\mu_{\infty}))\\ &-\partial_{\theta}((f^{\alpha}-\mu_{\infty})\nabla W*h)\\ &-\partial_{\theta}(h\nabla W*h).\end{split}$ $$

We can adapt the Lagrangian flow argument used in Lemma C.7 to bound $\|h\|_{H^{-k}}$. Let $\bar{\psi}\in H^{k}(\mathbb{S}^{1})$, and define $\psi_{t}$ as the solution of:

$$ $\begin{cases}\partial_{s}\psi_{s}=&\mu_{\infty}\Delta W*\psi_{s}\\ &-[\nabla W*(f^{\alpha}_{s}-\mu_{\infty})]\partial_{\theta}\psi_{s}\\ &-\nabla W*[(f^{\alpha}_{s}-\mu_{\infty})\partial_{\theta}\psi_{s}]\\ &-[\nabla W*h_{s}]\partial_{\theta}\psi_{s}\\ \psi_{t}=\bar{\psi}.\end{cases}$ $$

To estimate the energy of $\psi_{t}$, we proceed as follows:

$$ $\begin{split}\frac{1}{2}\partial_{s}\|\psi_{t-s}\|_{H^{k}}^{2}=&-\mu_{\infty} \langle\Delta W*\psi_{t-s},\psi_{t-s}\rangle_{H^{k}}+\\ &+\langle[\nabla W*(f^{\alpha}-\mu_{\infty})]\partial_{\theta}\psi_{t-s},\psi_ {t-s}\rangle_{H^{k}}+\\ &+\langle\nabla W*[(f^{\alpha}-\mu_{\infty})\partial_{\theta}\psi_{t-s}],\psi_ {t-s}\rangle_{H^{k}}+\\ &+\langle[\nabla W*h]\partial_{\theta}\psi_{t-s},\psi_{t-s}\rangle_{H^{k}}\end {split}$ $$

We estimate each term separately:

- •
first term (Lemma E.2):
$-\mu_{\infty}\langle\Delta W*\psi_{t-s},\psi_{t-s}\rangle_{H^{k}}\leq\gamma_{
max}\|\psi_{t-s}\|_{H^{k}}^{2}.$
- •
second term (Lemma C.5):
$\begin{split}\langle[\nabla W*(f^{\alpha}-\mu_{\infty})]\partial_{\theta}\psi_
{t-s},\psi_{t-s}\rangle_{H^{k}}\leq&C\|\psi_{t-s}\|_{H^{k}}^{2}\|\nabla W*(f^{
\alpha}_{t-s}-\mu_{\infty})\|_{W^{k,\infty}}\leq\\
\leq&C\|\psi_{t-s}\|_{H^{k}}^{2}\|f^{\alpha}_{t-s}-\mu_{\infty}\|_{L^{2}}.\end
{split}$
- •
third term:
$\begin{split}\langle\nabla W*[(f^{\alpha}-\mu_{\infty})\partial_{\theta}\psi_{
t-s}],\psi_{t-s}\rangle_{H^{k}}=&\langle(f^{\alpha}-\mu_{\infty})\partial_{
\theta}\psi_{t-s},\nabla W*\psi_{t-s}\rangle_{L^{2}}+\\
+&\langle(f^{\alpha}-\mu_{\infty})\partial_{\theta}\psi_{t-s},\nabla^{3}W*\psi
_{t-s}\rangle_{L^{2}}+\\
+&\langle(f^{\alpha}-\mu_{\infty})\partial_{\theta}\psi_{t-s},\nabla^{5}W*\psi
_{t-s}\rangle_{L^{2}}+...\\
\leq&\|f^{\alpha}-\mu_{\infty}\|_{L^{2}}\|\psi_{t-s}\|_{H^{1}}\|\nabla W*\psi_
{t-s}\|_{L^{\infty}}+...\\
\leq&C\|f^{\alpha}-\mu_{\infty}\|_{L^{2}}\|\psi_{t-s}\|_{H^{1}}^{2}.\end{split}$
- •
fourth term (Lemma C.5):
$\begin{split}\langle[\nabla W*h]\partial_{\theta}\psi_{t-s},\psi_{t-s}\rangle_
{H^{k}}\leq C\|\psi_{t-s}\|^{2}_{H^{k}}\|h\|_{H^{-k}}.\end{split}$

Summarizing, we obtain the following differential inequality:

$$ $\partial_{s}\|\psi_{t-s}\|_{H^{k}}\leq(\gamma_{max}+C\|f^{\alpha}_{t-s}-\mu_{ \infty}\|_{L^{2}}+\|h_{t-s}\|_{H^{-k}})\|\psi_{t-s}\|_{H^{k}},$ $$

and by Gronwall’s lemma:

$$ (29) $\|\psi_{0}\|_{H^{k}}\leq\|\psi_{t}\|_{H^{k}}e^{\gamma_{max}t+\int_{0}^{t}C\|f^ {\alpha}_{s}-\mu_{\infty}\|_{L^{2}}+\|h_{s}\|_{H^{-k}}ds}.$ $$

Since by construction $\partial_{t}\langle h_{t},\psi_{t}\rangle=0$, that implies together with Eq. (29):

$$ $\begin{split}\|h_{t}\|_{H^{-k}}&:=\sup_{\|\bar{\psi}\|_{H^{k}}=1}\langle h_{t} ,\bar{\psi}\rangle=\sup_{\|\psi_{t}\|_{H^{k}}=1}\langle h_{t},\psi_{t}\rangle= \\ &=\sup_{\|\psi_{t}\|_{H^{k}}=1}\langle h_{0},\psi_{0}\rangle\leq\|h_{0}\|_{H^{ -k}}\sup_{\|\psi_{t}\|_{H^{k}}=1}\|\psi_{0}\|_{H^{k}}\\ &\leq\|h_{0}\|_{H^{-k}}e^{\gamma_{max}t+\int_{0}^{t}C\|f^{\alpha}_{s}-\mu_{ \infty}\|_{L^{2}}+\|h_{s}\|_{H^{-k}}ds}.\end{split}$ $$

The conclusion follows by a continuation argument. Suppose $\|h_{t}\|_{H^{-k}}\leq 3\|h_{0}\|_{H^{-k}}e^{\gamma_{max}t}$ and $t\in[0,T_{2}]$. Then:

$$ $\begin{split}\|h_{t}\|_{H^{-k}}\leq&\|h(0)\|_{H^{-k}}e^{\gamma_{max}t+\int_{0} ^{t}C\alpha e^{\gamma_{max}s}+3\|h_{0}\|_{H^{-k}}e^{\gamma_{max}s}ds}\leq\\ \leq&\|h(0)\|_{H^{-k}}e^{\gamma_{max}t+\frac{C\alpha}{\gamma_{max}}e^{\gamma_{ max}t}}\\ \leq&\|h(0)\|_{H^{-k}}e^{\gamma_{max}t+\frac{C\delta}{\gamma_{max}}}\end{split}$ $$

where the hypothesis $\|h_{0}\|_{H^{-k}}\leq C\alpha$ was used in the second line. By choosing $\delta$ small enough, such that $\frac{C\delta}{\gamma_{max}}\leq 1$, we get the desired estimate.
∎

###### Lemma C.11 .

###### Proof.

###### Remark C.12 .

###### Lemma C.13 .

###### Proof.

###### Lemma C.14 .

###### Proof.

###### Proposition C.15 .

###### Proof.

###### Remark C.16 .

###### Proposition C.17 .

###### Remark C.18 .

###### Proof.

### C.5. Combining the two phases

In Section C.3, we analyzed the initial evolution of a perturbation $\mu=\mu_{\infty}+\rho$ of the uniform measure by comparing it with the solution of the linearized PDE.
After a time $T_{1}$, the dominant mode emerges. As the perturbation exits the neighborhood $B_{H^{-k}}(\mu_{\infty},3\epsilon)$, a higher order approximation using Grenier’s scheme is required to track the nonlinear evolution of this dominant mode, as described in Section C.4. We now consolidate these findings into the following proposition, which we specify to the case of empirical measures.

Let $\{\mu^{N}_{0}\}_{N\in\mathbb{N}}$ denote a sequence of random measures in $\mathcal{P}(\mathbb{S}^{1})$, where $\mu^{N}_{0}$ is the empirical measure associated with $N$ i.i.d. particles sampled from the uniform measure on $\mathbb{S}^{1}$.
Define the radius of the ball in which the linear phase occurs as follows:

$$ $\alpha^{N}:=\frac{(\widehat{\mu^{N}_{0}-\mu_{\infty}})_{k_{max}}}{N^{1/4}\|\mu ^{N}_{0}-\mu_{\infty}\|_{H^{-1}}},$ $$

and consider the corresponding solutions $\mu^{N}_{t}$ and $f^{N}_{t}$ of Eq. (15) with initial conditions $\mu^{N}_{0}$ and $\mu_{\infty}+\alpha^{N}\cos(k_{max}\theta)$, respectively.

###### Remark C.19 .

Since $(\widehat{\mu^{N}_{0}-\mu_{\infty}})_{k_{max}}=O(\|\mu^{N}_{0}-\mu_{\infty}\|_
{H^{-1}})$, $\alpha_{N}\to 0$ as $N\to\infty$.

###### Proposition C.20 .

There exist a constant $\delta>0$ and two sequences of times $T^{N}_{1}$ and $T^{N}_{2}$ (depending on $\mu_{0}^{N}$) such that:

$$ $\|f^{N}_{T^{N}_{2}}-\mu_{\infty}\|_{H^{-2}(\mathbb{S}^{1})}>\delta$ $$

uniformly in $N$, and

$$ $\|\mu^{N}_{T^{N}_{1}+T^{N}_{2}}-f^{N}_{T^{N}_{2}}\|_{H^{-2}(\mathbb{S}^{1})} \to 0,$ $$

as $N\to\infty$ in probability.

###### Remark C.21 .

By Proposition C.15 and Remark C.12 we have both a lower and an upper bound for $\|f^{N}_{T^{N}_{2}}-\mu_{\infty}\|_{H^{-2}(\mathbb{S}^{1})}$, uniform in $N$.

###### Proof.

For clarity, denote $\rho^{N}_{t}:=\mu^{N}_{t}-\mu_{\infty}$.
Applying Proposition C.10 with $\epsilon=N^{-1/4}$ and noting that $N^{1/4}\|\rho_{0}^{N}\|_{H^{-1}}\to 0$ in probability (Lemma E.3), we obtain:

$$ $\mu^{N}_{T_{1}^{N}}=\mu_{\infty}+\alpha^{N}\cos(k_{max}\theta)+R^{N},$ $$

where $T^{N}_{1}:=\frac{1}{\gamma_{max}}\ln\left(\frac{1}{N^{1/4}\|\rho_{0}^{N}\|_{H^
{-1}}}\right)$ and:

$$ $R^{N}=O_{H^{-2}}\left(\|\rho_{0}\|_{H^{-1}}\left(\frac{\epsilon}{\|\rho_{0}\|_ {H^{-1}}}\right)^{\frac{\gamma^{-}}{\gamma_{max}}}+\epsilon^{2}\right).$ $$

Note that, by Lemma E.3, we have:

$$ (30) $\frac{1}{\alpha^{N}}\|R^{N}\|_{H^{-2}}\to 0$ $$

in probability. This implies that the hypothesis of Proposition C.17 are asymptotically satisfied for the initial condition $\mu^{N}_{T_{1}^{N}}$. Therefore, there exists a constant $\delta>0$ such that $f^{N}_{t}$, defined as above, satisfies:

$$ $\|\mu^{N}_{T^{N}_{1}+t}-f^{N}_{t}\|_{H^{-2}}\leq 3\|R^{N}\|_{H^{-2}}e^{\gamma_ {max}t},$ $$

for all $t\in\left[0,T^{N}_{2}\right]$, with $T^{N}_{2}:=\frac{1}{\gamma_{max}}\ln\left(\frac{\delta}{\alpha^{N}}\right)$.

Thus,

$$ $\|\mu^{N}_{T_{1}^{N}+T_{2}^{N}}-f^{N}_{T_{2}^{N}}\|_{H^{-2}}\leq 3\frac{\delta }{\alpha^{N}}\|R^{N}\|_{H^{-2}}\to 0$ $$

in probability, as recalled in Eq. (30).

Finally, observe that $\|f^{N}_{T^{N}_{2}}-\mu_{\infty}\|_{H^{-2}(\mathbb{S}^{1})}>\delta$ is an immediate consequence of Proposition C.15.
∎

###### Remark C.22 .

The convergence also holds in Wasserstein distance, as proved in Lemma E.4.

###### Remark C.19 .

###### Proposition C.20 .

###### Remark C.21 .

###### Proof.

###### Remark C.22 .

### C.6. The clustering phase

In the previous steps, only an approximate understanding of the trajectory of the dominant mode, $f^{\alpha}$, was necessary. Now, however, we focus on a more specific case. Numerical experiments (see Figure 5) conducted on the Transformers model, $W(\theta)=\frac{1}{\beta}e^{\beta\cos(\theta)}$, reveal that after an initial phase where $f^{\alpha}$ surpasses a fixed threshold, i.e., $W_{1}(f^{\alpha}_{t},\mu_{\infty})>\delta$, the system converges to $k_{max}$ equally spaced clusters. The time required for the transition from such threshold to the clustered state is independent of $\alpha$. This assumption is summarized in Assumption 3
.

Although this remains an assumption, we believe it holds true, particularly in the case of Transformers. This belief is strongly supported by the fact that probability measures invariant under $k_{max}$-fold rotations form an invariant manifold for the system’s dynamics, and the limiting measure must be a sum of Dirac deltas (see Lemma E.5).

Figure: Figure 5. Plots showing the evolution of the Wasserstein distance between $\mu_{t}$ and the uniform measure $\mu_{\infty}$ (solid line) and between $\mu_{t}$ and $\delta_{3}:=\sum_{k=0}^{2}\delta_{2\pi k/3}$ (dashed line). Note that the simulations with the initial condition $f^{\alpha}$ for $\alpha=0.01$ and $\alpha=0.001$ almost completely overlap, differing only by a time shift. This observation supports the validity of Assumption 3.
Refer to caption: extracted/5966015/images/beta5/wass.png

Under Assumption 3 we can more precisely characterize the final result of the meta-stable phase:

###### Theorem C.23 .

Let $\{\mu^{N}_{0}\}_{N\in\mathbb{N}}$ denote a sequence of random measures in $\mathcal{P}(\mathbb{S}^{1})$, where $\mu^{N}_{0}$ is the empirical measure associated with $N$ i.i.d. particles sampled from the uniform measure on $\mathbb{S}^{1}$. Under assumptions 1,2 and 3 we can conclude:

$$ $\lim_{N\to\infty}\inf_{t\geq 0}W_{1}(\mu^{N}_{t},\delta^{k_{max}})=0,$ $$

in probability, where $\delta^{k_{max}}:=\frac{1}{k_{max}}\sum_{i}\delta_{\frac{2\pi i}{k_{max}}}$ modulo rotations.

###### Proof.

By Assumption 3, for every $\epsilon>0$ there exists $\bar{t}>0$, independent of $N$, such that:

$$ $W_{1}(f^{\alpha^{N}}_{T_{2}+\bar{t}},\delta^{k_{max}})\leq\frac{\epsilon}{2},$ $$

where $\alpha^{N}$ and $T_{2}$ are defined as in Proposition C.20. Therefore, for all $\epsilon>0$:

$$ $\begin{split}\lim_{N\to\infty}\inf_{t\geq 0}W_{1}(\mu^{N}_{t},\delta^{k_{max}} )&\leq\lim_{N\to\infty}W_{1}(\mu_{T_{1}+T_{2}+\bar{t}},\delta^{k_{max}})\leq\\ &\leq\lim_{N\to\infty}W_{1}(\mu_{T_{1}+T_{2}+\bar{t}},f^{\alpha^{N}}_{T_{2}+ \bar{t}})+W_{1}(f^{\alpha^{N}}_{T_{2}+\bar{t}},\delta^{k_{max}})\leq\\ &\leq\lim_{N\to\infty}e^{L\bar{t}}W_{1}(\mu_{T_{1}+T_{2}},f^{\alpha^{N}}_{T_{2 }})+\frac{\epsilon}{2},\end{split}$ $$

where the classical Dobrushin’s estimate (Theorem A.4) is used in the last line, with a finite constant $L$ depending on the properties of $W$.
By Proposition C.20 and Remark C.22, it follows that $e^{L\bar{t}}W_{1}(\mu_{T_{1}+T_{2}},f^{\alpha^{N}}_{T_{2}})\leq\frac{\epsilon}
{2}$ definitely in $N$.
Hence, the conclusion follows by arbitrariness of $\epsilon$.
∎

###### Theorem C.23 .

###### Proof.

## Appendix D Extension to higher dimensions

In this section we discuss what happens if the system is defined on $\mathbb{S}^{d-1}$ by:

$$ (31) $\begin{cases}\partial_{t}\mu&=-\operatorname{div}(\mu\nabla(W*\mu)),\\ \mu(0)&=\mu_{0},\end{cases}$ $$

where $W:\mathbb{S}^{d-1}\to\mathbb{R}$ and $W*\mu$ is the convolution defined in Eq. (4).

###### Remark D.1 .

The differential operators should be interpreted with respect to the underlying Riemannian manifold structure.

The uniform measure $\mu_{\infty}$ remains an unstable equilibrium of the dynamics. Furthermore, the linearized PDE for an initial perturbation $\mu_{\infty}+\rho_{0}$ is again:

$$ $\begin{cases}\partial_{t}\rho^{L}&=-\mu_{\infty}\Delta(W*\rho^{L}),\\ \rho^{L}_{0}&=\rho_{0},\end{cases}$ $$

with $\Delta$ the Laplace-Beltrami operator on the sphere $\mathbb{S}^{d-1}$.

As in the $d=2$ case, we can study the linear operator $\mathcal{L}_{\mu_{\infty}}(f):=-\mu_{\infty}\Delta(W*f)$. Letting $f_{n,j}$ represent the spherical harmonics coefficients, we obtain:

$$ $(\mathcal{L}_{\mu_{\infty}}(f))_{n,j}=\mu_{\infty}n(n+d-2)\hat{W}_{n}f_{n,j}.$ $$

where $\hat{W}_{n}$ are the Gegenbauer coefficients. This result follows from the fact that spherical harmonics are eigenfunctions of the Laplace-Beltrami operator, combined with the Funk-Hecke theorem for convolutions on spheres (see Section C.1.2). This provides the usual spectral bounds with a similar $\gamma_{max}$ for the linear operator, and an explicit solution $\rho^{L}$:

$$ $\rho^{L}_{t}=\sum_{n=0}^{\infty}\sum_{j=0}^{Z_{n}^{d}}(\rho_{0})_{n,j}e^{ \gamma_{n}t}Y_{n,j},$ $$

where $Z_{n}^{d}$ denotes the number of spherical harmonics $Y_{n,j}$ on $\mathbb{S}^{d-1}$ of degree $n$.

It is important to note that we now have a superposition of functions of the same degree $n_{max}$, all growing at the same rate. In particular, the steps outlined in the previous sections can be repeated, but with initial condition for $f^{N}$ given by:

$$ $f^{N}_{0}=\mu_{\infty}+\sum_{j=0}^{Z_{n_{max}}^{d}}\alpha^{N}_{j}Y_{n_{max},j}.$ $$

Additionally, the calculations have to be performed in the space $H^{s}$ with $s<-d/2$, rather than in $H^{-1}$, the proofs remain analogous.

In $d=2$, the emerging symmetry was characterized by invariance under rotations by angles of $\frac{2\pi}{k_{max}}$, which was relatively straightforward to describe. However, as we move to higher dimensions, the nature of the symmetry becomes more complex and challenging to express.

Consider the subspace:

$$ $\mathcal{H}_{k}:=\{\mu\in H^{s}:\ \langle\mu,Y_{l,j}\rangle=0\quad\forall l \text{ not divisible by }k\}.$ $$

This set is invariant for the dynamics of Eq. (31), indeed, since $\mathcal{H}_{k}$ is a vector subspace of $H^{s}$, it suffices to show that $\partial_{t}\mu\in\mathcal{H}_{k}$ for every $\mu\in\mathcal{H}_{k}$:

$$ $\begin{split}\langle\partial_{t}\mu,Y_{l,m}\rangle&=-\langle\operatorname{div} (\mu\nabla(W*\mu)),Y_{l,m}\rangle=\\ &=\langle\mu\nabla(W*\mu),\nabla Y_{l,m}\rangle=\\ &=\langle\left(\sum_{n,j}\mu_{n,j}Y_{n,j}\right)\left(\sum_{n^{\prime},j^{ \prime}}W_{n^{\prime}}\mu_{n^{\prime},j^{\prime}}\nabla Y_{n^{\prime},j^{ \prime}}\right),\nabla Y_{l,m}\rangle=\\ &=\sum_{n^{\prime},n,j^{\prime},j}W_{n^{\prime}}\mu_{n^{\prime},j^{\prime}}\mu _{n,j}\langle Y_{n,j}\nabla Y_{n^{\prime},j^{\prime}},\nabla Y_{l,m}\rangle=\\ &=\sum_{n,j^{\prime},j}W_{l-n}\mu_{l-n,j^{\prime}}\mu_{n,j}\langle Y_{n,j} \nabla Y_{l-n,j^{\prime}},\nabla Y_{l,m}\rangle,\end{split}$ $$

where we used Funk-Hecke theorem and a triple product integral identity for vector spherical harmonics. If this derivative is non-zero, then at least one of the terms in the sum must be non-zero. This implies $l-n=0\ mod\ k$ and $n=0\ mod\ k$. Thus, $l$ must be a multiple of $k$.

In conclusion:

$$ $\lim_{N\to\infty}\inf_{t\geq 0}W_{1}(\mu^{N}_{t},\mathcal{H}_{n_{max}}^{\delta }\cap\mathcal{P}(\mathbb{S}^{d-1}))\to 0.$ $$

in probability.

Figure: Figure 6. Example of a curve in $\mathcal{H}_{3}$.
Refer to caption: extracted/5966015/images/newplot.png

###### Remark D.1 .

## Appendix E Auxiliary results

###### Lemma E.1 .

Let $f:[0,\infty)\to\mathbb{R}$ satisfy $f^{\prime}(t)\leq af(t)+ce^{bt}$ for all $t\in[0,\infty)$, where $0<a<b$ and $c>0$. Then:

$$ $f(t)\leq f(0)e^{at}+\frac{c}{b-a}e^{bt}.$ $$

###### Proof.

This result follows directly by Gronwall’s inequality. Specifically:

$$ $\begin{split}f(t)&\leq f(0)+\frac{c}{b}e^{bt}+\int_{0}^{t}\left(f(0)+\frac{c}{ b}e^{bs}\right)ae^{a(t-s)}ds=\\ &=f(0)+\frac{c}{b}e^{bt}+f(0)ae^{at}\int_{0}^{t}e^{-as}ds+\frac{c}{b}ae^{at} \int_{0}^{t}e^{(b-a)s}ds=\\ &=f(0)+\frac{c}{b}e^{bt}+f(0)e^{at}(1-e^{-at})+\frac{c}{b}\frac{a}{b-a}e^{at}( e^{(b-a)t}-1)\leq\\ &\leq f(0)e^{at}+\frac{c}{b-a}e^{bt}.\end{split}$ $$

∎

###### Lemma E.2 .

Let $k\in\mathbb{Z}$. Under Assumptions 1 and 2 the linear operator $\mathcal{L}_{\mu_{\infty}}:H^{k}(\mathbb{S}^{1})\to H^{k}(\mathbb{S}^{1})$ defined as $\mathcal{L}_{\mu_{\infty}}(f):=-\mu_{\infty}\Delta W*f$ satisfies:

$$ $\|\mathcal{L}_{\mu_{\infty}}f\|_{H^{k}}\leq\frac{1}{2\pi}\gamma_{max}\|f\|_{H^ {k}}.$ $$

###### Proof.

Using the Fourier definition of the spaces $H^{k}(\mathbb{S}^{1})$:

$$ $\displaystyle\|\mathcal{L}_{\mu_{\infty}}f\|_{H^{k}}^{2}$ $\displaystyle=\sum_{n\in\mathbb{Z}}n^{2k}|\widehat{(-\mu_{\infty}\Delta W*f)}_ {n}|^{2}=$ $\displaystyle=\sum_{n\in\mathbb{Z}}n^{2k}\left(\mu_{\infty}\gamma_{n}|(\hat{f} )_{n}|\right)^{2}\leq\mu_{\infty}^{2}\gamma_{max}^{2}\|f\|_{H^{k}}^{2}.$ $$

∎

###### Lemma E.3 .

Let $\{\mu^{N}\}$ be a sequence of random probabilities on $\mathbb{S}^{1}$ given by the empirical measures of $N$ i.i.d. samples from the uniform measure. Then $\rho^{N}:=\mu^{N}-\mu_{\infty}$ satisfies:

- •
$N^{1/4}\|\rho_{0}^{N}\|_{H^{-1}}\to 0$,
- •
$\frac{N^{1/4}\|\rho^{N}_{0}\|_{H^{-1}}}{(\hat{\rho}^{N}_{0})_{k_{max}}}\left(
\|\rho^{N}_{0}\|_{H^{-1}}\left(\frac{1}{N^{1/4}\|\rho^{N}_{0}\|_{H^{-1}}}
\right)^{\frac{\gamma^{-}}{\gamma_{max}}}+(N^{-1/4})^{2}\right)\to 0$,

with both of the limits in probability.

###### Proof.

First of all notice that, fixing an orthonormal basis $\{e_{k}\}_{k}$ of $L^{2}(\mathbb{S}^{1})$, $\forall\beta>0$ and $s>\frac{1}{2}$:

$$ $\begin{split}\mathbb{E}[(N^{\frac{1}{2}-\beta}\|\rho_{0}^{N}\|_{H^{-s}})^{2}]= &N^{-2\beta}\mathbb{E}\left[\sum_{k}Nk^{-2s}\langle\rho_{0}^{N},e_{k}\rangle^{ 2}\right]\leq\\ &\leq N^{-2\beta}\sum_{k}Nk^{-2s}\mathbb{E}\left[\left(\frac{1}{N}\sum_{i=1}^{ N}e_{k}(x_{i})\right)^{2}\right]\leq\\ &\leq N^{-2\beta}\sum_{k}k^{-2s}\to 0,\end{split}$ $$

where we used Beppo Levi and the indipendence of samples. In particular by Chebychev’s lemma this implies $N^{\frac{1}{2}-\beta}\|\rho_{0}^{N}\|_{H^{-s}}\to 0$ in probability. Taking $\beta=1/4$ and $s=1$ we get the first limit.

Before proving the second limit, observe that

$$ $\begin{split}\sqrt{N}(\hat{\rho^{N}})_{k}=\sqrt{N}\langle\rho^{N},e_{k}\rangle =\frac{1}{\sqrt{N}}\left(\sum_{j=1}^{N}e_{k}(X_{j})-\int e_{k}\right)\to \mathcal{N}(0,1)\end{split}$ $$

in distribution by the central limit theorem.

Now:

$$ $\begin{split}&\frac{\|\rho_{0}\|_{H^{-1}}}{(\hat{\rho}_{0})_{k_{max}}}\left( \frac{N^{-1/4}}{\|\rho_{0}\|_{H^{-1}}}\right)^{\frac{\gamma^{-}}{\gamma_{max}} -1}+N^{-1/4}\frac{\|\rho_{0}\|_{H^{-1}}}{(\hat{\rho_{0}})_{k_{max}}}=\\ &=\frac{1}{\sqrt{N}(\hat{\rho}_{0})_{k_{max}}}N^{1/2}\|\rho_{0}\|_{H^{-1}}^{2- \frac{\gamma^{-}}{\gamma_{max}}}N^{\frac{1}{4}\left(1-\frac{\gamma^{-}}{\gamma _{max}}\right)}+\frac{N^{1/4}\|\rho_{0}\|_{H^{-1}}}{\sqrt{N}(\hat{\rho_{0}})_{ k_{max}}}=\\ &=\frac{1}{\sqrt{N}(\hat{\rho}_{0})_{k_{max}}}\left(N^{\frac{1}{2}+\frac{1}{4} \left(1-\frac{\gamma^{-}}{\gamma_{max}}\right)}\|\rho_{0}\|_{H^{-1}}^{2-\frac{ \gamma^{-}}{\gamma_{max}}}+N^{1/4}\|\rho_{0}\|_{H^{-1}}\right).\end{split}$ $$

The terms between the parenthesis converge to zero in probability (indeed $\frac{1}{2}+\frac{1}{4}\left(1-\frac{\gamma^{-}}{\gamma_{max}}\right)<\frac{1}
{2}\left(2-\frac{\gamma^{-}}{\gamma_{max}}\right)$ and we can use the argument above). The term outside the parenthesis instead converges in distribution to $1/Z$ with $Z$ standard normal (because of the continuous mapping theorem, since $1/x$ is almost-surely continuous). Hence, by Slutsky’s lemma, we get convergence to 0 0 in distribution and then in probability.
∎

###### Lemma E.4 .

Given two sequences of probability measures $\mu_{n},\nu_{n}$ in $H^{-k}(X)$, with $X$ compact space, such that $\|\mu_{n}-\nu_{n}\|_{H^{-k}(X)}\to 0$, then also $W_{1}(\mu_{n},\nu_{n})\to 0$ is true.

###### Proof.

Notice that
$\|\mu_{n}-\nu_{n}\|_{H^{-k}}\to 0$ implies $\langle\mu_{n}-\nu_{n},f\rangle\to 0$ for every $f\in H^{k}(X)$. Since $H^{k}(X)\cap C_{b}(X)$ is dense in $C_{b}(X)$ (it contains the smooth functions) and since $\mu_{n}$ and $\nu_{n}$ are both probability measures, then $\mu_{n}-\nu_{n}\rightharpoonup 0$ in weak sense.

Let us fix a subsequence that satisfies $\lim_{k}W_{1}(\mu_{n_{k}},\nu_{n_{k}})=\limsup_{n}W_{1}(\mu_{n},\nu_{n})$. For each $k$, consider $\phi_{n_{k}}\in Lip_{1}(X)$ such that $\int\phi_{n_{k}}(\mu_{n_{k}}-\nu_{n_{k}})=W_{1}(\mu_{n_{k}},\nu_{n_{k}})$. Without loss of generality, by adding a constant (which does not affect the integral), we can assume that the functions $\phi_{n_{k}}$ vanish at the same point, hence they are uniformly bounded and equicontinuous. By Ascoli-Arzelà theorem we can extract a subsequence converging to some $\phi\in Lip_{1}(X)$. Hence, renaming the subsequence:

$$ $W_{1}(\mu_{n_{k}},\nu_{n_{k}})=\int\phi_{n_{k}}d(\mu_{n_{k}}-\nu_{n_{k}})\leq 2 \|\phi_{n_{k}}-\phi\|_{\infty}+\int\phi d(\mu_{n_{k}}-\nu_{n_{k}})\to 0.$ $$

This concludes the proof.
∎

###### Lemma E.5 .

Let $W:[-1,1]\to\mathbb{R}$ be an analytic function and suppose that $\hat{W}_{n}\neq 0$ for every $n$. Then the equilibria of Eq. (31) can only be the uniform measure or a finite union of submanifolds of dimension at most $d-2$.

###### Proof.

Consider $\mu_{eq}$ to be an equilibrium of Eq. (31). Then, for every $f\in\mathcal{C}^{\infty}(\mathbb{S}^{d-1})$, it must hold that:

$$ $0=\langle f,\operatorname{div}(\mu_{eq}\nabla(W*\mu_{eq})\rangle.$ $$

In particular, substituting $f=\nabla(W*\mu_{eq})$, we obtain:

$$ $\int_{\mathbb{S}^{d-1}}\|\nabla(W*\mu_{eq})\|^{2}d\mu_{eq}=0.$ $$

This implies $A:=\{x\in\mathbb{S}^{d-1}|\nabla(W*\mu_{eq})(x)=0\}$ is such that $\mu_{eq}(A^{C})=0$, hence $supp(\mu_{eq})=A$. Note that $x\to\|\nabla(W*\mu_{eq})(x)\|^{2}$ is still an analytic function, hence $A$ must be either $\mathbb{S}^{d-1}$ or a finite union of submanifolds of dimension at most $d-2$ (by Lojasiewicz’s structure theorem, []).

To conclude the proof, we just need to study the case $A=\mathbb{S}^{d-1}$. The definition of $A$ implies that $W*\mu_{eq}$ must be constant on $\mathbb{S}^{d-1}$. By the Funk-Hecke theorem, $\forall n>0,\forall j$:

$$ $0=(W*\mu_{eq})_{n,j}=W_{n}\cdot(\mu_{eq})_{n,j},$ $$

and thanks to the hypothesis $W_{n}\neq 0$, we obtain $(\mu_{eq})_{n,j}=0$ $\forall n\neq 0$ and $\forall j$. Thus, $\mu_{eq}$ is the uniform measure.
∎

###### Lemma E.1 .

###### Proof.

###### Lemma E.2 .

###### Proof.

###### Lemma E.3 .

###### Proof.

###### Lemma E.4 .

###### Proof.

###### Lemma E.5 .

###### Proof.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: - In the integral representation of (USA-MF) (lines 148-149), the coefficient $1/N$ seems redundant since $\mu$ is an empirical distribution which contains the normalization term. Also, I’m not sure if (SA-MF) representation is also appropriate because of the same reason.

- Taking sufficiently large $N$, $T_1$ becomes negative. Does this mean the non-existence of linear phase?

- The convergence rate of W1 distance in Theorem 4.3 is not given in the main text. Can you clarify it?
soundness: 3
strengths: The authors provide a comprehensive analysis of metastability that precisely describes the evolution of tokens. They successfully identify the existence of linear, quasi-linear, and clustering phases, contributing valuable insights into the behavior of simplified transformer models.
summary: This paper investigates the evolution of tokens in simplified transformer models using a mean-field formulation. By analyzing the long-term behavior of interacting particle systems, the authors prove results on metastable clustering, demonstrating that the model remains close to a metastable manifold of solutions. The study identifies the existence of linear, quasi-linear, and clustering phases in the token evolution.
weaknesses: - The model considers all attention parameters $Q, K, V$ as fixed identity matrices. This significant simplification may limit the applicability of the theoretical results, as it does not capture the complexity of learned attention mechanisms.

- Some notations in the paper are not properly defined, which can hinder readers' understanding of the results. For instance, the notation $\hat{\rho}\_0$ related to Theorems 4.2 and 4.3 is not introduced. Additionally, $\mu\_{cluster}$ in Equation (8) seems to be defined on a one-dimensional space since $2\pi j / k_{max}$ is a scalar, making it unclear how to measure the W1 distance from $f_*(t)$. Providing clearer definitions and explanations would enhance the paper's readability.

- For sufficiently large $N$, the parameter $T_1$ becomes negative. This could restrict the applicability of the theorem to certain token counts. Clarification on how this affects the results and whether it imposes practical limitations would be beneficial.

- Minor: At the first glance, I thought the propagation of chaos result (Theorem 3.1) is also one of the main contributions but is actually weak due to the exponential growth of the bound. Now I see that this result serves to emphasize the importance of the metastability analysis. Clarifying this role could prevent potential confusion for readers.

---

confidence: 2
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Do slightly more realistic transformers behave in a way consistent with the predictions of this theory? Relatedly, if the theory assumes Q = K = V = Id, what is the right point of comparison for a language model?
2. How does the theory change if certain assumptions (e.g., Q = K = V = Id, finite $N$) are modified or generalized?
soundness: 3
strengths: The authors present a detailed mathematical analysis of a simplified model of transformers, and rigorously prove a variety of results. They are good about presenting their results at a high level in the main text, and leaving the fine technical details in SI. They closely connect their approach to a variety of recent work, principally the aforementioned work by Geshkovski et al.
summary: Transformers are performant but not theoretically well understood. In particular, it is not clear how to think about the dynamics associated with a large stack of transformer layers. Geshkovski et al. (2023) made a formal analogy between these dynamics and the dynamics of a mean-field interacting particle system, and were able to characterize various aspects of these dynamics, at least in a simplified theoretical setting. The authors of this work build upon this earlier work and characterize not just the long-time behavior, but associated metastable dynamics, which may be important in practice.
weaknesses: The authors present their results clearly and do not appear to overstate them. My major concern is mostly that the authors' results concern kind of a toy setting somewhat far from the kinds of transformers people use in practice. One assumes Q = K = V = Id (line 123), one takes a limit where the number of layers go to infinity, the number of tokens $N$ is assumed to go to infinity, etc. This makes sense given that theoretical analysis of any kind is quite difficult, but makes it unclear to what extent the authors' results shed light on transformers 'in the wild'. It would be extremely helpful if the authors could provide some numerical experiments for slightly more realistic transformer models that show key predictions from their theory hold, at least approximately. 

Also, the authors could provide additional commentary on what happens if one tries to generalize their results. What is expected if Q, K, and V are not all the identity? How does one expect finite $N$ corrections to behave, and what do they change about dynamics?

---

confidence: 3
contribution: 4
initial_rating: 10
presentation: 4
questions: I only have a minor question. The authors make a key Assumption 3 regarding convergence to the clustering phase. While they discuss this assumption based on (Markdahl et al., 2017), relying on periodicity, I am curious whether it would still hold in the generic case--specifically, in the case where the initial condition in equation (6) contains multiple modes. Could the authors provide some intuition and discuss potential implications of their result in this case?
soundness: 4
strengths: 1. I appreciate the authors provide rigorous proofs that illustrate the convergence of the tokens to structured meta-stable manifolds, and identifies the influence of temperature, which is a key factor in understanding the mechanism of transformers. In particular, understanding the mean-field transformer model is beneficial for tasks involving long-context dependencies. 

2. Numerical experiments are presented to demonstrate that the theoretical predictions of the clustering dynamics align well with observed practical results. It is nice to see the number of clusters is influenced by the temperature, which I found surprising.

3. Overall, the paper is well-written, and the results are sound. The decomposition of the transformer dynamics into linear, quasi-linear, and collapsing phases allows for a systematic analysis of the clustering phenomena. I'm also excited to see new PDE techniques (the Grenier's scheme) applied to the analysis of transformer dynamics. The findings are both highly relevant to the field and of significant interest to the community.
summary: This paper presents a rigorous investigation of meta-stable clustering phenomena of mean-field Transformer models. By modeling transformer layers as continuous-time flows and employing a mean-field PDE framework, the authors present a very interesting approach to understanding intermediate clustering phases through linearization and higher-order approximation. Numerical experiments support the theoretical findings. This work opens a venue for understanding the meta-stable dynamics of Transformer models.
weaknesses: 1. (Minor) In the contribution bullet point 3, the authors state that "the periodicity developed in the first phase is maintained over exponentially long time intervals." The authors may want to clarify in what sense the time interval is "exponential long" and where in the paper this claim is made.

2. (Minor) Page 10, Line 504, Should "Figure 4" be "Figure 3"?

3. (Minor) Page 5, Line 233, should the coefficient $\hat{W}_k$ be $\tfrac{1}{\beta}I_k(\beta)$?

---

confidence: 1
contribution: 2
initial_rating: 5
presentation: 3
questions: - Why does the  existence of a "meta-stable phase" imply that then the network learns a richer and more complex representation of the data? What is meant by richer and more complex?

- Are there any clear takeaways from this paper that a practitioner can use to build intuition and how and why a transformer works?
soundness: 3
strengths: - The paper appears to have a high degree of rigor.
- The goal of developing a rigorous theory of how the transformer works is important.
summary: The authors build on existing work which models the evolution of tokens within a Transformer model. The authors prove the existent of a meta-stable phrase in learning.

Note: I fear I am not the right audience for this paper. I am not at all familiar with the literature, or its relevance in the ML community. I additionally understood little of the content of this paper.
weaknesses: - It is not clear (to me) what the relevance of the conclusions made by the paper is.

---

confidence: 2
contribution: 2
initial_rating: 6
presentation: 4
questions: 1. What is the relationship between this paper and the recent Geshkovski et al. paper "Dynamic metastability in the self-attention model" [1]?
2. Are there simple ways to extend this analysis as $N \to \infty$ in the discrete case? Is there a qualitative difference in this setting?
3. In practice, should we think that transformers operate in phase 1, 2, or 3?
4. How do we know that neglecting the remainder $R$ from equation 5 to 6 is acceptable?
5. What is the interpretation of the $\alpha \to 0$ limit (i.e. should it be interpreted as $N\to\infty$ again)?

**References:**

1. Geshkovski, Borjan, et al. "Dynamic metastability in the self-attention model." arXiv preprint arXiv:2410.06833 (2024).
soundness: 4
strengths: The strengths of this paper are its rigorous analysis of the problem, where they first extract and then rigorously prove that certain clustering dynamics arise directly from attention. This work makes it very clear what structures arise and how they evolve. This is a strong extension of prior work, which relies on less intuitive arguments, and so this paper finds a way to explain a complicated phenomenon more clearly than prior work.
summary: The authors consider the evolution of the token distribution in a limit of an infinitely deep transformer which yields a differential equation for the evolution of the tokens. This equation is further simplified by the assumption that the attention parameters are constant over layers, and all equal to the identity, and that there are no MLP subunits. An initial result is that they show that the limit of infinite particles commutes with the time evolution in the sense that there is a PDE that describes the evolution of an empirical distribution with $N$ large enough. From this starting point, they describe a departure from these solutions (initialized so that the limiting measure is the uniform measure)

1) an initial phase where a periodic fluctuation of a certain frequency, $k$, grows 
2) a quasi-linear phase where the fluctuations are well-described by the behavior of this mode around the uniform background
3) and finally a collapse phase where the evolution reaches close to a finite set of delta measures.
weaknesses: The main weakness is the lack of connection to a practical setting. The problem considered is highly simplified, and there is little discussion concerning even qualitative arguments explaining what differs in the setting with the greatest interest -- deep transformers with MLP blocks and non-identity weight matrices. It is difficult to understand how to take these results and understand what they say about that setting. 

For example:
1. Prior work [1] suggests that the structure of the value, key, and query matrices is important and derives results in various (though simplified) cases
2. The work cited as the foundation for this work [2] discusses the BBGKY hierarchy -- a way to understand the joint law of all the particles by breaking them down in terms of the $n^{\text{th}}$ degree marginals.
3. Other work [3] considers the behavior, including the MLP, and finds (though non-rigorously) that the MLP significantly affects dynamics.

It is of significant interest if connections to ideas like these could be explained in the paper. Of course, the limited scope of one paper may hinder detailed analysis in all possible settings, but it would make it clear how to interpret the results in context.

If the authors could discuss this issue satisfactorily, I would be happy to increase my score for this paper.


**References:**

1) Geshkovski, Borjan, et al. "The emergence of clusters in self-attention dynamics." Advances in Neural Information Processing Systems 36 (2024).
2) Geshkovski, Borjan, et al. "A mathematical perspective on transformers." arXiv preprint arXiv:2312.10794 (2023).
3) Cowsik, Aditya, et al. "Geometric Dynamics of Signal Propagation Predict Trainability of Transformers." arXiv preprint arXiv:2403.02579 (2024).

Meta-review: The authors studied a mean-field limit for a simplified model of transformers, where the number of tokens and the depth of the network approaches infinity. While the framework was first introduced in Geshkovski et al. (2023), the authors contributed several technical results for the model. This includes a propagation of chaos result justifying the mean-field limit, and characterizing the different phases of the token dynamics. 

As many reviewers have mentioned, the main weakness of this work is the simplified setting, and it is questionable whether this analysis will eventually yield useful insights towards a practical transformer. However, as most of the reviewers also recognized, this paper has made clear and precise mathematical contributions towards understanding the toy model, which is already quite technically challenging in itself. I would interpret studying the toy model as a necessary step towards understanding a practical transformer architecture, and hence the contributions here are welcomed. 

Given the high average rating, and the clear contributions, I would recommend accept.

Decision: Accept (Oral)