Introduction
Transformer-based Vaswani et al. [46 ] large language models (LLMs) have achieved remarkable success across various tasks, including natural language processing [4 , 44 b] , image and video generation [28 ] , and multimodal learning [1 , 36 ] . Notably, these models have also achieved state-of-the-art performance on complex reasoning tasks [22 , 57 , 9 , 56 ] . A key factor driving this progress is Chain-of-Thought (CoT), which enables LLMs to generate intermediate reasoning steps autoregressively rather than producing only a final answer. This process enhances the models’ ability to solve complex problems. However, the mechanisms underlying CoT reasoning remain poorly understood, posing fundamental theoretical challenges.
Theoretical studies on transformers with CoT have recently progressed along three main directions: expressive power, statistical properties, and training theory. On the expressivity side, prior work shows that intermediate reasoning steps can expand the effective computational power. of transformers, enabling shallow architectures to solve problems beyond direct-answer prediction and establishing reasoning length as a key computational resource [12 , 29 , 26 , 2 ] . On the statistical side, recent analyses formalize CoT as a structured decomposition of complex inference into simpler intermediate subproblems, leading to improvements in sample efficiency, robustness, and generalization [33 ] (Hu et al. 2024; Li et al. 2025). Complementing these results, a growing line of training-theoretic work characterizes how transformers learn multi-step reasoning capabilities under gradient-based optimization, focusing on tasks such as in-context linear regression, symbolic path finding, and synthetic state tracking [16 , 49 , 20 ] .
Among these directions, the training-theoretic perspective is most closely aligned with practical LLM development, as it aims to explain how transformers acquire CoT-style multi-step reasoning capabilities through gradient-based training. Recent work has made encouraging progress in this direction by analyzing several structured settings, but current theoretical understanding remains limited. Following this perspective, we investigate the in-context K-nearest-neighbor (K-NN) problem. Prior work has shown that one-layer transformers can be trained to perform in-context 1-NN without CoT (Li et al., 2024a). However, this result does not directly extend to K-NN with K > 1 K > 1 K > 1 . We prove a proposition showing that direct inference already fails for odd K > 1 K > 1 K > 1 , which motivates our study of the CoT setting. We then show that a one-layer transformer admits an explicit construction for solving the K-NN problem via CoT by giving both an asymptotic expressivity guarantee and a finite-margin correctness statement. We further show that gradient descent can recover this construction, and that the resulting trained model applies to a broader test class than the one specified by the training distributional assumptions.
Contributions. We summarize the main contributions of this work as follows.
We prove that a one-layer transformer without CoT cannot perform K-NN via direct inference for odd K > 1 K > 1 K > 1 (Proposition 3.2 ). In contrast, a one-layer transformer admits an explicit construction for solving the K-NN problem via CoT (Theorem 4.1 and Proposition 4.2). Together, these results provide a concrete example, in a controlled theoretical setting, of how CoT can expand the computational capabilities of transformers.
We further provide a convergence analysis of the population loss for a one-layer transformer trained by gradient descent (Theorem 5.2 ), showing that gradient descent recovers the construction in Theorem 4.1 . This extends the in-context 1-NN result of Li et al. (2024a) to K-NN prediction with CoT. Combining the training and construction analyses further shows that the resulting trained model applies beyond the distributional assumptions used in the training analysis.
Our work contributes to a more comprehensive theoretical understanding of how Transformers with CoT can perform complex tasks. Prior work has shown that CoT can implement gradient descent for in-context linear regression [16 ] , repeatedly apply transition rules to update a state [20 ] , and autoregressively trace paths between nodes in trees [49 ] . In contrast, our work theoretically identifies and formalizes a distinct CoT mechanism based on iterative token selection and masking, thereby broadening the current theoretical understanding of CoT.
mulated as a sequential procedure based on iterative token selection and masking, thereby enabling CoT-based prediction, as formalized in Lemma 4.3 . We also develop technical tools for analyzing softmax-attention training, including contradiction and compactness arguments that establish coefficient divergence (Appendix § 12 .§ 3 ) and drift and crossing arguments that characterize the precise limiting ratios among the coefficients (Appendix § 12 .§ 6 ). Together, these tools reveal how a model can simultaneously learn token selection and masking.
Notation. For a scalar x x x , let sign ( x ) = 1 \operatorname{sign}(x)=1 sign ( x ) = 1 if x > 0 x>0 x > 0 , 0 0 0 if x = 0 x=0 x = 0 , and − 1 -1 − 1 otherwise. For a vector v ∈ R d \mathbf{v}\in\mathbb{R}^{d} v ∈ R d and a matrix A ∈ R m × n \mathbf{A}\in\mathbb{R}^{m\times n} A ∈ R m × n , let ∥ v ∥ \lVert\mathbf{v}\rVert ∥ v ∥ denote the ℓ 2 \ell_{2} ℓ 2 -norm of v \mathbf{v} v and ∥ A ∥ \lVert\mathbf{A}\rVert ∥ A ∥ the spectral norm of A \mathbf{A} A . We write A : , j ∈ R m \mathbf{A}_{:,j}\in\mathbb{R}^{m} A : , j ∈ R m and A i , : ∈ R n \mathbf{A}_{i,:}\in\mathbb{R}^{n} A i , : ∈ R n for the j j j -th column and i i i -th row of A \mathbf{A} A , respectively. The symbols 0 n \mathbf{0}_{n} 0 n and 0 m × n \mathbf{0}_{m\times n} 0 m × n denote the zero vector in R n \mathbb{R}^{n} R n and the zero matrix in R m × n \mathbb{R}^{m\times n} R m × n , respectively. We denote by I d \mathbf{I}_{d} I d the d d d -dimensional identity matrix, and by I \mathbf{I} I the identity matrix when the dimension is clear. For an integer n n n , we define [ n ] = { 1 , 2 , … , n } [n]=\{1,2,\ldots,n\} [ n ] = { 1 , 2 , … , n } . For two sequences { a n } \{a_{n}\} { a n } and { b n } \{b_{n}\} { b n } , we denote a n = O ( b n ) a_{n}=O(b_{n}) a n = O ( b n ) if there exists a constant C > 0 C>0 C > 0 such that ∣ a n ∣ ≤ C ∣ b n ∣ |a_{n}|\leq C|b_{n}| ∣ a n ∣ ≤ C ∣ b n ∣ for all large enough n n n . We denote a n = Ω ( b n ) a_{n}=\Omega(b_{n}) a n = Ω ( b n ) if b n = O ( a n ) b_{n}=O(a_{n}) b n = O ( a n ) . We say a n = Θ ( b n ) a_{n}=\Theta(b_{n}) a n = Θ ( b n ) if both a n = O ( b n ) a_{n}=O(b_{n}) a n = O ( b n ) and a n = Ω ( b n ) a_{n}=\Omega(b_{n}) a n = Ω ( b n ) hold.
Related Work
In-context learning. In-context learning describes the ability of transformers to perform previously unseen tasks without updating their model parameters. Bai et al. [3 ] demonstrated the in-context learning capacities of transformers by constructing multi-head ReLU transformers capable of performing a variety of learning methods, including ridge regression, lasso regression, generalized linear models, and learning with shallow neural networks. Zhang et al. [54 ] studied the gradient-flow dynamics of a linear self-attention model. Huang et al. [18 ] analyzed linear prediction tasks using a softmax-attention layer trained via gradient descent. Li et al. (2024a) investigated how transformers perform in-context learning when solving one-nearest-neighbor selection problems. Zhang et al. [55 ] showed that the MLP component of a transformer block can learn to simulate the initialization step of in-context gradient descent. Chen et al. [7 ] investigated the gradient-flow dynamics of training multi-head softmax attention and showed that all heads exhibit distinct patterns and interact jointly to solve in-context linear regression. Zhang and Cao [50 ] showed that softmax transformers can perform in-context logistic regression via normalized gradient descent by recurrently applying a trained self-attention layer.
Transformers as more general algorithm learners. Beyond standard in-context learning settings, a growing body of work studies how transformers learn more general algorithmic procedures. A line of work studies transformers on Markovian or Markov-like sequence models. Edelman et al. [11 ] empirically demonstrated that transformers trained on samples generated by a Markov chain in a bigram setting can develop statistical induction heads. Nichani et al. [30 ] proved that gradient descent can train transformers to learn a generalized induction head on latent causal structures. Chen et al. [8 ] analyzed a modified two-layer transformer on n n n -gram Markov data. Shi and Cao [35 ] showed that gradient-trained softmax attention acts as a token selector for random-walk prediction. A complementary body of work examines optimization in more specialized transformer architectures and training regimes. This includes analyses of vision transformers and their sample complexity (Jelassi et al. [21 ] ), the role of adaptive optimizers in transformer training (Pan and Li [31 ] ; Zhang et al. [53 ] ), the mechanisms through which transformers acquire semantic or topical structure (Li et al. (2023)), and the optimization of looped transformer architectures, where Wu et al. (2026) proved that gradient descent on looped linear transformers with layer normalization converges to solutions implementing the power method for principal-component prediction. Other studies investigate the joint training dynamics of attention, decoder, and MLP components [41 , 42 ] , characterize the implicit bias of softmax attention by linking its optimization dynamics to max-margin or SVM-like solutions (Tarzanagh et al., 2023a,b; Huang et al., 2025b). Finally, several recent results demonstrate the capability of trained softmax transformers to perform token selection and identify task-relevant structure: Wang et al. [47 ] proved that a one-layer transformer trained by gradient descent can learn sparse token selection, while Zhang et al. [51 , 52 ] established optimal variable selection in group-sparse classification and teacher-student learning setups.
Understanding Chain-of-Thought Reasoning. Recently, several studies have sought to understand CoT from both experimental and theoretical perspectives. Sprague et al. [37 ] conducted a large-scale meta-analysis showing that CoT is most effective on mathematical, symbolic, and algorithmic tasks, whereas Stechly et al. [38 ] showed, in planning domains, that the gains from CoT rely heavily on problem-specific demonstrations, casting doubt on whether CoT yields robust procedural generalization. Liu et al. [27 ] identified task regimes in which CoT can systematically degrade performance. Chen et al. [6 ] proposed a reasoning-boundary framework to quantify CoT capability and analyze how different CoT strategies affect reasoning performance. Ton et al. [43 ] developed an information-theoretic framework for evaluating the contribution of individual reasoning steps and diagnosing CoT failure modes without requiring annotated intermediate traces. Hou et al. [14 ] ; Cabannes et al. [5 ] investigated CoT through the lens of mechanistic interpretability. On the theoretical side, most existing studies have examined how CoT enhances transformer expressiveness [12 , 29 , 2 ] (Li et al. 2024b) and have explored CoT through its statistical properties [33 ] (Hu et al. 2024; Li et al. 2025). Other works have characterized the intrinsic limits of CoT-based reasoning, showing that transformers face inherent barriers to compositional computation and that some problems provably require long CoT traces [32 ] . Complementing these results, Huang et al. [16 ] ; Yang et al. [49 ] ; Huang et al. [20 ] characterized how transformers learn multi-step reasoning capabilities under gradient-based optimization, focusing on tasks such as in-context linear regression, symbolic path finding, and synthetic state tracking.
Preliminaries
In this section, we first define the K-NN problem and introduce the transformer architecture studied in this paper. Based on these definitions, we then show that direct inference by a one-layer transformer already fails on a well-separated class of inputs for odd K > 1 K > 1 K > 1 .
K-Nearest Neighbor Problem
Given a dataset D = { ( x i , y i ) } i = 1 N \mathcal{D} = \{(\mathbf{x}_i,y_i)\}_{i=1}^{N} D = {( x i , y i ) } i = 1 N , where x i ∈ R d \mathbf{x}_i \in\mathbb{R}^{d} x i ∈ R d is the input feature vector and y i ∈ Y y_i \in\mathcal{Y} y i ∈ Y is the corresponding label, and a query instance x q ∈ R d \mathbf{x}_q \in\mathbb{R}^{d} x q ∈ R d , we define the K-NN problem as follows.
Definition 3.1 (K-nearest neighbor ordering and classification). Given a query x q \mathbf{x}_q x q and a dataset D = { ( x i , y i ) } i = 1 N \mathcal{D} = \{(\mathbf{x}_i,y_i)\}_{i=1}^{N} D = {( x i , y i ) } i = 1 N , a permutation π : [ N ] → [ N ] \pi: [N] \to[N] π : [ N ] → [ N ] is said to order the dataset points by increasing distance to x q \mathbf{x}_q x q if
∥ x q − x π ( 1 ) ∥ < ∥ x q − x π ( 2 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ . \lVert\mathbf{x}_q - \mathbf{x}_{\pi(1)} \rVert< \lVert\mathbf{x}_q - \mathbf{x}_{\pi(2)} \rVert< \cdots< \lVert\mathbf{x}_q - \mathbf{x}_{\pi(N)} \rVert. ∥ x q − x π ( 1 ) ∥ < ∥ x q − x π ( 2 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ .
Then x π ( k ) \mathbf{x}_{\pi(k)} x π ( k ) is the k k k -th nearest neighbor of x q \mathbf{x}_q x q . The K-NN problem is to predict the label of x q \mathbf{x}_q x q from the labels of its top-K K K nearest neighbors. Formally, the K-NN target is defined as arg max c ∈ Y ∑ k = 1 K 1 { y π ( k ) = c } \arg\max_{c\in\mathcal{Y}}\sum_{k=1}^{K}\mathbb{1}\{y_{\pi(k)}=c\} arg max c ∈ Y ∑ k = 1 K 1 { y π ( k ) = c } , namely the majority label among the top-K K K nearest neighbors.
In the definition above, we implicitly assume that ∥ x q − x i ∥ ≠ ∥ x q − x j ∥ \lVert\mathbf{x}_q-\mathbf{x}_i\rVert\ne\lVert\mathbf{x}_q-\mathbf{x}_j\rVert ∥ x q − x i ∥ = ∥ x q − x j ∥ for all i ≠ j i\ne j i = j , so that the ordering permutation π \pi π is well defined. This assumption is satisfied almost surely whenever ( x 1 , … , x N , x q ) (\mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q) ( x 1 , … , x N , x q ) are independent and continuously distributed, because the event of a distance tie then has probability zero. In this work, we focus on the binary-label case Y = { ± 1 } \mathcal{Y}=\{\pm1\} Y = { ± 1 } . In this case, the K-NN target reduces to sign ( ∑ k = 1 K y π ( k ) ) \operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right) sign ( ∑ k = 1 K y π ( k ) ) , where we take sign ( 0 ) = 0 \operatorname{sign}(0)=0 sign ( 0 ) = 0 to represent abstention when the top-K K K set has no strict majority.
Transformer Architecture
In this subsection, we introduce the stochastic positional encoding module, the input embedding matrix, and the transformer model considered in our analysis. We also give a negative result for using transformers without CoT to solve K-NN tasks.
Stochastic positional encodings. Let { e j } j = 1 N + 1 \{e_j\}_{j=1}^{N+1} { e j } j = 1 N + 1 denote the canonical basis of R N + 1 \mathbb{R}^{N+1} R N + 1 . During each training epoch and at test time, a new set of stochastic positional encodings is generated as follows:
a uniformly random permutation τ ∼ Unif ( S N + 1 ) \tau\sim\operatorname{Unif}(S_{N+1}) τ ∼ Unif ( S N + 1 ) ;
independent Rademacher signs s 1 , … , s N + 1 ∼ i . i . d . Rad ( ± 1 ) s_1,\ldots,s_{N+1}\overset{\mathrm{i.i.d.}}{\sim}\operatorname{Rad}(\pm1) s 1 , … , s N + 1 ∼ i.i.d. Rad ( ± 1 ) .
Here, S N + 1 S_{N+1} S N + 1 denotes the set of all permutations of [ N + 1 ] [N+1] [ N + 1 ] , so that τ ( i ) \tau(i) τ ( i ) specifies the permuted position assigned to the token i i i . We then define the one-hot signed positional vectors by
p i : = s i e τ ( i ) ( i ∈ [ N + 1 ] ) . \mathbf{p}_i := s_i e_{\tau(i)} \quad(i\in[N+1]). p i := s i e τ ( i ) ( i ∈ [ N + 1 ]) .
Stochastic positional encodings have been employed in several prior works Shen et al. [34 ] ; Wang et al. [47 ] ; Dwivedi et al. [10 ] . Most closely related to our work, Wang et al. [47 ] theoretically analyzes the training dynamics of one-layer transformers with near-orthogonal stochastic positional encodings, showing that these encodings improve length generalization while inducing distributional symmetries that simplify the characterization of gradient-descent trajectories. Our construction similarly induces a signed-permutation symmetry, which we exploit in Appendix § 12 .§ 2 to characterize the training dynamics. Importantly, stochastic positional encodings are not essential to our expressive power guarantees (Theorem 4.1 and Proposition 4.2); these results extend directly to any set of mutually orthogonal positional encodings.
Embedding construction. We construct the context matrix H ∈ R D × N \mathbf{H}\in\mathbb{R}^{D\times N} H ∈ R D × N and the initial query vector q ( 0 ) ∈ R D \mathbf{q}^{(0)}\in\mathbb{R}^{D} q ( 0 ) ∈ R D by concatenating the features, labels, and positional encodings. Specifically, for each training set { ( x i , y i ) } i = 1 N \{(\mathbf{x}_i,y_i)\}_{i=1}^{N} {( x i , y i ) } i = 1 N and query input x q \mathbf{x}_q x q , the embedding h i \mathbf{h}_i h i (the i i i -th column of H \mathbf{H} H ) and the initial query vector q ( 0 ) \mathbf{q}^{(0)} q ( 0 ) are given by h i = [ x i T , y i , p i T ] T \mathbf{h}_i=[\mathbf{x}_i^{\mathsf{T}},y_i,\mathbf{p}_i^{\mathsf{T}}]^{\mathsf{T}} h i = [ x i T , y i , p i T ] T and q ( 0 ) = [ x q T , 0 , p N + 1 T ] T \mathbf{q}^{(0)}=[\mathbf{x}_q^{\mathsf{T}},0,\mathbf{p}_{N+1}^{\mathsf{T}}]^{\mathsf{T}} q ( 0 ) = [ x q T , 0 , p N + 1 T ] T , respectively. Consequently, the initial input embedding matrix is in the following format:
Z ( 0 ) = [ H , q ( 0 ) ] = [ x 1 ⋯ x N x q y 1 ⋯ y N 0 p 1 ⋯ p N p N + 1 ] ∈ R D × ( N + 1 ) . (1) \mathbf{Z}^{(0)}=[\mathbf{H},\mathbf{q}^{(0)}]=
\begin{bmatrix}
\mathbf{x}_1 & \cdots& \mathbf{x}_N & \mathbf{x}_q\\
y_1 & \cdots& y_N & 0\\
\mathbf{p}_1 & \cdots& \mathbf{p}_N & \mathbf{p}_{N+1}
\end{bmatrix}\in\mathbb{R}^{D\times(N+1)}. \tag*{(1)} Z ( 0 ) = [ H , q ( 0 ) ] = x 1 y 1 p 1 ⋯ ⋯ ⋯ x N y N p N x q 0 p N + 1 ∈ R D × ( N + 1 ) . (1)
One-layer self-attention transformer. Following the setup of Wang et al. [47 ] ; Huang et al. [16 ] ; Yang et al. [49 ] , we consider a one-layer self-attention transformer in which the projection and value matrices are combined into V ∈ R D × D \mathbf{V}\in\mathbb{R}^{D\times D} V ∈ R D × D , and the key and query matrices are combined into W ∈ R D × D \mathbf{W} \in\mathbb{R}^{D \times D} W ∈ R D × D . The transformer layer, parameterized by θ = ( V , W ) \boldsymbol{\theta} = (\mathbf{V},\mathbf{W}) θ = ( V , W ) , is defined by
TF ( Z , θ ) = Z + V Z ⋅ softmax ( Z T W Z ) , (2) \operatorname{TF}(\mathbf{Z},\boldsymbol{\theta}) = \mathbf{Z} + \mathbf{V}\mathbf{Z} \cdot\operatorname{softmax}\left(\mathbf{Z}^{\mathsf{T}}\mathbf{W}\mathbf{Z}\right), \tag*{(2)} TF ( Z , θ ) = Z + VZ ⋅ softmax ( Z T WZ ) , (2)
where softmax ( A ) \operatorname{softmax}(\mathbf{A}) softmax ( A ) applies the softmax operator on each column of the matrix A \mathbf{A} A , i.e., [ softmax ( A ) ] i j = exp ( A i j ) / ∑ i exp ( A i j ) [\operatorname{softmax}(\mathbf{A})]_{ij} = \exp(A_{ij}) / \sum_i \exp(A_{ij}) [ softmax ( A ) ] ij = exp ( A ij ) / ∑ i exp ( A ij ) .
The transformer definition in (2) is slightly simplified relative to practical implementations, most notably in its use of merged key and query matrices. These simplifications reflect the limitations of our theoretical framework. However, similar simplifications are common in theoretical analyses of transformers [47 , 49 ] (Li et al. 2024a). Among these existing works, Li et al. (2024a) showed that transformers with frozen V = I \mathbf{V} = \mathbf{I} V = I can be trained to perform 1-NN prediction in context via direct inference. However, their result cannot be directly extended to the case of K-NN with K > 1 K > 1 K > 1 , as softmax attention is much less naturally suited to attending to the 2nd through K K K -th nearest neighbors than to attending to the single nearest neighbor.
To illustrate the limitation of direct inference by transformers, we define a class of well-separated input instances, and show that transformers in (2) cannot perform K-NN even on such instances. Specifically, for γ > 0 \gamma> 0 γ > 0 , let X γ \mathcal{X}_{\gamma} X γ be the class of input instances { ( x i , y i ) i = 1 N , x q } \{(\mathbf{x}_i,y_i)_{i=1}^{N},\mathbf{x}_q\} {( x i , y i ) i = 1 N , x q } such that x 1 , … , x N , x q ∈ S d − 1 \mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q \in\mathbb{S}^{d-1} x 1 , … , x N , x q ∈ S d − 1 , y i ∈ { ± 1 } y_i \in\{\pm1\} y i ∈ { ± 1 } , and
min { min 1 ≤ k ≤ N − 1 ( ∥ x q − x π ( k + 1 ) ∥ − ∥ x q − x π ( k ) ∥ ) , 2 − ∥ x q − x π ( N ) ∥ } ≥ γ . \min\left\{\min_{1\leq k\leq N-1}\left(\lVert\mathbf{x}_q-\mathbf{x}_{\pi(k+1)}\rVert-\lVert\mathbf{x}_q-\mathbf{x}_{\pi(k)}\rVert\right),\,2-\lVert\mathbf{x}_q-\mathbf{x}_{\pi(N)}\rVert\right\}\geq\gamma. min { 1 ≤ k ≤ N − 1 min ( ∥ x q − x π ( k + 1 ) ∥ − ∥ x q − x π ( k ) ∥ ) , 2 − ∥ x q − x π ( N ) ∥ } ≥ γ .
Then we have the following proposition.
Proposition 3.2. Assume d ≥ 2 d \geq2 d ≥ 2 , 3 ≤ K ≤ N − 2 3 \leq K \leq N-2 3 ≤ K ≤ N − 2 , and K K K is odd. For any 0 < γ ≤ 2 / ( N + K + 1 ) 0 < \gamma\leq2/(N+K+1) 0 < γ ≤ 2/ ( N + K + 1 ) , any one-layer transformer (2) with fixed finite matrices V , W ∈ R D × D \mathbf{V},\mathbf{W} \in\mathbb{R}^{D \times D} V , W ∈ R D × D and any realization of the stochastic positional encodings, there exists an input instance in X γ \mathcal{X}_{\gamma} X γ such that the corresponding input embedding matrix Z ( 0 ) \mathbf{Z}^{(0)} Z ( 0 ) in (1) satisfies
sign ( TF ( Z ( 0 ) , θ ) d + 1 , − 1 ) ≠ sign ( ∑ k = 1 K y π ( k ) ) . \operatorname{sign}\left(\operatorname{TF}(\mathbf{Z}^{(0)},\boldsymbol{\theta})_{d+1,-1}\right)\ne\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right). sign ( TF ( Z ( 0 ) , θ ) d + 1 , − 1 ) = sign ( k = 1 ∑ K y π ( k ) ) .
We defer the detailed proof to Appendix § 9 . Proposition 3.2 shows that, although one-layer transformers are capable of performing in-context 1-NN prediction (Li et al., 2024a), this direct-inference mechanism already breaks down for odd K > 1 K > 1 K > 1 , even on a well-separated class of inputs. This limitation motivates our study of the CoT setting.
Construction of Transformers
In this section, we first introduce the CoT process, which enables transformers to generate intermediate results autoregressively before producing the final answer. We then show that there exists a parameter setting θ \boldsymbol{\theta} θ such that the one-layer transformer (2) can solve the K-NN problem.
Prediction with CoT. With CoT, we enable the transformer to generate K − 1 K-1 K − 1 steps before it outputs the final prediction. Specifically, at the k k k -th generation step, given the input sequence Z ^ ( k ) \widehat{\mathbf{Z}}^{(k)} Z ( k ) , we obtain TF ( Z ^ ( k ) , θ ) : , − 1 \operatorname{TF}(\widehat{\mathbf{Z}}^{(k)},\boldsymbol{\theta})_{:,-1} TF ( Z ( k ) , θ ) : , − 1 as the prediction of the ( k + 1 ) (k+1) ( k + 1 ) -th token and append it to the end of the current sequence such that Z ^ ( k + 1 ) = [ Z ^ ( k ) , TF ( Z ^ ( k ) , θ ) : , − 1 ] \widehat{\mathbf{Z}}^{(k+1)} = [\widehat{\mathbf{Z}}^{(k)},\operatorname{TF}(\widehat{\mathbf{Z}}^{(k)},\boldsymbol{\theta})_{:,-1}] Z ( k + 1 ) = [ Z ( k ) , TF ( Z ( k ) , θ ) : , − 1 ] . After K − 1 K-1 K − 1 reasoning steps, the CoT process induces K − 1 K-1 K − 1 sequences { Z ^ ( k ) } k = 1 K − 1 \{\widehat{Z}^{(k)}\}_{k=1}^{K-1} { Z ( k ) } k = 1 K − 1 in the following form:
Z ^ ( k ) = [ Z ( 0 ) , TF ( Z ( 0 ) , θ ) : , − 1 , … , TF ( Z ^ ( k − 1 ) , θ ) : , − 1 ] ∈ R D × ( N + k + 1 ) , k ∈ [ K − 1 ] . \widehat{Z}^{(k)} = [Z^{(0)}, \operatorname{TF}(Z^{(0)},\theta)_{:,-1},\ldots,\operatorname{TF}(\widehat{Z}^{(k-1)},\theta)_{:,-1}] \in\mathbb{R}^{D\times(N+k+1)},\quad k\in[K-1]. Z ( k ) = [ Z ( 0 ) , TF ( Z ( 0 ) , θ ) : , − 1 , … , TF ( Z ( k − 1 ) , θ ) : , − 1 ] ∈ R D × ( N + k + 1 ) , k ∈ [ K − 1 ] .
Note that Z ^ ( 0 ) = Z ( 0 ) = [ H , q ( 0 ) ] \widehat{Z}^{(0)}=Z^{(0)}=[\mathbf{H},q^{(0)}] Z ( 0 ) = Z ( 0 ) = [ H , q ( 0 ) ] .
We impose the following parameters θ = ( V , W ) \theta=(\mathbf{V},\mathbf{W}) θ = ( V , W ) in (2) :
V = [ 0 d × d 0 d × 1 0 d × ( N + 1 ) 0 1 × d 1 0 1 × ( N + 1 ) 0 ( N + 1 ) × d 0 ( N + 1 ) × 1 I N + 1 ] , W = [ α I d 0 d × 1 0 d × ( N + 1 ) 0 1 × d 0 0 1 × ( N + 1 ) 0 ( N + 1 ) × d 0 ( N + 1 ) × 1 β I N + 1 ] . \mathbf{V}=
\begin{bmatrix}
\mathbf{0}_{d\times d} & \mathbf{0}_{d\times1} & \mathbf{0}_{d\times(N+1)}\\
\mathbf{0}_{1\times d} & 1 & \mathbf{0}_{1\times(N+1)}\\
\mathbf{0}_{(N+1)\times d} & \mathbf{0}_{(N+1)\times1} & \mathbf{I}_{N+1}
\end{bmatrix},
\qquad
\mathbf{W}=
\begin{bmatrix}
\alpha\mathbf{I}_{d} & \mathbf{0}_{d\times1} & \mathbf{0}_{d\times(N+1)}\\
\mathbf{0}_{1\times d} & 0 & \mathbf{0}_{1\times(N+1)}\\
\mathbf{0}_{(N+1)\times d} & \mathbf{0}_{(N+1)\times1} & \beta\mathbf{I}_{N+1}
\end{bmatrix}. V = 0 d × d 0 1 × d 0 ( N + 1 ) × d 0 d × 1 1 0 ( N + 1 ) × 1 0 d × ( N + 1 ) 0 1 × ( N + 1 ) I N + 1 , W = α I d 0 1 × d 0 ( N + 1 ) × d 0 d × 1 0 0 ( N + 1 ) × 1 0 d × ( N + 1 ) 0 1 × ( N + 1 ) β I N + 1 .
where α \alpha α and β \beta β are scalars. The following theorem provides a construction of a one-layer transformer that solves the K-NN problem.
Theorem 4.1. Suppose that, almost surely, x 1 , … , x N , x q ∈ S d − 1 \mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q\in\mathbb{S}^{d-1} x 1 , … , x N , x q ∈ S d − 1 , ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 \lVert\mathbf{x}_q-\mathbf{x}_{\pi(1)}\rVert<\cdots<\lVert\mathbf{x}_q-\mathbf{x}_{\pi(N)}\rVert<2 ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 , and y i ∈ { ± 1 } y_i\in\{\pm1\} y i ∈ { ± 1 } for every i ∈ [ N ] i\in[N] i ∈ [ N ] . For any K ≤ N K\leq N K ≤ N , let y ^ K = sign ( ∑ k = 1 K y π ( k ) ) \widehat{y}_K=\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right) y K = sign ( ∑ k = 1 K y π ( k ) ) . Then, as α → ∞ \alpha\to\infty α → ∞ , β → − ∞ \beta\to-\infty β → − ∞ , and β / α → − 2 \beta/\alpha\to-2 β / α → − 2 , it holds that
P ( TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 ⋅ y ^ K < 0 ) → 0 , \mathbb{P}\left(\operatorname{TF}(\widehat{Z}^{(K-1)},\theta)_{d+1,-1}\cdot\widehat{y}_K<0\right)\to0, P ( TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 ⋅ y K < 0 ) → 0 , where the probability is taken with respect to the joint law of ( D , x q , ω ) (\mathcal{D},\mathbf{x}_q,\omega) ( D , x q , ω ) , where D = { ( x i , y i ) } i = 1 N \mathcal{D}=\{(\mathbf{x}_i,y_i)\}_{i=1}^{N} D = {( x i , y i ) } i = 1 N and ω = ( τ , s 1 , … , s N + 1 ) \omega=(\tau,s_1,\ldots,s_{N+1}) ω = ( τ , s 1 , … , s N + 1 ) denotes the randomness in the stochastic positional encodings.
We defer the detailed proof to Appendix § 10 . Theorem 4.1 gives an asymptotic expressivity result: under the sharp-attention limit α → ∞ \alpha\to\infty α → ∞ , β → − ∞ \beta\to-\infty β → − ∞ , and β / α → − 2 \beta/\alpha\to-2 β / α → − 2 , a one-layer transformer can solve the K-NN problem via CoT reasoning. If we further restrict attention to the γ \gamma γ -separated input instances in X γ \mathcal{X}_{\gamma} X γ defined in § 3.2 , this asymptotic construction can be strengthened to a finite-parameter correctness statement, which we state next.
Proposition 4.2 (Uniform correctness under a fixed margin). Under the construction in Theorem 4.1, the following holds. For any K ≤ N K\leq N K ≤ N and γ > 0 \gamma>0 γ > 0 , there exist constants α 0 > 0 \alpha_0>0 α 0 > 0 and δ 0 > 0 \delta_0>0 δ 0 > 0 depending only on ( γ , N , K ) (\gamma,N,K) ( γ , N , K ) such that if α ≥ α 0 \alpha\geq\alpha_0 α ≥ α 0 and ∣ β / α + 2 ∣ ≤ δ 0 \lvert\beta/\alpha+2\rvert\leq\delta_0 ∣ β / α + 2 ∣ ≤ δ 0 , then
sign ( TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 ) ≡ sign ( ∑ k = 1 K y π ( k ) ) \operatorname{sign}\left(\operatorname{TF}(\widehat{Z}^{(K-1)},\theta)_{d+1,-1}\right)\equiv\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right) sign ( TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 ) ≡ sign ( k = 1 ∑ K y π ( k ) ) for all instances in X γ \mathcal{X}_{\gamma} X γ with ∑ k = 1 K y π ( k ) ≠ 0 \sum_{k=1}^{K}y_{\pi(k)}\ne0 ∑ k = 1 K y π ( k ) = 0 and all realizations of the stochastic positional encodings.
We defer the detailed proof to Appendix § 11 . Proposition 4.2 is directly comparable with Proposition 3.2, showing that a transformer with exactly the same architecture can perform K-NN with K K K reasoning steps. These two propositions together highlight the strength of CoT over direct inference in handling complicated tasks.
Key intuition. The key intuition behind Theorem 4.1 and Proposition 4.2 is that our construction implements a sequential nearest-neighbor selection procedure. The following lemma summarizes the outcome of this selection procedure and serves as a key step in the proof of Theorem 4.1.
Lemma 4.3. Suppose that x 1 , … , x N , x q ∈ S d − 1 \mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q\in\mathbb{S}^{d-1} x 1 , … , x N , x q ∈ S d − 1 , ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 \lVert\mathbf{x}_q-\mathbf{x}_{\pi(1)}\rVert<\cdots<\lVert\mathbf{x}_q-\mathbf{x}_{\pi(N)}\rVert<2 ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 , and y i ∈ { ± 1 } y_i\in\{\pm1\} y i ∈ { ± 1 } for every i ∈ [ N ] i\in[N] i ∈ [ N ] . For any K ≤ N K\leq N K ≤ N , as α → ∞ \alpha\to\infty α → ∞ , β → − ∞ \beta\to-\infty β → − ∞ , and β / α → − 2 \beta/\alpha\to-2 β / α → − 2 , it holds that
TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 − ∑ k = 1 K y π ( k ) → 0. \operatorname{TF}(\widehat{Z}^{(K-1)},\theta)_{d+1,-1}-\sum_{k=1}^{K}y_{\pi(k)}\to0. TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 − k = 1 ∑ K y π ( k ) → 0.
To explain Lemma 4.3, consider the following idealized setting. Suppose that after k k k CoT steps, all previously generated tokens are exact, so that Z ˉ ( k ) = [ H , q ( 0 ) , … , q ( k ) ] \bar{\mathbf{Z}}^{(k)} = [\mathbf{H}, \mathbf{q}^{(0)}, \ldots, \mathbf{q}^{(k)}] Z ˉ ( k ) = [ H , q ( 0 ) , … , q ( k ) ] , where q ( k ) = [ x q ⊤ , ∑ i = 1 k y π ( i ) , p N + 1 ⊤ + ∑ i = 1 k p π ( i ) ⊤ ] ⊤ \mathbf{q}^{(k)} = \left[\mathbf{x}_q^\top, \sum_{i=1}^{k} y_{\pi(i)}, \mathbf{p}_{N+1}^\top+ \sum_{i=1}^{k} \mathbf{p}_{\pi(i)}^\top\right]^\top q ( k ) = [ x q ⊤ , ∑ i = 1 k y π ( i ) , p N + 1 ⊤ + ∑ i = 1 k p π ( i ) ⊤ ] ⊤ . Then the attention logits for the last token take the form
( Z ˉ ( k ) ) ⊤ W Z ˉ : , − 1 ( k ) = { α x i ⊤ x q , for an unselected context token h i , i ∉ { π ( 1 ) , … , π ( k ) } , α x π ( i ) ⊤ x q + β , for a selected context token h π ( i ) , 1 ≤ i ≤ k , α + ( m + 1 ) β , for a previously generated token q ( m ) , 0 ≤ m ≤ k . \left(\bar{\mathbf{Z}}^{(k)}\right)^\top\mathbf{W}\bar{\mathbf{Z}}^{(k)}_{:,-1} =
\begin{cases}
\alpha\mathbf{x}_i^\top\mathbf{x}_q, & \text{for an unselected context token } h_i,\ i \notin\{\pi(1),\ldots,\pi(k)\},\\
\alpha\mathbf{x}_{\pi(i)}^\top\mathbf{x}_q + \beta, & \text{for a selected context token } h_{\pi(i)},\ 1 \le i \le k,\\
\alpha+ (m+1)\beta, & \text{for a previously generated token } \mathbf{q}^{(m)},\ 0 \le m \le k.
\end{cases} ( Z ˉ ( k ) ) ⊤ W Z ˉ : , − 1 ( k ) = ⎩ ⎨ ⎧ α x i ⊤ x q , α x π ( i ) ⊤ x q + β , α + ( m + 1 ) β , for an unselected context token h i , i ∈ / { π ( 1 ) , … , π ( k )} , for a selected context token h π ( i ) , 1 ≤ i ≤ k , for a previously generated token q ( m ) , 0 ≤ m ≤ k .
The key point is that the positional component leaves unselected context tokens unchanged, penalizes each previously selected neighbor by an additive factor of β \beta β , and penalizes each previously generated token q ( m ) \mathbf{q}^{(m)} q ( m ) by an additive factor of ( m + 1 ) β (m+1)\beta ( m + 1 ) β . Dividing by α \alpha α and letting − β / α → 2 -\beta/\alpha\to2 − β / α → 2 , the corresponding asymptotic scores become x i ⊤ x q \mathbf{x}_i^\top\mathbf{x}_q x i ⊤ x q , x π ( i ) ⊤ x q − 2 \mathbf{x}_{\pi(i)}^\top\mathbf{x}_q - 2 x π ( i ) ⊤ x q − 2 , and − ( 2 m + 1 ) -(2m+1) − ( 2 m + 1 ) . Combined with x π ( 1 ) ⊤ x q > ⋯ > x π ( N ) ⊤ x q > − 1 \mathbf{x}_{\pi(1)}^\top\mathbf{x}_q > \cdots> \mathbf{x}_{\pi(N)}^\top\mathbf{x}_q > -1 x π ( 1 ) ⊤ x q > ⋯ > x π ( N ) ⊤ x q > − 1 , which is implied by ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 \lVert\mathbf{x}_q-\mathbf{x}_{\pi(1)}\rVert< \cdots< \lVert\mathbf{x}_q-\mathbf{x}_{\pi(N)}\rVert< 2 ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 , the largest score is attained by the next unretrieved neighbor π ( k + 1 ) \pi(k+1) π ( k + 1 ) . Therefore, softmax ( ( Z ˉ ( k ) ) ⊤ W Z ˉ : , − 1 ( k ) ) \operatorname{softmax}\left((\bar{\mathbf{Z}}^{(k)})^\top\mathbf{W}\bar{\mathbf{Z}}^{(k)}_{:,-1}\right) softmax ( ( Z ˉ ( k ) ) ⊤ W Z ˉ : , − 1 ( k ) ) converges to the one-hot vector corresponding to h π ( k + 1 ) h_{\pi(k+1)} h π ( k + 1 ) . With the residual connection, the transformer prediction TF ( Z ˉ ( k ) , θ ) : , − 1 \operatorname{TF}(\bar{\mathbf{Z}}^{(k)}, \theta)_{:,-1} TF ( Z ˉ ( k ) , θ ) : , − 1 converges to q ( k + 1 ) = [ x q ⊤ , ∑ i = 1 k + 1 y π ( i ) , p N + 1 ⊤ + ∑ i = 1 k + 1 p π ( i ) ⊤ ] ⊤ \mathbf{q}^{(k+1)} = \left[\mathbf{x}_q^\top, \sum_{i=1}^{k+1} y_{\pi(i)}, \mathbf{p}_{N+1}^\top+ \sum_{i=1}^{k+1} \mathbf{p}_{\pi(i)}^\top\right]^\top q ( k + 1 ) = [ x q ⊤ , ∑ i = 1 k + 1 y π ( i ) , p N + 1 ⊤ + ∑ i = 1 k + 1 p π ( i ) ⊤ ] ⊤ .
The discussion above explains the one-step mechanism underlying the construction under the idealization that all previously generated tokens are exact. In the actual CoT rollout, however, the previously generated tokens only approach their ideal counterparts, and the resulting perturbations to subsequent attention scores may affect which token receives the largest attention weight. Appendix § 10 addresses this challenge through a refined induction argument, thereby establishing Lemma 4.3. Since the K-NN target is given by sign ( ∑ i = 1 K y π ( i ) ) \operatorname{sign}\left(\sum_{i=1}^{K} y_{\pi(i)}\right) sign ( ∑ i = 1 K y π ( i ) ) , Lemma 4.3 implies that P ( TF ( Z ˉ ( K − 1 ) , θ ) d + 1 , − 1 ⊤ y K < 0 ) → 0 \mathbb{P}\left(\operatorname{TF}(\bar{\mathbf{Z}}^{(K-1)}, \theta)_{d+1,-1}^\top\mathbf{y}_K < 0\right) \to0 P ( TF ( Z ˉ ( K − 1 ) , θ ) d + 1 , − 1 ⊤ y K < 0 ) → 0 , which is exactly the statement of Theorem 4.1 .
Training Dynamics and Generalization of Transformers
§ 4 establishes the existence of a one-layer transformer capable of solving the K-NN problem using CoT. However, those results do not address whether such a transformer can be learned in practice. In this section, we analyze the training dynamics of the transformer and, interestingly, our result shows that gradient descent can recover the construction in Theorem 4.1 under one-step state supervision.
Training. Following prior analyses of training dynamics [19 , 13 , 49 ] (Li et al. 2024a), we keep V \mathbf{V} V fixed throughout training. This simplification is commonly adopted in recent theoretical work to isolate the learning dynamics of softmax attention. Motivated by the construction in § 4 , we set V = diag ( 0 , 1 , I N + 1 ) \mathbf{V} = \operatorname{diag}(0,1,\mathbf{I}_{N+1}) V = diag ( 0 , 1 , I N + 1 ) . Accordingly, we rewrite TF ( Z , θ ) \operatorname{TF}(\mathbf{Z}, \theta) TF ( Z , θ ) in (2) as TF ( Z , W ) \operatorname{TF}(\mathbf{Z}, \mathbf{W}) TF ( Z , W ) . We then train the transformer to predict the one-nearest-neighbor ground-truth vector [ x q ⊤ , y π ( 1 ) , p N + 1 ⊤ + p π ( 1 ) ⊤ ] ⊤ [\mathbf{x}_q^\top, y_{\pi(1)}, \mathbf{p}_{N+1}^\top+ \mathbf{p}_{\pi(1)}^\top]^\top [ x q ⊤ , y π ( 1 ) , p N + 1 ⊤ + p π ( 1 ) ⊤ ] ⊤ given the initial embedding matrix Z ( 0 ) \mathbf{Z}^{(0)} Z ( 0 ) .
The training loss for a single sample is:
ℓ ( W ) = 1 2 ∥ TF ( Z ( 0 ) , W ) : , − 1 − [ x q ⊤ , y π ( 1 ) , p N + 1 ⊤ + p π ( 1 ) ⊤ ] ⊤ ∥ 2 . \ell(\mathbf{W}) = \frac{1}{2}\left\lVert\operatorname{TF}(\mathbf{Z}^{(0)}, \mathbf{W})_{:,-1} - [\mathbf{x}_q^\top, y_{\pi(1)}, \mathbf{p}_{N+1}^\top+ \mathbf{p}_{\pi(1)}^\top]^\top\right\rVert^2. ℓ ( W ) = 2 1 TF ( Z ( 0 ) , W ) : , − 1 − [ x q ⊤ , y π ( 1 ) , p N + 1 ⊤ + p π ( 1 ) ⊤ ] ⊤ 2 .
The population loss is then defined as
L ( W ) = E D , x q E W [ ℓ ( W ) ] . (3) \mathcal{L}(\mathbf{W}) = \mathbb{E}_{D,\mathbf{x}_q}\mathbb{E}_{\mathbf{W}}[\ell(\mathbf{W})]. \tag*{(3)} L ( W ) = E D , x q E W [ ℓ ( W )] . (3)
The learning objective in (3) is optimized via GD with learning rate η > 0 \eta> 0 η > 0 . At t = 0 t = 0 t = 0 , we initialize W ( 0 ) = 0 \mathbf{W}^{(0)} = \mathbf{0} W ( 0 ) = 0 as the zero matrix. The parameter is updated as follows:
W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) . \mathbf{W}^{(t+1)} = \mathbf{W}^{(t)} - \eta\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)}). W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) .
For this training setup, we make the following assumption on the training set.
Assumption 5.1 (Training Distribution). For a given dataset { ( x i , y i ) } i = 1 N ∪ { x q } \{(\mathbf{x}_i,y_i)\}_{i=1}^{N} \cup\{\mathbf{x}_q\} {( x i , y i ) } i = 1 N ∪ { x q } , let x 1 : q : = ( x 1 , … , x N , x q ) \mathbf{x}_{1:q} := (\mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q) x 1 : q := ( x 1 , … , x N , x q ) and y 1 : N : = ( y 1 , … , y N ) y_{1:N} := (y_1,\ldots,y_N) y 1 : N := ( y 1 , … , y N ) . We focus on the following underlying distribution: (i) The input vectors { x i } i = 1 N \{\mathbf{x}_i\}_{i=1}^{N} { x i } i = 1 N and the query x q \mathbf{x}_q x q are sampled independently and uniformly from the unit sphere S d − 1 ⊂ R d \mathbb{S}^{d-1} \subset\mathbb{R}^{d} S d − 1 ⊂ R d . (ii) The labels { y i } i = 1 N \{y_i\}_{i=1}^{N} { y i } i = 1 N satisfy y i ∈ { ± 1 } y_i \in\{\pm1\} y i ∈ { ± 1 } and E [ y i y j ∣ x 1 : q ] = 0 \mathbb{E}[y_i y_j \mid\mathbf{x}_{1:q}] = 0 E [ y i y j ∣ x 1 : q ] = 0 for all i ≠ j , i , j ∈ [ N ] i \ne j, i,j \in[N] i = j , i , j ∈ [ N ] . (iii) We have P ( y 1 : N ∣ x 1 : q ) = P ( − y 1 : N ∣ x 1 : q ) \mathbb{P}(y_{1:N} \mid\mathbf{x}_{1:q}) = \mathbb{P}(-y_{1:N} \mid\mathbf{x}_{1:q}) P ( y 1 : N ∣ x 1 : q ) = P ( − y 1 : N ∣ x 1 : q ) and P ( y 1 : N ∣ x 1 : q ) = P ( y 1 : N ∣ R x 1 : q ) \mathbb{P}(y_{1:N} \mid\mathbf{x}_{1:q}) = \mathbb{P}(y_{1:N} \mid\mathbf{R}\mathbf{x}_{1:q}) P ( y 1 : N ∣ x 1 : q ) = P ( y 1 : N ∣ R x 1 : q ) for any rotation matrix R ∈ R d × d \mathbf{R} \in\mathbb{R}^{d \times d} R ∈ R d × d .
Assumption 5.1 is adapted from Li et al. (2024a). As discussed in Li et al. (2024a), it covers the setting in which the y i y_i y i ’s are independent of the x i \mathbf{x}_i x i ’s and uniformly distributed over { ± 1 } \{\pm1\} { ± 1 } . Such cases can be challenging because they may induce a complicated K-NN prediction rule and a highly oscillatory optimization landscape.
In the following theorem, we prove that for suitable parameters ( d , N , η ) (d,N,\eta) ( d , N , η ) , the loss function (3) will converge to zero under gradient descent.
Theorem 5.2. Suppose that d ≥ 2 d \ge2 d ≥ 2 , N = Ω ( d ) N = \Omega(\sqrt{d}) N = Ω ( d ) and η = O ( N − 2 ) \eta= O(N^{-2}) η = O ( N − 2 ) . Under Assumption 5.1 , we train the transformer model (2) by gradient descent to minimize the population loss (3) . Then we have
For all training steps t ≥ 0 t \ge0 t ≥ 0 ,
W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) , \mathbf{W}^{(t)} = \operatorname{diag}(\alpha^{(t)}\mathbf{I}_d, 0, \beta^{(t)}\mathbf{I}_{N+1}), W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) , with the scalar coefficients satisfying β ( t ) → − ∞ \beta^{(t)} \to-\infty β ( t ) → − ∞ , α ( t ) → + ∞ \alpha^{(t)} \to+\infty α ( t ) → + ∞ , and β ( t ) / α ( t ) → − 2 \beta^{(t)}/\alpha^{(t)} \to-2 β ( t ) / α ( t ) → − 2 .
The population loss L ( W ( t ) ) \mathcal{L}(\mathbf{W}^{(t)}) L ( W ( t ) ) converges to zero as t → ∞ t \to\infty t → ∞ .
We defer the detailed proof to Appendix § 12 . Theorem 5.2 shows that gradient descent recovers the construction in Theorem 4.1 using supervision only on the first-step target state vector. Prior theoretical studies of one-layer transformers with CoT (Huang et al., 2025a,c; Yang et al., 2025) typically supervise multiple intermediate states via teacher forcing, effectively providing repeated examples of a shared transition rule. Such supervision can facilitate optimization analysis, but need not be necessary for identifying the underlying rule. Our result shows that, for K-NN, supervising only the first-step target state vector suffices to learn the mechanism detailed in § 4 , which can then be applied autoregressively over multiple steps.
The first-step target supervision essentially also directly teaches the model to perform 1-NN retrieval, making our setting more comparable to that of Li et al. (2024a). However, the two settings differ in several important ways. Li et al. (2024a) only use a binary indicator to distinguish the query token from the context tokens and supervise the scalar target y π ( 1 ) y_{\pi(1)} y π ( 1 ) . Their GD trajectory has the form diag ( ξ 1 ( t ) I d , 0 , − ξ 2 ( t ) ) \operatorname{diag}(\xi_1^{(t)}\mathbf{I}_d,0,-\xi_2^{(t)}) diag ( ξ 1 ( t ) I d , 0 , − ξ 2 ( t ) ) , with a single scalar coefficient for the indicator dimension. In our setting, each token instead carries a stochastic positional vector, and we supervise the full target [ x q , y π ( 1 ) , p N + 1 + p π ( 1 ) ] ⊤ [\mathbf{x}_q,y_{\pi(1)},\mathbf{p}_{N+1}+\mathbf{p}_{\pi(1)}]^\top [ x q , y π ( 1 ) , p N + 1 + p π ( 1 ) ] ⊤ . The positional component is essential for CoT because it records the retrieved neighbor, allowing that neighbor to be penalized in subsequent reasoning steps. A further difference is that the analysis of Li et al. (2024a) requires − ξ 2 ( 0 ) -\xi_2^{(0)} − ξ 2 ( 0 ) to be sufficiently negative, whereas we use α ( 0 ) = β ( 0 ) = 0 \alpha^{(0)}=\beta^{(0)}=0 α ( 0 ) = β ( 0 ) = 0 , so query-token suppression must emerge from GD. Moreover, their analysis establishes the qualitative separation ξ 1 ( t ) → + ∞ \xi_1^{(t)}\to+\infty ξ 1 ( t ) → + ∞ and ξ 2 ( t ) − ξ 1 ( t ) → + ∞ \xi_2^{(t)}-\xi_1^{(t)}\to+\infty ξ 2 ( t ) − ξ 1 ( t ) → + ∞ . Our analysis provides a finer characterization of the learned coefficients: starting from zero initialization, we prove that α ( t ) → + ∞ \alpha^{(t)}\to+\infty α ( t ) → + ∞ and β ( t ) → − ∞ \beta^{(t)}\to-\infty β ( t ) → − ∞ and further identify their relative growth through β ( t ) / α ( t ) → − 2 \beta^{(t)}/\alpha^{(t)}\to-2 β ( t ) / α ( t ) → − 2 . Establishing these coupled asymptotics from zero initialization requires new analytical arguments. In particular, we develop contradiction and compactness arguments to establish coefficient divergence (Appendix § 12 .§ 3 ), and drift and crossing arguments to characterize the limiting ratio (Appendix § 12 .§ 6 ). We provide a proof sketch in § 6 .
Testing. Compared with the conditions of Theorem 4.1 , Assumption 5.1 is more restrictive. This is natural, as Assumption 5.1 enables training guarantees that are stronger than the pure expressive power results in Theorem 4.1 . Once training has recovered the construction, however, the learned model can still be applied to more general in-context K-NN prediction tasks. Combining the training and construction results therefore yields the following corollary.
Corollary 5.3. Suppose that, almost surely, x 1 , … , x N , x q ∈ S d − 1 x_1,\ldots,x_N,x_q\in\mathbb{S}^{d-1} x 1 , … , x N , x q ∈ S d − 1 , ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 \lVert x_q-x_{\pi(1)}\rVert<\cdots<\lVert x_q-x_{\pi(N)}\rVert<2 ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 , and y i ∈ { ± 1 } y_i\in\{\pm1\} y i ∈ { ± 1 } for every i ∈ [ N ] i\in[N] i ∈ [ N ] . Let the single-layer model ((2) ) be trained for t t t steps under the conditions of Theorem 5.2 . For any K ≤ N K\le N K ≤ N , let y ^ K = sign ( ∑ k = 1 K y π ( k ) ) \widehat{y}_K=\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right) y K = sign ( ∑ k = 1 K y π ( k ) ) . Then,
P ( TF ( Z ^ ( K − 1 ) , θ ( t ) ) d + 1 , − 1 ⋅ y ^ K < 0 ) → 0 as t → ∞ , \mathbb{P}\left(\operatorname{TF}\left(\widehat{Z}^{(K-1)},\theta^{(t)}\right)_{d+1,-1}\cdot\widehat{y}_K<0\right)\to0\quad\text{as }t\to\infty, P ( TF ( Z ( K − 1 ) , θ ( t ) ) d + 1 , − 1 ⋅ y K < 0 ) → 0 as t → ∞ , where the probability is taken with respect to the joint law of ( D , x q , ω ) (\mathcal{D},x_q,\omega) ( D , x q , ω ) , where D = { ( x i , y i ) } i = 1 N \mathcal{D}=\{(x_i,y_i)\}_{i=1}^{N} D = {( x i , y i ) } i = 1 N and ω = ( τ , s 1 , … , s N + 1 ) \omega=(\tau,s_1,\ldots,s_{N+1}) ω = ( τ , s 1 , … , s N + 1 ) denotes the randomness in the stochastic positional encodings. Moreover,
TF ( Z ^ ( K − 1 ) , θ ( t ) ) d + 1 , − 1 − ∑ k = 1 K y π ( k ) → 0 almost surely . \operatorname{TF}\left(\widehat{Z}^{(K-1)},\theta^{(t)}\right)_{d+1,-1}-\sum_{k=1}^{K}y_{\pi(k)}\to0\quad\text{almost surely}. TF ( Z ( K − 1 ) , θ ( t ) ) d + 1 , − 1 − k = 1 ∑ K y π ( k ) → 0 almost surely .
Corollary 5.3 summarizes the consequence of first learning the sharp-attention construction under the training assumptions and then applying that learned construction to the broader test class, and is proved by directly combining Theorems 5.2 and 4.1 .
Proof Sketch
In this section, we sketch the proof of Theorem 5.2 and highlight the techniques we used. The full proof is deferred to Appendix § 12 .
We first characterize the structure of W ( t ) W^{(t)} W ( t ) preserved throughout training. The key observation is that the population loss is invariant under three symmetries: feature rotations, label sign flips, and transformations of the positional block of the form S = D P S=DP S = D P , where P ∈ R ( N + 1 ) × ( N + 1 ) P\in\mathbb{R}^{(N+1)\times(N+1)} P ∈ R ( N + 1 ) × ( N + 1 ) is a permutation matrix and D ∈ R ( N + 1 ) × ( N + 1 ) D\in\mathbb{R}^{(N+1)\times(N+1)} D ∈ R ( N + 1 ) × ( N + 1 ) is a diagonal matrix with entries in { ± 1 } \{\pm1\} { ± 1 } . Specifically, for R ∈ O ( d ) R\in O(d) R ∈ O ( d ) , s ∈ { ± 1 } s\in\{\pm1\} s ∈ { ± 1 } , and such an S S S , define G R : = diag ( R , 1 , I N + 1 ) G_R:=\operatorname{diag}(R,1,I_{N+1}) G R := diag ( R , 1 , I N + 1 ) , G s : = diag ( I d , s , I N + 1 ) G_s:=\operatorname{diag}(I_d,s,I_{N+1}) G s := diag ( I d , s , I N + 1 ) , and G S : = diag ( I d , 1 , S ) G_S:=\operatorname{diag}(I_d,1,S) G S := diag ( I d , 1 , S ) . These invariances follow, respectively, from the rotational invariance of ( x 1 , … , x N , x q ) (x_1,\ldots,x_N,x_q) ( x 1 , … , x N , x q ) , the sign symmetry of y 1 , … , y N y_1,\ldots,y_N y 1 , … , y N , and the construction of the stochastic positional encodings. Hence, for each G ∈ { G R , G s , G S } G\in\{G_R,G_s,G_S\} G ∈ { G R , G s , G S } ,
L ( W ) = L ( G W G − 1 ) and ∇ L ( G W G − 1 ) = G ( ∇ L ( W ) ) G − 1 . (4) \mathcal{L}(W)=\mathcal{L}(GWG^{-1})\quad\text{and}\quad\nabla\mathcal{L}(GWG^{-1})=G\bigl(\nabla\mathcal{L}(W)\bigr)G^{-1}. \tag*{(4)} L ( W ) = L ( G W G − 1 ) and ∇ L ( G W G − 1 ) = G ( ∇ L ( W ) ) G − 1 . (4)
Since W ( 0 ) = 0 W^{(0)}=0 W ( 0 ) = 0 , ((4) ) implies we always have G W ( t ) G − 1 = W ( t ) GW^{(t)}G^{-1}=W^{(t)} G W ( t ) G − 1 = W ( t ) . A direct characterization of this property shows that W ( t ) W^{(t)} W ( t ) takes the form diag ( α I d , γ , β I N + 1 ) \operatorname{diag}(\alpha I_d,\gamma,\beta I_{N+1}) diag ( α I d , γ , β I N + 1 ) . Moreover, we can prove by induction that the scalar γ \gamma γ remains equal to 0 0 0 throughout training. We summarize our result in the following lemma.
Lemma 6.1. Under the same conditions as in Theorem 5.2 , for every t ≥ 0 t \ge0 t ≥ 0 , there exist scalars α ( t ) , β ( t ) ∈ R \alpha^{(t)}, \beta^{(t)} \in\mathbb{R} α ( t ) , β ( t ) ∈ R such that
W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) . \mathbf{W}^{(t)} = \operatorname{diag}(\alpha^{(t)}\mathbf{I}_d, 0, \beta^{(t)}\mathbf{I}_{N+1}). W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) .
Lemma 6.1 reduces the population objective to two scalar parameters. For clarity, we first write the explicit form of the attention weights. Let softmax ( Z ( 0 ) ⊤ W ( t ) q ( 0 ) ) = ( a 1 ( t ) , … , a N ( t ) , a 0 ( t ) ) ⊤ \operatorname{softmax}\left(\mathbf{Z}^{(0)\top}\mathbf{W}^{(t)}\mathbf{q}^{(0)}\right) = \left(a_1^{(t)}, \ldots, a_N^{(t)}, a_0^{(t)}\right)^\top softmax ( Z ( 0 ) ⊤ W ( t ) q ( 0 ) ) = ( a 1 ( t ) , … , a N ( t ) , a 0 ( t ) ) ⊤ . Then
a i ( t ) = exp ( α ( t ) x i ⊤ x q ) exp ( α ( t ) + β ( t ) ) + ∑ j = 1 N exp ( α ( t ) x j ⊤ x q ) , a 0 ( t ) = exp ( α ( t ) + β ( t ) ) exp ( α ( t ) + β ( t ) ) + ∑ j = 1 N exp ( α ( t ) x j ⊤ x q ) . a_i^{(t)} = \frac{\exp\left(\alpha^{(t)}\mathbf{x}_i^\top\mathbf{x}_q\right)}{\exp\left(\alpha^{(t)}+\beta^{(t)}\right) + \sum_{j=1}^{N}\exp\left(\alpha^{(t)}\mathbf{x}_j^\top\mathbf{x}_q\right)}, \quad a_0^{(t)} = \frac{\exp\left(\alpha^{(t)}+\beta^{(t)}\right)}{\exp\left(\alpha^{(t)}+\beta^{(t)}\right) + \sum_{j=1}^{N}\exp\left(\alpha^{(t)}\mathbf{x}_j^\top\mathbf{x}_q\right)}. a i ( t ) = exp ( α ( t ) + β ( t ) ) + ∑ j = 1 N exp ( α ( t ) x j ⊤ x q ) exp ( α ( t ) x i ⊤ x q ) , a 0 ( t ) = exp ( α ( t ) + β ( t ) ) + ∑ j = 1 N exp ( α ( t ) x j ⊤ x q ) exp ( α ( t ) + β ( t ) ) .
Moreover, taking the conditional expectation with respect to σ ( x 1 , … , x N , x q ) \sigma(\mathbf{x}_1, \ldots, \mathbf{x}_N, \mathbf{x}_q) σ ( x 1 , … , x N , x q ) eliminates the dependence of the terms a i ( t ) a j ( t ) y i y j a_i^{(t)}a_j^{(t)}y_i y_j a i ( t ) a j ( t ) y i y j in the population loss on the labels. Under Assumption 5.1, which gives E [ y i y j ∣ x 1 , … , x N , x q ] = 0 \mathbb{E}[y_i y_j \mid\mathbf{x}_1, \ldots, \mathbf{x}_N, \mathbf{x}_q] = 0 E [ y i y j ∣ x 1 , … , x N , x q ] = 0 for i ≠ j i \ne j i = j and E [ y i 2 ∣ x 1 , … , x N , x q ] = 1 \mathbb{E}[y_i^2 \mid\mathbf{x}_1, \ldots, \mathbf{x}_N, \mathbf{x}_q] = 1 E [ y i 2 ∣ x 1 , … , x N , x q ] = 1 , and using the identity p i ⊤ p j = δ i j \mathbf{p}_i^\top\mathbf{p}_j = \delta_{ij} p i ⊤ p j = δ ij , we obtain
L ( W ( t ) ) = E [ ( 1 − a π ( 1 ) ( t ) ) 2 + ∑ i ≠ π ( 1 ) ( a i ( t ) ) 2 + 1 2 ( a 0 ( t ) ) 2 ] . (5) \mathcal{L}(\mathbf{W}^{(t)}) = \mathbb{E}\left[(1-a_{\pi(1)}^{(t)})^2 + \sum_{i\ne\pi(1)}(a_i^{(t)})^2 + \frac{1}{2}(a_0^{(t)})^2\right]. \tag*{(5)} L ( W ( t ) ) = E ( 1 − a π ( 1 ) ( t ) ) 2 + i = π ( 1 ) ∑ ( a i ( t ) ) 2 + 2 1 ( a 0 ( t ) ) 2 . (5)
Equation (5) makes the objective transparent: ( 1 − a π ( 1 ) ( t ) ) 2 (1-a_{\pi(1)}^{(t)})^2 ( 1 − a π ( 1 ) ( t ) ) 2 rewards attention to the nearest neighbor, ∑ i ≠ π ( 1 ) ( a i ( t ) ) 2 \sum_{i\ne\pi(1)}(a_i^{(t)})^2 ∑ i = π ( 1 ) ( a i ( t ) ) 2 penalizes mass assigned to incorrect context tokens, and 1 2 ( a 0 ( t ) ) 2 \frac{1}{2}(a_0^{(t)})^2 2 1 ( a 0 ( t ) ) 2 penalizes attention to the query token. The convergence analysis therefore reduces to tracking two scalar parameters: β ( t ) \beta^{(t)} β ( t ) must suppress attention to the query token, while α ( t ) \alpha^{(t)} α ( t ) must sharpen the ranking of context tokens according to x i ⊤ x q \mathbf{x}_i^\top\mathbf{x}_q x i ⊤ x q . The following lemma presents our first result on the dynamics of α ( t ) \alpha^{(t)} α ( t ) and β ( t ) \beta^{(t)} β ( t ) .
Lemma 6.2. Under the same conditions as in Theorem 5.2 , we have
α ( t ) → + ∞ , β ( t ) → − ∞ . \alpha^{(t)} \to+\infty, \qquad\beta^{(t)} \to-\infty. α ( t ) → + ∞ , β ( t ) → − ∞.
Establishing these results is nontrivial, particularly under the zero initialization of W \mathbf{W} W . In contrast, Li et al. (2024a) initialize the entry of W \mathbf{W} W associated with the query token to a sufficiently negative value, thereby suppressing the corresponding attention weight from the outset. Under our zero initialization W ( 0 ) = 0 \mathbf{W}^{(0)} = 0 W ( 0 ) = 0 , this suppression must instead arise from the GD dynamics. We first establish, via an inductive argument, the forward invariance of the region defined by α ( t ) ≥ 0 \alpha^{(t)} \ge0 α ( t ) ≥ 0 and β ( t ) ≤ 0 \beta^{(t)} \le0 β ( t ) ≤ 0 throughout training, which further allows us to prove that β ( t ) \beta^{(t)} β ( t ) is strictly decreasing (Lemma D.18 ). Building on these properties, we develop a contradiction argument to establish β ( t ) → − ∞ \beta^{(t)} \to-\infty β ( t ) → − ∞ (Lemma D.20 ). Finally, once β ( t ) → − ∞ \beta^{(t)} \to-\infty β ( t ) → − ∞ has been established, we show that the gradient with respect to α \alpha α is eventually uniformly negative on every compact interval, which implies α ( t ) → + ∞ \alpha^{(t)} \to+\infty α ( t ) → + ∞ (Lemma D.21 ).
However, Lemma 6.2 alone does not determine a 0 ( t ) a_0^{(t)} a 0 ( t ) , which depends on the competition between the logit α ( t ) + β ( t ) \alpha^{(t)} + \beta^{(t)} α ( t ) + β ( t ) and the top context logit α ( t ) x π ( 1 ) ⊤ x q \alpha^{(t)}\mathbf{x}_{\pi(1)}^\top\mathbf{x}_q α ( t ) x π ( 1 ) ⊤ x q . The key issue is therefore the relative scale of α ( t ) \alpha^{(t)} α ( t ) and β ( t ) \beta^{(t)} β ( t ) . To identify the relevant threshold, it is natural to compare the weight of the query token with that of the top context token. Since a 0 ( t ) a π ( 1 ) ( t ) = exp ( α ( t ) ( 1 − x π ( 1 ) ⊤ x q + β ( t ) / α ( t ) ) ) \frac{a_0^{(t)}}{a_{\pi(1)}^{(t)}} = \exp\left(\alpha^{(t)}(1-\mathbf{x}_{\pi(1)}^\top\mathbf{x}_q+\beta^{(t)}/\alpha^{(t)})\right) a π ( 1 ) ( t ) a 0 ( t ) = exp ( α ( t ) ( 1 − x π ( 1 ) ⊤ x q + β ( t ) / α ( t ) ) ) , the competition is governed by the sign of ( 1 − x π ( 1 ) ⊤ x q + β ( t ) / α ( t ) ) (1-\mathbf{x}_{\pi(1)}^\top\mathbf{x}_q+\beta^{(t)}/\alpha^{(t)}) ( 1 − x π ( 1 ) ⊤ x q + β ( t ) / α ( t ) ) . Because 1 − x π ( 1 ) ⊤ x q ∈ ( 0 , 2 ) 1-\mathbf{x}_{\pi(1)}^\top\mathbf{x}_q \in(0,2) 1 − x π ( 1 ) ⊤ x q ∈ ( 0 , 2 ) a.s., the value 2 2 2 emerges as the critical threshold for ensuring that a π ( 1 ) ( t ) a_{\pi(1)}^{(t)} a π ( 1 ) ( t ) dominates. This observation motivates splitting the analysis into two separate regimes:
− β ( t ) α ( t ) ∈ ( 0 , 2 ) and − β ( t ) α ( t ) > 2. -\frac{\beta^{(t)}}{\alpha^{(t)}} \in(0,2) \qquad\text{and} \qquad-\frac{\beta^{(t)}}{\alpha^{(t)}} > 2. − α ( t ) β ( t ) ∈ ( 0 , 2 ) and − α ( t ) β ( t ) > 2.
The next two lemmas formalize these behaviors and show that they imply lim inf t → ∞ − β ( t ) / α ( t ) ≥ 2 \liminf_{t\to\infty} -\beta^{(t)}/\alpha^{(t)} \ge2 lim inf t → ∞ − β ( t ) / α ( t ) ≥ 2 and lim sup t → ∞ − β ( t ) / α ( t ) ≤ 2 \limsup_{t\to\infty} -\beta^{(t)}/\alpha^{(t)} \le2 lim sup t → ∞ − β ( t ) / α ( t ) ≤ 2 .
Lemma 6.3. Denote λ t : = − β ( t ) / α ( t ) \lambda_t := -\beta^{(t)}/\alpha^{(t)} λ t := − β ( t ) / α ( t ) . Let I = [ a , b ] ⊂ ( 0 , 2 ) I=[a,b]\subset(0,2) I = [ a , b ] ⊂ ( 0 , 2 ) . Then there exist constants 0 < d I ≤ d ˉ I < ∞ 0<d_I\le\bar d_I<\infty 0 < d I ≤ d ˉ I < ∞ , δ I > 0 \delta_I>0 δ I > 0 , and an integer T I T_I T I such that for every t ≥ T I t\ge T_I t ≥ T I , if λ t ∈ I \lambda_t\in I λ t ∈ I , then
d I ( α ( t ) ) 2 ≤ λ t + 1 − λ t ≤ d ˉ I ( α ( t ) ) 2 , L ( W ( t ) ) − L ( W ( t + 1 ) ) ≥ δ I ( α ( t ) ) 2 . \frac{d_I}{(\alpha^{(t)})^2}\le\lambda_{t+1}-\lambda_t\le\frac{\bar d_I}{(\alpha^{(t)})^2}, \qquad\mathcal{L}(\mathbf{W}^{(t)})-\mathcal{L}(\mathbf{W}^{(t+1)})\ge\frac{\delta_I}{(\alpha^{(t)})^2}. ( α ( t ) ) 2 d I ≤ λ t + 1 − λ t ≤ ( α ( t ) ) 2 d ˉ I , L ( W ( t ) ) − L ( W ( t + 1 ) ) ≥ ( α ( t ) ) 2 δ I .
Lemma 6.3 establishes two key facts. First, on any interval I ⊂ ( 0 , 2 ) I\subset(0,2) I ⊂ ( 0 , 2 ) , λ t \lambda_t λ t exhibits a uniform positive drift: the increment λ t + 1 − λ t \lambda_{t+1}-\lambda_t λ t + 1 − λ t is of order ( α ( t ) ) − 2 (\alpha^{(t)})^{-2} ( α ( t ) ) − 2 . Second, each such step yields a decrease in the loss of at least order ( α ( t ) ) − 2 (\alpha^{(t)})^{-2} ( α ( t ) ) − 2 . Together, these facts imply that every sufficiently late upcrossing of [ a , b ] ⊂ ( 0 , 2 ) [a,b]\subset(0,2) [ a , b ] ⊂ ( 0 , 2 ) by the sequence ( λ t ) t ≥ 0 (\lambda_t)_{t\ge0} ( λ t ) t ≥ 0 induces a fixed positive decrease in the loss; therefore, only finitely many such upcrossings can occur. Combining this conclusion with two results from the appendix, we obtain the desired claim (Theorem D.39). Specifically, Lemma D.38 shows that 0 0 0 is not a subsequential limit of { λ t } \{\lambda_t\} { λ t } , while Lemma D.36 shows that the trajectory cannot remain indefinitely in any compact interval I ⊂ ( 0 , 2 ) I\subset(0,2) I ⊂ ( 0 , 2 ) . Therefore, lim inf t → ∞ λ t ≥ 2 \liminf_{t\to\infty}\lambda_t\ge2 lim inf t → ∞ λ t ≥ 2 .
Lemma 6.4. Denote λ t : = − β ( t ) / α ( t ) \lambda_t := -\beta^{(t)}/\alpha^{(t)} λ t := − β ( t ) / α ( t ) . For every ε > 0 \varepsilon>0 ε > 0 , there exist constants c ε > 0 c_\varepsilon>0 c ε > 0 , C ε > 0 C_\varepsilon>0 C ε > 0 , and an integer T ε T_\varepsilon T ε such that for all t ≥ T ε t\ge T_\varepsilon t ≥ T ε , the following hold:
If λ t ≥ 2 + ε 2 \lambda_t\ge2+\frac{\varepsilon}{2} λ t ≥ 2 + 2 ε , then
λ t + 1 − λ t ≤ − c ε ( α ( t ) ) d + 1 , α ( t + 1 ) − α ( t ) ≥ c ε ( α ( t ) ) d , 0 ≤ β ( t ) − β ( t + 1 ) ≤ C ε e − ( ε / 2 ) α ( t ) . \lambda_{t+1}-\lambda_t\le-\frac{c_\varepsilon}{(\alpha^{(t)})^{d+1}}, \qquad\alpha^{(t+1)}-\alpha^{(t)}\ge\frac{c_\varepsilon}{(\alpha^{(t)})^d}, \qquad0\le\beta^{(t)}-\beta^{(t+1)}\le C_\varepsilon e^{-(\varepsilon/2)\alpha^{(t)}}. λ t + 1 − λ t ≤ − ( α ( t ) ) d + 1 c ε , α ( t + 1 ) − α ( t ) ≥ ( α ( t ) ) d c ε , 0 ≤ β ( t ) − β ( t + 1 ) ≤ C ε e − ( ε /2 ) α ( t ) . If λ t ≤ 2 + ε \lambda_t\le2+\varepsilon λ t ≤ 2 + ε , then ∣ λ t + 1 − λ t ∣ < ε / 2 |\lambda_{t+1}-\lambda_t|<\varepsilon/2 ∣ λ t + 1 − λ t ∣ < ε /2 .
Lemma 6.4 reveals two important facts. First, when λ t ≥ 2 + ε / 2 \lambda_t\ge2+\varepsilon/2 λ t ≥ 2 + ε /2 , λ t \lambda_t λ t exhibits a uniform negative drift, while α ( t ) \alpha^{(t)} α ( t ) continues to increase and the β \beta β -updates become exponentially small. These estimates imply that the trajectory cannot remain indefinitely in the region { λ t ≥ 2 + ε / 2 } \{\lambda_t\ge2+\varepsilon/2\} { λ t ≥ 2 + ε /2 } . Otherwise, α ( t ) \alpha^{(t)} α ( t ) would grow at least polynomially fast, the increments β ( t ) − β ( t + 1 ) \beta^{(t)}-\beta^{(t+1)} β ( t ) − β ( t + 1 ) would be summable, and β ( t ) \beta^{(t)} β ( t ) would converge to a finite limit, contradicting the fact that β ( t ) → − ∞ \beta^{(t)}\to-\infty β ( t ) → − ∞ . Second, once t t t is sufficiently large and λ t ≤ 2 + ε \lambda_t\le2+\varepsilon λ t ≤ 2 + ε , the final estimate shows that the dynamics cannot cross back above 2 + ε 2+\varepsilon 2 + ε in a single step. Combined with the negative drift in the regime λ t ≥ 2 + ε / 2 \lambda_t\ge2+\varepsilon/2 λ t ≥ 2 + ε /2 , this implies that, after the last time the trajectory exits the exterior region, it must remain below 2 + ε 2+\varepsilon 2 + ε forever. Therefore, for every ε > 0 \varepsilon>0 ε > 0 , we have λ t < 2 + ε \lambda_t<2+\varepsilon λ t < 2 + ε for all sufficiently large t t t , which yields lim sup t → ∞ λ t ≤ 2 \limsup_{t\to\infty}\lambda_t\le2 lim sup t → ∞ λ t ≤ 2 .
Proof of Theorem 5.2. Combining Lemma 6.3 and Lemma 6.4, we obtain − β ( t ) / α ( t ) → 2 -\beta^{(t)}/\alpha^{(t)}\to2 − β ( t ) / α ( t ) → 2 . Together with Lemma 6.2, this implies that the top context token eventually dominates the query token and all other context tokens. Hence a π ( 1 ) ( t ) → 1 a_{\pi(1)}^{(t)}\to1 a π ( 1 ) ( t ) → 1 , a 0 ( t ) → 0 a_0^{(t)}\to0 a 0 ( t ) → 0 , and a i ( t ) → 0 a_i^{(t)}\to0 a i ( t ) → 0 for i ≠ π ( 1 ) i\ne\pi(1) i = π ( 1 ) . Recalling the representation (5) , we conclude that L ( W ( t ) ) → 0 \mathcal{L}(\mathbf{W}^{(t)})\to0 L ( W ( t ) ) → 0 .
Numerical Experiments
In this section, we conduct numerical experiments to empirically validate our theoretical results. Specifically, we first show that the convergence of the training loss and the learned parameter structure of the transformer match the predictions of Theorem 5.2 . We then report the test accuracy of the trained transformer to verify the claims of Theorem 4.1 and Proposition 4.2. In addition, we conduct an experiment in which W \mathbf{W} W and V \mathbf{V} V are jointly trained from random initialization. The results show that fixing V \mathbf{V} V is not essential for recovering the theoretical construction in Theorem 4.1 , but is used only for analytical tractability. Due to space constraints, we defer these results to Appendix § 13 .§ 1 .
Experimental setup. We conduct experiments to assess three theory-facing questions: whether the training loss decreases, whether the learned parameter matrix develops the predicted block structure, and whether the trained model can execute K-NN prediction at test time via CoT. We train the transformer on synthetic data generated according to Assumption 5.1 , with x 1 , … , x N , x q \mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q x 1 , … , x N , x q independently and uniformly sampled from the unit sphere, and y 1 , … , y N y_1,\ldots,y_N y 1 , … , y N sampled as independent Rademacher variables. For each run, we sample fresh training instances independently, use the stochastic positional encoding procedure described in § 3.2 , and evaluate the trained model on a separate test set. We independently sample this test set of size 1000 consisting of well-separated instances with distance margin γ = 0.1 \gamma= 0.1 γ = 0.1 via rejection sampling, and we report test accuracy on the K-NN problem for K = 1 , 3 , 5 K = 1, 3, 5 K = 1 , 3 , 5 . Test accuracy is computed as the fraction of test instances satisfying TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 ⋅ y ^ K > 0 \operatorname{TF}(\widehat{\mathbf{Z}}^{(K-1)}, \theta)_{d+1,-1} \cdot\widehat{y}_K > 0 TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 ⋅ y K > 0 .
To probe behavior beyond the theorem setup, we use random Gaussian initialization with variance 0.5 and SGD with batch size 1000 and learning rate 1, rather than zero initialization and exact gradient descent on the population loss. We train the model for 10000 online SGD iterations. Accordingly, these experiments should be interpreted as qualitative checks rather than as a direct numerical verification of Theorem 5.2 .
Loss convergence. We train the model under various configurations with d ∈ { 5 , 10 , 20 } d \in\{5, 10, 20\} d ∈ { 5 , 10 , 20 } and N ∈ { 20 , 40 } N \in\{20, 40\} N ∈ { 20 , 40 } . Figure 1 a shows that the training loss decreases consistently across all tested configurations, with all curves displaying stable downward trends over training.
Figure 1. Training loss, learned parameter heatmap, and test accuracy. The heatmap and test accuracy are shown for the trained transformer with d = 10 d = 10 d = 10 and N = 20 N = 20 N = 20 .
Learned parameter structure. We plot a heatmap of the learned matrix W \mathbf{W} W after 10000 iterations for d = 10 d = 10 d = 10 and N = 20 N = 20 N = 20 . As shown in Figure 1 b, most entries of W \mathbf{W} W are close to zero except for the diagonal entries in the top-left block and the bottom-right block, matching the qualitative block structure predicted by Theorem 5.2 . The top-left diagonal entries are positive, while the bottom-right entry is negative, and the magnitude ratio is close to the theoretical value.
Test accuracy. We set d = 10 d = 10 d = 10 and N = 20 N = 20 N = 20 , and plot test accuracy against the number of training iterations. As shown in Figure 1 c, the CoT accuracy for K = 1 , 3 , 5 K = 1,3,5 K = 1 , 3 , 5 approaches 1 on the test distribution by the end of training. For comparison, we also train direct-inference baselines for K = 3 K = 3 K = 3 and K = 5 K = 5 K = 5 . For each K K K , we train a separate transformer with the same architecture and optimization setup, but supervise it to predict the corresponding final K K K -NN target state q ( K ) = [ x q T , ∑ i = 1 K y π ( i ) , p N + 1 T + ∑ i = 1 K p π ( i ) T ] q^{(K)} = [x_q^{\mathsf{T}}, \sum_{i=1}^{K} y_{\pi(i)}, p_{N+1}^{\mathsf{T}} + \sum_{i=1}^{K} p_{\pi(i)}^{\mathsf{T}}] q ( K ) = [ x q T , ∑ i = 1 K y π ( i ) , p N + 1 T + ∑ i = 1 K p π ( i ) T ] directly from the initial input in a single forward pass. Despite being trained specifically for each value of K K K , these direct-inference baselines achieve substantially lower test accuracy than their CoT counterparts for both K = 3 K = 3 K = 3 and K = 5 K = 5 K = 5 (Figure 1 c). These results suggest that CoT enables a sequential retrieval mechanism for K K K -NN prediction that generalizes across reasoning depths, while direct inference appears substantially less effective for K ≥ 3 K \ge3 K ≥ 3 . We further examine direct inference under a larger context size and with multi-head and multi-layer architectures in Appendix § 13 .§ 2 .
Conclusions and Limitations
This paper gives a concrete theoretical example in which CoT changes what a one-layer transformer can do in context. Without CoT, we show that direct inference fails for odd K-NN on a well-separated class of binary classification tasks. In contrast, a one-layer transformer admits an explicit construction for solving the K-NN problem via CoT. We further show that, in a stylized population-loss training setting with one-step state supervision, gradient descent converges to the same sharp-attention parameter pattern underlying this construction.
The contribution of the paper is primarily theoretical rather than empirical. Our analysis is based on a simplified transformer architecture, frozen V \mathbf{V} V in the training theorem, synthetic data, and population-loss arguments. These choices make the problem tractable and allow us to isolate the role of intermediate reasoning steps, but they also limit how directly the results transfer to practical large-scale transformers. Extending this analysis to richer transformer blocks, less symmetric data models, and finite-sample training remains an important direction for future work.
Proof of Proposition 3.2
Proof. Fix arbitrary finite matrices V , W ∈ R D × D \mathbf{V},\mathbf{W} \in\mathbb{R}^{D \times D} V , W ∈ R D × D , a realization of p 1 , … , p N + 1 \mathbf{p}_1,\ldots,\mathbf{p}_{N+1} p 1 , … , p N + 1 , and 0 < γ ≤ 2 N + K + 1 0 < \gamma\le\frac{2}{N + K + 1} 0 < γ ≤ N + K + 1 2 . We prove that the one-layer transformer (2) cannot be correct on all instances in X γ \mathcal{X}_{\gamma} X γ . Fix x q ∈ S d − 1 \mathbf{x}_q \in\mathbb{S}^{d-1} x q ∈ S d − 1 , and choose a unit vector u ⊥ x q \mathbf{u} \perp\mathbf{x}_q u ⊥ x q . For t ∈ ( − 1 , 1 ) t \in(-1,1) t ∈ ( − 1 , 1 ) , define
x ( t ) = t x q + 1 − t 2 u . \mathbf{x}(t) = t\mathbf{x}_q + \sqrt{1-t^2}\,\mathbf{u}. x ( t ) = t x q + 1 − t 2 u .
Then x ( t ) ∈ S d − 1 \mathbf{x}(t) \in\mathbb{S}^{d-1} x ( t ) ∈ S d − 1 and
∥ x ( t ) − x q ∥ 2 = 2 − 2 t . \lVert\mathbf{x}(t) - \mathbf{x}_q \rVert^2 = 2 - 2t. ∥ x ( t ) − x q ∥ 2 = 2 − 2 t .
Thus larger t t t corresponds to smaller distance from x q \mathbf{x}_q x q .
For each context position i i i , write
h i ( t , y ) = [ x ( t ) y p i ] , y ∈ { ± 1 } . \mathbf{h}_i(t,y) =
\begin{bmatrix}
\mathbf{x}(t) \\
y \\
\mathbf{p}_i
\end{bmatrix},
\qquad y \in\{\pm1\}. h i ( t , y ) = x ( t ) y p i , y ∈ { ± 1 } .
For an input with x i = x ( t i ) x_i = x(t_i) x i = x ( t i ) , the single-pass last-column label prediction is
\operatorname{TF}(\mathbf{Z}^{(0)},\theta)_{d+1,-1} =
\frac{e^{(\mathbf{q}^{(0)})^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}[\mathbf{V}\mathbf{q}^{(0)}]_{d+1}+\sum_{i=1}^{N}e^{\mathbf{h}_i(t_i,y_i)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{h}_i(t_i,y_i)]_{d+1}}
{e^{(\mathbf{q}^{(0)})^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)} }+\sum_{i=1}^{N}e^{\mathbf{h}_i(t_i,y_i)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}}.}
The denominator is strictly positive. Hence the sign of TF ( Z ( 0 ) , θ ) d + 1 , − 1 \operatorname{TF}(\mathbf{Z}^{(0)},\theta)_{d+1,-1} TF ( Z ( 0 ) , θ ) d + 1 , − 1 is the sign of the numerator.
For y ∈ { ± 1 } y \in\{ \pm1 \} y ∈ { ± 1 } , define
A i ( t ) = e h i ( t , 1 ) T W q ( 0 ) [ V h i ( t , 1 ) ] d + 1 + e h i ( t , − 1 ) T W q ( 0 ) [ V h i ( t , − 1 ) ] d + 1 2 . A_i(t) = \frac{e^{\mathbf{h}_i(t,1)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{h}_i(t,1)]_{d+1}+e^{\mathbf{h}_i(t,-1)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{h}_i(t,-1)]_{d+1}}{2}. A i ( t ) = 2 e h i ( t , 1 ) T W q ( 0 ) [ V h i ( t , 1 ) ] d + 1 + e h i ( t , − 1 ) T W q ( 0 ) [ V h i ( t , − 1 ) ] d + 1 .
and
B i ( t ) = e h i ( t , 1 ) T W q ( 0 ) [ V h i ( t , 1 ) ] d + 1 − e h i ( t , − 1 ) T W q ( 0 ) [ V h i ( t , − 1 ) ] d + 1 2 . B_i(t) = \frac{e^{\mathbf{h}_i(t,1)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{h}_i(t,1)]_{d+1}-e^{\mathbf{h}_i(t,-1)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{h}_i(t,-1)]_{d+1}}{2}. B i ( t ) = 2 e h i ( t , 1 ) T W q ( 0 ) [ V h i ( t , 1 ) ] d + 1 − e h i ( t , − 1 ) T W q ( 0 ) [ V h i ( t , − 1 ) ] d + 1 .
Then
e h i ( t , y ) T W q ( 0 ) [ V h i ( t , y ) ] d + 1 = A i ( t ) + B i ( t ) y . e^{\mathbf{h}_i(t,y)^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{h}_i(t,y)]_{d+1} = A_i(t) + B_i(t)y. e h i ( t , y ) T W q ( 0 ) [ V h i ( t , y ) ] d + 1 = A i ( t ) + B i ( t ) y .
Therefore, on this restricted family of inputs, the prediction has sign
sign ( A ( t 1 , … , t N ) + ∑ i = 1 N B i ( t i ) y i ) . \operatorname{sign}\left(A(t_1,\ldots,t_N)+\sum_{i=1}^{N}B_i(t_i)y_i\right). sign ( A ( t 1 , … , t N ) + i = 1 ∑ N B i ( t i ) y i ) .
where
A ( t 1 , … , t N ) = e ( q ( 0 ) ) T W q ( 0 ) [ V q ( 0 ) ] d + 1 + ∑ i = 1 N A i ( t i ) A(t_1,\ldots,t_N)=e^{(\mathbf{q}^{(0)})^{\mathsf{T}}\mathbf{W}\mathbf{q}^{(0)}}[\mathbf{V}\mathbf{q}^{(0)}]_{d+1}+\sum_{i=1}^{N}A_i(t_i) A ( t 1 , … , t N ) = e ( q ( 0 ) ) T W q ( 0 ) [ V q ( 0 ) ] d + 1 + i = 1 ∑ N A i ( t i )
is independent of the labels.
We now switch to distance coordinates. If
d i = ∥ x ( t i ) − x q ∥ , d_i=\lVert\mathbf{x}(t_i)-\mathbf{x}_q\rVert, d i = ∥ x ( t i ) − x q ∥ ,
then
t i = 1 − d i 2 2 . t_i=1-\frac{d_i^2}{2}. t i = 1 − 2 d i 2 .
For notational simplicity, write B i ( d i ) B_i(d_i) B i ( d i ) for B i ( 1 − d i 2 / 2 ) B_i(1-d_i^2/2) B i ( 1 − d i 2 /2 ) , and similarly write A ( d 1 , … , d N ) A(d_1,\ldots,d_N) A ( d 1 , … , d N ) . Thus the prediction has sign
sign ( A ( d 1 , … , d N ) + ∑ i = 1 N B i ( d i ) y i ) . \operatorname{sign}\left(A(d_1,\ldots,d_N)+\sum_{i=1}^{N}B_i(d_i)y_i\right). sign ( A ( d 1 , … , d N ) + i = 1 ∑ N B i ( d i ) y i ) .
Assume for contradiction that the fixed matrices V , W \mathbf{V},\mathbf{W} V , W are correct for every instance in X γ \mathcal{X}_\gamma X γ . Fix any distance configuration with strict ordering, and let S S S be the set of the K K K closest indices. Since K K K is odd, the KNN target is
sign ( ∑ i ∈ S y i ) ∈ { ± 1 } . \operatorname{sign}\left(\sum_{i\in S}y_i\right)\in\{\pm1\}. sign ( i ∈ S ∑ y i ) ∈ { ± 1 } .
Let
R = ∑ j ∉ S ∣ B j ( d j ) ∣ . R = \sum_{j \notin S} |B_j(d_j)|. R = j ∈ / S ∑ ∣ B j ( d j ) ∣.
For correctness under all choices of the outside labels, the following conditions are necessary:
∑ i ∈ S y i > 0 ⟹ A ( d 1 , … , d N ) + ∑ i ∈ S B i ( d i ) y i > R . \sum_{i \in S} y_i > 0 \quad\Longrightarrow\quad A(d_1,\ldots,d_N) + \sum_{i \in S} B_i(d_i)y_i > R. i ∈ S ∑ y i > 0 ⟹ A ( d 1 , … , d N ) + i ∈ S ∑ B i ( d i ) y i > R .
and
∑ i ∈ S y i < 0 ⟹ A ( d 1 , … , d N ) + ∑ i ∈ S B i ( d i ) y i < − R . \sum_{i \in S} y_i < 0 \quad\Longrightarrow\quad A(d_1,\ldots,d_N) + \sum_{i \in S} B_i(d_i)y_i < -R. i ∈ S ∑ y i < 0 ⟹ A ( d 1 , … , d N ) + i ∈ S ∑ B i ( d i ) y i < − R .
Indeed, the outside labels contribute
∑ j ∉ S B j ( d j ) y j , \sum_{j \notin S} B_j(d_j)y_j, j ∈ / S ∑ B j ( d j ) y j ,
whose possible perturbation has magnitude at most R R R . The inequalities are strict because sign ( 0 ) = 0 \operatorname{sign}(0) = 0 sign ( 0 ) = 0 , while the KNN target is ± 1 \pm1 ± 1 .
We first record two consequences of these necessary conditions. First, for every r ∈ S r \in S r ∈ S ,
B r ( d r ) > R . B_r(d_r) > R. B r ( d r ) > R .
To prove this, choose labels on S ∖ { r } S \setminus\{r\} S ∖ { r } such that
∑ i ∈ S ∖ { r } y i = 0 , \sum_{i \in S \setminus\{r\}} y_i = 0, i ∈ S ∖ { r } ∑ y i = 0 ,
which is possible because K − 1 K - 1 K − 1 is even. Keeping these labels fixed, the KNN target is + 1 +1 + 1 when y r = + 1 y_r = +1 y r = + 1 , and − 1 -1 − 1 when y r = − 1 y_r = -1 y r = − 1 . Hence
A + ∑ i ∈ S ∖ { r } B i ( d i ) y i + B r ( d r ) > R , A + \sum_{i \in S \setminus\{r\}} B_i(d_i)y_i + B_r(d_r) > R, A + i ∈ S ∖ { r } ∑ B i ( d i ) y i + B r ( d r ) > R ,
and
A + ∑ i ∈ S ∖ { r } B i ( d i ) y i − B r ( d r ) < − R . A + \sum_{i \in S \setminus\{r\}} B_i(d_i)y_i - B_r(d_r) < -R. A + i ∈ S ∖ { r } ∑ B i ( d i ) y i − B r ( d r ) < − R .
Subtracting the second inequality from the first gives
B r ( d r ) > R . B_r(d_r) > R. B r ( d r ) > R .
Second, let
m = K + 1 2 . m = \frac{K+1}{2}. m = 2 K + 1 .
For every P ⊂ S P \subset S P ⊂ S with ∣ P ∣ = m |P| = m ∣ P ∣ = m , one has
∑ i ∈ P B i ( d i ) − ∑ i ∈ S ∖ P B i ( d i ) > R + ∣ A ( d 1 , … , d N ) ∣ . \sum_{i \in P} B_i(d_i) - \sum_{i \in S \setminus P} B_i(d_i) > R + |A(d_1,\ldots,d_N)|. i ∈ P ∑ B i ( d i ) − i ∈ S ∖ P ∑ B i ( d i ) > R + ∣ A ( d 1 , … , d N ) ∣.
Indeed, set y i = + 1 y_i = +1 y i = + 1 for i ∈ P i \in P i ∈ P and y i = − 1 y_i = -1 y i = − 1 for i ∈ S ∖ P i \in S \setminus P i ∈ S ∖ P . Since ∣ P ∣ = m |P| = m ∣ P ∣ = m and ∣ S ∖ P ∣ = m − 1 |S \setminus P| = m - 1 ∣ S ∖ P ∣ = m − 1 , the top-K K K label sum equals 1. Therefore,
A + ∑ i ∈ P B i ( d i ) − ∑ i ∈ S ∖ P B i ( d i ) > R . A+\sum_{i\in P} B_i(d_i)-\sum_{i\in S\setminus P} B_i(d_i)>R. A + i ∈ P ∑ B i ( d i ) − i ∈ S ∖ P ∑ B i ( d i ) > R .
Flipping all top-K K K labels gives target − 1 -1 − 1 , so
A − ∑ i ∈ P B i ( d i ) + ∑ i ∈ S ∖ P B i ( d i ) < − R . A-\sum_{i\in P} B_i(d_i)+\sum_{i\in S\setminus P} B_i(d_i)<-R. A − i ∈ P ∑ B i ( d i ) + i ∈ S ∖ P ∑ B i ( d i ) < − R .
Combining these two inequalities gives
∑ i ∈ P B i ( d i ) − ∑ i ∈ S ∖ P B i ( d i ) > R + ∣ A ( d 1 , … , d N ) ∣ . \sum_{i\in P} B_i(d_i)-\sum_{i\in S\setminus P} B_i(d_i)>R+\lvert A(d_1,\ldots,d_N)\rvert. i ∈ P ∑ B i ( d i ) − i ∈ S ∖ P ∑ B i ( d i ) > R + ∣ A ( d 1 , … , d N )∣ .
We now construct fixed-margin configurations leading to a contradiction. Choose disjoint index sets L , P ⊂ [ N ] L,P\subset[N] L , P ⊂ [ N ] such that
∣ L ∣ = m − 1 , ∣ P ∣ = m . \lvert L\rvert=m-1,\qquad\lvert P\rvert=m. ∣ L ∣ = m − 1 , ∣ P ∣ = m .
This is possible because
∣ L ∣ + ∣ P ∣ = 2 m − 1 = K ≤ N − 2 < N . \lvert L\rvert+\lvert P\rvert=2m-1=K\le N-2<N. ∣ L ∣ + ∣ P ∣ = 2 m − 1 = K ≤ N − 2 < N .
First define a distance configuration in which L ∪ P L\cup P L ∪ P is exactly the top-K K K set. Enumerate
L = { ℓ 1 , … , ℓ m − 1 } , P = { p 1 , … , p m } . L=\{\ell_1,\ldots,\ell_{m-1}\},\qquad P=\{p_1,\ldots,p_m\}. L = { ℓ 1 , … , ℓ m − 1 } , P = { p 1 , … , p m } .
Assign
d ℓ r = ( K + r ) γ , r = 1 , … , m − 1 , d_{\ell_r}=(K+r)\gamma,\qquad r=1,\ldots,m-1, d ℓ r = ( K + r ) γ , r = 1 , … , m − 1 ,
and
d p s = ( K + m − 1 + s ) γ , s = 1 , … , m . d_{p_s}=(K+m-1+s)\gamma,\qquad s=1,\ldots,m. d p s = ( K + m − 1 + s ) γ , s = 1 , … , m .
Thus the P P P -indices are farther than the L L L -indices. Assign the remaining N − K N-K N − K indices distances
( 2 K + 1 ) γ , ( 2 K + 2 ) γ , … , ( 2 K + N − K ) γ . (2K+1)\gamma,\ (2K+2)\gamma,\ \ldots,\ (2K+N-K)\gamma. ( 2 K + 1 ) γ , ( 2 K + 2 ) γ , … , ( 2 K + N − K ) γ .
All pairwise distance gaps are at least γ \gamma γ . The largest distance used is
( 2 K + N − K ) γ = ( N + K ) γ ≤ 2 − γ . (2K+N-K)\gamma=(N+K)\gamma\le2-\gamma. ( 2 K + N − K ) γ = ( N + K ) γ ≤ 2 − γ .
Hence this is a valid instance in X γ \mathcal{X}_\gamma X γ . In this configuration, the top-K K K set is L ∪ P L\cup P L ∪ P . Applying the balance consequence to the subset P ⊂ L ∪ P P\subset L\cup P P ⊂ L ∪ P gives
∑ p ∈ P B p ( d p ) > ∑ ℓ ∈ L B ℓ ( d ℓ ) . (6) \sum_{p\in P}B_p(d_p)>\sum_{\ell\in L}B_\ell(d_\ell). \tag*{(6)} p ∈ P ∑ B p ( d p ) > ℓ ∈ L ∑ B ℓ ( d ℓ ) . (6)
Applying the dominance consequence to each top-K K K index gives
B i ( d i ) > 0 , i ∈ L ∪ P . (7) B_i(d_i)>0,\qquad i\in L\cup P. \tag*{(7)} B i ( d i ) > 0 , i ∈ L ∪ P . (7)
In particular,
B p ( d p ) > 0 , p ∈ P . (8) B_p(d_p) > 0, \qquad p \in P. \tag*{(8)} B p ( d p ) > 0 , p ∈ P . (8)
Next we cover P P P by subsets associated with indices in L L L . Since N − K ≥ 2 N-K \ge2 N − K ≥ 2 ,
∣ L ∣ ( N − K ) = ( m − 1 ) ( N − K ) ≥ 2 ( m − 1 ) ≥ m = ∣ P ∣ , |L|(N-K) = (m-1)(N-K) \ge2(m-1) \ge m = |P|, ∣ L ∣ ( N − K ) = ( m − 1 ) ( N − K ) ≥ 2 ( m − 1 ) ≥ m = ∣ P ∣ ,
where the last inequality uses m ≥ 2 m \ge2 m ≥ 2 . Hence, for each ℓ ∈ L \ell\in L ℓ ∈ L , we may choose a subset T ℓ ⊆ P T_\ell\subseteq P T ℓ ⊆ P such that
∣ T ℓ ∣ ≤ N − K |T_\ell| \le N-K ∣ T ℓ ∣ ≤ N − K
and
⋃ ℓ ∈ L T ℓ = P . (9) \bigcup_{\ell\in L} T_\ell= P. \tag*{(9)} ℓ ∈ L ⋃ T ℓ = P . (9)
Now fix ℓ ∈ L \ell\in L ℓ ∈ L . We construct another fixed-margin distance configuration. Keep token ℓ \ell ℓ at the same distance d ℓ d_\ell d ℓ , and keep every token p ∈ T ℓ p \in T_\ell p ∈ T ℓ at the same distance d p d_p d p . Choose any K − 1 K-1 K − 1 indices from
[ N ] ∖ ( { ℓ } ∪ T ℓ ) , [N] \setminus(\{\ell\} \cup T_\ell), [ N ] ∖ ({ ℓ } ∪ T ℓ ) ,
which is possible because
N − 1 − ∣ T ℓ ∣ ≥ N − 1 − ( N − K ) = K − 1. N-1-|T_\ell| \ge N-1-(N-K) = K-1. N − 1 − ∣ T ℓ ∣ ≥ N − 1 − ( N − K ) = K − 1.
Assign these K − 1 K-1 K − 1 indices the distances
d ℓ − γ , d ℓ − 2 γ , … , d ℓ − ( K − 1 ) γ . d_\ell-\gamma,\ d_\ell-2\gamma,\ \ldots,\ d_\ell-(K-1)\gamma. d ℓ − γ , d ℓ − 2 γ , … , d ℓ − ( K − 1 ) γ .
These distances are positive because the smallest possible value of d ℓ d_\ell d ℓ is ( K + 1 ) γ (K+1)\gamma ( K + 1 ) γ , and hence
d ℓ − ( K − 1 ) γ ≥ 2 γ > 0. d_\ell-(K-1)\gamma\ge2\gamma> 0. d ℓ − ( K − 1 ) γ ≥ 2 γ > 0.
Assign all remaining indices distances
( 2 K + 1 ) γ , ( 2 K + 2 ) γ , … (2K+1)\gamma,\ (2K+2)\gamma,\ \ldots ( 2 K + 1 ) γ , ( 2 K + 2 ) γ , …
using consecutive increments of γ \gamma γ . This configuration also has all pairwise distance gaps at least γ \gamma γ . Its largest distance is at most
( N + K ) γ ≤ 2 − γ . (N+K)\gamma\le2-\gamma. ( N + K ) γ ≤ 2 − γ .
Therefore it also belongs to X γ \mathcal{X}_\gamma X γ . In this configuration, token ℓ \ell ℓ is exactly the K K K -th nearest neighbor, and every token p ∈ T ℓ p \in T_\ell p ∈ T ℓ lies outside the top-K K K set because d p > d ℓ d_p > d_\ell d p > d ℓ . Applying the dominance consequence to token ℓ \ell ℓ gives
B ℓ ( d ℓ ) > ∑ p ∈ T ℓ ∣ B p ( d p ) ∣ . B_\ell(d_\ell) > \sum_{p \in T_\ell} |B_p(d_p)|. B ℓ ( d ℓ ) > p ∈ T ℓ ∑ ∣ B p ( d p ) ∣.
Here the distances of the tokens p ∈ T ℓ p \in T_\ell p ∈ T ℓ are kept equal to the same values d p d_p d p used in the first configuration. Hence the coefficient values B p ( d p ) B_p(d_p) B p ( d p ) are the same as those in (A.3). By (A.3), B p ( d p ) > 0 B_p(d_p)>0 B p ( d p ) > 0 for every p ∈ P p\in P p ∈ P , and therefore
B ℓ ( d ℓ ) > ∑ p ∈ T ℓ B p ( d p ) . (10) B_\ell(d_\ell)>\sum_{p\in T_\ell}B_p(d_p). \tag*{(10)} B ℓ ( d ℓ ) > p ∈ T ℓ ∑ B p ( d p ) . (10)
Summing (A.5) over all ℓ ∈ L \ell\in L ℓ ∈ L yields
∑ ℓ ∈ L B ℓ ( d ℓ ) > ∑ ℓ ∈ L ∑ p ∈ T ℓ B p ( d p ) . \sum_{\ell\in L}B_\ell(d_\ell)>\sum_{\ell\in L}\sum_{p\in T_\ell}B_p(d_p). ℓ ∈ L ∑ B ℓ ( d ℓ ) > ℓ ∈ L ∑ p ∈ T ℓ ∑ B p ( d p ) .
By the covering property (A.4) and positivity (A.3),
∑ ℓ ∈ L ∑ p ∈ T ℓ B p ( d p ) ≥ ∑ p ∈ P B p ( d p ) . \sum_{\ell\in L}\sum_{p\in T_\ell}B_p(d_p)\geq\sum_{p\in P}B_p(d_p). ℓ ∈ L ∑ p ∈ T ℓ ∑ B p ( d p ) ≥ p ∈ P ∑ B p ( d p ) .
Therefore,
∑ ℓ ∈ L B ℓ ( d ℓ ) > ∑ p ∈ P B p ( d p ) . (11) \sum_{\ell\in L}B_\ell(d_\ell)>\sum_{p\in P}B_p(d_p). \tag*{(11)} ℓ ∈ L ∑ B ℓ ( d ℓ ) > p ∈ P ∑ B p ( d p ) . (11)
This contradicts (A.1).
Thus the assumption that the fixed matrices V , W \mathbf{V},\mathbf{W} V , W are correct on all instances in X γ \mathcal{X}_\gamma X γ is false.
Consequently, for every finite V , W \mathbf{V},\mathbf{W} V , W , there exists an instance in X γ \mathcal{X}_\gamma X γ such that
sign ( TF ( Z ( 0 ) , θ ) d + 1 , − 1 ) ≠ sign ( ∑ k = 1 K y π ( k ) ) . \operatorname{sign}\left(\operatorname{TF}(Z^{(0)},\theta)_{d+1,-1}\right)\ne\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right). sign ( TF ( Z ( 0 ) , θ ) d + 1 , − 1 ) = sign ( k = 1 ∑ K y π ( k ) ) .
This proves the proposition.
Proof of Theorem 4.1
Proof. We first prove the following stronger vector-valued statement of Lemma 4.3. By the sequential characterization of limits, it suffices to show that for every sequence ( α n , β n ) n ≥ 1 (\alpha_n,\beta_n)_{n\geq1} ( α n , β n ) n ≥ 1 such that α n → + ∞ \alpha_n\to+\infty α n → + ∞ , β n → − ∞ \beta_n\to-\infty β n → − ∞ , and − β n / α n → 2 -\beta_n/\alpha_n\to2 − β n / α n → 2 , one has
TF ( Z ^ n ( K − 1 ) , θ n ) : , − 1 − q ( K ) → 0 a.s. \operatorname{TF}\left(\widehat{Z}_n^{(K-1)},\theta_n\right)_{:,-1}-\mathbf{q}^{(K)}\to0\quad\text{a.s.} TF ( Z n ( K − 1 ) , θ n ) : , − 1 − q ( K ) → 0 a.s.
where
q ( K ) = [ x τ T , ∑ k = 1 K y π ( k ) , p N + 1 T + ∑ k = 1 K p π ( k ) T ] T . \mathbf{q}^{(K)}=\left[\mathbf{x}_{\tau}^{\mathsf{T}},\sum_{k=1}^{K}y_{\pi(k)},\mathbf{p}_{N+1}^{\mathsf{T}}+\sum_{k=1}^{K}\mathbf{p}_{\pi(k)}^{\mathsf{T}}\right]^{\mathsf{T}}. q ( K ) = [ x τ T , k = 1 ∑ K y π ( k ) , p N + 1 T + k = 1 ∑ K p π ( k ) T ] T .
Fix such a sequence ( α n , β n ) n ≥ 1 (\alpha_n,\beta_n)_{n\geq1} ( α n , β n ) n ≥ 1 . For each n n n , define
W n : = diag ( α n I d , 0 , β n I N + 1 ) , θ n : = ( V , W n ) , \mathbf{W}_n:=\operatorname{diag}(\alpha_n I_d,0,\beta_n I_{N+1}),\qquad\theta_n:=(\mathbf{V},\mathbf{W}_n), W n := diag ( α n I d , 0 , β n I N + 1 ) , θ n := ( V , W n ) ,
where V = diag ( 0 , 1 , I N + 1 ) \mathbf{V}=\operatorname{diag}(0,1,I_{N+1}) V = diag ( 0 , 1 , I N + 1 ) . Define the append-style rollout recursively by
q ^ n ( 0 ) : = q ( 0 ) , Z ^ n ( 0 ) : = Z ( 0 ) = [ H , q ( 0 ) ] , \widehat{\mathbf{q}}_n^{(0)}:=\mathbf{q}^{(0)},\qquad\widehat{\mathbf{Z}}_n^{(0)}:=\mathbf{Z}^{(0)}=[\mathbf{H},\mathbf{q}^{(0)}], q n ( 0 ) := q ( 0 ) , Z n ( 0 ) := Z ( 0 ) = [ H , q ( 0 ) ] ,
and, for r ≥ 1 r\geq1 r ≥ 1 ,
q ^ n ( r ) : = TF ( Z ^ n ( r − 1 ) , θ n ) : , − 1 , Z ^ n ( r ) : = [ H , q ^ n ( 0 ) , q ^ n ( 1 ) , … , q ^ n ( r ) ] . (12) \widehat{\mathbf{q}}_n^{(r)}:=\operatorname{TF}\left(\widehat{\mathbf{Z}}_n^{(r-1)},\theta_n\right)_{:,-1},\qquad\widehat{\mathbf{Z}}_n^{(r)}:=[\mathbf{H},\widehat{\mathbf{q}}_n^{(0)},\widehat{\mathbf{q}}_n^{(1)},\ldots,\widehat{\mathbf{q}}_n^{(r)}]. \tag*{(12)} q n ( r ) := TF ( Z n ( r − 1 ) , θ n ) : , − 1 , Z n ( r ) := [ H , q n ( 0 ) , q n ( 1 ) , … , q n ( r ) ] . (12)
Thus, in particular,
q ^ n ( K ) = TF ( Z ^ n ( K − 1 ) , θ n ) : , − 1 . \widehat{\mathbf{q}}_{n}^{(K)}=\operatorname{TF}(\widehat{\mathbf{Z}}_{n}^{(K-1)},\theta_n)_{:,-1}. q n ( K ) = TF ( Z n ( K − 1 ) , θ n ) : , − 1 .
For r = 0 , … , K r=0,\ldots,K r = 0 , … , K , write
q ( r ) = [ x q ∑ m = 1 n y π ( m ) p N + 1 + ∑ m = 1 r p π ( m ) ] . (13) \mathbf{q}^{(r)}=
\begin{bmatrix}
\mathbf{x}_q\\
\sum_{m=1}^{n}y_{\pi(m)}\\
\mathbf{p}_{N+1}+\sum_{m=1}^{r}\mathbf{p}_{\pi(m)}
\end{bmatrix}. \tag*{(13)} q ( r ) = x q ∑ m = 1 n y π ( m ) p N + 1 + ∑ m = 1 r p π ( m ) . (13)
We now establish the convergence through four lemmas.
Lemma B.1. For every r ≥ 0 r\ge0 r ≥ 0 and every n n n ,
( q ^ n ( r ) ) x = x q . \left(\widehat{\mathbf{q}}_{n}^{(r)}\right)_x=\mathbf{x}_q. ( q n ( r ) ) x = x q .
Proof. We prove by induction on r r r . For r = 0 r=0 r = 0 , by definition,
q ^ n ( 0 ) = q ( 0 ) = [ x q 0 p N + 1 ] , \widehat{\mathbf{q}}_{n}^{(0)}=\mathbf{q}^{(0)}=
\begin{bmatrix}
\mathbf{x}_q\\
0\\
\mathbf{p}_{N+1}
\end{bmatrix}, q n ( 0 ) = q ( 0 ) = x q 0 p N + 1 ,
so ( q ^ n ( 0 ) ) x = x q \left(\widehat{\mathbf{q}}_{n}^{(0)}\right)_x=\mathbf{x}_q ( q n ( 0 ) ) x = x q .
Assume now that ( q ^ n ( r − 1 ) ) x = x q \left(\widehat{\mathbf{q}}_{n}^{(r-1)}\right)_x=\mathbf{x}_q ( q n ( r − 1 ) ) x = x q . Using the transformer formula,
q ^ n ( r ) = q ^ n ( r − 1 ) + ( V Z ^ n ( r − 1 ) ) softmax ( ( Z ^ n ( r − 1 ) ) T W n ( Z ^ n ( r − 1 ) ) : , − 1 ) . \widehat{\mathbf{q}}_{n}^{(r)}
=
\widehat{\mathbf{q}}_{n}^{(r-1)}
+
\left(\mathbf{V}\widehat{\mathbf{Z}}_{n}^{(r-1)}\right)\operatorname{softmax}\left(\left(\widehat{\mathbf{Z}}_{n}^{(r-1)}\right)^{\mathsf{T}}\mathbf{W}_n\left(\widehat{\mathbf{Z}}_{n}^{(r-1)}\right)_{:,-1}\right). q n ( r ) = q n ( r − 1 ) + ( V Z n ( r − 1 ) ) softmax ( ( Z n ( r − 1 ) ) T W n ( Z n ( r − 1 ) ) : , − 1 ) .
Since the x x x -row block of V = diag ( 0 , 1 , I N + 1 ) \mathbf{V}=\operatorname{diag}(0,1,\mathbf{I}_{N+1}) V = diag ( 0 , 1 , I N + 1 ) is identically zero, the additive attention correction has zero x x x -block. Hence
( q ^ n ( r ) ) x = ( q ^ n ( r − 1 ) ) x = x q . \left(\widehat{\mathbf{q}}_{n}^{(r)}\right)_x
=
\left(\widehat{\mathbf{q}}_{n}^{(r-1)}\right)_x
=
\mathbf{x}_q. ( q n ( r ) ) x = ( q n ( r − 1 ) ) x = x q .
This completes the induction. □ \square □
Lemma B.2. For every 0 ≤ r ≤ K 0\le r\le K 0 ≤ r ≤ K and every n n n ,
∣ ( q ^ n ( r ) ) y ∣ ≤ 2 r − 1 , ∥ ( q ^ n ( r ) ) p ∥ ≤ 2 r . \left|\left(\widehat{\mathbf{q}}_{n}^{(r)}\right)_y\right|\le2^r-1,
\qquad
\left\|\left(\widehat{\mathbf{q}}_{n}^{(r)}\right)_p\right\|\le2^r. ( q n ( r ) ) y ≤ 2 r − 1 , ( q n ( r ) ) p ≤ 2 r .
Proof. We prove the two bounds simultaneously by induction on r r r . For r = 0 r=0 r = 0 , by definition,
q ^ n ( 0 ) = q ( 0 ) = [ x q 0 p N + 1 ] . \widehat{\mathbf{q}}_{n}^{(0)}=\mathbf{q}^{(0)}=
\begin{bmatrix}
\mathbf{x}_q\\
0\\
\mathbf{p}_{N+1}
\end{bmatrix}. q n ( 0 ) = q ( 0 ) = x q 0 p N + 1 .
Therefore
∣ ( q ^ n ( 0 ) ) y ∣ = 0 = 2 0 − 1 , ∥ ( q ^ n ( 0 ) ) p ∥ = ∥ p N + 1 ∥ = 1 = 2 0 . \left|\left(\widehat{\mathbf{q}}_{n}^{(0)}\right)_y\right|=0=2^0-1,
\qquad
\left\|\left(\widehat{\mathbf{q}}_{n}^{(0)}\right)_p\right\|
=
\left\|\mathbf{p}_{N+1}\right\|
=
1=2^0. ( q n ( 0 ) ) y = 0 = 2 0 − 1 , ( q n ( 0 ) ) p = ∥ p N + 1 ∥ = 1 = 2 0 .
Assume that the claim holds at depth r − 1 r-1 r − 1 , where r ≥ 1 r\ge1 r ≥ 1 . Let
a n ( r ) : = softmax ( ( Z ^ n ( r − 1 ) ) T W n ( Z ^ n ( r − 1 ) ) : , − 1 ) . \mathbf{a}_{n}^{(r)}:=\operatorname{softmax}\left(\left(\widehat{\mathbf{Z}}_{n}^{(r-1)}\right)^{\mathsf{T}}\mathbf{W}_n\left(\widehat{\mathbf{Z}}_{n}^{(r-1)}\right)_{:,-1}\right). a n ( r ) := softmax ( ( Z n ( r − 1 ) ) T W n ( Z n ( r − 1 ) ) : , − 1 ) .
Then
q ^ n ( r ) = q ^ n ( r − 1 ) + ( V Z ^ n ( r − 1 ) ) a n ( r ) . \widehat{\mathbf{q}}_{n}^{(r)}
=
\widehat{\mathbf{q}}_{n}^{(r-1)}
+
\left(\mathbf{V}\widehat{\mathbf{Z}}_{n}^{(r-1)}\right)\mathbf{a}_{n}^{(r)}. q n ( r ) = q n ( r − 1 ) + ( V Z n ( r − 1 ) ) a n ( r ) .
For the y y y -block, we may write
( q ^ n ( r ) ) y = ( q ^ n ( r − 1 ) ) y + ∑ j a j , n ( r ) y j , n c t x , (\widehat{\mathbf{q}}_n^{(r)})_y = (\widehat{\mathbf{q}}_n^{(r-1)})_y + \sum_j a_{j,n}^{(r)} y_{j,n}^{\mathrm{ctx}}, ( q n ( r ) ) y = ( q n ( r − 1 ) ) y + j ∑ a j , n ( r ) y j , n ctx ,
where y j , n c t x y_{j,n}^{\mathrm{ctx}} y j , n ctx denotes the y y y -block of the j j j -th context token in Z ^ n ( r − 1 ) \widehat{Z}_n^{(r-1)} Z n ( r − 1 ) . Each context token is either an original token h i h_i h i , whose y y y -block equals y i y_i y i and hence has magnitude at most 1, or a previously generated token q ^ n ( m ) \widehat{\mathbf{q}}_n^{(m)} q n ( m ) with m ≤ r − 1 m \le r-1 m ≤ r − 1 , whose y y y -block has magnitude at most 2 r − 1 − 1 2^{r-1}-1 2 r − 1 − 1 by the induction hypothesis. Therefore
∣ y j , n c t x ∣ ≤ max { 1 , 2 r − 1 − 1 } ≤ 2 r − 1 for every j . \left|y_{j,n}^{\mathrm{ctx}}\right| \le\max\{1,2^{r-1}-1\} \le2^{r-1} \qquad\text{for every }j. y j , n ctx ≤ max { 1 , 2 r − 1 − 1 } ≤ 2 r − 1 for every j .
Since a n ( r ) \mathbf{a}_n^{(r)} a n ( r ) is a probability vector,
∣ ∑ j a j , n ( r ) y j , n c t x ∣ ≤ ∑ j a j , n ( r ) 2 r − 1 = 2 r − 1 . \left|\sum_j a_{j,n}^{(r)}y_{j,n}^{\mathrm{ctx}}\right| \le\sum_j a_{j,n}^{(r)}2^{r-1}=2^{r-1}. j ∑ a j , n ( r ) y j , n ctx ≤ j ∑ a j , n ( r ) 2 r − 1 = 2 r − 1 .
Using the induction hypothesis,
∣ ( q ^ n ( r − 1 ) ) y ∣ ≤ 2 r − 1 − 1 , \left|(\widehat{\mathbf{q}}_n^{(r-1)})_y\right| \le2^{r-1}-1, ( q n ( r − 1 ) ) y ≤ 2 r − 1 − 1 ,
we obtain
∣ ( q ^ n ( r ) ) y ∣ ≤ 2 r − 1 − 1 + 2 r − 1 = 2 r − 1. \left|(\widehat{\mathbf{q}}_n^{(r)})_y\right| \le2^{r-1}-1+2^{r-1}=2^r-1. ( q n ( r ) ) y ≤ 2 r − 1 − 1 + 2 r − 1 = 2 r − 1.
For the p p p -block, similarly,
( q ^ n ( r ) ) p = ( q ^ n ( r − 1 ) ) p + ∑ j a j , n ( r ) p j , n c t x , (\widehat{\mathbf{q}}_n^{(r)})_p = (\widehat{\mathbf{q}}_n^{(r-1)})_p + \sum_j a_{j,n}^{(r)}p_{j,n}^{\mathrm{ctx}}, ( q n ( r ) ) p = ( q n ( r − 1 ) ) p + j ∑ a j , n ( r ) p j , n ctx ,
where p j , n c t x p_{j,n}^{\mathrm{ctx}} p j , n ctx denotes the p p p -block of the j j j -th context token. Each context token is either an original token h i h_i h i , whose p p p -block is p i \mathbf{p}_i p i and has norm 1, or a previously generated token q ^ n ( m ) \widehat{\mathbf{q}}_n^{(m)} q n ( m ) with m ≤ r − 1 m \le r-1 m ≤ r − 1 , whose p p p -block has norm at most 2 r − 1 2^{r-1} 2 r − 1 by the induction hypothesis. Hence
∥ p j , n c t x ∥ ≤ max { 1 , 2 r − 1 } = 2 r − 1 for every j , \left\|p_{j,n}^{\mathrm{ctx}}\right\| \le\max\{1,2^{r-1}\}=2^{r-1} \qquad\text{for every }j, p j , n ctx ≤ max { 1 , 2 r − 1 } = 2 r − 1 for every j ,
and therefore
∥ ∑ j a j , n ( r ) p j , n c t x ∥ ≤ ∑ j a j , n ( r ) 2 r − 1 = 2 r − 1 . \left\|\sum_j a_{j,n}^{(r)}p_{j,n}^{\mathrm{ctx}}\right\| \le\sum_j a_{j,n}^{(r)}2^{r-1}=2^{r-1}. j ∑ a j , n ( r ) p j , n ctx ≤ j ∑ a j , n ( r ) 2 r − 1 = 2 r − 1 .
Using the induction hypothesis once more,
∥ ( q ^ n ( r − 1 ) ) p ∥ ≤ 2 r − 1 , \left\|(\widehat{\mathbf{q}}_n^{(r-1)})_p\right\| \le2^{r-1}, ( q n ( r − 1 ) ) p ≤ 2 r − 1 ,
we conclude
∥ ( q ^ n ( r ) ) p ∥ ≤ 2 r − 1 + 2 r − 1 = 2 r . \left\|(\widehat{\mathbf{q}}_n^{(r)})_p\right\| \le2^{r-1}+2^{r-1}=2^r. ( q n ( r ) ) p ≤ 2 r − 1 + 2 r − 1 = 2 r .
This completes the induction.
□ \square □
Lemma B.3. Fix s ∈ { 1 , … , K } s \in\{1,\ldots,K\} s ∈ { 1 , … , K } . Let
Ω ∗ : = { x π ( 1 ) T x q > ⋯ > x π ( N ) T x q } ∩ { x π ( r ) T x q > − 1 for all 1 ≤ r ≤ K } . \Omega_* := \left\{\mathbf{x}_{\pi(1)}^{\mathsf{T}}\mathbf{x}_q > \cdots> \mathbf{x}_{\pi(N)}^{\mathsf{T}}\mathbf{x}_q\right\} \cap\left\{\mathbf{x}_{\pi(r)}^{\mathsf{T}}\mathbf{x}_q > -1 \text{ for all } 1 \le r \le K\right\}. Ω ∗ := { x π ( 1 ) T x q > ⋯ > x π ( N ) T x q } ∩ { x π ( r ) T x q > − 1 for all 1 ≤ r ≤ K } . On Ω ∗ \Omega_* Ω ∗ , define
Δ s : = { min j ∈ [ N ] ∖ { π ( 1 ) , … , π ( s ) } ( x π ( s ) T x q − x j T x q ) , s < N , 1 , s = N . \Delta_s := \begin{cases}
\min_{j\in[N]\setminus\{\pi(1),\ldots,\pi(s)\}}\left(\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q-\mathbf{x}_j^{\mathsf{T}}\mathbf{x}_q\right), & s<N,\\
1, & s=N.
\end{cases} Δ s := { min j ∈ [ N ] ∖ { π ( 1 ) , … , π ( s )} ( x π ( s ) T x q − x j T x q ) , 1 , s < N , s = N . Then Δ s > 0 \Delta_s>0 Δ s > 0 and 1 + x π ( s ) T x q > 0 1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q>0 1 + x π ( s ) T x q > 0 .
Assume that
q ^ n ( m ) → q ( m ) \widehat{\mathbf{q}}_n^{(m)} \to\mathbf{q}^{(m)} q n ( m ) → q ( m ) for every 0 ≤ m ≤ s − 1 0\le m\le s-1 0 ≤ m ≤ s − 1 .
Then on Ω ∗ \Omega_* Ω ∗ ,
q ^ n ( s ) → q ( s ) . \widehat{\mathbf{q}}_n^{(s)} \to\mathbf{q}^{(s)}. q n ( s ) → q ( s ) .
Proof. We work pointwise on Ω ∗ \Omega_* Ω ∗ . At inference step s s s , the current input is
Z ^ n ( s − 1 ) = [ H , q ^ n ( 0 ) , q ^ n ( 1 ) , … , q ^ n ( s − 1 ) ] , \widehat{\mathbf{Z}}_n^{(s-1)}=\left[\mathbf{H},\widehat{\mathbf{q}}_n^{(0)},\widehat{\mathbf{q}}_n^{(1)},\ldots,\widehat{\mathbf{q}}_n^{(s-1)}\right], Z n ( s − 1 ) = [ H , q n ( 0 ) , q n ( 1 ) , … , q n ( s − 1 ) ] ,
and the query token is the last token q ^ n ( s − 1 ) \widehat{\mathbf{q}}_n^{(s-1)} q n ( s − 1 ) .
Step 1: exact score formulas.
For an original token h i \mathbf{h}_i h i , the score at step s s s is
s ^ i , n ( s ) = α n x i T x q + β n p i T ( q ^ n ( s − 1 ) ) p . (14) \widehat{s}_{i,n}^{(s)}=\alpha_n\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q+\beta_n\mathbf{p}_i^{\mathsf{T}}\left(\widehat{\mathbf{q}}_n^{(s-1)}\right)_p. \tag*{(14)} s i , n ( s ) = α n x i T x q + β n p i T ( q n ( s − 1 ) ) p . (14)
For a previously generated token q ^ n ( m ) \widehat{\mathbf{q}}_n^{(m)} q n ( m ) with 0 ≤ m ≤ s − 1 0\le m\le s-1 0 ≤ m ≤ s − 1 , the score is
s ^ m , n ( s ) = α n + β n ⟨ ( q ^ n ( m ) ) p , ( q ^ n ( s − 1 ) ) p ⟩ . (15) \widehat{s}_{m,n}^{(s)}=\alpha_n+\beta_n\left\langle\left(\widehat{\mathbf{q}}_n^{(m)}\right)_p,\left(\widehat{\mathbf{q}}_n^{(s-1)}\right)_p\right\rangle. \tag*{(15)} s m , n ( s ) = α n + β n ⟨ ( q n ( m ) ) p , ( q n ( s − 1 ) ) p ⟩ . (15)
These identities follow directly from the block form
W n = diag ( α n I d , 0 , β n I N + 1 ) , \mathbf{W}_n=\operatorname{diag}(\alpha_n\mathbf{I}_d,0,\beta_n\mathbf{I}_{N+1}), W n = diag ( α n I d , 0 , β n I N + 1 ) ,
together with Lemma B.1, which implies that every generated token has x x x -block exactly equal to x q \mathbf{x}_q x q .
Step 2: normalized score limits.
Define
σ ^ i , n ( s ) : = s ^ i , n ( s ) α n ( i ∈ [ N ] ) , σ ^ m , n ( s ) : = s ^ m , n ( s ) α n ( 0 ≤ m ≤ s − 1 ) . \widehat{\sigma}_{i,n}^{(s)}:=\frac{\widehat{s}_{i,n}^{(s)}}{\alpha_n}\quad(i\in[N]),\qquad
\widehat{\sigma}_{m,n}^{(s)}:=\frac{\widehat{s}_{m,n}^{(s)}}{\alpha_n}\quad(0\le m\le s-1). σ i , n ( s ) := α n s i , n ( s ) ( i ∈ [ N ]) , σ m , n ( s ) := α n s m , n ( s ) ( 0 ≤ m ≤ s − 1 ) .
Using (B.3),
σ ^ i , n ( s ) = x i T x q − ( β n α n ) p i T ( q ^ n ( s − 1 ) ) p . \widehat{\sigma}_{i,n}^{(s)}=\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q-\left(\frac{\beta_n}{\alpha_n}\right)\mathbf{p}_i^{\mathsf{T}}\left(\widehat{\mathbf{q}}_n^{(s-1)}\right)_p. σ i , n ( s ) = x i T x q − ( α n β n ) p i T ( q n ( s − 1 ) ) p .
By the induction hypothesis,
( q ^ n ( s − 1 ) ) p → p N + 1 + ∑ r = 1 s − 1 p π ( r ) . \left(\widehat{\mathbf{q}}_n^{(s-1)}\right)_p\to\mathbf{p}_{N+1}+\sum_{r=1}^{s-1}\mathbf{p}_{\pi(r)}. ( q n ( s − 1 ) ) p → p N + 1 + r = 1 ∑ s − 1 p π ( r ) .
Since the signed one-hot vectors are orthonormal,
p i T ( p N + 1 + ∑ r = 1 s − 1 p π ( r ) ) = { 1 , i ∈ { π ( 1 ) , … , π ( s − 1 ) } , 0 , i ∉ { π ( 1 ) , … , π ( s − 1 ) } . \mathbf{p}_i^{\mathsf{T}}\left(\mathbf{p}_{N+1}+\sum_{r=1}^{s-1}\mathbf{p}_{\pi(r)}\right)=
\begin{cases}
1, & i\in\{\pi(1),\ldots,\pi(s-1)\},\\
0, & i\notin\{\pi(1),\ldots,\pi(s-1)\}.
\end{cases} p i T ( p N + 1 + r = 1 ∑ s − 1 p π ( r ) ) = { 1 , 0 , i ∈ { π ( 1 ) , … , π ( s − 1 )} , i ∈ / { π ( 1 ) , … , π ( s − 1 )} .
Together with − β n / α n → 2 -\beta_n/\alpha_n\to2 − β n / α n → 2 , this implies
σ ^ i , n ( s ) → { x i T x q − 2 , i ∈ { π ( 1 ) , … , π ( s − 1 ) } , x i T x q , i ∉ { π ( 1 ) , … , π ( s − 1 ) } . (16) \hat{\sigma}_{i,n}^{(s)}\to
\begin{cases}
\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q-2, & i\in\{\pi(1),\ldots,\pi(s-1)\},\\
\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q, & i\notin\{\pi(1),\ldots,\pi(s-1)\}.
\end{cases} \tag*{(16)} σ ^ i , n ( s ) → { x i T x q − 2 , x i T x q , i ∈ { π ( 1 ) , … , π ( s − 1 )} , i ∈ / { π ( 1 ) , … , π ( s − 1 )} . (16)
In particular, since π ( s ) ∉ { π ( 1 ) , … , π ( s − 1 ) } \pi(s)\notin\{\pi(1),\ldots,\pi(s-1)\} π ( s ) ∈ / { π ( 1 ) , … , π ( s − 1 )} ,
σ ^ π ( s ) , n ( s ) → x π ( s ) T x q . (17) \hat{\sigma}_{\pi(s),n}^{(s)}\to\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q. \tag*{(17)} σ ^ π ( s ) , n ( s ) → x π ( s ) T x q . (17)
For 0 ≤ m ≤ s − 1 0\le m\le s-1 0 ≤ m ≤ s − 1 , using (B.4),
σ ^ m , n ( s ) = 1 − ( − β n α n ) ⟨ ( q ^ n ( m ) ) p , ( q ^ n ( s − 1 ) ) p ⟩ . \hat{\sigma}_{m,n}^{(s)}=1-\left(-\frac{\beta_n}{\alpha_n}\right)\left\langle(\widehat{\mathbf{q}}_n^{(m)})_p,(\widehat{\mathbf{q}}_n^{(s-1)})_p\right\rangle. σ ^ m , n ( s ) = 1 − ( − α n β n ) ⟨ ( q n ( m ) ) p , ( q n ( s − 1 ) ) p ⟩ .
Again by the induction hypothesis,
( q ^ n ( m ) ) p → p N + 1 + ∑ r = 1 m p π ( r ) , ( q ^ n ( s − 1 ) ) p → p N + 1 + ∑ r = 1 s − 1 p π ( r ) . (\widehat{\mathbf{q}}_n^{(m)})_p\to\mathbf{p}_{N+1}+\sum_{r=1}^{m}\mathbf{p}_{\pi(r)},\qquad
(\widehat{\mathbf{q}}_n^{(s-1)})_p\to\mathbf{p}_{N+1}+\sum_{r=1}^{s-1}\mathbf{p}_{\pi(r)}. ( q n ( m ) ) p → p N + 1 + r = 1 ∑ m p π ( r ) , ( q n ( s − 1 ) ) p → p N + 1 + r = 1 ∑ s − 1 p π ( r ) .
Since
⟨ p N + 1 + ∑ r = 1 m p π ( r ) , p N + 1 + ∑ r = 1 s − 1 p π ( r ) ⟩ = m + 1 , \left\langle\mathbf{p}_{N+1}+\sum_{r=1}^{m}\mathbf{p}_{\pi(r)},\mathbf{p}_{N+1}+\sum_{r=1}^{s-1}\mathbf{p}_{\pi(r)}\right\rangle=m+1, ⟨ p N + 1 + r = 1 ∑ m p π ( r ) , p N + 1 + r = 1 ∑ s − 1 p π ( r ) ⟩ = m + 1 ,
we obtain
σ ^ m , n ( s ) → 1 − 2 ( m + 1 ) = − ( 2 m + 1 ) . (18) \hat{\sigma}_{m,n}^{(s)}\to1-2(m+1)=-(2m+1). \tag*{(18)} σ ^ m , n ( s ) → 1 − 2 ( m + 1 ) = − ( 2 m + 1 ) . (18)
Step 3: deterministic margin separation. We compare the limiting normalized score x π ( s ) T x q \mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q x π ( s ) T x q of the desired token with every competitor.
If j ∈ [ N ] ∖ { π ( 1 ) , … , π ( s ) } j\in[N]\setminus\{\pi(1),\ldots,\pi(s)\} j ∈ [ N ] ∖ { π ( 1 ) , … , π ( s )} , then j ≠ π ( s ) j\ne\pi(s) j = π ( s ) , and by definition of Δ s \Delta_s Δ s ,
x π ( s ) T x q − x j T x q ≥ Δ s > 0. \mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q-\mathbf{x}_j^{\mathsf{T}}\mathbf{x}_q\ge\Delta_s>0. x π ( s ) T x q − x j T x q ≥ Δ s > 0.
If j ∈ { π ( 1 ) , … , π ( s − 1 ) } j\in\{\pi(1),\ldots,\pi(s-1)\} j ∈ { π ( 1 ) , … , π ( s − 1 )} , then by (B.5),
x π ( s ) T x q − ( x j T x q − 2 ) = 2 + x π ( s ) T x q − x j T x q ≥ 1 + x π ( s ) T x q > 0. \mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q-\left(\mathbf{x}_j^{\mathsf{T}}\mathbf{x}_q-2\right)
=2+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q-\mathbf{x}_j^{\mathsf{T}}\mathbf{x}_q
\ge1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q>0. x π ( s ) T x q − ( x j T x q − 2 ) = 2 + x π ( s ) T x q − x j T x q ≥ 1 + x π ( s ) T x q > 0.
If 0 ≤ m ≤ s − 1 0\le m\le s-1 0 ≤ m ≤ s − 1 , then by (B.7),
x π ( s ) T x q − ( − ( 2 m + 1 ) ) = x π ( s ) T x q + 2 m + 1 ≥ 1 + x π ( s ) T x q > 0. \mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q-\left(-(2m+1)\right)
=\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q+2m+1
\ge1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q>0. x π ( s ) T x q − ( − ( 2 m + 1 ) ) = x π ( s ) T x q + 2 m + 1 ≥ 1 + x π ( s ) T x q > 0.
Thus every competitor lies at least
min { Δ s , 1 + x π ( s ) T x q } \min\left\{\Delta_s,\,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\} min { Δ s , 1 + x π ( s ) T x q }
below the desired token at the level of limiting normalized scores. Since there are only finitely many competitors, (B.5) and (B.7) imply that there exists N s N_s N s such that for all n ≥ N s n \ge N_s n ≥ N s ,
σ ^ π ( s ) , n ( s ) − σ ^ j , n ( s ) ≥ 1 2 min { Δ s , 1 + x π ( s ) T x q } (19) \widehat{\sigma}^{(s)}_{\pi(s),n}-\widehat{\sigma}^{(s)}_{j,n}\ge\frac{1}{2}\min\left\{\Delta_s,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\} \tag*{(19)} σ π ( s ) , n ( s ) − σ j , n ( s ) ≥ 2 1 min { Δ s , 1 + x π ( s ) T x q } (19)
for every competitor j ≠ π ( s ) j\ne\pi(s) j = π ( s ) .
Multiplying by α n \alpha_n α n , we obtain
s ^ π ( s ) , n ( s ) − s ^ j , n ( s ) ≥ α n 2 min { Δ s , 1 + x π ( s ) T x q } (20) \widehat{s}^{(s)}_{\pi(s),n}-\widehat{s}^{(s)}_{j,n}\ge\frac{\alpha_n}{2}\min\left\{\Delta_s,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\} \tag*{(20)} s π ( s ) , n ( s ) − s j , n ( s ) ≥ 2 α n min { Δ s , 1 + x π ( s ) T x q } (20)
for every competitor j ≠ π ( s ) j\ne\pi(s) j = π ( s ) .
Step 4: softmax concentration. Let a j , n ( s ) a^{(s)}_{j,n} a j , n ( s ) denote the step-s s s attention weights on the context tokens of Z ^ n ( s − 1 ) \widehat{\mathbf{Z}}^{(s-1)}_n Z n ( s − 1 ) . By the softmax formula and (B.9),
1 − a π ( s ) , n ( s ) = ∑ j ≠ π ( s ) e s ^ j , n ( s ) − s ^ π ( s ) , n ( s ) 1 + ∑ j ≠ π ( s ) e s ^ j , n ( s ) − s ^ π ( s ) , n ( s ) ≤ ( N + s ) exp ( − α n 2 min { Δ s , 1 + x π ( s ) T x q } ) . 1-a^{(s)}_{\pi(s),n}=\frac{\sum_{j\ne\pi(s)}e^{\widehat{s}^{(s)}_{j,n}-\widehat{s}^{(s)}_{\pi(s),n}}}{1+\sum_{j\ne\pi(s)}e^{\widehat{s}^{(s)}_{j,n}-\widehat{s}^{(s)}_{\pi(s),n}}}\le(N+s)\exp\left(-\frac{\alpha_n}{2}\min\left\{\Delta_s,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\}\right). 1 − a π ( s ) , n ( s ) = 1 + ∑ j = π ( s ) e s j , n ( s ) − s π ( s ) , n ( s ) ∑ j = π ( s ) e s j , n ( s ) − s π ( s ) , n ( s ) ≤ ( N + s ) exp ( − 2 α n min { Δ s , 1 + x π ( s ) T x q } ) .
In particular,
a j , n ( s ) ≤ exp ( − α n 2 min { Δ s , 1 + x π ( s ) T x q } ) ( j ≠ π ( s ) ) . (21) a^{(s)}_{j,n}\le\exp\left(-\frac{\alpha_n}{2}\min\left\{\Delta_s,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\}\right)\qquad(j\ne\pi(s)). \tag*{(21)} a j , n ( s ) ≤ exp ( − 2 α n min { Δ s , 1 + x π ( s ) T x q } ) ( j = π ( s )) . (21)
Hence
a π ( s ) , n ( s ) → 1 , a j , n ( s ) → 0 ( j ≠ π ( s ) ) . (22) a^{(s)}_{\pi(s),n}\to1,\qquad a^{(s)}_{j,n}\to0\quad(j\ne\pi(s)). \tag*{(22)} a π ( s ) , n ( s ) → 1 , a j , n ( s ) → 0 ( j = π ( s )) . (22)
Step 5: convergence of the output token. The output token satisfies
q ^ n ( s ) = q ^ n ( s − 1 ) + ( V Z ^ n ( s − 1 ) ) a n ( s ) . \widehat{\mathbf{q}}^{(s)}_n=\widehat{\mathbf{q}}^{(s-1)}_n+\left(V\widehat{\mathbf{Z}}^{(s-1)}_n\right)a^{(s)}_n. q n ( s ) = q n ( s − 1 ) + ( V Z n ( s − 1 ) ) a n ( s ) .
The x x x -block is exact by Lemma B.1. We therefore only need to treat the y y y - and p p p -blocks.
For the y y y -block,
( q ^ n ( s ) ) y = ( q ^ n ( s − 1 ) ) y + a π ( s ) , n ( s ) y π ( s ) + ∑ j ≠ π ( s ) a j , n ( s ) y j , n c t x . \left(\widehat{\mathbf{q}}^{(s)}_n\right)_y=\left(\widehat{\mathbf{q}}^{(s-1)}_n\right)_y+a^{(s)}_{\pi(s),n}\mathbf{y}_{\pi(s)}+\sum_{j\ne\pi(s)}a^{(s)}_{j,n}\mathbf{y}^{\mathsf{ctx}}_{j,n}. ( q n ( s ) ) y = ( q n ( s − 1 ) ) y + a π ( s ) , n ( s ) y π ( s ) + j = π ( s ) ∑ a j , n ( s ) y j , n ctx .
By the induction hypothesis,
( q ^ n ( s − 1 ) ) y → ∑ i = 1 s − 1 y π ( i ) , \left(\widehat{\mathbf{q}}^{(s-1)}_n\right)_y\to\sum_{i=1}^{s-1}\mathbf{y}_{\pi(i)}, ( q n ( s − 1 ) ) y → i = 1 ∑ s − 1 y π ( i ) ,
and by (B.11),
a π ( s ) , n ( s ) y π ( s ) → y π ( s ) . a^{(s)}_{\pi(s),n}\mathbf{y}_{\pi(s)}\to\mathbf{y}_{\pi(s)}. a π ( s ) , n ( s ) y π ( s ) → y π ( s ) .
By Lemma B.2, every competitor context token has y y y -block magnitude at most 2 s − 1 2^{s-1} 2 s − 1 . Therefore, using (B.10),
∣ ∑ j ≠ π ( s ) a j , n ( s ) y j , n c t x ∣ ≤ ( N + s ) 2 s − 1 exp ( − α n 2 min { Δ s , 1 + x π ( s ) T x q } ) → 0. \left|\sum_{j\ne\pi(s)}a^{(s)}_{j,n}\mathbf{y}^{\mathsf{ctx}}_{j,n}\right|\le(N+s)2^{s-1}\exp\left(-\frac{\alpha_n}{2}\min\left\{\Delta_s,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\}\right)\to0. j = π ( s ) ∑ a j , n ( s ) y j , n ctx ≤ ( N + s ) 2 s − 1 exp ( − 2 α n min { Δ s , 1 + x π ( s ) T x q } ) → 0.
Thus
( q ^ n ( s ) ) y → ∑ i = 1 s − 1 y π ( i ) + y π ( s ) = ∑ i = 1 s y π ( i ) . \left(\widehat{\mathbf{q}}^{(s)}_n\right)_y\to\sum_{i=1}^{s-1}\mathbf{y}_{\pi(i)}+\mathbf{y}_{\pi(s)}=\sum_{i=1}^{s}\mathbf{y}_{\pi(i)}. ( q n ( s ) ) y → i = 1 ∑ s − 1 y π ( i ) + y π ( s ) = i = 1 ∑ s y π ( i ) .
For the p p p -block,
( q ^ n ( s ) ) p = ( q ^ n ( s − 1 ) ) p + a π ( s ) , n ( s ) p π ( s ) + ∑ j ≠ π ( s ) a j , n ( s ) p j , n c t x . (\widehat{\mathbf{q}}_n^{(s)})_p=(\widehat{\mathbf{q}}_n^{(s-1)})_p+a_{\pi(s),n}^{(s)}\mathbf{p}_{\pi(s)}+\sum_{j\ne\pi(s)}a_{j,n}^{(s)}\mathbf{p}_{j,n}^{\mathrm{ctx}}. ( q n ( s ) ) p = ( q n ( s − 1 ) ) p + a π ( s ) , n ( s ) p π ( s ) + j = π ( s ) ∑ a j , n ( s ) p j , n ctx .
By the induction hypothesis,
( q ^ n ( s − 1 ) ) p → p N + 1 + ∑ r = 1 s − 1 p π ( r ) . (\widehat{\mathbf{q}}_n^{(s-1)})_p\to\mathbf{p}_{N+1}+\sum_{r=1}^{s-1}\mathbf{p}_{\pi(r)}. ( q n ( s − 1 ) ) p → p N + 1 + r = 1 ∑ s − 1 p π ( r ) .
and by (B.11),
a π ( s ) , n ( s ) p π ( s ) → p π ( s ) . a_{\pi(s),n}^{(s)}\mathbf{p}_{\pi(s)}\to\mathbf{p}_{\pi(s)}. a π ( s ) , n ( s ) p π ( s ) → p π ( s ) .
Again by Lemma B.2, every competitor context token has p p p -block norm at most 2 s − 1 2^{s-1} 2 s − 1 . Hence
∥ ∑ j ≠ π ( s ) a j , n ( s ) p j , n c t x ∥ ≤ ( N + s ) 2 s − 1 exp ( − α n 2 min { Δ s , 1 + x π ( s ) T x q } ) → 0. \left\|\sum_{j\ne\pi(s)}a_{j,n}^{(s)}\mathbf{p}_{j,n}^{\mathrm{ctx}}\right\|
\le(N+s)2^{s-1}\exp\left(-\frac{\alpha_n}{2}\min\left\{\Delta_s,1+\mathbf{x}_{\pi(s)}^{\mathsf{T}}\mathbf{x}_q\right\}\right)\to0. j = π ( s ) ∑ a j , n ( s ) p j , n ctx ≤ ( N + s ) 2 s − 1 exp ( − 2 α n min { Δ s , 1 + x π ( s ) T x q } ) → 0.
Therefore
( q ^ n ( s ) ) p → p N + 1 + ∑ r = 1 s p π ( r ) . (\widehat{\mathbf{q}}_n^{(s)})_p\to\mathbf{p}_{N+1}+\sum_{r=1}^{s}\mathbf{p}_{\pi(r)}. ( q n ( s ) ) p → p N + 1 + r = 1 ∑ s p π ( r ) .
Combining the x x x -, y y y -, and p p p -block conclusions gives
q ^ n ( s ) → q ( s ) . \widehat{\mathbf{q}}_n^{(s)}\to\mathbf{q}^{(s)}. q n ( s ) → q ( s ) .
This proves the lemma.
Lemma B.4. Under the assumptions of Theorem 4.1 ,
q ^ n ( K ) − q ( K ) → 0 a.s. \widehat{\mathbf{q}}_n^{(K)}-\mathbf{q}^{(K)}\to0\quad\text{a.s.} q n ( K ) − q ( K ) → 0 a.s. Equivalently,
TF ( Z ^ n ( K − 1 ) , θ n ) : , − 1 − q ( K ) → 0 a.s. \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)},\boldsymbol{\theta}_n)_{:,-1}-\mathbf{q}^{(K)}\to0\quad\text{a.s.} TF ( Z n ( K − 1 ) , θ n ) : , − 1 − q ( K ) → 0 a.s.
Proof. Under the assumptions of Theorem 4.1 , we have
∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 a.s. , \|\mathbf{x}_q-\mathbf{x}_{\pi(1)}\|<\cdots<\|\mathbf{x}_q-\mathbf{x}_{\pi(N)}\|<2\quad\text{a.s.}, ∥ x q − x π ( 1 ) ∥ < ⋯ < ∥ x q − x π ( N ) ∥ < 2 a.s. ,
and, since x i , x q ∈ S d − 1 \mathbf{x}_i,\mathbf{x}_q\in S^{d-1} x i , x q ∈ S d − 1 , the identity
∥ x q − x i ∥ 2 = 2 − 2 x i T x q \|\mathbf{x}_q-\mathbf{x}_i\|^2=2-2\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q ∥ x q − x i ∥ 2 = 2 − 2 x i T x q
implies
x π ( 1 ) T x q > ⋯ > x π ( N ) T x q > − 1 a.s. \mathbf{x}_{\pi(1)}^{\mathsf{T}}\mathbf{x}_q>\cdots>\mathbf{x}_{\pi(N)}^{\mathsf{T}}\mathbf{x}_q>-1\quad\text{a.s.} x π ( 1 ) T x q > ⋯ > x π ( N ) T x q > − 1 a.s.
Hence P ( Ω ∗ ) = 1 \mathbb{P}(\Omega_*)=1 P ( Ω ∗ ) = 1 . By definition,
q ^ n ( 0 ) = q ( 0 ) for all n . \widehat{\mathbf{q}}_n^{(0)}=\mathbf{q}^{(0)}\qquad\text{for all }n. q n ( 0 ) = q ( 0 ) for all n .
Applying Lemma B.3 successively for s = 1 , 2 , … , K s=1,2,\ldots,K s = 1 , 2 , … , K , we obtain
q ^ n ( r ) → q ( r ) for every 0 ≤ r ≤ K \widehat{\mathbf{q}}_n^{(r)}\to\mathbf{q}^{(r)}\qquad\text{for every }0\le r\le K q n ( r ) → q ( r ) for every 0 ≤ r ≤ K
on Ω ∗ \Omega_* Ω ∗ . Since P ( Ω ∗ ) = 1 \mathbb{P}(\Omega_*) = 1 P ( Ω ∗ ) = 1 , this holds almost surely. In particular,
q ^ n ( K ) → q ( K ) almost surely . \widehat{\mathbf{q}}_n^{(K)} \to\mathbf{q}^{(K)} \quad\text{almost surely}. q n ( K ) → q ( K ) almost surely .
The equivalent statement follows from the definition
q ^ n ( K ) = TF ( Z ^ n ( K − 1 ) , θ n ) : , − 1 . \widehat{\mathbf{q}}_n^{(K)} = \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{:,-1}. q n ( K ) = TF ( Z n ( K − 1 ) , θ n ) : , − 1 .
□ \square □
By Lemma B.4, for every sequence ( α n , β n ) n ≥ 1 (\alpha_n,\beta_n)_{n\geq1} ( α n , β n ) n ≥ 1 such that
α n → + ∞ , β n → − ∞ , − β n / α n → 2 , \alpha_n \to+\infty,\qquad\beta_n \to-\infty,\qquad-\beta_n/\alpha_n \to2, α n → + ∞ , β n → − ∞ , − β n / α n → 2 ,
we have
TF ( Z ^ n ( K − 1 ) , θ n ) : , − 1 − q ( K ) → 0 a.s. \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{:,-1} - \mathbf{q}^{(K)} \to0 \quad\text{a.s.} TF ( Z n ( K − 1 ) , θ n ) : , − 1 − q ( K ) → 0 a.s.
Taking the ( d + 1 ) (d+1) ( d + 1 ) -st coordinate yields
TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 − ( q ( K ) ) d + 1 → 0 a.s. \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{d+1,-1} - \left(\mathbf{q}^{(K)}\right)_{d+1} \to0 \quad\text{a.s.} TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 − ( q ( K ) ) d + 1 → 0 a.s.
By the definition of q ( K ) \mathbf{q}^{(K)} q ( K ) ,
( q ( K ) ) d + 1 = ∑ k = 1 K y π ( k ) . \left(\mathbf{q}^{(K)}\right)_{d+1} = \sum_{k=1}^{K} y_{\pi(k)}. ( q ( K ) ) d + 1 = k = 1 ∑ K y π ( k ) .
Hence
TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 − ∑ k = 1 K y π ( k ) → 0 a.s. \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{d+1,-1} - \sum_{k=1}^{K} y_{\pi(k)} \to0 \quad\text{a.s.} TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 − k = 1 ∑ K y π ( k ) → 0 a.s.
Since
y ^ K = sign ( ∑ k = 1 K y π ( k ) ) , \widehat{y}_K = \operatorname{sign}\left(\sum_{k=1}^{K} y_{\pi(k)}\right), y K = sign ( k = 1 ∑ K y π ( k ) ) ,
it follows that
1 { TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 ⋅ y ^ K < 0 } → 0 a.s. \mathbf{1}\left\{\operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{d+1,-1}\cdot\widehat{y}_K < 0\right\} \to0 \quad\text{a.s.} 1 { TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 ⋅ y K < 0 } → 0 a.s.
Indeed, if ∑ k = 1 K y π ( k ) = 0 \sum_{k=1}^{K} y_{\pi(k)} = 0 ∑ k = 1 K y π ( k ) = 0 , then y ^ K = 0 \widehat{y}_K = 0 y K = 0 , and the indicator above is identically zero for every n n n . If ∑ k = 1 K y π ( k ) > 0 \sum_{k=1}^{K} y_{\pi(k)} > 0 ∑ k = 1 K y π ( k ) > 0 , then
TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 → ∑ k = 1 K y π ( k ) > 0 a.s. , \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{d+1,-1} \to\sum_{k=1}^{K} y_{\pi(k)} > 0 \quad\text{a.s.}, TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 → k = 1 ∑ K y π ( k ) > 0 a.s. ,
so
TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 > 0 \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{d+1,-1} > 0 TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 > 0
for all sufficiently large n n n almost surely, and therefore
TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 ⋅ y ^ K < 0 \operatorname{TF}(\widehat{\mathbf{Z}}_n^{(K-1)}, \boldsymbol{\theta}_n)_{d+1,-1}\cdot\widehat{y}_K < 0 TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 ⋅ y K < 0
cannot occur for all sufficiently large n n n almost surely. The case ∑ k = 1 K y π ( k ) < 0 \sum_{k=1}^{K} y_{\pi(k)} < 0 ∑ k = 1 K y π ( k ) < 0 is analogous.
Since the indicator is bounded by 1, the dominated convergence theorem yields
P ( TF ( Z ^ n ( K − 1 ) , θ n ) d + 1 , − 1 ⋅ y ^ K < 0 ) → 0. \mathbb{P}\left(\operatorname{TF}(\widehat{Z}^{(K-1)}_n,\theta_n)_{d+1,-1}\cdot\widehat{y}_K<0\right)\to0. P ( TF ( Z n ( K − 1 ) , θ n ) d + 1 , − 1 ⋅ y K < 0 ) → 0.
Because the sequence ( α n , β n ) (\alpha_n,\beta_n) ( α n , β n ) was arbitrary, the sequential characterization of limits implies
P ( TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 ⋅ y ^ K < 0 ) → 0 \mathbb{P}\left(\operatorname{TF}(\widehat{Z}^{(K-1)},\theta)_{d+1,-1}\cdot\widehat{y}_K<0\right)\to0 P ( TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 ⋅ y K < 0 ) → 0
as α → + ∞ \alpha\to+\infty α → + ∞ , β → − ∞ \beta\to-\infty β → − ∞ , and − β / α → 2 -\beta/\alpha\to2 − β / α → 2 . This is exactly the statement of Theorem 4.1 .
Proof of Proposition 4.2
Proof. We use the same rollout notation as in the proof of Theorem 4.1 : q ^ ( r ) \widehat{\mathbf{q}}^{(r)} q ( r ) denotes the actual token generated at step r r r , Z ^ ( r ) \widehat{Z}^{(r)} Z ( r ) denotes the corresponding appended sequence, and q ( r ) \mathbf{q}^{(r)} q ( r ) denotes the ideal token,
q ( r ) = [ x q ∑ m = 1 r y π ( m ) p N + 1 + ∑ m = 1 r p π ( m ) ] , r = 0 , … , K . \mathbf{q}^{(r)}=
\begin{bmatrix}
\mathbf{x}_q\\
\sum_{m=1}^{r}y_{\pi(m)}\\
\mathbf{p}_{N+1}+\sum_{m=1}^{r}\mathbf{p}_{\pi(m)}
\end{bmatrix},
\qquad r=0,\ldots,K. q ( r ) = x q ∑ m = 1 r y π ( m ) p N + 1 + ∑ m = 1 r p π ( m ) , r = 0 , … , K .
We write ( ⋅ ) p (\cdot)_p ( ⋅ ) p for the positional block. Fix an arbitrary instance in X γ \mathcal{X}_\gamma X γ with ∑ k = 1 K y π ( k ) ≠ 0 \sum_{k=1}^{K}y_{\pi(k)}\ne0 ∑ k = 1 K y π ( k ) = 0 . We first convert the distance margin into an inner-product margin. Since x i , x q ∈ S d − 1 \mathbf{x}_i,\mathbf{x}_q\in\mathbb{S}^{d-1} x i , x q ∈ S d − 1 ,
x i T x q = 1 − ∥ x q − x i ∥ 2 2 . \mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q=1-\frac{\lVert\mathbf{x}_q-\mathbf{x}_i\rVert^2}{2}. x i T x q = 1 − 2 ∥ x q − x i ∥ 2 .
Let
d k : = ∥ x q − x π ( k ) ∥ , k = 1 , … , N . d_k:=\lVert\mathbf{x}_q-\mathbf{x}_{\pi(k)}\rVert,\qquad k=1,\ldots,N. d k := ∥ x q − x π ( k ) ∥ , k = 1 , … , N .
For k = 1 , … , N − 1 k=1,\ldots,N-1 k = 1 , … , N − 1 , the assumption d k + 1 − d k ≥ γ d_{k+1}-d_k\ge\gamma d k + 1 − d k ≥ γ implies
x π ( k ) T x q − x π ( k + 1 ) T x q = d k + 1 2 − d k 2 2 = ( d k + 1 − d k ) ( d k + 1 + d k ) 2 ≥ γ 2 2 . \mathbf{x}_{\pi(k)}^{\mathsf{T}}\mathbf{x}_q-\mathbf{x}_{\pi(k+1)}^{\mathsf{T}}\mathbf{x}_q
=\frac{d_{k+1}^2-d_k^2}{2}
=\frac{(d_{k+1}-d_k)(d_{k+1}+d_k)}{2}
\ge\frac{\gamma^2}{2}. x π ( k ) T x q − x π ( k + 1 ) T x q = 2 d k + 1 2 − d k 2 = 2 ( d k + 1 − d k ) ( d k + 1 + d k ) ≥ 2 γ 2 .
Moreover, 2 − d N ≥ γ 2-d_N\ge\gamma 2 − d N ≥ γ implies d N ≤ 2 − γ d_N\le2-\gamma d N ≤ 2 − γ , and hence
x π ( N ) T x q = 1 − d N 2 2 ≥ 1 − ( 2 − γ ) 2 2 = − 1 + 2 γ − γ 2 2 . \mathbf{x}_{\pi(N)}^{\mathsf{T}}\mathbf{x}_q
=1-\frac{d_N^2}{2}
\ge1-\frac{(2-\gamma)^2}{2}
=-1+2\gamma-\frac{\gamma^2}{2}. x π ( N ) T x q = 1 − 2 d N 2 ≥ 1 − 2 ( 2 − γ ) 2 = − 1 + 2 γ − 2 γ 2 .
Define
η γ : = min { γ 2 2 , 2 γ − γ 2 2 } . \eta_\gamma:=\min\left\{\frac{\gamma^2}{2},2\gamma-\frac{\gamma^2}{2}\right\}. η γ := min { 2 γ 2 , 2 γ − 2 γ 2 } .
If X γ \mathcal{X}_\gamma X γ is nonempty, then 0 < γ ≤ 2 0<\gamma\le2 0 < γ ≤ 2 , so η γ > 0 \eta_\gamma>0 η γ > 0 . Therefore,
x π ( k ) T x q − x π ( k + 1 ) T x q ≥ η γ , k = 1 , … , N − 1 , \mathbf{x}_{\pi(k)}^{\mathsf{T}}\mathbf{x}_q-\mathbf{x}_{\pi(k+1)}^{\mathsf{T}}\mathbf{x}_q\ge\eta_\gamma,\qquad k=1,\ldots,N-1, x π ( k ) T x q − x π ( k + 1 ) T x q ≥ η γ , k = 1 , … , N − 1 ,
and
x π ( N ) T x q ≥ − 1 + η γ . \mathbf{x}_{\pi(N)}^{\mathsf{T}}\mathbf{x}_q\ge-1+\eta_\gamma. x π ( N ) T x q ≥ − 1 + η γ .
The arguments proving Lemma (B.1) and Lemma (B.2) are purely algebraic and apply verbatim to every finite choice of ( α , β ) (\alpha,\beta) ( α , β ) . By Lemma (B.1), the feature block of every actual generated token equals x q \mathbf{x}_q x q . By Lemma (B.2), for all generated tokens up to depth K K K , the label block and positional block are bounded by constants depending only on K K K . Hence there exists B N , K > 0 B_{N,K}>0 B N , K > 0 , depending only on ( N , K ) (N,K) ( N , K ) , such that every token appearing in Z ^ ( r ) \widehat{\mathbf{Z}}^{(r)} Z ( r ) , 0 ≤ r ≤ K − 1 0\le r\le K-1 0 ≤ r ≤ K − 1 , and every original token has norm at most B N , K B_{N,K} B N , K .
Set
C N , K ′ : = 2 B N , K ( N + K ) . C'_{N,K}:=2B_{N,K}(N+K). C N , K ′ := 2 B N , K ( N + K ) .
We will prove by induction that
∥ q ^ ( r ) − q ( r ) ∥ ≤ C N , K e − α η γ / 8 , r = 0 , … , K , \left\|\widehat{\mathbf{q}}^{(r)}-\mathbf{q}^{(r)}\right\|\le C_{N,K}e^{-\alpha\eta\gamma/8},\qquad r=0,\ldots,K, q ( r ) − q ( r ) ≤ C N , K e − α η γ /8 , r = 0 , … , K ,
for a constant C N , K > 0 C_{N,K}>0 C N , K > 0 depending only on ( N , K ) (N,K) ( N , K ) , to be chosen below.
Let
E α : = e − α η γ / 8 . E_\alpha:=e^{-\alpha\eta\gamma/8}. E α := e − α η γ /8 .
Assume that, for some 1 ≤ r ≤ K 1\le r\le K 1 ≤ r ≤ K ,
∥ q ^ ( ℓ ) − q ( ℓ ) ∥ ≤ C N , K E α , ℓ = 0 , … , r − 1. \left\|\widehat{\mathbf{q}}^{(\ell)}-\mathbf{q}^{(\ell)}\right\|\le C_{N,K}E_\alpha,\qquad\ell=0,\ldots,r-1. q ( ℓ ) − q ( ℓ ) ≤ C N , K E α , ℓ = 0 , … , r − 1.
Let the attention scores at step r r r be computed with respect to the last token q ^ ( r − 1 ) \widehat{\mathbf{q}}^{(r-1)} q ( r − 1 ) . For an original token h i \mathbf{h}_i h i ,
s ^ i ( r ) = α x i T x q + β p i T ( q ^ ( r − 1 ) ) p , \widehat{s}_i^{(r)}=\alpha\mathbf{x}_i^{\mathsf T}\mathbf{x}_q+\beta\mathbf{p}_i^{\mathsf T}\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p, s i ( r ) = α x i T x q + β p i T ( q ( r − 1 ) ) p ,
and for a previously generated token q ^ ( m ) \widehat{\mathbf{q}}^{(m)} q ( m ) , 0 ≤ m ≤ r − 1 0\le m\le r-1 0 ≤ m ≤ r − 1 ,
s ^ m ( r ) = α + β ⟨ ( q ^ ( m ) ) p , ( q ^ ( r − 1 ) ) p ⟩ . \widehat{s}_m^{(r)}=\alpha+\beta\left\langle\left(\widehat{\mathbf{q}}^{(m)}\right)_p,\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p\right\rangle. s m ( r ) = α + β ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ .
We compare these normalized scores with the limiting normalized scores obtained from the ideal rollout and the limiting ratio β / α = − 2 \beta/\alpha=-2 β / α = − 2 . For original tokens, the corresponding limiting normalized score is
{ x i T x q − 2 , i ∈ { π ( 1 ) , … , π ( r − 1 ) } , x i T x q , i ∉ { π ( 1 ) , … , π ( r − 1 ) } . \begin{cases}
\mathbf{x}_i^{\mathsf T}\mathbf{x}_q-2, & i\in\{\pi(1),\ldots,\pi(r-1)\},\\
\mathbf{x}_i^{\mathsf T}\mathbf{x}_q, & i\notin\{\pi(1),\ldots,\pi(r-1)\}.
\end{cases} { x i T x q − 2 , x i T x q , i ∈ { π ( 1 ) , … , π ( r − 1 )} , i ∈ / { π ( 1 ) , … , π ( r − 1 )} .
For a previously generated token q ( m ) \mathbf{q}^{(m)} q ( m ) , 0 ≤ m ≤ r − 1 0\le m\le r-1 0 ≤ m ≤ r − 1 , the corresponding limiting normalized score is
1 − 2 ( m + 1 ) = − ( 2 m + 1 ) , 1-2(m+1)=-(2m+1), 1 − 2 ( m + 1 ) = − ( 2 m + 1 ) ,
because
⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ = m + 1. \left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle=m+1. ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ = m + 1.
Assume ∣ β / α + 2 ∣ ≤ δ 0 ≤ 1 |\beta/\alpha+2|\le\delta_0\le1 ∣ β / α + 2∣ ≤ δ 0 ≤ 1 . Then
∣ β / α ∣ ≤ 3. |\beta/\alpha|\le3. ∣ β / α ∣ ≤ 3.
For an original token h i \mathbf{h}_i h i , using
p i T ( q ( r − 1 ) ) p = { 1 , i ∈ { π ( 1 ) , … , π ( r − 1 ) } , 0 , i ∉ { π ( 1 ) , … , π ( r − 1 ) } , \mathbf{p}_i^{\mathsf T}\left(\mathbf{q}^{(r-1)}\right)_p=
\begin{cases}
1, & i\in\{\pi(1),\ldots,\pi(r-1)\},\\
0, & i\notin\{\pi(1),\ldots,\pi(r-1)\},
\end{cases} p i T ( q ( r − 1 ) ) p = { 1 , 0 , i ∈ { π ( 1 ) , … , π ( r − 1 )} , i ∈ / { π ( 1 ) , … , π ( r − 1 )} ,
we have
∣ s ^ i ( r ) α − ( x i T x q − 2 p i T ( q ( r − 1 ) ) p ) ∣ = ∣ β α p i T ( q ^ ( r − 1 ) ) p + 2 p i T ( q ( r − 1 ) ) p ∣ ≤ ∣ β α ∣ ∣ p i T ( ( q ^ ( r − 1 ) ) p − ( q ( r − 1 ) ) p ) ∣ + ∣ β α + 2 ∣ ∣ p i T ( q ( r − 1 ) ) p ∣ ≤ 3 C N , K E α + δ 0 . \begin{aligned}
\left|\frac{\widehat{s}_i^{(r)}}{\alpha}-\left(\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q-2\mathbf{p}_i^{\mathsf{T}}\left(\mathbf{q}^{(r-1)}\right)_p\right)\right|=\left|\frac{\beta}{\alpha}\mathbf{p}_i^{\mathsf{T}}\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p+2\mathbf{p}_i^{\mathsf{T}}\left(\mathbf{q}^{(r-1)}\right)_p\right| \\
&\leq\left|\frac{\beta}{\alpha}\right|\left|\mathbf{p}_i^{\mathsf{T}}\left(\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p-\left(\mathbf{q}^{(r-1)}\right)_p\right)\right|+\left|\frac{\beta}{\alpha}+2\right|\left|\mathbf{p}_i^{\mathsf{T}}\left(\mathbf{q}^{(r-1)}\right)_p\right|\leq3C_{N,K}E_\alpha+\delta_0.
\end{aligned} α s i ( r ) − ( x i T x q − 2 p i T ( q ( r − 1 ) ) p ) = α β p i T ( q ( r − 1 ) ) p + 2 p i T ( q ( r − 1 ) ) p ≤ α β p i T ( ( q ( r − 1 ) ) p − ( q ( r − 1 ) ) p ) + α β + 2 p i T ( q ( r − 1 ) ) p ≤ 3 C N , K E α + δ 0 .
For a previously generated token q ^ ( m ) \widehat{\mathbf{q}}^{(m)} q ( m ) , 0 ≤ m ≤ r − 1 0\leq m\leq r-1 0 ≤ m ≤ r − 1 , we similarly compare s ^ m ( r ) / α \widehat{s}_m^{(r)}/\alpha s m ( r ) / α with − ( 2 m + 1 ) -(2m+1) − ( 2 m + 1 ) . Since
⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ = m + 1 , \left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle=m+1, ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ = m + 1 ,
we have
∣ s ^ m ( r ) α − ( − ( 2 m + 1 ) ) ∣ = ∣ β α ⟨ ( q ^ ( m ) ) p , ( q ^ ( r − 1 ) ) p ⟩ + 2 ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ ∣ \left|\frac{\widehat{s}_m^{(r)}}{\alpha}-\left(-(2m+1)\right)\right|=\left|\frac{\beta}{\alpha}\left\langle\left(\widehat{\mathbf{q}}^{(m)}\right)_p,\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p\right\rangle+2\left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle\right| α s m ( r ) − ( − ( 2 m + 1 ) ) = α β ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ + 2 ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩
≤ 3 ∣ ⟨ ( q ^ ( m ) ) p , ( q ^ ( r − 1 ) ) p ⟩ − ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ ∣ + ∣ β α + 2 ∣ ∣ ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ ∣ . \leq3\left|\left\langle\left(\widehat{\mathbf{q}}^{(m)}\right)_p,\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p\right\rangle-\left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle\right|+\left|\frac{\beta}{\alpha}+2\right|\left|\left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle\right|. ≤ 3 ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ − ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ + α β + 2 ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ .
The first term is controlled by the induction hypothesis and the boundedness from Lemma B.2. Indeed,
∣ ⟨ ( q ^ ( m ) ) p , ( q ^ ( r − 1 ) ) p ⟩ − ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ ∣ ≤ ∥ ( q ^ ( m ) ) p − ( q ( m ) ) p ∥ ∥ ( q ^ ( r − 1 ) ) p ∥ + ∥ ( q ( m ) ) p ∥ ∥ ( q ^ ( r − 1 ) ) p − ( q ( r − 1 ) ) p ∥ ≤ A K C N , K E α , \begin{aligned}
\left|\left\langle\left(\widehat{\mathbf{q}}^{(m)}\right)_p,\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p\right\rangle-\left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle\right| \\
&\leq\left\|\left(\widehat{\mathbf{q}}^{(m)}\right)_p-\left(\mathbf{q}^{(m)}\right)_p\right\|\left\|\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p\right\|+\left\|\left(\mathbf{q}^{(m)}\right)_p\right\|\left\|\left(\widehat{\mathbf{q}}^{(r-1)}\right)_p-\left(\mathbf{q}^{(r-1)}\right)_p\right\|\leq A_KC_{N,K}E_\alpha,
\end{aligned} ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ − ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ ≤ ( q ( m ) ) p − ( q ( m ) ) p ( q ( r − 1 ) ) p + ( q ( m ) ) p ( q ( r − 1 ) ) p − ( q ( r − 1 ) ) p ≤ A K C N , K E α ,
for some constant A K > 0 A_K>0 A K > 0 depending only on K K K . Also,
∣ ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ ∣ = m + 1 ≤ K . \left|\left\langle\left(\mathbf{q}^{(m)}\right)_p,\left(\mathbf{q}^{(r-1)}\right)_p\right\rangle\right|=m+1\leq K. ⟨ ( q ( m ) ) p , ( q ( r − 1 ) ) p ⟩ = m + 1 ≤ K .
Consequently, there exist constants L K 0 , D K > 0 L_K^0,D_K>0 L K 0 , D K > 0 , depending only on K K K , such that every normalized score at step r r r differs from its corresponding limiting normalized score by at most
L K 0 C N , K E α + D K δ 0 . L_K^0C_{N,K}E_\alpha+D_K\delta_0. L K 0 C N , K E α + D K δ 0 .
We now choose the constants. First choose
C N , K ≥ K C N , K ′ . C_{N,K}\geq KC'_{N,K}. C N , K ≥ K C N , K ′ .
Next define
δ 0 : = min { 1 , η γ 16 D K } . \delta_0:=\min\left\{1,\frac{\eta_\gamma}{16D_K}\right\}. δ 0 := min { 1 , 16 D K η γ } .
Finally choose α 0 > 0 \alpha_0>0 α 0 > 0 sufficiently large so that, for all α ≥ α 0 \alpha\geq\alpha_0 α ≥ α 0 ,
L K 0 C N , K e − α η γ / 8 ≤ η γ 16 . L_K^0C_{N,K}e^{-\alpha\eta_\gamma/8}\leq\frac{\eta_\gamma}{16}. L K 0 C N , K e − α η γ /8 ≤ 16 η γ .
With these choices, whenever α ≥ α 0 \alpha\geq\alpha_0 α ≥ α 0 and ∣ β / α + 2 ∣ ≤ δ 0 |\beta/\alpha+2|\leq\delta_0 ∣ β / α + 2∣ ≤ δ 0 , every actual normalized score differs from its limiting normalized score by at most
η γ 16 + η γ 16 = η γ 8 . \frac{\eta\gamma}{16}+\frac{\eta\gamma}{16}=\frac{\eta\gamma}{8}. 16 η γ + 16 η γ = 8 η γ .
We now compare the limiting scores. The correct token at step r r r is h π ( r ) \mathbf{h}_{\pi(r)} h π ( r ) , whose limiting normalized score is
x π ( r ) T x q . \mathbf{x}_{\pi(r)}^{\mathsf{T}}\mathbf{x}_q. x π ( r ) T x q .
For any later unselected original token h π ( j ) \mathbf{h}_{\pi(j)} h π ( j ) , j > r j>r j > r ,
x π ( r ) T x q − x π ( j ) T x q ≥ η γ . \mathbf{x}_{\pi(r)}^{\mathsf{T}}\mathbf{x}_q-\mathbf{x}_{\pi(j)}^{\mathsf{T}}\mathbf{x}_q\ge\eta\gamma. x π ( r ) T x q − x π ( j ) T x q ≥ η γ .
For any previously selected original token h π ( j ) \mathbf{h}_{\pi(j)} h π ( j ) , j < r j<r j < r , the limiting normalized score is
x π ( j ) T x q − 2 ≤ − 1 , \mathbf{x}_{\pi(j)}^{\mathsf{T}}\mathbf{x}_q-2\le-1, x π ( j ) T x q − 2 ≤ − 1 ,
whereas
x π ( r ) T x q ≥ x π ( N ) T x q ≥ − 1 + η γ . \mathbf{x}_{\pi(r)}^{\mathsf{T}}\mathbf{x}_q\ge\mathbf{x}_{\pi(N)}^{\mathsf{T}}\mathbf{x}_q\ge-1+\eta\gamma. x π ( r ) T x q ≥ x π ( N ) T x q ≥ − 1 + η γ .
Thus the correct token beats every previously selected original token by at least η γ \eta\gamma η γ . Finally, every previously generated token has limiting normalized score − ( 2 m + 1 ) ≤ − 1 -(2m+1)\le-1 − ( 2 m + 1 ) ≤ − 1 , and hence the correct token also beats every previously generated token by at least η γ \eta\gamma η γ . Therefore, before perturbation, the correct token has normalized score gap at least η γ \eta\gamma η γ over every competitor.
Since each normalized score is perturbed by at most η γ / 8 \eta\gamma/8 η γ /8 , the actual normalized score of h π ( r ) \mathbf{h}_{\pi(r)} h π ( r ) exceeds the actual normalized score of every other column by at least
η γ − 2 ⋅ η γ 8 = 3 η γ 4 . \eta\gamma-2\cdot\frac{\eta\gamma}{8}=\frac{3\eta\gamma}{4}. η γ − 2 ⋅ 8 η γ = 4 3 η γ .
Equivalently, the corresponding unnormalized score gap is at least 3 α η γ / 4 3\alpha\eta\gamma/4 3 α η γ /4 . Therefore, if a ( r ) \mathbf{a}^{(r)} a ( r ) denotes the softmax attention vector at step r r r , then
∑ ℓ ∈ [ N + r ] ∖ { π ( r ) } a ℓ ( r ) ≤ ( N + K ) e − 3 α η γ / 4 . \sum_{\ell\in[N+r]\setminus\{\pi(r)\}}a^{(r)}_{\ell}\le(N+K)e^{-3\alpha\eta\gamma/4}. ℓ ∈ [ N + r ] ∖ { π ( r )} ∑ a ℓ ( r ) ≤ ( N + K ) e − 3 α η γ /4 .
Using the token norm bound and ∥ V ∥ ≤ 1 \lVert V\rVert\le1 ∥ V ∥ ≤ 1 , we get
∥ ( V Z ^ ( r − 1 ) ) a ( r ) − V h π ( r ) ∥ = ∥ ∑ ℓ ∈ [ N + r ] ∖ { π ( r ) } a ℓ ( r ) V ( z ^ : , ℓ ( r − 1 ) − h π ( r ) ) ∥ \left\lVert(V\widehat{Z}^{(r-1)})\mathbf{a}^{(r)}-V\mathbf{h}_{\pi(r)}\right\rVert
=
\left\lVert
\sum_{\ell\in[N+r]\setminus\{\pi(r)\}}
a^{(r)}_{\ell}V\left(\widehat{\mathbf{z}}^{(r-1)}_{:,\ell}-\mathbf{h}_{\pi(r)}\right)
\right\rVert ( V Z ( r − 1 ) ) a ( r ) − V h π ( r ) = ℓ ∈ [ N + r ] ∖ { π ( r )} ∑ a ℓ ( r ) V ( z : , ℓ ( r − 1 ) − h π ( r ) )
≤ 2 B N , K ∑ ℓ ∈ [ N + r ] ∖ { π ( r ) } a ℓ ( r ) ≤ C N , K ′ e − 3 α η γ / 4 . \begin{aligned}
\le2B_{N,K}\sum_{\ell\in[N+r]\setminus\{\pi(r)\}}a^{(r)}_{\ell} \\
&\le C'_{N,K}e^{-3\alpha\eta\gamma/4}.
\end{aligned} ≤ 2 B N , K ℓ ∈ [ N + r ] ∖ { π ( r )} ∑ a ℓ ( r ) ≤ C N , K ′ e − 3 α η γ /4 .
By the residual update and the ideal identity
q ( r ) = q ( r − 1 ) + V h π ( r ) , \mathbf{q}^{(r)}=\mathbf{q}^{(r-1)}+V\mathbf{h}_{\pi(r)}, q ( r ) = q ( r − 1 ) + V h π ( r ) ,
we obtain
∥ q ^ ( r ) − q ( r ) ∥ ≤ ∥ q ^ ( r − 1 ) − q ( r − 1 ) ∥ + C N , K ′ e − 3 α η γ / 4 . \left\lVert\widehat{\mathbf{q}}^{(r)}-\mathbf{q}^{(r)}\right\rVert\le\left\lVert\widehat{\mathbf{q}}^{(r-1)}-\mathbf{q}^{(r-1)}\right\rVert+C'_{N,K}e^{-3\alpha\eta\gamma/4}. q ( r ) − q ( r ) ≤ q ( r − 1 ) − q ( r − 1 ) + C N , K ′ e − 3 α η γ /4 .
Since C N , K ≥ K C N , K ′ C_{N,K}\ge KC'_{N,K} C N , K ≥ K C N , K ′ , iterating from 1 1 1 to r r r gives
∥ q ^ ( r ) − q ( r ) ∥ ≤ r C N , K ′ e − 3 α η γ / 4 ≤ C N , K e − α η γ / 8 , r = 0 , … , K , \left\lVert\widehat{\mathbf{q}}^{(r)}-\mathbf{q}^{(r)}\right\rVert\le rC'_{N,K}e^{-3\alpha\eta\gamma/4}\le C_{N,K}e^{-\alpha\eta\gamma/8},\qquad r=0,\ldots,K, q ( r ) − q ( r ) ≤ r C N , K ′ e − 3 α η γ /4 ≤ C N , K e − α η γ /8 , r = 0 , … , K ,
where the case r = 0 r=0 r = 0 is exact. This closes the induction.
Taking r = K r=K r = K and the ( d + 1 ) (d+1) ( d + 1 ) -st coordinate gives
∣ TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 − ∑ k = 1 K y π ( k ) ∣ ≤ C N , K e − α η γ / 8 . \left|\operatorname{TF}(\widehat{\mathbf{Z}}^{(K-1)},\boldsymbol{\theta})_{d+1,-1}-\sum_{k=1}^{K}y_{\pi(k)}\right|\le C_{N,K}e^{-\alpha\eta\gamma/8}. TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 − k = 1 ∑ K y π ( k ) ≤ C N , K e − α η γ /8 .
Increase α 0 \alpha_0 α 0 once more, if necessary, so that
C N , K e − α 0 η γ / 8 < 1. C_{N,K}e^{-\alpha_0\eta\gamma/8}<1. C N , K e − α 0 η γ /8 < 1.
Then, for all α ≥ α 0 \alpha\ge\alpha_0 α ≥ α 0 ,
∣ TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 − ∑ k = 1 K y π ( k ) ∣ < 1. \left|\operatorname{TF}(\widehat{\mathbf{Z}}^{(K-1)},\boldsymbol{\theta})_{d+1,-1}-\sum_{k=1}^{K}y_{\pi(k)}\right|<1. TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 − k = 1 ∑ K y π ( k ) < 1.
Since y i ∈ { ± 1 } y_i\in\{\pm1\} y i ∈ { ± 1 } , the sum
S K : = ∑ k = 1 K y π ( k ) S_K:=\sum_{k=1}^{K}y_{\pi(k)} S K := k = 1 ∑ K y π ( k )
is an integer. Under the assumption S K ≠ 0 S_K\ne0 S K = 0 , we have ∣ S K ∣ ≥ 1 |S_K|\ge1 ∣ S K ∣ ≥ 1 . The strict error bound above therefore implies that
sign ( TF ( Z ^ ( K − 1 ) , θ ) d + 1 , − 1 ) = sign ( S K ) = sign ( ∑ k = 1 K y π ( k ) ) . \operatorname{sign}\left(\operatorname{TF}(\widehat{\mathbf{Z}}^{(K-1)},\boldsymbol{\theta})_{d+1,-1}\right)=\operatorname{sign}(S_K)=\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right). sign ( TF ( Z ( K − 1 ) , θ ) d + 1 , − 1 ) = sign ( S K ) = sign ( k = 1 ∑ K y π ( k ) ) .
The constants δ 0 \delta_0 δ 0 and α 0 \alpha_0 α 0 depend only on ( γ , N , K ) (\gamma,N,K) ( γ , N , K ) , and the argument was deterministic for an arbitrary instance satisfying the margin condition. Hence the conclusion holds uniformly over all instances satisfying the stated margin condition. □
Proof of Theorem 5.2
In this section, we elaborate on the proof of Theorem 5.2 . Our proof can be broken down into the following steps:
We prove in Sections D.1 and D.2 that gradient descent preserves a two-dimensional invariant manifold utilizing the symmetry of the data distribution and the gradient structure. More precisely, from zero initialization, for every iteration t t t ,
W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) , \mathbf{W}^{(t)}=\operatorname{diag}\left(\alpha^{(t)}I_d,0,\beta^{(t)}I_{N+1}\right), W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) ,
where α ( t ) \alpha^{(t)} α ( t ) and β ( t ) \beta^{(t)} β ( t ) are scalar parameters, so the matrix recursion reduces exactly to a scalar recursion for the pair ( α ( t ) , β ( t ) ) (\alpha^{(t)},\beta^{(t)}) ( α ( t ) , β ( t ) ) .
We rewrite the population loss to a reduced objective L ( α , β ) \mathcal{L}(\alpha,\beta) L ( α , β ) . By analyzing the update dynamics of α ( t ) \alpha^{(t)} α ( t ) and β ( t ) \beta^{(t)} β ( t ) , we prove in Section D.3 that, under the regime d ≥ 2 d \ge2 d ≥ 2 , N ≥ 100 d N \ge100\sqrt{d} N ≥ 100 d , 0 < η ≤ 1 / 840 ( N + 1 ) 2 0 < \eta\le1/840(N+1)^2 0 < η ≤ 1/840 ( N + 1 ) 2 the region [ 0 , ∞ ) × ( − ∞ , 0 ] [0,\infty) \times(-\infty,0] [ 0 , ∞ ) × ( − ∞ , 0 ] is forward invariant, and the iterates satisfy
β ( t ) → − ∞ , α ( t ) → + ∞ . \beta^{(t)} \to-\infty,\qquad\alpha^{(t)} \to+\infty. β ( t ) → − ∞ , α ( t ) → + ∞.
We further provide an analysis of the precise slope − β ( t ) / α ( t ) -\beta^{(t)}/\alpha^{(t)} − β ( t ) / α ( t ) in Sections D.4, D.5 and D.6. We demonstrate that
lim inf t → ∞ ( − β ( t ) α ( t ) ) ≥ 2 and lim sup t → ∞ ( − β ( t ) α ( t ) ) ≤ 2. \liminf_{t\to\infty}\left(-\frac{\beta^{(t)}}{\alpha^{(t)}}\right) \ge2
\qquad\text{and}\qquad
\limsup_{t\to\infty}\left(-\frac{\beta^{(t)}}{\alpha^{(t)}}\right) \le2. t → ∞ lim inf ( − α ( t ) β ( t ) ) ≥ 2 and t → ∞ lim sup ( − α ( t ) β ( t ) ) ≤ 2.
and therefore − β ( t ) / α ( t ) → 2 -\beta^{(t)}/\alpha^{(t)} \to2 − β ( t ) / α ( t ) → 2 . With the asymptotic slope identified, we then show that the self-token contribution vanishes and establish the convergence of the loss function.
Derivation of Gradients
In this subsection, we provide a derivation of the gradients of the population loss L ( W ) \mathcal{L}(\mathbf{W}) L ( W ) with respect to the parameter matrix W \mathbf{W} W , based on the architecture defined in § 3.2 .
Under Assumption 5.1, the random variables { x i x q } i = 1 N \{\mathbf{x}_i\mathbf{x}_q\}_{i=1}^{N} { x i x q } i = 1 N have a continuous joint law, hence ties occur with probability zero. Therefore π ( 1 ) \pi(1) π ( 1 ) is almost surely uniquely defined. For notational simplicity, we write
π : = π ( 1 ) , q : = q ( 0 ) , Z : = Z ( 0 ) = [ H , q ] . \pi:= \pi(1),\qquad\mathbf{q} := \mathbf{q}^{(0)},\qquad\mathbf{Z} := \mathbf{Z}^{(0)} = [\mathbf{H},\mathbf{q}]. π := π ( 1 ) , q := q ( 0 ) , Z := Z ( 0 ) = [ H , q ] .
Recall that for a single sample ( D , x q , ω ) (\mathcal{D},\mathbf{x}_q,\omega) ( D , x q , ω ) , the training loss is
ℓ ( W ) = 1 2 ∥ TF ( Z ; W ) : , − 1 − q ( 1 ) ∥ 2 , (23) \ell(\mathbf{W}) = \frac{1}{2}\left\|\operatorname{TF}(\mathbf{Z};\mathbf{W})_{:,-1} - \mathbf{q}^{(1)}\right\|^2, \tag*{(23)} ℓ ( W ) = 2 1 TF ( Z ; W ) : , − 1 − q ( 1 ) 2 , (23)
where q ( 1 ) : = [ x q T , y π ( 1 ) , p N + 1 T + p π ( 1 ) T ] T \mathbf{q}^{(1)} := [\mathbf{x}_q^{\mathsf{T}},y_{\pi(1)},\mathbf{p}_{N+1}^{\mathsf{T}}+\mathbf{p}_{\pi(1)}^{\mathsf{T}}]^{\mathsf{T}} q ( 1 ) := [ x q T , y π ( 1 ) , p N + 1 T + p π ( 1 ) T ] T , and the population objective is
L ( W ) = E D , x q E ω [ ℓ ( W ) ] . (24) \mathcal{L}(\mathbf{W}) = \mathbb{E}_{\mathcal{D},\mathbf{x}_q}\mathbb{E}_{\omega}\left[\ell(\mathbf{W})\right]. \tag*{(24)} L ( W ) = E D , x q E ω [ ℓ ( W ) ] . (24)
Intermediate variables. Define
u : = Z T W q ∈ R N + 1 , a : = softmax ( u ) ∈ R N + 1 , q ^ : = TF ( Z ; W ) : , − 1 = q + V Z a , (25) \mathbf{u} := \mathbf{Z}^{\mathsf{T}}\mathbf{W}\mathbf{q} \in\mathbb{R}^{N+1},\qquad
\mathbf{a} := \operatorname{softmax}(\mathbf{u}) \in\mathbb{R}^{N+1},\qquad
\widehat{\mathbf{q}} := \operatorname{TF}(\mathbf{Z};\mathbf{W})_{:,-1} = \mathbf{q}+\mathbf{V}\mathbf{Z}\mathbf{a}, \tag*{(25)} u := Z T Wq ∈ R N + 1 , a := softmax ( u ) ∈ R N + 1 , q := TF ( Z ; W ) : , − 1 = q + VZa , (25)
and the residual
r : = q ^ − q ( 1 ) . (26) \mathbf{r} := \widehat{\mathbf{q}}-\mathbf{q}^{(1)}. \tag*{(26)} r := q − q ( 1 ) . (26)
Then ℓ ( W ) = 1 2 ∥ r ∥ 2 \ell(\mathbf{W})=\frac{1}{2}\|\mathbf{r}\|^2 ℓ ( W ) = 2 1 ∥ r ∥ 2 .
Lemma D.1. For the single-sample loss ℓ ( W ) \ell(\mathbf{W}) ℓ ( W ) defined in (D.1), we have
∇ W ℓ ( W ) = Z ( diag ( a ) − a a T ) Z T V T r q T . (27) \nabla_{\mathbf{W}}\ell(\mathbf{W}) =
\mathbf{Z}\left(\operatorname{diag}(\mathbf{a})-\mathbf{a}\mathbf{a}^{\mathsf{T}}\right)
\mathbf{Z}^{\mathsf{T}}\mathbf{V}^{\mathsf{T}}\mathbf{r}\,\mathbf{q}^{\mathsf{T}}. \tag*{(27)} ∇ W ℓ ( W ) = Z ( diag ( a ) − a a T ) Z T V T r q T . (27) Consequently,
∇ W L ( W ) = E D , x q E ω [ Z ( diag ( a ) − a a T ) Z T V T r q T ] . (28) \nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}) =
\mathbb{E}_{\mathcal{D},\mathbf{x}_q}\mathbb{E}_{\omega}\left[
\mathbf{Z}\left(\operatorname{diag}(\mathbf{a})-\mathbf{a}\mathbf{a}^{\mathsf{T}}\right)
\mathbf{Z}^{\mathsf{T}}\mathbf{V}^{\mathsf{T}}\mathbf{r}\,\mathbf{q}^{\mathsf{T}}
\right]. \tag*{(28)} ∇ W L ( W ) = E D , x q E ω [ Z ( diag ( a ) − a a T ) Z T V T r q T ] . (28)
Proof. We apply the chain rule in three steps. Step 1: gradient with respect to the attention weights. From (D.4),
r = q + V Z a − q ( 1 ) . \mathbf{r}=\mathbf{q}+\mathbf{VZ}\mathbf{a}-\mathbf{q}^{(1)}. r = q + VZ a − q ( 1 ) .
Hence
ℓ ( W ) = 1 2 ∥ r ∥ 2 , ∇ a ℓ = ( V Z ) T r = Z T V T r . \ell(\mathbf{W})=\frac{1}{2}\lVert\mathbf{r}\rVert^2,\qquad\nabla_{\mathbf{a}}\ell=(\mathbf{VZ})^{\mathsf{T}}\mathbf{r}=\mathbf{Z}^{\mathsf{T}}\mathbf{V}^{\mathsf{T}}\mathbf{r}. ℓ ( W ) = 2 1 ∥ r ∥ 2 , ∇ a ℓ = ( VZ ) T r = Z T V T r .
Step 2: gradient with respect to the logits. Let J softmax ( u ) \mathbf{J}_{\operatorname{softmax}}(\mathbf{u}) J softmax ( u ) denote the Jacobian of softmax at u \mathbf{u} u . The standard softmax identity gives
J softmax ( u ) = diag ( a ) − a a T . \mathbf{J}_{\operatorname{softmax}}(\mathbf{u})=\operatorname{diag}(\mathbf{a})-\mathbf{a}\mathbf{a}^{\mathsf{T}}. J softmax ( u ) = diag ( a ) − a a T .
Therefore,
∇ u ℓ = J softmax ( u ) ∇ a ℓ = ( diag ( a ) − a a T ) Z T V T r . \nabla_{\mathbf{u}}\ell=\mathbf{J}_{\operatorname{softmax}}(\mathbf{u})\nabla_{\mathbf{a}}\ell=\left(\operatorname{diag}(\mathbf{a})-\mathbf{a}\mathbf{a}^{\mathsf{T}}\right)\mathbf{Z}^{\mathsf{T}}\mathbf{V}^{\mathsf{T}}\mathbf{r}. ∇ u ℓ = J softmax ( u ) ∇ a ℓ = ( diag ( a ) − a a T ) Z T V T r .
Step 3: gradient with respect to W \mathbf{W} W . Since
u = Z T W q , \mathbf{u}=\mathbf{Z}^{\mathsf{T}}\mathbf{W}\mathbf{q}, u = Z T Wq ,
its differential is
d u = Z T ( d W ) q . \mathrm{d}\mathbf{u}=\mathbf{Z}^{\mathsf{T}}(\mathrm{d}\mathbf{W})\mathbf{q}. d u = Z T ( d W ) q .
Thus, for any perturbation d W \mathrm{d}\mathbf{W} d W ,
d ℓ = ⟨ ∇ u ℓ , d u ⟩ = ⟨ ∇ u ℓ , Z T ( d W ) q ⟩ = ⟨ Z ( ∇ u ℓ ) q T , d W ⟩ . \begin{aligned}
\mathrm{d}\ell&=\langle\nabla_{\mathbf{u}}\ell,\mathrm{d}\mathbf{u}\rangle\\
&=\langle\nabla_{\mathbf{u}}\ell,\mathbf{Z}^{\mathsf{T}}(\mathrm{d}\mathbf{W})\mathbf{q}\rangle\\
&=\langle\mathbf{Z}(\nabla_{\mathbf{u}}\ell)\mathbf{q}^{\mathsf{T}},\mathrm{d}\mathbf{W}\rangle.
\end{aligned} d ℓ = ⟨ ∇ u ℓ , d u ⟩ = ⟨ ∇ u ℓ , Z T ( d W ) q ⟩ = ⟨ Z ( ∇ u ℓ ) q T , d W ⟩ .
Hence
∇ W ℓ ( W ) = Z ( ∇ u ℓ ) q T = Z ( ( diag ( a ) − a a T ) Z T V T r ) q T , \nabla_{\mathbf{W}}\ell(\mathbf{W})=\mathbf{Z}(\nabla_{\mathbf{u}}\ell)\mathbf{q}^{\mathsf{T}}=\mathbf{Z}\left(\left(\operatorname{diag}(\mathbf{a})-\mathbf{a}\mathbf{a}^{\mathsf{T}}\right)\mathbf{Z}^{\mathsf{T}}\mathbf{V}^{\mathsf{T}}\mathbf{r}\right)\mathbf{q}^{\mathsf{T}}, ∇ W ℓ ( W ) = Z ( ∇ u ℓ ) q T = Z ( ( diag ( a ) − a a T ) Z T V T r ) q T ,
which proves (D.5). Taking expectation and using linearity of expectation gives (D.6).
Lemma D.2. Let y y y denote the label coordinate in the ( x , y , p ) (x,y,p) ( x , y , p ) -block decomposition of R D \mathbb{R}^{D} R D . Then, for every W ∈ R D × D \mathbf{W}\in\mathbb{R}^{D\times D} W ∈ R D × D ,
( ∇ W ℓ ( W ) ) : , y = 0 , (29) (\nabla_{\mathbf{W}}\ell(\mathbf{W}))_{:,y}=0, \tag*{(29)} ( ∇ W ℓ ( W ) ) : , y = 0 , (29) and
( ∇ W L ( W ) ) : , y = 0. (30) (\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}))_{:,y}=0. \tag*{(30)} ( ∇ W L ( W ) ) : , y = 0. (30) Consequently, since gradient descent is initialized at W 0 = 0 \mathbf{W}_0=0 W 0 = 0 and evolves according to
W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) , t ≥ 0 , (31) \mathbf{W}^{(t+1)}=\mathbf{W}^{(t)}-\eta\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)}),\qquad t\ge0, \tag*{(31)} W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) , t ≥ 0 , (31) we have
( W ( t ) ) : , y = 0 for all t ≥ 0. (32) (\mathbf{W}^{(t)})_{:,y}=0\qquad\text{for all }t\ge0. \tag*{(32)} ( W ( t ) ) : , y = 0 for all t ≥ 0. (32)
Proof. From the definition of the initial query token,
q = [ x q 0 p N + 1 ] , \mathbf{q} =
\begin{bmatrix}
\mathbf{x}_{q} \\
0 \\
\mathbf{p}_{N+1}
\end{bmatrix}, q = x q 0 p N + 1 ,
so its y y y -coordinate is zero:
By (D.5),
∇ W ℓ ( W ) = Z ( ( diag ( a ) − a a T ) Z T V T r ) q T . \nabla_{\mathbf{W}}\ell(\mathbf{W}) = \mathbf{Z}\left((\operatorname{diag}(\mathbf{a})-\mathbf{a}\mathbf{a}^{\mathsf{T}})\mathbf{Z}^{\mathsf{T}}\mathbf{V}^{\mathsf{T}}\mathbf{r}\right)\mathbf{q}^{\mathsf{T}}. ∇ W ℓ ( W ) = Z ( ( diag ( a ) − a a T ) Z T V T r ) q T .
The y y y -th column of the right-hand side is obtained by multiplying by the scalar q y q_y q y , hence
( ∇ W ℓ ( W ) ) : , y = 0. (\nabla_{\mathbf{W}}\ell(\mathbf{W}))_{:,y}=0. ( ∇ W ℓ ( W ) ) : , y = 0.
Taking expectation gives
( ∇ W L ( W ) ) : , y = E D , x q E ω [ ( ∇ W ℓ ( W ) ) : , y ] = 0. (\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}))_{:,y}=\mathbb{E}_{D,\mathbf{x}_q}\mathbb{E}_{\omega}\left[(\nabla_{\mathbf{W}}\ell(\mathbf{W}))_{:,y}\right]=0. ( ∇ W L ( W ) ) : , y = E D , x q E ω [ ( ∇ W ℓ ( W ) ) : , y ] = 0.
Finally, ( W ( 0 ) ) : , y = 0 (\mathbf{W}^{(0)})_{:,y}=\mathbf{0} ( W ( 0 ) ) : , y = 0 because W ( 0 ) = 0 \mathbf{W}^{(0)}=\mathbf{0} W ( 0 ) = 0 . Then by (D.9) and (D.8),
( W ( t + 1 ) ) : , y = ( W ( t ) ) : , y − η ( ∇ W L ( W ( t ) ) ) : , y = 0 − η 0 = 0. (\mathbf{W}^{(t+1)})_{:,y}=(\mathbf{W}^{(t)})_{:,y}-\eta(\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)}))_{:,y}=0-\eta0=0. ( W ( t + 1 ) ) : , y = ( W ( t ) ) : , y − η ( ∇ W L ( W ( t ) ) ) : , y = 0 − η 0 = 0.
This proves (D.10) by induction.
A low-dimensional block-diagonal structure preserved by GD
In this subsection, we show that gradient descent preserves a low-dimensional block-diagonal structure of W \mathbf{W} W .
Symmetry group. We use the same ( x , y , p ) (x,y,p) ( x , y , p ) -block decomposition
R D = R d ⊕ R ⊕ R N + 1 . \mathbb{R}^{D}=\mathbb{R}^{d}\oplus\mathbb{R}\oplus\mathbb{R}^{N+1}. R D = R d ⊕ R ⊕ R N + 1 .
Define the following orthogonal transformations:
Data rotations: for any R ∈ O ( d ) R\in O(d) R ∈ O ( d ) ,
G R ≔ diag ( R , 1 , I N + 1 ) ∈ R D × D . G_R\coloneqq\operatorname{diag}(R,1,I_{N+1})\in\mathbb{R}^{D\times D}. G R : = diag ( R , 1 , I N + 1 ) ∈ R D × D .
Label flips: for any s ∈ { ± 1 } s\in\{ \pm1\} s ∈ { ± 1 } ,
G s ≔ diag ( I d , s , I N + 1 ) ∈ R D × D . G_s\coloneqq\operatorname{diag}(I_d,s,I_{N+1})\in\mathbb{R}^{D\times D}. G s : = diag ( I d , s , I N + 1 ) ∈ R D × D .
Signed permutations on the position block: Let H N + 1 \mathcal{H}_{N+1} H N + 1 be the set of all signed permutation matrices in R ( N + 1 ) × ( N + 1 ) \mathbb{R}^{(N+1)\times(N+1)} R ( N + 1 ) × ( N + 1 ) , i.e. matrices of the form S = D P S=DP S = D P where P P P is a permutation matrix and D D D is diagonal with ± 1 \pm1 ± 1 entries. For any S ∈ H N + 1 S\in\mathcal{H}_{N+1} S ∈ H N + 1 , define
G S ≔ diag ( I d , 1 , S ) ∈ R D × D . G_S\coloneqq\operatorname{diag}(I_d,1,S)\in\mathbb{R}^{D\times D}. G S : = diag ( I d , 1 , S ) ∈ R D × D .
Let G \mathbb{G} G be the group generated by all such G R G_R G R , G s G_s G s , and G S G_S G S . The group acts on W \mathbb{W} W by conjugation:
W ↦ G W G − 1 , G ∈ G . \mathbb{W} \mapsto G\mathbb{W}G^{-1}, \qquad G \in\mathbb{G}. W ↦ G W G − 1 , G ∈ G .
Lemma D.3. For any orthogonal G ∈ G G \in\mathbb{G} G ∈ G , any Z ∈ R D × ( N + 1 ) Z \in\mathbb{R}^{D \times(N+1)} Z ∈ R D × ( N + 1 ) , and any W ∈ R D × D \mathbb{W} \in\mathbb{R}^{D \times D} W ∈ R D × D ,
TF ( G Z ; G W G − 1 ) = G TF ( Z ; W ) . (33) \operatorname{TF}(GZ;G\mathbb{W}G^{-1}) = G\operatorname{TF}(Z;\mathbb{W}). \tag*{(33)} TF ( GZ ; G W G − 1 ) = G TF ( Z ; W ) . (33) In particular,
TF ( G Z ; G W G − 1 ) : , − 1 = G TF ( Z ; W ) : , − 1 . (34) \operatorname{TF}(GZ;G\mathbb{W}G^{-1})_{:,-1} = G\operatorname{TF}(Z;\mathbb{W})_{:,-1}. \tag*{(34)} TF ( GZ ; G W G − 1 ) : , − 1 = G TF ( Z ; W ) : , − 1 . (34)
Proof. We first note that the fixed value matrix
V = diag ( 0 , 1 , I N + 1 ) \mathbb{V} = \operatorname{diag}(0,1,I_{N+1}) V = diag ( 0 , 1 , I N + 1 )
commutes with every generator of G \mathbb{G} G , and hence with every G ∈ G G \in\mathbb{G} G ∈ G . Indeed:
G R V = V G R , G s V = V G s , G S V = V G S . G_R\mathbb{V} = \mathbb{V}G_R, \qquad G_s\mathbb{V} = \mathbb{V}G_s, \qquad G_S\mathbb{V} = \mathbb{V}G_S. G R V = V G R , G s V = V G s , G S V = V G S .
Now compute:
V ( G Z ) = G ( V Z ) , \mathbb{V}(GZ) = G(\mathbb{V}Z), V ( GZ ) = G ( V Z ) ,
and
( G Z ) T ( G W G − 1 ) ( G Z ) = Z T G T G W G − 1 G Z = Z T W Z , (GZ)^{\mathsf{T}}(G\mathbb{W}G^{-1})(GZ) = Z^{\mathsf{T}}G^{\mathsf{T}}G\mathbb{W}G^{-1}GZ = Z^{\mathsf{T}}\mathbb{W}Z, ( GZ ) T ( G W G − 1 ) ( GZ ) = Z T G T G W G − 1 GZ = Z T W Z ,
because G G G is orthogonal. Therefore the arguments of the column-wise softmax coincide:
softmax ( ( G Z ) T ( G W G − 1 ) ( G Z ) ) = softmax ( Z T W Z ) . \operatorname{softmax}\left((GZ)^{\mathsf{T}}(G\mathbb{W}G^{-1})(GZ)\right) = \operatorname{softmax}\left(Z^{\mathsf{T}}\mathbb{W}Z\right). softmax ( ( GZ ) T ( G W G − 1 ) ( GZ ) ) = softmax ( Z T W Z ) .
Substituting into the definition of TF \operatorname{TF} TF ,
TF ( G Z ; G W G − 1 ) = G Z + ( G V Z ) softmax ( ( G Z ) T ( G W G − 1 ) ( G Z ) ) = G Z + ( G ( V Z ) ) softmax ( Z T W Z ) = G ( Z + ( V Z ) softmax ( Z T W Z ) ) = G TF ( Z ; W ) . \begin{aligned}
\operatorname{TF}(GZ;G\mathbb{W}G^{-1})
&= GZ + (G\mathbb{V}Z)\operatorname{softmax}\left((GZ)^{\mathsf{T}}(G\mathbb{W}G^{-1})(GZ)\right) \\
&= GZ + (G(\mathbb{V}Z))\operatorname{softmax}\left(Z^{\mathsf{T}}\mathbb{W}Z\right) \\
&= G\left(Z + (\mathbb{V}Z)\operatorname{softmax}\left(Z^{\mathsf{T}}\mathbb{W}Z\right)\right) \\
&= G\operatorname{TF}(Z;\mathbb{W}).
\end{aligned} TF ( GZ ; G W G − 1 ) = GZ + ( G V Z ) softmax ( ( GZ ) T ( G W G − 1 ) ( GZ ) ) = GZ + ( G ( V Z )) softmax ( Z T W Z ) = G ( Z + ( V Z ) softmax ( Z T W Z ) ) = G TF ( Z ; W ) .
This proves (D.11), and (D.12) follows by taking the last column. □
Lemma D.4. For every R ∈ O ( d ) R \in O(d) R ∈ O ( d ) ,
L ( W ) = L ( G R W G R − 1 ) . (35) \mathcal{L}(\mathbb{W}) = \mathcal{L}(G_R\mathbb{W}G_R^{-1}). \tag*{(35)} L ( W ) = L ( G R W G R − 1 ) . (35)
Proof. Define rotated data
x i ′ : = R x i , x q ′ : = R x q , y i ′ : = y i , x'_i := Rx_i, \qquad x'_q := Rx_q, \qquad y'_i := y_i, x i ′ := R x i , x q ′ := R x q , y i ′ := y i ,
and keep ω \omega ω unchanged. Since the uniform measure on S d − 1 \mathbb{S}^{d-1} S d − 1 is rotationally invariant,
( D ′ , x q ′ , ω ) = d ( D , x q , ω ) . (\mathcal{D}',x'_q,\omega) \mathrel{\overset{d}{=}} (\mathcal{D},x_q,\omega). ( D ′ , x q ′ , ω ) = d ( D , x q , ω ) .
The nearest-neighbor index is unchanged under rotations, because Euclidean distances are preserved. Moreover,
h i ′ = [ R x i y i p i ] = G R h i , q ′ = [ R x q 0 p N + 1 ] = G R q , \mathbf{h}_i' =
\begin{bmatrix}
R\mathbf{x}_i \\
y_i \\
\mathbf{p}_i
\end{bmatrix}
=G_R\mathbf{h}_i,\qquad
\mathbf{q}' =
\begin{bmatrix}
R\mathbf{x}_q \\
0 \\
\mathbf{p}_{N+1}
\end{bmatrix}
=G_R\mathbf{q}, h i ′ = R x i y i p i = G R h i , q ′ = R x q 0 p N + 1 = G R q ,
and therefore
Z ′ = G R Z . \mathbf{Z}'=G_R\mathbf{Z}. Z ′ = G R Z .
Similarly,
( q ( 1 ) ) ′ = [ R x q y π p N + 1 + p π ] = G R q ( 1 ) . (\mathbf{q}^{(1)})' =
\begin{bmatrix}
R\mathbf{x}_q \\
y_\pi\\
\mathbf{p}_{N+1}+\mathbf{p}_\pi
\end{bmatrix}
=G_R\mathbf{q}^{(1)}. ( q ( 1 ) ) ′ = R x q y π p N + 1 + p π = G R q ( 1 ) .
Hence, by Lemma D.3 ,
ℓ ( G R W G R − 1 ; D ′ , x q ′ , ω ) = 1 2 ∥ TF ( Z ′ ; G R W G R − 1 ) : , − 1 − ( q ( 1 ) ) ′ ∥ 2 = 1 2 ∥ G R TF ( Z ; W ) : , − 1 − G R q ( 1 ) ∥ 2 = 1 2 ∥ TF ( Z ; W ) : , − 1 − q ( 1 ) ∥ 2 = ℓ ( W ; D , x q , ω ) , \begin{aligned}
\ell(G_R\mathbf{W}G_R^{-1};\mathcal{D}',\mathbf{x}_q',\omega)
&=\frac{1}{2}\left\|\operatorname{TF}(\mathbf{Z}';G_R\mathbf{W}G_R^{-1})_{:,-1}-(\mathbf{q}^{(1)})'\right\|^2\\
&=\frac{1}{2}\left\|G_R\operatorname{TF}(\mathbf{Z};\mathbf{W})_{:,-1}-G_R\mathbf{q}^{(1)}\right\|^2\\
&=\frac{1}{2}\left\|\operatorname{TF}(\mathbf{Z};\mathbf{W})_{:,-1}-\mathbf{q}^{(1)}\right\|^2\\
&=\ell(\mathbf{W};\mathcal{D},\mathbf{x}_q,\omega),
\end{aligned} ℓ ( G R W G R − 1 ; D ′ , x q ′ , ω ) = 2 1 TF ( Z ′ ; G R W G R − 1 ) : , − 1 − ( q ( 1 ) ) ′ 2 = 2 1 G R TF ( Z ; W ) : , − 1 − G R q ( 1 ) 2 = 2 1 TF ( Z ; W ) : , − 1 − q ( 1 ) 2 = ℓ ( W ; D , x q , ω ) ,
where we used the orthogonality of G R G_R G R in the third equality. Taking expectation over ( D , x q , ω ) (\mathcal{D},\mathbf{x}_q,\omega) ( D , x q , ω ) gives (D.13). □
Lemma D.5. For every s ∈ { ± 1 } s \in\{\pm1\} s ∈ { ± 1 } ,
L ( W ) = L ( G s W G s − 1 ) . (36) \mathcal{L}(\mathbf{W})=\mathcal{L}(G_s\mathbf{W}G_s^{-1}). \tag*{(36)} L ( W ) = L ( G s W G s − 1 ) . (36)
Proof. Define transformed labels
y i ′ = s y i , y_i'=s y_i, y i ′ = s y i ,
and keep { x i } i = 1 N \{\mathbf{x}_i\}_{i=1}^{N} { x i } i = 1 N , x q \mathbf{x}_q x q , and ω \omega ω unchanged. By Assumption 5.1, we have
( D ′ , x q , ω ) = d ( D , x q , ω ) . (\mathcal{D}',\mathbf{x}_q,\omega)\mathrel{\overset{d}{=}}(\mathcal{D},\mathbf{x}_q,\omega). ( D ′ , x q , ω ) = d ( D , x q , ω ) .
The nearest-neighbor index π \pi π depends only on { x i } i = 1 N \{\mathbf{x}_i\}_{i=1}^{N} { x i } i = 1 N and x q \mathbf{x}_q x q , so it is unchanged. Moreover,
h i ′ = [ x i s y i p i ] = G s h i , q ′ = [ x q 0 p N + 1 ] = G s q , \mathbf{h}_i'=
\begin{bmatrix}
\mathbf{x}_i \\
s y_i \\
\mathbf{p}_i
\end{bmatrix}
=G_s\mathbf{h}_i,\qquad
\mathbf{q}'=
\begin{bmatrix}
\mathbf{x}_q \\
0 \\
\mathbf{p}_{N+1}
\end{bmatrix}
=G_s\mathbf{q}, h i ′ = x i s y i p i = G s h i , q ′ = x q 0 p N + 1 = G s q ,
hence
Z ′ = G s Z . \mathbf{Z}'=G_s\mathbf{Z}. Z ′ = G s Z .
Also,
( q ( 1 ) ) ′ = [ x q s y π p N + 1 + p π ] = G s q ( 1 ) . (\mathbf{q}^{(1)})' =
\begin{bmatrix}
\mathbf{x}_q \\
s y_\pi\\
\mathbf{p}_{N+1}+\mathbf{p}_\pi
\end{bmatrix}
=G_s\mathbf{q}^{(1)}. ( q ( 1 ) ) ′ = x q s y π p N + 1 + p π = G s q ( 1 ) .
Applying Lemma D.3 and using orthogonality of G s G_s G s , we obtain
ℓ ( G s W G s − 1 ; D ′ , x q , ω ) = ℓ ( W ; D , x q , ω ) . \ell(G_sWG_s^{-1};\mathcal{D}',\mathbf{x}_q,\omega)=\ell(W;\mathcal{D},\mathbf{x}_q,\omega). ℓ ( G s W G s − 1 ; D ′ , x q , ω ) = ℓ ( W ; D , x q , ω ) .
Taking expectation gives (D.14).
Lemma D.6. Let S ∈ H N + 1 S\in\mathcal{H}_{N+1} S ∈ H N + 1 be any signed permutation matrix. Define transformed position vectors
( p 1 ′ , … , p N ′ , p N + 1 ′ ) : = ( S p 1 , … , S p N , S p N + 1 ) . (\mathbf{p}'_1,\ldots,\mathbf{p}'_N,\mathbf{p}'_{N+1}):=(S\mathbf{p}_1,\ldots,S\mathbf{p}_N,S\mathbf{p}_{N+1}). ( p 1 ′ , … , p N ′ , p N + 1 ′ ) := ( S p 1 , … , S p N , S p N + 1 ) . Then
( p 1 ′ , … , p N ′ , p N + 1 ′ ) = d ( p 1 , … , p N , p N + 1 ) . (\mathbf{p}'_1,\ldots,\mathbf{p}'_N,\mathbf{p}'_{N+1})\mathrel{\stackrel{d}{=}}(\mathbf{p}_1,\ldots,\mathbf{p}_N,\mathbf{p}_{N+1}). ( p 1 ′ , … , p N ′ , p N + 1 ′ ) = d ( p 1 , … , p N , p N + 1 ) . Equivalently, there exists ω ′ = ( τ ′ , s 1 ′ , … , s N + 1 ′ ) \omega'=(\tau',s'_1,\ldots,s'_{N+1}) ω ′ = ( τ ′ , s 1 ′ , … , s N + 1 ′ ) with ω ′ = d ω \omega'\mathrel{\stackrel{d}{=}}\omega ω ′ = d ω such that
p i ′ = s i ′ e τ ′ ( i ) ( i ∈ [ N ] ) , p N + 1 ′ = s N + 1 ′ e τ ′ ( N + 1 ) . \mathbf{p}'_i=s'_i\mathbf{e}_{\tau'(i)}\quad(i\in[N]),\qquad
\mathbf{p}'_{N+1}=s'_{N+1}\mathbf{e}_{\tau'(N+1)}. p i ′ = s i ′ e τ ′ ( i ) ( i ∈ [ N ]) , p N + 1 ′ = s N + 1 ′ e τ ′ ( N + 1 ) .
Proof. Write
where P P P is a permutation matrix and D = diag ( ϵ 1 , … , ϵ N + 1 ) D=\operatorname{diag}(\epsilon_1,\ldots,\epsilon_{N+1}) D = diag ( ϵ 1 , … , ϵ N + 1 ) with ϵ j ∈ { ± 1 } \epsilon_j\in\{\pm1\} ϵ j ∈ { ± 1 } . Since
p i = s i e τ ( i ) , \mathbf{p}_i=s_i\mathbf{e}_{\tau(i)}, p i = s i e τ ( i ) ,
we have
S p i = ( D P ) ( s i e τ ( i ) ) = s i D e P ( τ ( i ) ) . S\mathbf{p}_i=(DP)(s_i\mathbf{e}_{\tau(i)})=s_iD\mathbf{e}_{P(\tau(i))}. S p i = ( D P ) ( s i e τ ( i ) ) = s i D e P ( τ ( i )) .
Define
τ ′ : = P ∘ τ , s i ′ : = s i ϵ τ ′ ( i ) ( i = 1 , … , N + 1 ) . \tau':=P\circ\tau,\qquad s'_i:=s_i\epsilon_{\tau'(i)}\quad(i=1,\ldots,N+1). τ ′ := P ∘ τ , s i ′ := s i ϵ τ ′ ( i ) ( i = 1 , … , N + 1 ) .
Then
S p i = s i ′ e τ ′ ( i ) ( i = 1 , … , N ) , S p N + 1 = s N + 1 ′ e τ ′ ( N + 1 ) . S\mathbf{p}_i=s'_i\mathbf{e}_{\tau'(i)}\quad(i=1,\ldots,N),\qquad
S\mathbf{p}_{N+1}=s'_{N+1}\mathbf{e}_{\tau'(N+1)}. S p i = s i ′ e τ ′ ( i ) ( i = 1 , … , N ) , S p N + 1 = s N + 1 ′ e τ ′ ( N + 1 ) .
Because τ \tau τ is uniform on S N + 1 \mathcal{S}_{N+1} S N + 1 and P P P is fixed, τ ′ = P ∘ τ \tau'=P\circ\tau τ ′ = P ∘ τ is also uniform on S N + 1 \mathcal{S}_{N+1} S N + 1 .
It remains to verify that the transformed signs ( s 1 ′ , … , s N + 1 ′ ) (s'_1,\ldots,s'_{N+1}) ( s 1 ′ , … , s N + 1 ′ ) are i.i.d. Rademacher and independent of τ ′ \tau' τ ′ . Fix any σ ∈ S N + 1 \sigma\in\mathcal{S}_{N+1} σ ∈ S N + 1 . On the event { τ ′ = σ } \{\tau'=\sigma\} { τ ′ = σ } , the quantities ϵ τ ′ ( i ) = ϵ σ ( i ) \epsilon_{\tau'(i)}=\epsilon_{\sigma(i)} ϵ τ ′ ( i ) = ϵ σ ( i ) are deterministic signs, and therefore
s i ′ = s i ϵ σ ( i ) ( i = 1 , … , N + 1 ) . s'_i=s_i\epsilon_{\sigma(i)}\quad(i=1,\ldots,N+1). s i ′ = s i ϵ σ ( i ) ( i = 1 , … , N + 1 ) .
Since each s i s_i s i is Rademacher, multiplication by a deterministic sign preserves the Rademacher law. Moreover, because this transformation acts coordinate-wise, the collection ( s 1 ′ , … , s N + 1 ′ ) (s'_1,\ldots,s'_{N+1}) ( s 1 ′ , … , s N + 1 ′ ) remains independent under the conditioning τ ′ = σ \tau'=\sigma τ ′ = σ . Hence
( s 1 ′ , … , s N + 1 ′ ) ∣ ( τ ′ = σ ) = d ( s 1 , … , s N + 1 ) , (s'_1,\ldots,s'_{N+1})\mid(\tau'=\sigma)\mathrel{\stackrel{d}{=}}(s_1,\ldots,s_{N+1}), ( s 1 ′ , … , s N + 1 ′ ) ∣ ( τ ′ = σ ) = d ( s 1 , … , s N + 1 ) ,
and this conditional law does not depend on σ \sigma σ . Therefore ( s 1 ′ , … , s N + 1 ′ ) (s'_1,\ldots,s'_{N+1}) ( s 1 ′ , … , s N + 1 ′ ) is a vector of i.i.d. Rademacher variables independent of τ ′ \tau' τ ′ .
Consequently, ω ′ = ( τ ′ , s 1 ′ , … , s N + 1 ′ ) \omega'=(\tau',s'_1,\ldots,s'_{N+1}) ω ′ = ( τ ′ , s 1 ′ , … , s N + 1 ′ ) has the same distribution as ω \omega ω , which proves the claim.
Lemma D.7. For every S ∈ H N + 1 S \in\mathcal{H}_{N+1} S ∈ H N + 1 ,
L ( W ) = L ( G S W G S − 1 ) . (37) \mathcal{L}(\mathbf{W})=\mathcal{L}(G_S\mathbf{W}G_S^{-1}). \tag*{(37)} L ( W ) = L ( G S W G S − 1 ) . (37)
Proof. Fix ( D , x q ) (\mathcal{D},\mathbf{x}_q) ( D , x q ) , and let ω \omega ω generate the position vectors ( p 1 , … , p N , p N + 1 ) (\mathbf{p}_1,\ldots,\mathbf{p}_N,\mathbf{p}_{N+1}) ( p 1 , … , p N , p N + 1 ) . Let ω ′ \omega' ω ′ be as in Lemma D.6 , so that
( p 1 ′ , … , p N ′ , p N + 1 ′ ) = ( S p 1 , … , S p N , S p N + 1 ) (\mathbf{p}'_1,\ldots,\mathbf{p}'_N,\mathbf{p}'_{N+1})=(S\mathbf{p}_1,\ldots,S\mathbf{p}_N,S\mathbf{p}_{N+1}) ( p 1 ′ , … , p N ′ , p N + 1 ′ ) = ( S p 1 , … , S p N , S p N + 1 )
and ω ′ = d ω \omega' \mathrel{\mathop{=}^{d}} \omega ω ′ = d ω .
Because only the p \mathbf{p} p -block changes, we have
h i ′ = [ x i y i p i ′ ] = [ x i y i S p i ] = G S h i , q ′ = [ x q 0 p N + 1 ′ ] = G S q , \mathbf{h}'_i=
\begin{bmatrix}
\mathbf{x}_i\\
y_i\\
\mathbf{p}'_i
\end{bmatrix}
=
\begin{bmatrix}
\mathbf{x}_i\\
y_i\\
S\mathbf{p}_i
\end{bmatrix}
=G_S\mathbf{h}_i,
\qquad
\mathbf{q}'=
\begin{bmatrix}
\mathbf{x}_q\\
0\\
\mathbf{p}'_{N+1}
\end{bmatrix}
=G_S\mathbf{q}, h i ′ = x i y i p i ′ = x i y i S p i = G S h i , q ′ = x q 0 p N + 1 ′ = G S q ,
hence
Z ′ = G S Z . \mathbf{Z}'=G_S\mathbf{Z}. Z ′ = G S Z .
The nearest-neighbor index π \pi π depends only on the data vectors and the query, so it is unchanged. Therefore
( q ( 1 ) ) ′ = [ x q y π p N + 1 ′ + p π ′ ] = [ x q y π S p N + 1 + S p π ] = G S q ( 1 ) . (\mathbf{q}^{(1)})'=
\begin{bmatrix}
\mathbf{x}_q\\
y_\pi\\
\mathbf{p}'_{N+1}+\mathbf{p}'_\pi
\end{bmatrix}
=
\begin{bmatrix}
\mathbf{x}_q\\
y_\pi\\
S\mathbf{p}_{N+1}+S\mathbf{p}_\pi
\end{bmatrix}
=G_S\mathbf{q}^{(1)}. ( q ( 1 ) ) ′ = x q y π p N + 1 ′ + p π ′ = x q y π S p N + 1 + S p π = G S q ( 1 ) .
Applying Lemma D.3 and orthogonality of G S G_S G S , we obtain
ℓ ( G S W G S − 1 ; D , x q , ω ′ ) = ℓ ( W ; D , x q , ω ) . \ell(G_S\mathbf{W}G_S^{-1};\mathcal{D},\mathbf{x}_q,\omega')
=
\ell(\mathbf{W};\mathcal{D},\mathbf{x}_q,\omega). ℓ ( G S W G S − 1 ; D , x q , ω ′ ) = ℓ ( W ; D , x q , ω ) .
Finally, because ω ′ = d ω \omega' \mathrel{\mathop{=}^{d}} \omega ω ′ = d ω ,
E ω [ ℓ ( G S W G S − 1 ; D , x q , ω ) ] = E ω ′ [ ℓ ( G S W G S − 1 ; D , x q , ω ′ ) ] = E ω [ ℓ ( W ; D , x q , ω ) ] . \mathbb{E}_{\omega}\left[\ell(G_S\mathbf{W}G_S^{-1};\mathcal{D},\mathbf{x}_q,\omega)\right]
=
\mathbb{E}_{\omega'}\left[\ell(G_S\mathbf{W}G_S^{-1};\mathcal{D},\mathbf{x}_q,\omega')\right]
=
\mathbb{E}_{\omega}\left[\ell(\mathbf{W};\mathcal{D},\mathbf{x}_q,\omega)\right]. E ω [ ℓ ( G S W G S − 1 ; D , x q , ω ) ] = E ω ′ [ ℓ ( G S W G S − 1 ; D , x q , ω ′ ) ] = E ω [ ℓ ( W ; D , x q , ω ) ] .
Taking expectation over ( D , x q ) (\mathcal{D},\mathbf{x}_q) ( D , x q ) proves (D.15).
Lemma D.8. Let G ∈ G G \in\mathbb{G} G ∈ G . If
L ( W ) = L ( G W G − 1 ) for all W , \mathcal{L}(\mathbf{W})=\mathcal{L}(G\mathbf{W}G^{-1}) \qquad\text{for all }\mathbf{W}, L ( W ) = L ( G W G − 1 ) for all W , then
∇ W L ( G W G − 1 ) = G ( ∇ W L ( W ) ) G − 1 . (38) \nabla_{\mathbf{W}}\mathcal{L}(G\mathbf{W}G^{-1})
=
G(\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}))G^{-1}. \tag*{(38)} ∇ W L ( G W G − 1 ) = G ( ∇ W L ( W )) G − 1 . (38)
Proof. Let W ′ : = G W G − 1 \mathbf{W}':=G\mathbf{W}G^{-1} W ′ := G W G − 1 , and let D ∈ R D × D \mathbf{D}\in\mathbb{R}^{D\times D} D ∈ R D × D be arbitrary. By invariance,
L ( W + ϵ D ) = L ( G ( W + ϵ D ) G − 1 ) = L ( W ′ + ϵ G D G − 1 ) (39) \mathcal{L}(\mathbf{W}+\epsilon\mathbf{D})
=
\mathcal{L}(G(\mathbf{W}+\epsilon\mathbf{D})G^{-1})
=
\mathcal{L}(\mathbf{W}'+\epsilon G\mathbf{D}G^{-1}) \tag*{(39)} L ( W + ϵ D ) = L ( G ( W + ϵ D ) G − 1 ) = L ( W ′ + ϵ G D G − 1 ) (39)
for every sufficiently small ϵ \epsilon ϵ . Differentiating at ϵ = 0 \epsilon=0 ϵ = 0 gives
⟨ ∇ W L ( W ) , D ⟩ F = ⟨ ∇ W L ( W ′ ) , G D G − 1 ⟩ F . \langle\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}),\mathbf{D}\rangle_F=\langle\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}'),\mathbf{G}\mathbf{D}\mathbf{G}^{-1}\rangle_F. ⟨ ∇ W L ( W ) , D ⟩ F = ⟨ ∇ W L ( W ′ ) , GD G − 1 ⟩ F .
Using trace cyclicity,
⟨ ∇ W L ( W ′ ) , G D G − 1 ⟩ F = tr ( ( ∇ W L ( W ′ ) ) ⊤ G D G − 1 ) = tr ( ( G − 1 ∇ W L ( W ′ ) G ) ⊤ D ) = ⟨ G − 1 ∇ W L ( W ′ ) G , D ⟩ F . \begin{aligned}
\langle\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}'),\mathbf{G}\mathbf{D}\mathbf{G}^{-1}\rangle_F
&=\operatorname{tr}\left((\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}'))^\top\mathbf{G}\mathbf{D}\mathbf{G}^{-1}\right)\\
&=\operatorname{tr}\left((\mathbf{G}^{-1}\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}')\mathbf{G})^\top\mathbf{D}\right)\\
&=\langle\mathbf{G}^{-1}\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}')\mathbf{G},\mathbf{D}\rangle_F.
\end{aligned} ⟨ ∇ W L ( W ′ ) , GD G − 1 ⟩ F = tr ( ( ∇ W L ( W ′ ) ) ⊤ GD G − 1 ) = tr ( ( G − 1 ∇ W L ( W ′ ) G ) ⊤ D ) = ⟨ G − 1 ∇ W L ( W ′ ) G , D ⟩ F .
Since D \mathbf{D} D is arbitrary,
∇ W L ( W ) = G − 1 ∇ W L ( W ′ ) G , (40) \nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W})=\mathbf{G}^{-1}\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}')\mathbf{G}, \tag*{(40)} ∇ W L ( W ) = G − 1 ∇ W L ( W ′ ) G , (40)
which is equivalent to (D.16).
Fixed-point set. Define
Fix ( G ) : = { W ∈ R D × D : G W G − 1 = W , ∀ G ∈ G } . \operatorname{Fix}(\mathcal{G}):=\{\mathbf{W}\in\mathbb{R}^{D\times D}:\mathbf{G}\mathbf{W}\mathbf{G}^{-1}=\mathbf{W},\ \forall\mathbf{G}\in\mathcal{G}\}. Fix ( G ) := { W ∈ R D × D : GW G − 1 = W , ∀ G ∈ G } .
Lemma D.9. Let ( W ( t ) ) t ≥ 0 (\mathbf{W}^{(t)})_{t\geq0} ( W ( t ) ) t ≥ 0 be the gradient-descent iterates
W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) , W ( 0 ) = 0. \mathbf{W}^{(t+1)}=\mathbf{W}^{(t)}-\eta\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)}),\qquad\mathbf{W}^{(0)}=0. W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) , W ( 0 ) = 0. Then
W ( t ) ∈ Fix ( G ) for all t ≥ 0. \mathbf{W}^{(t)}\in\operatorname{Fix}(\mathcal{G})\qquad\text{for all }t\geq0. W ( t ) ∈ Fix ( G ) for all t ≥ 0. Proof. By Lemmas D.4 , D.5 , and D.7 , the population objective is invariant under conjugation by every element of G \mathcal{G} G . Since W ( 0 ) = 0 \mathbf{W}^{(0)}=0 W ( 0 ) = 0 , clearly W ( 0 ) ∈ Fix ( G ) \mathbf{W}^{(0)}\in\operatorname{Fix}(\mathcal{G}) W ( 0 ) ∈ Fix ( G ) .
Assume inductively that W ( t ) ∈ Fix ( G ) \mathbf{W}^{(t)}\in\operatorname{Fix}(\mathcal{G}) W ( t ) ∈ Fix ( G ) . Fix any G ∈ G \mathbf{G}\in\mathcal{G} G ∈ G . Then
G W ( t ) G − 1 = W ( t ) . \mathbf{G}\mathbf{W}^{(t)}\mathbf{G}^{-1}=\mathbf{W}^{(t)}. G W ( t ) G − 1 = W ( t ) . Applying Lemma D.8 ,
∇ W L ( W ( t ) ) = ∇ W L ( G W ( t ) G − 1 ) = G ( ∇ W L ( W ( t ) ) ) G − 1 . \nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)})=\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{G}\mathbf{W}^{(t)}\mathbf{G}^{-1})=\mathbf{G}(\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)}))\mathbf{G}^{-1}. ∇ W L ( W ( t ) ) = ∇ W L ( G W ( t ) G − 1 ) = G ( ∇ W L ( W ( t ) )) G − 1 . Therefore the gradient is also fixed by G \mathbf{G} G . Consequently,
G W ( t + 1 ) G − 1 = G ( W ( t ) − η ∇ W L ( W ( t ) ) ) G − 1 = W ( t ) − η ∇ W L ( W ( t ) ) = W ( t + 1 ) . \mathbf{G}\mathbf{W}^{(t+1)}\mathbf{G}^{-1}=\mathbf{G}\left(\mathbf{W}^{(t)}-\eta\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)})\right)\mathbf{G}^{-1}=\mathbf{W}^{(t)}-\eta\nabla_{\mathbf{W}}\mathcal{L}(\mathbf{W}^{(t)})=\mathbf{W}^{(t+1)}. G W ( t + 1 ) G − 1 = G ( W ( t ) − η ∇ W L ( W ( t ) ) ) G − 1 = W ( t ) − η ∇ W L ( W ( t ) ) = W ( t + 1 ) . Since G ∈ G \mathbf{G}\in\mathcal{G} G ∈ G was arbitrary, W ( t + 1 ) ∈ Fix ( G ) \mathbf{W}^{(t+1)}\in\operatorname{Fix}(\mathcal{G}) W ( t + 1 ) ∈ Fix ( G ) . The claim follows by induction.
Lemma D.10. If W ∈ Fix ( G ) \mathbf{W}\in\operatorname{Fix}(\mathcal{G}) W ∈ Fix ( G ) , then there exist scalars α , γ , β ∈ R \alpha,\gamma,\beta\in\mathbb{R} α , γ , β ∈ R such that
W = diag ( α I d , γ , β I N + 1 ) . (41) \mathbf{W}=\operatorname{diag}(\alpha I_d,\gamma,\beta I_{N+1}). \tag*{(41)} W = diag ( α I d , γ , β I N + 1 ) . (41)
Proof. Write W \mathbf{W} W in ( x , y , p ) (x,y,p) ( x , y , p ) -block form:
W = [ W x x W x y W x p W y x W y y W y p W p x W p y W p p ] . \mathbf{W} =
\begin{bmatrix}
\mathbf{W}_{xx} & \mathbf{W}_{xy} & \mathbf{W}_{xp} \\
\mathbf{W}_{yx} & \mathbf{W}_{yy} & \mathbf{W}_{yp} \\
\mathbf{W}_{px} & \mathbf{W}_{py} & \mathbf{W}_{pp}
\end{bmatrix}. W = W xx W y x W p x W x y W y y W p y W x p W y p W pp .
Step 1: constraints from data rotations. Since G R W G R − 1 = W G_R\mathbf{W}G_R^{-1}=\mathbf{W} G R W G R − 1 = W for all R ∈ O ( d ) R\in O(d) R ∈ O ( d ) ,
G R W G R − 1 = [ R W x x R T R W x y R W x p W y x R T W y y W y p W p x R T W p y W p p ] = W . G_R\mathbf{W}G_R^{-1} =
\begin{bmatrix}
R\mathbf{W}_{xx}R^{\mathsf{T}} & R\mathbf{W}_{xy} & R\mathbf{W}_{xp} \\
\mathbf{W}_{yx}R^{\mathsf{T}} & \mathbf{W}_{yy} & \mathbf{W}_{yp} \\
\mathbf{W}_{px}R^{\mathsf{T}} & \mathbf{W}_{py} & \mathbf{W}_{pp}
\end{bmatrix}
= \mathbf{W}. G R W G R − 1 = R W xx R T W y x R T W p x R T R W x y W y y W p y R W x p W y p W pp = W .
Thus,
R W x x R T = W x x , R W x y = W x y , R W x p = W x p , R\mathbf{W}_{xx}R^{\mathsf{T}}=\mathbf{W}_{xx},\qquad
R\mathbf{W}_{xy}=\mathbf{W}_{xy},\qquad
R\mathbf{W}_{xp}=\mathbf{W}_{xp}, R W xx R T = W xx , R W x y = W x y , R W x p = W x p ,
W y x R T = W y x , W p x R T = W p x , ∀ R ∈ O ( d ) . \mathbf{W}_{yx}R^{\mathsf{T}}=\mathbf{W}_{yx},\qquad
\mathbf{W}_{px}R^{\mathsf{T}}=\mathbf{W}_{px},\qquad
\forall R\in O(d). W y x R T = W y x , W p x R T = W p x , ∀ R ∈ O ( d ) .
We now solve these constraints.
First, R W x y = W x y R\mathbf{W}_{xy}=\mathbf{W}_{xy} R W x y = W x y for every R ∈ O ( d ) R\in O(d) R ∈ O ( d ) implies W x y = 0 \mathbf{W}_{xy}=0 W x y = 0 . Indeed, fix any unit vector u ∈ R d u\in\mathbb{R}^{d} u ∈ R d , and let
R u : = I d − 2 u u T R_u:=I_d-2uu^{\mathsf{T}} R u := I d − 2 u u T
be the reflection across u ⊥ u^\perp u ⊥ . Then R u u = − u R_u u=-u R u u = − u . Applying R u W x y = W x y R_u\mathbf{W}_{xy}=\mathbf{W}_{xy} R u W x y = W x y and left-multiplying by u T u^{\mathsf{T}} u T , we obtain
− u T W x y = u T W x y , -u^{\mathsf{T}}\mathbf{W}_{xy}=u^{\mathsf{T}}\mathbf{W}_{xy}, − u T W x y = u T W x y ,
hence u T W x y = 0 u^{\mathsf{T}}\mathbf{W}_{xy}=0 u T W x y = 0 . Since u u u is arbitrary, W x y = 0 \mathbf{W}_{xy}=0 W x y = 0 . The same reflection argument yields
W x p = 0 , W y x = 0 , W p x = 0. \mathbf{W}_{xp}=0,\qquad\mathbf{W}_{yx}=0,\qquad\mathbf{W}_{px}=0. W x p = 0 , W y x = 0 , W p x = 0.
It remains to determine W x x \mathbf{W}_{xx} W xx . The relation R W x x R T = W x x R\mathbf{W}_{xx}R^{\mathsf{T}}=\mathbf{W}_{xx} R W xx R T = W xx for all R ∈ O ( d ) R\in O(d) R ∈ O ( d ) implies that W x x \mathbf{W}_{xx} W xx commutes with all orthogonal transformations. In particular:
Hence W x x = α I d \mathbf{W}_{xx}=\alpha I_d W xx = α I d for some α ∈ R \alpha\in\mathbb{R} α ∈ R .
Step 2: constraints from label flips. Since G − 1 W G − 1 − 1 = W G_{-1}\mathbf{W}G_{-1}^{-1}=\mathbf{W} G − 1 W G − 1 − 1 = W ,
G − 1 W G − 1 − 1 = [ W x x − W x y W x p − W y x W y y − W y p W p x − W p y W p p ] = W . G_{-1}\mathbf{W}G_{-1}^{-1} =
\begin{bmatrix}
\mathbf{W}_{xx} & -\mathbf{W}_{xy} & \mathbf{W}_{xp} \\
-\mathbf{W}_{yx} & \mathbf{W}_{yy} & -\mathbf{W}_{yp} \\
\mathbf{W}_{px} & -\mathbf{W}_{py} & \mathbf{W}_{pp}
\end{bmatrix}
= \mathbf{W}. G − 1 W G − 1 − 1 = W xx − W y x W p x − W x y W y y − W p y W x p − W y p W pp = W .
Therefore
W x y = W y x = W y p = W p y = 0. \mathbf{W}_{xy}=\mathbf{W}_{yx}=\mathbf{W}_{yp}=\mathbf{W}_{py}=0. W x y = W y x = W y p = W p y = 0.
Combined with Step 1, this shows that all cross-couplings between x x x , y y y , and p p p vanish, except that W y y \mathbf{W}_{yy} W y y and W p p \mathbf{W}_{pp} W pp remain unconstrained at this stage.
Step 3: constraints from signed permutations on the position block. For every S ∈ H N + 1 S \in\mathcal{H}_{N+1} S ∈ H N + 1 , the relation G S W G S − 1 = W G_S W G_S^{-1} = W G S W G S − 1 = W implies
S W p p S − 1 = W p p . S W_{pp} S^{-1} = W_{pp}. S W pp S − 1 = W pp .
We claim that this forces W p p W_{pp} W pp to be a scalar multiple of the identity. First, take S = D ( j ) S = D^{(j)} S = D ( j ) , the diagonal sign-flip matrix that changes only the sign of the j j j -th coordinate. Then
D ( j ) W p p D ( j ) = W p p D^{(j)} W_{pp} D^{(j)} = W_{pp} D ( j ) W pp D ( j ) = W pp
implies that every off-diagonal entry in row j j j and column j j j must vanish. Since j j j is arbitrary, all off-diagonal entries of W p p W_{pp} W pp vanish, so W p p W_{pp} W pp is diagonal. Next, take S = P i j S = P_{ij} S = P ij , the permutation matrix that swaps coordinates i i i and j j j . Then
P i j W p p P i j − 1 = W p p P_{ij} W_{pp} P_{ij}^{-1} = W_{pp} P ij W pp P ij − 1 = W pp
implies that the i i i -th and j j j -th diagonal entries of W p p W_{pp} W pp are equal. Since i , j i,j i , j are arbitrary, all diagonal entries coincide. Hence
W p p = β I N + 1 W_{pp} = \beta I_{N+1} W pp = β I N + 1
for some β ∈ R \beta\in\mathbb{R} β ∈ R . Putting together Steps 1–3, we conclude that
W = diag ( α I d , γ , β I N + 1 ) W = \operatorname{diag}(\alpha I_d,\gamma,\beta I_{N+1}) W = diag ( α I d , γ , β I N + 1 )
for some scalars α , γ , β ∈ R \alpha,\gamma,\beta\in\mathbb{R} α , γ , β ∈ R .
Theorem D.11. Let ( W ( t ) ) t ≥ 0 (W^{(t)})_{t\geq0} ( W ( t ) ) t ≥ 0 be the gradient-descent iterates (D.9) initialized at W ( 0 ) = 0 W^{(0)} = 0 W ( 0 ) = 0 . Then for every t ≥ 0 t \geq0 t ≥ 0 , there exist scalars α t , β t ∈ R \alpha_t,\beta_t \in\mathbb{R} α t , β t ∈ R such that
W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) . (42) W^{(t)} = \operatorname{diag}(\alpha^{(t)} I_d,0,\beta^{(t)} I_{N+1}). \tag*{(42)} W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) . (42) Equivalently, the gradient-descent trajectory remains in the two-dimensional linear subspace
M = { diag ( α I d , 0 , β I N + 1 ) : α , β ∈ R } . \mathcal{M} = \{\operatorname{diag}(\alpha I_d,0,\beta I_{N+1}):\ \alpha,\beta\in\mathbb{R}\}. M = { diag ( α I d , 0 , β I N + 1 ) : α , β ∈ R } .
Proof. By Lemma D.9 , each iterate W ( t ) W^{(t)} W ( t ) belongs to Fix ( G ) \operatorname{Fix}(\mathcal{G}) Fix ( G ) . Therefore, by Lemma D.10 , there exist scalars α ( t ) , γ ( t ) , β ( t ) \alpha^{(t)},\gamma^{(t)},\beta^{(t)} α ( t ) , γ ( t ) , β ( t ) such that
W ( t ) = diag ( α ( t ) I d , γ ( t ) , β ( t ) I N + 1 ) . W^{(t)} = \operatorname{diag}(\alpha^{(t)}I_d,\gamma^{(t)},\beta^{(t)}I_{N+1}). W ( t ) = diag ( α ( t ) I d , γ ( t ) , β ( t ) I N + 1 ) .
On the other hand, Lemma D.2 shows that the y y y -column of every iterate vanishes:
( W ( t ) ) : , y = 0 for all t ≥ 0. (W^{(t)})_{:,y} = 0 \qquad\text{for all } t \geq0. ( W ( t ) ) : , y = 0 for all t ≥ 0.
For a matrix of the form diag ( α ( t ) I d , γ ( t ) , β ( t ) I N + 1 ) \operatorname{diag}(\alpha^{(t)}I_d,\gamma^{(t)},\beta^{(t)}I_{N+1}) diag ( α ( t ) I d , γ ( t ) , β ( t ) I N + 1 ) , the only possibly nonzero entry in the y y y -th column is the diagonal entry γ ( t ) \gamma^{(t)} γ ( t ) . Hence ( W ( t ) ) : , y = 0 (W^{(t)})_{:,y} = 0 ( W ( t ) ) : , y = 0 implies
γ ( t ) = 0. \gamma^{(t)} = 0. γ ( t ) = 0.
Therefore
W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) for all t ≥ 0 , \mathbf{W}^{(t)}=\operatorname{diag}\left(\alpha^{(t)}\mathbf{I}_d,0,\beta^{(t)}\mathbf{I}_{N+1}\right) \quad\text{for all } t\ge0, W ( t ) = diag ( α ( t ) I d , 0 , β ( t ) I N + 1 ) for all t ≥ 0 ,
which proves the claim.
Parameter Divergence
By Theorem D.11 , the population gradient-descent iterates remain in the two-dimensional manifold
M = { diag ( α I d , 0 , β I N + 1 ) : α , β ∈ R } . \mathcal{M}=\left\{\operatorname{diag}\left(\alpha\mathbf{I}_d,0,\beta\mathbf{I}_{N+1}\right):\alpha,\beta\in\mathbb{R}\right\}. M = { diag ( α I d , 0 , β I N + 1 ) : α , β ∈ R } .
Hence the matrix recursion for W ( t ) \mathbf{W}^{(t)} W ( t ) reduces exactly to a scalar recursion for the pair ( α ( t ) , β ( t ) ) (\alpha^{(t)},\beta^{(t)}) ( α ( t ) , β ( t ) ) . In this subsection, we analyze this reduced two-parameter dynamical system and prove that
α ( t ) → + ∞ , β ( t ) → − ∞ . \alpha^{(t)}\to+\infty,\qquad\beta^{(t)}\to-\infty. α ( t ) → + ∞ , β ( t ) → − ∞.
The analysis proceeds in three main steps:
Step 1: We first rewrite the population loss as an exact expectation over the inner products
U i : = x i T x q , i ∈ [ N ] , U_i:=\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q,\qquad i\in[N], U i := x i T x q , i ∈ [ N ] ,
thereby integrating out the label randomness and the stochastic positional-encoding randomness. This yields a reduced objective L ( α , β ) \mathcal{L}(\alpha,\beta) L ( α , β ) .
Step 2: We show that the region
[ 0 , ∞ ) × ( − ∞ , 0 ] [0,\infty)\times(-\infty,0] [ 0 , ∞ ) × ( − ∞ , 0 ]
is forward invariant under gradient descent, and that throughout this region the β \beta β -gradient is strictly positive.
Step 3: We then prove by contradiction that β ( t ) → − ∞ \beta^{(t)}\to-\infty β ( t ) → − ∞ . Once β ( t ) → − ∞ \beta^{(t)}\to-\infty β ( t ) → − ∞ is known, we prove that α ( t ) \alpha^{(t)} α ( t ) cannot remain in any compact interval, and hence α ( t ) → + ∞ \alpha^{(t)}\to+\infty α ( t ) → + ∞ .
Recall the notation
π : = π ( 1 ) , Z : = Z ( 0 ) , q : = q ( 0 ) , q ^ : = q ^ ( 1 ) = TF ( Z ; W ) : − 1 . \pi:=\pi^{(1)},\qquad\mathbf{Z}:=\mathbf{Z}^{(0)},\qquad\mathbf{q}:=\mathbf{q}^{(0)},\qquad\widehat{\mathbf{q}}:=\widehat{\mathbf{q}}^{(1)}=\operatorname{TF}(\mathbf{Z};\mathbf{W})_{:-1}. π := π ( 1 ) , Z := Z ( 0 ) , q := q ( 0 ) , q := q ( 1 ) = TF ( Z ; W ) : − 1 .
Since all vectors lie on the unit sphere,
∥ x i − x q ∥ 2 = 2 − 2 x i T x q , \left\|\mathbf{x}_i-\mathbf{x}_q\right\|^2=2-2\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q, ∥ x i − x q ∥ 2 = 2 − 2 x i T x q ,
hence π \pi π is a nearest-neighbor index if and only if it maximizes U i = x i T x q U_i=\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q U i = x i T x q . Conditional on x q \mathbf{x}_q x q , the random variables U i U_i U i are i.i.d. with a continuous law on ( − 1 , 1 ) (-1,1) ( − 1 , 1 ) when d ≥ 2 d\ge2 d ≥ 2 ; therefore π = arg max i ∈ [ N ] U i \pi=\operatorname*{arg\,max}_{i\in[N]}U_i π = arg max i ∈ [ N ] U i is unique almost surely. We work on this full-probability event from now on.
Lemma D.12. For every realization of ( x i , y i , p i ) i = 1 N + 1 (\mathbf{x}_i,\mathbf{y}_i,\mathbf{p}_i)_{i=1}^{N+1} ( x i , y i , p i ) i = 1 N + 1 and every ( α , β ) ∈ R 2 (\alpha,\beta)\in\mathbb{R}^2 ( α , β ) ∈ R 2 , let
a ( α , β ) : = softmax ( Z T W ( α , β ) q ) = ( a 1 ( α , β ) , … , a N ( α , β ) , a 0 ( α , β ) ) T \mathbf{a}(\alpha,\beta):=\operatorname{softmax}\left(\mathbf{Z}^{\mathsf{T}}\mathbf{W}(\alpha,\beta)\mathbf{q}\right)=\left(a_1(\alpha,\beta),\ldots,a_N(\alpha,\beta),a_0(\alpha,\beta)\right)^{\mathsf{T}} a ( α , β ) := softmax ( Z T W ( α , β ) q ) = ( a 1 ( α , β ) , … , a N ( α , β ) , a 0 ( α , β ) ) T be the attention weights. Then
a i ( α , β ) = e α U i e α + β + ∑ j = 1 N e α U j , a 0 ( α , β ) = e α + β e α + β + ∑ j = 1 N e α U j . a_i(\alpha,\beta)=\frac{e^{\alpha U_i}}{e^{\alpha+\beta}+\sum_{j=1}^{N}e^{\alpha U_j}},\qquad a_0(\alpha,\beta)=\frac{e^{\alpha+\beta}}{e^{\alpha+\beta}+\sum_{j=1}^{N}e^{\alpha U_j}}. a i ( α , β ) = e α + β + ∑ j = 1 N e α U j e α U i , a 0 ( α , β ) = e α + β + ∑ j = 1 N e α U j e α + β .
Moreover,
q ^ ( α , β ) = [ x q ∑ i = 1 N a i ( α , β ) y i ( 1 + a 0 ( α , β ) ) p N + 1 + ∑ i = 1 N a i ( α , β ) p i ] . \widehat{\mathbf{q}}(\alpha,\beta)=
\begin{bmatrix}
\mathbf{x}_q\\
\sum_{i=1}^{N}a_i(\alpha,\beta)y_i\\
(1+a_0(\alpha,\beta))\mathbf{p}_{N+1}+\sum_{i=1}^{N}a_i(\alpha,\beta)\mathbf{p}_i
\end{bmatrix}. q ( α , β ) = x q ∑ i = 1 N a i ( α , β ) y i ( 1 + a 0 ( α , β )) p N + 1 + ∑ i = 1 N a i ( α , β ) p i .
Proof. Since
W ( α , β ) = diag ( α I d , 0 , β I N + 1 ) , \mathbf{W}(\alpha,\beta)=\operatorname{diag}(\alpha\mathbf{I}_d,0,\beta\mathbf{I}_{N+1}), W ( α , β ) = diag ( α I d , 0 , β I N + 1 ) ,
the label coordinate does not contribute to the score. For i ∈ [ N ] i\in[N] i ∈ [ N ] ,
h i T W ( α , β ) q ( 0 ) = α x i T x q + β p i T p N + 1 . \mathbf{h}_i^{\mathsf{T}}\mathbf{W}(\alpha,\beta)\mathbf{q}^{(0)}
=\alpha\mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q+\beta\mathbf{p}_i^{\mathsf{T}}\mathbf{p}_{N+1}. h i T W ( α , β ) q ( 0 ) = α x i T x q + β p i T p N + 1 .
Because τ \tau τ is a permutation, the vectors p 1 , … , p N + 1 \mathbf{p}_1,\ldots,\mathbf{p}_{N+1} p 1 , … , p N + 1 are orthonormal up to signs, so p i T p N + 1 = 0 \mathbf{p}_i^{\mathsf{T}}\mathbf{p}_{N+1}=0 p i T p N + 1 = 0 for i ≤ N i\leq N i ≤ N . Hence
h i T W ( α , β ) q ( 0 ) = α U i . \mathbf{h}_i^{\mathsf{T}}\mathbf{W}(\alpha,\beta)\mathbf{q}^{(0)}=\alpha U_i. h i T W ( α , β ) q ( 0 ) = α U i .
Similarly,
q ( 0 ) T W ( α , β ) q ( 0 ) = α ∥ x q ∥ 2 + β ∥ p N + 1 ∥ 2 = α + β . \mathbf{q}^{(0)\mathsf{T}}\mathbf{W}(\alpha,\beta)\mathbf{q}^{(0)}
=\alpha\lVert\mathbf{x}_q\rVert^2+\beta\lVert\mathbf{p}_{N+1}\rVert^2=\alpha+\beta. q ( 0 ) T W ( α , β ) q ( 0 ) = α ∥ x q ∥ 2 + β ∥ p N + 1 ∥ 2 = α + β .
Substituting these scores into the softmax gives the stated formula for a ( α , β ) \mathbf{a}(\alpha,\beta) a ( α , β ) .
Next,
V h i = [ 0 y i p i ] , V q ( 0 ) = [ 0 0 p N + 1 ] . \mathbf{V}\mathbf{h}_i=
\begin{bmatrix}
0\\
y_i\\
\mathbf{p}_i
\end{bmatrix},
\qquad
\mathbf{V}\mathbf{q}^{(0)}=
\begin{bmatrix}
0\\
0\\
\mathbf{p}_{N+1}
\end{bmatrix}. V h i = 0 y i p i , V q ( 0 ) = 0 0 p N + 1 .
Therefore
q ^ ( α , β ) = q ( 0 ) + ∑ i = 1 N a i ( α , β ) V h i + a 0 ( α , β ) V q ( 0 ) , \widehat{\mathbf{q}}(\alpha,\beta)=\mathbf{q}^{(0)}+\sum_{i=1}^{N}a_i(\alpha,\beta)\mathbf{V}\mathbf{h}_i+a_0(\alpha,\beta)\mathbf{V}\mathbf{q}^{(0)}, q ( α , β ) = q ( 0 ) + i = 1 ∑ N a i ( α , β ) V h i + a 0 ( α , β ) V q ( 0 ) ,
which is exactly
q ^ ( α , β ) = [ x q ∑ i = 1 N a i ( α , β ) y i ( 1 + a 0 ( α , β ) ) p N + 1 + ∑ i = 1 N a i ( α , β ) p i ] . \widehat{\mathbf{q}}(\alpha,\beta)=
\begin{bmatrix}
\mathbf{x}_q\\
\sum_{i=1}^{N}a_i(\alpha,\beta)y_i\\
(1+a_0(\alpha,\beta))\mathbf{p}_{N+1}+\sum_{i=1}^{N}a_i(\alpha,\beta)\mathbf{p}_i
\end{bmatrix}. q ( α , β ) = x q ∑ i = 1 N a i ( α , β ) y i ( 1 + a 0 ( α , β )) p N + 1 + ∑ i = 1 N a i ( α , β ) p i .
:::
Lemma D.13. The sample loss satisfies
ℓ ( α , β ) = 1 2 ∥ r ( α , β ) ∥ 2 = 1 2 ( ∑ i = 1 N a i y i − y π ) 2 + 1 2 ∥ a 0 p N + 1 + ∑ i = 1 N a i p i − p π ∥ 2 . \ell(\alpha,\beta)=\frac{1}{2}\lVert r(\alpha,\beta)\rVert^2
=\frac{1}{2}\left(\sum_{i=1}^{N}a_i y_i-y_{\pi}\right)^2
+\frac{1}{2}\left\lVert a_0\mathbf{p}_{N+1}+\sum_{i=1}^{N}a_i\mathbf{p}_i-\mathbf{p}_{\pi}\right\rVert^2. ℓ ( α , β ) = 2 1 ∥ r ( α , β ) ∥ 2 = 2 1 ( i = 1 ∑ N a i y i − y π ) 2 + 2 1 a 0 p N + 1 + i = 1 ∑ N a i p i − p π 2 . Moreover, for every ( α , β ) ∈ R 2 (\alpha,\beta)\in\mathbb{R}^2 ( α , β ) ∈ R 2 , let
G : = σ ( x 1 , … , x N , x q , π ) , \mathcal{G}:=\sigma(\mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q,\pi), G := σ ( x 1 , … , x N , x q , π ) , then
φ ( U 1 , … , U N ; α , β ) : = E [ ℓ ( α , β ) ∣ G ] = 1 + ∑ i = 1 N a i ( α , β ) 2 + 1 2 a 0 ( α , β ) 2 − 2 a π ( α , β ) . \varphi(U_1,\ldots,U_N;\alpha,\beta):=\mathbb{E}\left[\ell(\alpha,\beta)\mid\mathcal{G}\right]
=1+\sum_{i=1}^{N}a_i(\alpha,\beta)^2+\frac{1}{2}a_0(\alpha,\beta)^2-2a_{\pi}(\alpha,\beta). φ ( U 1 , … , U N ; α , β ) := E [ ℓ ( α , β ) ∣ G ] = 1 + i = 1 ∑ N a i ( α , β ) 2 + 2 1 a 0 ( α , β ) 2 − 2 a π ( α , β ) .
Hence, the population loss is exactly
L ( α , β ) = E [ φ ( U 1 , … , U N ; α , β ) ] . \mathcal{L}(\alpha,\beta)=\mathbb{E}\left[\varphi(U_1,\ldots,U_N;\alpha,\beta)\right]. L ( α , β ) = E [ φ ( U 1 , … , U N ; α , β ) ] .
Proof. By Lemma D.12 ,
r ( α , β ) = q ^ ( α , β ) − q ( 1 ) = [ 0 ∑ i = 1 N a i y i − y π a 0 p N + 1 + ∑ i = 1 N a i p i − p π ] . \mathbf{r}(\alpha,\beta)=\widehat{\mathbf{q}}(\alpha,\beta)-\mathbf{q}^{(1)}
=
\begin{bmatrix}
0\\
\sum_{i=1}^{N}a_i y_i-y_\pi\\
a_0\mathbf{p}_{N+1}+\sum_{i=1}^{N}a_i\mathbf{p}_i-\mathbf{p}_\pi
\end{bmatrix}. r ( α , β ) = q ( α , β ) − q ( 1 ) = 0 ∑ i = 1 N a i y i − y π a 0 p N + 1 + ∑ i = 1 N a i p i − p π .
The x x x -block is therefore identically zero. For the positional block, write
r p : = a 0 p N + 1 + ∑ i = 1 N a i p i − p π . \mathbf{r}_p:=a_0\mathbf{p}_{N+1}+\sum_{i=1}^{N}a_i\mathbf{p}_i-\mathbf{p}_\pi. r p := a 0 p N + 1 + i = 1 ∑ N a i p i − p π .
Since
p i T p j = δ i j \mathbf{p}_i^{\mathsf{T}}\mathbf{p}_j=\delta_{ij} p i T p j = δ ij
for every realization of ( τ , s 1 , … , s N + 1 ) (\tau,s_1,\ldots,s_{N+1}) ( τ , s 1 , … , s N + 1 ) , all cross terms vanish exactly. Hence
∥ r p ∥ 2 = a 0 2 + ∑ i ≠ π a i 2 + ( a π − 1 ) 2 = a 0 2 + ∑ i = 1 N a i 2 + 1 − 2 a π . \lVert\mathbf{r}_p\rVert^2=a_0^2+\sum_{i\ne\pi}a_i^2+(a_\pi-1)^2=a_0^2+\sum_{i=1}^{N}a_i^2+1-2a_\pi. ∥ r p ∥ 2 = a 0 2 + i = π ∑ a i 2 + ( a π − 1 ) 2 = a 0 2 + i = 1 ∑ N a i 2 + 1 − 2 a π .
For the label block, decompose
∑ i = 1 N a i y i − y π = ∑ i ≠ π a i y i + ( a π − 1 ) y π . \sum_{i=1}^{N}a_i y_i-y_\pi=\sum_{i\ne\pi}a_i y_i+(a_\pi-1)y_\pi. i = 1 ∑ N a i y i − y π = i = π ∑ a i y i + ( a π − 1 ) y π .
Therefore
( ∑ i = 1 N a i y i − y π ) 2 = ∑ i ≠ π a i 2 + ( a π − 1 ) 2 + 2 ∑ i < j i , j ≠ π a i a j y i y j + 2 ( a π − 1 ) ∑ i ≠ π a i y i y π . \left(\sum_{i=1}^{N}a_i y_i-y_\pi\right)^2
=\sum_{i\ne\pi}a_i^2+(a_\pi-1)^2+2\sum_{\substack{i<j\\i,j\ne\pi}}a_i a_j y_i y_j+2(a_\pi-1)\sum_{i\ne\pi}a_i y_i y_\pi. ( i = 1 ∑ N a i y i − y π ) 2 = i = π ∑ a i 2 + ( a π − 1 ) 2 + 2 i < j i , j = π ∑ a i a j y i y j + 2 ( a π − 1 ) i = π ∑ a i y i y π .
Conditional on G \mathcal{G} G , by Assumption 5.1 , we have
E [ y i y j ∣ G ] = 0 ( i ≠ j ) , E [ y i 2 ∣ G ] = 1. \mathbb{E}[y_i y_j\mid\mathcal{G}]=0\quad(i\ne j),\qquad\mathbb{E}[y_i^2\mid\mathcal{G}]=1. E [ y i y j ∣ G ] = 0 ( i = j ) , E [ y i 2 ∣ G ] = 1.
Taking conditional expectation therefore yields
E [ ( ∑ i = 1 N a i y i − y π ) 2 ∣ G ] = ∑ i ≠ π a i 2 + ( a π − 1 ) 2 = ∑ i = 1 N a i 2 + 1 − 2 a π . \mathbb{E}\left[\left.\left(\sum_{i=1}^{N}a_i y_i-y_\pi\right)^2\right|\mathcal{G}\right]
=\sum_{i\ne\pi}a_i^2+(a_\pi-1)^2
=\sum_{i=1}^{N}a_i^2+1-2a_\pi. E ( i = 1 ∑ N a i y i − y π ) 2 G = i = π ∑ a i 2 + ( a π − 1 ) 2 = i = 1 ∑ N a i 2 + 1 − 2 a π .
Combining the two block computations gives
E [ ℓ ( α , β ) ∣ G ] = 1 2 ( ∑ i = 1 N a i 2 + 1 − 2 a π ) + 1 2 ( a 0 2 + ∑ i = 1 N a i 2 + 1 − 2 a π ) = 1 + ∑ i = 1 N a i 2 + 1 2 a 0 2 − 2 a π . \begin{aligned}
\mathbb{E}[\ell(\alpha,\beta)\mid\mathcal{G}] = \frac{1}{2}\left(\sum_{i=1}^{N}a_i^2+1-2a_\pi\right)+\frac{1}{2}\left(a_0^2+\sum_{i=1}^{N}a_i^2+1-2a_\pi\right) \\
&=1+\sum_{i=1}^{N}a_i^2+\frac{1}{2}a_0^2-2a_\pi.
\end{aligned} E [ ℓ ( α , β ) ∣ G ] = 2 1 ( i = 1 ∑ N a i 2 + 1 − 2 a π ) + 2 1 ( a 0 2 + i = 1 ∑ N a i 2 + 1 − 2 a π ) = 1 + i = 1 ∑ N a i 2 + 2 1 a 0 2 − 2 a π .
The formula for L \mathcal{L} L now follows from the tower property:
L ( α , β ) = E [ E [ ℓ ( α , β ) ∣ G ] ] = E [ φ ( U 1 , … , U N ; α , β ) ] . \mathcal{L}(\alpha,\beta)=\mathbb{E}\left[\mathbb{E}[\ell(\alpha,\beta)\mid\mathcal{G}]\right]=\mathbb{E}[\varphi(U_1,\ldots,U_N;\alpha,\beta)]. L ( α , β ) = E [ E [ ℓ ( α , β ) ∣ G ] ] = E [ φ ( U 1 , … , U N ; α , β )] .
Lemma D.14. Fix a realization of U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N , and define
u ( α , β ) : = ( α U 1 , … , α U N , α + β ) ∈ R N + 1 , a ( α , β ) : = ( a 1 , … , a N , a 0 ) : = softmax ( u ) . \mathbf{u}(\alpha,\beta):=(\alpha U_1,\ldots,\alpha U_N,\alpha+\beta)\in\mathbb{R}^{N+1},\qquad\mathbf{a}(\alpha,\beta):=(a_1,\ldots,a_N,a_0):=\operatorname{softmax}(\mathbf{u}). u ( α , β ) := ( α U 1 , … , α U N , α + β ) ∈ R N + 1 , a ( α , β ) := ( a 1 , … , a N , a 0 ) := softmax ( u ) . Then for θ ∈ { α , β } \theta\in\{\alpha,\beta\} θ ∈ { α , β } ,
∂ θ a j = a j ( ∂ θ u j − ∑ k = 0 N a k ∂ θ u k ) . \partial_\theta a_j=a_j\left(\partial_\theta u_j-\sum_{k=0}^{N}a_k\partial_\theta u_k\right). ∂ θ a j = a j ( ∂ θ u j − k = 0 ∑ N a k ∂ θ u k ) . For θ , θ ′ ∈ { α , β } \theta,\theta'\in\{\alpha,\beta\} θ , θ ′ ∈ { α , β } ,
∂ θ ′ ∂ θ a j = ( ∂ θ ′ a j ) ( ∂ θ u j − ∑ k = 0 N a k ∂ θ u k ) − a j ∑ k = 0 N ( ∂ θ ′ a k ) ∂ θ u k . \partial_{\theta'}\partial_\theta a_j=(\partial_{\theta'}a_j)\left(\partial_\theta u_j-\sum_{k=0}^{N}a_k\partial_\theta u_k\right)-a_j\sum_{k=0}^{N}(\partial_{\theta'}a_k)\partial_\theta u_k. ∂ θ ′ ∂ θ a j = ( ∂ θ ′ a j ) ( ∂ θ u j − k = 0 ∑ N a k ∂ θ u k ) − a j k = 0 ∑ N ( ∂ θ ′ a k ) ∂ θ u k . Moreover, for every j j j and θ \theta θ ,
∣ ∂ θ a j ∣ ≤ 2 a j , ∣ ∂ θ ′ ∂ θ a j ∣ ≤ 6 a j . \lvert\partial_\theta a_j\rvert\le2a_j,\qquad\lvert\partial_{\theta'}\partial_\theta a_j\rvert\le6a_j. ∣ ∂ θ a j ∣ ≤ 2 a j , ∣ ∂ θ ′ ∂ θ a j ∣ ≤ 6 a j . Consequently, for the reduced sample loss φ \varphi φ of Lemma D.13 ,
∣ ∂ θ φ ∣ ≤ 10 , ∣ ∂ θ ′ ∂ θ φ ∣ ≤ 42 ( θ , θ ′ ∈ { α , β } ) . \lvert\partial_\theta\varphi\rvert\le10,\qquad\lvert\partial_{\theta'}\partial_\theta\varphi\rvert\le42\qquad(\theta,\theta'\in\{\alpha,\beta\}). ∣ ∂ θ φ ∣ ≤ 10 , ∣ ∂ θ ′ ∂ θ φ ∣ ≤ 42 ( θ , θ ′ ∈ { α , β }) .
Proof. By the definition of u \mathbf{u} u ,
∂ α u i = U i , i ∈ [ N ] , ∂ α u 0 = 1 , \partial_\alpha u_i=U_i,\quad i\in[N],\qquad\partial_\alpha u_0=1, ∂ α u i = U i , i ∈ [ N ] , ∂ α u 0 = 1 ,
and
∂ β u i = 0 , i ∈ [ N ] , ∂ β u 0 = 1. \partial_\beta u_i=0,\quad i\in[N],\qquad\partial_\beta u_0=1. ∂ β u i = 0 , i ∈ [ N ] , ∂ β u 0 = 1.
Differentiating
a j = e u j ∑ ℓ = 0 N e u ℓ a_j=\frac{e^{u_j}}{\sum_{\ell=0}^{N}e^{u_\ell}} a j = ∑ ℓ = 0 N e u ℓ e u j
with respect to u k u_k u k gives
∂ a j ∂ u k = a j ( δ j k − a k ) . \frac{\partial a_j}{\partial u_k}=a_j(\delta_{jk}-a_k). ∂ u k ∂ a j = a j ( δ j k − a k ) .
Applying the chain rule,
∂ θ a j = ∑ k = 0 N ∂ a j ∂ u k ∂ θ u k = ∑ k = 0 N a j ( δ j k − a k ) ∂ θ u k = a j ( ∂ θ u j − ∑ k = 0 N a k ∂ θ u k ) . \partial_\theta a_j = \sum_{k=0}^{N} \frac{\partial a_j}{\partial u_k}\partial_\theta u_k = \sum_{k=0}^{N} a_j(\delta_{jk}-a_k)\partial_\theta u_k = a_j\left(\partial_\theta u_j-\sum_{k=0}^{N}a_k\partial_\theta u_k\right). ∂ θ a j = k = 0 ∑ N ∂ u k ∂ a j ∂ θ u k = k = 0 ∑ N a j ( δ j k − a k ) ∂ θ u k = a j ( ∂ θ u j − k = 0 ∑ N a k ∂ θ u k ) .
Differentiating once more and using that ∂ θ ∂ θ u j = 0 \partial_\theta\partial_\theta u_j=0 ∂ θ ∂ θ u j = 0 because u \mathbf{u} u is affine in ( α , β ) (\alpha,\beta) ( α , β ) , we obtain
∂ θ ∂ θ a j = ( ∂ θ a j ) ( ∂ θ u j − ∑ k = 0 N a k ∂ θ u k ) − a j ∑ k = 0 N ( ∂ θ a k ) ∂ θ u k . \partial_\theta\partial_\theta a_j = (\partial_\theta a_j)\left(\partial_\theta u_j-\sum_{k=0}^{N}a_k\partial_\theta u_k\right)-a_j\sum_{k=0}^{N}(\partial_\theta a_k)\partial_\theta u_k. ∂ θ ∂ θ a j = ( ∂ θ a j ) ( ∂ θ u j − k = 0 ∑ N a k ∂ θ u k ) − a j k = 0 ∑ N ( ∂ θ a k ) ∂ θ u k .
Since ∣ ∂ θ u j ∣ ≤ 1 |\partial_\theta u_j|\leq1 ∣ ∂ θ u j ∣ ≤ 1 , we also have
∣ ∑ k = 0 N a k ∂ θ u k ∣ ≤ 1 , \left|\sum_{k=0}^{N}a_k\partial_\theta u_k\right|\leq1, k = 0 ∑ N a k ∂ θ u k ≤ 1 ,
hence
∣ ∂ θ u j − ∑ k = 0 N a k ∂ θ u k ∣ ≤ 2. \left|\partial_\theta u_j-\sum_{k=0}^{N}a_k\partial_\theta u_k\right|\leq2. ∂ θ u j − k = 0 ∑ N a k ∂ θ u k ≤ 2.
Therefore
∣ ∂ θ a j ∣ ≤ a j ⋅ 2 = 2 a j . |\partial_\theta a_j|\leq a_j\cdot2=2a_j. ∣ ∂ θ a j ∣ ≤ a j ⋅ 2 = 2 a j .
Using this in the second-derivative formula,
∣ ∂ θ ∂ θ a j ∣ ≤ ∣ ∂ θ a j ∣ ⋅ 2 + a j ∑ k = 0 N ∣ ∂ θ a k ∣ ∣ ∂ θ u k ∣ ≤ 4 a j + a j ∑ k = 0 N 2 a k = 6 a j . |\partial_\theta\partial_\theta a_j|\leq|\partial_\theta a_j|\cdot2+a_j\sum_{k=0}^{N}|\partial_\theta a_k||\partial_\theta u_k|\leq4a_j+a_j\sum_{k=0}^{N}2a_k=6a_j. ∣ ∂ θ ∂ θ a j ∣ ≤ ∣ ∂ θ a j ∣ ⋅ 2 + a j k = 0 ∑ N ∣ ∂ θ a k ∣∣ ∂ θ u k ∣ ≤ 4 a j + a j k = 0 ∑ N 2 a k = 6 a j .
Now
φ = 1 + ∑ i = 1 N a i 2 + 1 2 a 0 2 − 2 a π , \varphi=1+\sum_{i=1}^{N}a_i^2+\frac{1}{2}a_0^2-2a_\pi, φ = 1 + i = 1 ∑ N a i 2 + 2 1 a 0 2 − 2 a π ,
so
∂ θ φ = 2 ∑ i = 1 N a i ∂ θ a i + a 0 ∂ θ a 0 − 2 ∂ θ a π . \partial_\theta\varphi=2\sum_{i=1}^{N}a_i\partial_\theta a_i+a_0\partial_\theta a_0-2\partial_\theta a_\pi. ∂ θ φ = 2 i = 1 ∑ N a i ∂ θ a i + a 0 ∂ θ a 0 − 2 ∂ θ a π .
Using ∣ ∂ θ a j ∣ ≤ 2 a j |\partial_\theta a_j|\leq2a_j ∣ ∂ θ a j ∣ ≤ 2 a j ,
∣ ∂ θ φ ∣ ≤ 2 ∑ i = 1 N a i ⋅ 2 a i + a 0 ⋅ 2 a 0 + 2 ⋅ 2 a π ≤ 4 ∑ i = 1 N a i 2 + 2 a 0 2 + 4 a π ≤ 10. |\partial_\theta\varphi|\leq2\sum_{i=1}^{N}a_i\cdot2a_i+a_0\cdot2a_0+2\cdot2a_\pi\leq4\sum_{i=1}^{N}a_i^2+2a_0^2+4a_\pi\leq10. ∣ ∂ θ φ ∣ ≤ 2 i = 1 ∑ N a i ⋅ 2 a i + a 0 ⋅ 2 a 0 + 2 ⋅ 2 a π ≤ 4 i = 1 ∑ N a i 2 + 2 a 0 2 + 4 a π ≤ 10.
Differentiating once more,
∂ θ ∂ θ φ = 2 ∑ i = 1 N ( ( ∂ θ a i ) ( ∂ θ a i ) + a i ∂ θ ∂ θ a i ) + ( ∂ θ a 0 ) ( ∂ θ a 0 ) + a 0 ∂ θ ∂ θ a 0 − 2 ∂ θ ∂ θ a π , \partial_\theta\partial_\theta\varphi=2\sum_{i=1}^{N}\left((\partial_\theta a_i)(\partial_\theta a_i)+a_i\partial_\theta\partial_\theta a_i\right)+(\partial_\theta a_0)(\partial_\theta a_0)+a_0\partial_\theta\partial_\theta a_0-2\partial_\theta\partial_\theta a_\pi, ∂ θ ∂ θ φ = 2 i = 1 ∑ N ( ( ∂ θ a i ) ( ∂ θ a i ) + a i ∂ θ ∂ θ a i ) + ( ∂ θ a 0 ) ( ∂ θ a 0 ) + a 0 ∂ θ ∂ θ a 0 − 2 ∂ θ ∂ θ a π ,
hence
∣ ∂ θ ′ ∂ θ φ ∣ ≤ 2 ∑ i = 1 N ( 4 a i 2 + 6 a i 2 ) + ( 4 a 0 2 + 6 a 0 2 ) + 12 a π \left|\partial_{\theta'}\partial_{\theta}\varphi\right| \le2\sum_{i=1}^{N}(4a_i^2+6a_i^2)+(4a_0^2+6a_0^2)+12a_{\pi} ∣ ∂ θ ′ ∂ θ φ ∣ ≤ 2 i = 1 ∑ N ( 4 a i 2 + 6 a i 2 ) + ( 4 a 0 2 + 6 a 0 2 ) + 12 a π
≤ 20 ∑ i = 1 N a i 2 + 10 a 0 2 + 12 a π ≤ 42. \le20\sum_{i=1}^{N}a_i^2+10a_0^2+12a_{\pi}\le42. ≤ 20 i = 1 ∑ N a i 2 + 10 a 0 2 + 12 a π ≤ 42.
This proves the lemma. □
Lemma D.15. Define
b i ( α ) : = e α U i ∑ j = 1 N e α U j , Q ( α ) : = ∑ i = 1 N b i ( α ) 2 , μ ( α ) : = ∑ i = 1 N b i ( α ) U i . b_i(\alpha):=\frac{e^{\alpha U_i}}{\sum_{j=1}^{N}e^{\alpha U_j}},\qquad Q(\alpha):=\sum_{i=1}^{N}b_i(\alpha)^2,\qquad\mu(\alpha):=\sum_{i=1}^{N}b_i(\alpha)U_i. b i ( α ) := ∑ j = 1 N e α U j e α U i , Q ( α ) := i = 1 ∑ N b i ( α ) 2 , μ ( α ) := i = 1 ∑ N b i ( α ) U i . Then
φ ( α , β ) = 1 + ( 1 − a 0 ( α , β ) ) 2 Q ( α ) + 1 2 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β ) ) b π ( α ) , \varphi(\alpha,\beta)=1+(1-a_0(\alpha,\beta))^2Q(\alpha)+\frac{1}{2}a_0(\alpha,\beta)^2-2(1-a_0(\alpha,\beta))b_{\pi}(\alpha), φ ( α , β ) = 1 + ( 1 − a 0 ( α , β ) ) 2 Q ( α ) + 2 1 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β )) b π ( α ) , ∂ α b π ( α ) = b π ( α ) ( U π − μ ( α ) ) , Q ′ ( α ) = 2 ∑ i = 1 N b i ( α ) 2 ( U i − μ ( α ) ) , \partial_{\alpha}b_{\pi}(\alpha)=b_{\pi}(\alpha)(U_{\pi}-\mu(\alpha)),\qquad Q'(\alpha)=2\sum_{i=1}^{N}b_i(\alpha)^2(U_i-\mu(\alpha)), ∂ α b π ( α ) = b π ( α ) ( U π − μ ( α )) , Q ′ ( α ) = 2 i = 1 ∑ N b i ( α ) 2 ( U i − μ ( α )) , and the reduced sample gradients are
∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) , (43) \partial_{\beta}\varphi=a_0(\alpha,\beta)(1-a_0(\alpha,\beta))\left(a_0(\alpha,\beta)+2b_{\pi}(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha)\right), \tag*{(43)} ∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) ) , (43) ∂ α φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β ) ) ∂ α b π ( α ) . (44) \begin{aligned}
\partial_{\alpha}\varphi={}&a_0(\alpha,\beta)(1-a_0(\alpha,\beta))(1-\mu(\alpha))\left(a_0(\alpha,\beta)+2b_{\pi}(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha)\right)\\
&+(1-a_0(\alpha,\beta))^2Q'(\alpha)-2(1-a_0(\alpha,\beta))\partial_{\alpha}b_{\pi}(\alpha). \tag*{(44)}
\end{aligned} ∂ α φ = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( 1 − μ ( α )) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) ) + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β )) ∂ α b π ( α ) . (44) Moreover,
L ∈ C 2 ( R 2 ) , ∂ θ L = E [ ∂ θ φ ] , ∂ θ ′ ∂ θ L = E [ ∂ θ ′ ∂ θ φ ] \mathcal{L}\in C^2(\mathbb{R}^2),\qquad\partial_{\theta}\mathcal{L}=\mathbb{E}[\partial_{\theta}\varphi],\qquad\partial_{\theta'}\partial_{\theta}\mathcal{L}=\mathbb{E}[\partial_{\theta'}\partial_{\theta}\varphi] L ∈ C 2 ( R 2 ) , ∂ θ L = E [ ∂ θ φ ] , ∂ θ ′ ∂ θ L = E [ ∂ θ ′ ∂ θ φ ] for θ , θ ′ ∈ { α , β } \theta,\theta'\in\{\alpha,\beta\} θ , θ ′ ∈ { α , β } , and ∇ L \nabla\mathcal{L} ∇ L is globally 84-Lipschitz on R 2 \mathbb{R}^2 R 2 .
Finally, along the invariant manifold, the full matrix gradient-descent recursion induces
α ( t + 1 ) = α ( t ) − η d E [ ∂ α φ ( U 1 , … , U N ; α ( t ) , β ( t ) ) ] , \alpha^{(t+1)}=\alpha^{(t)}-\frac{\eta}{d}\mathbb{E}\left[\partial_{\alpha}\varphi\left(U_1,\ldots,U_N;\alpha^{(t)},\beta^{(t)}\right)\right], α ( t + 1 ) = α ( t ) − d η E [ ∂ α φ ( U 1 , … , U N ; α ( t ) , β ( t ) ) ] , β ( t + 1 ) = β ( t ) − η N + 1 E [ ∂ β φ ( U 1 , … , U N ; α ( t ) , β ( t ) ) ] . \beta^{(t+1)}=\beta^{(t)}-\frac{\eta}{N+1}\mathbb{E}\left[\partial_{\beta}\varphi\left(U_1,\ldots,U_N;\alpha^{(t)},\beta^{(t)}\right)\right]. β ( t + 1 ) = β ( t ) − N + 1 η E [ ∂ β φ ( U 1 , … , U N ; α ( t ) , β ( t ) ) ] . Proof. The identity
a i ( α , β ) = ( 1 − a 0 ( α , β ) ) b i ( α ) , i ∈ [ N ] , a_i(\alpha,\beta)=(1-a_0(\alpha,\beta))b_i(\alpha),\qquad i\in[N], a i ( α , β ) = ( 1 − a 0 ( α , β )) b i ( α ) , i ∈ [ N ] , follows immediately from the definitions of a i a_i a i , a 0 a_0 a 0 , and b i b_i b i . Substituting this into the formula of Lemma D.13 gives
φ ( α , β ) = 1 + ( 1 − a 0 ( α , β ) ) 2 Q ( α ) + 1 2 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β ) ) b π ( α ) . \varphi(\alpha,\beta)=1+(1-a_0(\alpha,\beta))^2Q(\alpha)+\frac{1}{2}a_0(\alpha,\beta)^2-2(1-a_0(\alpha,\beta))b_{\pi}(\alpha). φ ( α , β ) = 1 + ( 1 − a 0 ( α , β ) ) 2 Q ( α ) + 2 1 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β )) b π ( α ) .
Because
log a 0 ( α , β ) 1 − a 0 ( α , β ) = ( α + β ) − log ( ∑ j = 1 N e α U j ) , \log\frac{a_0(\alpha,\beta)}{1-a_0(\alpha,\beta)}=(\alpha+\beta)-\log\left(\sum_{j=1}^{N}e^{\alpha U_j}\right), log 1 − a 0 ( α , β ) a 0 ( α , β ) = ( α + β ) − log ( j = 1 ∑ N e α U j ) ,
and
∂ α log ( ∑ j = 1 N e α U j ) = ∑ j = 1 N U j e α U j ∑ j = 1 N e α U j = μ ( α ) , \partial_\alpha\log\left(\sum_{j=1}^{N}e^{\alpha U_j}\right)=\frac{\sum_{j=1}^{N}U_je^{\alpha U_j}}{\sum_{j=1}^{N}e^{\alpha U_j}}=\mu(\alpha), ∂ α log ( j = 1 ∑ N e α U j ) = ∑ j = 1 N e α U j ∑ j = 1 N U j e α U j = μ ( α ) ,
we obtain
∂ β log a 0 ( α , β ) 1 − a 0 ( α , β ) = 1 , ∂ α log a 0 ( α , β ) 1 − a 0 ( α , β ) = 1 − μ ( α ) . \partial_\beta\log\frac{a_0(\alpha,\beta)}{1-a_0(\alpha,\beta)}=1,\qquad\partial_\alpha\log\frac{a_0(\alpha,\beta)}{1-a_0(\alpha,\beta)}=1-\mu(\alpha). ∂ β log 1 − a 0 ( α , β ) a 0 ( α , β ) = 1 , ∂ α log 1 − a 0 ( α , β ) a 0 ( α , β ) = 1 − μ ( α ) .
Since the derivative of the logistic map is u ↦ u ( 1 − u ) u\mapsto u(1-u) u ↦ u ( 1 − u ) , this yields
∂ β a 0 ( α , β ) = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) , \partial_\beta a_0(\alpha,\beta)=a_0(\alpha,\beta)(1-a_0(\alpha,\beta)), ∂ β a 0 ( α , β ) = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ,
∂ α a 0 ( α , β ) = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) . \partial_\alpha a_0(\alpha,\beta)=a_0(\alpha,\beta)(1-a_0(\alpha,\beta))(1-\mu(\alpha)). ∂ α a 0 ( α , β ) = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( 1 − μ ( α )) .
Similarly,
∂ α b i ( α ) = b i ( α ) ( U i − μ ( α ) ) . \partial_\alpha b_i(\alpha)=b_i(\alpha)(U_i-\mu(\alpha)). ∂ α b i ( α ) = b i ( α ) ( U i − μ ( α )) .
Therefore
∂ α b π ( α ) = b π ( α ) ( U π − μ ( α ) ) , \partial_\alpha b_\pi(\alpha)=b_\pi(\alpha)(U_\pi-\mu(\alpha)), ∂ α b π ( α ) = b π ( α ) ( U π − μ ( α )) ,
and
Q ′ ( α ) = 2 ∑ i = 1 N b i ( α ) ∂ α b i ( α ) = 2 ∑ i = 1 N b i ( α ) 2 ( U i − μ ( α ) ) . Q'(\alpha)=2\sum_{i=1}^{N}b_i(\alpha)\partial_\alpha b_i(\alpha)=2\sum_{i=1}^{N}b_i(\alpha)^2(U_i-\mu(\alpha)). Q ′ ( α ) = 2 i = 1 ∑ N b i ( α ) ∂ α b i ( α ) = 2 i = 1 ∑ N b i ( α ) 2 ( U i − μ ( α )) .
Now differentiate
φ = 1 + ( 1 − a 0 ( α , β ) ) 2 Q ( α ) + 1 2 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β ) ) b π ( α ) . \varphi=1+(1-a_0(\alpha,\beta))^2Q(\alpha)+\frac{1}{2}a_0(\alpha,\beta)^2-2(1-a_0(\alpha,\beta))b_\pi(\alpha). φ = 1 + ( 1 − a 0 ( α , β ) ) 2 Q ( α ) + 2 1 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β )) b π ( α ) .
With respect to β \beta β , only a 0 ( α , β ) a_0(\alpha,\beta) a 0 ( α , β ) varies, so
∂ β φ = ∂ β a 0 ( α , β ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) , \partial_\beta\varphi=\partial_\beta a_0(\alpha,\beta)\left(a_0(\alpha,\beta)+2b_\pi(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha)\right), ∂ β φ = ∂ β a 0 ( α , β ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) ) ,
which is exactly (D.19). With respect to α \alpha α ,
∂ α φ = ∂ α a 0 ( α , β ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β ) ) ∂ α b π ( α ) , \partial_\alpha\varphi=\partial_\alpha a_0(\alpha,\beta)\left(a_0(\alpha,\beta)+2b_\pi(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha)\right)+(1-a_0(\alpha,\beta))^2Q'(\alpha)-2(1-a_0(\alpha,\beta))\partial_\alpha b_\pi(\alpha), ∂ α φ = ∂ α a 0 ( α , β ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) ) + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β )) ∂ α b π ( α ) ,
which is (D.20).
By Lemma D.14 , ∣ ∂ θ φ ∣ ≤ 10 |\partial_\theta\varphi|\leq10 ∣ ∂ θ φ ∣ ≤ 10 and ∣ ∂ θ ′ ∂ θ φ ∣ ≤ 42 |\partial_{\theta'}\partial_\theta\varphi|\leq42 ∣ ∂ θ ′ ∂ θ φ ∣ ≤ 42 pointwise. These bounds are deterministic and integrable. Hence differentiation under the expectation is justified twice by dominated convergence, and L ∈ C 2 ( R 2 ) \mathcal{L}\in C^2(\mathbb{R}^2) L ∈ C 2 ( R 2 ) with
∂ θ L = E [ ∂ θ φ ] , ∂ θ ′ ∂ θ L = E [ ∂ θ ′ ∂ θ φ ] . \partial_\theta\mathcal{L}=\mathbb{E}[\partial_\theta\varphi],\qquad\partial_{\theta'}\partial_\theta\mathcal{L}=\mathbb{E}[\partial_{\theta'}\partial_\theta\varphi]. ∂ θ L = E [ ∂ θ φ ] , ∂ θ ′ ∂ θ L = E [ ∂ θ ′ ∂ θ φ ] .
Every Hessian entry of L \mathcal{L} L is bounded in absolute value by 42. Since the Hessian is a 2 × 2 2\times2 2 × 2 matrix, its operator norm is bounded by 84; therefore ∇ L \nabla\mathcal{L} ∇ L is globally 84-Lipschitz.
It remains to justify the displayed scalar recursion. Along the invariant manifold, the population matrix gradient has the block form
∇ W L ( W ( α , β ) ) = diag ( g α I d , 0 , g β I N + 1 ) \nabla_{\mathbf W}L(\mathbf W(\alpha,\beta))=\operatorname{diag}(g_\alpha I_d,0,g_\beta I_{N+1}) ∇ W L ( W ( α , β )) = diag ( g α I d , 0 , g β I N + 1 )
for some scalars g α , g β g_\alpha,g_\beta g α , g β . By the chain rule,
∂ α L ( α , β ) = ⟨ ∇ W L ( W ( α , β ) ) , diag ( I d , 0 , 0 ) ⟩ F = d g α , \partial_\alpha\mathcal{L}(\alpha,\beta)=\langle\nabla_{\mathbf W}L(\mathbf W(\alpha,\beta)),\operatorname{diag}(I_d,0,0)\rangle_F=d g_\alpha, ∂ α L ( α , β ) = ⟨ ∇ W L ( W ( α , β )) , diag ( I d , 0 , 0 ) ⟩ F = d g α ,
and
∂ β L ( α , β ) = ⟨ ∇ W L ( W ( α , β ) ) , diag ( 0 , 0 , I N + 1 ) ⟩ F = ( N + 1 ) g β . \partial_\beta\mathcal{L}(\alpha,\beta)=\langle\nabla_{\mathbf W}L(\mathbf W(\alpha,\beta)),\operatorname{diag}(0,0,I_{N+1})\rangle_F=(N+1)g_\beta. ∂ β L ( α , β ) = ⟨ ∇ W L ( W ( α , β )) , diag ( 0 , 0 , I N + 1 ) ⟩ F = ( N + 1 ) g β .
Therefore the full matrix update
W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) ) \mathbf W^{(t+1)}=\mathbf W^{(t)}-\eta\nabla_{\mathbf W}L(\mathbf W^{(t)}) W ( t + 1 ) = W ( t ) − η ∇ W L ( W ( t ) )
induces
α ( t + 1 ) = α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) , β ( t + 1 ) = β ( t ) − η N + 1 ∂ β L ( α ( t ) , β ( t ) ) . \alpha^{(t+1)}=\alpha^{(t)}-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)}),\qquad
\beta^{(t+1)}=\beta^{(t)}-\frac{\eta}{N+1}\partial_\beta\mathcal{L}(\alpha^{(t)},\beta^{(t)}). α ( t + 1 ) = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) , β ( t + 1 ) = β ( t ) − N + 1 η ∂ β L ( α ( t ) , β ( t ) ) .
Combining this with the identities
∂ θ L = E [ ∂ θ φ ] , θ ∈ { α , β } , \partial_\theta\mathcal{L}=\mathbb{E}[\partial_\theta\varphi],\qquad\theta\in\{\alpha,\beta\}, ∂ θ L = E [ ∂ θ φ ] , θ ∈ { α , β } ,
proves the stated recursion.
Lemma D.16. We have
E [ U π ] ≥ 7 e − 2 18 2 π d > 7 432 d . \mathbb{E}[U_\pi]\ge\frac{7e^{-2}}{18\sqrt{2}\pi d}>\frac{7}{432\sqrt{d}}. E [ U π ] ≥ 18 2 π d 7 e − 2 > 432 d 7 . Proof. Let G = ( G 1 , … , G d ) ∼ N ( 0 , I d ) G=(G_1,\ldots,G_d)\sim N(0,I_d) G = ( G 1 , … , G d ) ∼ N ( 0 , I d ) and X : = G / ∥ G ∥ X:=G/\lVert G\rVert X := G / ∥ G ∥ , so X ∼ Unif ( S d − 1 ) X\sim\operatorname{Unif}(S^{d-1}) X ∼ Unif ( S d − 1 ) . By rotational invariance, the law of U i = x i T x q U_i=x_i^\mathsf{T}x_q U i = x i T x q is the same as the law of X 1 X_1 X 1 . Set
S : = ∑ j = 2 d G j 2 ∼ χ d − 1 2 , S:=\sum_{j=2}^{d}G_j^2\sim\chi^2_{d-1}, S := j = 2 ∑ d G j 2 ∼ χ d − 1 2 , independent of G 1 G_1 G 1 . On the event
E : = { 1 ≤ G 1 ≤ 2 } ∩ { S ≤ 4 ( d − 1 ) } E:=\{1\le G_1\le2\}\cap\{S\le4(d-1)\} E := { 1 ≤ G 1 ≤ 2 } ∩ { S ≤ 4 ( d − 1 )} we have
X 1 = G 1 G 1 2 + S ≥ 1 4 + 4 ( d − 1 ) = 1 2 d . X_1=\frac{G_1}{\sqrt{G_1^2+S}}\ge\frac{1}{\sqrt{4+4(d-1)}}=\frac{1}{2\sqrt d}. X 1 = G 1 2 + S G 1 ≥ 4 + 4 ( d − 1 ) 1 = 2 d 1 . Therefore
P ( U i ≥ 1 2 d ) ≥ P ( E ) . \mathbb{P}\left(U_i\ge\frac{1}{2\sqrt d}\right)\ge\mathbb{P}(E). P ( U i ≥ 2 d 1 ) ≥ P ( E ) . Now
P ( 1 ≤ G 1 ≤ 2 ) = ∫ 1 2 e − x 2 / 2 2 π d x ≥ e − 2 2 π , \mathbb{P}(1\le G_1\le2)=\int_1^2\frac{e^{-x^2/2}}{\sqrt{2\pi}}\,dx\ge\frac{e^{-2}}{\sqrt{2\pi}}, P ( 1 ≤ G 1 ≤ 2 ) = ∫ 1 2 2 π e − x 2 /2 d x ≥ 2 π e − 2 ,
and Chebyshev’s inequality gives
P ( S > 4 ( d − 1 ) ) = P ( S − ( d − 1 ) > 3 ( d − 1 ) ) ≤ Var ( S ) 9 ( d − 1 ) 2 = 2 ( d − 1 ) 9 ( d − 1 ) 2 ≤ 2 9 . \mathbb{P}\left(S > 4(d-1)\right) = \mathbb{P}\left(S-(d-1) > 3(d-1)\right) \le\frac{\operatorname{Var}(S)}{9(d-1)^2} = \frac{2(d-1)}{9(d-1)^2} \le\frac{2}{9}. P ( S > 4 ( d − 1 ) ) = P ( S − ( d − 1 ) > 3 ( d − 1 ) ) ≤ 9 ( d − 1 ) 2 Var ( S ) = 9 ( d − 1 ) 2 2 ( d − 1 ) ≤ 9 2 .
since d ≥ 2 d \ge2 d ≥ 2 . Hence
P ( E ) ≥ e − 2 2 π ⋅ 7 9 . \mathbb{P}(E) \ge\frac{e^{-2}}{\sqrt{2\pi}}\cdot\frac{7}{9}. P ( E ) ≥ 2 π e − 2 ⋅ 9 7 .
Thus
P ( U i ≥ 1 2 d ) ≥ 7 e − 2 9 2 π . \mathbb{P}\left(U_i \ge\frac{1}{2\sqrt{d}}\right) \ge\frac{7e^{-2}}{9\sqrt{2\pi}}. P ( U i ≥ 2 d 1 ) ≥ 9 2 π 7 e − 2 .
Since U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N are conditionally independent given x q x_q x q , we further have
P ( U π ≥ 1 2 d ) = 1 − P ( U 1 < 1 2 d , … , U N < 1 2 d ) \mathbb{P}\left(U_\pi\ge\frac{1}{2\sqrt{d}}\right) = 1-\mathbb{P}\left(U_1 < \frac{1}{2\sqrt{d}},\ldots,U_N < \frac{1}{2\sqrt{d}}\right) P ( U π ≥ 2 d 1 ) = 1 − P ( U 1 < 2 d 1 , … , U N < 2 d 1 )
≥ 1 − ( 1 − 7 e − 2 9 2 π ) N . \ge1-\left(1-\frac{7e^{-2}}{9\sqrt{2\pi}}\right)^N. ≥ 1 − ( 1 − 9 2 π 7 e − 2 ) N .
Since N ≥ 100 d ≥ 2 N \ge100\sqrt{d} \ge2 N ≥ 100 d ≥ 2 and
7 e − 2 9 2 π < 1 2 , \frac{7e^{-2}}{9\sqrt{2\pi}} < \frac{1}{2}, 9 2 π 7 e − 2 < 2 1 ,
we get
P ( U π ≥ 1 2 d ) ≥ 1 − ( 1 − 7 e − 2 9 2 π ) 2 = 2 ⋅ 7 e − 2 9 2 π − ( 7 e − 2 9 2 π ) 2 ≥ 3 2 ⋅ 7 e − 2 9 2 π . \begin{aligned}
\mathbb{P}\left(U_\pi\ge\frac{1}{2\sqrt{d}}\right) \ge1-\left(1-\frac{7e^{-2}}{9\sqrt{2\pi}}\right)^2 \\
&=2\cdot\frac{7e^{-2}}{9\sqrt{2\pi}}-\left(\frac{7e^{-2}}{9\sqrt{2\pi}}\right)^2 \\
&\ge\frac{3}{2}\cdot\frac{7e^{-2}}{9\sqrt{2\pi}}.
\end{aligned} P ( U π ≥ 2 d 1 ) ≥ 1 − ( 1 − 9 2 π 7 e − 2 ) 2 = 2 ⋅ 9 2 π 7 e − 2 − ( 9 2 π 7 e − 2 ) 2 ≥ 2 3 ⋅ 9 2 π 7 e − 2 .
Now we lower bound the expectation while accounting for the possible negative contribution. Since U π ∈ [ − 1 , 1 ] U_\pi\in[-1,1] U π ∈ [ − 1 , 1 ] ,
E [ U π ] ≥ 1 2 d P ( U π ≥ 1 2 d ) − P ( U π < 0 ) . \mathbb{E}[U_\pi] \ge\frac{1}{2\sqrt{d}}\mathbb{P}\left(U_\pi\ge\frac{1}{2\sqrt{d}}\right)-\mathbb{P}(U_\pi<0). E [ U π ] ≥ 2 d 1 P ( U π ≥ 2 d 1 ) − P ( U π < 0 ) .
Moreover, by symmetry and conditional independence,
P ( U π < 0 ) = P ( U 1 < 0 , … , U N < 0 ) = 2 − N . \mathbb{P}(U_\pi<0)=\mathbb{P}(U_1<0,\ldots,U_N<0)=2^{-N}. P ( U π < 0 ) = P ( U 1 < 0 , … , U N < 0 ) = 2 − N .
Using N ≥ 100 d N \ge100\sqrt{d} N ≥ 100 d , we have N ≥ 4 N \ge4 N ≥ 4 , and hence 2 N ≥ N 2 2^N \ge N^2 2 N ≥ N 2 . Therefore
2 − N ≤ 1 N 2 ≤ 1 10000 d ≤ 1 10000 d . 2^{-N}\le\frac{1}{N^2}\le\frac{1}{10000d}\le\frac{1}{10000\sqrt{d}}. 2 − N ≤ N 2 1 ≤ 10000 d 1 ≤ 10000 d 1 .
On the other hand, since e 2 < 8 e^2<8 e 2 < 8 and 2 π < 3 \sqrt{2\pi}<3 2 π < 3 ,
7 e − 2 9 2 π > 7 9 ⋅ 8 ⋅ 3 = 7 216 > 1 100 . \frac{7e^{-2}}{9\sqrt{2\pi}}>\frac{7}{9\cdot8\cdot3}=\frac{7}{216}>\frac{1}{100}. 9 2 π 7 e − 2 > 9 ⋅ 8 ⋅ 3 7 = 216 7 > 100 1 .
Thus
2 − N ≤ 1 10000 d ≤ 1 4 d ⋅ 7 e − 2 9 2 π . 2^{-N} \le\frac{1}{10000\sqrt{d}} \le\frac{1}{4\sqrt{d}}\cdot\frac{7e^{-2}}{9\sqrt{2\pi}}. 2 − N ≤ 10000 d 1 ≤ 4 d 1 ⋅ 9 2 π 7 e − 2 .
Combining the preceding estimates gives
E [ U π ] ≥ 1 2 d ⋅ 3 2 ⋅ 7 e − 2 9 2 π − 1 4 d ⋅ 7 e − 2 9 2 π = 7 e − 2 18 2 π d . \begin{aligned}
\mathbb{E}[U_{\pi}] \ge\frac{1}{2\sqrt{d}}\cdot\frac{3}{2}\cdot\frac{7e^{-2}}{9\sqrt{2\pi}}-\frac{1}{4\sqrt{d}}\cdot\frac{7e^{-2}}{9\sqrt{2\pi}} \\
&= \frac{7e^{-2}}{18\sqrt{2\pi d}}.
\end{aligned} E [ U π ] ≥ 2 d 1 ⋅ 2 3 ⋅ 9 2 π 7 e − 2 − 4 d 1 ⋅ 9 2 π 7 e − 2 = 18 2 π d 7 e − 2 .
Finally, e 2 < 8 e^2 < 8 e 2 < 8 and 2 π < 3 \sqrt{2\pi} < 3 2 π < 3 , so
7 e − 2 18 2 π d > 7 18 ⋅ 8 ⋅ 3 d = 7 432 d . \frac{7e^{-2}}{18\sqrt{2\pi d}} > \frac{7}{18\cdot8\cdot3\sqrt{d}}=\frac{7}{432\sqrt{d}}. 18 2 π d 7 e − 2 > 18 ⋅ 8 ⋅ 3 d 7 = 432 d 7 .
This proves the lemma.
Lemma D.17. Assume N ≥ 100 d N \ge100\sqrt{d} N ≥ 100 d . Then for every β ≤ 0 \beta\le0 β ≤ 0 ,
∂ α L ( 0 , β ) ≤ − 1 ( N + 1 ) 2 . \partial_{\alpha}\mathcal{L}(0,\beta) \le-\frac{1}{(N+1)^2}. ∂ α L ( 0 , β ) ≤ − ( N + 1 ) 2 1 . Proof. At α = 0 \alpha=0 α = 0 , we have
b i ( 0 ) = 1 N , b π ( 0 ) = 1 N , Q ( 0 ) = 1 N , b_i(0)=\frac{1}{N},\qquad b_{\pi}(0)=\frac{1}{N},\qquad Q(0)=\frac{1}{N}, b i ( 0 ) = N 1 , b π ( 0 ) = N 1 , Q ( 0 ) = N 1 , and
μ ( 0 ) = 1 N ∑ i = 1 N U i = : U ‾ . \mu(0)=\frac{1}{N}\sum_{i=1}^{N}U_i=:\overline{U}. μ ( 0 ) = N 1 i = 1 ∑ N U i =: U . Also
Q ′ ( 0 ) = 2 ∑ i = 1 N 1 N 2 ( U i − U ‾ ) = 0 , ∂ α b π ( 0 ) = 1 N ( U π − U ‾ ) . Q'(0)=2\sum_{i=1}^{N}\frac{1}{N^2}(U_i-\overline{U})=0,\qquad\partial_{\alpha}b_{\pi}(0)=\frac{1}{N}(U_{\pi}-\overline{U}). Q ′ ( 0 ) = 2 i = 1 ∑ N N 2 1 ( U i − U ) = 0 , ∂ α b π ( 0 ) = N 1 ( U π − U ) . Since β ≤ 0 \beta\le0 β ≤ 0 ,
a 0 ( 0 , β ) = 1 1 + N e − β ≤ 1 N + 1 . a_0(0,\beta)=\frac{1}{1+Ne^{-\beta}}\le\frac{1}{N+1}. a 0 ( 0 , β ) = 1 + N e − β 1 ≤ N + 1 1 . Substituting these identities into (D.20) yields
∂ α φ ( 0 , β ) = a 0 ( 0 , β ) ( 1 − a 0 ( 0 , β ) ) ( 1 − U ‾ ) ( a 0 ( 0 , β ) + 2 N − 2 ( 1 − a 0 ( 0 , β ) ) N ) − 2 ( 1 − a 0 ( 0 , β ) ) N ( U π − U ‾ ) . \partial_{\alpha}\varphi(0,\beta)=a_0(0,\beta)(1-a_0(0,\beta))(1-\overline{U})\left(a_0(0,\beta)+\frac{2}{N}-\frac{2(1-a_0(0,\beta))}{N}\right)-\frac{2(1-a_0(0,\beta))}{N}(U_{\pi}-\overline{U}). ∂ α φ ( 0 , β ) = a 0 ( 0 , β ) ( 1 − a 0 ( 0 , β )) ( 1 − U ) ( a 0 ( 0 , β ) + N 2 − N 2 ( 1 − a 0 ( 0 , β )) ) − N 2 ( 1 − a 0 ( 0 , β )) ( U π − U ) . The bracket simplifies to a 0 ( 0 , β ) ( 1 + 2 / N ) a_0(0,\beta)(1+2/N) a 0 ( 0 , β ) ( 1 + 2/ N ) , hence
∂ α φ ( 0 , β ) = a 0 ( 0 , β ) 2 ( 1 − a 0 ( 0 , β ) ) ( 1 + 2 N ) ( 1 − U ‾ ) − 2 ( 1 − a 0 ( 0 , β ) ) N ( U π − U ‾ ) . \partial_{\alpha}\varphi(0,\beta)=a_0(0,\beta)^2(1-a_0(0,\beta))\left(1+\frac{2}{N}\right)(1-\overline{U})-\frac{2(1-a_0(0,\beta))}{N}(U_{\pi}-\overline{U}). ∂ α φ ( 0 , β ) = a 0 ( 0 , β ) 2 ( 1 − a 0 ( 0 , β )) ( 1 + N 2 ) ( 1 − U ) − N 2 ( 1 − a 0 ( 0 , β )) ( U π − U ) . Taking expectation and using E [ U ‾ ] = 0 \mathbb{E}[\overline{U}]=0 E [ U ] = 0 gives
∂ α L ( 0 , β ) = a 0 ( 0 , β ) 2 ( 1 − a 0 ( 0 , β ) ) ( 1 + 2 N ) − 2 ( 1 − a 0 ( 0 , β ) ) N E [ U π ] . \partial_{\alpha}\mathcal{L}(0,\beta)=a_0(0,\beta)^2(1-a_0(0,\beta))\left(1+\frac{2}{N}\right)-\frac{2(1-a_0(0,\beta))}{N}\mathbb{E}[U_{\pi}]. ∂ α L ( 0 , β ) = a 0 ( 0 , β ) 2 ( 1 − a 0 ( 0 , β )) ( 1 + N 2 ) − N 2 ( 1 − a 0 ( 0 , β )) E [ U π ] .
Since a 0 ( 0 , β ) ≤ 1 N + 1 a_0(0,\beta) \le\frac{1}{N+1} a 0 ( 0 , β ) ≤ N + 1 1 ,
a 0 ( 0 , β ) 2 ( 1 − a 0 ( 0 , β ) ) ( 1 + 2 N ) ≤ 1 ( N + 1 ) 2 ( 1 + 2 N ) < 2 ( N + 1 ) 2 . a_0(0,\beta)^2(1-a_0(0,\beta))\left(1+\frac{2}{N}\right) \le\frac{1}{(N+1)^2}\left(1+\frac{2}{N}\right) < \frac{2}{(N+1)^2}. a 0 ( 0 , β ) 2 ( 1 − a 0 ( 0 , β )) ( 1 + N 2 ) ≤ ( N + 1 ) 2 1 ( 1 + N 2 ) < ( N + 1 ) 2 2 .
and
2 ( 1 − a 0 ( 0 , β ) ) N ≥ 2 N + 1 . \frac{2(1-a_0(0,\beta))}{N} \ge\frac{2}{N+1}. N 2 ( 1 − a 0 ( 0 , β )) ≥ N + 1 2 .
Therefore
∂ α L ( 0 , β ) ≤ 2 ( N + 1 ) 2 − 2 N + 1 E [ U π ] . \partial_\alpha\mathcal{L}(0,\beta) \le\frac{2}{(N+1)^2}-\frac{2}{N+1}\mathbb{E}[U_\pi]. ∂ α L ( 0 , β ) ≤ ( N + 1 ) 2 2 − N + 1 2 E [ U π ] .
By Lemma D.16,
E [ U π ] > 7 432 d . \mathbb{E}[U_\pi] > \frac{7}{432\sqrt{d}}. E [ U π ] > 432 d 7 .
Since N ≥ 100 d N \ge100\sqrt{d} N ≥ 100 d , we have N + 1 ≥ 100 d N+1 \ge100\sqrt{d} N + 1 ≥ 100 d , so
2 N + 1 E [ U π ] > 14 432 d ( N + 1 ) ≥ 1400 432 ( N + 1 ) 2 > 3 ( N + 1 ) 2 . \frac{2}{N+1}\mathbb{E}[U_\pi] > \frac{14}{432\sqrt{d}(N+1)} \ge\frac{1400}{432(N+1)^2} > \frac{3}{(N+1)^2}. N + 1 2 E [ U π ] > 432 d ( N + 1 ) 14 ≥ 432 ( N + 1 ) 2 1400 > ( N + 1 ) 2 3 .
Hence
∂ α L ( 0 , β ) < 2 ( N + 1 ) 2 − 3 ( N + 1 ) 2 = − 1 ( N + 1 ) 2 . \partial_\alpha\mathcal{L}(0,\beta) < \frac{2}{(N+1)^2}-\frac{3}{(N+1)^2}=-\frac{1}{(N+1)^2}. ∂ α L ( 0 , β ) < ( N + 1 ) 2 2 − ( N + 1 ) 2 3 = − ( N + 1 ) 2 1 .
Lemma D.18. Assume d ≥ 2 d \ge2 d ≥ 2 , N ≥ 100 d N \ge100\sqrt{d} N ≥ 100 d , and
0 < η ≤ 1 840 ( N + 1 ) 2 . 0 < \eta\le\frac{1}{840(N+1)^2}. 0 < η ≤ 840 ( N + 1 ) 2 1 . Then, along the gradient-descent trajectory issued from ( 0 , 0 ) (0,0) ( 0 , 0 ) ,
α ( t ) ≥ 0 , β ( t ) ≤ 0 for all t ≥ 0. \alpha^{(t)} \ge0,\qquad\beta^{(t)} \le0 \qquad\text{for all } t \ge0. α ( t ) ≥ 0 , β ( t ) ≤ 0 for all t ≥ 0. Moreover, for every ( α , β ) (\alpha,\beta) ( α , β ) with α ≥ 0 \alpha\ge0 α ≥ 0 ,
∂ β L ( α , β ) > 0. \partial_\beta\mathcal{L}(\alpha,\beta)>0. ∂ β L ( α , β ) > 0. Consequently ( β ( t ) ) t ≥ 0 (\beta^{(t)})_{t\ge0} ( β ( t ) ) t ≥ 0 is strictly decreasing.
Proof. We first prove positivity of ∂ β L \partial_\beta\mathcal{L} ∂ β L on { α ≥ 0 } \{\alpha\ge0\} { α ≥ 0 } . Fix a realization of U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N and α ≥ 0 \alpha\ge0 α ≥ 0 . Since π \pi π indexes the largest U i U_i U i , the map u ↦ e α u u \mapsto e^{\alpha u} u ↦ e α u is nondecreasing, and therefore
b π ( α ) = max 1 ≤ i ≤ N b i ( α ) . b_\pi(\alpha)=\max_{1\le i\le N} b_i(\alpha). b π ( α ) = 1 ≤ i ≤ N max b i ( α ) .
Hence
Q ( α ) = ∑ i = 1 N b i ( α ) 2 ≤ b π ( α ) ∑ i = 1 N b i ( α ) = b π ( α ) . Q(\alpha)=\sum_{i=1}^{N}b_i(\alpha)^2 \le b_\pi(\alpha)\sum_{i=1}^{N}b_i(\alpha)=b_\pi(\alpha). Q ( α ) = i = 1 ∑ N b i ( α ) 2 ≤ b π ( α ) i = 1 ∑ N b i ( α ) = b π ( α ) .
Using (D.19),
∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( a 0 ( α , β ) + 2 ( b π ( α ) − Q ( α ) ) + 2 a 0 ( α , β ) Q ( α ) ) . \begin{aligned}
\partial_{\beta}\varphi= a_0(\alpha,\beta)\left(1-a_0(\alpha,\beta)\right)\left(a_0(\alpha,\beta)+2b_{\pi}(\alpha)-2\left(1-a_0(\alpha,\beta)\right)Q(\alpha)\right) \\
&= a_0(\alpha,\beta)\left(1-a_0(\alpha,\beta)\right)\left(a_0(\alpha,\beta)+2\left(b_{\pi}(\alpha)-Q(\alpha)\right)+2a_0(\alpha,\beta)Q(\alpha)\right).
\end{aligned} ∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( a 0 ( α , β ) + 2 ( b π ( α ) − Q ( α ) ) + 2 a 0 ( α , β ) Q ( α ) ) .
All terms inside the last parentheses are nonnegative, and a 0 ( α , β ) ∈ ( 0 , 1 ) a_0(\alpha,\beta) \in(0,1) a 0 ( α , β ) ∈ ( 0 , 1 ) , so
∂ β φ > 0. \partial_{\beta}\varphi> 0. ∂ β φ > 0.
Taking expectations gives ∂ β L ( α , β ) > 0 \partial_{\beta}\mathcal{L}(\alpha,\beta)>0 ∂ β L ( α , β ) > 0 for every α ≥ 0 \alpha\ge0 α ≥ 0 . We now prove forward invariance. Set
δ : = 1 84 ( N + 1 ) 2 . \delta:= \frac{1}{84(N+1)^2}. δ := 84 ( N + 1 ) 2 1 .
By Lemma D.15 , ∣ ∂ α L ∣ ≤ 10 |\partial_{\alpha}\mathcal{L}| \le10 ∣ ∂ α L ∣ ≤ 10 and ∣ ∂ α α L ∣ ≤ 42 |\partial_{\alpha\alpha}\mathcal{L}| \le42 ∣ ∂ α α L ∣ ≤ 42 everywhere. We argue by induction on t t t . At t = 0 t=0 t = 0 we have α ( 0 ) = 0 \alpha^{(0)}=0 α ( 0 ) = 0 and β ( 0 ) = 0 \beta^{(0)}=0 β ( 0 ) = 0 . Assume that
α ( t ) ≥ 0 , β ( t ) ≤ 0. \alpha^{(t)} \ge0,\qquad\beta^{(t)} \le0. α ( t ) ≥ 0 , β ( t ) ≤ 0.
If 0 ≤ α ( t ) ≤ δ 0 \le\alpha^{(t)} \le\delta 0 ≤ α ( t ) ≤ δ , then by the mean-value theorem and Lemma D.17 ,
∂ α L ( α ( t ) , β ( t ) ) ≤ ∂ α L ( 0 , β ( t ) ) + 42 α ( t ) ≤ − 1 ( N + 1 ) 2 + 42 84 ( N + 1 ) 2 = − 1 2 ( N + 1 ) 2 < 0. \partial_{\alpha}\mathcal{L}\left(\alpha^{(t)},\beta^{(t)}\right) \le\partial_{\alpha}\mathcal{L}\left(0,\beta^{(t)}\right)+42\alpha^{(t)} \le-\frac{1}{(N+1)^2}+\frac{42}{84(N+1)^2}=-\frac{1}{2(N+1)^2}<0. ∂ α L ( α ( t ) , β ( t ) ) ≤ ∂ α L ( 0 , β ( t ) ) + 42 α ( t ) ≤ − ( N + 1 ) 2 1 + 84 ( N + 1 ) 2 42 = − 2 ( N + 1 ) 2 1 < 0.
Hence
α ( t + 1 ) = α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) > α ( t ) ≥ 0. \alpha^{(t+1)}=\alpha^{(t)}-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}\left(\alpha^{(t)},\beta^{(t)}\right)>\alpha^{(t)}\ge0. α ( t + 1 ) = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) > α ( t ) ≥ 0.
If α ( t ) ≥ δ \alpha^{(t)}\ge\delta α ( t ) ≥ δ , then
α ( t + 1 ) ≥ α ( t ) − η d ∣ ∂ α L ( α ( t ) , β ( t ) ) ∣ ≥ α ( t ) − 10 η d ≥ δ − 10 840 d ( N + 1 ) 2 ≥ 0. \alpha^{(t+1)}\ge\alpha^{(t)}-\frac{\eta}{d}\left|\partial_{\alpha}\mathcal{L}\left(\alpha^{(t)},\beta^{(t)}\right)\right|\ge\alpha^{(t)}-\frac{10\eta}{d}\ge\delta-\frac{10}{840d(N+1)^2}\ge0. α ( t + 1 ) ≥ α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) ≥ α ( t ) − d 10 η ≥ δ − 840 d ( N + 1 ) 2 10 ≥ 0.
Thus α ( t + 1 ) ≥ 0 \alpha^{(t+1)}\ge0 α ( t + 1 ) ≥ 0 in all cases. Since α ( t ) ≥ 0 \alpha^{(t)}\ge0 α ( t ) ≥ 0 , the already-proved positivity of ∂ β L \partial_{\beta}\mathcal{L} ∂ β L applies, and therefore
β ( t + 1 ) = β ( t ) − η N + 1 ∂ β L ( α ( t ) , β ( t ) ) < β ( t ) ≤ 0. \beta^{(t+1)}=\beta^{(t)}-\frac{\eta}{N+1}\partial_{\beta}\mathcal{L}\left(\alpha^{(t)},\beta^{(t)}\right)<\beta^{(t)}\le0. β ( t + 1 ) = β ( t ) − N + 1 η ∂ β L ( α ( t ) , β ( t ) ) < β ( t ) ≤ 0.
This closes the induction and proves
α ( t ) ≥ 0 , β ( t ) ≤ 0 \alpha^{(t)}\ge0,\qquad\beta^{(t)}\le0 α ( t ) ≥ 0 , β ( t ) ≤ 0
for every t t t , together with the strict monotonic decrease of β ( t ) \beta^{(t)} β ( t ) .
Lemma D.19. Under the assumptions of Theorem 5.2 , if
θ t : = ( α ( t ) , β ( t ) ) , L t : = L ( θ t ) , \theta_t:=\left(\alpha^{(t)},\beta^{(t)}\right),\qquad L_t:=\mathcal{L}(\theta_t), θ t := ( α ( t ) , β ( t ) ) , L t := L ( θ t ) ,
then
L t + 1 ≤ L t − η 2 ( 1 d ( ∂ α L ( θ t ) ) 2 + 1 N + 1 ( ∂ β L ( θ t ) ) 2 ) for all t ≥ 0. L_{t+1} \le L_t - \frac{\eta}{2}\left(\frac{1}{d}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2 + \frac{1}{N+1}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\right) \qquad\text{for all } t \ge0. L t + 1 ≤ L t − 2 η ( d 1 ( ∂ α L ( θ t ) ) 2 + N + 1 1 ( ∂ β L ( θ t ) ) 2 ) for all t ≥ 0.
Consequently,
∑ t = 0 ∞ ( 1 d ( ∂ α L ( θ t ) ) 2 + 1 N + 1 ( ∂ β L ( θ t ) ) 2 ) < ∞ , ∥ ∇ L ( θ t ) ∥ → 0 , \sum_{t=0}^{\infty}\left(\frac{1}{d}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2 + \frac{1}{N+1}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\right) < \infty,\qquad\|\nabla\mathcal{L}(\theta_t)\| \to0, t = 0 ∑ ∞ ( d 1 ( ∂ α L ( θ t ) ) 2 + N + 1 1 ( ∂ β L ( θ t ) ) 2 ) < ∞ , ∥∇ L ( θ t ) ∥ → 0 ,
and
∣ α ( t + 1 ) − α ( t ) ∣ ≤ 10 η d ≤ 10 η < 1 for all t . \left|\alpha^{(t+1)}-\alpha^{(t)}\right| \le\frac{10\eta}{d} \le10\eta< 1 \qquad\text{for all } t. α ( t + 1 ) − α ( t ) ≤ d 10 η ≤ 10 η < 1 for all t .
Moreover, the trajectory ( θ t ) t ≥ 0 (\theta_t)_{t\ge0} ( θ t ) t ≥ 0 is unbounded in R 2 \mathbb{R}^2 R 2 .
Proof. By Lemma D.15 , ∇ L \nabla\mathcal{L} ∇ L is globally 84-Lipschitz. The induced scalar recursion gives
θ t + 1 = ( α ( t ) − η d ∂ α L ( θ t ) , β ( t ) − η N + 1 ∂ β L ( θ t ) ) . \theta_{t+1} = \left(\alpha^{(t)}-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\theta_t),\ \beta^{(t)}-\frac{\eta}{N+1}\partial_{\beta}\mathcal{L}(\theta_t)\right). θ t + 1 = ( α ( t ) − d η ∂ α L ( θ t ) , β ( t ) − N + 1 η ∂ β L ( θ t ) ) .
The descent lemma therefore gives
L t + 1 ≤ L t − η ( 1 d ( ∂ α L ( θ t ) ) 2 + 1 N + 1 ( ∂ β L ( θ t ) ) 2 ) + 84 η 2 2 ( 1 d 2 ( ∂ α L ( θ t ) ) 2 + 1 ( N + 1 ) 2 ( ∂ β L ( θ t ) ) 2 ) . \begin{aligned}
L_{t+1} &\le L_t-\eta\left(\frac{1}{d}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2+\frac{1}{N+1}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\right)\\
&\quad+\frac{84\eta^2}{2}\left(\frac{1}{d^2}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2+\frac{1}{(N+1)^2}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\right).
\end{aligned} L t + 1 ≤ L t − η ( d 1 ( ∂ α L ( θ t ) ) 2 + N + 1 1 ( ∂ β L ( θ t ) ) 2 ) + 2 84 η 2 ( d 2 1 ( ∂ α L ( θ t ) ) 2 + ( N + 1 ) 2 1 ( ∂ β L ( θ t ) ) 2 ) .
Since d ≥ 1 d \ge1 d ≥ 1 and N + 1 ≥ 1 N+1 \ge1 N + 1 ≥ 1 ,
1 d 2 ( ∂ α L ( θ t ) ) 2 + 1 ( N + 1 ) 2 ( ∂ β L ( θ t ) ) 2 ≤ 1 d ( ∂ α L ( θ t ) ) 2 + 1 N + 1 ( ∂ β L ( θ t ) ) 2 . \frac{1}{d^2}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2+\frac{1}{(N+1)^2}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\le\frac{1}{d}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2+\frac{1}{N+1}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2. d 2 1 ( ∂ α L ( θ t ) ) 2 + ( N + 1 ) 2 1 ( ∂ β L ( θ t ) ) 2 ≤ d 1 ( ∂ α L ( θ t ) ) 2 + N + 1 1 ( ∂ β L ( θ t ) ) 2 .
Also η ≤ 1 840 ( N + 1 ) 2 < 1 84 \eta\le\frac{1}{840(N+1)^2}<\frac{1}{84} η ≤ 840 ( N + 1 ) 2 1 < 84 1 , so
1 − 84 η 2 ≥ 1 2 . 1-\frac{84\eta}{2}\ge\frac{1}{2}. 1 − 2 84 η ≥ 2 1 .
Hence
L t + 1 ≤ L t − η 2 ( 1 d ( ∂ α L ( θ t ) ) 2 + 1 N + 1 ( ∂ β L ( θ t ) ) 2 ) . L_{t+1}\le L_t-\frac{\eta}{2}\left(\frac{1}{d}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2+\frac{1}{N+1}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\right). L t + 1 ≤ L t − 2 η ( d 1 ( ∂ α L ( θ t ) ) 2 + N + 1 1 ( ∂ β L ( θ t ) ) 2 ) .
Because L ≥ 0 \mathcal{L}\ge0 L ≥ 0 , summing over t t t yields
∑ t = 0 ∞ ( 1 d ( ∂ α L ( θ t ) ) 2 + 1 N + 1 ( ∂ β L ( θ t ) ) 2 ) ≤ 2 L 0 η < ∞ . \sum_{t=0}^{\infty}\left(\frac{1}{d}\left(\partial_{\alpha}\mathcal{L}(\theta_t)\right)^2+\frac{1}{N+1}\left(\partial_{\beta}\mathcal{L}(\theta_t)\right)^2\right)\le\frac{2L_0}{\eta}<\infty. t = 0 ∑ ∞ ( d 1 ( ∂ α L ( θ t ) ) 2 + N + 1 1 ( ∂ β L ( θ t ) ) 2 ) ≤ η 2 L 0 < ∞.
Since d d d and N N N are fixed finite constants, this implies
∥ ∇ L ( θ t ) ∥ → 0. \|\nabla\mathcal{L}(\theta_t)\|\to0. ∥∇ L ( θ t ) ∥ → 0.
The bound ∣ ∂ α L ∣ ≤ 10 |\partial_{\alpha}\mathcal{L}|\le10 ∣ ∂ α L ∣ ≤ 10 from Lemma D.15 gives
∣ α ( t + 1 ) − α ( t ) ∣ = η d ∣ ∂ α L ( θ t ) ∣ ≤ 10 η d ≤ 10 η < 1. \left|\alpha^{(t+1)}-\alpha^{(t)}\right|=\frac{\eta}{d}\left|\partial_{\alpha}\mathcal{L}(\theta_t)\right|\le\frac{10\eta}{d}\le10\eta<1. α ( t + 1 ) − α ( t ) = d η ∣ ∂ α L ( θ t ) ∣ ≤ d 10 η ≤ 10 η < 1.
It remains to exclude bounded trajectories. Suppose that ( θ t ) (\theta_t) ( θ t ) were bounded. By Lemma D.18 , every θ t \theta_t θ t belongs to the closed half-strip
[ 0 , ∞ ) × ( − ∞ , 0 ] . [0,\infty) \times(-\infty,0]. [ 0 , ∞ ) × ( − ∞ , 0 ] .
A bounded sequence in R 2 \mathbb{R}^2 R 2 has a convergent subsequence, so there exist t k → ∞ t_k \to\infty t k → ∞ and θ ˉ = ( α ˉ , β ˉ ) ∈ [ 0 , ∞ ) × ( − ∞ , 0 ] \bar{\theta} = (\bar{\alpha},\bar{\beta}) \in[0,\infty) \times(-\infty,0] θ ˉ = ( α ˉ , β ˉ ) ∈ [ 0 , ∞ ) × ( − ∞ , 0 ] such that
θ t k → θ ˉ . \theta_{t_k} \to\bar{\theta}. θ t k → θ ˉ .
Since ∥ ∇ L ( θ t ) ∥ → 0 \lVert\nabla\mathcal{L}(\theta_t)\rVert\to0 ∥ ∇ L ( θ t )∥ → 0 and ∇ L \nabla\mathcal{L} ∇ L is continuous,
∇ L ( θ ˉ ) = 0. \nabla\mathcal{L}(\bar{\theta}) = 0. ∇ L ( θ ˉ ) = 0.
But Lemma D.18 states that ∂ β L ( α , β ) > 0 \partial_\beta\mathcal{L}(\alpha,\beta)>0 ∂ β L ( α , β ) > 0 for every α ≥ 0 \alpha\geq0 α ≥ 0 , which contradicts ∂ β L ( θ ˉ ) = 0 \partial_\beta\mathcal{L}(\bar{\theta})=0 ∂ β L ( θ ˉ ) = 0 . Hence the trajectory is unbounded.
Lemma D.20. Under the assumptions of Theorem 5.2 ,
β ( t ) → − ∞ as t → ∞ . \beta^{(t)} \to-\infty\qquad\text{as } t\to\infty. β ( t ) → − ∞ as t → ∞.
Proof. By Lemma D.18 , ( β ( t ) ) t ≥ 0 (\beta^{(t)})_{t\geq0} ( β ( t ) ) t ≥ 0 is strictly decreasing and bounded above by 0 0 0 . Suppose, toward a contradiction, that it is bounded below. Then monotone convergence yields a finite limit
β ( t ) → β ∞ ∈ R . \beta^{(t)} \to\beta_\infty\in\mathbb{R}. β ( t ) → β ∞ ∈ R .
By Lemma D.19, the full trajectory is unbounded. Since α ( t ) ≥ 0 \alpha^{(t)}\geq0 α ( t ) ≥ 0 for all t t t , this forces ( α ( t ) ) t ≥ 0 (\alpha^{(t)})_{t\geq0} ( α ( t ) ) t ≥ 0 to be unbounded above. Hence there exists a subsequence t k → ∞ t_k\to\infty t k → ∞ such that
α ( t k ) → + ∞ . \alpha^{(t_k)} \to+\infty. α ( t k ) → + ∞.
Fix a realization of U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N such that U i < 1 U_i<1 U i < 1 for every i i i , which holds almost surely because U i = 1 U_i=1 U i = 1 is equivalent to x i = x q x_i=x_q x i = x q , an event of probability zero. Then, for every i ∈ [ N ] i\in[N] i ∈ [ N ] ,
a i ( α , β ) = e α U i e α + β + ∑ j = 1 N e α U j = e − β − α ( 1 − U i ) 1 + ∑ j = 1 N e − β − α ( 1 − U j ) . a_i(\alpha,\beta)=\frac{e^{\alpha U_i}}{e^{\alpha+\beta}+\sum_{j=1}^{N}e^{\alpha U_j}}=\frac{e^{-\beta-\alpha(1-U_i)}}{1+\sum_{j=1}^{N}e^{-\beta-\alpha(1-U_j)}}. a i ( α , β ) = e α + β + ∑ j = 1 N e α U j e α U i = 1 + ∑ j = 1 N e − β − α ( 1 − U j ) e − β − α ( 1 − U i ) .
If α → + ∞ \alpha\to+\infty α → + ∞ and β → β ∞ ∈ R \beta\to\beta_\infty\in\mathbb{R} β → β ∞ ∈ R , then 1 − U i > 0 1-U_i>0 1 − U i > 0 , hence
a i ( α , β ) → 0 , a 0 ( α , β ) = 1 − ∑ i = 1 N a i ( α , β ) → 1. a_i(\alpha,\beta)\to0,\qquad a_0(\alpha,\beta)=1-\sum_{i=1}^{N}a_i(\alpha,\beta)\to1. a i ( α , β ) → 0 , a 0 ( α , β ) = 1 − i = 1 ∑ N a i ( α , β ) → 1.
Therefore, along the subsequence t k t_k t k ,
φ ( U 1 , … , U N ; α ( t k ) , β ( t k ) ) → 1 + 0 + 1 2 − 0 = 3 2 \varphi(U_1,\ldots,U_N;\alpha^{(t_k)},\beta^{(t_k)})\to1+0+\frac{1}{2}-0=\frac{3}{2} φ ( U 1 , … , U N ; α ( t k ) , β ( t k ) ) → 1 + 0 + 2 1 − 0 = 2 3
almost surely. Since φ = E [ ℓ ( α , β ) ∣ G ] \varphi= \mathbb{E}[\ell(\alpha,\beta)\mid\mathcal{G}] φ = E [ ℓ ( α , β ) ∣ G ] , we have φ ≥ 0 \varphi\ge0 φ ≥ 0 . Also,
φ = 1 + ∑ i = 1 N a i 2 + 1 2 a 0 2 − 2 a π ≤ 1 + ∑ i = 1 N a i 2 + 1 2 a 0 2 ≤ 5 2 . \varphi= 1+\sum_{i=1}^{N}a_i^2+\frac{1}{2}a_0^2-2a_\pi\le1+\sum_{i=1}^{N}a_i^2+\frac{1}{2}a_0^2 \le\frac{5}{2}. φ = 1 + i = 1 ∑ N a i 2 + 2 1 a 0 2 − 2 a π ≤ 1 + i = 1 ∑ N a i 2 + 2 1 a 0 2 ≤ 2 5 .
Hence dominated convergence gives
L t k = L ( α ( t k ) , β ( t k ) ) → 3 2 . L_{t_k}=\mathcal{L}\left(\alpha^{(t_k)},\beta^{(t_k)}\right)\to\frac{3}{2}. L t k = L ( α ( t k ) , β ( t k ) ) → 2 3 .
On the other hand, Lemma D.19 implies L t ≤ L 0 L_t\le L_0 L t ≤ L 0 for all t t t . At ( α , β ) = ( 0 , 0 ) (\alpha,\beta)=(0,0) ( α , β ) = ( 0 , 0 ) , all N + 1 N+1 N + 1 attention weights equal ( N + 1 ) − 1 (N+1)^{-1} ( N + 1 ) − 1 , so Lemma D.13 yields
L 0 = 1 + N ( N + 1 ) 2 + 1 2 ( N + 1 ) 2 − 2 N + 1 = 1 − N + 3 2 ( N + 1 ) 2 < 1. L_0=1+\frac{N}{(N+1)^2}+\frac{1}{2(N+1)^2}-\frac{2}{N+1}=1-\frac{N+\frac{3}{2}}{(N+1)^2}<1. L 0 = 1 + ( N + 1 ) 2 N + 2 ( N + 1 ) 2 1 − N + 1 2 = 1 − ( N + 1 ) 2 N + 2 3 < 1.
Thus L t < 1 L_t<1 L t < 1 for all t t t , which contradicts L t k → 3 2 L_{t_k}\to\frac{3}{2} L t k → 2 3 . The contradiction proves
β ( t ) → − ∞ . \beta^{(t)}\to-\infty. β ( t ) → − ∞.
Lemma D.21. Define the data-only reduced loss
ψ ( U 1 , … , U N ; α ) : = 1 + Q ( α ) − 2 b π ( α ) , \psi(U_1,\ldots,U_N;\alpha):=1+Q(\alpha)-2b_\pi(\alpha), ψ ( U 1 , … , U N ; α ) := 1 + Q ( α ) − 2 b π ( α ) , and its population version
Ψ ( α ) : = E [ ψ ( U 1 , … , U N ; α ) ] , α ≥ 0. \Psi(\alpha):=\mathbb{E}\left[\psi(U_1,\ldots,U_N;\alpha)\right],\qquad\alpha\ge0. Ψ ( α ) := E [ ψ ( U 1 , … , U N ; α ) ] , α ≥ 0. Then Ψ ∈ C 1 ( [ 0 , ∞ ) ) \Psi\in C^1([0,\infty)) Ψ ∈ C 1 ([ 0 , ∞ )) and
Ψ ′ ( α ) < 0 for every α ≥ 0. \Psi'(\alpha)<0\qquad\text{for every }\alpha\ge0. Ψ ′ ( α ) < 0 for every α ≥ 0. Moreover,
α ( t ) → + ∞ as t → ∞ . \alpha^{(t)}\to+\infty\qquad\text{as }t\to\infty. α ( t ) → + ∞ as t → ∞.
Proof. We first prove Ψ ′ ( α ) < 0 \Psi'(\alpha)<0 Ψ ′ ( α ) < 0 . For fixed U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N , the derivative of ψ \psi ψ is
∂ α ψ = Q ′ − 2 ∂ α b π . \partial_\alpha\psi=Q'-2\partial_\alpha b_\pi. ∂ α ψ = Q ′ − 2 ∂ α b π .
If α = 0 \alpha=0 α = 0 , then b i ( 0 ) = 1 / N b_i(0)=1/N b i ( 0 ) = 1/ N , so
Q ( 0 ) = 1 N , b π ( 0 ) = 1 N , Q ′ ( 0 ) = 0 , ∂ α b π ( 0 ) = 1 N ( U π − 1 N ∑ i = 1 N U i ) . Q(0)=\frac{1}{N},\qquad b_\pi(0)=\frac{1}{N},\qquad Q'(0)=0,\qquad\partial_\alpha b_\pi(0)=\frac{1}{N}\left(U_\pi-\frac{1}{N}\sum_{i=1}^{N}U_i\right). Q ( 0 ) = N 1 , b π ( 0 ) = N 1 , Q ′ ( 0 ) = 0 , ∂ α b π ( 0 ) = N 1 ( U π − N 1 i = 1 ∑ N U i ) .
Since N ≥ 2 N\ge2 N ≥ 2 and U π U_\pi U π is a strict maximum almost surely, we have
U π > 1 N ∑ i = 1 N U i . U_\pi>\frac{1}{N}\sum_{i=1}^{N}U_i. U π > N 1 i = 1 ∑ N U i .
almost surely, hence
∂ α ψ ( 0 ) = − 2 N ( U π − 1 N ∑ i = 1 N U i ) < 0 a.s. \partial_{\alpha}\psi(0)=-\frac{2}{N}\left(U_{\pi}-\frac{1}{N}\sum_{i=1}^{N}U_i\right)<0 \qquad\text{a.s.} ∂ α ψ ( 0 ) = − N 2 ( U π − N 1 i = 1 ∑ N U i ) < 0 a.s.
If α > 0 \alpha>0 α > 0 , then b π ( α ) b_{\pi}(\alpha) b π ( α ) is the unique largest b i ( α ) b_i(\alpha) b i ( α ) , because U π > U i U_{\pi}>U_i U π > U i for all i ≠ π i\ne\pi i = π and u ↦ e α u u\mapsto e^{\alpha u} u ↦ e α u is strictly increasing. Therefore
Q ( α ) = ∑ i = 1 N b i ( α ) 2 < b π ( α ) ∑ i = 1 N b i ( α ) = b π ( α ) . Q(\alpha)=\sum_{i=1}^{N}b_i(\alpha)^2<b_{\pi}(\alpha)\sum_{i=1}^{N}b_i(\alpha)=b_{\pi}(\alpha). Q ( α ) = i = 1 ∑ N b i ( α ) 2 < b π ( α ) i = 1 ∑ N b i ( α ) = b π ( α ) .
Also μ ( α ) = ∑ i = 1 N b i ( α ) U i \mu(\alpha)=\sum_{i=1}^{N}b_i(\alpha)U_i μ ( α ) = ∑ i = 1 N b i ( α ) U i is a strict convex combination of the U i U_i U i , so
μ ( α ) < U π . \mu(\alpha)<U_{\pi}. μ ( α ) < U π .
Using the formula for Q ′ Q' Q ′ ,
Q ′ = 2 ∑ i = 1 N b i ( α ) 2 ( U i − μ ( α ) ) ≤ 2 U π ∑ i = 1 N b i ( α ) 2 − 2 μ ( α ) ∑ i = 1 N b i ( α ) 2 = 2 Q ( α ) ( U π − μ ( α ) ) . Q'=2\sum_{i=1}^{N}b_i(\alpha)^2\left(U_i-\mu(\alpha)\right)\le2U_{\pi}\sum_{i=1}^{N}b_i(\alpha)^2-2\mu(\alpha)\sum_{i=1}^{N}b_i(\alpha)^2=2Q(\alpha)\left(U_{\pi}-\mu(\alpha)\right). Q ′ = 2 i = 1 ∑ N b i ( α ) 2 ( U i − μ ( α ) ) ≤ 2 U π i = 1 ∑ N b i ( α ) 2 − 2 μ ( α ) i = 1 ∑ N b i ( α ) 2 = 2 Q ( α ) ( U π − μ ( α ) ) .
Therefore
Q ′ − 2 ∂ α b π ≤ 2 Q ( α ) ( U π − μ ( α ) ) − 2 b π ( α ) ( U π − μ ( α ) ) = − 2 ( b π ( α ) − Q ( α ) ) ( U π − μ ( α ) ) < 0. Q'-2\partial_{\alpha}b_{\pi}\le2Q(\alpha)\left(U_{\pi}-\mu(\alpha)\right)-2b_{\pi}(\alpha)\left(U_{\pi}-\mu(\alpha)\right)=-2\left(b_{\pi}(\alpha)-Q(\alpha)\right)\left(U_{\pi}-\mu(\alpha)\right)<0. Q ′ − 2 ∂ α b π ≤ 2 Q ( α ) ( U π − μ ( α ) ) − 2 b π ( α ) ( U π − μ ( α ) ) = − 2 ( b π ( α ) − Q ( α ) ) ( U π − μ ( α ) ) < 0.
Hence ∂ α ψ ( α ) < 0 \partial_{\alpha}\psi(\alpha)<0 ∂ α ψ ( α ) < 0 almost surely for every α > 0 \alpha>0 α > 0 . Since ∣ Q ′ ∣ ≤ 4 |Q'|\le4 ∣ Q ′ ∣ ≤ 4 and ∣ ∂ α b π ∣ ≤ 2 |\partial_{\alpha}b_{\pi}|\le2 ∣ ∂ α b π ∣ ≤ 2 , we have ∣ ∂ α ψ ∣ ≤ 8 |\partial_{\alpha}\psi|\le8 ∣ ∂ α ψ ∣ ≤ 8 , and dominated convergence gives Ψ ∈ C 1 ( [ 0 , ∞ ) ) \Psi\in C^1([0,\infty)) Ψ ∈ C 1 ([ 0 , ∞ )) with
Ψ ′ ( α ) = E [ ∂ α ψ ( α ) ] < 0 ( α ≥ 0 ) . \Psi'(\alpha)=\mathbb{E}[\partial_{\alpha}\psi(\alpha)]<0\qquad(\alpha\ge0). Ψ ′ ( α ) = E [ ∂ α ψ ( α )] < 0 ( α ≥ 0 ) .
We now prove α ( t ) → + ∞ \alpha^{(t)}\to+\infty α ( t ) → + ∞ . Fix A > 0 A>0 A > 0 . Since Ψ ′ \Psi' Ψ ′ is continuous and strictly negative on the compact interval [ 0 , A + 1 ] [0,A+1] [ 0 , A + 1 ] , the quantity
ρ A : = − 1 2 max 0 ≤ α ≤ A + 1 Ψ ′ ( α ) \rho_A:=-\frac{1}{2}\max_{0\le\alpha\le A+1}\Psi'(\alpha) ρ A := − 2 1 0 ≤ α ≤ A + 1 max Ψ ′ ( α )
is well defined and strictly positive.
We next compare ∂ α L \partial_{\alpha}\mathcal{L} ∂ α L with Ψ ′ \Psi' Ψ ′ for large negative β \beta β . For fixed U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N and 0 ≤ α ≤ A + 1 0\le\alpha\le A+1 0 ≤ α ≤ A + 1 , Lemma D.15 gives
∂ α φ − ∂ α ψ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) + ( ( 1 − a 0 ( α , β ) ) 2 − 1 ) Q ′ ( α ) + 2 a 0 ( α , β ) ∂ α b π ( α ) . \partial_{\alpha}\varphi-\partial_{\alpha}\psi=a_0(\alpha,\beta)\left(1-a_0(\alpha,\beta)\right)\left(1-\mu(\alpha)\right)\left(a_0(\alpha,\beta)+2b_{\pi}(\alpha)-2\left(1-a_0(\alpha,\beta)\right)Q(\alpha)\right)+\left(\left(1-a_0(\alpha,\beta)\right)^2-1\right)Q'(\alpha)+2a_0(\alpha,\beta)\partial_{\alpha}b_{\pi}(\alpha). ∂ α φ − ∂ α ψ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) + ( ( 1 − a 0 ( α , β ) ) 2 − 1 ) Q ′ ( α ) + 2 a 0 ( α , β ) ∂ α b π ( α ) .
Because 0 ≤ a 0 ( α , β ) ≤ 1 0\le a_0(\alpha,\beta)\le1 0 ≤ a 0 ( α , β ) ≤ 1 , ∣ 1 − μ ( α ) ∣ ≤ 2 |1-\mu(\alpha)|\le2 ∣1 − μ ( α ) ∣ ≤ 2 , 0 ≤ b π ( α ) , Q ( α ) ≤ 1 0\le b_{\pi}(\alpha),Q(\alpha)\le1 0 ≤ b π ( α ) , Q ( α ) ≤ 1 , ∣ Q ′ ( α ) ∣ ≤ 4 |Q'(\alpha)|\le4 ∣ Q ′ ( α ) ∣ ≤ 4 , and ∣ ∂ α b π ( α ) ∣ ≤ 2 |\partial_{\alpha}b_{\pi}(\alpha)|\le2 ∣ ∂ α b π ( α ) ∣ ≤ 2 , this implies
∣ ∂ α φ − ∂ α ψ ∣ ≤ 10 a 0 ( α , β ) + 8 a 0 ( α , β ) + 4 a 0 ( α , β ) = 22 a 0 ( α , β ) . |\partial_{\alpha}\varphi-\partial_{\alpha}\psi|\le10a_0(\alpha,\beta)+8a_0(\alpha,\beta)+4a_0(\alpha,\beta)=22a_0(\alpha,\beta). ∣ ∂ α φ − ∂ α ψ ∣ ≤ 10 a 0 ( α , β ) + 8 a 0 ( α , β ) + 4 a 0 ( α , β ) = 22 a 0 ( α , β ) .
Moreover,
a 0 ( α , β ) = e α + β e α + β + ∑ j = 1 N e α U j ≤ e α + β ∑ j = 1 N e α U j ≤ e α + β N e − α = e β + 2 α N ≤ e β + 2 A + 2 N . a_0(\alpha,\beta)=\frac{e^{\alpha+\beta}}{e^{\alpha+\beta}+\sum_{j=1}^{N}e^{\alpha U_j}}\leq\frac{e^{\alpha+\beta}}{\sum_{j=1}^{N}e^{\alpha U_j}}\leq\frac{e^{\alpha+\beta}}{Ne^{-\alpha}}=\frac{e^{\beta+2\alpha}}{N}\leq\frac{e^{\beta+2A+2}}{N}. a 0 ( α , β ) = e α + β + ∑ j = 1 N e α U j e α + β ≤ ∑ j = 1 N e α U j e α + β ≤ N e − α e α + β = N e β + 2 α ≤ N e β + 2 A + 2 .
Hence
sup 0 ≤ α ≤ A + 1 ∣ ∂ α L ( α , β ) − Ψ ′ ( α ) ∣ ≤ 22 e β + 2 A + 2 N . \sup_{0\leq\alpha\leq A+1}\left|\partial_\alpha\mathcal{L}(\alpha,\beta)-\Psi'(\alpha)\right|\leq\frac{22e^{\beta+2A+2}}{N}. 0 ≤ α ≤ A + 1 sup ∣ ∂ α L ( α , β ) − Ψ ′ ( α ) ∣ ≤ N 22 e β + 2 A + 2 .
Choose β ˉ A < 0 \bar{\beta}_A<0 β ˉ A < 0 so negative that
22 e β ˉ A + 2 A + 2 N ≤ ρ A . \frac{22e^{\bar{\beta}_A+2A+2}}{N}\leq\rho_A. N 22 e β ˉ A + 2 A + 2 ≤ ρ A .
Then for every β ≤ β ˉ A \beta\leq\bar{\beta}_A β ≤ β ˉ A and every 0 ≤ α ≤ A + 1 0\leq\alpha\leq A+1 0 ≤ α ≤ A + 1 ,
∂ α L ( α , β ) ≤ Ψ ′ ( α ) + ρ A ≤ − ρ A . \partial_\alpha\mathcal{L}(\alpha,\beta)\leq\Psi'(\alpha)+\rho_A\leq-\rho_A. ∂ α L ( α , β ) ≤ Ψ ′ ( α ) + ρ A ≤ − ρ A .
By Lemma D.20 , β ( t ) → − ∞ \beta^{(t)}\to-\infty β ( t ) → − ∞ , so there exists T A T_A T A such that
β ( t ) ≤ β ˉ A for all t ≥ T A . \beta^{(t)}\leq\bar{\beta}_A\qquad\text{for all }t\geq T_A. β ( t ) ≤ β ˉ A for all t ≥ T A .
Also Lemma D.19 gives
∣ α ( t + 1 ) − α ( t ) ∣ ≤ 10 η d ≤ 10 η < 1 for all t . \left|\alpha^{(t+1)}-\alpha^{(t)}\right|\leq\frac{10\eta}{d}\leq10\eta<1\qquad\text{for all }t. α ( t + 1 ) − α ( t ) ≤ d 10 η ≤ 10 η < 1 for all t .
If α ( T A ) > A + 1 \alpha^{(T_A)}>A+1 α ( T A ) > A + 1 , set S A : = T A S_A:=T_A S A := T A . Otherwise, while α ( t ) ≤ A + 1 \alpha^{(t)}\leq A+1 α ( t ) ≤ A + 1 and t ≥ T A t\geq T_A t ≥ T A , the previous estimate yields
α ( t + 1 ) = α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) ≥ α ( t ) + η ρ A d . \alpha^{(t+1)}=\alpha^{(t)}-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\geq\alpha^{(t)}+\frac{\eta\rho_A}{d}. α ( t + 1 ) = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) ≥ α ( t ) + d η ρ A .
Therefore after finitely many steps one reaches some S A ≥ T A S_A\geq T_A S A ≥ T A such that
α ( S A ) > A + 1. \alpha^{(S_A)}>A+1. α ( S A ) > A + 1.
We claim that
α ( t ) > A for all t ≥ S A . \alpha^{(t)}>A\qquad\text{for all }t\geq S_A. α ( t ) > A for all t ≥ S A .
Suppose the contrary. Then there exists t ≥ S A t\geq S_A t ≥ S A such that α ( t + 1 ) ≤ A \alpha^{(t+1)}\leq A α ( t + 1 ) ≤ A and α ( t ) > A \alpha^{(t)}>A α ( t ) > A . If A < α ( t ) ≤ A + 1 A<\alpha^{(t)}\leq A+1 A < α ( t ) ≤ A + 1 , then β ( t ) ≤ β ˉ A \beta^{(t)}\leq\bar{\beta}_A β ( t ) ≤ β ˉ A and the estimate above gives
α ( t + 1 ) > α ( t ) > A , \alpha^{(t+1)}>\alpha^{(t)}>A, α ( t + 1 ) > α ( t ) > A ,
a contradiction. If α ( t ) > A + 1 \alpha^{(t)}>A+1 α ( t ) > A + 1 , then
α ( t ) − α ( t + 1 ) > 1 , \alpha^{(t)}-\alpha^{(t+1)}>1, α ( t ) − α ( t + 1 ) > 1 ,
which contradicts ∣ α ( t + 1 ) − α ( t ) ∣ < 1 |\alpha^{(t+1)}-\alpha^{(t)}|<1 ∣ α ( t + 1 ) − α ( t ) ∣ < 1 . This proves the claim.
Since A > 0 A>0 A > 0 was arbitrary, for every finite A A A there exists S A S_A S A such that α ( t ) > A \alpha^{(t)}>A α ( t ) > A for all t ≥ S A t\geq S_A t ≥ S A . Therefore
α ( t ) → + ∞ . \alpha^{(t)}\to+\infty. α ( t ) → + ∞.
Theorem D.22. Under Assumption 5.1 , suppose that
d ≥ 2 , N ≥ 100 d , 0 < η ≤ 1 840 ( N + 1 ) 2 . d \ge2,\qquad N \ge100\sqrt{d},\qquad0 < \eta\le\frac{1}{840(N+1)^2}. d ≥ 2 , N ≥ 100 d , 0 < η ≤ 840 ( N + 1 ) 2 1 . Let
( α ( t ) , β ( t ) ) t ≥ 0 \left(\alpha^{(t)},\beta^{(t)}\right)_{t\ge0} ( α ( t ) , β ( t ) ) t ≥ 0 be the scalar iterates induced by the full matrix gradient-descent updates on the invariant manifold, initialized at
α ( 0 ) = 0 , β ( 0 ) = 0. \alpha^{(0)}=0,\qquad\beta^{(0)}=0. α ( 0 ) = 0 , β ( 0 ) = 0. Equivalently, they satisfy
α ( t + 1 ) = α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) , \alpha^{(t+1)}=\alpha^{(t)}-\frac{\eta}{d}\partial_\alpha L\left(\alpha^{(t)},\beta^{(t)}\right), α ( t + 1 ) = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) , β ( t + 1 ) = β ( t ) − η N + 1 ∂ β L ( α ( t ) , β ( t ) ) . \beta^{(t+1)}=\beta^{(t)}-\frac{\eta}{N+1}\partial_\beta L\left(\alpha^{(t)},\beta^{(t)}\right). β ( t + 1 ) = β ( t ) − N + 1 η ∂ β L ( α ( t ) , β ( t ) ) . Then the recursion is well defined for every t ≥ 0 t\ge0 t ≥ 0 , and
α ( t ) → + ∞ , β ( t ) → − ∞ as t → ∞ . \alpha^{(t)}\to+\infty,\qquad\beta^{(t)}\to-\infty\qquad\text{as }t\to\infty. α ( t ) → + ∞ , β ( t ) → − ∞ as t → ∞. Moreover,
α ( t ) ≥ 0 , β ( t ) ≤ 0 for all t ≥ 0 , \alpha^{(t)}\ge0,\qquad\beta^{(t)}\le0\qquad\text{for all }t\ge0, α ( t ) ≥ 0 , β ( t ) ≤ 0 for all t ≥ 0 , and ( β ( t ) ) t ≥ 0 (\beta^{(t)})_{t\ge0} ( β ( t ) ) t ≥ 0 is strictly decreasing.
Proof of Theorem D.22. Lemma D.15 shows that L ∈ C 2 ( R 2 ) L\in C^2(\mathbb{R}^2) L ∈ C 2 ( R 2 ) , so the induced scalar recursion is well defined for every t ≥ 0 t\ge0 t ≥ 0 . Lemma D.18 proves
α ( t ) ≥ 0 , β ( t ) ≤ 0 ( t ≥ 0 ) , \alpha^{(t)}\ge0,\qquad\beta^{(t)}\le0\qquad(t\ge0), α ( t ) ≥ 0 , β ( t ) ≤ 0 ( t ≥ 0 ) ,
and shows that ( β ( t ) ) t ≥ 0 (\beta^{(t)})_{t\ge0} ( β ( t ) ) t ≥ 0 is strictly decreasing. Lemma D.20 yields
β ( t ) → − ∞ , \beta^{(t)}\to-\infty, β ( t ) → − ∞ ,
and Lemma D.21 yields
α ( t ) → + ∞ . \alpha^{(t)}\to+\infty. α ( t ) → + ∞.
This is exactly the asserted conclusion.
Exact asymptotic representation of the population loss
We now continue from Theorem D.22 , which established the parameter divergence
α ( t ) → + ∞ , β ( t ) → − ∞ . \alpha^{(t)}\to+\infty,\qquad\beta^{(t)}\to-\infty. α ( t ) → + ∞ , β ( t ) → − ∞.
The next goal is to identify the precise quantity that controls the population loss along the actual gradient-descent trajectory. In this subsection, we show that once α ( t ) \alpha^{(t)} α ( t ) is large, the attention over the context tokens concentrates on the nearest neighbor, and the entire population loss can be reduced asymptotically to the contribution of the self-token weight. The analysis proceeds in two main steps:
Step 1. We first prove that the normalized context-token softmax concentrates on the nearest-neighbor index, so that the data-only part of the loss becomes asymptotically negligible.
Step 2. Using the exact reduced loss formula derived earlier, we then decompose the population loss into a vanishing context term, lower-order interaction terms, and a leading self-token term. Combining these estimates, we obtain an exact asymptotic representation of the form
L ( α ( t ) , β ( t ) ) = 3 2 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) , \mathcal{L}(\alpha^{(t)},\beta^{(t)}) = \frac{3}{2}\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right] + o(1), L ( α ( t ) , β ( t ) ) = 2 3 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) ,
which shows that the asymptotic behavior of the population loss is determined entirely by the squared self-token weight a 0 ( α ( t ) , β ( t ) ) 2 a_0(\alpha^{(t)},\beta^{(t)})^2 a 0 ( α ( t ) , β ( t ) ) 2 .
Retain the notation introduced earlier. In particular,
U i : = x i T x q , π : = arg max 1 ≤ i ≤ N U i , U_i := \mathbf{x}_i^{\mathsf{T}}\mathbf{x}_q,\qquad\pi:= \underset{1\le i\le N}{\arg\max}\ U_i, U i := x i T x q , π := 1 ≤ i ≤ N arg max U i ,
and for each t ≥ 0 t \ge0 t ≥ 0 ,
b i ( t ) : = e α ( t ) U i ∑ j = 1 N e α ( t ) U j , Q t : = ∑ i = 1 N ( b i ( t ) ) 2 . b_i^{(t)} := \frac{e^{\alpha^{(t)}U_i}}{\sum_{j=1}^{N}e^{\alpha^{(t)}U_j}},\qquad Q_t := \sum_{i=1}^{N}\left(b_i^{(t)}\right)^2. b i ( t ) := ∑ j = 1 N e α ( t ) U j e α ( t ) U i , Q t := i = 1 ∑ N ( b i ( t ) ) 2 .
Lemma D.23. For almost every realization of ( x 1 , … , x N , x q ) (\mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q) ( x 1 , … , x N , x q ) , we have
b π ( t ) → 1 , b j ( t ) → 0 ( j ∈ [ N ] ∖ { π } ) , Q t → 1 b_\pi^{(t)} \to1,\qquad b_j^{(t)} \to0\quad(j\in[N]\setminus\{\pi\}),\qquad Q_t\to1 b π ( t ) → 1 , b j ( t ) → 0 ( j ∈ [ N ] ∖ { π }) , Q t → 1 as t → ∞ t\to\infty t → ∞ . If
ψ t : = 1 + Q t − 2 b π ( t ) , \psi_t := 1+Q_t-2b_\pi^{(t)}, ψ t := 1 + Q t − 2 b π ( t ) , then
ψ t → 0 almost surely , E [ ψ t ] → 0. \psi_t\to0\quad\text{almost surely},\qquad\mathbb{E}[\psi_t]\to0. ψ t → 0 almost surely , E [ ψ t ] → 0.
Proof. By Theorem D.22 ,
α ( t ) → + ∞ . \alpha^{(t)}\to+\infty. α ( t ) → + ∞.
Outside the null tie event, π \pi π is the unique maximizer of U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N , hence
U π − U j > 0 for every j ∈ [ N ] ∖ { π } . U_\pi-U_j>0\qquad\text{for every }j\in[N]\setminus\{\pi\}. U π − U j > 0 for every j ∈ [ N ] ∖ { π } .
Therefore
b j ( t ) b π ( t ) = exp ( − α ( t ) ( U π − U j ) ) → 0 ( j ≠ π ) . \frac{b_j^{(t)}}{b_\pi^{(t)}}=\exp\left(-\alpha^{(t)}(U_\pi-U_j)\right)\to0\qquad(j\ne\pi). b π ( t ) b j ( t ) = exp ( − α ( t ) ( U π − U j ) ) → 0 ( j = π ) .
Since ∑ i = 1 N b i ( t ) = 1 \sum_{i=1}^{N}b_i^{(t)}=1 ∑ i = 1 N b i ( t ) = 1 , it follows that
b π ( t ) = 1 1 + ∑ j ≠ π b j ( t ) / b π ( t ) → 1 , b_\pi^{(t)}=\frac{1}{1+\sum_{j\ne\pi}b_j^{(t)}/b_\pi^{(t)}}\to1, b π ( t ) = 1 + ∑ j = π b j ( t ) / b π ( t ) 1 → 1 ,
and hence b j ( t ) → 0 b_j^{(t)} \to0 b j ( t ) → 0 for every j ≠ π j \ne\pi j = π . Consequently,
Q t = ∑ i = 1 N ( b i ( t ) ) 2 → 1 Q_t = \sum_{i=1}^{N} (b_i^{(t)})^2 \to1 Q t = i = 1 ∑ N ( b i ( t ) ) 2 → 1
almost surely.
Next,
ψ t = 1 + Q t − 2 b π ( t ) = ( 1 − b π ( t ) ) 2 + ∑ j ≠ π ( b j ( t ) ) 2 . \psi_t = 1 + Q_t - 2b_\pi^{(t)} = (1-b_\pi^{(t)})^2 + \sum_{j \ne\pi}(b_j^{(t)})^2. ψ t = 1 + Q t − 2 b π ( t ) = ( 1 − b π ( t ) ) 2 + j = π ∑ ( b j ( t ) ) 2 .
Hence ψ t ≥ 0 \psi_t \ge0 ψ t ≥ 0 and ψ t → 0 \psi_t \to0 ψ t → 0 almost surely. Also 0 ≤ b π ( t ) , Q t ≤ 1 0 \le b_\pi^{(t)}, Q_t \le1 0 ≤ b π ( t ) , Q t ≤ 1 , so
0 ≤ ψ t ≤ 2. 0 \le\psi_t \le2. 0 ≤ ψ t ≤ 2.
Dominated convergence therefore yields
E [ ψ t ] → 0. \mathbb{E}[\psi_t] \to0. E [ ψ t ] → 0.
Lemma D.24. For every t ≥ 0 t \ge0 t ≥ 0 ,
L ( α ( t ) , β ( t ) ) = E [ ψ t ] + 2 E [ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ] + E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 1 2 ) ] . \mathcal{L}(\alpha^{(t)},\beta^{(t)}) = \mathbb{E}[\psi_t] + 2\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})(b_\pi^{(t)}-Q_t)\right] + \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\left(Q_t+\frac{1}{2}\right)\right]. L ( α ( t ) , β ( t ) ) = E [ ψ t ] + 2 E [ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ] + E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 2 1 ) ] . Moreover,
E [ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ] → 0 , E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ] → 0 , \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})(b_\pi^{(t)}-Q_t)\right] \to0,\qquad
\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2(Q_t-1)\right] \to0, E [ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ] → 0 , E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ] → 0 , and therefore
L ( α ( t ) , β ( t ) ) = 3 2 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) (45) \mathcal{L}(\alpha^{(t)},\beta^{(t)}) = \frac{3}{2}\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right] + o(1) \tag*{(45)} L ( α ( t ) , β ( t ) ) = 2 3 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) (45) as t → ∞ t \to\infty t → ∞ .
Proof. From Lemma D.15 in the preceding section,
φ ( α , β ) = 1 + ( 1 − a 0 ( α , β ) ) 2 ∑ i = 1 N b i ( α ) 2 + 1 2 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β ) ) b π ( α ) . \varphi(\alpha,\beta) = 1 + (1-a_0(\alpha,\beta))^2\sum_{i=1}^{N}b_i(\alpha)^2 + \frac{1}{2}a_0(\alpha,\beta)^2 - 2(1-a_0(\alpha,\beta))b_\pi(\alpha). φ ( α , β ) = 1 + ( 1 − a 0 ( α , β ) ) 2 i = 1 ∑ N b i ( α ) 2 + 2 1 a 0 ( α , β ) 2 − 2 ( 1 − a 0 ( α , β )) b π ( α ) .
Evaluating this at ( α ( t ) , β ( t ) ) (\alpha^{(t)},\beta^{(t)}) ( α ( t ) , β ( t ) ) gives
φ ( α ( t ) , β ( t ) ) = 1 + ( 1 − a 0 ( α ( t ) , β ( t ) ) ) 2 Q t + 1 2 a 0 ( α ( t ) , β ( t ) ) 2 − 2 ( 1 − a 0 ( α ( t ) , β ( t ) ) ) b π ( t ) . \varphi(\alpha^{(t)},\beta^{(t)}) = 1 + (1-a_0(\alpha^{(t)},\beta^{(t)}))^2Q_t + \frac{1}{2}a_0(\alpha^{(t)},\beta^{(t)})^2 - 2(1-a_0(\alpha^{(t)},\beta^{(t)}))b_\pi^{(t)}. φ ( α ( t ) , β ( t ) ) = 1 + ( 1 − a 0 ( α ( t ) , β ( t ) ) ) 2 Q t + 2 1 a 0 ( α ( t ) , β ( t ) ) 2 − 2 ( 1 − a 0 ( α ( t ) , β ( t ) )) b π ( t ) .
Expanding the right-hand side yields
φ ( α ( t ) , β ( t ) ) = ( 1 + Q t − 2 b π ( t ) ) + 2 a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) + a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 1 2 ) = ψ t + 2 a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) + a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 1 2 ) . \begin{aligned}
\varphi(\alpha^{(t)},\beta^{(t)}) &= (1+Q_t-2b_\pi^{(t)}) + 2a_0(\alpha^{(t)},\beta^{(t)})(b_\pi^{(t)}-Q_t) + a_0(\alpha^{(t)},\beta^{(t)})^2\left(Q_t+\frac{1}{2}\right) \\
&= \psi_t + 2a_0(\alpha^{(t)},\beta^{(t)})(b_\pi^{(t)}-Q_t) + a_0(\alpha^{(t)},\beta^{(t)})^2\left(Q_t+\frac{1}{2}\right).
\end{aligned} φ ( α ( t ) , β ( t ) ) = ( 1 + Q t − 2 b π ( t ) ) + 2 a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) + a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 2 1 ) = ψ t + 2 a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) + a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 2 1 ) .
Taking expectation gives the displayed identity for L ( α ( t ) , β ( t ) ) \mathcal{L}(\alpha^{(t)},\beta^{(t)}) L ( α ( t ) , β ( t ) ) .
Next, since b π ( t ) = max i b i ( t ) b_{\pi}^{(t)}=\max_i b_i^{(t)} b π ( t ) = max i b i ( t ) and ∑ i b i ( t ) = 1 \sum_i b_i^{(t)}=1 ∑ i b i ( t ) = 1 ,
Q t = ∑ i = 1 N ( b i ( t ) ) 2 ≤ b π ( t ) ∑ i = 1 N b i ( t ) = b π ( t ) . Q_t=\sum_{i=1}^{N}(b_i^{(t)})^2\le b_{\pi}^{(t)}\sum_{i=1}^{N}b_i^{(t)}=b_{\pi}^{(t)}. Q t = i = 1 ∑ N ( b i ( t ) ) 2 ≤ b π ( t ) i = 1 ∑ N b i ( t ) = b π ( t ) .
Thus b π ( t ) − Q t ≥ 0 b_{\pi}^{(t)}-Q_t\ge0 b π ( t ) − Q t ≥ 0 . Also Q t ≥ ( b π ( t ) ) 2 Q_t\ge(b_{\pi}^{(t)})^2 Q t ≥ ( b π ( t ) ) 2 , so
0 ≤ b π ( t ) − Q t ≤ b π ( t ) − ( b π ( t ) ) 2 = b π ( t ) ( 1 − b π ( t ) ) ≤ 1 − b π ( t ) . 0\le b_{\pi}^{(t)}-Q_t\le b_{\pi}^{(t)}-(b_{\pi}^{(t)})^2=b_{\pi}^{(t)}(1-b_{\pi}^{(t)})\le1-b_{\pi}^{(t)}. 0 ≤ b π ( t ) − Q t ≤ b π ( t ) − ( b π ( t ) ) 2 = b π ( t ) ( 1 − b π ( t ) ) ≤ 1 − b π ( t ) .
Since 0 ≤ a 0 ( α ( t ) , β ( t ) ) ≤ 1 0\le a_0(\alpha^{(t)},\beta^{(t)})\le1 0 ≤ a 0 ( α ( t ) , β ( t ) ) ≤ 1 ,
0 ≤ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ≤ 1 − b π ( t ) . 0\le a_0(\alpha^{(t)},\beta^{(t)})(b_{\pi}^{(t)}-Q_t)\le1-b_{\pi}^{(t)}. 0 ≤ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ≤ 1 − b π ( t ) .
By Lemma D.23, b π ( t ) → 1 b_{\pi}^{(t)}\to1 b π ( t ) → 1 almost surely, and 0 ≤ 1 − b π ( t ) ≤ 1 0\le1-b_{\pi}^{(t)}\le1 0 ≤ 1 − b π ( t ) ≤ 1 , so dominated convergence gives
E [ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ] → 0. \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})(b_{\pi}^{(t)}-Q_t)\right]\to0. E [ a 0 ( α ( t ) , β ( t ) ) ( b π ( t ) − Q t ) ] → 0.
For the quadratic term,
E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 1 2 ) ] = 3 2 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ] . \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\left(Q_t+\frac{1}{2}\right)\right]
=\frac{3}{2}\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right]
+\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2(Q_t-1)\right]. E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t + 2 1 ) ] = 2 3 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ] .
Because 0 ≤ Q t ≤ 1 0\le Q_t\le1 0 ≤ Q t ≤ 1 ,
∣ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ∣ = a 0 ( α ( t ) , β ( t ) ) 2 ( 1 − Q t ) ≤ 1 − Q t . \left|a_0(\alpha^{(t)},\beta^{(t)})^2(Q_t-1)\right|
=a_0(\alpha^{(t)},\beta^{(t)})^2(1-Q_t)\le1-Q_t. a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) = a 0 ( α ( t ) , β ( t ) ) 2 ( 1 − Q t ) ≤ 1 − Q t .
By Lemma D.23, Q t → 1 Q_t\to1 Q t → 1 almost surely, and 0 ≤ 1 − Q t ≤ 1 0\le1-Q_t\le1 0 ≤ 1 − Q t ≤ 1 , hence dominated convergence yields
E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ] → 0. \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2(Q_t-1)\right]\to0. E [ a 0 ( α ( t ) , β ( t ) ) 2 ( Q t − 1 ) ] → 0.
Finally, E [ ψ t ] → 0 \mathbb{E}[\psi_t]\to0 E [ ψ t ] → 0 by Lemma D.23. Substituting these three convergences into the exact decomposition of L ( α ( t ) , β ( t ) ) \mathcal{L}(\alpha^{(t)},\beta^{(t)}) L ( α ( t ) , β ( t ) ) proves (D.21).
Interior subsequential gradient asymptotics
Having reduced the population loss asymptotically to the self-token contribution, we next study the gradient field along subsequences for which the slope parameter
λ t : = β ( t ) α ( t ) , t ≥ 1 , \lambda_t:=\frac{\beta^{(t)}}{\alpha^{(t)}},\qquad t\ge1, λ t := α ( t ) β ( t ) , t ≥ 1 ,
converges to a limit in the interior regime ( 0 , 2 ) (0,2) ( 0 , 2 ) . The purpose of this subsection is to derive sharp boundary-layer asymptotics for the gradients at the scale 1 / α t 1/\alpha_t 1/ α t , which will later be used to control the global dynamics of λ t \lambda_t λ t . The analysis proceeds in three main steps:
Step 1. Fix an arbitrary subsequence t k → ∞ t_k\to\infty t k → ∞ such that λ t k → λ ∈ ( 0 , 2 ) \lambda_{t_k}\to\lambda\in(0,2) λ t k → λ ∈ ( 0 , 2 ) . We analyze the logistic kernels centered at the boundary layer
1 − U π = λ , 1-U_{\pi}=\lambda, 1 − U π = λ ,
and show that these kernels form approximate identities. Step 2. We then estimate the contributions of the non-maximal context tokens. In particular, we prove that all error terms produced by the residual tail and by the exact softmax profile are negligible after multiplication by α ( t k ) \alpha^{(t_k)} α ( t k ) .
Step 3. Finally, we replace the exact self-token profile by its ideal logistic approximation and compute the limiting boundary-layer profiles of the gradients. This yields explicit asymptotic formulas for
α ( t k ) ∂ α L ( α ( t k ) , β ( t k ) ) and α ( t k ) ( ∂ β L ( α ( t k ) , β ( t k ) ) + λ t k ∂ α L ( α ( t k ) , β ( t k ) ) ) , \alpha^{(t_k)}\partial_\alpha\mathcal{L}(\alpha^{(t_k)},\beta^{(t_k)}) \quad\text{and} \quad\alpha^{(t_k)}\left(\partial_\beta\mathcal{L}(\alpha^{(t_k)},\beta^{(t_k)})+\lambda_{t_k}\partial_\alpha\mathcal{L}(\alpha^{(t_k)},\beta^{(t_k)})\right), α ( t k ) ∂ α L ( α ( t k ) , β ( t k ) ) and α ( t k ) ( ∂ β L ( α ( t k ) , β ( t k ) ) + λ t k ∂ α L ( α ( t k ) , β ( t k ) ) ) ,
with strictly positive limits throughout the interior regime λ ∈ ( 0 , 2 ) \lambda\in(0,2) λ ∈ ( 0 , 2 ) .
We retain the notation introduced earlier. In particular,
U i : = x i T x q , π : = arg max 1 ≤ i ≤ N U i , U_i := x_i^{\mathsf{T}}x_q,\qquad\pi:= \underset{1\le i\le N}{\arg\max}\ U_i, U i := x i T x q , π := 1 ≤ i ≤ N arg max U i ,
and the exact loss reduction already proved:
L ( α ( t ) , β ( t ) ) = 3 2 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) . (46) \mathcal{L}(\alpha^{(t)},\beta^{(t)})=\frac{3}{2}\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right]+o(1). \tag*{(46)} L ( α ( t ) , β ( t ) ) = 2 3 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) . (46)
We also retain the already established divergence
α ( t ) → + ∞ , β ( t ) → − ∞ , λ t : = − β ( t ) α ( t ) ( t ≥ 1 ) . \alpha^{(t)}\to+\infty,\qquad\beta^{(t)}\to-\infty,\qquad\lambda_t:=-\frac{\beta^{(t)}}{\alpha^{(t)}}\quad(t\ge1). α ( t ) → + ∞ , β ( t ) → − ∞ , λ t := − α ( t ) β ( t ) ( t ≥ 1 ) .
To analyze the interior regime λ t ∈ ( 0 , 2 ) \lambda_t\in(0,2) λ t ∈ ( 0 , 2 ) , fix throughout this subsection an arbitrary subsequence ( t k ) k ≥ 1 (t_k)_{k\ge1} ( t k ) k ≥ 1 such that
α k : = α ( t k ) → + ∞ , β k : = β ( t k ) → − ∞ , λ k : = λ t k → λ ∈ ( 0 , 2 ) . \alpha_k:=\alpha^{(t_k)}\to+\infty,\qquad\beta_k:=\beta^{(t_k)}\to-\infty,\qquad\lambda_k:=\lambda_{t_k}\to\lambda\in(0,2). α k := α ( t k ) → + ∞ , β k := β ( t k ) → − ∞ , λ k := λ t k → λ ∈ ( 0 , 2 ) .
Let
f d ( u ) = κ d ( 1 − u 2 ) ( d − 3 ) / 2 1 ( − 1 , 1 ) ( u ) , F d ( u ) = ∫ − 1 u f d ( v ) d v , f_d(u)=\kappa_d(1-u^2)^{(d-3)/2}\mathbf{1}_{(-1,1)}(u),\qquad F_d(u)=\int_{-1}^{u}f_d(v)\,\mathrm{d}v, f d ( u ) = κ d ( 1 − u 2 ) ( d − 3 ) /2 1 ( − 1 , 1 ) ( u ) , F d ( u ) = ∫ − 1 u f d ( v ) d v ,
so that the density of 1 − U π 1-U_\pi 1 − U π is
h ( t ) = N F d ( 1 − t ) N − 1 f d ( 1 − t ) , t ∈ ( 0 , 2 ) . h(t)=N F_d(1-t)^{N-1}f_d(1-t),\qquad t\in(0,2). h ( t ) = N F d ( 1 − t ) N − 1 f d ( 1 − t ) , t ∈ ( 0 , 2 ) .
Lemma D.25. Let ψ : [ 0 , 2 ] → R \psi:[0,2]\to\mathbb{R} ψ : [ 0 , 2 ] → R be bounded and continuous. Then
α k E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ψ ( 1 − U π ) ] ⟶ h ( λ ) ψ ( λ ) , \alpha_k\mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\psi(1-U_\pi)\right]\longrightarrow h(\lambda)\psi(\lambda), α k E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ψ ( 1 − U π ) ] ⟶ h ( λ ) ψ ( λ ) , and
α k E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ψ ( 1 − U π ) ] ⟶ 1 2 h ( λ ) ψ ( λ ) . \alpha_k\mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\psi(1-U_\pi)\right]\longrightarrow\frac{1}{2}h(\lambda)\psi(\lambda). α k E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ψ ( 1 − U π ) ] ⟶ 2 1 h ( λ ) ψ ( λ ) .
Proof. We prove the first limit; the second is identical, with the denominator power 2 replaced by 3.
Choose δ > 0 \delta>0 δ > 0 such that
[ λ − 2 δ , λ + 2 δ ] ⊂ ( 0 , 2 ) . [\lambda-2\delta,\lambda+2\delta]\subset(0,2). [ λ − 2 δ , λ + 2 δ ] ⊂ ( 0 , 2 ) .
Since λ k → λ \lambda_k \to\lambda λ k → λ , after discarding finitely many terms we may assume
∣ λ k − λ ∣ ≤ δ for every k . (47) |\lambda_k-\lambda| \le\delta\qquad\text{for every } k. \tag*{(47)} ∣ λ k − λ ∣ ≤ δ for every k . (47)
Set
J : = [ λ − 2 δ , λ + 2 δ ] ⊂ ( 0 , 2 ) . J := [\lambda- 2\delta,\lambda+ 2\delta] \subset(0,2). J := [ λ − 2 δ , λ + 2 δ ] ⊂ ( 0 , 2 ) .
Decompose
α k E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ψ ( 1 − U π ) ] = A k + B k , \alpha_k \mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}\psi(1-U_\pi)\right] = A_k+B_k, α k E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ψ ( 1 − U π ) ] = A k + B k ,
where
A k : = α k ∫ J e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 2 ψ ( t ) h ( t ) d t , A_k := \alpha_k\int_J \frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^2}\psi(t)h(t)\,dt, A k := α k ∫ J ( 1 + e α k ( λ k − t ) ) 2 e α k ( λ k − t ) ψ ( t ) h ( t ) d t ,
and
B k : = α k ∫ [ 0 , 2 ] ∖ J e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 2 ψ ( t ) h ( t ) d t . B_k := \alpha_k\int_{[0,2]\setminus J}\frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^2}\psi(t)h(t)\,dt. B k := α k ∫ [ 0 , 2 ] ∖ J ( 1 + e α k ( λ k − t ) ) 2 e α k ( λ k − t ) ψ ( t ) h ( t ) d t .
If t ∈ [ 0 , 2 ] ∖ J t \in[0,2]\setminus J t ∈ [ 0 , 2 ] ∖ J , then by (D.23),
∣ t − λ k ∣ ≥ ∣ t − λ ∣ − ∣ λ k − λ ∣ ≥ 2 δ − δ = δ . |t-\lambda_k| \ge|t-\lambda|-|\lambda_k-\lambda| \ge2\delta-\delta=\delta. ∣ t − λ k ∣ ≥ ∣ t − λ ∣ − ∣ λ k − λ ∣ ≥ 2 δ − δ = δ .
For every x ∈ R x \in\mathbb{R} x ∈ R ,
0 ≤ e x ( 1 + e x ) 2 ≤ e − ∣ x ∣ . 0 \le\frac{e^x}{(1+e^x)^2} \le e^{-|x|}. 0 ≤ ( 1 + e x ) 2 e x ≤ e − ∣ x ∣ .
Therefore
e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 2 ≤ e − α k ∣ t − λ k ∣ ≤ e − α k δ , \frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^2}
\le e^{-\alpha_k|t-\lambda_k|}
\le e^{-\alpha_k\delta}, ( 1 + e α k ( λ k − t ) ) 2 e α k ( λ k − t ) ≤ e − α k ∣ t − λ k ∣ ≤ e − α k δ ,
and hence
∣ B k ∣ ≤ α k e − α k δ ∥ ψ ∥ ∞ ∫ [ 0 , 2 ] ∖ J h ( t ) d t ≤ α k e − α k δ ∥ ψ ∥ ∞ ⟶ 0. (48) |B_k| \le\alpha_k e^{-\alpha_k\delta}\|\psi\|_\infty\int_{[0,2]\setminus J}h(t)\,dt
\le\alpha_k e^{-\alpha_k\delta}\|\psi\|_\infty\longrightarrow0. \tag*{(48)} ∣ B k ∣ ≤ α k e − α k δ ∥ ψ ∥ ∞ ∫ [ 0 , 2 ] ∖ J h ( t ) d t ≤ α k e − α k δ ∥ ψ ∥ ∞ ⟶ 0. (48)
On J J J , the function h ψ h\psi h ψ is bounded and continuous. Using the change of variables
z = α k ( t − λ k ) , t = λ k + z α k , d t = d z α k , z=\alpha_k(t-\lambda_k),\qquad t=\lambda_k+\frac{z}{\alpha_k},\qquad dt=\frac{dz}{\alpha_k}, z = α k ( t − λ k ) , t = λ k + α k z , d t = α k d z ,
we obtain
A k = ∫ α k ( λ − 2 δ − λ k ) α k ( λ + 2 δ − λ k ) e − z ( 1 + e − z ) 2 ψ ( λ k + z α k ) h ( λ k + z α k ) d z . A_k=\int_{\alpha_k(\lambda-2\delta-\lambda_k)}^{\alpha_k(\lambda+2\delta-\lambda_k)}
\frac{e^{-z}}{(1+e^{-z})^2}\psi\left(\lambda_k+\frac{z}{\alpha_k}\right)
h\left(\lambda_k+\frac{z}{\alpha_k}\right)\,dz. A k = ∫ α k ( λ − 2 δ − λ k ) α k ( λ + 2 δ − λ k ) ( 1 + e − z ) 2 e − z ψ ( λ k + α k z ) h ( λ k + α k z ) d z .
By (D.23),
α k ( λ − 2 δ − λ k ) ≤ − α k δ ⟶ − ∞ , α k ( λ + 2 δ − λ k ) ≥ α k δ ⟶ + ∞ . \alpha_k(\lambda-2\delta-\lambda_k)\le-\alpha_k\delta\longrightarrow-\infty,\qquad
\alpha_k(\lambda+2\delta-\lambda_k)\ge\alpha_k\delta\longrightarrow+\infty. α k ( λ − 2 δ − λ k ) ≤ − α k δ ⟶ − ∞ , α k ( λ + 2 δ − λ k ) ≥ α k δ ⟶ + ∞.
Extend the integrand by zero outside the interval of integration. Since
0 ≤ e − z ( 1 + e − z ) 2 ≤ e − ∣ z ∣ for all z ∈ R , 0 \le\frac{e^{-z}}{(1+e^{-z})^2}\le e^{-|z|}\qquad\text{for all }z\in\mathbb{R}, 0 ≤ ( 1 + e − z ) 2 e − z ≤ e − ∣ z ∣ for all z ∈ R ,
and h ψ h\psi h ψ is bounded on J J J , the extended integrand is dominated by
C J e − ∣ z ∣ C_J e^{-|z|} C J e − ∣ z ∣
for some constant C J < ∞ C_J < \infty C J < ∞ , and e − ∣ z ∣ e^{-|z|} e − ∣ z ∣ is integrable on R \mathbb{R} R .
For every fixed z ∈ R z \in\mathbb{R} z ∈ R , we have
λ k + z ~ α k ⟶ λ , \lambda_k+\frac{\widetilde{z}}{\alpha_k}\longrightarrow\lambda, λ k + α k z ⟶ λ ,
and for all sufficiently large k k k this point lies in J J J . Hence the extended integrand converges pointwise to
e − z ( 1 + e − z ) 2 ψ ( λ ) h ( λ ) . \frac{e^{-z}}{(1+e^{-z})^2}\psi(\lambda)h(\lambda). ( 1 + e − z ) 2 e − z ψ ( λ ) h ( λ ) .
Dominated convergence yields
A k ⟶ ψ ( λ ) h ( λ ) ∫ R e − z ( 1 + e − z ) 2 d z . A_k\longrightarrow\psi(\lambda)h(\lambda)\int_{\mathbb{R}}\frac{e^{-z}}{(1+e^{-z})^2}\,dz. A k ⟶ ψ ( λ ) h ( λ ) ∫ R ( 1 + e − z ) 2 e − z d z .
With the substitution u = ( 1 + e − z ) − 1 u=(1+e^{-z})^{-1} u = ( 1 + e − z ) − 1 , we have
d u = e − z ( 1 + e − z ) 2 d z , du=\frac{e^{-z}}{(1+e^{-z})^2}\,dz, d u = ( 1 + e − z ) 2 e − z d z ,
so
∫ R e − z ( 1 + e − z ) 2 d z = ∫ 0 1 d u = 1. \int_{\mathbb{R}}\frac{e^{-z}}{(1+e^{-z})^2}\,dz=\int_0^1du=1. ∫ R ( 1 + e − z ) 2 e − z d z = ∫ 0 1 d u = 1.
Thus
A k → h ( λ ) ψ ( λ ) . (49) A_k\to h(\lambda)\psi(\lambda). \tag*{(49)} A k → h ( λ ) ψ ( λ ) . (49)
Combining (D.24) and (D.25) proves the first limit.
For the second limit, write
α k E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ψ ( 1 − U π ) ] = A k ′ + B k ′ , \alpha_k\mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\psi(1-U_\pi)\right]=A'_k+B'_k, α k E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ψ ( 1 − U π ) ] = A k ′ + B k ′ ,
where
A k ′ : = α k ∫ J e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 3 ψ ( t ) h ( t ) d t , A'_k:=\alpha_k\int_J\frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^3}\psi(t)h(t)\,dt, A k ′ := α k ∫ J ( 1 + e α k ( λ k − t ) ) 3 e α k ( λ k − t ) ψ ( t ) h ( t ) d t ,
and
B k ′ : = α k ∫ [ 0 , 2 ] ∖ J e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 3 ψ ( t ) h ( t ) d t . B'_k:=\alpha_k\int_{[0,2]\setminus J}\frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^3}\psi(t)h(t)\,dt. B k ′ := α k ∫ [ 0 , 2 ] ∖ J ( 1 + e α k ( λ k − t ) ) 3 e α k ( λ k − t ) ψ ( t ) h ( t ) d t .
Since
0 ≤ e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 3 ≤ e α k ( λ k − t ) ( 1 + e α k ( λ k − t ) ) 2 , 0\leq\frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^3}\leq\frac{e^{\alpha_k(\lambda_k-t)}}{(1+e^{\alpha_k(\lambda_k-t)})^2}, 0 ≤ ( 1 + e α k ( λ k − t ) ) 3 e α k ( λ k − t ) ≤ ( 1 + e α k ( λ k − t ) ) 2 e α k ( λ k − t ) ,
the estimate for B k B_k B k gives B k ′ → 0 B'_k\to0 B k ′ → 0 . On J J J , the same change of variables yields
A k ′ = ∫ α k ( λ − 2 δ − λ k ) α k ( λ + 2 δ − λ k ) e − z ( 1 + e − z ) 3 ψ ( λ k + z α k ) h ( λ k + z α k ) d z . A'_k=\int_{\alpha_k(\lambda-2\delta-\lambda_k)}^{\alpha_k(\lambda+2\delta-\lambda_k)}
\frac{e^{-z}}{(1+e^{-z})^3}
\psi\left(\lambda_k+\frac{z}{\alpha_k}\right)
h\left(\lambda_k+\frac{z}{\alpha_k}\right)\,dz. A k ′ = ∫ α k ( λ − 2 δ − λ k ) α k ( λ + 2 δ − λ k ) ( 1 + e − z ) 3 e − z ψ ( λ k + α k z ) h ( λ k + α k z ) d z .
The same dominated convergence argument gives
A k ′ ⟶ ψ ( λ ) h ( λ ) ∫ R e − z ( 1 + e − z ) 3 d z . A'_k \longrightarrow\psi(\lambda)h(\lambda)\int_{\mathbb{R}} \frac{e^{-z}}{(1+e^{-z})^3}\,dz. A k ′ ⟶ ψ ( λ ) h ( λ ) ∫ R ( 1 + e − z ) 3 e − z d z .
Again with u = ( 1 + e − z ) − 1 u=(1+e^{-z})^{-1} u = ( 1 + e − z ) − 1 ,
e − z ( 1 + e − z ) 3 d z = u d u , \frac{e^{-z}}{(1+e^{-z})^3}\,dz=u\,du, ( 1 + e − z ) 3 e − z d z = u d u ,
so
∫ R e − z ( 1 + e − z ) 3 d z = ∫ 0 1 u d u = 1 2 . \int_{\mathbb{R}} \frac{e^{-z}}{(1+e^{-z})^3}\,dz=\int_0^1 u\,du=\frac{1}{2}. ∫ R ( 1 + e − z ) 3 e − z d z = ∫ 0 1 u d u = 2 1 .
Hence
α k E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ψ ( 1 − U π ) ] ⟶ 1 2 h ( λ ) ψ ( λ ) . \alpha_k\mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\psi(1-U_\pi)\right]\longrightarrow\frac{1}{2}h(\lambda)\psi(\lambda). α k E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ψ ( 1 − U π ) ] ⟶ 2 1 h ( λ ) ψ ( λ ) .
Lemma D.26. Let g : [ 0 , 2 ] → [ 0 , ∞ ) g:[0,2]\to[0,\infty) g : [ 0 , 2 ] → [ 0 , ∞ ) be Borel measurable. Then, for almost every u ∈ ( − 1 , 1 ) u\in(-1,1) u ∈ ( − 1 , 1 ) ,
E [ ∑ j ≠ π g ( U π − U j ) ∣ U π = u ] = N − 1 F d ( u ) ∫ − 1 u g ( u − v ) f d ( v ) d v . \mathbb{E}\left[\left.\sum_{j\ne\pi}g(U_\pi-U_j)\,\right|\,U_\pi=u\right]=\frac{N-1}{F_d(u)}\int_{-1}^{u}g(u-v)f_d(v)\,dv. E j = π ∑ g ( U π − U j ) U π = u = F d ( u ) N − 1 ∫ − 1 u g ( u − v ) f d ( v ) d v . In particular, for almost every u ∈ ( − 1 , 1 ) u\in(-1,1) u ∈ ( − 1 , 1 ) ,
E [ ∑ j ≠ π e − α k ( U π − U j ) ∣ U π = u ] = N − 1 F d ( u ) ∫ − 1 u e − α k ( u − v ) f d ( v ) d v . \mathbb{E}\left[\left.\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\,\right|\,U_\pi=u\right]=\frac{N-1}{F_d(u)}\int_{-1}^{u}e^{-\alpha_k(u-v)}f_d(v)\,dv. E j = π ∑ e − α k ( U π − U j ) U π = u = F d ( u ) N − 1 ∫ − 1 u e − α k ( u − v ) f d ( v ) d v . Proof. Fix a Borel set B ⊂ ( − 1 , 1 ) B\subset(-1,1) B ⊂ ( − 1 , 1 ) . Since ties occur with probability zero, on the event { π = i } \{\pi=i\} { π = i } we have U π = U i U_\pi=U_i U π = U i and U j < U i U_j<U_i U j < U i for every j ≠ i j\ne i j = i . By symmetry of the i.i.d. variables U 1 , … , U N U_1,\ldots,U_N U 1 , … , U N ,
E [ ∑ j ≠ π g ( U π − U j ) 1 { U π ∈ B } ] = ∑ i = 1 N ∑ j ≠ i E [ g ( U i − U j ) 1 { U i ∈ B , U j < U i , U ℓ < U i ∀ ℓ ≠ i } ] \mathbb{E}\left[\sum_{j\ne\pi}g(U_\pi-U_j)1_{\{U_\pi\in B\}}\right]
=\sum_{i=1}^{N}\sum_{j\ne i}\mathbb{E}\left[g(U_i-U_j)1_{\{U_i\in B,\ U_j<U_i,\ U_\ell<U_i\ \forall\ell\ne i\}}\right] E j = π ∑ g ( U π − U j ) 1 { U π ∈ B } = i = 1 ∑ N j = i ∑ E [ g ( U i − U j ) 1 { U i ∈ B , U j < U i , U ℓ < U i ∀ ℓ = i } ] = N ( N − 1 ) ∫ B ∫ − 1 u g ( u − v ) f d ( v ) F d ( u ) N − 2 f d ( u ) d v d u . =N(N-1)\int_B\int_{-1}^{u}g(u-v)f_d(v)F_d(u)^{N-2}f_d(u)\,dv\,du. = N ( N − 1 ) ∫ B ∫ − 1 u g ( u − v ) f d ( v ) F d ( u ) N − 2 f d ( u ) d v d u . The density of U π U_\pi U π is
u ↦ N F d ( u ) N − 1 f d ( u ) , u ∈ ( − 1 , 1 ) . u\mapsto N F_d(u)^{N-1}f_d(u),\qquad u\in(-1,1). u ↦ N F d ( u ) N − 1 f d ( u ) , u ∈ ( − 1 , 1 ) . Hence
E [ ∑ j ≠ π g ( U π − U j ) 1 { U π ∈ B } ] = ∫ B [ N − 1 F d ( u ) ∫ − 1 u g ( u − v ) f d ( v ) d v ] N F d ( u ) N − 1 f d ( u ) d u . \mathbb{E}\left[\sum_{j\ne\pi}g(U_\pi-U_j)1_{\{U_\pi\in B\}}\right]=\int_B\left[\frac{N-1}{F_d(u)}\int_{-1}^{u}g(u-v)f_d(v)\,dv\right]NF_d(u)^{N-1}f_d(u)\,du. E j = π ∑ g ( U π − U j ) 1 { U π ∈ B } = ∫ B [ F d ( u ) N − 1 ∫ − 1 u g ( u − v ) f d ( v ) d v ] N F d ( u ) N − 1 f d ( u ) d u . By the uniqueness of conditional expectation with respect to the distribution of U π U_\pi U π , this proves the
claim.
Lemma D.27. Choose δ > 0 \delta> 0 δ > 0 so that
[ λ − 2 δ , λ + 2 δ ] ⊂ ( 0 , 2 ) . [\lambda- 2\delta, \lambda+ 2\delta] \subset(0,2). [ λ − 2 δ , λ + 2 δ ] ⊂ ( 0 , 2 ) . Then there exists a constant C δ < ∞ C_{\delta} < \infty C δ < ∞ such that, for all sufficiently large k k k ,
E [ ∑ j ≠ π e − α k ( U π − U j ) | 1 − U π ] ≤ C δ α k on the event { ∣ 1 − U π − λ ∣ ≤ δ } . \mathbb{E}\left[\sum_{j \ne\pi} e^{-\alpha_k(U_{\pi}-U_j)} \,\middle|\, 1-U_{\pi}\right] \le\frac{C_{\delta}}{\alpha_k}\quad\text{on the event }\{|1-U_{\pi}-\lambda| \le\delta\}. E j = π ∑ e − α k ( U π − U j ) 1 − U π ≤ α k C δ on the event { ∣1 − U π − λ ∣ ≤ δ } . Moreover,
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] → 0 , \alpha_k\mathbb{E}\left[\left(\sum_{j \ne\pi}e^{-\alpha_k(U_{\pi}-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_{\pi}))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_{\pi}))}\right)^2}\right]\to0, α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) → 0 , and
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ] → 0. \alpha_k\mathbb{E}\left[\left(\sum_{j \ne\pi}e^{-\alpha_k(U_{\pi}-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_{\pi}))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_{\pi}))}\right)^3}\right]\to0. α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) → 0.
Proof. Set
J δ : = [ 1 − λ − δ , 1 − λ + δ ] ⊂ ( − 1 , 1 ) . J_{\delta}:=[1-\lambda-\delta,1-\lambda+\delta]\subset(-1,1). J δ := [ 1 − λ − δ , 1 − λ + δ ] ⊂ ( − 1 , 1 ) .
On the event { ∣ 1 − U π − λ ∣ ≤ δ } \{|1-U_{\pi}-\lambda|\le\delta\} { ∣1 − U π − λ ∣ ≤ δ } , we have
U π ∈ J δ . U_{\pi}\in J_{\delta}. U π ∈ J δ .
Because J δ ⊂ ( − 1 , 1 ) J_{\delta}\subset(-1,1) J δ ⊂ ( − 1 , 1 ) , the continuous function F d F_d F d satisfies
inf u ∈ J δ F d ( u ) ≥ c δ > 0. (50) \inf_{u\in J_{\delta}}F_d(u)\ge c_{\delta}>0. \tag*{(50)} u ∈ J δ inf F d ( u ) ≥ c δ > 0. (50)
Also, since J δ J_{\delta} J δ is compact and contained in ( − 1 , 1 ) (-1,1) ( − 1 , 1 ) , there exists η δ > 0 \eta_{\delta}>0 η δ > 0 such that
[ u − η δ , u ] ⊂ K δ for every u ∈ J δ , [u-\eta_{\delta},u]\subset K_{\delta}\quad\text{for every }u\in J_{\delta}, [ u − η δ , u ] ⊂ K δ for every u ∈ J δ ,
where
K δ : = [ 1 − λ − δ − η δ , 1 − λ + δ ] ⊂ ( − 1 , 1 ) . K_{\delta}:=[1-\lambda-\delta-\eta_{\delta},1-\lambda+\delta]\subset(-1,1). K δ := [ 1 − λ − δ − η δ , 1 − λ + δ ] ⊂ ( − 1 , 1 ) .
Hence
sup v ∈ K δ f d ( v ) ≤ C δ ′ < ∞ . (51) \sup_{v\in K_{\delta}}f_d(v)\le C'_{\delta}<\infty. \tag*{(51)} v ∈ K δ sup f d ( v ) ≤ C δ ′ < ∞. (51)
By Lemma D.26 , for almost every u ∈ J δ u\in J_{\delta} u ∈ J δ ,
E [ ∑ j ≠ π e − α k ( U π − U j ) | U π = u ] = N − 1 F d ( u ) ∫ − 1 u e − α k ( u − v ) f d ( v ) d v . \mathbb{E}\left[\sum_{j\ne\pi}e^{-\alpha_k(U_{\pi}-U_j)}\,\middle|\,U_{\pi}=u\right]
=\frac{N-1}{F_d(u)}\int_{-1}^{u}e^{-\alpha_k(u-v)}f_d(v)\,dv. E j = π ∑ e − α k ( U π − U j ) U π = u = F d ( u ) N − 1 ∫ − 1 u e − α k ( u − v ) f d ( v ) d v .
Split the integral at u − η δ u-\eta\delta u − η δ :
∫ − 1 u e − α k ( u − v ) f d ( v ) d v = ∫ − 1 u − η δ e − α k ( u − v ) f d ( v ) d v + ∫ u − η δ u e − α k ( u − v ) f d ( v ) d v . \int_{-1}^{u} e^{-\alpha_k(u-v)}f_d(v)\,\mathrm{d}v = \int_{-1}^{u-\eta\delta} e^{-\alpha_k(u-v)}f_d(v)\,\mathrm{d}v + \int_{u-\eta\delta}^{u} e^{-\alpha_k(u-v)}f_d(v)\,\mathrm{d}v. ∫ − 1 u e − α k ( u − v ) f d ( v ) d v = ∫ − 1 u − η δ e − α k ( u − v ) f d ( v ) d v + ∫ u − η δ u e − α k ( u − v ) f d ( v ) d v .
For the first term, u − v ≥ η δ u-v \ge\eta\delta u − v ≥ η δ , so
∫ − 1 u − η δ e − α k ( u − v ) f d ( v ) d v ≤ e − α k η δ ∫ − 1 u − η δ f d ( v ) d v ≤ e − α k η δ . (52) \int_{-1}^{u-\eta\delta} e^{-\alpha_k(u-v)}f_d(v)\,\mathrm{d}v \le e^{-\alpha_k\eta\delta}\int_{-1}^{u-\eta\delta} f_d(v)\,\mathrm{d}v \le e^{-\alpha_k\eta\delta}. \tag*{(52)} ∫ − 1 u − η δ e − α k ( u − v ) f d ( v ) d v ≤ e − α k η δ ∫ − 1 u − η δ f d ( v ) d v ≤ e − α k η δ . (52)
For the second term, [ u − η δ , u ] ⊂ K δ [u-\eta\delta,u]\subset K_\delta [ u − η δ , u ] ⊂ K δ , so by (D.27),
∫ u − η δ u e − α k ( u − v ) f d ( v ) d v ≤ C δ ′ ∫ 0 η δ e − α k s d s ≤ C δ ′ α k . (53) \int_{u-\eta\delta}^{u} e^{-\alpha_k(u-v)}f_d(v)\,\mathrm{d}v \le C'_\delta\int_{0}^{\eta\delta}e^{-\alpha_k s}\,\mathrm{d}s \le\frac{C'_\delta}{\alpha_k}. \tag*{(53)} ∫ u − η δ u e − α k ( u − v ) f d ( v ) d v ≤ C δ ′ ∫ 0 η δ e − α k s d s ≤ α k C δ ′ . (53)
Combining (D.26), (D.28), and (D.29), for almost every u ∈ J δ u\in J_\delta u ∈ J δ ,
E [ ∑ j ≠ π e − α k ( U π − U j ) ∣ U π = u ] ≤ N − 1 c δ ( e − α k η δ + C δ ′ α k ) . \mathbb{E}\left[\left.\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right|U_\pi=u\right]\le\frac{N-1}{c_\delta}\left(e^{-\alpha_k\eta\delta}+\frac{C'_\delta}{\alpha_k}\right). E j = π ∑ e − α k ( U π − U j ) U π = u ≤ c δ N − 1 ( e − α k η δ + α k C δ ′ ) .
Since α k → ∞ \alpha_k\to\infty α k → ∞ , the exponential term is eventually bounded by 1 / α k 1/\alpha_k 1/ α k . Hence there exists C δ < ∞ C_\delta<\infty C δ < ∞ such that, for all sufficiently large k k k ,
E [ ∑ j ≠ π e − α k ( U π − U j ) ∣ U π = u ] ≤ C δ α k for almost every u ∈ J δ . \mathbb{E}\left[\left.\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right|U_\pi=u\right]\le\frac{C_\delta}{\alpha_k}\qquad\text{for almost every }u\in J_\delta. E j = π ∑ e − α k ( U π − U j ) U π = u ≤ α k C δ for almost every u ∈ J δ .
Because 1 − U π 1-U_\pi 1 − U π is a measurable function of U π U_\pi U π , this proves
E [ ∑ j ≠ π e − α k ( U π − U j ) ∣ 1 − U π ] ≤ C δ α k on { ∣ 1 − U π − λ ∣ ≤ δ } . (54) \mathbb{E}\left[\left.\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right|1-U_\pi\right]\le\frac{C_\delta}{\alpha_k}\quad\text{on }\{|1-U_\pi-\lambda|\le\delta\}. \tag*{(54)} E j = π ∑ e − α k ( U π − U j ) 1 − U π ≤ α k C δ on { ∣1 − U π − λ ∣ ≤ δ } . (54)
Let
A δ : = { ∣ 1 − U π − λ ∣ ≤ δ } , A δ c : = { ∣ 1 − U π − λ ∣ > δ } . A_\delta:=\{|1-U_\pi-\lambda|\le\delta\},\qquad A_\delta^c:=\{|1-U_\pi-\lambda|>\delta\}. A δ := { ∣1 − U π − λ ∣ ≤ δ } , A δ c := { ∣1 − U π − λ ∣ > δ } .
On A δ A_\delta A δ , using (D.30),
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 1 A δ ] = α k E [ E [ ∑ j ≠ π e − α k ( U π − U j ) ∣ 1 − U π ] e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 1 A δ ] ≤ C δ E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] . \begin{aligned}
\alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\mathbf{1}_{A_\delta}\right] \\
&=\alpha_k\mathbb{E}\left[\mathbb{E}\left[\left.\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right|1-U_\pi\right]\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\mathbf{1}_{A_\delta}\right] \\
&\le C_\delta\mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\right].
\end{aligned} α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) 1 A δ = α k E E j = π ∑ e − α k ( U π − U j ) 1 − U π ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) 1 A δ ≤ C δ E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ] .
By Lemma D.25 with ψ = 1 \psi= 1 ψ = 1 ,
α k E [ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] → h ( λ ) , \alpha_k \mathbb{E}\left[\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\right]\to h(\lambda), α k E [ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ] → h ( λ ) ,
so the expectation is O ( α k − 1 ) O(\alpha_k^{-1}) O ( α k − 1 ) . Therefore
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 1 A δ ] → 0. (55) \alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\mathbf{1}_{A_\delta}\right]\to0. \tag*{(55)} α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) 1 A δ → 0. (55)
Similarly, since
0 ≤ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ≤ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 , 0\le\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\le\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}, 0 ≤ ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ≤ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ,
we obtain
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 1 A δ ] → 0. (56) \alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\mathbf{1}_{A_\delta}\right]\to0. \tag*{(56)} α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) 1 A δ → 0. (56)
Since λ k → λ \lambda_k\to\lambda λ k → λ , for all sufficiently large k k k ,
∣ λ k − λ ∣ ≤ δ 2 . (57) |\lambda_k-\lambda|\le\frac{\delta}{2}. \tag*{(57)} ∣ λ k − λ ∣ ≤ 2 δ . (57)
If ∣ 1 − U π − λ ∣ > δ |1-U_\pi-\lambda|>\delta ∣1 − U π − λ ∣ > δ , then by (D.33),
∣ 1 − U π − λ k ∣ ≥ ∣ 1 − U π − λ ∣ − ∣ λ k − λ ∣ > δ 2 . |1-U_\pi-\lambda_k|\ge|1-U_\pi-\lambda|-|\lambda_k-\lambda|>\frac{\delta}{2}. ∣1 − U π − λ k ∣ ≥ ∣1 − U π − λ ∣ − ∣ λ k − λ ∣ > 2 δ .
For every x ∈ R x\in\mathbb{R} x ∈ R ,
0 ≤ e x ( 1 + e x ) 2 ≤ e − ∣ x ∣ , 0 ≤ e x ( 1 + e x ) 3 ≤ e − ∣ x ∣ . 0\le\frac{e^x}{(1+e^x)^2}\le e^{-|x|},\qquad0\le\frac{e^x}{(1+e^x)^3}\le e^{-|x|}. 0 ≤ ( 1 + e x ) 2 e x ≤ e − ∣ x ∣ , 0 ≤ ( 1 + e x ) 3 e x ≤ e − ∣ x ∣ .
Thus, on A δ A_\delta A δ ,
e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ≤ e − α k δ / 2 , e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ≤ e − α k δ / 2 \frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\le e^{-\alpha_k\delta/2},\qquad\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\le e^{-\alpha_k\delta/2} ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ≤ e − α k δ /2 , ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ≤ e − α k δ /2
for all large k k k . Since
0 ≤ ∑ j ≠ π e − α k ( U π − U j ) ≤ N − 1 , 0\le\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\le N-1, 0 ≤ j = π ∑ e − α k ( U π − U j ) ≤ N − 1 ,
we have
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 1 A δ c ] ≤ α k ( N − 1 ) e − α k δ / 2 → 0 , (58) \alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\mathbf{1}_{A_\delta^c}\right]\le\alpha_k(N-1)e^{-\alpha_k\delta/2}\to0, \tag*{(58)} α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) 1 A δ c ≤ α k ( N − 1 ) e − α k δ /2 → 0 , (58)
and likewise
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 1 A d c ] ≤ α k ( N − 1 ) e − α k δ / 2 → 0. (59) \alpha_k \mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\mathbf{1}_{A^c_d}\right]\le\alpha_k(N-1)e^{-\alpha_k\delta/2}\to0. \tag*{(59)} α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) 1 A d c ≤ α k ( N − 1 ) e − α k δ /2 → 0. (59)
Combining (D.31) with (D.34), and (D.32) with (D.35), proves the claim.
Lemma D.28. Then
α k E [ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) ] ⟶ 0. \alpha_k\mathbb{E}\left[\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}\right]\longrightarrow0. α k E j = π ∑ ( U π − U j ) e − α k ( U π − U j ) ⟶ 0.
Proof. For j ≠ π j\ne\pi j = π ,
( U π − U j ) e − α k ( U π − U j ) = ( U π − U j ) + e − α k ( U π − U j ) + . (U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}=(U_\pi-U_j)_+e^{-\alpha_k(U_\pi-U_j)_+}. ( U π − U j ) e − α k ( U π − U j ) = ( U π − U j ) + e − α k ( U π − U j ) + .
Since π ∈ [ N ] \pi\in[N] π ∈ [ N ] ,
( U π − U j ) + e − α k ( U π − U j ) + ≤ ∑ i ≠ j ( U i − U j ) + e − α k ( U i − U j ) + . (U_\pi-U_j)_+e^{-\alpha_k(U_\pi-U_j)_+}\le\sum_{i\ne j}(U_i-U_j)_+e^{-\alpha_k(U_i-U_j)_+}. ( U π − U j ) + e − α k ( U π − U j ) + ≤ i = j ∑ ( U i − U j ) + e − α k ( U i − U j ) + .
Summing over j ≠ π j\ne\pi j = π ,
∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) ≤ ∑ j = 1 N ∑ i ≠ j ( U i − U j ) + e − α k ( U i − U j ) + . \sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}
\le\sum_{j=1}^{N}\sum_{i\ne j}(U_i-U_j)_+e^{-\alpha_k(U_i-U_j)_+}. j = π ∑ ( U π − U j ) e − α k ( U π − U j ) ≤ j = 1 ∑ N i = j ∑ ( U i − U j ) + e − α k ( U i − U j ) + .
Taking expectation and using exchangeability,
E [ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) ] ≤ N ( N − 1 ) I d ( α k ) , (60) \mathbb{E}\left[\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}\right]\le N(N-1)I_d(\alpha_k), \tag*{(60)} E j = π ∑ ( U π − U j ) e − α k ( U π − U j ) ≤ N ( N − 1 ) I d ( α k ) , (60)
where
I d ( α ) : = E [ ( U 1 − U 2 ) + e − α ( U 1 − U 2 ) + ] . I_d(\alpha):=\mathbb{E}\left[(U_1-U_2)_+e^{-\alpha(U_1-U_2)_+}\right]. I d ( α ) := E [ ( U 1 − U 2 ) + e − α ( U 1 − U 2 ) + ] .
Since U 1 , U 2 U_1,U_2 U 1 , U 2 are i.i.d. with density f d f_d f d ,
I d ( α ) = ∫ − 1 1 ∫ − 1 1 ( u − v ) + e − α ( u − v ) + f d ( u ) f d ( v ) d u d v = ∫ 0 2 s e − α s ( ∫ − 1 1 − s f d ( u + s ) f d ( u ) d u ) d s . \begin{aligned}
I_d(\alpha)&=\int_{-1}^{1}\int_{-1}^{1}(u-v)_+e^{-\alpha(u-v)_+}f_d(u)f_d(v)\,du\,dv\\
&=\int_{0}^{2}se^{-\alpha s}\left(\int_{-1}^{1-s}f_d(u+s)f_d(u)\,du\right)\,ds.
\end{aligned} I d ( α ) = ∫ − 1 1 ∫ − 1 1 ( u − v ) + e − α ( u − v ) + f d ( u ) f d ( v ) d u d v = ∫ 0 2 s e − α s ( ∫ − 1 1 − s f d ( u + s ) f d ( u ) d u ) d s .
Define
J d ( s ) : = ∫ − 1 1 − s f d ( u + s ) f d ( u ) d u , 0 < s < 2. J_d(s):=\int_{-1}^{1-s}f_d(u+s)f_d(u)\,du,\qquad0<s<2. J d ( s ) := ∫ − 1 1 − s f d ( u + s ) f d ( u ) d u , 0 < s < 2.
Then
I d ( α ) = ∫ 0 2 s e − α s J d ( s ) d s . (61) I_d(\alpha)=\int_{0}^{2}se^{-\alpha s}J_d(s)\,ds. \tag*{(61)} I d ( α ) = ∫ 0 2 s e − α s J d ( s ) d s . (61)
If d ≥ 3 d\ge3 d ≥ 3 , then f d f_d f d is bounded on ( − 1 , 1 ) (-1,1) ( − 1 , 1 ) , hence
J d ( s ) ≤ 2 ∥ f d ∥ ∞ 2 ( 0 < s < 2 ) , J_d(s)\le2\|f_d\|_\infty^2\qquad(0<s<2), J d ( s ) ≤ 2∥ f d ∥ ∞ 2 ( 0 < s < 2 ) ,
and therefore
I d ( α ) ≤ C ∫ 0 2 s e − α s d s ≤ C α 2 . I_d(\alpha) \le C \int_0^2 s e^{-\alpha s}\,ds \le\frac{C}{\alpha^2}. I d ( α ) ≤ C ∫ 0 2 s e − α s d s ≤ α 2 C .
Thus
α I d ( α ) → 0 ( d ≥ 3 ) . (62) \alpha I_d(\alpha) \to0 \qquad(d \ge3). \tag*{(62)} α I d ( α ) → 0 ( d ≥ 3 ) . (62)
It remains to treat d = 2 d=2 d = 2 . Then
f 2 ( u ) = 1 π 1 − u 2 1 ( − 1 , 1 ) ( u ) . f_2(u)=\frac{1}{\pi\sqrt{1-u^2}}1_{(-1,1)}(u). f 2 ( u ) = π 1 − u 2 1 1 ( − 1 , 1 ) ( u ) .
For 0 < s ≤ 1 0<s\le1 0 < s ≤ 1 ,
J 2 ( s ) = 1 π 2 ∫ − 1 1 − s d u 1 − u 2 1 − ( u + s ) 2 . J_2(s)=\frac{1}{\pi^2}\int_{-1}^{1-s}\frac{du}{\sqrt{1-u^2}\sqrt{1-(u+s)^2}}. J 2 ( s ) = π 2 1 ∫ − 1 1 − s 1 − u 2 1 − ( u + s ) 2 d u .
Set v = 1 + u v=1+u v = 1 + u . Then v ∈ [ 0 , 2 − s ] v\in[0,2-s] v ∈ [ 0 , 2 − s ] , and
1 − u 2 = v ( 2 − v ) , 1 − ( u + s ) 2 = ( v + s ) ( 2 − s − v ) . 1-u^2=v(2-v),\qquad1-(u+s)^2=(v+s)(2-s-v). 1 − u 2 = v ( 2 − v ) , 1 − ( u + s ) 2 = ( v + s ) ( 2 − s − v ) .
Hence
J 2 ( s ) = 1 π 2 ∫ 0 2 − s d v v ( v + s ) ( 2 − v ) ( 2 − s − v ) . (63) J_2(s)=\frac{1}{\pi^2}\int_0^{2-s}\frac{dv}{\sqrt{v(v+s)(2-v)(2-s-v)}}. \tag*{(63)} J 2 ( s ) = π 2 1 ∫ 0 2 − s v ( v + s ) ( 2 − v ) ( 2 − s − v ) d v . (63)
Let
m s : = 1 − s 2 ∈ [ 1 2 , 1 ] . m_s:=1-\frac{s}{2}\in\left[\frac{1}{2},1\right]. m s := 1 − 2 s ∈ [ 2 1 , 1 ] .
Split the integral in (D.39) into [ 0 , m s ] [0,m_s] [ 0 , m s ] and [ m s , 2 − s ] [m_s,2-s] [ m s , 2 − s ] . If 0 ≤ v ≤ m s 0\le v\le m_s 0 ≤ v ≤ m s , then
2 − v ≥ 1 , 2 − s − v ≥ 1 − s 2 ≥ 1 2 , 2-v\ge1,\qquad2-s-v\ge1-\frac{s}{2}\ge\frac{1}{2}, 2 − v ≥ 1 , 2 − s − v ≥ 1 − 2 s ≥ 2 1 ,
so
1 v ( v + s ) ( 2 − v ) ( 2 − s − v ) ≤ 2 v ( v + s ) . \frac{1}{\sqrt{v(v+s)(2-v)(2-s-v)}}\le\frac{\sqrt{2}}{\sqrt{v(v+s)}}. v ( v + s ) ( 2 − v ) ( 2 − s − v ) 1 ≤ v ( v + s ) 2 .
Hence
∫ 0 m s d v v ( v + s ) ( 2 − v ) ( 2 − s − v ) ≤ 2 ∫ 0 1 d v v ( v + s ) . (64) \int_0^{m_s}\frac{dv}{\sqrt{v(v+s)(2-v)(2-s-v)}}\le\sqrt{2}\int_0^1\frac{dv}{\sqrt{v(v+s)}}. \tag*{(64)} ∫ 0 m s v ( v + s ) ( 2 − v ) ( 2 − s − v ) d v ≤ 2 ∫ 0 1 v ( v + s ) d v . (64)
For the right half, set w = 2 − s − v w=2-s-v w = 2 − s − v . Then w ∈ [ 0 , m s ] w\in[0,m_s] w ∈ [ 0 , m s ] , v = 2 − s − w v=2-s-w v = 2 − s − w , and
1 v ( v + s ) ( 2 − v ) ( 2 − s − v ) = 1 ( 2 − s − w ) ( 2 − w ) ( w + s ) w . \frac{1}{\sqrt{v(v+s)(2-v)(2-s-v)}}=\frac{1}{\sqrt{(2-s-w)(2-w)(w+s)w}}. v ( v + s ) ( 2 − v ) ( 2 − s − v ) 1 = ( 2 − s − w ) ( 2 − w ) ( w + s ) w 1 .
Since w ≤ m s w\le m_s w ≤ m s ,
2 − s − w ≥ 1 − s 2 ≥ 1 2 , 2 − w ≥ 1 , 2-s-w\ge1-\frac{s}{2}\ge\frac{1}{2},\qquad2-w\ge1, 2 − s − w ≥ 1 − 2 s ≥ 2 1 , 2 − w ≥ 1 ,
thus
1 ( 2 − s − w ) ( 2 − w ) ( w + s ) w ≤ 2 w ( w + s ) . \frac{1}{\sqrt{(2-s-w)(2-w)(w+s)w}}\le\frac{\sqrt{2}}{\sqrt{w(w+s)}}. ( 2 − s − w ) ( 2 − w ) ( w + s ) w 1 ≤ w ( w + s ) 2 .
Therefore
∫ m s 2 − s d v v ( v + s ) ( 2 − v ) ( 2 − s − v ) ≤ 2 ∫ 0 1 d w w ( w + s ) . (65) \int_{m_s}^{2-s} \frac{dv}{\sqrt{v(v+s)(2-v)(2-s-v)}} \le\sqrt{2}\int_{0}^{1} \frac{dw}{\sqrt{w(w+s)}}. \tag*{(65)} ∫ m s 2 − s v ( v + s ) ( 2 − v ) ( 2 − s − v ) d v ≤ 2 ∫ 0 1 w ( w + s ) d w . (65)
Combining (D.39), (D.40), and (D.41),
J 2 ( s ) ≤ C ∫ 0 1 d y y ( y + s ) ( 0 < s ≤ 1 ) . J_2(s) \le C\int_{0}^{1} \frac{dy}{\sqrt{y(y+s)}} \qquad(0<s\le1). J 2 ( s ) ≤ C ∫ 0 1 y ( y + s ) d y ( 0 < s ≤ 1 ) .
The antiderivative is explicit:
∫ 0 1 d y y ( y + s ) = 2 arsinh ( 1 s ) . \int_{0}^{1} \frac{dy}{\sqrt{y(y+s)}} = 2\operatorname{arsinh}\left(\frac{1}{\sqrt{s}}\right). ∫ 0 1 y ( y + s ) d y = 2 arsinh ( s 1 ) .
Since arsinh ( x ) ≤ C ( 1 + log x ) \operatorname{arsinh}(x)\le C(1+\log x) arsinh ( x ) ≤ C ( 1 + log x ) for x ≥ 1 x\ge1 x ≥ 1 ,
J 2 ( s ) ≤ C ( 1 + log ( 1 / s ) ) , 0 < s ≤ 1. (66) J_2(s)\le C(1+\log(1/s)), \qquad0<s\le1. \tag*{(66)} J 2 ( s ) ≤ C ( 1 + log ( 1/ s )) , 0 < s ≤ 1. (66)
For every d ≥ 2 d\ge2 d ≥ 2 , J d J_d J d is integrable on ( 0 , 2 ) (0,2) ( 0 , 2 ) , because by Fubini
∫ 0 2 J d ( s ) d s = ∫ 0 2 ∫ − 1 1 − s f d ( u + s ) f d ( u ) d u d s = ∫ − 1 1 ∫ u 1 f d ( v ) f d ( u ) d v d u ≤ 1. (67) \int_{0}^{2}J_d(s)\,ds=\int_{0}^{2}\int_{-1}^{1-s}f_d(u+s)f_d(u)\,du\,ds=\int_{-1}^{1}\int_{u}^{1}f_d(v)f_d(u)\,dv\,du\le1. \tag*{(67)} ∫ 0 2 J d ( s ) d s = ∫ 0 2 ∫ − 1 1 − s f d ( u + s ) f d ( u ) d u d s = ∫ − 1 1 ∫ u 1 f d ( v ) f d ( u ) d v d u ≤ 1. (67)
Therefore
∫ 1 2 s e − α s J d ( s ) d s ≤ 2 e − α ∫ 1 2 J d ( s ) d s ≤ 2 e − α . (68) \int_{1}^{2}se^{-\alpha s}J_d(s)\,ds\le2e^{-\alpha}\int_{1}^{2}J_d(s)\,ds\le2e^{-\alpha}. \tag*{(68)} ∫ 1 2 s e − α s J d ( s ) d s ≤ 2 e − α ∫ 1 2 J d ( s ) d s ≤ 2 e − α . (68)
Using (D.42) and (D.44),
I 2 ( α ) ≤ C ∫ 0 1 s e − α s ( 1 + log ( 1 / s ) ) d s + 2 e − α . I_2(\alpha)\le C\int_{0}^{1}se^{-\alpha s}(1+\log(1/s))\,ds+2e^{-\alpha}. I 2 ( α ) ≤ C ∫ 0 1 s e − α s ( 1 + log ( 1/ s )) d s + 2 e − α .
Hence
α I 2 ( α ) ≤ C α ∫ 0 1 s e − α s ( 1 + log ( 1 / s ) ) d s + 2 α e − α . \alpha I_2(\alpha)\le C\alpha\int_{0}^{1}se^{-\alpha s}(1+\log(1/s))\,ds+2\alpha e^{-\alpha}. α I 2 ( α ) ≤ C α ∫ 0 1 s e − α s ( 1 + log ( 1/ s )) d s + 2 α e − α .
With the substitution y = α s y=\alpha s y = α s ,
α ∫ 0 1 s e − α s ( 1 + log ( 1 / s ) ) d s = 1 α ∫ 0 α y e − y ( 1 + log ( α / y ) ) d y ≤ 1 α ∫ 0 ∞ y e − y ( 1 + log α + ∣ log y ∣ ) d y . \alpha\int_{0}^{1}se^{-\alpha s}(1+\log(1/s))\,ds
=\frac{1}{\alpha}\int_{0}^{\alpha}ye^{-y}(1+\log(\alpha/y))\,dy
\le\frac{1}{\alpha}\int_{0}^{\infty}ye^{-y}(1+\log\alpha+|\log y|)\,dy. α ∫ 0 1 s e − α s ( 1 + log ( 1/ s )) d s = α 1 ∫ 0 α y e − y ( 1 + log ( α / y )) d y ≤ α 1 ∫ 0 ∞ y e − y ( 1 + log α + ∣ log y ∣ ) d y .
Since
∫ 0 ∞ y e − y d y < ∞ , ∫ 0 ∞ y e − y ∣ log y ∣ d y < ∞ , \int_{0}^{\infty}ye^{-y}\,dy<\infty,\qquad\int_{0}^{\infty}ye^{-y}|\log y|\,dy<\infty, ∫ 0 ∞ y e − y d y < ∞ , ∫ 0 ∞ y e − y ∣ log y ∣ d y < ∞ ,
it follows that
α I 2 ( α ) ≤ C 1 + log α α + 2 α e − α → 0. (69) \alpha I_2(\alpha)\le C\frac{1+\log\alpha}{\alpha}+2\alpha e^{-\alpha}\to0. \tag*{(69)} α I 2 ( α ) ≤ C α 1 + log α + 2 α e − α → 0. (69)
Combining (D.38) and (D.45),
α I d ( α ) → 0 for every d ≥ 2. \alpha I_d(\alpha)\to0 \qquad\text{for every }d\ge2. α I d ( α ) → 0 for every d ≥ 2.
Returning to (D.36),
α k E [ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) ] ≤ N ( N − 1 ) α k I d ( α k ) → 0. \alpha_k \mathbb{E}\left[\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}\right]\le N(N-1)\alpha_k I_d(\alpha_k)\to0. α k E j = π ∑ ( U π − U j ) e − α k ( U π − U j ) ≤ N ( N − 1 ) α k I d ( α k ) → 0.
Lemma D.29. Define
b i , k : = e α k U i ∑ j = 1 N e α k U j , Q k : = ∑ i = 1 N b i , k 2 , μ k : = ∑ i = 1 N b i , k U i . b_{i,k}:=\frac{e^{\alpha_k U_i}}{\sum_{j=1}^{N}e^{\alpha_k U_j}},\qquad Q_k:=\sum_{i=1}^{N}b_{i,k}^{2},\qquad\mu_k:=\sum_{i=1}^{N}b_{i,k}U_i. b i , k := ∑ j = 1 N e α k U j e α k U i , Q k := i = 1 ∑ N b i , k 2 , μ k := i = 1 ∑ N b i , k U i . Then
1 − b π , k ≤ ∑ j ≠ π e − α k ( U π − U j ) , 1-b_{\pi,k}\le\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}, 1 − b π , k ≤ j = π ∑ e − α k ( U π − U j ) , 0 ≤ b π , k − Q k ≤ 1 − b π , k , 0\le b_{\pi,k}-Q_k\le1-b_{\pi,k}, 0 ≤ b π , k − Q k ≤ 1 − b π , k , 1 − Q k ≤ 2 ( 1 − b π , k ) ≤ 2 ∑ j ≠ π e − α k ( U π − U j ) , 1-Q_k\le2(1-b_{\pi,k})\le2\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}, 1 − Q k ≤ 2 ( 1 − b π , k ) ≤ 2 j = π ∑ e − α k ( U π − U j ) , 0 ≤ U π − μ k ≤ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) , 0\le U_\pi-\mu_k\le\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}, 0 ≤ U π − μ k ≤ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) , ∣ ∂ α b π ( α k ) ∣ ≤ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) , \left|\partial_\alpha b_\pi(\alpha_k)\right|\le\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}, ∣ ∂ α b π ( α k ) ∣ ≤ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) , ∣ Q k ′ ∣ ≤ 4 ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) , \left|Q'_k\right|\le4\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}, ∣ Q k ′ ∣ ≤ 4 j = π ∑ ( U π − U j ) e − α k ( U π − U j ) , where
∂ α b π ( α k ) = b π , k ( U π − μ k ) , Q k ′ = 2 ∑ i = 1 N b i , k 2 ( U i − μ k ) . \partial_\alpha b_\pi(\alpha_k)=b_{\pi,k}(U_\pi-\mu_k),\qquad Q'_k=2\sum_{i=1}^{N}b_{i,k}^{2}(U_i-\mu_k). ∂ α b π ( α k ) = b π , k ( U π − μ k ) , Q k ′ = 2 i = 1 ∑ N b i , k 2 ( U i − μ k ) . Moreover,
∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 6 ∑ j ≠ π e − α k ( U π − U j ) . \left|a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k-3a_0(\alpha_k,\beta_k)\right|\le6\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}. ∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 6 j = π ∑ e − α k ( U π − U j ) .
Proof. Since
b π , k = 1 1 + ∑ j ≠ π e − α k ( U π − U j ) , b_{\pi,k}=\frac{1}{1+\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}}, b π , k = 1 + ∑ j = π e − α k ( U π − U j ) 1 ,
we have
1 − b π , k = ∑ j ≠ π e − α k ( U π − U j ) 1 + ∑ j ≠ π e − α k ( U π − U j ) ≤ ∑ j ≠ π e − α k ( U π − U j ) . 1-b_{\pi,k}=\frac{\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}}{1+\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}}\le\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}. 1 − b π , k = 1 + ∑ j = π e − α k ( U π − U j ) ∑ j = π e − α k ( U π − U j ) ≤ j = π ∑ e − α k ( U π − U j ) .
Also Q k ≥ b π , k 2 Q_k\ge b_{\pi,k}^{2} Q k ≥ b π , k 2 , so
0 ≤ b π , k − Q k ≤ b π , k − b π , k 2 = b π , k ( 1 − b π , k ) ≤ 1 − b π , k . 0\le b_{\pi,k}-Q_k\le b_{\pi,k}-b_{\pi,k}^{2}=b_{\pi,k}(1-b_{\pi,k})\le1-b_{\pi,k}. 0 ≤ b π , k − Q k ≤ b π , k − b π , k 2 = b π , k ( 1 − b π , k ) ≤ 1 − b π , k .
Therefore
1 − Q k = ( 1 − b π , k 2 ) − ∑ j ≠ π b j , k 2 ≤ 1 − b π , k 2 ≤ 2 ( 1 − b π , k ) , 1-Q_k=(1-b_{\pi,k}^{2})-\sum_{j\ne\pi}b_{j,k}^{2}\le1-b_{\pi,k}^{2}\le2(1-b_{\pi,k}), 1 − Q k = ( 1 − b π , k 2 ) − j = π ∑ b j , k 2 ≤ 1 − b π , k 2 ≤ 2 ( 1 − b π , k ) ,
which gives the third inequality.
Next,
U π − μ k = ∑ j ≠ π b j , k ( U π − U j ) . U_\pi-\mu_k=\sum_{j\ne\pi}b_{j,k}(U_\pi-U_j). U π − μ k = j = π ∑ b j , k ( U π − U j ) .
For j ≠ π j\ne\pi j = π ,
b j , k = e − α k ( U π − U j ) 1 + ∑ ℓ ≠ π e − α k ( U π − U ℓ ) ≤ e − α k ( U π − U j ) , b_{j,k}=\frac{e^{-\alpha_k(U_\pi-U_j)}}{1+\sum_{\ell\ne\pi}e^{-\alpha_k(U_\pi-U_\ell)}}\le e^{-\alpha_k(U_\pi-U_j)}, b j , k = 1 + ∑ ℓ = π e − α k ( U π − U ℓ ) e − α k ( U π − U j ) ≤ e − α k ( U π − U j ) ,
hence
0 ≤ U π − μ k ≤ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) . 0\le U_\pi-\mu_k\le\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}. 0 ≤ U π − μ k ≤ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) .
Using
∂ α b π ( α k ) = b π , k ( U π − μ k ) , \partial_\alpha b_\pi(\alpha_k)=b_{\pi,k}(U_\pi-\mu_k), ∂ α b π ( α k ) = b π , k ( U π − μ k ) ,
we get
∣ ∂ α b π ( α k ) ∣ ≤ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) . \left|\partial_\alpha b_\pi(\alpha_k)\right|\le\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}. ∣ ∂ α b π ( α k ) ∣ ≤ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) .
For Q k ′ Q'_k Q k ′ ,
Q k ′ = 2 ∑ i = 1 N b i , k 2 ( U i − μ k ) , Q'_k=2\sum_{i=1}^{N}b_{i,k}^{2}(U_i-\mu_k), Q k ′ = 2 i = 1 ∑ N b i , k 2 ( U i − μ k ) ,
hence
∣ Q k ′ ∣ ≤ 2 ∑ i = 1 N b i , k 2 ∣ U i − μ k ∣ ≤ 2 ∑ i = 1 N b i , k ∣ U i − μ k ∣ . |Q'_k|\le2\sum_{i=1}^{N}b_{i,k}^{2}|U_i-\mu_k|\le2\sum_{i=1}^{N}b_{i,k}|U_i-\mu_k|. ∣ Q k ′ ∣ ≤ 2 i = 1 ∑ N b i , k 2 ∣ U i − μ k ∣ ≤ 2 i = 1 ∑ N b i , k ∣ U i − μ k ∣.
Since U i ≤ U π U_i\le U_\pi U i ≤ U π ,
∣ U i − μ k ∣ ≤ ( U π − U i ) + ( U π − μ k ) . |U_i-\mu_k|\le(U_\pi-U_i)+(U_\pi-\mu_k). ∣ U i − μ k ∣ ≤ ( U π − U i ) + ( U π − μ k ) .
Therefore
∑ i = 1 N b i , k ∣ U i − μ k ∣ ≤ ∑ i = 1 N b i , k ( U π − U i ) + ∑ i = 1 N b i , k ( U π − μ k ) = 2 ( U π − μ k ) , \sum_{i=1}^{N}b_{i,k}|U_i-\mu_k|\le\sum_{i=1}^{N}b_{i,k}(U_\pi-U_i)+\sum_{i=1}^{N}b_{i,k}(U_\pi-\mu_k)=2(U_\pi-\mu_k), i = 1 ∑ N b i , k ∣ U i − μ k ∣ ≤ i = 1 ∑ N b i , k ( U π − U i ) + i = 1 ∑ N b i , k ( U π − μ k ) = 2 ( U π − μ k ) ,
and thus
∣ Q k ′ ∣ ≤ 4 ( U π − μ k ) ≤ 4 ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) . |Q'_k|\le4(U_\pi-\mu_k)\le4\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}. ∣ Q k ′ ∣ ≤ 4 ( U π − μ k ) ≤ 4 j = π ∑ ( U π − U j ) e − α k ( U π − U j ) .
Finally,
a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k − 3 a 0 ( α k , β k ) = 2 ( b π , k − Q k ) + 2 a 0 ( α k , β k ) ( Q k − 1 ) . a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k-3a_0(\alpha_k,\beta_k)=2(b_{\pi,k}-Q_k)+2a_0(\alpha_k,\beta_k)(Q_k-1). a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k − 3 a 0 ( α k , β k ) = 2 ( b π , k − Q k ) + 2 a 0 ( α k , β k ) ( Q k − 1 ) .
Hence
∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 2 ∣ b π , k − Q k ∣ + 2 a 0 ( α k , β k ) ∣ 1 − Q k ∣ ≤ 2 ( 1 − b π , k ) + 4 ( 1 − b π , k ) = 6 ( 1 − b π , k ) ≤ 6 ∑ j ≠ π e − α k ( U π − U j ) . \begin{aligned}
\left|a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k-3a_0(\alpha_k,\beta_k)\right| &\le2|b_{\pi,k}-Q_k|+2a_0(\alpha_k,\beta_k)|1-Q_k| \\
&\le2(1-b_{\pi,k})+4(1-b_{\pi,k}) \\
&=6(1-b_{\pi,k})\le6\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}.
\end{aligned} ∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 2∣ b π , k − Q k ∣ + 2 a 0 ( α k , β k ) ∣1 − Q k ∣ ≤ 2 ( 1 − b π , k ) + 4 ( 1 − b π , k ) = 6 ( 1 − b π , k ) ≤ 6 j = π ∑ e − α k ( U π − U j ) .
Lemma D.30. Let
a 0 ( α k , β k ) = ( 1 + e α k ( λ k − ( 1 − U π ) ) ( 1 + ∑ j ≠ π e − α k ( U π − U j ) ) ) − 1 . a_0(\alpha_k,\beta_k)=\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\left(1+\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\right)^{-1}. a 0 ( α k , β k ) = 1 + e α k ( λ k − ( 1 − U π )) 1 + j = π ∑ e − α k ( U π − U j ) − 1 . Then
α k E [ ∣ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ∣ ] → 0 , \alpha_k\mathbb{E}\left[\left|a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}\right|\right]\to0, α k E [ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ] → 0 , and
α k E [ ∣ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ∣ ] → 0. \alpha_k\mathbb{E}\left[\left|a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right|\right]\to0. α k E [ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ] → 0. Moreover, the pointwise bounds
∣ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ∣ ≤ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 , \left|a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}\right|\le\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}, a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ≤ j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) , and
∣ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ∣ ≤ 2 ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 \left|a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right|\le2\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3} a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ≤ 2 j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) hold almost surely.
Proof. Set
A : = e α k ( λ k − ( 1 − U π ) ) , x : = 1 + ∑ j ≠ π e − α k ( U π − U j ) ≥ 1. A:=e^{\alpha_k(\lambda_k-(1-U_\pi))},\qquad x:=1+\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\ge1. A := e α k ( λ k − ( 1 − U π )) , x := 1 + j = π ∑ e − α k ( U π − U j ) ≥ 1. Then
a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) = ℓ ( A , x ) , e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 = ℓ ( A , 1 ) , ℓ ( A , x ) : = A x ( 1 + A x ) 2 , a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))=\ell(A,x),\qquad\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}=\ell(A,1),\qquad\ell(A,x):=\frac{Ax}{(1+Ax)^2}, a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) = ℓ ( A , x ) , ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) = ℓ ( A , 1 ) , ℓ ( A , x ) := ( 1 + A x ) 2 A x , and
a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) = κ ( A , x ) , e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 = κ ( A , 1 ) , κ ( A , x ) : = A x ( 1 + A x ) 3 . a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))=\kappa(A,x),\qquad\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}=\kappa(A,1),\qquad\kappa(A,x):=\frac{Ax}{(1+Ax)^3}. a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) = κ ( A , x ) , ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) = κ ( A , 1 ) , κ ( A , x ) := ( 1 + A x ) 3 A x .
Differentiate with respect to x x x :
∂ x ℓ ( A , x ) = A ( 1 − A x ) ( 1 + A x ) 3 , ∂ x κ ( A , x ) = A ( 1 − 2 A x ) ( 1 + A x ) 4 . \partial_x\ell(A,x)=\frac{A(1-Ax)}{(1+Ax)^3},\qquad\partial_x\kappa(A,x)=\frac{A(1-2Ax)}{(1+Ax)^4}. ∂ x ℓ ( A , x ) = ( 1 + A x ) 3 A ( 1 − A x ) , ∂ x κ ( A , x ) = ( 1 + A x ) 4 A ( 1 − 2 A x ) .
For x ≥ 1 x\ge1 x ≥ 1 ,
∣ ∂ x ℓ ( A , x ) ∣ ≤ A ( 1 + A x ) ( 1 + A x ) 3 = A ( 1 + A x ) 2 ≤ A ( 1 + A ) 2 = e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 , \left|\partial_x\ell(A,x)\right|\le\frac{A(1+Ax)}{(1+Ax)^3}=\frac{A}{(1+Ax)^2}\le\frac{A}{(1+A)^2}=\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}, ∣ ∂ x ℓ ( A , x ) ∣ ≤ ( 1 + A x ) 3 A ( 1 + A x ) = ( 1 + A x ) 2 A ≤ ( 1 + A ) 2 A = ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ,
and similarly
∣ ∂ x κ ( A , x ) ∣ ≤ A ( 1 + 2 A x ) ( 1 + A x ) 4 ≤ 2 A ( 1 + A x ) 3 ≤ 2 A ( 1 + A ) 3 = 2 e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 . \left|\partial_x\kappa(A,x)\right|\le\frac{A(1+2Ax)}{(1+Ax)^4}\le\frac{2A}{(1+Ax)^3}\le\frac{2A}{(1+A)^3}=2\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}. ∣ ∂ x κ ( A , x ) ∣ ≤ ( 1 + A x ) 4 A ( 1 + 2 A x ) ≤ ( 1 + A x ) 3 2 A ≤ ( 1 + A ) 3 2 A = 2 ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) .
Hence, by the mean-value theorem,
∣ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ∣ = ∣ ℓ ( A , x ) − ℓ ( A , 1 ) ∣ ≤ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 , \begin{aligned}
\left|a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\right| \\
&=\left|\ell(A,x)-\ell(A,1)\right| \\
&\le\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2},
\end{aligned} a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) = ∣ ℓ ( A , x ) − ℓ ( A , 1 ) ∣ ≤ j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ,
and
∣ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ∣ = ∣ κ ( A , x ) − κ ( A , 1 ) ∣ \begin{aligned}
\left|a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\right| \\
&=\left|\kappa(A,x)-\kappa(A,1)\right|
\end{aligned} a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) = ∣ κ ( A , x ) − κ ( A , 1 ) ∣
≤ 2 ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 . \le2\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}. ≤ 2 j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) .
Taking expectations and using Lemma D.27 ,
α k E [ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] ≤ α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] → 0 , \begin{aligned}
\alpha_k\mathbb{E}\left[a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\right] \\
&\le\alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^2}\right]\to0,
\end{aligned} α k E [ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ] ≤ α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) → 0 ,
and
α k E [ ∣ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ∣ ] \alpha_k \mathbb{E}\left[\left|a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right|\right] α k E [ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ]
≤ 2 α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ] → 0. \leq2\alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right]\to0. ≤ 2 α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) → 0.
Let φ ( U 1 , … , U N ; α , β ) \varphi(U_1,\ldots,U_N;\alpha,\beta) φ ( U 1 , … , U N ; α , β ) denote the reduced sample loss. The exact sample-level gradient formulas proved earlier are
∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) , \partial_\beta\varphi=a_0(\alpha,\beta)(1-a_0(\alpha,\beta))\left(a_0(\alpha,\beta)+2b_\pi(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha)\right), ∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) ) ,
and
∂ α φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) ) + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β ) ) ∂ α b π ( α ) , \partial_\alpha\varphi=a_0(\alpha,\beta)(1-a_0(\alpha,\beta))(1-\mu(\alpha))\left(a_0(\alpha,\beta)+2b_\pi(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha)\right)
+(1-a_0(\alpha,\beta))^2Q'(\alpha)-2(1-a_0(\alpha,\beta))\partial_\alpha b_\pi(\alpha), ∂ α φ = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( 1 − μ ( α )) ( a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) ) + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β )) ∂ α b π ( α ) ,
where
Q ( α ) = ∑ i = 1 N b i ( α ) 2 , μ ( α ) = ∑ i = 1 N b i ( α ) U i , ∂ α b π ( α ) = b π ( α ) ( U π − μ ( α ) ) , Q ′ ( α ) = 2 ∑ i = 1 N b i ( α ) 2 ( U i − μ ( α ) ) . Q(\alpha)=\sum_{i=1}^{N}b_i(\alpha)^2,\quad\mu(\alpha)=\sum_{i=1}^{N}b_i(\alpha)U_i,\quad\partial_\alpha b_\pi(\alpha)=b_\pi(\alpha)(U_\pi-\mu(\alpha)),\quad Q'(\alpha)=2\sum_{i=1}^{N}b_i(\alpha)^2(U_i-\mu(\alpha)). Q ( α ) = i = 1 ∑ N b i ( α ) 2 , μ ( α ) = i = 1 ∑ N b i ( α ) U i , ∂ α b π ( α ) = b π ( α ) ( U π − μ ( α )) , Q ′ ( α ) = 2 i = 1 ∑ N b i ( α ) 2 ( U i − μ ( α )) .
Theorem D.31. Then
α k E [ 1 N + 1 ∂ β φ ( α k , β k ) + λ k d ∂ α φ ( α k , β k ) ] ⟶ Γ λ ( λ ) : = 3 2 h ( λ ) ( 1 N + 1 + λ 2 d ) . \alpha_k\mathbb{E}\left[\frac{1}{N+1}\partial_\beta\varphi(\alpha_k,\beta_k)+\frac{\lambda_k}{d}\partial_\alpha\varphi(\alpha_k,\beta_k)\right]\longrightarrow\Gamma_\lambda(\lambda):=\frac{3}{2}h(\lambda)\left(\frac{1}{N+1}+\frac{\lambda^2}{d}\right). α k E [ N + 1 1 ∂ β φ ( α k , β k ) + d λ k ∂ α φ ( α k , β k ) ] ⟶ Γ λ ( λ ) := 2 3 h ( λ ) ( N + 1 1 + d λ 2 ) . In particular, Γ λ ( λ ) > 0 \Gamma_\lambda(\lambda)>0 Γ λ ( λ ) > 0 for every λ ∈ ( 0 , 2 ) \lambda\in(0,2) λ ∈ ( 0 , 2 ) .
Proof. Write
1 N + 1 ∂ β φ ( α k , β k ) + λ k d ∂ α φ ( α k , β k ) = A k + B k , \frac{1}{N+1}\partial_\beta\varphi(\alpha_k,\beta_k)+\frac{\lambda_k}{d}\partial_\alpha\varphi(\alpha_k,\beta_k)=A_k+B_k, N + 1 1 ∂ β φ ( α k , β k ) + d λ k ∂ α φ ( α k , β k ) = A k + B k ,
where
A k = a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) ( 1 N + 1 + λ k d ( 1 − μ k ) ) × ( a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k ) , A_k=a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))\left(\frac{1}{N+1}+\frac{\lambda_k}{d}(1-\mu_k)\right)
\times\left(a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k\right), A k = a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) ( N + 1 1 + d λ k ( 1 − μ k ) ) × ( a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k ) ,
and
B k = λ k d ( ( 1 − a 0 ( α k , β k ) ) 2 Q k ′ − 2 ( 1 − a 0 ( α k , β k ) ) ∂ α b π ( α k ) ) . B_k=\frac{\lambda_k}{d}\left((1-a_0(\alpha_k,\beta_k))^2Q'_k-2(1-a_0(\alpha_k,\beta_k))\partial_\alpha b_\pi(\alpha_k)\right). B k = d λ k ( ( 1 − a 0 ( α k , β k ) ) 2 Q k ′ − 2 ( 1 − a 0 ( α k , β k )) ∂ α b π ( α k ) ) .
Since λ k → λ ∈ ( 0 , 2 ) \lambda_k\to\lambda\in(0,2) λ k → λ ∈ ( 0 , 2 ) , the sequence ( λ k ) (\lambda_k) ( λ k ) is bounded. By Lemma D.29,
∣ Q k ′ ∣ + 2 ∣ ∂ α b π ( α k ) ∣ ≤ 6 ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) . |Q'_k|+2|\partial_\alpha b_\pi(\alpha_k)|\leq6\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}. ∣ Q k ′ ∣ + 2∣ ∂ α b π ( α k ) ∣ ≤ 6 j = π ∑ ( U π − U j ) e − α k ( U π − U j ) .
Hence
∣ B k ∣ ≤ C ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) |B_k| \le C \sum_{j\ne\pi} (U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)} ∣ B k ∣ ≤ C j = π ∑ ( U π − U j ) e − α k ( U π − U j )
for some deterministic constant C C C , and Lemma D.28 yields
α k E [ ∣ B k ∣ ] → 0. (70) \alpha_k \mathbb{E}[|B_k|] \to0. \tag*{(70)} α k E [ ∣ B k ∣ ] → 0. (70)
We next compare A k A_k A k with
3 ( 1 N + 1 + λ d ( 1 − U π ) ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) . 3\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k)). 3 ( N + 1 1 + d λ ( 1 − U π ) ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) .
By Lemma D.29,
∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 6 ∑ j ≠ π e − α k ( U π − U j ) . (71) \left|a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k-3a_0(\alpha_k,\beta_k)\right|
\le6\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}. \tag*{(71)} ∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 6 j = π ∑ e − α k ( U π − U j ) . (71)
Also,
1 − μ k = ( 1 − U π ) + ( U π − μ k ) , 1-\mu_k=(1-U_\pi)+(U_\pi-\mu_k), 1 − μ k = ( 1 − U π ) + ( U π − μ k ) ,
and Lemma D.29 gives
0 ≤ U π − μ k ≤ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) . (72) 0\le U_\pi-\mu_k\le\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}. \tag*{(72)} 0 ≤ U π − μ k ≤ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) . (72)
Therefore
∣ 1 N + 1 + λ k d ( 1 − μ k ) − ( 1 N + 1 + λ d ( 1 − U π ) ) ∣ ≤ ∣ λ k − λ ∣ d ∣ 1 − μ k ∣ + λ d ( U π − μ k ) ≤ 2 ∣ λ k − λ ∣ + λ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) , (73) \begin{aligned}
\left|\frac{1}{N+1}+\frac{\lambda_k}{d}(1-\mu_k)-\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)\right|
&\le\frac{|\lambda_k-\lambda|}{d}|1-\mu_k|+\frac{\lambda}{d}(U_\pi-\mu_k)\\
&\le2|\lambda_k-\lambda|+\lambda\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}, \tag*{(73)}
\end{aligned} N + 1 1 + d λ k ( 1 − μ k ) − ( N + 1 1 + d λ ( 1 − U π ) ) ≤ d ∣ λ k − λ ∣ ∣1 − μ k ∣ + d λ ( U π − μ k ) ≤ 2∣ λ k − λ ∣ + λ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) , (73)
because d ≥ 1 d\ge1 d ≥ 1 and ∣ 1 − μ k ∣ ≤ 2 |1-\mu_k|\le2 ∣1 − μ k ∣ ≤ 2 .
Using (D.47), (D.48), (D.49), and the boundedness of a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k)) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) and a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k)) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) , we obtain
∣ A k − 3 ( 1 N + 1 + λ d ( 1 − U π ) ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) ∣ ≤ C ∣ λ k − λ ∣ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) + C ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) + C ( ∑ j ≠ π e − α k ( U π − U j ) ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) \begin{aligned}
\left|A_k-3\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\right|
&\le C|\lambda_k-\lambda|a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\\
&\quad+C\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}\\
&\quad+C\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))
\end{aligned} A k − 3 ( N + 1 1 + d λ ( 1 − U π ) ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) ≤ C ∣ λ k − λ ∣ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) + C j = π ∑ ( U π − U j ) e − α k ( U π − U j ) + C j = π ∑ e − α k ( U π − U j ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ))
for some constant C C C .
Multiplying by α k \alpha_k α k and taking expectations, the middle term vanishes by Lemma D.28 . For the last term, Lemma D.30 gives
a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) ≤ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 + ∣ a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ∣ ≤ e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 + ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 , \begin{aligned}
a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k)) \le\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2} + \left|a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}\right| \\
&\le\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}+\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2},
\end{aligned} a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) ≤ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) + a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ≤ ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) + j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) ,
hence, using ∑ j ≠ π e − α k ( U π − U j ) ≤ N − 1 \sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\le N-1 ∑ j = π e − α k ( U π − U j ) ≤ N − 1 ,
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) ] ≤ α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] + ( N − 1 ) α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 2 ] → 0 \begin{aligned}
\alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))\right] \\
&\le\alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}\right] \\
&+(N-1)\alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^2}\right]\to0
\end{aligned} α k E j = π ∑ e − α k ( U π − U j ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) ≤ α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) + ( N − 1 ) α k E j = π ∑ e − α k ( U π − U j ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 2 e α k ( λ k − ( 1 − U π )) → 0
by Lemma D.27 . For the ∣ λ k − λ ∣ |\lambda_k-\lambda| ∣ λ k − λ ∣ -term,
α k E [ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) ] = O ( 1 ) \alpha_k\mathbb{E}\left[a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\right]=O(1) α k E [ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) ] = O ( 1 )
by Lemma D.30 and Lemma D.25 with ψ ≡ 1 \psi\equiv1 ψ ≡ 1 . Therefore
α k ∣ λ k − λ ∣ E [ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) ] → 0. \alpha_k|\lambda_k-\lambda|\mathbb{E}\left[a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\right]\to0. α k ∣ λ k − λ ∣ E [ a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) ] → 0.
Consequently,
α k E [ ∣ A k − 3 ( 1 N + 1 + λ d ( 1 − U π ) ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) ∣ ] → 0. (74) \alpha_k\mathbb{E}\left[\left|A_k-3\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\right|\right]\to0. \tag*{(74)} α k E [ A k − 3 ( N + 1 1 + d λ ( 1 − U π ) ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) ] → 0. (74)
Next, Lemma D.30 yields
α k E [ ∣ 3 ( 1 N + 1 + λ d ( 1 − U π ) ) ( a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ) ∣ ] → 0. (75) \alpha_k\mathbb{E}\left[\left|3\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)\left(a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right)\right|\right]\to0. \tag*{(75)} α k E [ 3 ( N + 1 1 + d λ ( 1 − U π ) ) ( a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ) ] → 0. (75)
Combining (D.50) and (D.51,
α k E [ A k ] − 3 α k E [ ( 1 N + 1 + λ d ( 1 − U π ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ] → 0. (76) \alpha_k\mathbb{E}[A_k]-3\alpha_k\mathbb{E}\left[\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right]\to0. \tag*{(76)} α k E [ A k ] − 3 α k E [ ( N + 1 1 + d λ ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ] → 0. (76)
Applying Lemma D.25 with
ψ ( t ) = 3 ( 1 N + 1 + λ d t ) \psi(t)=3\left(\frac{1}{N+1}+\frac{\lambda}{d}t\right) ψ ( t ) = 3 ( N + 1 1 + d λ t )
we obtain
3 α k E [ ( 1 N + 1 + λ d ( 1 − U π ) ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ] ⟶ 3 2 h ( λ ) ( 1 N + 1 + λ 2 d ) . (77) 3\alpha_k\mathbb{E}\left[\left(\frac{1}{N+1}+\frac{\lambda}{d}(1-U_\pi)\right)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{\left(1+e^{\alpha_k(\lambda_k-(1-U_\pi))}\right)^3}\right]\longrightarrow\frac{3}{2}h(\lambda)\left(\frac{1}{N+1}+\frac{\lambda^2}{d}\right). \tag*{(77)} 3 α k E [ ( N + 1 1 + d λ ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ] ⟶ 2 3 h ( λ ) ( N + 1 1 + d λ 2 ) . (77)
Combining (D.46), (D.52), and (D.53) proves
α k E [ 1 N + 1 ∂ β φ ( α k , β k ) + λ k d ∂ α φ ( α k , β k ) ] ⟶ 3 2 h ( λ ) ( 1 N + 1 + λ 2 d ) . \alpha_k\mathbb{E}\left[\frac{1}{N+1}\partial_\beta\varphi(\alpha_k,\beta_k)+\frac{\lambda_k}{d}\partial_\alpha\varphi(\alpha_k,\beta_k)\right]\longrightarrow\frac{3}{2}h(\lambda)\left(\frac{1}{N+1}+\frac{\lambda^2}{d}\right). α k E [ N + 1 1 ∂ β φ ( α k , β k ) + d λ k ∂ α φ ( α k , β k ) ] ⟶ 2 3 h ( λ ) ( N + 1 1 + d λ 2 ) .
Since h ( λ ) > 0 h(\lambda)>0 h ( λ ) > 0 on ( 0 , 2 ) (0,2) ( 0 , 2 ) , the positivity is immediate.
Lemma D.32. We have
α k ∂ α L ( α k , β k ) ⟶ Γ α ( λ ) : = 3 2 λ h ( λ ) . \alpha_k\partial_\alpha\mathcal{L}(\alpha_k,\beta_k)\longrightarrow\Gamma_\alpha(\lambda):=\frac{3}{2}\lambda h(\lambda). α k ∂ α L ( α k , β k ) ⟶ Γ α ( λ ) := 2 3 λh ( λ ) . In particular, Γ α ( λ ) > 0 \Gamma_\alpha(\lambda)>0 Γ α ( λ ) > 0 for every λ ∈ ( 0 , 2 ) \lambda\in(0,2) λ ∈ ( 0 , 2 ) .
Proof. Write
∂ α φ ( α k , β k ) = A k α + B k α , \partial_\alpha\varphi(\alpha_k,\beta_k)=A_k^\alpha+B_k^\alpha, ∂ α φ ( α k , β k ) = A k α + B k α ,
where
A k α = a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) ( 1 − μ k ) ( a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k ) , A_k^\alpha=a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))(1-\mu_k)
\left(a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k\right), A k α = a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) ( 1 − μ k ) ( a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k ) ,
and
B k α = ( 1 − a 0 ( α k , β k ) ) 2 Q k ′ − 2 ( 1 − a 0 ( α k , β k ) ) ∂ α b π ( α k ) . B_k^\alpha=(1-a_0(\alpha_k,\beta_k))^2Q'_k-2(1-a_0(\alpha_k,\beta_k))\partial_\alpha b_\pi(\alpha_k). B k α = ( 1 − a 0 ( α k , β k ) ) 2 Q k ′ − 2 ( 1 − a 0 ( α k , β k )) ∂ α b π ( α k ) .
By Lemma D.29,
∣ Q k ′ + 2 ∂ α b π ( α k ) ∣ ≤ 6 ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) , \left|Q'_k+2\partial_\alpha b_\pi(\alpha_k)\right|\leq6\sum_{j\neq\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}, ∣ Q k ′ + 2 ∂ α b π ( α k ) ∣ ≤ 6 j = π ∑ ( U π − U j ) e − α k ( U π − U j ) ,
so
∣ B k α ∣ ≤ 6 ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) . |B_k^\alpha|\leq6\sum_{j\neq\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}. ∣ B k α ∣ ≤ 6 j = π ∑ ( U π − U j ) e − α k ( U π − U j ) .
Lemma D.28 then gives
α k E [ ∣ B k α ∣ ] ⟶ 0. (78) \alpha_k\mathbb{E}[|B_k^\alpha|]\longrightarrow0. \tag*{(78)} α k E [ ∣ B k α ∣ ] ⟶ 0. (78)
We compare A k α A_k^\alpha A k α with
3 ( 1 − U π ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) . 3(1-U_\pi)a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k)). 3 ( 1 − U π ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) .
Since
1 − μ k = ( 1 − U π ) + ( U π − μ k ) , 1-\mu_k=(1-U_\pi)+(U_\pi-\mu_k), 1 − μ k = ( 1 − U π ) + ( U π − μ k ) ,
Lemma D.29 yields
∣ 1 − μ k − ( 1 − U π ) ∣ = U π − μ k ≤ ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) , |1-\mu_k-(1-U_\pi)|=U_\pi-\mu_k\leq\sum_{j\neq\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}, ∣1 − μ k − ( 1 − U π ) ∣ = U π − μ k ≤ j = π ∑ ( U π − U j ) e − α k ( U π − U j ) ,
and again
∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k ) ) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 6 ∑ j ≠ π e − α k ( U π − U j ) . \left|a_0(\alpha_k,\beta_k)+2b_{\pi,k}-2(1-a_0(\alpha_k,\beta_k))Q_k-3a_0(\alpha_k,\beta_k)\right| \le6\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}. ∣ a 0 ( α k , β k ) + 2 b π , k − 2 ( 1 − a 0 ( α k , β k )) Q k − 3 a 0 ( α k , β k ) ∣ ≤ 6 j = π ∑ e − α k ( U π − U j ) .
Hence
∣ A k α − 3 ( 1 − U π ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) ∣ ≤ C ∑ j ≠ π ( U π − U j ) e − α k ( U π − U j ) + C ( ∑ j ≠ π e − α k ( U π − U j ) ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) \begin{aligned}
\left|A_k^\alpha-3(1-U_\pi)a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\right| \\
&\le C\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha_k(U_\pi-U_j)}+C\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))
\end{aligned} A k α − 3 ( 1 − U π ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) ≤ C j = π ∑ ( U π − U j ) e − α k ( U π − U j ) + C j = π ∑ e − α k ( U π − U j ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ))
for some constant C C C , since 0 ≤ 1 − U π ≤ 2 0\le1-U_\pi\le2 0 ≤ 1 − U π ≤ 2 . Using Lemma D.28 and the same estimate
α k E [ ( ∑ j ≠ π e − α k ( U π − U j ) ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k ) ) ] → 0 \alpha_k\mathbb{E}\left[\left(\sum_{j\ne\pi}e^{-\alpha_k(U_\pi-U_j)}\right)a_0(\alpha_k,\beta_k)(1-a_0(\alpha_k,\beta_k))\right]\to0 α k E j = π ∑ e − α k ( U π − U j ) a 0 ( α k , β k ) ( 1 − a 0 ( α k , β k )) → 0
proved in the preceding theorem, we obtain
α k E [ ∣ A k α − 3 ( 1 − U π ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) ∣ ] → 0. (79) \alpha_k\mathbb{E}\left[\left|A_k^\alpha-3(1-U_\pi)a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))\right|\right]\to0. \tag*{(79)} α k E [ A k α − 3 ( 1 − U π ) a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) ] → 0. (79)
By Lemma D.30 ,
α k E [ ∣ 3 ( 1 − U π ) ( a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k ) ) − e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ) ∣ ] → 0. (80) \alpha_k\mathbb{E}\left[\left|3(1-U_\pi)\left(a_0(\alpha_k,\beta_k)^2(1-a_0(\alpha_k,\beta_k))-\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right)\right|\right]\to0. \tag*{(80)} α k E [ 3 ( 1 − U π ) ( a 0 ( α k , β k ) 2 ( 1 − a 0 ( α k , β k )) − ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ) ] → 0. (80)
Combining ((D.55) and ((D.56),
α k E [ A k α ] − 3 α k E [ ( 1 − U π ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ] → 0. (81) \alpha_k\mathbb{E}[A_k^\alpha]-3\alpha_k\mathbb{E}\left[(1-U_\pi)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right]\to0. \tag*{(81)} α k E [ A k α ] − 3 α k E [ ( 1 − U π ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ] → 0. (81)
Applying Lemma D.25 with ψ ( t ) = 3 t \psi(t)=3t ψ ( t ) = 3 t ,
3 α k E [ ( 1 − U π ) e α k ( λ k − ( 1 − U π ) ) ( 1 + e α k ( λ k − ( 1 − U π ) ) ) 3 ] → 3 2 λ h ( λ ) . (82) 3\alpha_k\mathbb{E}\left[(1-U_\pi)\frac{e^{\alpha_k(\lambda_k-(1-U_\pi))}}{(1+e^{\alpha_k(\lambda_k-(1-U_\pi))})^3}\right]\to\frac{3}{2}\lambda h(\lambda). \tag*{(82)} 3 α k E [ ( 1 − U π ) ( 1 + e α k ( λ k − ( 1 − U π )) ) 3 e α k ( λ k − ( 1 − U π )) ] → 2 3 λh ( λ ) . (82)
Finally, (D.54), (D.57), and (D.58) imply
α k ∂ α L ( α k , β k ) = α k E [ ∂ α φ ( α k , β k ) ] → 3 2 λ h ( λ ) . \alpha_k\partial_\alpha L(\alpha_k,\beta_k)=\alpha_k\mathbb{E}[\partial_\alpha\varphi(\alpha_k,\beta_k)]\to\frac{3}{2}\lambda h(\lambda). α k ∂ α L ( α k , β k ) = α k E [ ∂ α φ ( α k , β k )] → 2 3 λh ( λ ) .
Convergence of the population loss
We now return from the subsequential boundary-layer analysis to the full gradient-descent trajectory. The results of the previous subsection provide the key interior asymptotics needed to control the global dynamics of
λ t ≔ − β ( t ) α ( t ) . \lambda_t \coloneqq-\frac{\beta^{(t)}}{\alpha^{(t)}}. λ t : = − α ( t ) β ( t ) .
In this subsection, we first combine the interior estimates with a subsequential analysis of the self-token weight to rule out persistent visits of λ t \lambda_t λ t to compact subsets of ( 0 , 2 ) (0,2) ( 0 , 2 ) , which yields the lower bound
lim inf t → ∞ λ t ≥ 2. \liminf_{t\to\infty}\lambda_t \ge2. t → ∞ lim inf λ t ≥ 2.
We then complement this with an analysis to rule out persistent excursions to the region ( 2 , ∞ ) (2,\infty) ( 2 , ∞ ) , thereby proving
lim sup t → ∞ λ t ≤ 2. \limsup_{t\to\infty}\lambda_t \le2. t → ∞ lim sup λ t ≤ 2.
Hence
λ t → 2. \lambda_t \to2. λ t → 2.
Finally, we use this limiting slope behavior together with the asymptotic representation of the population loss to prove that the self-token contribution vanishes and therefore
L ( α ( t ) , β ( t ) ) → 0. \mathcal{L}(\alpha^{(t)},\beta^{(t)}) \to0. L ( α ( t ) , β ( t ) ) → 0.
Lemma D.33. Let ( s k ) k ≥ 1 (s_k)_{k\ge1} ( s k ) k ≥ 1 be any subsequence such that
s k → ∞ , λ s k ≔ − β ( s k ) α ( s k ) → λ ∗ ∈ [ 0 , ∞ ] . s_k \to\infty,\qquad\lambda_{s_k}\coloneqq-\frac{\beta^{(s_k)}}{\alpha^{(s_k)}}\to\lambda_\ast\in[0,\infty]. s k → ∞ , λ s k : = − α ( s k ) β ( s k ) → λ ∗ ∈ [ 0 , ∞ ] . Then
a 0 ( α ( s k ) , β ( s k ) ) → 1 { 1 − U π > λ ∗ } almost surely . a_0(\alpha^{(s_k)},\beta^{(s_k)})\to\mathbf{1}_{\{1-U_\pi>\lambda_\ast\}}\quad\text{almost surely}. a 0 ( α ( s k ) , β ( s k ) ) → 1 { 1 − U π > λ ∗ } almost surely . In particular, since U π < 1 U_\pi<1 U π < 1 almost surely, 1 − U π > 0 1-U_\pi>0 1 − U π > 0 almost surely.
Proof. By the exact score formula,
a 0 ( α ( t ) , β ( t ) ) = ( 1 + ∑ j = 1 N e − β ( t ) − α ( t ) ( 1 − U j ) ) − 1 = ( 1 + ∑ j = 1 N e α ( t ) ( λ t − ( 1 − U j ) ) ) − 1 . (83) a_0(\alpha^{(t)},\beta^{(t)})=
\left(1+\sum_{j=1}^{N}e^{-\beta^{(t)}-\alpha^{(t)}(1-U_j)}\right)^{-1}
=
\left(1+\sum_{j=1}^{N}e^{\alpha^{(t)}(\lambda_t-(1-U_j))}\right)^{-1}. \tag*{(83)} a 0 ( α ( t ) , β ( t ) ) = ( 1 + j = 1 ∑ N e − β ( t ) − α ( t ) ( 1 − U j ) ) − 1 = ( 1 + j = 1 ∑ N e α ( t ) ( λ t − ( 1 − U j )) ) − 1 . (83)
Since U j = 1 U_j=1 U j = 1 has probability zero for each fixed j j j , and N N N is finite,
P ( U π = 1 ) ≤ ∑ j = 1 N P ( U j = 1 ) = 0. \mathbb{P}(U_\pi=1)\le\sum_{j=1}^{N}\mathbb{P}(U_j=1)=0. P ( U π = 1 ) ≤ j = 1 ∑ N P ( U j = 1 ) = 0.
Hence 1 − U π > 0 1-U_\pi>0 1 − U π > 0 almost surely.
Assume first that λ ∗ < ∞ \lambda_\ast<\infty λ ∗ < ∞ . Since 1 − U π 1-U_\pi 1 − U π has a continuous law, P ( 1 − U π = λ ∗ ) = 0 \mathbb{P}(1-U_\pi=\lambda_\ast)=0 P ( 1 − U π = λ ∗ ) = 0 . On the event { 1 − U π > λ ∗ } \{1-U_\pi>\lambda_\ast\} { 1 − U π > λ ∗ } , set ε = ( ( 1 − U π ) − λ ∗ ) / 2 > 0 \varepsilon=((1-U_\pi)-\lambda_\ast)/2>0 ε = (( 1 − U π ) − λ ∗ ) /2 > 0 . For all sufficiently large k k k ,
λ s k ≤ λ ∗ + ε = ( 1 − U π ) − ε ≤ 1 − U j − ε for all j ∈ [ N ] , \lambda_{s_k}\le\lambda_\ast+\varepsilon=(1-U_\pi)-\varepsilon\le1-U_j-\varepsilon\qquad\text{for all }j\in[N], λ s k ≤ λ ∗ + ε = ( 1 − U π ) − ε ≤ 1 − U j − ε for all j ∈ [ N ] ,
because 1 − U π ≤ 1 − U j 1-U_{\pi}\le1-U_j 1 − U π ≤ 1 − U j . Therefore
0 ≤ ∑ j = 1 N e α ( s k ) ( λ s k − ( 1 − U j ) ) ≤ N e − α ( s k ) ε → 0 , 0\le\sum_{j=1}^{N}e^{\alpha^{(s_k)}(\lambda_{s_k}-(1-U_j))}\le Ne^{-\alpha^{(s_k)}\varepsilon}\to0, 0 ≤ j = 1 ∑ N e α ( s k ) ( λ s k − ( 1 − U j )) ≤ N e − α ( s k ) ε → 0 ,
so by (D.59),
a 0 ( α ( s k ) , β ( s k ) ) → 1. a_0(\alpha^{(s_k)},\beta^{(s_k)})\to1. a 0 ( α ( s k ) , β ( s k ) ) → 1.
On the event { 1 − U π < λ ∗ } \{1-U_{\pi}<\lambda_*\} { 1 − U π < λ ∗ } , set ε = ( λ ∗ − ( 1 − U π ) ) / 2 > 0 \varepsilon=(\lambda_*-(1-U_{\pi}))/2>0 ε = ( λ ∗ − ( 1 − U π )) /2 > 0 . For all sufficiently large k k k ,
λ s k ≥ λ ∗ − ε = ( 1 − U π ) + ε . \lambda_{s_k}\ge\lambda_*-\varepsilon=(1-U_{\pi})+\varepsilon. λ s k ≥ λ ∗ − ε = ( 1 − U π ) + ε .
Since 1 − U π 1-U_{\pi} 1 − U π is the j = π j=\pi j = π case, we have
λ s k − ( 1 − U π ) ≥ ε , \lambda_{s_k}-(1-U_{\pi})\ge\varepsilon, λ s k − ( 1 − U π ) ≥ ε ,
and hence the π \pi π -term in (D.59) satisfies
e α ( s k ) ( λ s k − ( 1 − U π ) ) ≥ e α ( s k ) ε → + ∞ . e^{\alpha^{(s_k)}(\lambda_{s_k}-(1-U_{\pi}))}\ge e^{\alpha^{(s_k)}\varepsilon}\to+\infty. e α ( s k ) ( λ s k − ( 1 − U π )) ≥ e α ( s k ) ε → + ∞.
Thus a 0 ( α ( s k ) , β ( s k ) ) → 0 a_0(\alpha^{(s_k)},\beta^{(s_k)})\to0 a 0 ( α ( s k ) , β ( s k ) ) → 0 . Since P ( 1 − U π = λ ∗ ) = 0 \mathbb{P}(1-U_{\pi}=\lambda_*)=0 P ( 1 − U π = λ ∗ ) = 0 , this proves
a 0 ( α ( s k ) , β ( s k ) ) → 1 { 1 − U π > λ ∗ } a_0(\alpha^{(s_k)},\beta^{(s_k)})\to\mathbf{1}_{\{1-U_{\pi}>\lambda_*\}} a 0 ( α ( s k ) , β ( s k ) ) → 1 { 1 − U π > λ ∗ }
almost surely when λ ∗ < ∞ \lambda_*<\infty λ ∗ < ∞ .
If λ ∗ = ∞ \lambda_*=\infty λ ∗ = ∞ , then for almost every outcome 1 − U π < ∞ 1-U_{\pi}<\infty 1 − U π < ∞ , hence for all sufficiently large k k k ,
λ s k ≥ ( 1 − U π ) + 1. \lambda_{s_k}\ge(1-U_{\pi})+1. λ s k ≥ ( 1 − U π ) + 1.
Therefore
λ s k − ( 1 − U π ) ≥ 1 , \lambda_{s_k}-(1-U_{\pi})\ge1, λ s k − ( 1 − U π ) ≥ 1 ,
so again the π \pi π -term in (D.59) diverges to + ∞ +\infty + ∞ , and therefore
a 0 ( α ( s k ) , β ( s k ) ) → 0. a_0(\alpha^{(s_k)},\beta^{(s_k)})\to0. a 0 ( α ( s k ) , β ( s k ) ) → 0.
This is exactly
a 0 ( α ( s k ) , β ( s k ) ) → 1 { 1 − U π > ∞ } a_0(\alpha^{(s_k)},\beta^{(s_k)})\to\mathbf{1}_{\{1-U_{\pi}>\infty\}} a 0 ( α ( s k ) , β ( s k ) ) → 1 { 1 − U π > ∞ }
almost surely.
Lemma D.34. Let
I = [ a , b ] ⊂ ( 0 , 2 ) I=[a,b]\subset(0,2) I = [ a , b ] ⊂ ( 0 , 2 ) be compact. Then there exist constants
0 < A I ≤ A ‾ I < ∞ , 0 < G I ≤ G ‾ I < ∞ , 0<A_I\le\overline{A}_I<\infty,\qquad0<G_I\le\overline{G}_I<\infty, 0 < A I ≤ A I < ∞ , 0 < G I ≤ G I < ∞ ,
and an integer T I T_I T I such that for every t ≥ T I t \ge T_I t ≥ T I ,
λ t ∈ I ⟹ A ‾ I ≤ α ( t ) ∂ α L ( α ( t ) , β ( t ) ) ≤ A ‾ I , (84) \lambda_t \in I \Longrightarrow\underline{A}_I \le\alpha^{(t)}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)}) \le\overline{A}_I, \tag*{(84)} λ t ∈ I ⟹ A I ≤ α ( t ) ∂ α L ( α ( t ) , β ( t ) ) ≤ A I , (84)
and
λ t ∈ I ⟹ G ‾ I ≤ α ( t ) ( 1 N + 1 ∂ β L ( α ( t ) , β ( t ) ) + λ t d ∂ α L ( α ( t ) , β ( t ) ) ) ≤ G ‾ I . (85) \lambda_t \in I \Longrightarrow\underline{G}_I \le\alpha^{(t)}\left(\frac{1}{N+1}\partial_\beta\mathcal{L}(\alpha^{(t)},\beta^{(t)})+\frac{\lambda_t}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right) \le\overline{G}_I. \tag*{(85)} λ t ∈ I ⟹ G I ≤ α ( t ) ( N + 1 1 ∂ β L ( α ( t ) , β ( t ) ) + d λ t ∂ α L ( α ( t ) , β ( t ) ) ) ≤ G I . (85)
Proof. Recall the definition in Lemma D.32 and Theorem D.31 that
Γ α ( λ ) : = 3 2 λ h ( λ ) , Γ λ ( λ ) : = 3 2 h ( λ ) ( 1 N + 1 + λ 2 d ) , λ ∈ ( 0 , 2 ) . \Gamma_\alpha(\lambda) := \frac{3}{2}\lambda h(\lambda), \qquad\Gamma_\lambda(\lambda) := \frac{3}{2}h(\lambda)\left(\frac{1}{N+1}+\frac{\lambda^2}{d}\right), \qquad\lambda\in(0,2). Γ α ( λ ) := 2 3 λh ( λ ) , Γ λ ( λ ) := 2 3 h ( λ ) ( N + 1 1 + d λ 2 ) , λ ∈ ( 0 , 2 ) .
Since h h h is continuous and strictly positive on ( 0 , 2 ) (0,2) ( 0 , 2 ) , the functions Γ α \Gamma_\alpha Γ α and Γ λ \Gamma_\lambda Γ λ are continuous and strictly positive on ( 0 , 2 ) (0,2) ( 0 , 2 ) . On the compact interval I I I , set
m α : = min λ ∈ I Γ α ( λ ) , M α : = max λ ∈ I Γ α ( λ ) , m_\alpha:= \min_{\lambda\in I}\Gamma_\alpha(\lambda), \qquad M_\alpha:= \max_{\lambda\in I}\Gamma_\alpha(\lambda), m α := λ ∈ I min Γ α ( λ ) , M α := λ ∈ I max Γ α ( λ ) ,
and
m λ : = min λ ∈ I Γ λ ( λ ) , M λ : = max λ ∈ I Γ λ ( λ ) . m_\lambda:= \min_{\lambda\in I}\Gamma_\lambda(\lambda), \qquad M_\lambda:= \max_{\lambda\in I}\Gamma_\lambda(\lambda). m λ := λ ∈ I min Γ λ ( λ ) , M λ := λ ∈ I max Γ λ ( λ ) .
Then
0 < m α ≤ M α < ∞ , 0 < m λ ≤ M λ < ∞ . 0 < m_\alpha\le M_\alpha< \infty, \qquad0 < m_\lambda\le M_\lambda< \infty. 0 < m α ≤ M α < ∞ , 0 < m λ ≤ M λ < ∞.
Define
A ‾ I : = m α 2 , A ‾ I : = 2 M α , G ‾ I : = m λ 2 , G ‾ I : = 2 M λ . \underline{A}_I := \frac{m_\alpha}{2}, \qquad\overline{A}_I := 2M_\alpha, \qquad\underline{G}_I := \frac{m_\lambda}{2}, \qquad\overline{G}_I := 2M_\lambda. A I := 2 m α , A I := 2 M α , G I := 2 m λ , G I := 2 M λ .
Suppose (D.60) fails. Then there exists a sequence t n → ∞ t_n \to\infty t n → ∞ with λ t n ∈ I \lambda_{t_n} \in I λ t n ∈ I such that either
α ( t n ) ∂ α L ( α ( t n ) , β ( t n ) ) < A ‾ I \alpha^{(t_n)}\partial_\alpha\mathcal{L}(\alpha^{(t_n)},\beta^{(t_n)}) < \underline{A}_I α ( t n ) ∂ α L ( α ( t n ) , β ( t n ) ) < A I
or
α ( t n ) ∂ α L ( α ( t n ) , β ( t n ) ) > A ‾ I \alpha^{(t_n)}\partial_\alpha\mathcal{L}(\alpha^{(t_n)},\beta^{(t_n)}) > \overline{A}_I α ( t n ) ∂ α L ( α ( t n ) , β ( t n ) ) > A I
for every n n n . Passing to a subsequence, λ t n → λ ∗ ∈ I \lambda_{t_n} \to\lambda_* \in I λ t n → λ ∗ ∈ I . Lemma D.32 then gives
α ( t n ) ∂ α L ( α ( t n ) , β ( t n ) ) → Γ α ( λ ∗ ) ∈ [ m α , M α ] , \alpha^{(t_n)}\partial_\alpha\mathcal{L}(\alpha^{(t_n)},\beta^{(t_n)}) \to\Gamma_\alpha(\lambda_*) \in[m_\alpha,M_\alpha], α ( t n ) ∂ α L ( α ( t n ) , β ( t n ) ) → Γ α ( λ ∗ ) ∈ [ m α , M α ] ,
contradicting the construction of t n t_n t n . Thus (D.60) holds for all large t t t .
The proof of (D.61) is identical, using Theorem D.31 instead of Lemma D.32. Taking T I T_I T I larger if necessary, both bounds hold for all t ≥ T I t \ge T_I t ≥ T I .
Lemma D.35. Let
I = [ a , b ] ⊂ ( 0 , 2 ) I = [a,b] \subset(0,2) I = [ a , b ] ⊂ ( 0 , 2 ) be compact. Then there exist constants
0 < d ‾ I ≤ d ‾ I < ∞ , δ I > 0 , 0 < \underline{d}_I \le\overline{d}_I < \infty, \qquad\delta_I > 0, 0 < d I ≤ d I < ∞ , δ I > 0 ,
and an integer T I ′ ≥ T I T'_I \ge T_I T I ′ ≥ T I such that for every t ≥ T I ′ t \ge T'_I t ≥ T I ′ ,
λ t ∈ I ⟹ d I ( α ( t ) ) 2 ≤ λ t + 1 − λ t ≤ d ‾ I ( α ( t ) ) 2 , (86) \lambda_t \in I \quad\Longrightarrow\quad\frac{d_I}{(\alpha^{(t)})^2} \le\lambda_{t+1}-\lambda_t \le\frac{\overline{d}_I}{(\alpha^{(t)})^2}, \tag*{(86)} λ t ∈ I ⟹ ( α ( t ) ) 2 d I ≤ λ t + 1 − λ t ≤ ( α ( t ) ) 2 d I , (86)
and
λ t ∈ I ⟹ L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ≥ δ I ( α ( t ) ) 2 . (87) \lambda_t \in I \quad\Longrightarrow\quad\mathcal{L}(\alpha^{(t)},\beta^{(t)})-\mathcal{L}(\alpha^{(t+1)},\beta^{(t+1)}) \ge\frac{\delta_I}{(\alpha^{(t)})^2}. \tag*{(87)} λ t ∈ I ⟹ L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ≥ ( α ( t ) ) 2 δ I . (87)
Proof. The exact recursion for λ t \lambda_t λ t is
λ t + 1 − λ t = η ( 1 N + 1 ∂ β L ( α ( t ) , β ( t ) ) + λ t d ∂ α L ( α ( t ) , β ( t ) ) ) α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) . (88) \lambda_{t+1}-\lambda_t =
\frac{\eta\left(\frac{1}{N+1}\partial_\beta\mathcal{L}(\alpha^{(t)},\beta^{(t)})+\frac{\lambda_t}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right)}
{\alpha^{(t)}-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})}. \tag*{(88)} λ t + 1 − λ t = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) η ( N + 1 1 ∂ β L ( α ( t ) , β ( t ) ) + d λ t ∂ α L ( α ( t ) , β ( t ) ) ) . (88)
If λ t ∈ I \lambda_t \in I λ t ∈ I , then by (D.60),
0 < A ‾ I ≤ α ( t ) ∂ α L ( α ( t ) , β ( t ) ) ≤ A ‾ I . 0 < \underline{A}_I \le\alpha^{(t)}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)}) \le\overline{A}_I. 0 < A I ≤ α ( t ) ∂ α L ( α ( t ) , β ( t ) ) ≤ A I .
Hence
0 ≤ η d ∂ α L ( α ( t ) , β ( t ) ) ≤ η A ‾ I d α ( t ) . 0 \le\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)}) \le\frac{\eta\overline{A}_I}{d\alpha^{(t)}}. 0 ≤ d η ∂ α L ( α ( t ) , β ( t ) ) ≤ d α ( t ) η A I .
Since α ( t ) → + ∞ \alpha^{(t)} \to+\infty α ( t ) → + ∞ , after enlarging T I ′ T'_I T I ′ if necessary we may assume that for all t ≥ T I ′ t \ge T'_I t ≥ T I ′ ,
1 2 α ( t ) ≤ α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) ≤ 2 α ( t ) . (89) \frac{1}{2}\alpha^{(t)} \le\alpha^{(t)}-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)}) \le2\alpha^{(t)}. \tag*{(89)} 2 1 α ( t ) ≤ α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) ≤ 2 α ( t ) . (89)
If λ t ∈ I \lambda_t \in I λ t ∈ I , then by (D.61),
G ‾ I ≤ α ( t ) ( 1 N + 1 ∂ β L ( α ( t ) , β ( t ) ) + λ t d ∂ α L ( α ( t ) , β ( t ) ) ) ≤ G ‾ I . \underline{G}_I \le\alpha^{(t)}\left(\frac{1}{N+1}\partial_\beta\mathcal{L}(\alpha^{(t)},\beta^{(t)})+\frac{\lambda_t}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right) \le\overline{G}_I. G I ≤ α ( t ) ( N + 1 1 ∂ β L ( α ( t ) , β ( t ) ) + d λ t ∂ α L ( α ( t ) , β ( t ) ) ) ≤ G I .
Combining this with (D.64) and (D.65),
η G ‾ I 2 ( α ( t ) ) 2 ≤ λ t + 1 − λ t ≤ 2 η G ‾ I ( α ( t ) ) 2 . \frac{\eta\underline{G}_I}{2(\alpha^{(t)})^2} \le\lambda_{t+1}-\lambda_t \le\frac{2\eta\overline{G}_I}{(\alpha^{(t)})^2}. 2 ( α ( t ) ) 2 η G I ≤ λ t + 1 − λ t ≤ ( α ( t ) ) 2 2 η G I .
Thus (D.62) holds with
d ‾ I : = η G ‾ I 2 , d ‾ I : = 2 η G ‾ I . \underline{d}_I := \frac{\eta\underline{G}_I}{2}, \qquad\overline{d}_I := 2\eta\overline{G}_I. d I := 2 η G I , d I := 2 η G I .
For the loss, the previously proved descent inequality gives
L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ≥ η 2 ( 1 d ( ∂ α L ( α ( t ) , β ( t ) ) ) 2 + 1 N + 1 ( ∂ β L ( α ( t ) , β ( t ) ) ) 2 ) . \mathcal{L}(\alpha^{(t)},\beta^{(t)})-\mathcal{L}(\alpha^{(t+1)},\beta^{(t+1)}) \ge\frac{\eta}{2}\left(\frac{1}{d}\left(\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right)^2+\frac{1}{N+1}\left(\partial_\beta\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right)^2\right). L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ≥ 2 η ( d 1 ( ∂ α L ( α ( t ) , β ( t ) ) ) 2 + N + 1 1 ( ∂ β L ( α ( t ) , β ( t ) ) ) 2 ) .
If λ t ∈ I \lambda_t \in I λ t ∈ I , then by (D.60),
( ∂ α L ( α ( t ) , β ( t ) ) ) 2 ≥ A ‾ I 2 ( α ( t ) ) 2 . \left(\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right)^2 \ge\frac{\underline{A}_I^2}{(\alpha^{(t)})^2}. ( ∂ α L ( α ( t ) , β ( t ) ) ) 2 ≥ ( α ( t ) ) 2 A I 2 .
Therefore
L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ≥ η A ‾ I 2 2 d ( α ( t ) ) 2 . \mathcal{L}(\alpha^{(t)},\beta^{(t)})-\mathcal{L}(\alpha^{(t+1)},\beta^{(t+1)}) \ge\frac{\eta\underline{A}_I^2}{2d(\alpha^{(t)})^2}. L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ≥ 2 d ( α ( t ) ) 2 η A I 2 .
Thus (D.63) holds with
δ I : = η A I 2 2 d . \delta_I := \frac{\eta A_I^2}{2d}. δ I := 2 d η A I 2 .
Lemma D.36. Let
I = [ a , b ] ⊂ ( 0 , 2 ) I=[a,b]\subset(0,2) I = [ a , b ] ⊂ ( 0 , 2 ) be compact. There does not exist an integer T 0 T_0 T 0 such that
λ t ∈ I for all t ≥ T 0 . \lambda_t\in I \qquad\text{for all }t\ge T_0. λ t ∈ I for all t ≥ T 0 . Proof. Assume, toward a contradiction, that λ t ∈ I \lambda_t\in I λ t ∈ I for all t ≥ T 0 t\ge T_0 t ≥ T 0 . Let T ∗ : = max { T 0 , T I } T_*:=\max\{T_0,T_I\} T ∗ := max { T 0 , T I } . Then by (D.60),
∂ α L ( α ( t ) , β ( t ) ) ≥ A I α ( t ) > 0 for all t ≥ T ∗ . \partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})\ge\frac{A_I}{\alpha^{(t)}}>0 \qquad\text{for all }t\ge T_*. ∂ α L ( α ( t ) , β ( t ) ) ≥ α ( t ) A I > 0 for all t ≥ T ∗ . Therefore the gradient-descent update gives
α ( t + 1 ) = α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) < α ( t ) ( t ≥ T ∗ ) . \alpha^{(t+1)}=\alpha^{(t)}-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha^{(t)},\beta^{(t)})<\alpha^{(t)} \qquad(t\ge T_*). α ( t + 1 ) = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) < α ( t ) ( t ≥ T ∗ ) . Thus ( α ( t ) ) t ≥ T ∗ (\alpha^{(t)})_{t\ge T_*} ( α ( t ) ) t ≥ T ∗ is strictly decreasing, so
α ( t ) ≤ α ( T ∗ ) for all t ≥ T ∗ . \alpha^{(t)}\le\alpha^{(T_*)} \qquad\text{for all }t\ge T_*. α ( t ) ≤ α ( T ∗ ) for all t ≥ T ∗ . This contradicts the already proved divergence α ( t ) → + ∞ \alpha^{(t)}\to+\infty α ( t ) → + ∞ .
Theorem D.37. Fix any
Then the sequence ( λ t ) t ≥ 0 (\lambda_t)_{t\ge0} ( λ t ) t ≥ 0 has only finitely many upcrossings of [ a , b ] [a,b] [ a , b ] . More precisely, define recursively
u 1 : = inf { t ≥ 0 : λ t ≤ a } , v 1 : = inf { t > u 1 : λ t ≥ b } , u_1:=\inf\{t\ge0:\lambda_t\le a\},\qquad v_1:=\inf\{t>u_1:\lambda_t\ge b\}, u 1 := inf { t ≥ 0 : λ t ≤ a } , v 1 := inf { t > u 1 : λ t ≥ b } , and, whenever v n < ∞ v_n<\infty v n < ∞ ,
u n + 1 : = inf { t > v n : λ t ≤ a } , v n + 1 : = inf { t > u n + 1 : λ t ≥ b } . u_{n+1}:=\inf\{t>v_n:\lambda_t\le a\},\qquad v_{n+1}:=\inf\{t>u_{n+1}:\lambda_t\ge b\}. u n + 1 := inf { t > v n : λ t ≤ a } , v n + 1 := inf { t > u n + 1 : λ t ≥ b } . Then only finitely many indices n n n satisfy v n < ∞ v_n<\infty v n < ∞ .
Proof. Define
I : = [ a I , b I ] : = [ 2 a + b 3 , a + 2 b 3 ] ⊂ ( a , b ) ⊂ ( 0 , 2 ) , I:=[a_I,b_I]:=\left[\frac{2a+b}{3},\frac{a+2b}{3}\right]\subset(a,b)\subset(0,2), I := [ a I , b I ] := [ 3 2 a + b , 3 a + 2 b ] ⊂ ( a , b ) ⊂ ( 0 , 2 ) , so that
b I − a I = b − a 3 . b_I-a_I=\frac{b-a}{3}. b I − a I = 3 b − a . Let T I ′ T'_I T I ′ and d ˉ I , δ I \bar d_I,\delta_I d ˉ I , δ I be given by Lemma D.35.
We also need a global small-step bound before the level b b b is reached. Since ∣ ∂ α L ∣ , ∣ ∂ β L ∣ ≤ 10 |\partial_{\alpha}\mathcal{L}|,|\partial_{\beta}\mathcal{L}|\le10 ∣ ∂ α L ∣ , ∣ ∂ β L ∣ ≤ 10 ,
∣ λ t + 1 − λ t ∣ = ∣ η ( 1 N + 1 ∂ β L ( α ( t ) , β ( t ) ) + η d ∂ α L ( α ( t ) , β ( t ) ) ) α ( t ) − η d ∂ α L ( α ( t ) , β ( t ) ) ∣ ≤ η ( 10 N + 1 + 10 b d ) α ( t ) − 10 η d . |\lambda_{t+1}-\lambda_t|=\left|\frac{\eta\left(\frac{1}{N+1}\partial_{\beta}\mathcal{L}(\alpha^{(t)},\beta^{(t)})+\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha^{(t)},\beta^{(t)})\right)}{\alpha^{(t)}-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha^{(t)},\beta^{(t)})}\right|\le\frac{\eta\left(\frac{10}{N+1}+\frac{10b}{d}\right)}{\alpha^{(t)}-\frac{10\eta}{d}}. ∣ λ t + 1 − λ t ∣ = α ( t ) − d η ∂ α L ( α ( t ) , β ( t ) ) η ( N + 1 1 ∂ β L ( α ( t ) , β ( t ) ) + d η ∂ α L ( α ( t ) , β ( t ) ) ) ≤ α ( t ) − d 10 η η ( N + 1 10 + d 10 b ) .
whenever λ t ≤ b \lambda_t\le b λ t ≤ b and α ( t ) > 10 η / d \alpha^{(t)}>10\eta/d α ( t ) > 10 η / d . Since α ( t ) → + ∞ \alpha^{(t)}\to+\infty α ( t ) → + ∞ , there exists T b T_b T b such that, for all t ≥ T b t\ge T_b t ≥ T b ,
λ t ≤ b ⟹ ∣ λ t + 1 − λ t ∣ < b − a 9 . (90) \lambda_t\le b\quad\Longrightarrow\quad|\lambda_{t+1}-\lambda_t|<\frac{b-a}{9}. \tag*{(90)} λ t ≤ b ⟹ ∣ λ t + 1 − λ t ∣ < 9 b − a . (90)
Set
T ∗ : = max { T l ′ , T b } . T_*:=\max\{T'_l,T_b\}. T ∗ := max { T l ′ , T b } .
Consider any upcrossing ( u n , v n ) (u_n,v_n) ( u n , v n ) with u n ≥ T ∗ u_n\ge T_* u n ≥ T ∗ and v n < ∞ v_n<\infty v n < ∞ . Since
λ u n ≤ a < a I , λ v n ≥ b > b I , \lambda_{u_n}\le a<a_I,\qquad\lambda_{v_n}\ge b>b_I, λ u n ≤ a < a I , λ v n ≥ b > b I ,
and λ t < b \lambda_t<b λ t < b for every u n ≤ t < v n u_n\le t<v_n u n ≤ t < v n , define
r n : = max { t < v n : λ t < a I } . r_n:=\max\{t<v_n:\lambda_t<a_I\}. r n := max { t < v n : λ t < a I } .
This set is nonempty because u n ∈ { t < v n : λ t < a I } u_n\in\{t<v_n:\lambda_t<a_I\} u n ∈ { t < v n : λ t < a I } . Set
s n : = r n + 1. s_n:=r_n+1. s n := r n + 1.
Then λ s n ≥ a I \lambda_{s_n}\ge a_I λ s n ≥ a I by the maximality of r n r_n r n , and since λ r n < a I \lambda_{r_n}<a_I λ r n < a I and λ r n < b \lambda_{r_n}<b λ r n < b , (D.66) gives
λ s n = λ r n + 1 ≤ a I + b − a 9 . (91) \lambda_{s_n}=\lambda_{r_n+1}\le a_I+\frac{b-a}{9}. \tag*{(91)} λ s n = λ r n + 1 ≤ a I + 9 b − a . (91)
Now define
e n : = min { t ≥ s n : λ t > b I } . e_n:=\min\{t\ge s_n:\lambda_t>b_I\}. e n := min { t ≥ s n : λ t > b I } .
This index exists because v n v_n v n belongs to the set. By the minimality of e n e_n e n ,
λ t ≤ b I for all t = s n , … , e n − 1. \lambda_t\le b_I\qquad\text{for all }t=s_n,\ldots,e_n-1. λ t ≤ b I for all t = s n , … , e n − 1.
By the maximality of r n r_n r n ,
λ t ≥ a I for all t = s n , … , v n − 1. \lambda_t\ge a_I\qquad\text{for all }t=s_n,\ldots,v_n-1. λ t ≥ a I for all t = s n , … , v n − 1.
Hence
λ t ∈ I for all t = s n , … , e n − 1. (92) \lambda_t\in I\qquad\text{for all }t=s_n,\ldots,e_n-1. \tag*{(92)} λ t ∈ I for all t = s n , … , e n − 1. (92)
Since λ e n > b I \lambda_{e_n}>b_I λ e n > b I , (D.67) yields
λ e n − λ s n > b I − ( a I + b − a 9 ) = 2 ( b − a ) 9 . (93) \lambda_{e_n}-\lambda_{s_n}>b_I-\left(a_I+\frac{b-a}{9}\right)=\frac{2(b-a)}{9}. \tag*{(93)} λ e n − λ s n > b I − ( a I + 9 b − a ) = 9 2 ( b − a ) . (93)
On the other hand, by (D.68) and (D.62),
λ e n − λ s n = ∑ t = s n e n − 1 ( λ t + 1 − λ t ) ≤ d ˉ I ∑ t = s n e n − 1 1 ( α ( t ) ) 2 . \lambda_{e_n}-\lambda_{s_n}=\sum_{t=s_n}^{e_n-1}(\lambda_{t+1}-\lambda_t)\le\bar d_I\sum_{t=s_n}^{e_n-1}\frac{1}{(\alpha^{(t)})^2}. λ e n − λ s n = t = s n ∑ e n − 1 ( λ t + 1 − λ t ) ≤ d ˉ I t = s n ∑ e n − 1 ( α ( t ) ) 2 1 .
Combining with (D.69),
∑ t = s n e n − 1 1 ( α ( t ) ) 2 ≥ 2 ( b − a ) 9 d ˉ I . (94) \sum_{t=s_n}^{e_n-1}\frac{1}{(\alpha^{(t)})^2}\ge\frac{2(b-a)}{9\bar d_I}. \tag*{(94)} t = s n ∑ e n − 1 ( α ( t ) ) 2 1 ≥ 9 d ˉ I 2 ( b − a ) . (94)
Using (D.63),
L ( α ( s n ) , β ( s n ) ) − L ( α ( e n ) , β ( e n ) ) = ∑ t = s n e n − 1 ( L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ) ≥ δ I ∑ t = s n e n − 1 1 ( α ( t ) ) 2 . \mathcal{L}(\alpha^{(s_n)},\beta^{(s_n)})-\mathcal{L}(\alpha^{(e_n)},\beta^{(e_n)})=\sum_{t=s_n}^{e_n-1}\left(\mathcal{L}(\alpha^{(t)},\beta^{(t)})-\mathcal{L}(\alpha^{(t+1)},\beta^{(t+1)})\right)\ge\delta_I\sum_{t=s_n}^{e_n-1}\frac{1}{(\alpha^{(t)})^2}. L ( α ( s n ) , β ( s n ) ) − L ( α ( e n ) , β ( e n ) ) = t = s n ∑ e n − 1 ( L ( α ( t ) , β ( t ) ) − L ( α ( t + 1 ) , β ( t + 1 ) ) ) ≥ δ I t = s n ∑ e n − 1 ( α ( t ) ) 2 1 .
By (D.70),
L ( α ( s n ) , β ( s n ) ) − L ( α ( e n ) , β ( e n ) ) ≥ 2 δ I ( b − a ) 9 d ˉ I = : ε a , b > 0. (95) \mathcal{L}(\alpha^{(s_n)},\beta^{(s_n)})-\mathcal{L}(\alpha^{(e_n)},\beta^{(e_n)})\ge\frac{2\delta_I(b-a)}{9\bar d_I}=:\varepsilon_{a,b}>0. \tag*{(95)} L ( α ( s n ) , β ( s n ) ) − L ( α ( e n ) , β ( e n ) ) ≥ 9 d ˉ I 2 δ I ( b − a ) =: ε a , b > 0. (95)
Thus every sufficiently late upcrossing of [ a , b ] [a,b] [ a , b ] decreases the loss by at least ε a , b \varepsilon_{a,b} ε a , b . Since the intervals [ s n , e n ) [s_n,e_n) [ s n , e n ) corresponding to distinct upcrossings are disjoint and L ( α ( t ) , β ( t ) ) ≥ 0 \mathcal{L}(\alpha^{(t)},\beta^{(t)})\ge0 L ( α ( t ) , β ( t ) ) ≥ 0 for all t t t , there can be only finitely many such upcrossings.
Lemma D.38. There is no subsequence t k → ∞ t_k\to\infty t k → ∞ such that
λ t k → 0. \lambda_{t_k}\to0. λ t k → 0.
Proof. Assume, toward a contradiction, that λ t k → 0 \lambda_{t_k}\to0 λ t k → 0 . Since 1 − U π > 0 1-U_\pi>0 1 − U π > 0 almost surely, Lemma D.33 gives
a 0 ( α ( t k ) , β ( t k ) ) → 1 almost surely . a_0(\alpha^{(t_k)},\beta^{(t_k)})\to1 \quad\text{almost surely}. a 0 ( α ( t k ) , β ( t k ) ) → 1 almost surely .
Because
0 ≤ a 0 ( α ( t k ) , β ( t k ) ) 2 ≤ 1 , 0\le a_0(\alpha^{(t_k)},\beta^{(t_k)})^2\le1, 0 ≤ a 0 ( α ( t k ) , β ( t k ) ) 2 ≤ 1 ,
bounded convergence yields
E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] → 1. \mathbb{E}\left[a_0(\alpha^{(t_k)},\beta^{(t_k)})^2\right]\to1. E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] → 1.
By (D.22),
L ( α ( t k ) , β ( t k ) ) = 3 2 E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] + o ( 1 ) → 3 2 . \mathcal{L}(\alpha^{(t_k)},\beta^{(t_k)})=\frac{3}{2}\mathbb{E}\left[a_0(\alpha^{(t_k)},\beta^{(t_k)})^2\right]+o(1)\to\frac{3}{2}. L ( α ( t k ) , β ( t k ) ) = 2 3 E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] + o ( 1 ) → 2 3 .
On the other hand, L ( α ( t ) , β ( t ) ) \mathcal{L}(\alpha^{(t)},\beta^{(t)}) L ( α ( t ) , β ( t ) ) is nonincreasing along gradient descent, and the previously computed initial value satisfies L ( α ( 0 ) , β ( 0 ) ) < 1 \mathcal{L}(\alpha^{(0)},\beta^{(0)})<1 L ( α ( 0 ) , β ( 0 ) ) < 1 . Hence L ( α ( t ) , β ( t ) ) ≤ L ( α ( 0 ) , β ( 0 ) ) < 1 \mathcal{L}(\alpha^{(t)},\beta^{(t)})\le\mathcal{L}(\alpha^{(0)},\beta^{(0)})<1 L ( α ( t ) , β ( t ) ) ≤ L ( α ( 0 ) , β ( 0 ) ) < 1 for every t t t , a contradiction.
Theorem D.39. The gradient-descent trajectory satisfies
lim inf t → ∞ λ t ≥ 2. \liminf_{t\to\infty}\lambda_t\ge2. t → ∞ lim inf λ t ≥ 2.
Proof. By Lemma D.38 , 0 0 0 is not a subsequential limit of ( λ t ) (\lambda_t) ( λ t ) , hence
lim inf t → ∞ λ t > 0. \liminf_{t\to\infty} \lambda_t > 0. t → ∞ lim inf λ t > 0.
Assume, toward a contradiction, that
lim inf t → ∞ λ t < 2. \liminf_{t\to\infty} \lambda_t < 2. t → ∞ lim inf λ t < 2.
Choose numbers a , b a,b a , b such that
lim inf t → ∞ λ t < a < b < 2. (96) \liminf_{t\to\infty} \lambda_t < a < b < 2. \tag*{(96)} t → ∞ lim inf λ t < a < b < 2. (96)
By the definition of lim inf \liminf lim inf , there are infinitely many indices t t t such that
λ t ≤ a . (97) \lambda_t \le a. \tag*{(97)} λ t ≤ a . (97)
We claim that there are also infinitely many indices t t t such that
λ t ≥ b . (98) \lambda_t \ge b. \tag*{(98)} λ t ≥ b . (98)
If not, then there exists T 1 T_1 T 1 such that
λ t < b for all t ≥ T 1 . (99) \lambda_t < b \qquad\text{for all } t \ge T_1. \tag*{(99)} λ t < b for all t ≥ T 1 . (99)
By Lemma D.38 and λ t ≥ 0 \lambda_t \ge0 λ t ≥ 0 we have lim inf t → ∞ λ t > 0 \liminf_{t\to\infty}\lambda_t > 0 lim inf t → ∞ λ t > 0 , so there exists T 2 T_2 T 2 such that
λ t > 1 2 lim inf s → ∞ λ s for all t ≥ T 2 . (100) \lambda_t > \frac{1}{2}\liminf_{s\to\infty}\lambda_s \qquad\text{for all } t \ge T_2. \tag*{(100)} λ t > 2 1 s → ∞ lim inf λ s for all t ≥ T 2 . (100)
Combining (D.75) and (D.76),
λ t ∈ [ 1 2 lim inf s → ∞ λ s , b ] ⊂ ( 0 , 2 ) for all t ≥ max { T 1 , T 2 } , \lambda_t \in\left[\frac{1}{2}\liminf_{s\to\infty}\lambda_s,b\right] \subset(0,2) \qquad\text{for all } t \ge\max\{T_1,T_2\}, λ t ∈ [ 2 1 s → ∞ lim inf λ s , b ] ⊂ ( 0 , 2 ) for all t ≥ max { T 1 , T 2 } ,
contradicting Lemma D.36 . Thus (D.74) holds.
We now show that (D.73) and (D.74) imply infinitely many upcrossings of [ a , b ] [a,b] [ a , b ] . Since there are infinitely many times with λ t ≤ a \lambda_t \le a λ t ≤ a , set
u 1 : = inf { t ≥ 0 : λ t ≤ a } . u_1 := \inf\{t \ge0 : \lambda_t \le a\}. u 1 := inf { t ≥ 0 : λ t ≤ a } .
Because (D.74) gives arbitrarily late times with λ t ≥ b \lambda_t \ge b λ t ≥ b , the set { t > u 1 : λ t ≥ b } \{t > u_1 : \lambda_t \ge b\} { t > u 1 : λ t ≥ b } is nonempty, so
v 1 : = inf { t > u 1 : λ t ≥ b } v_1 := \inf\{t > u_1 : \lambda_t \ge b\} v 1 := inf { t > u 1 : λ t ≥ b }
is finite. Inductively, if v n v_n v n is finite, then (D.73) implies
u n + 1 : = inf { t > v n : λ t ≤ a } < ∞ , u_{n+1} := \inf\{t > v_n : \lambda_t \le a\} < \infty, u n + 1 := inf { t > v n : λ t ≤ a } < ∞ ,
and (D.74) implies
v n + 1 : = inf { t > u n + 1 : λ t ≥ b } < ∞ . v_{n+1} := \inf\{t > u_{n+1} : \lambda_t \ge b\} < \infty. v n + 1 := inf { t > u n + 1 : λ t ≥ b } < ∞.
Hence ( λ t ) (\lambda_t) ( λ t ) has infinitely many upcrossings of [ a , b ] [a,b] [ a , b ] , contradicting Theorem D.37 . Therefore
lim inf t → ∞ λ t ≥ 2. \liminf_{t\to\infty}\lambda_t \ge2. t → ∞ lim inf λ t ≥ 2.
We next complement Theorem D.39 with the matching upper bound
lim sup t → ∞ λ t ≤ 2. \limsup_{t\to\infty}\lambda_t \le2. t → ∞ lim sup λ t ≤ 2.
To this end, we analyze the exterior regime λ t > 2 \lambda_t > 2 λ t > 2 . The key point is that in this regime the self-token contribution is exponentially small, whereas the context-softmax sharpening term in ∂ α L \partial_\alpha\mathcal{L} ∂ α L remains polynomially large and strictly negative, which yields a genuine downward drift for λ t \lambda_t λ t .
Fix a sample ( D , x q , ω ) (\mathcal{D},\boldsymbol{x}_q,\omega) ( D , x q , ω ) , and recall the notation
U i : = x i T x q , π : = arg max 1 ≤ i ≤ N U i . U_i := \boldsymbol{x}_i^{\mathsf T}\boldsymbol{x}_q,\qquad\pi:= \underset{1\le i\le N}{\arg\max}\ U_i. U i := x i T x q , π := 1 ≤ i ≤ N arg max U i .
b i ( α ) : = e α U i ∑ j = 1 N e α U j , Q ( α ) : = ∑ i = 1 N b i ( α ) 2 , μ ( α ) : = ∑ i = 1 N b i ( α ) U i . b_i(\alpha) := \frac{e^{\alpha U_i}}{\sum_{j=1}^{N}e^{\alpha U_j}},\qquad Q(\alpha) := \sum_{i=1}^{N}b_i(\alpha)^2,\qquad\mu(\alpha) := \sum_{i=1}^{N}b_i(\alpha)U_i. b i ( α ) := ∑ j = 1 N e α U j e α U i , Q ( α ) := i = 1 ∑ N b i ( α ) 2 , μ ( α ) := i = 1 ∑ N b i ( α ) U i .
Lemma D.40. With the notation above, we have
U π − μ ( α ) = b π ( α ) ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) , U_\pi-\mu(\alpha)=b_\pi(\alpha)\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha(U_\pi-U_j)}, U π − μ ( α ) = b π ( α ) j = π ∑ ( U π − U j ) e − α ( U π − U j ) , ∂ α b π ( α ) = b π ( α ) 2 ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) , \partial_\alpha b_\pi(\alpha)=b_\pi(\alpha)^2\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha(U_\pi-U_j)}, ∂ α b π ( α ) = b π ( α ) 2 j = π ∑ ( U π − U j ) e − α ( U π − U j ) , Q ( α ) = b π ( α ) 2 ( 1 + ∑ j ≠ π e − 2 α ( U π − U j ) ) , Q(\alpha)=b_\pi(\alpha)^2\left(1+\sum_{j\ne\pi}e^{-2\alpha(U_\pi-U_j)}\right), Q ( α ) = b π ( α ) 2 1 + j = π ∑ e − 2 α ( U π − U j ) , and
Q ′ ( α ) − 2 ∂ α b π ( α ) = − 2 b π ( α ) 2 ( ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) ) + b π ( α ) ( ∑ j ≠ π ( e − α ( U π − U j ) − e − 2 α ( U π − U j ) ) ) ( ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) ) . \begin{aligned}
Q'(\alpha)-2\partial_\alpha b_\pi(\alpha)
={}&-2b_\pi(\alpha)^2\left(\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}\right)\\
&+b_\pi(\alpha)\left(\sum_{j\ne\pi}\left(e^{-\alpha(U_\pi-U_j)}-e^{-2\alpha(U_\pi-U_j)}\right)\right)
\left(\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha(U_\pi-U_j)}\right).
\end{aligned} Q ′ ( α ) − 2 ∂ α b π ( α ) = − 2 b π ( α ) 2 j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) + b π ( α ) j = π ∑ ( e − α ( U π − U j ) − e − 2 α ( U π − U j ) ) j = π ∑ ( U π − U j ) e − α ( U π − U j ) . In particular,
Q ′ ( α ) − 2 ∂ α b π ( α ) ≤ − 2 b π ( α ) 2 ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) ≤ − 2 N 2 ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) . (101) Q'(\alpha)-2\partial_\alpha b_\pi(\alpha)
\le-2b_\pi(\alpha)^2\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}
\le-\frac{2}{N^2}\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}. \tag*{(101)} Q ′ ( α ) − 2 ∂ α b π ( α ) ≤ − 2 b π ( α ) 2 j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) ≤ − N 2 2 j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) . (101)
Proof. For j ≠ π j\ne\pi j = π ,
b j ( α ) = b π ( α ) e − α ( U π − U j ) . b_j(\alpha)=b_\pi(\alpha)e^{-\alpha(U_\pi-U_j)}. b j ( α ) = b π ( α ) e − α ( U π − U j ) .
Hence
μ ( α ) = b π ( α ) U π + ∑ j ≠ π b π ( α ) e − α ( U π − U j ) U j = U π − b π ( α ) ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) . \mu(\alpha)=b_{\pi}(\alpha)U_{\pi}+\sum_{j\ne\pi}b_{\pi}(\alpha)e^{-\alpha(U_{\pi}-U_j)}U_j
=U_{\pi}-b_{\pi}(\alpha)\sum_{j\ne\pi}(U_{\pi}-U_j)e^{-\alpha(U_{\pi}-U_j)}. μ ( α ) = b π ( α ) U π + j = π ∑ b π ( α ) e − α ( U π − U j ) U j = U π − b π ( α ) j = π ∑ ( U π − U j ) e − α ( U π − U j ) .
which gives
U π − μ ( α ) = b π ( α ) ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) . U_{\pi}-\mu(\alpha)=b_{\pi}(\alpha)\sum_{j\ne\pi}(U_{\pi}-U_j)e^{-\alpha(U_{\pi}-U_j)}. U π − μ ( α ) = b π ( α ) j = π ∑ ( U π − U j ) e − α ( U π − U j ) .
Therefore
∂ α b π ( α ) = b π ( α ) ( U π − μ ( α ) ) = b π ( α ) 2 ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) . \partial_{\alpha}b_{\pi}(\alpha)=b_{\pi}(\alpha)(U_{\pi}-\mu(\alpha))
=b_{\pi}(\alpha)^2\sum_{j\ne\pi}(U_{\pi}-U_j)e^{-\alpha(U_{\pi}-U_j)}. ∂ α b π ( α ) = b π ( α ) ( U π − μ ( α )) = b π ( α ) 2 j = π ∑ ( U π − U j ) e − α ( U π − U j ) .
Next,
Q ( α ) = b π ( α ) 2 + ∑ j ≠ π b π ( α ) 2 e − 2 α ( U π − U j ) = b π ( α ) 2 ( 1 + ∑ j ≠ π e − 2 α ( U π − U j ) ) . Q(\alpha)=b_{\pi}(\alpha)^2+\sum_{j\ne\pi}b_{\pi}(\alpha)^2e^{-2\alpha(U_{\pi}-U_j)}
=b_{\pi}(\alpha)^2\left(1+\sum_{j\ne\pi}e^{-2\alpha(U_{\pi}-U_j)}\right). Q ( α ) = b π ( α ) 2 + j = π ∑ b π ( α ) 2 e − 2 α ( U π − U j ) = b π ( α ) 2 1 + j = π ∑ e − 2 α ( U π − U j ) .
For Q ′ ( α ) Q'(\alpha) Q ′ ( α ) , using
Q ′ ( α ) = 2 ∑ i = 1 N b i ( α ) 2 ( U i − μ ( α ) ) , Q'(\alpha)=2\sum_{i=1}^{N}b_i(\alpha)^2(U_i-\mu(\alpha)), Q ′ ( α ) = 2 i = 1 ∑ N b i ( α ) 2 ( U i − μ ( α )) ,
we obtain
Q ′ ( α ) = 2 b π ( α ) 2 ( U π − μ ( α ) ) + 2 ∑ j ≠ π b π ( α ) 2 e − 2 α ( U π − U j ) ( U j − μ ( α ) ) = 2 b π ( α ) 3 ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) + 2 b π ( α ) 2 ∑ j ≠ π e − 2 α ( U π − U j ) ( b π ( α ) ∑ ℓ ≠ π ( U π − U ℓ ) e − α ( U π − U ℓ ) − ( U π − U j ) ) . \begin{aligned}
Q'(\alpha)
&=2b_{\pi}(\alpha)^2(U_{\pi}-\mu(\alpha))
+2\sum_{j\ne\pi}b_{\pi}(\alpha)^2e^{-2\alpha(U_{\pi}-U_j)}(U_j-\mu(\alpha))\\
&=2b_{\pi}(\alpha)^3\sum_{j\ne\pi}(U_{\pi}-U_j)e^{-\alpha(U_{\pi}-U_j)}\\
&\quad+2b_{\pi}(\alpha)^2\sum_{j\ne\pi}e^{-2\alpha(U_{\pi}-U_j)}
\left(b_{\pi}(\alpha)\sum_{\ell\ne\pi}(U_{\pi}-U_{\ell})e^{-\alpha(U_{\pi}-U_{\ell})}-(U_{\pi}-U_j)\right).
\end{aligned} Q ′ ( α ) = 2 b π ( α ) 2 ( U π − μ ( α )) + 2 j = π ∑ b π ( α ) 2 e − 2 α ( U π − U j ) ( U j − μ ( α )) = 2 b π ( α ) 3 j = π ∑ ( U π − U j ) e − α ( U π − U j ) + 2 b π ( α ) 2 j = π ∑ e − 2 α ( U π − U j ) b π ( α ) ℓ = π ∑ ( U π − U ℓ ) e − α ( U π − U ℓ ) − ( U π − U j ) .
Subtracting 2 ∂ α b π ( α ) 2\partial_{\alpha}b_{\pi}(\alpha) 2 ∂ α b π ( α ) , we get
Q ′ ( α ) − 2 ∂ α b π ( α ) = 2 b π ( α ) 2 ( ( b π ( α ) ( 1 + ∑ j ≠ π e − 2 α ( U π − U j ) ) − 1 ) ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) − ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) ) . \begin{aligned}
Q'(\alpha)-2\partial_{\alpha}b_{\pi}(\alpha)
&=2b_{\pi}(\alpha)^2\left(\left(b_{\pi}(\alpha)\left(1+\sum_{j\ne\pi}e^{-2\alpha(U_{\pi}-U_j)}\right)-1\right)\sum_{j\ne\pi}(U_{\pi}-U_j)e^{-\alpha(U_{\pi}-U_j)}\right.\\
&\qquad\left.-\sum_{j\ne\pi}(U_{\pi}-U_j)e^{-2\alpha(U_{\pi}-U_j)}\right).
\end{aligned} Q ′ ( α ) − 2 ∂ α b π ( α ) = 2 b π ( α ) 2 b π ( α ) 1 + j = π ∑ e − 2 α ( U π − U j ) − 1 j = π ∑ ( U π − U j ) e − α ( U π − U j ) − j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) .
Since
b π ( α ) ( 1 + ∑ j ≠ π e − 2 α ( U π − U j ) ) − 1 = − b π ( α ) ∑ j ≠ π ( e − α ( U π − U j ) − e − 2 α ( U π − U j ) ) , b_{\pi}(\alpha)\left(1+\sum_{j\ne\pi}e^{-2\alpha(U_{\pi}-U_j)}\right)-1
=-b_{\pi}(\alpha)\sum_{j\ne\pi}\left(e^{-\alpha(U_{\pi}-U_j)}-e^{-2\alpha(U_{\pi}-U_j)}\right), b π ( α ) 1 + j = π ∑ e − 2 α ( U π − U j ) − 1 = − b π ( α ) j = π ∑ ( e − α ( U π − U j ) − e − 2 α ( U π − U j ) ) ,
we obtain the displayed identity. Because b π ( α ) ≥ 1 / N b_{\pi}(\alpha)\ge1/N b π ( α ) ≥ 1/ N , (D.77) follows. □
Lemma D.41. There exist constants c 0 > 0 c_0>0 c 0 > 0 , A 0 ≥ 1 A_0\ge1 A 0 ≥ 1 , depending only on N N N and d d d , such that for
every α ≥ A 0 \alpha\ge A_0 α ≥ A 0 ,
E [ ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) ] ≥ c 0 α − d . \mathbb{E}\left[\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}\right]\ge c_0\alpha^{-d}. E j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) ≥ c 0 α − d .
Proof. Let
a : = d − 1 2 . a:=\frac{d-1}{2}. a := 2 d − 1 .
Since
f d ( u ) = κ d ( 1 − u 2 ) ( d − 3 ) / 2 1 ( − 1 , 1 ) , f_d(u)=\kappa_d(1-u^2)^{(d-3)/2}\mathbf{1}_{(-1,1)}, f d ( u ) = κ d ( 1 − u 2 ) ( d − 3 ) /2 1 ( − 1 , 1 ) ,
we have, as s ↓ 0 s\downarrow0 s ↓ 0 ,
f d ( 1 − s ) ≍ s a − 1 . f_d(1-s)\asymp s^{a-1}. f d ( 1 − s ) ≍ s a − 1 .
Hence there exist constants c 1 , c 2 > 0 c_1,c_2>0 c 1 , c 2 > 0 and s 0 ∈ ( 0 , 1 ) s_0\in(0,1) s 0 ∈ ( 0 , 1 ) such that for every 0 < s ≤ s 0 0<s\le s_0 0 < s ≤ s 0 ,
P ( U 1 ∈ [ 1 − s , 1 ] ) ≥ c 1 s a , P ( U 1 ∈ [ 1 − 3 s 8 , 1 − s 4 ] ) ≥ c 2 s a . (102) \mathbb{P}\left(U_1\in[1-s,1]\right)\ge c_1s^a,\qquad
\mathbb{P}\left(U_1\in\left[1-\frac{3s}{8},1-\frac{s}{4}\right]\right)\ge c_2s^a. \tag*{(102)} P ( U 1 ∈ [ 1 − s , 1 ] ) ≥ c 1 s a , P ( U 1 ∈ [ 1 − 8 3 s , 1 − 4 s ] ) ≥ c 2 s a . (102)
Fix α \alpha α so large that 1 / ( 2 α ) ≤ s 0 1/(2\alpha)\le s_0 1/ ( 2 α ) ≤ s 0 . Define the event
E α : = { U 1 ∈ [ 1 − 1 8 α , 1 ] , U 2 ∈ [ 1 − 3 8 α , 1 − 1 4 α ] , U j ≤ 1 − 1 2 α ∀ j ≥ 3 } . E_\alpha:=\left\{U_1\in\left[1-\frac{1}{8\alpha},1\right],\ U_2\in\left[1-\frac{3}{8\alpha},1-\frac{1}{4\alpha}\right],\ U_j\le1-\frac{1}{2\alpha}\ \forall j\ge3\right\}. E α := { U 1 ∈ [ 1 − 8 α 1 , 1 ] , U 2 ∈ [ 1 − 8 α 3 , 1 − 4 α 1 ] , U j ≤ 1 − 2 α 1 ∀ j ≥ 3 } .
On E α E_\alpha E α , we have
U 1 > U 2 > U j ( j ≥ 3 ) , U_1>U_2>U_j\qquad(j\ge3), U 1 > U 2 > U j ( j ≥ 3 ) ,
hence π = 1 \pi=1 π = 1 , and
U π − U 2 = U 1 − U 2 ∈ [ 1 8 α , 3 8 α ] . U_\pi-U_2=U_1-U_2\in\left[\frac{1}{8\alpha},\frac{3}{8\alpha}\right]. U π − U 2 = U 1 − U 2 ∈ [ 8 α 1 , 8 α 3 ] .
Therefore
∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) ≥ ( U π − U 2 ) e − 2 α ( U π − U 2 ) ≥ 1 8 α e − 3 / 4 on E α . (103) \sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}
\ge(U_\pi-U_2)e^{-2\alpha(U_\pi-U_2)}
\ge\frac{1}{8\alpha}e^{-3/4}
\quad\text{on }E_\alpha. \tag*{(103)} j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) ≥ ( U π − U 2 ) e − 2 α ( U π − U 2 ) ≥ 8 α 1 e − 3/4 on E α . (103)
By independence and (D.78),
P ( E α ) = P ( U 1 ∈ [ 1 − 1 8 α , 1 ] ) P ( U 2 ∈ [ 1 − 3 8 α , 1 − 1 4 α ] ) P ( U 3 ≤ 1 − 1 2 α ) N − 2 . \mathbb{P}(E_\alpha)=\mathbb{P}\left(U_1\in\left[1-\frac{1}{8\alpha},1\right]\right)
\mathbb{P}\left(U_2\in\left[1-\frac{3}{8\alpha},1-\frac{1}{4\alpha}\right]\right)
\mathbb{P}\left(U_3\le1-\frac{1}{2\alpha}\right)^{N-2}. P ( E α ) = P ( U 1 ∈ [ 1 − 8 α 1 , 1 ] ) P ( U 2 ∈ [ 1 − 8 α 3 , 1 − 4 α 1 ] ) P ( U 3 ≤ 1 − 2 α 1 ) N − 2 .
The first two factors are bounded below by c α − a c\alpha^{-a} c α − a , while the third factor tends to 1 as α → ∞ \alpha\to\infty α → ∞ . Thus there exist c 3 > 0 c_3>0 c 3 > 0 and A 0 ≥ 1 A_0\ge1 A 0 ≥ 1 such that
P ( E α ) ≥ c 3 α − 2 a = c 3 α − ( d − 1 ) ( α ≥ A 0 ) . (104) \mathbb{P}(E_\alpha)\ge c_3\alpha^{-2a}=c_3\alpha^{-(d-1)}
\qquad(\alpha\ge A_0). \tag*{(104)} P ( E α ) ≥ c 3 α − 2 a = c 3 α − ( d − 1 ) ( α ≥ A 0 ) . (104)
Combining (D.79) and (D.80),
E [ ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) ] ≥ 1 8 α e − 3 / 4 P ( E α ) ≥ c 0 α − d \mathbb{E}\left[\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}\right]
\ge\frac{1}{8\alpha}e^{-3/4}\mathbb{P}(E_\alpha)\ge c_0\alpha^{-d} E j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) ≥ 8 α 1 e − 3/4 P ( E α ) ≥ c 0 α − d
for a suitable constant c 0 > 0 c_0 > 0 c 0 > 0 .
Lemma D.42. Fix ε > 0 \varepsilon> 0 ε > 0 . There exist constants A ε ≥ 1 A_\varepsilon\ge1 A ε ≥ 1 , c ε > 0 c_\varepsilon> 0 c ε > 0 , C ε > 0 C_\varepsilon> 0 C ε > 0 , depending only on ε \varepsilon ε , N N N , d d d , such that whenever
α ≥ A ε , λ : = − β α ≥ 2 + ε , \alpha\ge A_\varepsilon,\qquad\lambda:= -\frac{\beta}{\alpha} \ge2+\varepsilon, α ≥ A ε , λ := − α β ≥ 2 + ε , we have
0 ≤ ∂ β L ( α , β ) ≤ C ε e − ε α , 0 \le\partial_\beta L(\alpha,\beta) \le C_\varepsilon e^{-\varepsilon\alpha}, 0 ≤ ∂ β L ( α , β ) ≤ C ε e − ε α , ∂ α L ( α , β ) ≤ − c ε α − d , \partial_\alpha L(\alpha,\beta) \le-c_\varepsilon\alpha^{-d}, ∂ α L ( α , β ) ≤ − c ε α − d , and hence
1 N + 1 ∂ β L ( α , β ) + λ d ∂ α L ( α , β ) ≤ − c ε α − d . \frac{1}{N+1}\partial_\beta L(\alpha,\beta)+\frac{\lambda}{d}\partial_\alpha L(\alpha,\beta) \le-c_\varepsilon\alpha^{-d}. N + 1 1 ∂ β L ( α , β ) + d λ ∂ α L ( α , β ) ≤ − c ε α − d .
Proof. Fix a sample. Write
B : = a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β ) ) Q ( α ) . \mathcal{B}:=a_0(\alpha,\beta)+2b_\pi(\alpha)-2(1-a_0(\alpha,\beta))Q(\alpha). B := a 0 ( α , β ) + 2 b π ( α ) − 2 ( 1 − a 0 ( α , β )) Q ( α ) .
Since
b π ( α ) ≥ Q ( α ) ≥ 0 , b_\pi(\alpha)\ge Q(\alpha)\ge0, b π ( α ) ≥ Q ( α ) ≥ 0 ,
one may rewrite
B = a 0 ( α , β ) + 2 ( b π ( α ) − Q ( α ) ) + 2 a 0 ( α , β ) Q ( α ) , \mathcal{B}=a_0(\alpha,\beta)+2\bigl(b_\pi(\alpha)-Q(\alpha)\bigr)+2a_0(\alpha,\beta)Q(\alpha), B = a 0 ( α , β ) + 2 ( b π ( α ) − Q ( α ) ) + 2 a 0 ( α , β ) Q ( α ) ,
hence B ≥ 0 \mathcal{B}\ge0 B ≥ 0 . Also b π ( α ) , Q ( α ) ≤ 1 b_\pi(\alpha),Q(\alpha)\le1 b π ( α ) , Q ( α ) ≤ 1 , so
B ≤ a 0 ( α , β ) + 2 + 2 a 0 ( α , β ) ≤ 5. (105) \mathcal{B}\le a_0(\alpha,\beta)+2+2a_0(\alpha,\beta)\le5. \tag*{(105)} B ≤ a 0 ( α , β ) + 2 + 2 a 0 ( α , β ) ≤ 5. (105)
If λ ≥ 2 + ε \lambda\ge2+\varepsilon λ ≥ 2 + ε , then for every sample
λ − ( 1 − U i ) ≥ λ − 2 ≥ ε for all i ∈ [ N ] , \lambda-(1-U_i)\ge\lambda-2\ge\varepsilon\qquad\text{for all }i\in[N], λ − ( 1 − U i ) ≥ λ − 2 ≥ ε for all i ∈ [ N ] ,
hence
a 0 ( α , β ) = ( 1 + ∑ i = 1 N e α ( λ − ( 1 − U i ) ) ) − 1 ≤ e − ε α . (106) a_0(\alpha,\beta)=\left(1+\sum_{i=1}^{N}e^{\alpha(\lambda-(1-U_i))}\right)^{-1}\le e^{-\varepsilon\alpha}. \tag*{(106)} a 0 ( α , β ) = ( 1 + i = 1 ∑ N e α ( λ − ( 1 − U i )) ) − 1 ≤ e − ε α . (106)
Using the exact sample formula
∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) B , \partial_\beta\varphi=a_0(\alpha,\beta)(1-a_0(\alpha,\beta))\mathcal{B}, ∂ β φ = a 0 ( α , β ) ( 1 − a 0 ( α , β )) B ,
together with (D.81) and (D.82),
0 ≤ ∂ β φ ≤ 5 e − ε α . 0\le\partial_\beta\varphi\le5e^{-\varepsilon\alpha}. 0 ≤ ∂ β φ ≤ 5 e − ε α .
Taking expectations gives
0 ≤ ∂ β L ( α , β ) ≤ 5 e − ε α . (107) 0\le\partial_\beta L(\alpha,\beta)\le5e^{-\varepsilon\alpha}. \tag*{(107)} 0 ≤ ∂ β L ( α , β ) ≤ 5 e − ε α . (107)
For ∂ α φ \partial_\alpha\varphi ∂ α φ , the exact formula is
∂ α φ = a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) B + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β ) ) ∂ α b π ( α ) . \partial_\alpha\varphi=a_0(\alpha,\beta)(1-a_0(\alpha,\beta))(1-\mu(\alpha))\mathcal{B}+(1-a_0(\alpha,\beta))^2Q'(\alpha)-2(1-a_0(\alpha,\beta))\partial_\alpha b_\pi(\alpha). ∂ α φ = a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( 1 − μ ( α )) B + ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β )) ∂ α b π ( α ) .
The first term is nonnegative, and using 1 − μ ( α ) ≤ 2 1-\mu(\alpha)\le2 1 − μ ( α ) ≤ 2 , (D.81), and (D.82),
0 ≤ a 0 ( α , β ) ( 1 − a 0 ( α , β ) ) ( 1 − μ ( α ) ) B ≤ 10 e − ε α . (108) 0\le a_0(\alpha,\beta)(1-a_0(\alpha,\beta))(1-\mu(\alpha))B\le10e^{-\varepsilon\alpha}. \tag*{(108)} 0 ≤ a 0 ( α , β ) ( 1 − a 0 ( α , β )) ( 1 − μ ( α )) B ≤ 10 e − ε α . (108)
For the second part,
( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β ) ) ∂ α b π ( α ) = ( Q ′ ( α ) − 2 ∂ α b π ( α ) ) + ( ( 1 − a 0 ( α , β ) ) 2 − 1 ) Q ′ ( α ) + 2 a 0 ( α , β ) ∂ α b π ( α ) ≤ ( Q ′ ( α ) − 2 ∂ α b π ( α ) ) + 2 a 0 ( α , β ) ∣ Q ′ ( α ) ∣ + 2 a 0 ( α , β ) ∂ α b π ( α ) . \begin{aligned}
(1-a_0(\alpha,\beta))^2Q'(\alpha)-2(1-a_0(\alpha,\beta))\partial_\alpha b_\pi(\alpha)
&=(Q'(\alpha)-2\partial_\alpha b_\pi(\alpha))+((1-a_0(\alpha,\beta))^2-1)Q'(\alpha)+2a_0(\alpha,\beta)\partial_\alpha b_\pi(\alpha)\\
&\le(Q'(\alpha)-2\partial_\alpha b_\pi(\alpha))+2a_0(\alpha,\beta)|Q'(\alpha)|+2a_0(\alpha,\beta)\partial_\alpha b_\pi(\alpha).
\end{aligned} ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β )) ∂ α b π ( α ) = ( Q ′ ( α ) − 2 ∂ α b π ( α )) + (( 1 − a 0 ( α , β ) ) 2 − 1 ) Q ′ ( α ) + 2 a 0 ( α , β ) ∂ α b π ( α ) ≤ ( Q ′ ( α ) − 2 ∂ α b π ( α )) + 2 a 0 ( α , β ) ∣ Q ′ ( α ) ∣ + 2 a 0 ( α , β ) ∂ α b π ( α ) .
Using the earlier deterministic bounds
∣ Q ′ ( α ) ∣ ≤ 4 ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) , ∂ α b π ( α ) ≤ ∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) , |Q'(\alpha)|\le4\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha(U_\pi-U_j)},\qquad\partial_\alpha b_\pi(\alpha)\le\sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha(U_\pi-U_j)}, ∣ Q ′ ( α ) ∣ ≤ 4 j = π ∑ ( U π − U j ) e − α ( U π − U j ) , ∂ α b π ( α ) ≤ j = π ∑ ( U π − U j ) e − α ( U π − U j ) ,
and
x e − α x ≤ 1 e α ( x ≥ 0 ) , xe^{-\alpha x}\le\frac{1}{e\alpha}\qquad(x\ge0), x e − α x ≤ e α 1 ( x ≥ 0 ) ,
we have
∑ j ≠ π ( U π − U j ) e − α ( U π − U j ) ≤ N − 1 e α . \sum_{j\ne\pi}(U_\pi-U_j)e^{-\alpha(U_\pi-U_j)}\le\frac{N-1}{e\alpha}. j = π ∑ ( U π − U j ) e − α ( U π − U j ) ≤ e α N − 1 .
Therefore
( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β ) ) ∂ α b π ( α ) ≤ ( Q ′ ( α ) − 2 ∂ α b π ( α ) ) + 10 ( N − 1 ) e α e − ε α . (109) (1-a_0(\alpha,\beta))^2Q'(\alpha)-2(1-a_0(\alpha,\beta))\partial_\alpha b_\pi(\alpha)\le(Q'(\alpha)-2\partial_\alpha b_\pi(\alpha))+\frac{10(N-1)}{e\alpha}e^{-\varepsilon\alpha}. \tag*{(109)} ( 1 − a 0 ( α , β ) ) 2 Q ′ ( α ) − 2 ( 1 − a 0 ( α , β )) ∂ α b π ( α ) ≤ ( Q ′ ( α ) − 2 ∂ α b π ( α )) + e α 10 ( N − 1 ) e − ε α . (109)
Now apply Lemma D.40 :
Q ′ ( α ) − 2 ∂ α b π ( α ) ≤ − 2 N 2 ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) . (110) Q'(\alpha)-2\partial_\alpha b_\pi(\alpha)\le-\frac{2}{N^2}\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}. \tag*{(110)} Q ′ ( α ) − 2 ∂ α b π ( α ) ≤ − N 2 2 j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) . (110)
Combining (D.84), (D.85), and (D.86),
∂ α φ ≤ 10 e − ε α + 10 ( N − 1 ) e α e − ε α − 2 N 2 ∑ j ≠ π ( U π − U j ) e − 2 α ( U π − U j ) . \partial_\alpha\varphi\le10e^{-\varepsilon\alpha}+\frac{10(N-1)}{e\alpha}e^{-\varepsilon\alpha}-\frac{2}{N^2}\sum_{j\ne\pi}(U_\pi-U_j)e^{-2\alpha(U_\pi-U_j)}. ∂ α φ ≤ 10 e − ε α + e α 10 ( N − 1 ) e − ε α − N 2 2 j = π ∑ ( U π − U j ) e − 2 α ( U π − U j ) .
Taking expectations and using Lemma D.41 ,
∂ α L ( α , β ) ≤ 10 e − ε α + 10 ( N − 1 ) e α e − ε α − 2 c 0 N 2 α − d . \partial_\alpha\mathcal{L}(\alpha,\beta)\le10e^{-\varepsilon\alpha}+\frac{10(N-1)}{e\alpha}e^{-\varepsilon\alpha}-\frac{2c_0}{N^2}\alpha^{-d}. ∂ α L ( α , β ) ≤ 10 e − ε α + e α 10 ( N − 1 ) e − ε α − N 2 2 c 0 α − d .
Since the first two terms are exponentially small while the last term is polynomial, there exist A ε ≥ A 0 A_\varepsilon\ge A_0 A ε ≥ A 0 and c ε > 0 c_\varepsilon>0 c ε > 0 such that
∂ α L ( α , β ) ≤ − c ε α − d ( α ≥ A ε , λ ≥ 2 + ε ) . (111) \partial_\alpha\mathcal{L}(\alpha,\beta)\le-c_\varepsilon\alpha^{-d}\qquad(\alpha\ge A_\varepsilon,\ \lambda\ge2+\varepsilon). \tag*{(111)} ∂ α L ( α , β ) ≤ − c ε α − d ( α ≥ A ε , λ ≥ 2 + ε ) . (111)
Finally, combining (D.83) and (D.87), for λ ≥ 2 + ε \lambda\ge2+\varepsilon λ ≥ 2 + ε we have
1 N + 1 ∂ β L ( α , β ) + λ d ∂ α L ( α , β ) ≤ 5 N + 1 e − ε α − ( 2 + ε ) c ε d α − d . \frac{1}{N+1}\partial_\beta\mathcal{L}(\alpha,\beta)+\frac{\lambda}{d}\partial_\alpha\mathcal{L}(\alpha,\beta)\le\frac{5}{N+1}e^{-\varepsilon\alpha}-\frac{(2+\varepsilon)c_\varepsilon}{d}\alpha^{-d}. N + 1 1 ∂ β L ( α , β ) + d λ ∂ α L ( α , β ) ≤ N + 1 5 e − ε α − d ( 2 + ε ) c ε α − d .
Since the exponential term is negligible compared with α − d \alpha^{-d} α − d , by increasing A ε A_{\varepsilon} A ε and decreasing c ε c_{\varepsilon} c ε if necessary, we obtain
1 N + 1 ∂ β L ( α , β ) + λ d ∂ α L ( α , β ) ≤ − c ε α − d \frac{1}{N+1}\partial_{\beta}\mathcal{L}(\alpha,\beta)+\frac{\lambda}{d}\partial_{\alpha}\mathcal{L}(\alpha,\beta)\le-c_{\varepsilon}\alpha^{-d} N + 1 1 ∂ β L ( α , β ) + d λ ∂ α L ( α , β ) ≤ − c ε α − d
for all α ≥ A ε \alpha\ge A_{\varepsilon} α ≥ A ε and λ ≥ 2 + ε \lambda\ge2+\varepsilon λ ≥ 2 + ε .
Theorem D.43. Along the gradient-descent trajectory,
lim sup t → ∞ λ t ≤ 2. \limsup_{t\to\infty}\lambda_t\le2. t → ∞ lim sup λ t ≤ 2. Consequently,
λ t → 2 as t → ∞ . \lambda_t\to2 \qquad\text{as }t\to\infty. λ t → 2 as t → ∞. Proof. We already know that
α t → + ∞ , lim inf t → ∞ λ t ≥ 2 , \alpha_t\to+\infty,\qquad\liminf_{t\to\infty}\lambda_t\ge2, α t → + ∞ , t → ∞ lim inf λ t ≥ 2 , and that the exact λ \lambda λ -recursion is
λ t + 1 − λ t = η ( 1 N + 1 ∂ β L ( α t , β t ) + λ t d ∂ α L ( α t , β t ) ) α t − η d ∂ α L ( α t , β t ) . (112) \lambda_{t+1}-\lambda_t=
\frac{\eta\left(\frac{1}{N+1}\partial_{\beta}\mathcal{L}(\alpha_t,\beta_t)+\frac{\lambda_t}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\right)}
{\alpha_t-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)}. \tag*{(112)} λ t + 1 − λ t = α t − d η ∂ α L ( α t , β t ) η ( N + 1 1 ∂ β L ( α t , β t ) + d λ t ∂ α L ( α t , β t ) ) . (112) We also use the previously proved global gradient bounds
∣ ∂ α L ( α , β ) ∣ ≤ 10 , ∣ ∂ β L ( α , β ) ∣ ≤ 10 for all ( α , β ) , (113) |\partial_{\alpha}\mathcal{L}(\alpha,\beta)|\le10,\qquad|\partial_{\beta}\mathcal{L}(\alpha,\beta)|\le10\qquad\text{for all }(\alpha,\beta), \tag*{(113)} ∣ ∂ α L ( α , β ) ∣ ≤ 10 , ∣ ∂ β L ( α , β ) ∣ ≤ 10 for all ( α , β ) , (113) and the previously established exterior gradient bounds: for every δ > 0 \delta>0 δ > 0 , there exist constants
A δ ≥ 1 , c δ > 0 , C δ > 0 A_{\delta}\ge1,\qquad c_{\delta}>0,\qquad C_{\delta}>0 A δ ≥ 1 , c δ > 0 , C δ > 0 such that whenever
α ≥ A δ , λ : = − β α ≥ 2 + δ , \alpha\ge A_{\delta},\qquad\lambda:=-\frac{\beta}{\alpha}\ge2+\delta, α ≥ A δ , λ := − α β ≥ 2 + δ , we have
0 ≤ ∂ β L ( α , β ) ≤ C δ e − δ α , ∂ α L ( α , β ) ≤ − c δ α − d , 1 N + 1 ∂ β L ( α , β ) + λ d ∂ α L ( α , β ) ≤ − c δ α − d . (114) 0\le\partial_{\beta}\mathcal{L}(\alpha,\beta)\le C_{\delta}e^{-\delta\alpha},\qquad
\partial_{\alpha}\mathcal{L}(\alpha,\beta)\le-c_{\delta}\alpha^{-d},\qquad
\frac{1}{N+1}\partial_{\beta}\mathcal{L}(\alpha,\beta)+\frac{\lambda}{d}\partial_{\alpha}\mathcal{L}(\alpha,\beta)\le-c_{\delta}\alpha^{-d}. \tag*{(114)} 0 ≤ ∂ β L ( α , β ) ≤ C δ e − δ α , ∂ α L ( α , β ) ≤ − c δ α − d , N + 1 1 ∂ β L ( α , β ) + d λ ∂ α L ( α , β ) ≤ − c δ α − d . (114) Fix ε > 0 \varepsilon>0 ε > 0 . We shall prove that
λ t < 2 + ε for all sufficiently large t . (115) \lambda_t<2+\varepsilon\qquad\text{for all sufficiently large }t. \tag*{(115)} λ t < 2 + ε for all sufficiently large t . (115) Since ε > 0 \varepsilon>0 ε > 0 is arbitrary, this will imply
lim sup t → ∞ λ t ≤ 2. \limsup_{t\to\infty}\lambda_t\le2. t → ∞ lim sup λ t ≤ 2. Step 1: exterior negative drift above 2 + ε / 2 2+\varepsilon/2 2 + ε /2 . Apply (D.90) with δ = ε / 2 \delta=\varepsilon/2 δ = ε /2 . Thus there exist constants
A ε / 2 ≥ 1 , c ε / 2 > 0 A_{\varepsilon/2}\ge1,\qquad c_{\varepsilon/2}>0 A ε /2 ≥ 1 , c ε /2 > 0
such that, whenever
α ≥ A ε / 2 , λ ≥ 2 + ε 2 , \alpha\ge A_{\varepsilon/2}, \qquad\lambda\ge2+\frac{\varepsilon}{2}, α ≥ A ε /2 , λ ≥ 2 + 2 ε ,
we have
∂ α L ( α , β ) ≤ − c ε / 2 α − d . (116) \partial_{\alpha}\mathcal{L}(\alpha,\beta) \le-c_{\varepsilon/2}\alpha^{-d}. \tag*{(116)} ∂ α L ( α , β ) ≤ − c ε /2 α − d . (116)
and
1 N + 1 ∂ β L ( α , β ) + λ d ∂ α L ( α , β ) ≤ − c ε / 2 α − d . (117) \frac{1}{N+1}\partial_{\beta}\mathcal{L}(\alpha,\beta)+\frac{\lambda}{d}\partial_{\alpha}\mathcal{L}(\alpha,\beta) \le-c_{\varepsilon/2}\alpha^{-d}. \tag*{(117)} N + 1 1 ∂ β L ( α , β ) + d λ ∂ α L ( α , β ) ≤ − c ε /2 α − d . (117)
Since α t → + ∞ \alpha_t\to+\infty α t → + ∞ , there exists T 1 ( ε ) T_1(\varepsilon) T 1 ( ε ) such that
α t ≥ A ε / 2 for all t ≥ T 1 ( ε ) . \alpha_t\ge A_{\varepsilon/2}\qquad\text{for all }t\ge T_1(\varepsilon). α t ≥ A ε /2 for all t ≥ T 1 ( ε ) .
Because (D.92) implies ∂ α L ( α t , β t ) ≤ 0 \partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\le0 ∂ α L ( α t , β t ) ≤ 0 whenever λ t ≥ 2 + ε / 2 \lambda_t\ge2+\varepsilon/2 λ t ≥ 2 + ε /2 , the denominator in (D.88) satisfies
α t − η d ∂ α L ( α t , β t ) ≥ α t . \alpha_t-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\ge\alpha_t. α t − d η ∂ α L ( α t , β t ) ≥ α t .
We also claim that, after increasing T 1 ( ε ) T_1(\varepsilon) T 1 ( ε ) if necessary, we have
λ t ≥ 2 + ε 2 , t ≥ T 1 ( ε ) ⟹ α t − η d ∂ α L ( α t , β t ) ≤ 2 α t . (118) \lambda_t\ge2+\frac{\varepsilon}{2},\quad t\ge T_1(\varepsilon)\quad\Longrightarrow\quad\alpha_t-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\le2\alpha_t. \tag*{(118)} λ t ≥ 2 + 2 ε , t ≥ T 1 ( ε ) ⟹ α t − d η ∂ α L ( α t , β t ) ≤ 2 α t . (118)
Indeed, by (D.89),
− η d ∂ α L ( α t , β t ) ≤ η d ∣ ∂ α L ( α t , β t ) ∣ ≤ 10 η d . -\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\le\frac{\eta}{d}\lvert\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\rvert\le\frac{10\eta}{d}. − d η ∂ α L ( α t , β t ) ≤ d η ∣ ∂ α L ( α t , β t )∣ ≤ d 10 η .
Since α t → + ∞ \alpha_t\to+\infty α t → + ∞ , for all sufficiently large t t t we have 10 η / d ≤ α t 10\eta/d\le\alpha_t 10 η / d ≤ α t . Hence
α t − η d ∂ α L ( α t , β t ) ≤ α t + 10 η d ≤ 2 α t , \alpha_t-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\le\alpha_t+\frac{10\eta}{d}\le2\alpha_t, α t − d η ∂ α L ( α t , β t ) ≤ α t + d 10 η ≤ 2 α t ,
which proves (D.94).
Combining (D.88), (D.93), and (D.94), we obtain: for all t ≥ T 1 ( ε ) t\ge T_1(\varepsilon) t ≥ T 1 ( ε ) ,
λ t ≥ 2 + ε 2 ⟹ λ t + 1 − λ t ≤ − η c ε / 2 2 α t − d − 1 < 0. (119) \lambda_t\ge2+\frac{\varepsilon}{2}\quad\Longrightarrow\quad\lambda_{t+1}-\lambda_t\le-\frac{\eta c_{\varepsilon/2}}{2}\alpha_t^{-d-1}<0. \tag*{(119)} λ t ≥ 2 + 2 ε ⟹ λ t + 1 − λ t ≤ − 2 η c ε /2 α t − d − 1 < 0. (119)
Likewise, the α \alpha α -update gives, for all t ≥ T 1 ( ε ) t\ge T_1(\varepsilon) t ≥ T 1 ( ε ) ,
λ t ≥ 2 + ε 2 ⟹ α t + 1 − α t = − η d ∂ α L ( α t , β t ) ≥ η c ε / 2 d α t − d . (120) \lambda_t\ge2+\frac{\varepsilon}{2}\quad\Longrightarrow\quad\alpha_{t+1}-\alpha_t=-\frac{\eta}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\ge\frac{\eta c_{\varepsilon/2}}{d}\alpha_t^{-d}. \tag*{(120)} λ t ≥ 2 + 2 ε ⟹ α t + 1 − α t = − d η ∂ α L ( α t , β t ) ≥ d η c ε /2 α t − d . (120)
Step 2: there is no tail staying above 2 + ε / 2 2+\varepsilon/2 2 + ε /2 .
We claim that there does not exist T ≥ T 1 ( ε ) T\ge T_1(\varepsilon) T ≥ T 1 ( ε ) such that
λ t ≥ 2 + ε 2 for all t ≥ T . (121) \lambda_t\ge2+\frac{\varepsilon}{2}\qquad\text{for all }t\ge T. \tag*{(121)} λ t ≥ 2 + 2 ε for all t ≥ T . (121)
Assume, toward a contradiction, that such a T T T exists. Then (D.96) gives, for all t ≥ T t\ge T t ≥ T ,
α t + 1 − α t ≥ η c ε / 2 d α t − d . \alpha_{t+1}-\alpha_t\ge\frac{\eta c_{\varepsilon/2}}{d}\alpha_t^{-d}. α t + 1 − α t ≥ d η c ε /2 α t − d .
Set
a ε : = η C ~ ε / 2 d > 0. a_{\varepsilon} := \frac{\eta\widetilde{C}_{\varepsilon/2}}{d} > 0. a ε := d η C ε /2 > 0.
Since the function x ↦ x d + 1 x \mapsto x^{d+1} x ↦ x d + 1 is convex on ( 0 , ∞ ) (0,\infty) ( 0 , ∞ ) , we have
α t + 1 d + 1 − α t d + 1 ≥ ( d + 1 ) α t d ( α t + 1 − α t ) ≥ ( d + 1 ) a ε for all t ≥ T . \alpha_{t+1}^{d+1} - \alpha_t^{d+1} \ge(d+1)\alpha_t^d(\alpha_{t+1}-\alpha_t) \ge(d+1)a_{\varepsilon} \qquad\text{for all } t \ge T. α t + 1 d + 1 − α t d + 1 ≥ ( d + 1 ) α t d ( α t + 1 − α t ) ≥ ( d + 1 ) a ε for all t ≥ T .
Summing from T T T to t − 1 t-1 t − 1 , we obtain
α t d + 1 ≥ α T d + 1 + ( d + 1 ) a ε ( t − T ) , t ≥ T . \alpha_t^{d+1} \ge\alpha_T^{d+1} + (d+1)a_{\varepsilon}(t-T), \qquad t \ge T. α t d + 1 ≥ α T d + 1 + ( d + 1 ) a ε ( t − T ) , t ≥ T .
Hence there exists a constant C ε > 0 C_{\varepsilon}>0 C ε > 0 such that
α t ≥ C ε ( 1 + t ) 1 / ( d + 1 ) for all t ≥ T . (122) \alpha_t \ge C_{\varepsilon}(1+t)^{1/(d+1)} \qquad\text{for all } t \ge T. \tag*{(122)} α t ≥ C ε ( 1 + t ) 1/ ( d + 1 ) for all t ≥ T . (122)
On the other hand, Lemma D.42 with ε / 2 \varepsilon/2 ε /2 yields a constant
C ~ ε > 0 \widetilde{C}_{\varepsilon}>0 C ε > 0
such that, for all t ≥ T t \ge T t ≥ T ,
0 ≤ ∂ β L ( α t , β t ) ≤ C ~ ε e − ( ε / 2 ) α t . 0 \le\partial_{\beta}\mathcal{L}(\alpha_t,\beta_t) \le\widetilde{C}_{\varepsilon}e^{-(\varepsilon/2)\alpha_t}. 0 ≤ ∂ β L ( α t , β t ) ≤ C ε e − ( ε /2 ) α t .
Therefore
0 ≤ β t − β t + 1 = η N + 1 ∂ β L ( α t , β t ) ≤ η C ~ ε N + 1 e − ( ε / 2 ) α t . 0 \le\beta_t-\beta_{t+1}=\frac{\eta}{N+1}\partial_{\beta}\mathcal{L}(\alpha_t,\beta_t)\le\frac{\eta\widetilde{C}_{\varepsilon}}{N+1}e^{-(\varepsilon/2)\alpha_t}. 0 ≤ β t − β t + 1 = N + 1 η ∂ β L ( α t , β t ) ≤ N + 1 η C ε e − ( ε /2 ) α t .
Using (D.98), we get
0 ≤ β t − β t + 1 ≤ η C ~ ε N + 1 exp ( − ( ε / 2 ) C ε ( 1 + t ) 1 / ( d + 1 ) ) . 0 \le\beta_t-\beta_{t+1}\le\frac{\eta\widetilde{C}_{\varepsilon}}{N+1}\exp\left(-(\varepsilon/2)C_{\varepsilon}(1+t)^{1/(d+1)}\right). 0 ≤ β t − β t + 1 ≤ N + 1 η C ε exp ( − ( ε /2 ) C ε ( 1 + t ) 1/ ( d + 1 ) ) .
The right-hand side is summable in t t t . Hence
∑ t = T ∞ ( β t − β t + 1 ) < ∞ , \sum_{t=T}^{\infty}(\beta_t-\beta_{t+1})<\infty, t = T ∑ ∞ ( β t − β t + 1 ) < ∞ ,
so the monotone sequence ( β t ) t ≥ T (\beta_t)_{t\ge T} ( β t ) t ≥ T converges to a finite limit
β ∞ > − ∞ . \beta_{\infty}>-\infty. β ∞ > − ∞.
This contradicts the result that β t → − ∞ \beta_t\to-\infty β t → − ∞ . The contradiction proves that no tail satisfying (D.97) can exist.
Step 3: complete proof of the small-step statement below 2 + ε 2+\varepsilon 2 + ε . Suppose λ t ≤ 2 + ε \lambda_t\le2+\varepsilon λ t ≤ 2 + ε . Then by (D.89),
∣ 1 N + 1 ∂ β L ( α t , β t ) + λ t d ∂ α L ( α t , β t ) ∣ ≤ 1 N + 1 ∣ ∂ β L ( α t , β t ) ∣ + λ t d ∣ ∂ α L ( α t , β t ) ∣ ≤ 10 N + 1 + 10 ( 2 + ε ) d . \left|\frac{1}{N+1}\partial_{\beta}\mathcal{L}(\alpha_t,\beta_t)+\frac{\lambda_t}{d}\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)\right|
\le\frac{1}{N+1}|\partial_{\beta}\mathcal{L}(\alpha_t,\beta_t)|+\frac{\lambda_t}{d}|\partial_{\alpha}\mathcal{L}(\alpha_t,\beta_t)|
\le\frac{10}{N+1}+\frac{10(2+\varepsilon)}{d}. N + 1 1 ∂ β L ( α t , β t ) + d λ t ∂ α L ( α t , β t ) ≤ N + 1 1 ∣ ∂ β L ( α t , β t ) ∣ + d λ t ∣ ∂ α L ( α t , β t ) ∣ ≤ N + 1 10 + d 10 ( 2 + ε ) .
Substituting this into the exact recursion (D.88), when α t > 10 η / d \alpha_t > 10\eta/d α t > 10 η / d we obtain
λ t ≤ 2 + ε ⟹ ∣ λ t + 1 − λ t ∣ ≤ η ( 10 N + 1 + 10 ( 2 + ε ) d ) α t − η d ∂ α L ( α t , β t ) \lambda_t \le2+\varepsilon\quad\Longrightarrow\quad\lvert\lambda_{t+1}-\lambda_t\rvert\le\frac{\eta\left(\frac{10}{N+1}+\frac{10(2+\varepsilon)}{d}\right)}{\alpha_t-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha_t,\beta_t)} λ t ≤ 2 + ε ⟹ ∣ λ t + 1 − λ t ∣ ≤ α t − d η ∂ α L ( α t , β t ) η ( N + 1 10 + d 10 ( 2 + ε ) )
Again using (D.89),
α t − η d ∂ α L ( α t , β t ) ≥ α t − 10 η d . \alpha_t-\frac{\eta}{d}\partial_\alpha\mathcal{L}(\alpha_t,\beta_t)\ge\alpha_t-\frac{10\eta}{d}. α t − d η ∂ α L ( α t , β t ) ≥ α t − d 10 η .
Therefore
λ t ≤ 2 + ε ⟹ ∣ λ t + 1 − λ t ∣ ≤ η ( 10 N + 1 + 10 ( 2 + ε ) d ) α t − 10 η d . (123) \lambda_t\le2+\varepsilon\quad\Longrightarrow\quad\lvert\lambda_{t+1}-\lambda_t\rvert\le\frac{\eta\left(\frac{10}{N+1}+\frac{10(2+\varepsilon)}{d}\right)}{\alpha_t-\frac{10\eta}{d}}. \tag*{(123)} λ t ≤ 2 + ε ⟹ ∣ λ t + 1 − λ t ∣ ≤ α t − d 10 η η ( N + 1 10 + d 10 ( 2 + ε ) ) . (123)
Since α t → + ∞ \alpha_t\to+\infty α t → + ∞ , there exists T 0 ( ε ) T_0(\varepsilon) T 0 ( ε ) such that for all t ≥ T 0 ( ε ) t\ge T_0(\varepsilon) t ≥ T 0 ( ε ) ,
α t > 10 η d , η ( 10 N + 1 + 10 ( 2 + ε ) d ) α t − 10 η d < ε 2 . \alpha_t>\frac{10\eta}{d},\qquad\frac{\eta\left(\frac{10}{N+1}+\frac{10(2+\varepsilon)}{d}\right)}{\alpha_t-\frac{10\eta}{d}}<\frac{\varepsilon}{2}. α t > d 10 η , α t − d 10 η η ( N + 1 10 + d 10 ( 2 + ε ) ) < 2 ε .
Combining this with (D.99), we conclude that for all t ≥ T 0 ( ε ) t\ge T_0(\varepsilon) t ≥ T 0 ( ε ) ,
λ t ≤ 2 + ε ⟹ ∣ λ t + 1 − λ t ∣ < ε 2 . (124) \lambda_t\le2+\varepsilon\quad\Longrightarrow\quad\lvert\lambda_{t+1}-\lambda_t\rvert<\frac{\varepsilon}{2}. \tag*{(124)} λ t ≤ 2 + ε ⟹ ∣ λ t + 1 − λ t ∣ < 2 ε . (124)
Step 4: once the trajectory drops below 2 + ε 2+\varepsilon 2 + ε late enough, it never returns.
Set
T ε : = max { T 0 ( ε ) , T 1 ( ε ) } . T_\varepsilon:=\max\{T_0(\varepsilon),T_1(\varepsilon)\}. T ε := max { T 0 ( ε ) , T 1 ( ε )} .
We claim that if t ≥ T ε t\ge T_\varepsilon t ≥ T ε and
λ t < 2 + ε , \lambda_t<2+\varepsilon, λ t < 2 + ε ,
then automatically
λ t + 1 < 2 + ε . (125) \lambda_{t+1}<2+\varepsilon. \tag*{(125)} λ t + 1 < 2 + ε . (125)
To prove this, distinguish two cases. If
λ t ≤ 2 + ε 2 , \lambda_t\le2+\frac{\varepsilon}{2}, λ t ≤ 2 + 2 ε ,
then (D.100) gives
λ t + 1 ≤ λ t + ∣ λ t + 1 − λ t ∣ < ( 2 + ε 2 ) + ε 2 = 2 + ε . \lambda_{t+1}\le\lambda_t+\lvert\lambda_{t+1}-\lambda_t\rvert<\left(2+\frac{\varepsilon}{2}\right)+\frac{\varepsilon}{2}=2+\varepsilon. λ t + 1 ≤ λ t + ∣ λ t + 1 − λ t ∣ < ( 2 + 2 ε ) + 2 ε = 2 + ε .
If instead
2 + ε 2 < λ t < 2 + ε , 2+\frac{\varepsilon}{2}<\lambda_t<2+\varepsilon, 2 + 2 ε < λ t < 2 + ε ,
then λ t ≥ 2 + ε / 2 \lambda_t\ge2+\varepsilon/2 λ t ≥ 2 + ε /2 , so (D.95) applies and yields
λ t + 1 < λ t < 2 + ε . \lambda_{t+1}<\lambda_t<2+\varepsilon. λ t + 1 < λ t < 2 + ε .
Thus in either case,
t ≥ T ε , λ t < 2 + ε ⟹ λ t + 1 < 2 + ε , t\ge T_\varepsilon,\ \lambda_t<2+\varepsilon\quad\Longrightarrow\quad\lambda_{t+1}<2+\varepsilon, t ≥ T ε , λ t < 2 + ε ⟹ λ t + 1 < 2 + ε ,
which proves (D.101). By induction on n n n , (D.101) immediately implies:
t ≥ T ε , λ t < 2 + ε ⟹ λ s < 2 + ε for all s ≥ t . (126) t \ge T_{\varepsilon},\ \lambda_t < 2+\varepsilon\quad\Longrightarrow\quad\lambda_s < 2+\varepsilon\quad\text{for all } s \ge t. \tag*{(126)} t ≥ T ε , λ t < 2 + ε ⟹ λ s < 2 + ε for all s ≥ t . (126)
Step 5: conclude eventual boundedness by 2 + ε 2+\varepsilon 2 + ε . Assume, toward a contradiction, that there are infinitely many indices t ≥ T ε t \ge T_{\varepsilon} t ≥ T ε such that
λ t ≥ 2 + ε . (127) \lambda_t \ge2+\varepsilon. \tag*{(127)} λ t ≥ 2 + ε . (127)
Choose one such index t ∗ ≥ T ε t_* \ge T_{\varepsilon} t ∗ ≥ T ε . Step 2 shows that the trajectory cannot stay forever in the region [ 2 + ε / 2 , ∞ ) [2+\varepsilon/2,\infty) [ 2 + ε /2 , ∞ ) . Hence there exists s ≥ t ∗ s \ge t_* s ≥ t ∗ such that
λ s < 2 + ε 2 < 2 + ε . \lambda_s < 2+\frac{\varepsilon}{2} < 2+\varepsilon. λ s < 2 + 2 ε < 2 + ε .
Since s ≥ t ∗ ≥ T ε s \ge t_* \ge T_{\varepsilon} s ≥ t ∗ ≥ T ε , the absorbing property (D.102) applies and yields
λ t < 2 + ε for all t ≥ s . \lambda_t < 2+\varepsilon\quad\text{for all } t \ge s. λ t < 2 + ε for all t ≥ s .
This means that after time s s s , the trajectory can never again return to [ 2 + ε , ∞ ) [2+\varepsilon,\infty) [ 2 + ε , ∞ ) . But (D.103) asserts that there are infinitely many such return times t ≥ T ε t \ge T_{\varepsilon} t ≥ T ε , hence in particular some after s s s , which is impossible. This contradiction proves that only finitely many t t t satisfy λ t ≥ 2 + ε \lambda_t \ge2+\varepsilon λ t ≥ 2 + ε .
Therefore
λ t < 2 + ε for all sufficiently large t . \lambda_t < 2+\varepsilon\quad\text{for all sufficiently large } t. λ t < 2 + ε for all sufficiently large t .
This establishes (D.91). Since ε > 0 \varepsilon> 0 ε > 0 was arbitrary,
lim sup t → ∞ λ t ≤ 2. \limsup_{t\to\infty}\lambda_t \le2. t → ∞ lim sup λ t ≤ 2.
Finally, we already know that lim inf t → ∞ λ t ≥ 2 \liminf_{t\to\infty}\lambda_t \ge2 lim inf t → ∞ λ t ≥ 2 . Hence λ t → 2 \lambda_t \to2 λ t → 2 .
Theorem D.44. We have
E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0 as t → ∞ . \mathbb{E}\left[a_0\left(\alpha^{(t)},\beta^{(t)}\right)^2\right]\to0 \quad\text{as } t\to\infty. E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0 as t → ∞.
Proof. Suppose, toward a contradiction, that
E [ a 0 ( α ( t ) , β ( t ) ) 2 ] ↛ 0. \mathbb{E}\left[a_0\left(\alpha^{(t)},\beta^{(t)}\right)^2\right]\not\to0. E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0.
Then there exist ε > 0 \varepsilon> 0 ε > 0 and a subsequence t k → ∞ t_k \to\infty t k → ∞ such that
E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] ≥ ε for every k . (128) \mathbb{E}\left[a_0\left(\alpha^{(t_k)},\beta^{(t_k)}\right)^2\right]\ge\varepsilon\quad\text{for every } k. \tag*{(128)} E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] ≥ ε for every k . (128)
Passing to a further subsequence if necessary, we may assume
λ t k → λ ∗ ∈ [ 0 , ∞ ] . (129) \lambda_{t_k}\to\lambda_*\in[0,\infty]. \tag*{(129)} λ t k → λ ∗ ∈ [ 0 , ∞ ] . (129)
By Theorem D.39 ,
λ ∗ ≥ 2. (130) \lambda_* \ge2. \tag*{(130)} λ ∗ ≥ 2. (130)
Lemma D.33 therefore gives
a 0 ( α ( t k ) , β ( t k ) ) → 1 { 1 − U π > λ ∗ } almost surely. a_0(\alpha^{(t_k)},\beta^{(t_k)}) \to\mathbf{1}_{\{1-U_\pi>\lambda_*\}} \quad\text{almost surely.} a 0 ( α ( t k ) , β ( t k ) ) → 1 { 1 − U π > λ ∗ } almost surely.
Since 1 − U π ∈ ( 0 , 2 ) 1-U_\pi\in(0,2) 1 − U π ∈ ( 0 , 2 ) almost surely and λ ∗ ≥ 2 \lambda_* \ge2 λ ∗ ≥ 2 ,
1 { 1 − U π > λ ∗ } = 0 almost surely. \mathbf{1}_{\{1-U_\pi>\lambda_*\}}=0 \quad\text{almost surely.} 1 { 1 − U π > λ ∗ } = 0 almost surely.
Hence
a 0 ( α ( t k ) , β ( t k ) ) → 0 almost surely. a_0(\alpha^{(t_k)},\beta^{(t_k)}) \to0 \quad\text{almost surely.} a 0 ( α ( t k ) , β ( t k ) ) → 0 almost surely.
Because 0 ≤ a 0 ( α ( t k ) , β ( t k ) ) 2 ≤ 1 0 \le a_0(\alpha^{(t_k)},\beta^{(t_k)})^2 \le1 0 ≤ a 0 ( α ( t k ) , β ( t k ) ) 2 ≤ 1 , bounded convergence yields E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] → 0 \mathbb{E}\left[a_0(\alpha^{(t_k)},\beta^{(t_k)})^2\right] \to0 E [ a 0 ( α ( t k ) , β ( t k ) ) 2 ] → 0 , contradicting (D.104). Therefore
E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0. \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right] \to0. E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0.
Theorem D.45. Under Assumption 5.1, suppose that d ≥ 2 d \ge2 d ≥ 2 , N ≥ 100 d N \ge100\sqrt{d} N ≥ 100 d , 0 < η ≤ 1 / 840 ( N + 1 ) 2 0 < \eta\le1/840(N+1)^2 0 < η ≤ 1/840 ( N + 1 ) 2 . Then, under the conditions of Theorem 5.2 ,
L ( α ( t ) , β ( t ) ) → 0 as t → ∞ , \mathcal{L}(\alpha^{(t)},\beta^{(t)}) \to0 \quad\text{as } t \to\infty, L ( α ( t ) , β ( t ) ) → 0 as t → ∞ , or equivalently,
L ( W ( t ) ) → 0 as t → ∞ . \mathcal{L}(\mathbf{W}^{(t)}) \to0 \quad\text{as } t \to\infty. L ( W ( t ) ) → 0 as t → ∞.
Proof. By Theorem D.44 we have
E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0. \mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right] \to0. E [ a 0 ( α ( t ) , β ( t ) ) 2 ] → 0.
Using the exact loss reduction (D.22),
L ( α ( t ) , β ( t ) ) = 3 2 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) , \mathcal{L}(\alpha^{(t)},\beta^{(t)}) = \frac{3}{2}\mathbb{E}\left[a_0(\alpha^{(t)},\beta^{(t)})^2\right] + o(1), L ( α ( t ) , β ( t ) ) = 2 3 E [ a 0 ( α ( t ) , β ( t ) ) 2 ] + o ( 1 ) ,
we conclude that
L ( α ( t ) , β ( t ) ) → 0. \mathcal{L}(\alpha^{(t)},\beta^{(t)}) \to0. L ( α ( t ) , β ( t ) ) → 0.
Equivalently, by definition, we have
L ( W ( t ) ) → 0 as t → ∞ . \mathcal{L}(\mathbf{W}^{(t)}) \to0 \quad\text{as } t \to\infty. L ( W ( t ) ) → 0 as t → ∞.
Additional Experimental Results
Joint Training
In § 7 , we fix the value matrix V \mathbf{V} V according to the construction in Theorem 4.1 and optimize only the attention matrix W \mathbf{W} W . In this subsection, we provide an additional experiment in which both W \mathbf{W} W and V \mathbf{V} V are trained jointly from random initialization. We use the same experimental setup as in the main experiment, except that both W and V are randomly initialized and optimized jointly.
Learned Parameter Structure. Figures 2a and 2b show the learned matrices V and W after training. Although V is no longer fixed, the learned V still matches the construction in Theorem 4.1 . In particular, all entries are close to zero except for the entry corresponding to the y y y coordinate and the diagonal entries corresponding to the positional coordinates. Moreover, these nonzero entries are all close to 1, which is consistent with the theoretical construction.
The learned W also recovers the construction in Theorem 4.1 . Specifically, the diagonal entries in the data coordinates are positive, whereas the diagonal entries in the positional coordinates are negative, with the remaining entries close to zero. Furthermore, the magnitude of the negative diagonal entries is approximately twice that of the positive diagonal entries, again matching the predicted construction. These results show that even when V is trained jointly with W , the learned transformer still converges to the same parameter structure as predicted by the theory.
Test Accuracy. We further evaluate the jointly trained transformer on the K-NN task for K = 1 , 3 , 5 K = 1, 3, 5 K = 1 , 3 , 5 . As shown in Figure 2 c, the test accuracy converges to nearly 1 across different values of K K K . This demonstrates that the jointly trained model not only recovers the construction in Theorem 4.1 , but also retains the multi-step CoT behavior.
Figure 2. Joint training of W and V. We train both matrices jointly from random initialization. The learned V and W recover the construction in Theorem 4.1 , and the resulting transformer achieves high test accuracy on the K-NN task.
Direct-inference
In this subsection, we further examine direct inference using transformers with additional heads or layers and compare their performance with CoT. We also report results for the one-head, one-layer transformer with N = 40 N = 40 N = 40 and d = 10 d = 10 d = 10 , complementing the corresponding results with N = 20 N = 20 N = 20 reported in § 7 .
Specifically, we set N = 40 N = 40 N = 40 and d = 10 d = 10 d = 10 and consider three architectures: a one-head, one-layer transformer, a four-head, one-layer transformer, and a one-head, two-layer transformer. For each architecture, we train a separate direct-inference baseline for each K ∈ { 1 , 3 , 5 } K \in\{1, 3, 5\} K ∈ { 1 , 3 , 5 } for 10000 iterations. During training, each model receives only the initial input and is supervised to predict the final K-NN target state q ( K ) = [ x q T , ∑ i = 1 K y π ( i ) , p N + 1 T + ∑ i = 1 K p π ( i ) T ] q^{(K)} = [x_q^{\mathsf{T}}, \sum_{i=1}^{K} y_{\pi(i)}, p_{N+1}^{\mathsf{T}} + \sum_{i=1}^{K} p_{\pi(i)}^{\mathsf{T}}] q ( K ) = [ x q T , ∑ i = 1 K y π ( i ) , p N + 1 T + ∑ i = 1 K p π ( i ) T ] directly in a single forward pass.
At inference time, each trained direct-inference model performs only a single forward pass on the initial input, without intermediate-state generation or autoregressive rollout. We evaluate each direct model on the test task corresponding to the value of K K K for which it was trained. In addition, for the models trained with K = 3 K = 3 K = 3 and K = 5 K = 5 K = 5 , we also evaluate their predictions on the K = 1 K = 1 K = 1 test set. This additional evaluation allows us to examine whether models trained for larger K K K nevertheless retain behavior close to 1-NN prediction.
We summarize the new experiments and compare them with the CoT results in Table 1 .
Table 1. Test accuracy of CoT and direct models across different values of K K K .
First, the results for the one-head, one-layer transformer with N = 40 N = 40 N = 40 are consistent with those reported in § 7 for N = 20 N = 20 N = 20 . In particular, the direct-inference accuracies for K = 3 K = 3 K = 3 and K = 5 K = 5 K = 5 remain close to 75% and 69%, respectively, while the corresponding CoT accuracies remain near perfect. Moreover, direct-inference learning of K K K -NN remains difficult even with additional heads or layers: the direct models solve 1-NN well, but their accuracies remain far below those of the CoT models for K = 3 K = 3 K = 3 and K = 5 K = 5 K = 5 .
Second, the training of direct-inference models converges toward suboptimal 1-NN-like solutions. Specifically, these models achieve nearly perfect 1-NN accuracy but low 3-NN and 5-NN accuracies, even when supervised by 3-NN or 5-NN prediction rules. Since we use i.i.d. { ± 1 } \{\pm1\} { ± 1 } labels in the experiments, we can verify that the theoretical accuracies of a 1-NN predictor on the 3-NN and 5-NN prediction tasks are 75% and 68.75%, respectively. These values are close to our experimental results and explain the test accuracies achieved by the direct-inference models on the 3-NN and 5-NN tasks.
These results suggest that, during training, direct-inference models with additional heads or layers may continue to attend to the same context data point rather than retrieve multiple distinct neighbors. In contrast, CoT not only provides a natural sequential mechanism for the models to express K K K -NN prediction rules, but also helps training successfully converge to such predictors. These results are consistent with both our expressive-power results and our training guarantees.
Although universal approximation results suggest that sufficiently large models may be able to represent the K K K -NN prediction rule in principle, such results do not imply that gradient-based training will discover this mechanism, nor that the learned model will reliably generalize to test data. Such large-scale models are beyond the scope of this work.