Introduction
In-context reinforcement learning (ICRL) offers an alternative to the conventional paradigm of reinforcement learning. Rather than adapting to a new task through parameter updates, a pretrained agent can adjust its behavior directly from the interaction history provided in its context. This phenomenon has motivated an algorithmic interpretation of ICRL: a Transformer may not merely map a trajectory to a prediction, but may execute a reinforcement-learning algorithm within its forward pass. Recent theoretical work supports this view. Transformers have been shown to implement temporal-difference (TD) methods for policy evaluation, and more recent results extend this perspective to policy-improvement methods such as SARSA and actor-critic (Wang et al., 2024; 2025; Xie et al., 2026a;b; Liang & Lai, 2026).
A central regime remains largely unexplored: off-policy control. Existing policy-improvement constructions focus primarily on on-policy learning, where the behavior policy and the policy being improved are tightly coupled [10 ] . This coupling is restrictive in real applications where an agent must learn from previously collected, heterogeneous, or suboptimal experience rather than from trajectories generated by its current policy. Off-policy control asks whether useful policy improvement can still be carried out when these two roles are decoupled. Q-learning provides a canonical setting for studying this problem. Given a transition ( s , a , r , s ′ ) (s, a, r, s') ( s , a , r , s ′ ) , its target is r + γ max a ′ Q ( s ′ , a ′ ) r + \gamma\max_{a'} Q(s', a') r + γ max a ′ Q ( s ′ , a ′ ) , which does not depend on the successor action selected by the behavior policy. Thus, subject to sufficient state-action coverage, Q-learning can use experience generated by a suboptimal behavior policy while improving toward a greedy target policy. This makes Q-learning a natural testbed for a more demanding form of in-context adaptation: whether a Transformer can use off-policy experience to carry out control, rather than merely evaluate or improve the policy that generated its context.
This transition is substantially more than a change of update rule. At a conceptual level, it marks the passage from Bellman evaluation to Bellman optimality. An in-context implementation of Q-learning must compare competing successor actions, resolve the resulting action selection, and then use that decision to construct the bootstrap target. We show that there exists a two-layer Transformer, combining masked softmax attention with linear attention, that jointly implements next-state action selection and the corresponding window semi-gradient Q-learning update in finite-temperature form, where the softmax temperature τ > 0 \tau> 0 τ > 0 controls the degree of approximation to greedy action selection, and standard window (hard-max) Q-learning is recovered in the limit τ → 0 \tau\to0 τ → 0 . In this sense, the architecture of transformer does not merely reproduce the numerical output of Q-learning; its internal computation mirrors the decomposition of the algorithm itself.
What kind of pretraining can give rise to such a Transformer? We develop a gradient-based training algorithm in which a soft window-Q update serves as the teacher for each sampled context. Within the prescribed tokenization and attention mask, training supervises only the output update and imposes no numerical targets on the internal parameter blocks to implement either window Q-learning or action selection. Nevertheless, the constructed parameter structure emerges under training, recovering the underlying computation, including the internal action-selection mechanism. On unseen tasks, the trained Transformer achieves performance comparable to window Q-learning with the same step size.
To understand why a Q-learning implementation can emerge under this training procedure, we provide a theoretical analysis of its convergence. The nonlinear dependence of softmax attention on the action-score parameters makes the analysis substantially more intricate than in linear-attention settings. Meanwhile, the Q-learning realization is inherently non-identifiable, with different parameter configurations implementing the same update. This makes the relevant optimization target a manifold of functionally equivalent Q-learning realizations rather than a single parameter vector. We characterize this realization manifold and show that, under verifiable conditions on the training distribution, the discrete-time training dynamics converge locally to this manifold at an exponential rate. The analysis further reveals a quantitative difficulty in approaching greedy Q-learning: for the random-task model considered here, the local worst-case number of gradient steps needed to reduce the distance to the manifold by a factor ϵ \epsilon ϵ is Θ ( τ − 5 log ( 1 / ϵ ) ) \Theta\left(\tau^{-5}\log(1/\epsilon)\right) Θ ( τ − 5 log ( 1/ ϵ ) ) , quantifying the increasing optimization cost as the learned update approaches standard Q-learning.
Our results make three concrete advances. First, we give an explicit attention-only construction that jointly realizes successor-action comparison and the window Q-learning update. Second, we design a gradient-based training procedure and characterize a smooth manifold of functionally equivalent Q-learning realizations, showing local exponential convergence of the training dynamics to this manifold. Third, we quantify how the softmax temperature governs the tradeoff between approximating greedy action selection and optimization difficulty. Together, these results extend the mechanistic analysis of ICRL from policy evaluation and on-policy control to off-policy Q-learning.
Related work
Transformer-based agents have been studied extensively for sequential decision making. Decision Transformer and Trajectory Transformer formulate reinforcement learning as sequence modeling [2 , 6 ] , while Algorithm Distillation and related ICRL methods show that pretrained sequence models can adapt to unseen tasks through interaction histories without test-time parameter updates [7 , 9 , 5 ] . On the theoretical side, Lin et al. [11 ] establish provable ICRL under supervised pretraining and show that Transformers can approximate classical online decision-making algorithms.
Recent work has taken a mechanistic view of ICRL, asking which RL algorithms can be implemented by Transformer forward computation and whether the corresponding algorithmic parameters can emerge through pretraining. Wang et al. [16 , 17 ] show that linear-attention Transformers can implement TD updates for policy evaluation, while Xie et al. [21 ] extend this result to standard softmax attention via a kernel-weighted TD construction. Beyond policy evaluation, Liang & Lai [10 ] show that Transformers can realize semi-gradient SARSA and actor-critic updates for policy improvement. However, analogous results for off-policy control, including classical Q-learning, where trajectory data are coupled with subsequent action selection, remain largely unexplored. We study the emergence of Q-learning updates within Transformers, including the Transformer construction, pretraining algorithm, and its convergence analysis. Unlike Liang & Lai [10 ] , we focus on the effect of the action-selection mechanism on convergence, and our analysis accounts for discrete-time training iterates and provides verifiable convergence conditions.
Off-policy learning is particularly relevant to ICRL when context trajectories are offline, heterogeneous, or generated by suboptimal behavior policies. In such settings, the quality of the learned policy need not be tied to that of the behavior generating the trajectories, making off-policy value-based learning particularly relevant. Dong et al. [3 ] study ICRL from suboptimal historical trajectories and propose an advantage-weighted policy-learning framework to improve upon the behavior policies in the data. Scalable In-Context Q-Learning (Liu et al., [12 ] ) combines context-conditioned value estimation, dynamic programming, and policy extraction to enable iterative improvement from suboptimal offline experience. In-Context Compositional Q-Learning (Xu et al., [22 ] ) instead formulates Q Q Q -function estimation as contextual inference and uses retrieved transitions to infer local Q Q Q -functions for offline RL. Our work differs fundamentally from these studies by taking a mechanistic view of how Transformers realize Q Q Q -learning in ICRL, characterizing both the forward-pass implementation of the Q Q Q -learning update and the emergence of the corresponding parameter structure through training.
Background
Transformers and Self-Attention
All vectors are treated as column vectors. Let I n I_n I n denote the n × n n \times n n × n identity matrix, 0 m × n 0_{m \times n} 0 m × n the m × n m \times n m × n zero matrix, and 0 m 0_m 0 m the m m m -dimensional zero vector.
Let H = [ h 1 , … , h n ] ∈ R D × n \mathbf{H} = [h_1, \ldots, h_n] \in\mathbb{R}^{D \times n} H = [ h 1 , … , h n ] ∈ R D × n denote a prompt representation, where each column h i ∈ R D h_i \in\mathbb{R}^{D} h i ∈ R D corresponds to one token. The standard single-head softmax self-attention (Vaswani et al., [15 ] ) processes the prompt via SoftAttn P , V ( H ) ≜ ( V H ) softmax ( H T P H ) \operatorname{SoftAttn}_{P,V}(\mathbf{H}) \triangleq(V\mathbf{H})\operatorname{softmax}(\mathbf{H}^{\mathsf{T}}P\mathbf{H}) SoftAttn P , V ( H ) ≜ ( V H ) softmax ( H T P H ) , where V ∈ R D × D V \in\mathbb{R}^{D \times D} V ∈ R D × D is the value projection matrix, P : = W K T W Q ∈ R D × D P := W_K^{\mathsf{T}}W_Q \in\mathbb{R}^{D \times D} P := W K T W Q ∈ R D × D collects the key and query projection parameters, the conventional scaling factor in scaled dot-product attention is absorbed into P P P , and the softmax is applied independently to each query column, normalizing the attention scores over all key positions.
As a widely studied alternative to softmax self-attention, linear self-attention replaces the softmax-normalized attention weights with unnormalized bilinear attention scores (Ahn et al. [1 ] , Gatmiry et al. [4 ] , Zhang et al. [23 ] ). Its formulation is given by LinAttn P , V ( H ) ≜ 1 n ( V H ) ( H T P H ) \operatorname{LinAttn}_{P,V}(\mathbf{H}) \triangleq\frac{1}{n}(V\mathbf{H})(\mathbf{H}^{\mathsf{T}}P\mathbf{H}) LinAttn P , V ( H ) ≜ n 1 ( V H ) ( H T P H ) , where the factor 1 n \frac{1}{n} n 1 normalizes the aggregation with respect to the prompt length.
To model a multi-layer Transformer structure, we stack L L L attention layers with residual connections. Let H ( 0 ) = H ∈ R D × n \mathbf{H}^{(0)} = \mathbf{H} \in\mathbb{R}^{D \times n} H ( 0 ) = H ∈ R D × n denote the initial input prompt representation. For each layer ℓ ∈ { 1 , 2 , … , L } \ell\in\{1,2,\ldots,L\} ℓ ∈ { 1 , 2 , … , L } , the layer-wise update rule reads
H ( ℓ ) : = H ( ℓ − 1 ) + Attn P ( ℓ ) , V ( ℓ ) ( H ( ℓ − 1 ) ) ∈ R D × n , (1) \mathbf{H}^{(\ell)} := \mathbf{H}^{(\ell-1)} + \operatorname{Attn}_{P^{(\ell)},V^{(\ell)}}\left(\mathbf{H}^{(\ell-1)}\right) \in\mathbb{R}^{D \times n}, \tag*{(1)} H ( ℓ ) := H ( ℓ − 1 ) + Attn P ( ℓ ) , V ( ℓ ) ( H ( ℓ − 1 ) ) ∈ R D × n , (1)
where Attn \operatorname{Attn} Attn denotes either SoftAttn \operatorname{SoftAttn} SoftAttn or LinAttn \operatorname{LinAttn} LinAttn , and { P ( ℓ ) , V ( ℓ ) } \{P^{(\ell)}, V^{(\ell)}\} { P ( ℓ ) , V ( ℓ ) } are the layer-specific projection parameters at layer ℓ \ell ℓ . After stacking L L L attention layers, the final Transformer output is defined as
TF L ( H ; { P ( ℓ ) , V ( ℓ ) } ℓ = 1 L ) : = f r e a d ( H ( L ) ) , (2) \operatorname{TF}_L\left(\mathbf{H}; \{P^{(\ell)}, V^{(\ell)}\}_{\ell=1}^{L}\right) := f_{\mathrm{read}}\left(\mathbf{H}^{(L)}\right), \tag*{(2)} TF L ( H ; { P ( ℓ ) , V ( ℓ ) } ℓ = 1 L ) := f read ( H ( L ) ) , (2)
where f r e a d : R D × n → R D o u t f_{\mathrm{read}}: \mathbb{R}^{D \times n} \to\mathbb{R}^{D_{\mathrm{out}}} f read : R D × n → R D out denotes a fixed readout map. Equation (2) establishes the notation convention we adopt for defining the output of an L L L -layer Transformer. Specifically, the attention mechanism produces a matrix, while we require a vector output for policy improvement. Following prior works (Xie et al. [21 ] , Liang & Lai [10 ] , Wang et al. [16 ] ), we use the bottom-right d d d -dimensional vector of the output matrix as this vector.
Reinforcement Learning and Q-learning
We consider an infinite-horizon discounted Markov decision process (MDP) E = ( S , A , P , R , γ ) \mathcal{E} = (\mathcal{S}, \mathcal{A}, P, R, \gamma) E = ( S , A , P , R , γ ) , where S \mathcal{S} S is the state space, A \mathcal{A} A is the action space, P ( ⋅ ∣ s , a ) ∈ P ( S ) P(\cdot\mid s,a) \in\mathcal{P}(\mathcal{S}) P ( ⋅ ∣ s , a ) ∈ P ( S ) is the transition kernel, R : S × A × S → R R : \mathcal{S} \times\mathcal{A} \times\mathcal{S} \to\mathbb{R} R : S × A × S → R is the reward function, and γ ∈ [ 0 , 1 ) \gamma\in[0,1) γ ∈ [ 0 , 1 ) is the discount factor. Here, P ( X ) \mathcal{P}(\mathcal{X}) P ( X ) denotes the set of probability distributions over X \mathcal{X} X . At time t t t , an agent in state S t S_t S t selects an action A t ∼ π ( ⋅ ∣ S t ) A_t \sim\pi(\cdot\mid S_t) A t ∼ π ( ⋅ ∣ S t ) according to a policy π : P ( A ) \pi: \mathcal{P}(\mathcal{A}) π : P ( A ) , receives a reward R t + 1 = R ( S t , A t , S t + 1 ) R_{t+1} = R(S_t, A_t, S_{t+1}) R t + 1 = R ( S t , A t , S t + 1 ) , and transitions to a successor state S t + 1 ∼ P ( ⋅ ∣ S t , A t ) S_{t+1} \sim P(\cdot\mid S_t, A_t) S t + 1 ∼ P ( ⋅ ∣ S t , A t ) . The discounted return from time t t t is defined as G t : = ∑ k = 0 ∞ γ k R t + k + 1 G_t := \sum_{k=0}^{\infty} \gamma^k R_{t+k+1} G t := ∑ k = 0 ∞ γ k R t + k + 1 . The state-value and action-value functions associated with a policy π \pi π are respectively defined as v π ( s ) : = E π [ G t ∣ S t = s ] v_\pi(s) := \mathbb{E}_\pi[G_t \mid S_t = s] v π ( s ) := E π [ G t ∣ S t = s ] , q π ( s , a ) : = E π [ G t ∣ S t = s , A t = a ] q_\pi(s,a) := \mathbb{E}_\pi[G_t \mid S_t = s, A_t = a] q π ( s , a ) := E π [ G t ∣ S t = s , A t = a ] . The objective of RL is to find a policy that maximizes the expected discounted return.
Q-learning [18 , 19 ] is a classical off-policy TD control algorithm for estimating the optimal action-value function. In the tabular setting, an estimate Q t ( s , a ) Q_t(s,a) Q t ( s , a ) is maintained explicitly for each state-action pair. Given a transition ( S t , A t , R t + 1 , S t + 1 ) (S_t,A_t,R_{t+1},S_{t+1}) ( S t , A t , R t + 1 , S t + 1 ) , Q-learning updates the value of the visited state-action pair according to
Q t + 1 ( S t , A t ) = ( 1 − α ) Q t ( S t , A t ) + α [ R t + 1 + γ max a ′ ∈ A Q t ( S t + 1 , a ′ ) ] (3) Q_{t+1}(S_t,A_t)=(1-\alpha)Q_t(S_t,A_t)+\alpha\left[R_{t+1}+\gamma\max_{a'\in\mathcal{A}}Q_t(S_{t+1},a')\right] \tag*{(3)} Q t + 1 ( S t , A t ) = ( 1 − α ) Q t ( S t , A t ) + α [ R t + 1 + γ a ′ ∈ A max Q t ( S t + 1 , a ′ ) ] (3)
where α ∈ ( 0 , 1 ] \alpha\in(0,1] α ∈ ( 0 , 1 ] is the learning rate. All other state-action values remain unchanged. To handle large state-action spaces, we consider linear function approximation [14 , 13 ] . Given a feature map ϕ : S × A → R d \phi:\mathcal{S}\times\mathcal{A}\to\mathbb{R}^{d} ϕ : S × A → R d and a parameter vector w t ∈ R d \mathbf{w}_t\in\mathbb{R}^{d} w t ∈ R d at time t t t , the action-value function is approximated by q w t ( s , a ) : = w t ⊤ ϕ ( s , a ) q_{\mathbf{w}_t}(s,a):=\mathbf{w}_t^{\top}\phi(s,a) q w t ( s , a ) := w t ⊤ ϕ ( s , a ) . Given a transition ( S t , A t , R t + 1 , S t + 1 ) (S_t,A_t,R_{t+1},S_{t+1}) ( S t , A t , R t + 1 , S t + 1 ) , the semi-gradient Q-learning update is
w t + 1 = w t + α ( R t + 1 + γ max a ′ ∈ A w t ⊤ ϕ ( S t + 1 , a ′ ) − w t ⊤ ϕ ( S t , A t ) ) ϕ ( S t , A t ) . (4) \mathbf{w}_{t+1}=\mathbf{w}_t+\alpha\left(R_{t+1}+\gamma\max_{a'\in\mathcal{A}}\mathbf{w}_t^{\top}\phi(S_{t+1},a')-\mathbf{w}_t^{\top}\phi(S_t,A_t)\right)\phi(S_t,A_t). \tag*{(4)} w t + 1 = w t + α ( R t + 1 + γ a ′ ∈ A max w t ⊤ ϕ ( S t + 1 , a ′ ) − w t ⊤ ϕ ( S t , A t ) ) ϕ ( S t , A t ) . (4)
The tabular setting is recovered as a special case when S \mathcal{S} S and A \mathcal{A} A are finite, d = ∣ S ∣ ∣ A ∣ d=|\mathcal{S}||\mathcal{A}| d = ∣ S ∣∣ A ∣ , and each state-action pair ( s , a ) (s,a) ( s , a ) is assigned a distinct one-hot feature vector ϕ ( s , a ) = e ( s , a ) \phi(s,a)=e_{(s,a)} ϕ ( s , a ) = e ( s , a ) . In this case, each coordinate of w t \mathbf{w}_t w t corresponds to a single state-action value Q t ( s , a ) Q_t(s,a) Q t ( s , a ) , and the above semi-gradient update reduces exactly to the standard tabular Q-learning update.
Transformer can implement In-context soft Q-learning
We consider a Boltzmann-smoothed Q-learning update that replaces the hard maximum over successor actions with a Boltzmann-weighted average. Given the current parameter w \mathbf{w} w , trajectories ( s 0 , a 0 , r 1 , … , s n − 1 , a n − 1 , r n , s n ) (s_0,a_0,r_1,\ldots,s_{n-1},a_{n-1},r_n,s_n) ( s 0 , a 0 , r 1 , … , s n − 1 , a n − 1 , r n , s n ) can be obtained by interacting with environment under its behavioral policy, where behavioral policy is a behavior policy π b \pi_b π b , which may differ from greedy target policy. Let z \mathbf{z} z denote a context consisting of an n n n -transition window, parameter w \mathbf{w} w , and the features of all candidate successor actions. For i = 0 , … , n − 1 i=0,\ldots,n-1 i = 0 , … , n − 1 , define ϕ i = ϕ ( s i , a i ) \phi_i=\phi(s_i,a_i) ϕ i = ϕ ( s i , a i ) , ϕ i , a + = ϕ ( s i + 1 , a ) \phi_{i,a}^{+}=\phi(s_{i+1},a) ϕ i , a + = ϕ ( s i + 1 , a ) , a ∈ A a\in\mathcal{A} a ∈ A and
π i , a τ = exp ( w ⊤ ϕ i , a + / τ ) ∑ b ∈ A exp ( w ⊤ ϕ i , b + / τ ) , ϕ ˉ i + , τ = ∑ a ∈ A π i , a τ ϕ i , a + . (5) \pi_{i,a}^{\tau}=\frac{\exp(\mathbf{w}^{\top}\phi_{i,a}^{+}/\tau)}{\sum_{b\in\mathcal{A}}\exp(\mathbf{w}^{\top}\phi_{i,b}^{+}/\tau)},\qquad\bar{\phi}_{i}^{+,\tau}=\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+}. \tag*{(5)} π i , a τ = ∑ b ∈ A exp ( w ⊤ ϕ i , b + / τ ) exp ( w ⊤ ϕ i , a + / τ ) , ϕ ˉ i + , τ = a ∈ A ∑ π i , a τ ϕ i , a + . (5)
The corresponding batched semi-gradient update is w s o f t ( τ ) = w + α n ∑ i = 0 n − 1 ϕ i ( r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ) \mathbf{w}_{\mathrm{soft}}^{(\tau)}=\mathbf{w}+\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i(r_{i+1}+\gamma\mathbf{w}^{\top}\bar{\phi}_{i}^{+,\tau}-\mathbf{w}^{\top}\phi_i) w soft ( τ ) = w + n α ∑ i = 0 n − 1 ϕ i ( r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ) . Here, w ⊤ ϕ ˉ i + , τ \mathbf{w}^{\top}\bar{\phi}_{i}^{+,\tau} w ⊤ ϕ ˉ i + , τ is the Boltzmann-weighted average of the successor action values, which replaces the hard maximum max a ∈ A w ⊤ ϕ i , a + \max_{a\in\mathcal{A}}\mathbf{w}^{\top}\phi_{i,a}^{+} max a ∈ A w ⊤ ϕ i , a + in Q-learning. This soft backup recovers the Q-learning backup in the zero-temperature limit τ ↓ 0 \tau\downarrow0 τ ↓ 0 ; see Lemma A.1 .
We now give an explicit Transformer construction and show that its forward pass implements the soft Q-learning update. Each token is partitioned into six blocks, [ Φ ; G ; R ; Ψ ; U ; W ] [\Phi;G;R;\Psi;U;W] [ Φ ; G ; R ; Ψ ; U ; W ] of dimensions [ d , d , 1 , d , d , d + 1 ] [d,d,1,d,d,d+1] [ d , d , 1 , d , d , d + 1 ] , respectively. The prompt consists of three types of tokens: transition tokens, which encode the observed transitions; candidate-action tokens, which encode the features of candidate actions at the successor states; and a query token, which carries the current parameter vector. Let w ~ = [ 1 ; w ] \widetilde{\mathbf{w}}=[1;\mathbf{w}] w = [ 1 ; w ] , for each transition i = 0 , … , n − 1 i=0,\ldots,n-1 i = 0 , … , n − 1 and candidate action a ∈ A a\in\mathcal{A} a ∈ A , we define
t i = [ ϕ i ; 0 ; τ i + 1 ; 0 ; w ; 0 ] , c i , a = [ 0 ; 0 ; 0 ; ϕ i , a + ; 0 ; 0 ] , p = [ 0 ; 0 ; 0 ; 0 ; 0 ; w ~ ] . (6) t_i=[\phi_i;0;\tau_{i+1};0;\mathbf{w};0],\qquad c_{i,a}=[0;0;0;\phi_{i,a}^{+};0;0],\qquad p=[0;0;0;0;0;\widetilde{\mathbf{w}}]. \tag*{(6)} t i = [ ϕ i ; 0 ; τ i + 1 ; 0 ; w ; 0 ] , c i , a = [ 0 ; 0 ; 0 ; ϕ i , a + ; 0 ; 0 ] , p = [ 0 ; 0 ; 0 ; 0 ; 0 ; w ] . (6)
Thus, the token dimension is D = 5 d + 2 D=5d+2 D = 5 d + 2 , and the prompt contains N = n ( m + 1 ) + 1 N=n(m+1)+1 N = n ( m + 1 ) + 1 tokens. For each transition i i i , we group the candidate-action tokens as C i = [ c i , a 1 , c i , a 2 , … , c i , a m ] C_i=[c_{i,a_1},c_{i,a_2},\ldots,c_{i,a_m}] C i = [ c i , a 1 , c i , a 2 , … , c i , a m ] , where m : = ∣ A ∣ < ∞ m:=|\mathcal{A}|<\infty m := ∣ A ∣ < ∞ , so that C i C_i C i contains exactly the candidate-action tokens associated with all actions available at the successor state s i + 1 s_{i+1} s i + 1 . The resulting input prompt is
H ( 0 ) = [ t 0 , C 0 , t 1 , C 1 , … , t n − 1 , C n − 1 , p ] . (7) H^{(0)}=[t_0,C_0,t_1,C_1,\ldots,t_{n-1},C_{n-1},p]. \tag*{(7)} H ( 0 ) = [ t 0 , C 0 , t 1 , C 1 , … , t n − 1 , C n − 1 , p ] . (7)
Our Transformer consists of two successive attention layers. The first layer uses single-head softmax attention to compute a Boltzmann-weighted aggregation over candidate successor actions, thereby implementing a smooth approximation to the maximization operator in Q-learning. The second layer then uses linear attention to realize the corresponding update. Specifically, the first layer is defined as
H ( 1 ) = H ( 0 ) + ( V 1 H ( 0 ) ) softmax ( ( H ( 0 ) ) ⊤ P 1 H ( 0 ) + M ) . (8) H^{(1)}=H^{(0)}+(V_1H^{(0)})\operatorname{softmax}\left((H^{(0)})^{\top}P_1H^{(0)}+M\right). \tag*{(8)} H ( 1 ) = H ( 0 ) + ( V 1 H ( 0 ) ) softmax ( ( H ( 0 ) ) ⊤ P 1 H ( 0 ) + M ) . (8)
We use ⋆ \star ⋆ to denote an arbitrary matrix block of the corresponding dimension. These blocks need not vanish and may take arbitrary values, since they do not affect the entries relevant to the construction under the prescribed attention mask and token structure. We choose
P 1 = [ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ 0 d × d ⋆ 0 d × 1 ⋆ A θ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ] , V 1 = [ ⋆ ⋆ ⋆ D Φ ⋆ 0 ⋆ ⋆ ⋆ L ⋆ 0 ⋆ ⋆ ⋆ D R ⋆ 0 ⋆ ⋆ ⋆ 0 ⋆ 0 ⋆ ⋆ ⋆ D U ⋆ 0 ⋆ ⋆ ⋆ 0 ⋆ E ρ ] . (9) P_1 =
\begin{bmatrix}
\star& \star& \star& \star& \star& \star\\
\star& \star& \star& \star& \star& \star\\
\star& \star& \star& \star& \star& \star\\
0_{d\times d} & \star& 0_{d\times1} & \star& A_\theta& \star\\
\star& \star& \star& \star& \star& \star\\
\star& \star& \star& \star& \star& \star
\end{bmatrix},
\qquad
V_1 =
\begin{bmatrix}
\star& \star& \star& D_\Phi& \star& 0 \\
\star& \star& \star& L & \star& 0 \\
\star& \star& \star& D_R & \star& 0 \\
\star& \star& \star& 0 & \star& 0 \\
\star& \star& \star& D_U & \star& 0 \\
\star& \star& \star& 0 & \star& E_\rho
\end{bmatrix}. \tag*{(9)} P 1 = ⋆ ⋆ ⋆ 0 d × d ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ 0 d × 1 ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ A θ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ , V 1 = ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ D Φ L D R 0 D U 0 ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ 0 0 0 0 0 E ρ . (9)
where A θ = τ − 1 I d A_\theta= \tau^{-1}I_d A θ = τ − 1 I d , D Φ , D U ∈ R d × d D_\Phi,D_U \in\mathbb{R}^{d\times d} D Φ , D U ∈ R d × d , L ∈ GL ( d ) L \in\operatorname{GL}(d) L ∈ GL ( d ) , D R ∈ R 1 × d D_R \in\mathbb{R}^{1\times d} D R ∈ R 1 × d , and E ρ = Q − I d + 1 E_\rho= Q-I_{d+1} E ρ = Q − I d + 1 . Here
Q = [ ρ b ⊤ 0 d × 1 I d ] , Q =
\begin{bmatrix}
\rho& b^\top\\
0_{d\times1} & I_d
\end{bmatrix}, Q = [ ρ 0 d × 1 b ⊤ I d ] ,
b ∈ R d b \in\mathbb{R}^d b ∈ R d , ρ ≠ 0 \rho\ne0 ρ = 0 , and GL ( d ) \operatorname{GL}(d) GL ( d ) denotes the set of invertible d × d d \times d d × d matrices.
We define the attention mask M ∈ { 0 , − ∞ } N × N M \in\{0,-\infty\}^{N\times N} M ∈ { 0 , − ∞ } N × N , where rows index keys and columns index queries. The mask is chosen such that each transition token t i t_i t i attends only to its corresponding candidate-action tokens { c i , a } a ∈ A \{c_{i,a}\}_{a\in\mathcal{A}} { c i , a } a ∈ A , while each c i , a c_{i,a} c i , a and the query token p p p attend only to p p p . All other pairs are masked out, ensuring that each t i t_i t i aggregates only its corresponding successor action candidates.
The second layer employs single-head linear attention:
H ( 2 ) = H ( 1 ) + 1 n ( V 2 H ( 1 ) ) ( ( H ( 1 ) ) ⊤ P 2 H ( 1 ) ) . (10) H^{(2)} = H^{(1)} + \frac{1}{n}\left(V_2H^{(1)}\right)\left((H^{(1)})^\top P_2H^{(1)}\right). \tag*{(10)} H ( 2 ) = H ( 1 ) + n 1 ( V 2 H ( 1 ) ) ( ( H ( 1 ) ) ⊤ P 2 H ( 1 ) ) . (10)
We choose
P 2 = [ ⋆ ⋆ ⋆ ⋆ ⋆ B − ⋆ ⋆ ⋆ ⋆ ⋆ B + ⋆ ⋆ ⋆ ⋆ ⋆ B r ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ B U ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ] , V 2 = [ ⋆ ( 4 d + 2 ) × d ⋆ ( 4 d + 2 ) × d ⋆ ( 4 d + 2 ) × ( 3 d + 2 ) C C G 0 d × ( 3 d + 2 ) ] . (11) P_2 =
\begin{bmatrix}
\star& \star& \star& \star& \star& B_- \\
\star& \star& \star& \star& \star& B_+ \\
\star& \star& \star& \star& \star& B_r \\
\star& \star& \star& \star& \star& \star\\
\star& \star& \star& \star& \star& B_U \\
\star& \star& \star& \star& \star& \star
\end{bmatrix},
\qquad
V_2 =
\begin{bmatrix}
\star^{(4d+2)\times d} & \star^{(4d+2)\times d} & \star^{(4d+2)\times(3d+2)} \\
C & C_G & 0_{d\times(3d+2)}
\end{bmatrix}. \tag*{(11)} P 2 = ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ B − B + B r ⋆ B U ⋆ , V 2 = [ ⋆ ( 4 d + 2 ) × d C ⋆ ( 4 d + 2 ) × d C G ⋆ ( 4 d + 2 ) × ( 3 d + 2 ) 0 d × ( 3 d + 2 ) ] . (11)
where B − = − c J Q − 1 B_-=-cJQ^{-1} B − = − c J Q − 1 , B + = c L − ⊤ [ − D R ⊤ , γ I d + D Φ ⊤ − D U ⊤ Ω ] Q − 1 B_+=cL^{-\top}[-D_R^\top,\gamma I_d+D_\Phi^\top-D_U^\top\Omega]Q^{-1} B + = c L − ⊤ [ − D R ⊤ , γ I d + D Φ ⊤ − D U ⊤ Ω ] Q − 1 , B r = c e 0 ⊤ Q − 1 B_r=ce_0^\top Q^{-1} B r = c e 0 ⊤ Q − 1 , B U = c Ω J Q − 1 B_U=c\Omega JQ^{-1} B U = c Ω J Q − 1 , C = ( α / c ) I d C=(\alpha/c)I_d C = ( α / c ) I d , and C G = ( − α / c ) D Φ L − 1 C_G=(-\alpha/c)D_\Phi L^{-1} C G = ( − α / c ) D Φ L − 1 . Here, Ω ⊤ = − Ω \Omega^\top=-\Omega Ω ⊤ = − Ω is arbitrary and may, in particular, be nonzero, J = [ 0 , I d ] J=[0,I_d] J = [ 0 , I d ] , e 0 = [ 1 , 0 1 × d ] e_0=[1,0_{1\times d}] e 0 = [ 1 , 0 1 × d ] , and c ≠ 0 c\ne0 c = 0 .
Theorem 1 (Forward pass as soft Q-learning). Consider two-layer Transformer defined above, with masked softmax attention (8) parameterized by P 1 , V 1 P_1,V_1 P 1 , V 1 in the first layer, and linear attention (10) parameterized by P 2 , V 2 P_2,V_2 P 2 , V 2 in the second layer. For the input prompt H ( 0 ) H^{(0)} H ( 0 ) in (7), the following hold.
(i) The Transformer exactly implements the soft Q Q Q -learning update:
w T F ( τ ) : = TF ( τ ) ( H ( 0 ) ; P 1 , V 1 , P 2 , V 2 ) = w + α n ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ] , w_{\mathrm{TF}}^{(\tau)} := \operatorname{TF}^{(\tau)}(H^{(0)};P_1,V_1,P_2,V_2)
= w+\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i\left[r_{i+1}+\gamma w^\top\bar{\phi}_{i}^{+,\tau}-w^\top\phi_i\right], w TF ( τ ) := TF ( τ ) ( H ( 0 ) ; P 1 , V 1 , P 2 , V 2 ) = w + n α i = 0 ∑ n − 1 ϕ i [ r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ] , where ϕ ˉ i + , τ = ∑ a ∈ A π i , a τ ϕ i , a + \bar{\phi}_{i}^{+,\tau}=\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+} ϕ ˉ i + , τ = ∑ a ∈ A π i , a τ ϕ i , a + , π i , a τ = exp ( w ⊤ ϕ i , a + / τ ) / ∑ b ∈ A exp ( w ⊤ ϕ i , b + / τ ) \pi_{i,a}^{\tau}=\exp(w^\top\phi_{i,a}^{+}/\tau)/\sum_{b\in\mathcal{A}}\exp(w^\top\phi_{i,b}^{+}/\tau) π i , a τ = exp ( w ⊤ ϕ i , a + / τ ) / ∑ b ∈ A exp ( w ⊤ ϕ i , b + / τ ) .
(ii) For each i i i , define q i , a : = w ⊤ ϕ i , a + q_{i,a}:=w^\top\phi_{i,a}^{+} q i , a := w ⊤ ϕ i , a + , q i ∗ : = max a ∈ A q i , a q_i^*:=\max_{a\in\mathcal{A}}q_{i,a} q i ∗ := max a ∈ A q i , a , and A i ∗ : = arg max a ∈ A q i , a \mathcal{A}_i^*:=\arg\max_{a\in\mathcal{A}}q_{i,a} A i ∗ := arg max a ∈ A q i , a . Let m : = ∣ A ∣ < ∞ m:=|\mathcal{A}|<\infty m := ∣ A ∣ < ∞ and K i : = ∣ A i ∗ ∣ K_i:=|\mathcal{A}_i^*| K i := ∣ A i ∗ ∣ . Suppose that ∥ ϕ ( s , a ) ∥ 2 ≤ B ϕ \|\phi(s,a)\|_2\le B_\phi ∥ ϕ ( s , a ) ∥ 2 ≤ B ϕ and ∣ q w ( s , a ) ∣ ≤ B q |q_w(s,a)|\le B_q ∣ q w ( s , a ) ∣ ≤ B q for all state-action pairs. For every i i i such that A i ∗ ≠ A \mathcal{A}_i^*\ne\mathcal{A} A i ∗ = A , define the action gap Δ i : = q i ∗ − max a ∉ A i ∗ q i , a > 0 \Delta_i:=q_i^*-\max_{a\notin\mathcal{A}_i^*}q_{i,a}>0 Δ i := q i ∗ − max a ∈ / A i ∗ q i , a > 0 .
Then lim τ ↓ 0 w T F ( τ ) = w Q \lim_{\tau\downarrow0}w_{\mathrm{TF}}^{(\tau)}=w_Q lim τ ↓ 0 w TF ( τ ) = w Q and
∥ w Q − w T F ( τ ) ∥ 2 ≤ 2 α γ B q B ϕ ∑ i : A i ∗ ≠ A m − K i n K i e − Δ i / τ , \left\|w_Q-w_{\mathrm{TF}}^{(\tau)}\right\|_2
\le2\alpha\gamma B_qB_\phi
\sum_{i:\mathcal{A}_i^*\ne\mathcal{A}}
\frac{m-K_i}{nK_i}e^{-\Delta_i/\tau}, w Q − w TF ( τ ) 2 ≤ 2 α γ B q B ϕ i : A i ∗ = A ∑ n K i m − K i e − Δ i / τ , where w Q = w + α n ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ max a ∈ A w ⊤ ϕ i , a + − w ⊤ ϕ i ] w_Q=w+\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i\left[r_{i+1}+\gamma\max_{a\in\mathcal{A}}w^\top\phi_{i,a}^{+}-w^\top\phi_i\right] w Q = w + n α ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ max a ∈ A w ⊤ ϕ i , a + − w ⊤ ϕ i ] is window Q Q Q -learning update.
The proof of Theorem 1 is provided in Appendix A, together with the corresponding result for the tabular setting. Moreover, if each maximizer is unique and Δ min : = min i Δ i > 0 \Delta_{\min}:=\min_i\Delta_i>0 Δ m i n := min i Δ i > 0 , then ∥ w Q − w T F ( τ ) ∥ 2 ≤ 2 α γ B q B ϕ ( m − 1 ) e − Δ min / τ \left\|w_Q-w_{\mathrm{TF}}^{(\tau)}\right\|_2\le2\alpha\gamma B_qB_\phi(m-1)e^{-\Delta_{\min}/\tau} w Q − w TF ( τ ) 2 ≤ 2 α γ B q B ϕ ( m − 1 ) e − Δ m i n / τ , m > 1 m>1 m > 1 , showing that the Transformer update converges exponentially fast to the standard window Q Q Q -learning update as τ ↓ 0 \tau\downarrow0 τ ↓ 0 . The theorem thus establishes that a two-layer Transformer can exactly implement soft Q Q Q -learning in its forward pass and recover standard Q Q Q -learning in the zero-temperature limit. We call this in-context Q-learning.
Algorithm 1 IC-Q-Learning Transformer Training with Independent-Context Minibatches
Require: Transformer parameters θ ( 0 ) = ( P 1 ( 0 ) , V 1 ( 0 ) , P 2 ( 0 ) , V 2 ( 0 ) ) \theta^{(0)} = (\mathbf{P}_1^{(0)}, \mathbf{V}_1^{(0)}, \mathbf{P}_2^{(0)}, \mathbf{V}_2^{(0)}) θ ( 0 ) = ( P 1 ( 0 ) , V 1 ( 0 ) , P 2 ( 0 ) , V 2 ( 0 ) ) , trajectory window length n n n , number of optimizer updates U U U , minibatch size B B B , ϵ \epsilon ϵ -greedy parameter ϵ \epsilon ϵ , Transformer learning rate η \eta η , Q-learning step size α \alpha α , and temperature τ \tau τ .
for k = 0 , … , U − 1 k = 0,\ldots,U-1 k = 0 , … , U − 1 do
for b = 1 , … , B b = 1,\ldots,B b = 1 , … , B do
Independently sample a new MDP M b ( k ) \mathcal{M}^{(k)}_b M b ( k ) , feature map ϕ b ( k ) \phi_b^{(k)} ϕ b ( k ) , w b ( k ) \mathbf{w}_b^{(k)} w b ( k ) , and initial state s b s_b s b .
Estimate q w b ( k ) ( k , b ) ( s , a ) = ( w b ) T ϕ b ( k ) ( s , a ) q_{\mathbf{w}_b^{(k)}}^{(k,b)}(s,a) = (\mathbf{w}_b)^{\mathsf{T}}\phi_b^{(k)}(s,a) q w b ( k ) ( k , b ) ( s , a ) = ( w b ) T ϕ b ( k ) ( s , a ) , ∀ ( s , a ) ∈ S × A \forall(s,a) \in\mathcal{S} \times\mathcal{A} ∀ ( s , a ) ∈ S × A .
Sample an n n n -step trajectory ( s b , 0 , a b , 0 , r b , 1 , s b , 1 , a b , 1 , … , r b , n , s b , n ) (s_{b,0},a_{b,0},r_{b,1},s_{b,1},a_{b,1},\ldots,r_{b,n},s_{b,n}) ( s b , 0 , a b , 0 , r b , 1 , s b , 1 , a b , 1 , … , r b , n , s b , n ) from M b ( k ) \mathcal{M}^{(k)}_b M b ( k ) according to the ϵ \epsilon ϵ -greedy behavior policy derived from q w b ( k ) ( k , b ) q_{\mathbf{w}_b^{(k)}}^{(k,b)} q w b ( k ) ( k , b ) .
Formulate H b H_b H b as in (7) using the sampled trajectory, the candidate features { ϕ b ( k ) ( s b , i + 1 , a ) : a ∈ A } \{\phi_b^{(k)}(s_{b,i+1},a):a \in\mathcal{A}\} { ϕ b ( k ) ( s b , i + 1 , a ) : a ∈ A } , and the current parameter w b \mathbf{w}_b w b .
Compute H ~ b = H b + ( ∇ 1 H b ) softmax ( ( H b ) T P 1 H b + M ) \widetilde{H}_b = H_b + (\nabla_1 H_b)\operatorname{softmax}\left((H_b)^{\mathsf{T}}P_1H_b + M\right) H b = H b + ( ∇ 1 H b ) softmax ( ( H b ) T P 1 H b + M ) .
Compute w T F , b = [ H ~ b + 1 n ( ∇ 2 H ~ b ) ( ( H ~ b ) T P 2 H ~ b ) ] − d : , − 1 \mathbf{w}_{\mathrm{TF},b} = \left[\widetilde{H}_b + \frac{1}{n}(\nabla_2\widetilde{H}_b)\left((\widetilde{H}_b)^{\mathsf{T}}P_2\widetilde{H}_b\right)\right]_{-d:,-1} w TF , b = [ H b + n 1 ( ∇ 2 H b ) ( ( H b ) T P 2 H b ) ] − d : , − 1 .
Compute the teacher update w s o f t , b ( τ ) \mathbf{w}_{\mathrm{soft},b}^{(\tau)} w soft , b ( τ ) according to soft Q-learning.
end for
Compute L ^ B ( k ) = 1 2 B ∑ b = 1 B ∥ w T F , b − w s o f t , b ( τ ) ∥ 2 2 \widehat{\mathcal{L}}_B^{(k)} = \frac{1}{2B}\sum_{b=1}^{B}\left\|\mathbf{w}_{\mathrm{TF},b}-\mathbf{w}_{\mathrm{soft},b}^{(\tau)}\right\|_2^2 L B ( k ) = 2 B 1 ∑ b = 1 B w TF , b − w soft , b ( τ ) 2 2 .
Update θ ( k + 1 ) ← θ ( k ) − η ∇ θ L ^ B ( k ) \theta^{(k+1)} \leftarrow\theta^{(k)}-\eta\nabla_\theta\widehat{\mathcal{L}}_B^{(k)} θ ( k + 1 ) ← θ ( k ) − η ∇ θ L B ( k ) .
end for
return trained Transformer parameters θ \theta θ .
IC-Q-Learning algorithm and training dynamics analysis
IC-Q-Learning Algorithm and Training Dynamics
We now design an ICRL training procedure for the proposed soft Q-learning Transformer, inspired by prior ICRL training frameworks [7 , 10 ] , as summarized in Algorithm 1. The training objective follows the teacher-mimicking principle: for each sampled context, the Transformer is trained to predict the parameter obtained after one soft Q-learning update. In contrast to directly supervising the internal attention matrices, the loss is imposed only on the final parameter prediction. Hence, the Transformer is not explicitly provided with the analytical parameter construction derived in the preceding section.
Fix integers d ≥ 1 d \ge1 d ≥ 1 , m ≥ 2 m \ge2 m ≥ 2 , n ≥ 1 n \ge1 n ≥ 1 and constants α > 0 \alpha> 0 α > 0 , 0 < γ < 1 0 < \gamma< 1 0 < γ < 1 , τ > 0 \tau> 0 τ > 0 . Let z : = ( w , { ϕ i , r i + 1 , ϕ i , j + : 0 ≤ i < n , j ∈ [ m ] } ) ∼ D n z := (\mathbf{w}, \{\phi_i, r_{i+1}, \phi_{i,j}^{+}: 0 \le i < n, j \in[m]\}) \sim\mathcal{D}_n z := ( w , { ϕ i , r i + 1 , ϕ i , j + : 0 ≤ i < n , j ∈ [ m ]}) ∼ D n . Let w s o f t ( z ) \mathbf{w}_{\mathrm{soft}}(z) w soft ( z ) denote the corresponding soft Q-learning target. We define the population teacher-mimicking objective as
L ( θ ) : = E z [ 1 2 ∥ T F θ ( H ( z ) ) − w s o f t ( z ) ∥ 2 2 ] . (12) \mathcal{L}(\theta) := \mathbb{E}_z\left[\frac{1}{2}\left\|\mathrm{TF}_{\theta}(H(z))-\mathbf{w}_{\mathrm{soft}}(z)\right\|_2^2\right]. \tag*{(12)} L ( θ ) := E z [ 2 1 ∥ TF θ ( H ( z )) − w soft ( z ) ∥ 2 2 ] . (12)
where the expectation is taken jointly over the training-MDP distribution, random feature maps, behavior trajectories, and independently sampled input Q-function parameters.
We optimize the population objective in (12) using independently sampled training contexts. At each optimization step, we draw a minibatch z 1 , … , z B ∼ i . i . d . D n z_1,\ldots,z_B \mathrel{\overset{\mathrm{i.i.d.}}{\sim}} \mathcal{D}_n z 1 , … , z B ∼ i.i.d. D n , where each context is generated from an independently sampled MDP and feature map. The empirical loss is L ^ B ( θ ) : = 1 2 B ∑ b = 1 B ∥ T F θ ( H ( z b ) ) − w s o f t ( τ ) ( z b ) ∥ 2 2 \widehat{\mathcal{L}}_B(\theta) := \frac{1}{2B}\sum_{b=1}^{B}\left\|\mathrm{TF}_{\theta}(H(z_b))-\mathbf{w}_{\mathrm{soft}}^{(\tau)}(z_b)\right\|_2^2 L B ( θ ) := 2 B 1 ∑ b = 1 B TF θ ( H ( z b )) − w soft ( τ ) ( z b ) 2 2 . Here, B B B controls the amount of averaging across independently sampled training contexts within each parameter update, and hence the stochasticity of the resulting gradient estimate. Further details are provided in Proposition B.1.
Write K = ( Φ , R , U ) \mathcal{K} = (\Phi,R,U) K = ( Φ , R , U ) and I = ( Φ , G , R , U ) \mathcal{I} = (\Phi,G,R,U) I = ( Φ , G , R , U ) . Let W o u t W_{\mathrm{out}} W out denote the last d d d coordinates of W W W . Let θ o u t \theta_{\mathrm{out}} θ out collect all entries of θ = ( P 1 , V 1 , P 2 , V 2 ) \theta= (P_1,V_1,P_2,V_2) θ = ( P 1 , V 1 , P 2 , V 2 ) outside the following 16 blocks: P 1 , Ψ K P_{1,\Psi\mathcal{K}} P 1 , Ψ K , V 1 , I Ψ V_{1,\mathcal{I}\Psi} V 1 , I Ψ , V 1 , W W V_{1,\mathcal{W}\mathcal{W}} V 1 , WW , P 2 , I W P_{2,\mathcal{I}W} P 2 , I W , V 2 , W o u t I V_{2,W_{\mathrm{out}}\mathcal{I}} V 2 , W out I . Under the full-matrix population gradient flow θ ˙ = − ∇ L ( θ ) \dot{\theta} = -\nabla\mathcal{L}(\theta) θ ˙ = − ∇ L ( θ ) , if θ o u t ( 0 ) = 0 \theta_{\mathrm{out}}(0) = 0 θ out ( 0 ) = 0 , then θ o u t ( t ) = 0 \theta_{\mathrm{out}}(t) = 0 θ out ( t ) = 0 for all t ≥ 0 t \ge0 t ≥ 0 (Proposition B.2). Consequently, the training dynamics are entirely determined by the retained blocks. We refer to these parameter blocks as valid parameter blocks.
However, the resulting parameterization remains highly redundant, with additional degrees of freedom associated with D Φ D_{\Phi} D Φ , D U D_U D U , ρ \rho ρ , b b b , c c c , L L L , and Ω \Omega Ω . To isolate the essential parameter blocks, we define θ s u p : = ( A θ , L , B − , B + , B r , C ) ∈ Θ s u p \theta_{\mathrm{sup}} := (A_{\theta,L}, B_{-}, B_{+}, B_r, C) \in\Theta_{\mathrm{sup}} θ sup := ( A θ , L , B − , B + , B r , C ) ∈ Θ sup . For any L ∈ G L ( d ) L \in\mathrm{GL}(d) L ∈ GL ( d ) and c ≠ 0 c \ne0 c = 0 , let
θ ˉ τ ( L , c ) = ( τ − 1 I d , L , [ 0 , − c I d ] , [ 0 , c γ L − ⊤ ] , [ c , 0 ] , α c I d ) . (13) \bar{\theta}_{\tau}(L,c) = \left(\tau^{-1}I_d, L, [0,-cI_d], [0,c\gamma L^{-\top}], [c,0], \frac{\alpha}{c}I_d\right). \tag*{(13)} θ ˉ τ ( L , c ) = ( τ − 1 I d , L , [ 0 , − c I d ] , [ 0 , c γ L − ⊤ ] , [ c , 0 ] , c α I d ) . (13)
These six blocks form an inclusion-minimal sufficient support within the specified architecture: they realize the target update in Theorem 1 on all admissible prompts, whereas no proper subset does so when every other block is fixed to zero (Proposition B.3). We call these six parameter blocks the support parameter blocks.
Empirical Analysis
Each MDP has n S = 9 n_S = 9 n S = 9 states and n A = m = 4 n_A = m = 4 n A = m = 4 actions, with discount γ = 0.5 \gamma= 0.5 γ = 0.5 . For each MDP, the initial-state distribution P 0 P_0 P 0 and transition kernel P ( ⋅ ∣ s , a ) P(\cdot\mid s,a) P ( ⋅ ∣ s , a ) are drawn independently from Dirichlet( 1 , … , 1 ) (1,\ldots,1) ( 1 , … , 1 ) (uniform over the probability simplex on n S n_S n S states), and the rewards r ( a , s ′ ) ∼ Unif ( − 1 , 1 ) r(a,s') \sim\operatorname{Unif}(-1,1) r ( a , s ′ ) ∼ Unif ( − 1 , 1 ) are sampled i.i.d. per ( a , s ′ ) (a,s') ( a , s ′ ) . For each MDP, the state-action feature map ϕ : S × A → R d \phi:S \times A \to\mathbb{R}^{d} ϕ : S × A → R d (d = n S n A = 36 d = n_S n_A = 36 d = n S n A = 36 ) and the initial weight w ∈ R d w \in\mathbb{R}^{d} w ∈ R d have entries drawn i.i.d. from Unif ( − 1 , 1 ) \operatorname{Unif}(-1,1) Unif ( − 1 , 1 ) . The behavior policy is ϵ \epsilon ϵ -greedy (ϵ = 0.1 \epsilon= 0.1 ϵ = 0.1 ) with Q ( s , a ) = ϕ ( s , a ) ⊤ w Q(s,a) = \phi(s,a)^{\top}w Q ( s , a ) = ϕ ( s , a ) ⊤ w , and the soft window Q-learning target w s o f t ( τ ) w_{\mathrm{soft}}^{(\tau)} w soft ( τ ) is computed from the trajectory window with step size α = 0.2 \alpha= 0.2 α = 0.2 .
The Transformer uses embedding dimension D = 5 d + 2 = 182 D = 5d + 2 = 182 D = 5 d + 2 = 182 . The prompt supplies w w w , current features ϕ i \phi_i ϕ i , rewards r i + 1 r_{i+1} r i + 1 , and all next-state candidate features ϕ i , a + \phi_{i,a}^{+} ϕ i , a + . Tabular tests replace features by ϕ ( s , a ) = e ( s − 1 ) m + a \phi(s,a) = e_{(s-1)m+a} ϕ ( s , a ) = e ( s − 1 ) m + a and are explicitly separated from dense-feature tests. Training is performed over 46.40 million tasks per model and five paired seeds. Adam uses cosine learning-rate decay from the first update; the default temperature, batch size and context length are τ = 0.2 \tau= 0.2 τ = 0.2 , B = 32 B = 32 B = 32 and n = 20 n = 20 n = 20 . By Proposition B.2 , the sixteen valid parameter blocks are initialized using Xavier normal initialization with gain 0.1. All remaining entries of the two-layer attention construction are initialized to zero, as they remain fixed during training. We conduct the following experiments, with full details provided in Appendix § 13 .§ 1 .
Experiments show that parameter blocks other than the sixteen valid parameter blocks stay at zero as training progresses, confirming Proposition B.2 . We evaluate the learned update using three complementary metrics: Soft error measures how accurately the Transformer realizes the soft Q update, Hard error measures its discrepancy from standard Q-learning, and Greedy agreement measures how often it selects the same greedy action as Q-learning. The learned Transformer closely approximates the soft Q-learning update and achieves nearly 100% greedy agreement.
Figure 1 presents the final learned matrices P 1 \mathbf{P}_1 P 1 , V 1 \mathbf{V}_1 V 1 , P 2 \mathbf{P}_2 P 2 , and V 2 \mathbf{V}_2 V 2 obtained after training. Remarkably, the learned matrices recover the parameter structure predicted in Theorem 1 . In particular, the diagonal entries of A θ A_{\theta} A θ in P 1 \mathbf{P}_1 P 1 approach 1 / τ 1/\tau 1/ τ , indicating that the Transformer has learned the internal action-selection computation required by the soft Q-learning update. This provides direct evidence of parameter emergence. To quantitatively assess parameter recovery, we examine several construction relations. The learned parameters closely approximate analytical relations, and the task-exposure curves show improved recovery as training progresses. See Appendix § 13 .§ 1 for details of the heatmaps.
Figure 1. Final learned P 1 \mathbf{P}_1 P 1 , V 1 \mathbf{V}_1 V 1 , P 2 \mathbf{P}_2 P 2 and V 2 \mathbf{V}_2 V 2 matrices after training at τ = 0.2 \tau= 0.2 τ = 0.2 , B = 32 B = 32 B = 32 , and n = 20 n = 20 n = 20 . the non-zero structure matches the theoretical constructions ( P 1 , V 1 , P 2 , V 2 ) (\mathbf{P}_1,\mathbf{V}_1,\mathbf{P}_2,\mathbf{V}_2) ( P 1 , V 1 , P 2 , V 2 ) in (9) and (11).
The left panel of Figure 2 deploys frozen dense-feature-trained Transformers on unseen tabular MDPs and measures exact policy returns under a common interaction budget. Comparisons include hard and soft window Q-learning, a model-informed Oracle, and uniform Random. The Transformer achieves returns close to those of the soft window teacher and a higher sample-mean return than the hard window-Q baseline using the same fixed step size.
Figure 2. Left: Performance of Transformers on unseen tabular MDPs (sixteen valid parameter blocks). Right: The learned scalar projection β a t t \beta_{\mathrm{att}} β att and its target 1 / τ 1/\tau 1/ τ (six support parameter blocks).
The effect of the action-selection operator. To separately study how temperature affects the emergence of parameters, we analyze the six-block parameterization, which retains the complete soft Q-learning update mechanism and is inclusion-minimal (Proposition B.3). All six blocks remain jointly trainable under output-only supervision. Training is performed over 20.48 million tasks per model. At a given temperature τ \tau τ , the trained Transformer is shown to approximate the soft Q-learning update and produce emergent parameters, verifying Proposition B.3. Decreasing τ \tau τ brings the soft Q update closer to standard Q-learning, but increases the approximation error between the Transformer and the soft update. With a fixed training budget, the recovery error of the predicted parameter structure increases gradually as τ \tau τ decreases. The most pronounced discrepancy appears in the scalar attention scale β a t t : = tr ( A θ ) / d \beta_{\mathrm{att}} := \operatorname{tr}(A_\theta)/d β att := tr ( A θ ) / d . As shown in the right panel of Figure 2 , the learned scale falls below its theoretical target 1 / τ 1/\tau 1/ τ at low temperatures. This implies that smaller τ \tau τ requires greater task exposure for accurate parameter recovery. We further examine the effects of batch size and training-context length. See Appendix § 13 .§ 2 for details.
Theoretical Analysis
In this section, we provide a theoretical account of the above empirical findings by explaining how parameter emergence arises from the pretraining algorithm. Our primary focus is to investigate the effect of the action-selection mechanism on convergence. To this end, we restrict optimization to the support parameter blocks, reducing parameter redundancy and isolating the Transformer’s Q-learning mechanism. Define the optimal parameter manifold as M τ : = { θ ˉ τ ( L , c ) : L ∈ GL ( d ) , c ≠ 0 } \mathcal{M}_\tau:= \{\bar{\theta}_\tau(L,c) : L \in\operatorname{GL}(d),\ c \ne0\} M τ := { θ ˉ τ ( L , c ) : L ∈ GL ( d ) , c = 0 } , we study whether deterministic gradient descent θ k + 1 = θ k − η ∇ L ( θ k ) \theta_{k+1} = \theta_k - \eta\nabla\mathcal{L}(\theta_k) θ k + 1 = θ k − η ∇ L ( θ k ) converges to M τ \mathcal{M}_\tau M τ and characterize how its convergence rate and iteration complexity depend on τ \tau τ .
Let V \mathcal{V} V be a vector space with dim V = 4 d 2 + 3 d \dim\mathcal{V} = 4d^2 + 3d dim V = 4 d 2 + 3 d and ζ : = ( E C , e q , e − , E − , e + , E + , E A ) ∈ V \zeta:= (E_C,e_q,e_-,E_-,e_+,E_+,E_A) \in\mathcal{V} ζ := ( E C , e q , e − , E − , e + , E + , E A ) ∈ V , where the four E E E -symbols are d × d d \times d d × d matrices and the remaining symbols are vectors in R d \mathbb{R}^d R d . Let the teacher-weighted covariance be Σ i τ = ∑ a = 1 m π i , a τ ( ϕ i , a + − ϕ ˉ i + , τ ) ( ϕ i , a + − ϕ ˉ i + , τ ) ⊤ ∈ R d × d \Sigma_i^\tau= \sum_{a=1}^{m} \pi_{i,a}^\tau(\phi_{i,a}^{+} - \bar{\phi}_i^{+,\tau})(\phi_{i,a}^{+} - \bar{\phi}_i^{+,\tau})^\top\in\mathbb{R}^{d \times d} Σ i τ = ∑ a = 1 m π i , a τ ( ϕ i , a + − ϕ ˉ i + , τ ) ( ϕ i , a + − ϕ ˉ i + , τ ) ⊤ ∈ R d × d and
B τ , n ( ζ ) [ ζ ] = 1 n ∑ i = 0 n − 1 { E C ϕ i δ i τ + ϕ i [ ϕ i ⊤ ( e − + E − w ) + ( ϕ i + , τ ) ⊤ ( e + + E + w ) + r i + 1 e q ⊤ w + w ⊤ Σ i τ E A w ] } . (14) \mathcal{B}_{\tau,n}(\zeta)[\zeta] = \frac{1}{n}\sum_{i=0}^{n-1}\left\{E_C\phi_i\delta_i^\tau+ \phi_i\left[\phi_i^\top(e_- + E_-\mathbf{w}) + (\phi_i^{+,\tau})^\top(e_+ + E_+\mathbf{w}) + r_{i+1}e_q^\top\mathbf{w} + \mathbf{w}^\top\Sigma_i^\tau E_A\mathbf{w}\right]\right\}. \tag*{(14)} B τ , n ( ζ ) [ ζ ] = n 1 i = 0 ∑ n − 1 { E C ϕ i δ i τ + ϕ i [ ϕ i ⊤ ( e − + E − w ) + ( ϕ i + , τ ) ⊤ ( e + + E + w ) + r i + 1 e q ⊤ w + w ⊤ Σ i τ E A w ] } . (14)
where δ i τ ( z ) : = r i + 1 − w ⊤ ϕ i + γ w ⊤ ϕ ˉ i + , τ ( z ) \delta_i^\tau(z) := r_{i+1} - \mathbf{w}^\top\phi_i + \gamma\mathbf{w}^\top\bar{\phi}_i^{+,\tau}(z) δ i τ ( z ) := r i + 1 − w ⊤ ϕ i + γ w ⊤ ϕ ˉ i + , τ ( z ) . In these coordinates, the adjoint B τ , n ( z ) ∗ : R d → V \mathcal{B}_{\tau,n}(z)^* : \mathbb{R}^d \to\mathcal{V} B τ , n ( z ) ∗ : R d → V is represented by the transpose of B τ , n ( z ) \mathcal{B}_{\tau,n}(z) B τ , n ( z ) . We define the dim V × dim V \dim\mathcal{V} \times\dim\mathcal{V} dim V × dim V data Gram matrix as H n ( τ ) : = E [ B τ , n ( z ) ∗ B τ , n ( z ) ] H_n(\tau) := \mathbb{E}[\mathcal{B}_{\tau,n}(z)^*\mathcal{B}_{\tau,n}(z)] H n ( τ ) := E [ B τ , n ( z ) ∗ B τ , n ( z )] , and denote its smallest eigenvalue by χ = λ min ( H n ( τ ) ) \chi= \lambda_{\min}(H_n(\tau)) χ = λ m i n ( H n ( τ )) .
We now state the richness assumptions on the training-MDP distribution
Assumption 1. Let Π \Pi Π denote the class of behavior policies used to generate training trajectories. There exist positive constants B w B_w B w , B ϕ B_\phi B ϕ , B r B_r B r such that, for every π ∈ Π \pi\in\Pi π ∈ Π , D n \mathcal{D}_n D n is independent of θ \theta θ and (i) Boundedness. ∥ w ∥ 2 ≤ B w \lVert w\rVert_2 \le B_w ∥ w ∥ 2 ≤ B w , ∥ ϕ i ∥ 2 , ∥ ϕ i , a + ∥ 2 ≤ B ϕ \lVert\phi_i\rVert_2,\lVert\phi_{i,a}^{+}\rVert_2 \le B_\phi ∥ ϕ i ∥ 2 , ∥ ϕ i , a + ∥ 2 ≤ B ϕ , ∣ r i + 1 ∣ ≤ B r \lvert r_{i+1}\rvert\le B_r ∣ r i + 1 ∣ ≤ B r , D n \mathcal{D}_n D n -a.s.
(ii) Joint observable richness. For the fixed ( n , τ ) (n,\tau) ( n , τ ) , H n ( τ ) ≻ 0 H_n(\tau) \succ0 H n ( τ ) ≻ 0 , meaning ⟨ ζ , H n ( τ ) ζ ⟩ > 0 \langle\zeta,H_n(\tau)\zeta\rangle> 0 ⟨ ζ , H n ( τ ) ζ ⟩ > 0 for every ζ ≠ 0 \zeta\ne0 ζ = 0 . Equivalently, B τ , n ( z ) [ ζ ] = 0 B_{\tau,n}(z)[\zeta]=0 B τ , n ( z ) [ ζ ] = 0 , D n \mathcal{D}_n D n -a.s. ⟹ ζ = 0 \Longrightarrow\zeta=0 ⟹ ζ = 0 .
Assumption 1 holds for a broad class of task populations with a nonzero absolutely continuous component and sufficient trajectory support, including the distribution used in our experiments. Explicit sufficient conditions and their verification are given in Appendix E.
Fix a nonempty relatively compact open set Ω ⋐ GL ( d ) × ( R ∖ { 0 } ) \Omega\Subset\operatorname{GL}(d) \times(\mathbb{R}\setminus\{0\}) Ω ⋐ GL ( d ) × ( R ∖ { 0 }) . Its closure Ω ‾ \overline{\Omega} Ω is compact and remains inside GL ( d ) × ( R ∖ { 0 } ) \operatorname{GL}(d) \times(\mathbb{R}\setminus\{0\}) GL ( d ) × ( R ∖ { 0 }) . Define its images U τ = { θ ˉ τ ( L , c ) : ( L , c ) ∈ Ω } \mathcal{U}_\tau=\{\bar{\theta}_\tau(L,c):(L,c)\in\Omega\} U τ = { θ ˉ τ ( L , c ) : ( L , c ) ∈ Ω } , U ‾ τ = { θ ˉ τ ( L , c ) : ( L , c ) ∈ Ω ‾ } \overline{\mathcal{U}}_\tau=\{\bar{\theta}_\tau(L,c):(L,c)\in\overline{\Omega}\} U τ = { θ ˉ τ ( L , c ) : ( L , c ) ∈ Ω } . The set U ‾ τ \overline{\mathcal{U}}_\tau U τ is compact at each fixed τ \tau τ .
At a point θ ˉ ∈ M τ \bar{\theta}\in\mathcal{M}_\tau θ ˉ ∈ M τ , the tangent space T θ ˉ M τ T_{\bar{\theta}}\mathcal{M}_\tau T θ ˉ M τ consists of derivatives at zero of smooth curves lying in M τ \mathcal{M}_\tau M τ and passing through θ ˉ \bar{\theta} θ ˉ . The normal space is its orthogonal complement, N θ ˉ M τ = ( T θ ˉ M τ ) ⊥ N_{\bar{\theta}}\mathcal{M}_\tau=(T_{\bar{\theta}}\mathcal{M}_\tau)^\perp N θ ˉ M τ = ( T θ ˉ M τ ) ⊥ , define the tubular neighborhood of U τ \mathcal{U}_\tau U τ as
T : = T r ( U τ ) = { θ ˉ + Δ : θ ˉ ∈ U τ , Δ ∈ N θ ˉ M τ , ∥ Δ ∥ < r } . (15) \mathcal{T}:=\mathcal{T}_r(\mathcal{U}_\tau)=\{\bar{\theta}+\Delta:\bar{\theta}\in\mathcal{U}_\tau,\ \Delta\in N_{\bar{\theta}}\mathcal{M}_\tau,\ \lVert\Delta\rVert<r\}. \tag*{(15)} T := T r ( U τ ) = { θ ˉ + Δ : θ ˉ ∈ U τ , Δ ∈ N θ ˉ M τ , ∥ Δ ∥ < r } . (15)
A perturbation U ∈ Θ s u p U\in\Theta_{\mathrm{sup}} U ∈ Θ sup has blocks denoted by Δ A , … , Δ C \Delta_A,\ldots,\Delta_C Δ A , … , Δ C in the same order as (13). Let κ \kappa κ denote the minimum local curvature normal to M τ \mathcal{M}_\tau M τ , defined by
κ : = inf θ ˉ ∈ U τ , U ⊥ T θ ˉ M τ ∥ U ∥ = 1 ⟨ U , ∇ 2 L ( θ ˉ ) U ⟩ > 0. (16) \kappa:=\inf_{\substack{\bar{\theta}\in\mathcal{U}_\tau,\ U\perp T_{\bar{\theta}}\mathcal{M}_\tau\\\lVert U\rVert=1}}\langle U,\nabla^2\mathcal{L}(\bar{\theta})U\rangle>0. \tag*{(16)} κ := θ ˉ ∈ U τ , U ⊥ T θ ˉ M τ ∥ U ∥ = 1 inf ⟨ U , ∇ 2 L ( θ ˉ ) U ⟩ > 0. (16)
Let T η ( θ ) = θ − η ∇ L ( θ ) T_\eta(\theta)=\theta-\eta\nabla\mathcal{L}(\theta) T η ( θ ) = θ − η ∇ L ( θ ) and d ( θ ) : = dist ( θ , M τ ) d(\theta):=\operatorname{dist}(\theta,\mathcal{M}_\tau) d ( θ ) := dist ( θ , M τ ) , define
K G D ( ε ; θ 0 ) : = min { K ∈ N 0 : d ( T η K ( θ 0 ) ) ≤ ε d ( θ 0 ) } . K_{\mathrm{GD}}(\varepsilon;\theta_0):=\min\{K\in\mathbb{N}_0:d(T_\eta^K(\theta_0))\le\varepsilon d(\theta_0)\}. K GD ( ε ; θ 0 ) := min { K ∈ N 0 : d ( T η K ( θ 0 )) ≤ ε d ( θ 0 )} .
Theorem 2. Under Assumption 1, there exist a neighborhood T \mathcal{T} T , a constant M J > 0 M_J>0 M J > 0 such that, for any ε ∈ ( 0 , 1 / 2 ] \varepsilon\in(0,1/2] ε ∈ ( 0 , 1/2 ] , 0 < η ≤ 1 2 M J 2 0<\eta\le\frac{1}{2M_J^2} 0 < η ≤ 2 M J 2 1 , and θ 0 ∈ A τ : = { θ ∈ T : d ( θ ) > 0 , 4 M J κ d ( θ ) < dist ( θ , T c ) } \theta_0\in\mathcal{A}_\tau:=\{\theta\in\mathcal{T}:d(\theta)>0,\frac{4M_J}{\sqrt{\kappa}}d(\theta)<\operatorname{dist}(\theta,\mathcal{T}^c)\} θ 0 ∈ A τ := { θ ∈ T : d ( θ ) > 0 , κ 4 M J d ( θ ) < dist ( θ , T c )} ,
(i) The gradient descent θ k + 1 = θ k − η ∇ L ( θ k ) \theta_{k+1}=\theta_k-\eta\nabla\mathcal{L}(\theta_k) θ k + 1 = θ k − η ∇ L ( θ k ) , converges to some θ ∞ ∈ U τ \theta_\infty\in\mathcal{U}_\tau θ ∞ ∈ U τ , and ∥ θ k − θ ∞ ∥ ≤ 4 M J κ d ( θ 0 ) ( 1 − 1 4 η κ ) k / 2 \lVert\theta_k-\theta_\infty\rVert\le\frac{4M_J}{\sqrt{\kappa}}d(\theta_0)(1-\frac{1}{4}\eta\kappa)^{k/2} ∥ θ k − θ ∞ ∥ ≤ κ 4 M J d ( θ 0 ) ( 1 − 4 1 η κ ) k /2 , where 1 − 1 4 η κ ∈ ( 0 , 1 ) 1-\frac{1}{4}\eta\kappa\in(0,1) 1 − 4 1 η κ ∈ ( 0 , 1 ) .
(ii) K G D ( ε ; θ 0 ) = O ( 1 η κ log 1 ε ) K_{\mathrm{GD}}(\varepsilon;\theta_0)=O(\frac{1}{\eta\kappa}\log\frac{1}{\varepsilon}) K GD ( ε ; θ 0 ) = O ( η κ 1 log ε 1 ) for every θ 0 ∈ A τ \theta_0\in\mathcal{A}_\tau θ 0 ∈ A τ , and sup θ 0 ∈ A τ K G D ( ε ; θ 0 ) = Θ Ω ( 1 η κ log 1 ε ) \sup_{\theta_0\in\mathcal{A}_\tau}K_{\mathrm{GD}}(\varepsilon;\theta_0)=\Theta_\Omega(\frac{1}{\eta\kappa}\log\frac{1}{\varepsilon}) sup θ 0 ∈ A τ K GD ( ε ; θ 0 ) = Θ Ω ( η κ 1 log ε 1 ) .
In particular, under our experimental setting, we obtain the following corollary.
Corollary 3. Let feature table Φ : S × A → R d \Phi:\mathcal{S}\times\mathcal{A}\to\mathbb{R}^d Φ : S × A → R d , reward table R : A × S → R R:\mathcal{A}\times\mathcal{S}\to\mathbb{R} R : A × S → R , and an input weight w w w , N ⊂ N \mathcal{N}\subset\mathbb{N} N ⊂ N be a nonempty finite set of context lengths. Suppose n S , d , m ≥ 2 n_S,d,m\ge2 n S , d , m ≥ 2 , P 0 P_0 P 0 and all transition rows are mutually independent Dirichlet ( 1 , … , 1 ) \operatorname{Dirichlet}(1,\ldots,1) Dirichlet ( 1 , … , 1 ) , independent of ( w , Φ , R ) (w,\Phi,R) ( w , Φ , R ) , whose entries are mutually independent Unif ( − 1 , 1 ) \operatorname{Unif}(-1,1) Unif ( − 1 , 1 ) . The behavior policy is ϵ b \epsilon_b ϵ b -greedy with uniform exploration, 0 < ϵ b ≤ 1 0<\epsilon_b\le1 0 < ϵ b ≤ 1 . There exists τ ∗ > 0 \tau_*>0 τ ∗ > 0 such that, for 0 < τ ≤ τ ∗ 0<\tau\le\tau_* 0 < τ ≤ τ ∗ , n ∈ N n\in\mathcal{N} n ∈ N and η \eta η satisfying Theorem 2, K G D ( ε ; θ 0 ) = O ( 1 η τ 5 log 1 ε ) K_{\mathrm{GD}}(\varepsilon;\theta_0)=O(\frac{1}{\eta\tau^5}\log\frac{1}{\varepsilon}) K GD ( ε ; θ 0 ) = O ( η τ 5 1 log ε 1 ) for every θ 0 ∈ A τ \theta_0\in\mathcal{A}_\tau θ 0 ∈ A τ , and sup θ 0 ∈ A τ K G D ( ε ; θ 0 , τ , n ) = Θ Ω , N ( 1 η τ 5 log 1 ε ) \sup_{\theta_0\in\mathcal{A}_\tau}K_{\mathrm{GD}}(\varepsilon;\theta_0,\tau,n)=\Theta_{\Omega,\mathcal{N}}(\frac{1}{\eta\tau^5}\log\frac{1}{\varepsilon}) sup θ 0 ∈ A τ K GD ( ε ; θ 0 , τ , n ) = Θ Ω , N ( η τ 5 1 log ε 1 ) .
The proofs of Theorem 2 and Corollary 3 are provided in Appendices D and E. Corollary 3 shows that as τ \tau τ decreases, the local curvature diminishes, slowing convergence and requiring more iterations to achieve the same optimization accuracy, consistent with our empirical results.
Discussion and limitations
This work takes a step toward white-boxing in-context reinforcement learning for off-policy control. We show that an attention-only Transformer can implement a finite-temperature Q-learning update in its forward pass and recover standard window Q-learning as the temperature approaches zero. We further show that the corresponding parameter structure can emerge through teacher-mimicking training, and establish local exponential convergence to a manifold of functionally equivalent soft Q-learning realizations, with particular attention to how action selection in soft Q-updates affects parameter emergence. These results provide a mechanistic account of how Q-learning can be represented and learned within Transformer computation.
Our analysis has several limitations. First, our theoretical analysis is restricted to the support parameter blocks because the valid parameter blocks exhibit substantial redundancy; extending the convergence analysis to all valid blocks remains future work. Second, we do not analyze minibatch SGD, which would be needed to characterize the dependence of convergence on minibatch size.
AI USE STATEMENT
Generative AI tools were used to assist with code review, experimental implementation and analysis, verification of mathematical derivations, and linguistic refinement of the manuscript. In Appendix E, AI tools contributed key proof steps that were adopted by the authors. The core ideas of the other proofs were developed by the authors, with AI assistance in checking mathematical arguments, carrying out partial algebraic calculations, and identifying and correcting errors. The authors checked the proofs step by step and executed and tested the AI-assisted programs. All numerical results reported in the paper were obtained from executable simulation or model-evaluation code and its saved outputs. All AI-assisted content was reviewed and verified by the authors, who retain full responsibility for the accuracy, validity, and final presentation of this work.
ETHICS STATEMENT
This work investigates the representation and learning of Q-learning updates in structured Transformers through mathematical analysis and experiments on synthetically generated Markov decision processes. The study does not involve human participants, personal or sensitive data, or real-world deployment. We do not identify specific ethical concerns arising from the reported experiments. The results apply under the stated architectural and mathematical assumptions and do not constitute a safety guarantee for real-world reinforcement-learning deployment.
REPRODUCIBILITY STATEMENT
The Transformer architecture, prompt construction, attention mask, and teacher-mimicking objective are specified in Sections 4 and 5 and Algorithm 1. The assumptions and proofs supporting the theoretical results are provided in Appendices A, B, D, and E. Section 5.2 and Appendix C describe the synthetic task generation, training configurations, evaluation protocols, and definitions of the reported metrics. Appendix C also reports results across five paired random seeds and describes the uncertainty estimates used in the experiments. An anonymized implementation is provided in the supplementary material.
REFERENCES
Two-layer Transformer for soft Q-learning
Softmax weights at finite temperature τ \tau τ are not exactly equivalent to max. Recall the definition of π i , a τ \pi^\tau_{i,a} π i , a τ in (5) . Lemma A.1 states that softmax operator can approximate max arbitrarily well, with the true hard-max limit recovered only as the softmax temperature τ → 0 \tau\to0 τ → 0 .
Lemma A.1. For each i i i , define q i , a : = w T ϕ i , a + q_{i,a}:=\mathbf{w}^{\mathsf{T}}\phi^+_{i,a} q i , a := w T ϕ i , a + , q i ∗ : = max a ∈ A q i , a q_i^*:=\max_{a\in\mathcal{A}}q_{i,a} q i ∗ := max a ∈ A q i , a , and A i ∗ : = arg max a ∈ A q i , a \mathcal{A}_i^*:=\arg\max_{a\in\mathcal{A}}q_{i,a} A i ∗ := arg max a ∈ A q i , a . Let m : = ∣ A ∣ < ∞ m:=|\mathcal{A}|<\infty m := ∣ A ∣ < ∞ and K i : = ∣ A i ∗ ∣ K_i:=|\mathcal{A}_i^*| K i := ∣ A i ∗ ∣ . Then, as τ ↓ 0 \tau\downarrow0 τ ↓ 0 , π i , a τ → 1 K i 1 { a ∈ A i ∗ } \pi^\tau_{i,a}\to\frac{1}{K_i}\mathbf{1}\{a\in\mathcal{A}_i^*\} π i , a τ → K i 1 1 { a ∈ A i ∗ } . If A i ∗ ≠ A \mathcal{A}_i^*\ne\mathcal{A} A i ∗ = A , define the action gap Δ i : = q i ∗ − max a ∉ A i ∗ q i , a > 0 \Delta_i:=q_i^*-\max_{a\notin\mathcal{A}_i^*}q_{i,a}>0 Δ i := q i ∗ − max a ∈ / A i ∗ q i , a > 0 , then 1 − ∑ a ∈ A i ∗ π i , a τ ≤ [ ( m − K i ) / K i ] e − Δ i / τ 1-\sum_{a\in\mathcal{A}_i^*}\pi^\tau_{i,a}\leq[(m-K_i)/K_i]e^{-\Delta_i/\tau} 1 − ∑ a ∈ A i ∗ π i , a τ ≤ [( m − K i ) / K i ] e − Δ i / τ .
Proof of Lemma A.1. Fix i i i . Dividing the numerator and denominator of π i , a τ \pi^\tau_{i,a} π i , a τ by exp ( q i ∗ / τ ) \exp(q_i^*/\tau) exp ( q i ∗ / τ ) gives
π i , a τ = exp ( − ( q i ∗ − q i , a ) / τ ) ∑ b ∈ A exp ( − ( q i ∗ − q i , b ) / τ ) . \pi^\tau_{i,a}=\frac{\exp(-(q_i^*-q_{i,a})/\tau)}{\sum_{b\in\mathcal{A}}\exp(-(q_i^*-q_{i,b})/\tau)}. π i , a τ = ∑ b ∈ A exp ( − ( q i ∗ − q i , b ) / τ ) exp ( − ( q i ∗ − q i , a ) / τ ) .
For every a ∈ A i ∗ a\in\mathcal{A}_i^* a ∈ A i ∗ , we have q i ∗ − q i , a = 0 q_i^*-q_{i,a}=0 q i ∗ − q i , a = 0 , whereas for a ∉ A i ∗ a\notin\mathcal{A}_i^* a ∈ / A i ∗ , q i ∗ − q i , a > 0 q_i^*-q_{i,a}>0 q i ∗ − q i , a > 0 . Hence, as τ → 0 \tau\to0 τ → 0 , ∑ b ∈ A exp ( − ( q i ∗ − q i , b ) / τ ) → K i \sum_{b\in\mathcal{A}}\exp(-(q_i^*-q_{i,b})/\tau)\to K_i ∑ b ∈ A exp ( − ( q i ∗ − q i , b ) / τ ) → K i , which yields π i , a τ → 1 / K i \pi^\tau_{i,a}\to1/K_i π i , a τ → 1/ K i , for a ∈ A i ∗ a\in\mathcal{A}_i^* a ∈ A i ∗ , π i , a τ → 0 \pi^\tau_{i,a}\to0 π i , a τ → 0 , for a ∉ A i ∗ a\notin\mathcal{A}_i^* a ∈ / A i ∗ . Therefore, ∑ a ∈ A i ∗ π i , a τ → 1 \sum_{a\in\mathcal{A}_i^*}\pi^\tau_{i,a}\to1 ∑ a ∈ A i ∗ π i , a τ → 1 . Now suppose A i ∗ ≠ A \mathcal{A}_i^*\ne\mathcal{A} A i ∗ = A and define Δ i = q i ∗ − max a ∉ A i ∗ q i , a > 0 \Delta_i=q_i^*-\max_{a\notin\mathcal{A}_i^*}q_{i,a}>0 Δ i = q i ∗ − max a ∈ / A i ∗ q i , a > 0 . Then
1 − ∑ a ∈ A i ∗ π i , a τ = ∑ a ∉ A i ∗ e − ( q i ∗ − q i , a ) / τ K i + ∑ a ∉ A i ∗ e − ( q i ∗ − q i , a ) / τ . 1-\sum_{a\in\mathcal{A}_i^*}\pi^\tau_{i,a}=\frac{\sum_{a\notin\mathcal{A}_i^*}e^{-(q_i^*-q_{i,a})/\tau}}{K_i+\sum_{a\notin\mathcal{A}_i^*}e^{-(q_i^*-q_{i,a})/\tau}}. 1 − a ∈ A i ∗ ∑ π i , a τ = K i + ∑ a ∈ / A i ∗ e − ( q i ∗ − q i , a ) / τ ∑ a ∈ / A i ∗ e − ( q i ∗ − q i , a ) / τ .
Since q i ∗ − q i , a ≥ Δ i q_i^*-q_{i,a}\geq\Delta_i q i ∗ − q i , a ≥ Δ i for all a ∉ A i ∗ a\notin\mathcal{A}_i^* a ∈ / A i ∗ ,
1 − ∑ a ∈ A i ∗ π i , a τ ≤ m − K i K i e − Δ i / τ . 1-\sum_{a\in\mathcal{A}_i^*}\pi^\tau_{i,a}\leq\frac{m-K_i}{K_i}e^{-\Delta_i/\tau}. 1 − a ∈ A i ∗ ∑ π i , a τ ≤ K i m − K i e − Δ i / τ .
When K i = 1 K_i=1 K i = 1 , this reduces to 1 − π i , a i ∗ τ ≤ ( m − 1 ) e − Δ i / τ 1-\pi^\tau_{i,a_i^*}\leq(m-1)e^{-\Delta_i/\tau} 1 − π i , a i ∗ τ ≤ ( m − 1 ) e − Δ i / τ .
We proceed to prove Theorem 1. Our Transformer architecture is two-layered, where the first layer adopts single-head softmax attention to produce Boltzmann-weighted aggregation across all candidate successor actions. To facilitate the proof, we first formally characterize the output behavior of this layer in Lemma A.2, before establishing the full result of Theorem 1.
We first recall the first-layer attention mask. Let T i T_i T i , C i , a C_{i,a} C i , a , and P o P_o P o denote the positions of t i t_i t i , c i , a c_{i,a} c i , a , and p p p , respectively. For each transition query T i T_i T i , only its associated candidate-action tokens are unmasked:
M C j , a , T i = { 0 , j = i , − ∞ , j ≠ i , M T j , T i = M P o , T i = − ∞ . M_{C_{j,a},T_i}=
\begin{cases}
0, & j=i,\\
-\infty, & j\ne i,
\end{cases}
\qquad M_{T_j,T_i}=M_{P_o,T_i}=-\infty. M C j , a , T i = { 0 , − ∞ , j = i , j = i , M T j , T i = M P o , T i = − ∞.
For each candidate-action query and for the parameter query, only the parameter token p p p is unmasked: M P o , C i , a = 0 M_{P_o,C_{i,a}}=0 M P o , C i , a = 0 , M P o , P o = 0 M_{P_o,P_o}=0 M P o , P o = 0 , and all remaining entries are set to − ∞ -\infty − ∞ . Hence, each transition token t i t_i t i attends exactly to its own candidate-action set { c i , a } a ∈ A \{c_{i,a}\}_{a\in\mathcal{A}} { c i , a } a ∈ A .
Lemma A.2 (First layer computes the Boltzmann-weighted successor feature). Consider the single-head masked softmax attention layer in (8) with mask M \mathbf{M} M and parameters P 1 \mathbf{P}_1 P 1 , V 1 \mathbf{V}_1 V 1 specified in (9) . Define
ζ Q = ( Q − I d + 1 ) w ~ = [ ρ − 1 + b T w 0 d ] , w ~ Q = Q w ~ = [ ρ + b T w w ] . \zeta_Q=(\mathbf{Q}-I_{d+1})\widetilde{\mathbf{w}}=\begin{bmatrix}\rho-1+\mathbf{b}^{\mathsf{T}}\mathbf{w}\\0_d\end{bmatrix},
\qquad
\widetilde{\mathbf{w}}_Q=\mathbf{Q}\widetilde{\mathbf{w}}=\begin{bmatrix}\rho+\mathbf{b}^{\mathsf{T}}\mathbf{w}\\\mathbf{w}\end{bmatrix}. ζ Q = ( Q − I d + 1 ) w = [ ρ − 1 + b T w 0 d ] , w Q = Q w = [ ρ + b T w w ] . For the input prompt H ( 0 ) \mathbf{H}^{(0)} H ( 0 ) in (7) , the output is
H ( 1 ) = [ t 0 ( 1 ) , C 0 ( 1 ) , t 1 ( 1 ) , C 1 ( 1 ) , … , t n − 1 ( 1 ) , C n − 1 ( 1 ) , p ( 1 ) ] , \mathbf{H}^{(1)}=\left[t_0^{(1)},\mathbf{C}_0^{(1)},t_1^{(1)},\mathbf{C}_1^{(1)},\ldots,t_{n-1}^{(1)},\mathbf{C}_{n-1}^{(1)},p^{(1)}\right], H ( 1 ) = [ t 0 ( 1 ) , C 0 ( 1 ) , t 1 ( 1 ) , C 1 ( 1 ) , … , t n − 1 ( 1 ) , C n − 1 ( 1 ) , p ( 1 ) ] , where C i ( 1 ) = [ c i , a ( 1 ) ] a ∈ A \mathbf{C}_i^{(1)}=[c_{i,a}^{(1)}]_{a\in\mathcal{A}} C i ( 1 ) = [ c i , a ( 1 ) ] a ∈ A and
t i ( 1 ) = [ ϕ i + D Φ ϕ ˉ i + , τ ϕ ˉ i + , τ r i + 1 + D R ϕ ˉ i + , τ 0 d w + D U ϕ ˉ i + , τ 0 d + 1 ] , c i , a ( 1 ) = [ 0 d 0 d 0 ϕ i , a + 0 d ζ Q ] , p ( 1 ) = [ 0 d 0 d 0 0 d 0 d w ~ Q ] . (17) t_i^{(1)}=
\begin{bmatrix}
\phi_i+\mathbf{D}_{\Phi}\bar{\phi}^{+,\tau}_i\\
\bar{\phi}^{+,\tau}_i\\
r_{i+1}+\mathbf{D}_{R}\bar{\phi}^{+,\tau}_i\\
0_d\\
\mathbf{w}+\mathbf{D}_{U}\bar{\phi}^{+,\tau}_i\\
0_{d+1}
\end{bmatrix},
\qquad
c_{i,a}^{(1)}=
\begin{bmatrix}
0_d\\
0_d\\
0\\
\phi^+_{i,a}\\
0_d\\
\zeta_Q
\end{bmatrix},
\qquad
p^{(1)}=
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
\widetilde{\mathbf{w}}_Q
\end{bmatrix}. \tag*{(17)} t i ( 1 ) = ϕ i + D Φ ϕ ˉ i + , τ ϕ ˉ i + , τ r i + 1 + D R ϕ ˉ i + , τ 0 d w + D U ϕ ˉ i + , τ 0 d + 1 , c i , a ( 1 ) = 0 d 0 d 0 ϕ i , a + 0 d ζ Q , p ( 1 ) = 0 d 0 d 0 0 d 0 d w Q . (17)
Proof. Write H ( 0 ) = [ h 1 , … , h N ] \mathbf{H}^{(0)}=[h_1,\ldots,h_N] H ( 0 ) = [ h 1 , … , h N ] . Let A ˉ : = softmax ( ( H ( 0 ) ) T P 1 H ( 0 ) + M ) \bar{\mathbf{A}}:=\operatorname{softmax}((\mathbf{H}^{(0)})^{\mathsf{T}}\mathbf{P}_1\mathbf{H}^{(0)}+\mathbf{M}) A ˉ := softmax (( H ( 0 ) ) T P 1 H ( 0 ) + M ) , where the softmax is applied columnwise over the key positions. Thus, if h k h_k h k and h q h_q h q denote the tokens at key position k k k and query position q q q , respectively, then
A ˉ k , q = exp ( h k T P 1 h q + M k , q ) ∑ ℓ = 1 N exp ( h ℓ T P 1 h q + M ℓ , q ) . (18) \bar{A}_{k,q}=\frac{\exp(h_k^{\mathsf{T}}\mathbf{P}_1h_q+M_{k,q})}{\sum_{\ell=1}^{N}\exp(h_\ell^{\mathsf{T}}\mathbf{P}_1h_q+M_{\ell,q})}. \tag*{(18)} A ˉ k , q = ∑ ℓ = 1 N exp ( h ℓ T P 1 h q + M ℓ , q ) exp ( h k T P 1 h q + M k , q ) . (18)
Since the k k k th column of V 1 H ( 0 ) \mathbf{V}_1\mathbf{H}^{(0)} V 1 H ( 0 ) is V 1 h k \mathbf{V}_1h_k V 1 h k , the q q q th column of the attention output satisfies [ ( V 1 H ( 0 ) ) A ˉ ] : , q = ∑ k = 1 N A ˉ k , q V 1 h k \left[(\mathbf{V}_1\mathbf{H}^{(0)})\bar{\mathbf{A}}\right]_{:,q}=\sum_{k=1}^{N}\bar{A}_{k,q}\mathbf{V}_1h_k [ ( V 1 H ( 0 ) ) A ˉ ] : , q = ∑ k = 1 N A ˉ k , q V 1 h k . Therefore, using the residual connection, the output corresponding to query token h q h_q h q is
h q ( 1 ) = h q + ∑ k = 1 N A ˉ k , q V 1 h k . (19) h_q^{(1)}=h_q+\sum_{k=1}^{N}\bar{A}_{k,q}\mathbf{V}_1h_k. \tag*{(19)} h q ( 1 ) = h q + k = 1 ∑ N A ˉ k , q V 1 h k . (19)
We first consider a transition token t i t_i t i . By construction of the mask, the query t i t_i t i can attend only to its associated candidate-action tokens { c j , a } a ∈ A \{c_{j,a}\}_{a\in\mathcal{A}} { c j , a } a ∈ A . Hence, the only finite attention scores in the column corresponding to t i t_i t i are c j , a T P 1 t i c_{j,a}^{\mathsf{T}}\mathbf{P}_1t_i c j , a T P 1 t i , a ∈ A a\in\mathcal{A} a ∈ A .
Recall that t i = [ ϕ i ; 0 d ; r i + 1 ; 0 d ; w ; 0 d + 1 ] t_i=[\phi_i;0_d;r_{i+1};0_d;\mathbf{w};0_{d+1}] t i = [ ϕ i ; 0 d ; r i + 1 ; 0 d ; w ; 0 d + 1 ] , c j , a = [ 0 d ; 0 d ; 0 d ; ϕ j , a + ; 0 d ; 0 d + 1 ] c_{j,a}=[0_d;0_d;0_d;\phi_{j,a}^{+};0_d;0_{d+1}] c j , a = [ 0 d ; 0 d ; 0 d ; ϕ j , a + ; 0 d ; 0 d + 1 ] . Since c j , a c_{j,a} c j , a is nonzero only in its Ψ \Psi Ψ block, the inner product c j , a T P 1 t i c_{j,a}^{\mathsf{T}}\mathbf{P}_1t_i c j , a T P 1 t i depends only on the Ψ \Psi Ψ block of P 1 t i \mathbf{P}_1t_i P 1 t i . From the fourth block row of P 1 \mathbf{P}_1 P 1 , ( P 1 t i ) Ψ = 0 d × d ϕ i + 0 d + 0 d × 1 r i + 1 + 0 d + A θ w + 0 d + 1 (\mathbf{P}_1t_i)_{\Psi}=0_{d\times d}\phi_i+0_d+0_{d\times1}r_{i+1}+0_d+\mathbf{A}_{\theta}\mathbf{w}+0_{d+1} ( P 1 t i ) Ψ = 0 d × d ϕ i + 0 d + 0 d × 1 r i + 1 + 0 d + A θ w + 0 d + 1 .
All terms except the fifth vanish, so ( P 1 t i ) Ψ = A θ w (\mathbf{P}_1t_i)_{\Psi}=\mathbf{A}_{\theta}\mathbf{w} ( P 1 t i ) Ψ = A θ w . Since A θ = τ − 1 I d \mathbf{A}_{\theta}=\tau^{-1}\mathbf{I}_d A θ = τ − 1 I d , we obtain ( P 1 t i ) Ψ = τ − 1 w (\mathbf{P}_1t_i)_{\Psi}=\tau^{-1}\mathbf{w} ( P 1 t i ) Ψ = τ − 1 w . Therefore, for any candidate token c j , a c_{j,a} c j , a , c j , a T P 1 t i = ( ϕ j , a + ) T ( P 1 t i ) Ψ = 1 τ w T ϕ j , a + c_{j,a}^{\mathsf{T}}\mathbf{P}_1t_i=(\phi_{j,a}^{+})^{\mathsf{T}}(\mathbf{P}_1t_i)_{\Psi}=\frac{1}{\tau}\mathbf{w}^{\mathsf{T}}\phi_{j,a}^{+} c j , a T P 1 t i = ( ϕ j , a + ) T ( P 1 t i ) Ψ = τ 1 w T ϕ j , a + . The arbitrary χ \chi χ blocks in P 1 \mathbf{P}_1 P 1 do not affect the relevant attention scores. Although P 1 t i \mathbf{P}_1t_i P 1 t i may have nonzero components in other blocks, the candidate token c j , a c_{j,a} c j , a has zeros in all of those coordinates and therefore removes them in the inner product.
The mask now restricts the query t i t_i t i to the candidates with the same transition index i i i . Hence, M c i , a , T i = 0 M_{c_{i,a},T_i}=0 M c i , a , T i = 0 , and M k , T i = − ∞ M_{k,T_i}=-\infty M k , T i = − ∞ for every other key position k k k . It follows from (A.2) that
A ˉ C i , a , T i = exp ( c i , a T P 1 t i ) ∑ b ∈ A exp ( c i , b T P 1 t i ) = exp ( w T ϕ i , a + / τ ) ∑ b ∈ A exp ( w T ϕ i , b + / τ ) = π i , a τ . (20) \bar{A}_{C_i,a,T_i}=\frac{\exp(c_{i,a}^{\mathsf{T}}\mathbf{P}_1t_i)}{\sum_{b\in\mathcal{A}}\exp(c_{i,b}^{\mathsf{T}}\mathbf{P}_1t_i)}=\frac{\exp(\mathbf{w}^{\mathsf{T}}\phi_{i,a}^{+}/\tau)}{\sum_{b\in\mathcal{A}}\exp(\mathbf{w}^{\mathsf{T}}\phi_{i,b}^{+}/\tau)}=\pi_{i,a}^{\tau}. \tag*{(20)} A ˉ C i , a , T i = ∑ b ∈ A exp ( c i , b T P 1 t i ) exp ( c i , a T P 1 t i ) = ∑ b ∈ A exp ( w T ϕ i , b + / τ ) exp ( w T ϕ i , a + / τ ) = π i , a τ . (20)
All other attention weights in the T i T_i T i th column are zero.
We next compute the corresponding value vectors. Since c i , a c_{i,a} c i , a is nonzero only in its Ψ \Psi Ψ block, only the fourth block column of V 1 \mathbf{V}_1 V 1 contributes to V 1 c i , a \mathbf{V}_1c_{i,a} V 1 c i , a . From the prescribed form of V 1 \mathbf{V}_1 V 1 , this block column is
( V 1 ) : , Ψ = [ D Φ L D R 0 d × d D U 0 ( d + 1 ) × d ] , V 1 c i , a = [ D Φ ϕ i , a + L ϕ i , a + D R ϕ i , a + 0 d D U ϕ i , a + 0 d + 1 ] . (\mathbf{V}_1)_{:,\Psi}=
\begin{bmatrix}
\mathbf{D}_{\Phi}\\
\mathbf{L}\\
\mathbf{D}_{R}\\
0_{d\times d}\\
\mathbf{D}_{U}\\
0_{(d+1)\times d}
\end{bmatrix},
\qquad
\mathbf{V}_1c_{i,a}=
\begin{bmatrix}
\mathbf{D}_{\Phi}\phi_{i,a}^{+}\\
\mathbf{L}\phi_{i,a}^{+}\\
\mathbf{D}_{R}\phi_{i,a}^{+}\\
0_d\\
\mathbf{D}_{U}\phi_{i,a}^{+}\\
0_{d+1}
\end{bmatrix}. ( V 1 ) : , Ψ = D Φ L D R 0 d × d D U 0 ( d + 1 ) × d , V 1 c i , a = D Φ ϕ i , a + L ϕ i , a + D R ϕ i , a + 0 d D U ϕ i , a + 0 d + 1 .
Hence, the attention contribution to the transition query t i t_i t i is
[ ( V 1 H ( 0 ) ) A ˉ ] : , T i = ∑ a ∈ A A ˉ C i , a , T i V 1 c i , a = ∑ a ∈ A π i , a τ V 1 c i , a = [ D Φ ∑ a ∈ A π i , a τ ϕ i , a + L ∑ a ∈ A π i , a τ ϕ i , a + D R ∑ a ∈ A π i , a τ ϕ i , a + 0 d D U ∑ a ∈ A π i , a τ ϕ i , a + 0 d + 1 ] = [ D Φ ϕ ˉ i + , τ L ϕ ˉ i + , τ D R ϕ ˉ i + , τ 0 d D U ϕ ˉ i + , τ 0 d + 1 ] , (21) \begin{aligned}
\left[(\mathbf{V}_1\mathbf{H}^{(0)})\bar{\mathbf{A}}\right]_{:,T_i}
=\sum_{a\in\mathcal{A}}\bar{A}_{C_i,a,T_i}\mathbf{V}_1c_{i,a}
=\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\mathbf{V}_1c_{i,a} \\
&=
\begin{bmatrix}
\mathbf{D}_{\Phi}\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+}\\
\mathbf{L}\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+}\\
\mathbf{D}_{R}\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+}\\
0_d\\
\mathbf{D}_{U}\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+}\\
0_{d+1}
\end{bmatrix}
=
\begin{bmatrix}
\mathbf{D}_{\Phi}\bar{\phi}_{i}^{+,\tau}\\
\mathbf{L}\bar{\phi}_{i}^{+,\tau}\\
\mathbf{D}_{R}\bar{\phi}_{i}^{+,\tau}\\
0_d\\
\mathbf{D}_{U}\bar{\phi}_{i}^{+,\tau}\\
0_{d+1}
\end{bmatrix}, \tag*{(21)}
\end{aligned} [ ( V 1 H ( 0 ) ) A ˉ ] : , T i = a ∈ A ∑ A ˉ C i , a , T i V 1 c i , a = a ∈ A ∑ π i , a τ V 1 c i , a = D Φ ∑ a ∈ A π i , a τ ϕ i , a + L ∑ a ∈ A π i , a τ ϕ i , a + D R ∑ a ∈ A π i , a τ ϕ i , a + 0 d D U ∑ a ∈ A π i , a τ ϕ i , a + 0 d + 1 = D Φ ϕ ˉ i + , τ L ϕ ˉ i + , τ D R ϕ ˉ i + , τ 0 d D U ϕ ˉ i + , τ 0 d + 1 , (21)
where we used ϕ ˉ i + , τ = ∑ a ∈ A π i , a τ ϕ i , a + \bar{\phi}_{i}^{+,\tau}=\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+} ϕ ˉ i + , τ = ∑ a ∈ A π i , a τ ϕ i , a + in the last equality.
Finally, applying the residual connection gives
t i ( 1 ) = t i + [ ( V 1 H ( 0 ) ) A ˉ ] : , T i = [ ϕ i 0 d r i + 1 0 d w 0 d + 1 ] + [ D ϕ ˉ i + , τ L ϕ ˉ i + , τ D r i + , τ 0 d D U ϕ i + , τ 0 d + 1 ] = [ ϕ i + D ϕ ˉ i + , τ L ϕ ˉ i + , τ r i + 1 + D r i + , τ 0 d w + D U ϕ i + , τ 0 d + 1 ] . (22) t_i^{(1)}=t_i+\left[(\mathbf{V}_1\mathbf{H}^{(0)})\bar{\mathbf{A}}\right]_{:,T_i}=
\begin{bmatrix}
\phi_i\\
0_d\\
r_{i+1}\\
0_d\\
\mathbf{w}\\
0_{d+1}
\end{bmatrix}
+
\begin{bmatrix}
\mathbf{D}\bar{\phi}_i^{+,\tau}\\
\mathbf{L}\bar{\phi}_i^{+,\tau}\\
\mathbf{D}r_i^{+,\tau}\\
0_d\\
\mathbf{D}\mathbf{U}\phi_i^{+,\tau}\\
0_{d+1}
\end{bmatrix}
=
\begin{bmatrix}
\phi_i+\mathbf{D}\bar{\phi}_i^{+,\tau}\\
\mathbf{L}\bar{\phi}_i^{+,\tau}\\
r_{i+1}+\mathbf{D}r_i^{+,\tau}\\
0_d\\
\mathbf{w}+\mathbf{D}\mathbf{U}\phi_i^{+,\tau}\\
0_{d+1}
\end{bmatrix}. \tag*{(22)} t i ( 1 ) = t i + [ ( V 1 H ( 0 ) ) A ˉ ] : , T i = ϕ i 0 d r i + 1 0 d w 0 d + 1 + D ϕ ˉ i + , τ L ϕ ˉ i + , τ D r i + , τ 0 d DU ϕ i + , τ 0 d + 1 = ϕ i + D ϕ ˉ i + , τ L ϕ ˉ i + , τ r i + 1 + D r i + , τ 0 d w + DU ϕ i + , τ 0 d + 1 . (22)
It remains to compute the candidate-action tokens and the parameter token. By the mask construction, each candidate-action query c i , a c_{i,a} c i , a and the parameter query p p p can attend only to p p p . There is exactly one unmasked key in each of these columns, so
A ˉ P o , C i , a = exp ( p T P 1 c i , a ) exp ( p T P 1 c i , a ) = 1 , A ˉ P o , P o = exp ( p T P 1 p ) exp ( p T P 1 p ) = 1. \bar{A}_{P_o,C_{i,a}}=\frac{\exp(p^{\mathsf{T}}\mathbf{P}_{1}c_{i,a})}{\exp(p^{\mathsf{T}}\mathbf{P}_{1}c_{i,a})}=1,\qquad
\bar{A}_{P_o,P_o}=\frac{\exp(p^{\mathsf{T}}\mathbf{P}_{1}p)}{\exp(p^{\mathsf{T}}\mathbf{P}_{1}p)}=1. A ˉ P o , C i , a = exp ( p T P 1 c i , a ) exp ( p T P 1 c i , a ) = 1 , A ˉ P o , P o = exp ( p T P 1 p ) exp ( p T P 1 p ) = 1.
All other attention weights in these columns are zero.
Recall that p = [ 0 d ; 0 d ; 0 ; 0 d ; 0 d ; w ~ ] p=[0_d;0_d;0;0_d;0_d;\widetilde{\mathbf{w}}] p = [ 0 d ; 0 d ; 0 ; 0 d ; 0 d ; w ] . The last block column of V 1 \mathbf{V}_1 V 1 , corresponding to the W \mathbf{W} W block, is zero except for its last block Q − I d + 1 \mathbf{Q}-\mathbf{I}_{d+1} Q − I d + 1 . Hence
V 1 p = [ 0 d 0 d 0 0 d 0 d ( Q − I d + 1 ) w ~ ] = [ 0 d 0 d 0 0 d 0 d ζ Q ] , \mathbf{V}_1p=
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
(\mathbf{Q}-\mathbf{I}_{d+1})\widetilde{\mathbf{w}}
\end{bmatrix}
=
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
\zeta_Q
\end{bmatrix}, V 1 p = 0 d 0 d 0 0 d 0 d ( Q − I d + 1 ) w = 0 d 0 d 0 0 d 0 d ζ Q ,
where, explicitly,
( Q − I d + 1 ) w ~ = [ ρ − 1 b T 0 d × 1 0 d × d ] [ 1 w ] = [ ρ − 1 + b T w 0 d ] = ζ Q . (\mathbf{Q}-\mathbf{I}_{d+1})\widetilde{\mathbf{w}}=
\begin{bmatrix}
\rho-1 & b^{\mathsf{T}}\\
0_{d\times1} & 0_{d\times d}
\end{bmatrix}
\begin{bmatrix}
1\\
\mathbf{w}
\end{bmatrix}
=
\begin{bmatrix}
\rho-1+b^{\mathsf{T}}\mathbf{w}\\
0_d
\end{bmatrix}
=\zeta_Q. ( Q − I d + 1 ) w = [ ρ − 1 0 d × 1 b T 0 d × d ] [ 1 w ] = [ ρ − 1 + b T w 0 d ] = ζ Q .
Therefore, the attention outputs for all candidate-action queries and for the parameter query are [ ( V 1 H ( 0 ) ) A ˉ ] : , C i , a = V 1 p [(\mathbf{V}_1\mathbf{H}^{(0)})\bar{\mathbf{A}}]_{:,C_{i,a}}=\mathbf{V}_1p [( V 1 H ( 0 ) ) A ˉ ] : , C i , a = V 1 p , [ ( V 1 H ( 0 ) ) A ˉ ] : , P o = V 1 p [(\mathbf{V}_1\mathbf{H}^{(0)})\bar{\mathbf{A}}]_{:,P_o}=\mathbf{V}_1p [( V 1 H ( 0 ) ) A ˉ ] : , P o = V 1 p . Using the residual connection once again,
c i , a ( 1 ) = c i , a + V 1 p = [ 0 d 0 d 0 ϕ i , a + 0 d 0 d + 1 ] + [ 0 d 0 d 0 0 d 0 d ζ Q ] = [ 0 d 0 d 0 ϕ i , a + 0 d ζ Q ] , p ( 1 ) = p + V 1 p = [ 0 d 0 d 0 0 d 0 d w ~ ] + [ 0 d 0 d 0 0 d 0 d ζ Q ] = [ 0 d 0 d 0 0 d 0 d w ~ Q ] , c_{i,a}^{(1)}=c_{i,a}+\mathbf{V}_1p=
\begin{bmatrix}
0_d\\
0_d\\
0\\
\phi_{i,a}^{+}\\
0_d\\
0_{d+1}
\end{bmatrix}
+
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
\zeta_Q
\end{bmatrix}
=
\begin{bmatrix}
0_d\\
0_d\\
0\\
\phi_{i,a}^{+}\\
0_d\\
\zeta_Q
\end{bmatrix},
\qquad
p^{(1)}=p+\mathbf{V}_1p=
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
\widetilde{\mathbf{w}}
\end{bmatrix}
+
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
\zeta_Q
\end{bmatrix}
=
\begin{bmatrix}
0_d\\
0_d\\
0\\
0_d\\
0_d\\
\widetilde{\mathbf{w}}_Q
\end{bmatrix}, c i , a ( 1 ) = c i , a + V 1 p = 0 d 0 d 0 ϕ i , a + 0 d 0 d + 1 + 0 d 0 d 0 0 d 0 d ζ Q = 0 d 0 d 0 ϕ i , a + 0 d ζ Q , p ( 1 ) = p + V 1 p = 0 d 0 d 0 0 d 0 d w + 0 d 0 d 0 0 d 0 d ζ Q = 0 d 0 d 0 0 d 0 d w Q ,
where w ~ + ζ Q = ( I d + 1 + Q − I d + 1 ) w ~ = Q w ~ = w ~ Q \widetilde{\mathbf{w}}+\zeta_Q=(\mathbf{I}_{d+1}+\mathbf{Q}-\mathbf{I}_{d+1})\widetilde{\mathbf{w}}=\mathbf{Q}\widetilde{\mathbf{w}}=\widetilde{\mathbf{w}}_Q w + ζ Q = ( I d + 1 + Q − I d + 1 ) w = Q w = w Q .
Thus, H ( 1 ) = [ t 0 ( 1 ) , C 0 ( 1 ) , t 1 ( 1 ) , C 1 ( 1 ) , … , t n − 1 ( 1 ) , C n − 1 ( 1 ) , p ( 1 ) ] \mathbf{H}^{(1)}=[t_0^{(1)},C_0^{(1)},t_1^{(1)},C_1^{(1)},\ldots,t_{n-1}^{(1)},C_{n-1}^{(1)},p^{(1)}] H ( 1 ) = [ t 0 ( 1 ) , C 0 ( 1 ) , t 1 ( 1 ) , C 1 ( 1 ) , … , t n − 1 ( 1 ) , C n − 1 ( 1 ) , p ( 1 ) ] , with all three types of tokens as stated. In particular, the candidate-action tokens and the parameter token remain unchanged for every w \mathbf{w} w precisely when ρ = 1 \rho=1 ρ = 1 and b = 0 b=0 b = 0 , that is, when Q = I d + 1 \mathbf{Q}=\mathbf{I}_{d+1} Q = I d + 1 . □
With the above lemma established, we proceed to prove Theorem 1.
Proof of Theorem 1. (i) By Lemma A.2, after the first attention layer, each transition token takes the form
t i ( 1 ) = [ ϕ i + D ϕ ˉ i + , τ L ϕ ˉ i + , τ r i + 1 + D r i + , τ 0 d w + D U ϕ i + , τ 0 d + 1 ] , ϕ ˉ i + , τ = ∑ a ∈ A π i , a τ ϕ i , a + . t_i^{(1)}=
\begin{bmatrix}
\phi_i+\mathbf{D}\bar{\phi}_i^{+,\tau}\\
\mathbf{L}\bar{\phi}_i^{+,\tau}\\
r_{i+1}+\mathbf{D}r_i^{+,\tau}\\
0_d\\
\mathbf{w}+\mathbf{D}\mathbf{U}\phi_i^{+,\tau}\\
0_{d+1}
\end{bmatrix},
\qquad
\bar{\phi}_i^{+,\tau}=\sum_{a\in\mathcal{A}}\pi_{i,a}^{\tau}\phi_{i,a}^{+}. t i ( 1 ) = ϕ i + D ϕ ˉ i + , τ L ϕ ˉ i + , τ r i + 1 + D r i + , τ 0 d w + DU ϕ i + , τ 0 d + 1 , ϕ ˉ i + , τ = a ∈ A ∑ π i , a τ ϕ i , a + .
The candidate-action tokens and the parameter token have the forms c i , a ( 1 ) = [ 0 d ; 0 d ; 0 ; ϕ i , a + ; 0 d ; ζ Q ] c_{i,a}^{(1)}=[0_d;0_d;0;\phi_{i,a}^{+};0_d;\zeta_Q] c i , a ( 1 ) = [ 0 d ; 0 d ; 0 ; ϕ i , a + ; 0 d ; ζ Q ] , p ( 1 ) = [ 0 d ; 0 d ; 0 ; 0 d ; 0 d ; w ~ Q ] p^{(1)}=[0_d;0_d;0;0_d;0_d;\widetilde{\mathbf{w}}_Q] p ( 1 ) = [ 0 d ; 0 d ; 0 ; 0 d ; 0 d ; w Q ] . In particular, the F \mathbf{F} F and G \mathbf{G} G blocks of these latter tokens are still zero, and the only possibly nonzero block of p ( 1 ) p^{(1)} p ( 1 ) is its W \mathbf{W} W block.
We now consider the second linear-attention layer. Write H ( 1 ) = [ h 1 ( 1 ) , … , h N ( 1 ) ] \mathbf{H}^{(1)} = [h_1^{(1)}, \ldots, h_N^{(1)}] H ( 1 ) = [ h 1 ( 1 ) , … , h N ( 1 ) ] . From H ( 2 ) = H ( 1 ) + 1 n ( V 2 H ( 1 ) ) ( ( H ( 1 ) ) ⊤ P 2 H ( 1 ) ) \mathbf{H}^{(2)} = \mathbf{H}^{(1)} + \frac{1}{n}(\mathbf{V}_2\mathbf{H}^{(1)})((\mathbf{H}^{(1)})^{\top}\mathbf{P}_2\mathbf{H}^{(1)}) H ( 2 ) = H ( 1 ) + n 1 ( V 2 H ( 1 ) ) (( H ( 1 ) ) ⊤ P 2 H ( 1 ) ) , the update to the parameter token is
Δ p : = p ( 2 ) − p ( 1 ) = 1 n ∑ j = 1 N V 2 h j ( 1 ) ( ( h j ( 1 ) ) ⊤ P 2 p ( 1 ) ) . (23) \Delta p := p^{(2)} - p^{(1)} = \frac{1}{n}\sum_{j=1}^{N}\mathbf{V}_2h_j^{(1)}((h_j^{(1)})^{\top}\mathbf{P}_2p^{(1)}). \tag*{(23)} Δ p := p ( 2 ) − p ( 1 ) = n 1 j = 1 ∑ N V 2 h j ( 1 ) (( h j ( 1 ) ) ⊤ P 2 p ( 1 ) ) . (23)
Indeed, this is simply the column of the matrix product corresponding to the query token p ( 1 ) p^{(1)} p ( 1 ) : the j j j th entry of the corresponding score column is ( h j ( 1 ) ) ⊤ P 2 p ( 1 ) (h_j^{(1)})^{\top}\mathbf{P}_2p^{(1)} ( h j ( 1 ) ) ⊤ P 2 p ( 1 ) , and the j j j th value column is V 2 h j ( 1 ) \mathbf{V}_2h_j^{(1)} V 2 h j ( 1 ) .
We only need the last d d d coordinates of Δ p \Delta p Δ p , since the readout extracts these coordinates of the parameter token. Recall Π o u t = [ 0 d × ( 4 d + 2 ) , I d ] \Pi_{\mathrm{out}} = [0_{d\times(4d+2)}, I_d] Π out = [ 0 d × ( 4 d + 2 ) , I d ] , C = α c I d C = \frac{\alpha}{c}I_d C = c α I d , C G = − C D Φ L − 1 C_G = -CD_{\Phi}\mathbf{L}^{-1} C G = − C D Φ L − 1 . By the block structure of V 2 \mathbf{V}_2 V 2 , for any token h h h ,
Π o u t V 2 h = C h Φ + C G h G , (24) \Pi_{\mathrm{out}}\mathbf{V}_2h = Ch_{\Phi} + C_Gh_G, \tag*{(24)} Π out V 2 h = C h Φ + C G h G , (24)
where h Φ h_{\Phi} h Φ and h G h_G h G denote its Φ \Phi Φ and G G G blocks. The arbitrary entries in the first 4 d + 2 4d+2 4 d + 2 rows of V 2 \mathbf{V}_2 V 2 do not appear in this expression. Therefore,
Π o u t V 2 t i ( 1 ) = C ( ϕ i + D Φ ϕ ˉ i + , τ ) + C G L ϕ ˉ i + , τ = C ϕ i + C D Φ ϕ ˉ i + , τ − C D Φ L − 1 L ϕ ˉ i + , τ = C ϕ i + C D Φ ϕ ˉ i + , τ − C D Φ ϕ ˉ i + , τ = C ϕ i = α c ϕ i . (25) \begin{aligned}
\Pi_{\mathrm{out}}\mathbf{V}_2t_i^{(1)}
&= C(\phi_i + D_{\Phi}\bar{\phi}_i^{+,\tau}) + C_G\mathbf{L}\bar{\phi}_i^{+,\tau}\\
&= C\phi_i + CD_{\Phi}\bar{\phi}_i^{+,\tau} - CD_{\Phi}\mathbf{L}^{-1}\mathbf{L}\bar{\phi}_i^{+,\tau}\\
&= C\phi_i + CD_{\Phi}\bar{\phi}_i^{+,\tau} - CD_{\Phi}\bar{\phi}_i^{+,\tau}
= C\phi_i = \frac{\alpha}{c}\phi_i. \tag*{(25)}
\end{aligned} Π out V 2 t i ( 1 ) = C ( ϕ i + D Φ ϕ ˉ i + , τ ) + C G L ϕ ˉ i + , τ = C ϕ i + C D Φ ϕ ˉ i + , τ − C D Φ L − 1 L ϕ ˉ i + , τ = C ϕ i + C D Φ ϕ ˉ i + , τ − C D Φ ϕ ˉ i + , τ = C ϕ i = c α ϕ i . (25)
Here the second equality uses C G = − C D Φ L − 1 C_G = -CD_{\Phi}\mathbf{L}^{-1} C G = − C D Φ L − 1 , and the third uses L − 1 L = I d \mathbf{L}^{-1}\mathbf{L} = I_d L − 1 L = I d .
On the other hand, both c i , a ( 1 ) c_{i,a}^{(1)} c i , a ( 1 ) and p ( 1 ) p^{(1)} p ( 1 ) have zero Φ \Phi Φ and G G G blocks. Applying (A.8) gives
Π o u t V 2 c i , a ( 1 ) = C 0 d + C G 0 d = 0 d , Π o u t V 2 p ( 1 ) = C 0 d + C G 0 d = 0 d . (26) \Pi_{\mathrm{out}}\mathbf{V}_2c_{i,a}^{(1)} = C0_d + C_G0_d = 0_d,\qquad\Pi_{\mathrm{out}}\mathbf{V}_2p^{(1)} = C0_d + C_G0_d = 0_d. \tag*{(26)} Π out V 2 c i , a ( 1 ) = C 0 d + C G 0 d = 0 d , Π out V 2 p ( 1 ) = C 0 d + C G 0 d = 0 d . (26)
Thus, only the transition tokens contribute to the last d d d coordinates of the parameter update. The additional W W W block ζ Q \zeta_Q ζ Q in each candidate token does not affect this conclusion, since the last d d d rows of the W W W block column of V 2 \mathbf{V}_2 V 2 are zero. No assumption that the candidate or parameter scores vanish is needed: their projected value vectors already vanish.
It remains to compute the scalar score ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) (t_i^{(1)})^{\top}\mathbf{P}_2p^{(1)} ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) . Since p ( 1 ) = [ 0 d ; 0 d ; 0 ; 0 d ; 0 d ; w ~ Q ] p^{(1)} = [0_d;0_d;0;0_d;0_d;\widetilde{w}_Q] p ( 1 ) = [ 0 d ; 0 d ; 0 ; 0 d ; 0 d ; w Q ] , w ~ Q = Q w ~ = Q [ 1 w ] \widetilde{w}_Q = Q\widetilde{w} = Q\begin{bmatrix}1\\w\end{bmatrix} w Q = Q w = Q [ 1 w ] , only the last block column of P 2 \mathbf{P}_2 P 2 contributes to P 2 p ( 1 ) \mathbf{P}_2p^{(1)} P 2 p ( 1 ) . Because Q Q Q is invertible,
Q − 1 w ~ Q = Q − 1 Q w ~ = w ~ = [ 1 w ] . Q^{-1}\widetilde{w}_Q = Q^{-1}Q\widetilde{w} = \widetilde{w} = \begin{bmatrix}1\\w\end{bmatrix}. Q − 1 w Q = Q − 1 Q w = w = [ 1 w ] .
From the definition of the specified blocks, we obtain
B − w ~ Q = − c J Q − 1 Q w ~ = − c [ 0 d × 1 , I d ] [ 1 w ] = − c w , (27) \mathbf{B}_{- \widetilde{w}_Q} = -cJQ^{-1}Q\widetilde{w} = -c[0_{d\times1},I_d]\begin{bmatrix}1\\w\end{bmatrix} = -cw, \tag*{(27)} B − w Q = − c J Q − 1 Q w = − c [ 0 d × 1 , I d ] [ 1 w ] = − c w , (27)
B + w ~ Q = c L − ⊤ [ − D R ⊤ , γ I d + D Φ ⊤ − D U ⊤ Ω ] Q − 1 Q w ~ = c L − ⊤ [ − D R ⊤ , γ I d + D Φ ⊤ − D U ⊤ Ω ] [ 1 w ] = c L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] , (28) \begin{aligned}
\mathbf{B}_{+ \widetilde{w}_Q}
&= c\mathbf{L}^{-\top}[-D_R^{\top},\gamma I_d+D_{\Phi}^{\top}-D_U^{\top}\Omega]Q^{-1}Q\widetilde{w}\\
&= c\mathbf{L}^{-\top}[-D_R^{\top},\gamma I_d+D_{\Phi}^{\top}-D_U^{\top}\Omega]\begin{bmatrix}1\\w\end{bmatrix}\\
&= c\mathbf{L}^{-\top}[-D_R^{\top}+(\gamma I_d+D_{\Phi}^{\top}-D_U^{\top}\Omega)w], \tag*{(28)}
\end{aligned} B + w Q = c L − ⊤ [ − D R ⊤ , γ I d + D Φ ⊤ − D U ⊤ Ω ] Q − 1 Q w = c L − ⊤ [ − D R ⊤ , γ I d + D Φ ⊤ − D U ⊤ Ω ] [ 1 w ] = c L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] , (28)
B r w ~ Q = c e 0 ⊤ Q − 1 Q w ~ = c [ 1 , 0 1 × d ] [ 1 w ] = c , (29) \mathbf{B}_{r\widetilde{w}_Q} = ce_0^{\top}Q^{-1}Q\widetilde{w} = c[1,0_{1\times d}]\begin{bmatrix}1\\w\end{bmatrix} = c, \tag*{(29)} B r w Q = c e 0 ⊤ Q − 1 Q w = c [ 1 , 0 1 × d ] [ 1 w ] = c , (29)
B U w ~ Q = c Ω J Q − 1 Q w ~ = c Ω [ 0 d × 1 , I d ] [ 1 w ] = c Ω w . (30) \mathbf{B}_{U\widetilde{w}_Q} = c\Omega JQ^{-1}Q\widetilde{w} = c\Omega[0_{d\times1},I_d]\begin{bmatrix}1\\w\end{bmatrix} = c\Omega w. \tag*{(30)} B U w Q = c Ω J Q − 1 Q w = c Ω [ 0 d × 1 , I d ] [ 1 w ] = c Ω w . (30)
The fourth and sixth block rows of P 2 p ( 1 ) \mathbf{P}_2p^{(1)} P 2 p ( 1 ) may contain arbitrary terms arising from the corresponding ⋆ \star ⋆ blocks. However, the Ψ \Psi Ψ and W W W blocks of t i ( 1 ) t_i^{(1)} t i ( 1 ) are both zero, so these terms do not contribute to the bilinear score. Consequently,
( t i ( 1 ) ) ⊤ P 2 p ( 1 ) = ( ϕ i + D Φ ϕ ˉ i + , τ ) ⊤ B − w ~ Q + ( L ϕ ˉ i + , τ ) ⊤ B + w ~ Q + ( r i + 1 + D R ϕ ˉ i + , τ ) B r w ~ Q + ( w + D U ϕ ˉ i + , τ ) ⊤ B U w ~ Q = − c ( ϕ i + D Φ ϕ ˉ i + , τ ) ⊤ w + c ( L ϕ ˉ i + , τ ) ⊤ L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] + c ( r i + 1 + D R ϕ ˉ i + , τ ) + c ( w + D U ϕ ˉ i + , τ ) ⊤ Ω w . (31) \begin{aligned}
(t_i^{(1)})^{\top}\mathbf{P}_2p^{(1)}
={}&(\phi_i+D_{\Phi}\bar{\phi}_i^{+,\tau})^{\top}\mathbf{B}_{-\widetilde{w}_Q}
+(\mathbf{L}\bar{\phi}_i^{+,\tau})^{\top}\mathbf{B}_{+\widetilde{w}_Q}\\
&+(r_{i+1}+D_R\bar{\phi}_i^{+,\tau})\mathbf{B}_{r\widetilde{w}_Q}
+(w+D_U\bar{\phi}_i^{+,\tau})^{\top}\mathbf{B}_{U\widetilde{w}_Q}\\
={}&-c(\phi_i+D_{\Phi}\bar{\phi}_i^{+,\tau})^{\top}w
+c(\mathbf{L}\bar{\phi}_i^{+,\tau})^{\top}\mathbf{L}^{-\top}
[-D_R^{\top}+(\gamma I_d+D_{\Phi}^{\top}-D_U^{\top}\Omega)w]\\
&+c(r_{i+1}+D_R\bar{\phi}_i^{+,\tau})
+c(w+D_U\bar{\phi}_i^{+,\tau})^{\top}\Omega w. \tag*{(31)}
\end{aligned} ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) = = ( ϕ i + D Φ ϕ ˉ i + , τ ) ⊤ B − w Q + ( L ϕ ˉ i + , τ ) ⊤ B + w Q + ( r i + 1 + D R ϕ ˉ i + , τ ) B r w Q + ( w + D U ϕ ˉ i + , τ ) ⊤ B U w Q − c ( ϕ i + D Φ ϕ ˉ i + , τ ) ⊤ w + c ( L ϕ ˉ i + , τ ) ⊤ L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] + c ( r i + 1 + D R ϕ ˉ i + , τ ) + c ( w + D U ϕ ˉ i + , τ ) ⊤ Ω w . (31)
We simplify these terms one by one. First, − c ( ϕ i + D Φ ϕ ˉ i + , τ ) ⊤ w = − c ϕ i ⊤ w − c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w -c(\phi_i+D_{\Phi}\bar{\phi}_{i}^{+,\tau})^{\top}w=-c\phi_i^{\top}w-c(\bar{\phi}_{i}^{+,\tau})^{\top}D_{\Phi}^{\top}w − c ( ϕ i + D Φ ϕ ˉ i + , τ ) ⊤ w = − c ϕ i ⊤ w − c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w .
Next, since L ⊤ L − ⊤ = I d L^{\top}L^{-\top}=I_d L ⊤ L − ⊤ = I d ,
c ( ϕ ˉ i + , τ ) ⊤ L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] = c ( ϕ ˉ i + , τ ) ⊤ L ⊤ L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] = − c ( ϕ ˉ i + , τ ) ⊤ D R ⊤ + γ ( ϕ ˉ i + , τ ) ⊤ w + c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w − c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w . \begin{aligned}
c(\bar{\phi}_{i}^{+,\tau})^{\top}L^{-\top}\left[-D_R^{\top}+(\gamma I_d+D_{\Phi}^{\top}-D_U^{\top}\Omega)w\right] \\
&=c(\bar{\phi}_{i}^{+,\tau})^{\top}L^{\top}L^{-\top}\left[-D_R^{\top}+(\gamma I_d+D_{\Phi}^{\top}-D_U^{\top}\Omega)w\right] \\
&=-c(\bar{\phi}_{i}^{+,\tau})^{\top}D_R^{\top}+\gamma(\bar{\phi}_{i}^{+,\tau})^{\top}w+c(\bar{\phi}_{i}^{+,\tau})^{\top}D_{\Phi}^{\top}w-c(\bar{\phi}_{i}^{+,\tau})^{\top}D_U^{\top}\Omega w.
\end{aligned} c ( ϕ ˉ i + , τ ) ⊤ L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] = c ( ϕ ˉ i + , τ ) ⊤ L ⊤ L − ⊤ [ − D R ⊤ + ( γ I d + D Φ ⊤ − D U ⊤ Ω ) w ] = − c ( ϕ ˉ i + , τ ) ⊤ D R ⊤ + γ ( ϕ ˉ i + , τ ) ⊤ w + c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w − c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w .
The remaining two terms satisfy
c ( r i + 1 + D R ϕ ˉ i + , τ ) = c r i + 1 + c D R ϕ ˉ i + , τ , c(r_{i+1}+D_R\bar{\phi}_{i}^{+,\tau})=cr_{i+1}+cD_R\bar{\phi}_{i}^{+,\tau}, c ( r i + 1 + D R ϕ ˉ i + , τ ) = c r i + 1 + c D R ϕ ˉ i + , τ ,
c ( w + D U ϕ ˉ i + , τ ) ⊤ Ω w = c w ⊤ Ω w + c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w . c(w+D_U\bar{\phi}_{i}^{+,\tau})^{\top}\Omega w=cw^{\top}\Omega w+c(\bar{\phi}_{i}^{+,\tau})^{\top}D_U^{\top}\Omega w. c ( w + D U ϕ ˉ i + , τ ) ⊤ Ω w = c w ⊤ Ω w + c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w .
The terms involving D Φ D_{\Phi} D Φ , D R D_R D R , and D U D_U D U therefore cancel in pairs:
− c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w + c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w = 0 , -c(\bar{\phi}_{i}^{+,\tau})^{\top}D_{\Phi}^{\top}w+c(\bar{\phi}_{i}^{+,\tau})^{\top}D_{\Phi}^{\top}w=0, − c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w + c ( ϕ ˉ i + , τ ) ⊤ D Φ ⊤ w = 0 ,
− c ( ϕ ˉ i + , τ ) ⊤ D R ⊤ + c D R ϕ ˉ i + , τ = 0 , -c(\bar{\phi}_{i}^{+,\tau})^{\top}D_R^{\top}+cD_R\bar{\phi}_{i}^{+,\tau}=0, − c ( ϕ ˉ i + , τ ) ⊤ D R ⊤ + c D R ϕ ˉ i + , τ = 0 ,
− c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w + c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w = 0. -c(\bar{\phi}_{i}^{+,\tau})^{\top}D_U^{\top}\Omega w+c(\bar{\phi}_{i}^{+,\tau})^{\top}D_U^{\top}\Omega w=0. − c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w + c ( ϕ ˉ i + , τ ) ⊤ D U ⊤ Ω w = 0.
For the second cancellation, we used the fact that D R ϕ ˉ i + , τ D_R\bar{\phi}_{i}^{+,\tau} D R ϕ ˉ i + , τ is a scalar, so it equals its transpose ( ϕ ˉ i + , τ ) ⊤ D R ⊤ (\bar{\phi}_{i}^{+,\tau})^{\top}D_R^{\top} ( ϕ ˉ i + , τ ) ⊤ D R ⊤ . Moreover, since Ω ⊤ = − Ω \Omega^{\top}=-\Omega Ω ⊤ = − Ω ,
w ⊤ Ω w = ( w ⊤ Ω w ) ⊤ = w ⊤ Ω ⊤ w = − w ⊤ Ω w , w^{\top}\Omega w=(w^{\top}\Omega w)^{\top}=w^{\top}\Omega^{\top}w=-w^{\top}\Omega w, w ⊤ Ω w = ( w ⊤ Ω w ) ⊤ = w ⊤ Ω ⊤ w = − w ⊤ Ω w ,
and therefore w ⊤ Ω w = 0 w^{\top}\Omega w=0 w ⊤ Ω w = 0 . Substituting these identities into (A.15) yields
( t i ( 1 ) ) ⊤ P 2 p ( 1 ) = − c ϕ i ⊤ w + c γ ( ϕ ˉ i + , τ ) ⊤ w + c r i + 1 = c ( r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ) . (32) \begin{aligned}
(t_i^{(1)})^{\top}P_2p^{(1)}=-c\phi_i^{\top}w+c\gamma(\bar{\phi}_{i}^{+,\tau})^{\top}w+cr_{i+1} \\
&=c(r_{i+1}+\gamma w^{\top}\bar{\phi}_{i}^{+,\tau}-w^{\top}\phi_i). \tag*{(32)}
\end{aligned} ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) = − c ϕ i ⊤ w + c γ ( ϕ ˉ i + , τ ) ⊤ w + c r i + 1 = c ( r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ) . (32)
Define δ i ( τ ) : = r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i \delta_i^{(\tau)}:=r_{i+1}+\gamma w^{\top}\bar{\phi}_{i}^{+,\tau}-w^{\top}\phi_i δ i ( τ ) := r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i . Then ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) = c δ i ( τ ) (t_i^{(1)})^{\top}P_2p^{(1)}=c\delta_i^{(\tau)} ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) = c δ i ( τ ) .
Therefore, the last d d d coordinates of the second-layer update are
Π o u t Δ p = 1 n ∑ j = 1 N Π o u t V 2 h j ( 1 ) ( ( h j ( 1 ) ) ⊤ P 2 p ( 1 ) ) = 1 n ∑ i = 0 n − 1 Π o u t V 2 t i ( 1 ) ( ( t i ( 1 ) ) ⊤ P 2 p ( 1 ) ) = 1 n ∑ i = 0 n − 1 ( α c ϕ i ) c δ i ( τ ) = α n ∑ i = 0 n − 1 ϕ i δ i ( τ ) . (33) \begin{aligned}
\Pi_{\mathrm{out}}\Delta p=\frac{1}{n}\sum_{j=1}^{N}\Pi_{\mathrm{out}}V_2h_j^{(1)}((h_j^{(1)})^{\top}P_2p^{(1)})=\frac{1}{n}\sum_{i=0}^{n-1}\Pi_{\mathrm{out}}V_2t_i^{(1)}((t_i^{(1)})^{\top}P_2p^{(1)}) \\
&=\frac{1}{n}\sum_{i=0}^{n-1}\left(\frac{\alpha}{c}\phi_i\right)c\delta_i^{(\tau)}=\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i\delta_i^{(\tau)}. \tag*{(33)}
\end{aligned} Π out Δ p = n 1 j = 1 ∑ N Π out V 2 h j ( 1 ) (( h j ( 1 ) ) ⊤ P 2 p ( 1 ) ) = n 1 i = 0 ∑ n − 1 Π out V 2 t i ( 1 ) (( t i ( 1 ) ) ⊤ P 2 p ( 1 ) ) = n 1 i = 0 ∑ n − 1 ( c α ϕ i ) c δ i ( τ ) = n α i = 0 ∑ n − 1 ϕ i δ i ( τ ) . (33)
The second equality follows from (A.10), and the third uses (A.9) and (A.16).
Since the W W W block of the first-layer parameter token is w ~ Q = [ ρ + b ⊤ w ; w ] \widetilde{w}_Q=[\rho+b^{\top}w;\,w] w Q = [ ρ + b ⊤ w ; w ] , its last d d d coordinates are
Π o u t p ( 1 ) = J w ~ Q = J Q w ~ = J w ~ = [ 0 d × 1 , I d ] [ 1 w ] = w . \Pi_{\mathrm{out}}p^{(1)}=J\widetilde{w}_Q=JQ\widetilde{w}=J\widetilde{w}=[0_{d\times1},I_d]\begin{bmatrix}1\\w\end{bmatrix}=w. Π out p ( 1 ) = J w Q = J Q w = J w = [ 0 d × 1 , I d ] [ 1 w ] = w .
Here J Q = J JQ=J J Q = J follows directly from the prescribed form of Q Q Q . The residual connection thus gives
TF τ ( H ( 0 ) ) = Π o u t p ( 2 ) = Π o u t p ( 1 ) + Π o u t Δ p = w + α n ∑ i = 0 n − 1 ϕ i δ i ( τ ) = w + α n ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ] . \begin{aligned}
\operatorname{TF}_{\tau}(H^{(0)})=\Pi_{\mathrm{out}}p^{(2)}=\Pi_{\mathrm{out}}p^{(1)}+\Pi_{\mathrm{out}}\Delta p=w+\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i\delta_i^{(\tau)} \\
&=w+\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i\left[r_{i+1}+\gamma w^{\top}\bar{\phi}_{i}^{+,\tau}-w^{\top}\phi_i\right].
\end{aligned} TF τ ( H ( 0 ) ) = Π out p ( 2 ) = Π out p ( 1 ) + Π out Δ p = w + n α i = 0 ∑ n − 1 ϕ i δ i ( τ ) = w + n α i = 0 ∑ n − 1 ϕ i [ r i + 1 + γ w ⊤ ϕ ˉ i + , τ − w ⊤ ϕ i ] .
The readout extracts precisely these last d d d coordinates of p ( 2 ) p^{(2)} p ( 2 ) . Hence we have proved part (i). Notice that this argument does not prescribe the first coordinate of the W W W block of p ( 2 ) p^{(2)} p ( 2 ) ; that coordinate is outside the readout.
(ii) Recall that q i , a : = w ⊤ ϕ i , a q_{i,a}:=w^{\top}\phi_{i,a} q i , a := w ⊤ ϕ i , a , q i ⋆ : = max a ∈ A q i , a q_i^{\star}:=\max_{a\in A}q_{i,a} q i ⋆ := max a ∈ A q i , a , A i ⋆ : = arg max a ∈ A q i , a A_i^{\star}:=\arg\max_{a\in A}q_{i,a} A i ⋆ := arg max a ∈ A q i , a , K i : = ∣ A i ⋆ ∣ K_i:=|A_i^{\star}| K i := ∣ A i ⋆ ∣ . The soft backup value is q ˉ i ( τ ) : = w ⊤ ϕ ˉ i + , τ = ∑ a ∈ A π i , a q i , a \bar{q}_i^{(\tau)}:=w^{\top}\bar{\phi}_{i}^{+,\tau}=\sum_{a\in A}\pi_{i,a}q_{i,a} q ˉ i ( τ ) := w ⊤ ϕ ˉ i + , τ = ∑ a ∈ A π i , a q i , a . Since ∑ a ∈ A π i , a = 1 \sum_{a\in A}\pi_{i,a}=1 ∑ a ∈ A π i , a = 1 and q i , a = q i ⋆ q_{i,a}=q_i^{\star} q i , a = q i ⋆ for every a ∈ A i ⋆ a\in A_i^{\star} a ∈ A i ⋆ ,
q i ⋆ − q ˉ i ( τ ) = ∑ a ∈ A π i , a q i ⋆ − ∑ a ∈ A π i , a q i , a = ∑ a ∈ A π i , a ( q i ⋆ − q i , a ) = ∑ a ∉ A i ⋆ π i , a ( q i ⋆ − q i , a ) . (34) q_i^{\star}-\bar{q}_i^{(\tau)}=\sum_{a\in A}\pi_{i,a}q_i^{\star}-\sum_{a\in A}\pi_{i,a}q_{i,a}=\sum_{a\in A}\pi_{i,a}(q_i^{\star}-q_{i,a})=\sum_{a\notin A_i^{\star}}\pi_{i,a}(q_i^{\star}-q_{i,a}). \tag*{(34)} q i ⋆ − q ˉ i ( τ ) = a ∈ A ∑ π i , a q i ⋆ − a ∈ A ∑ π i , a q i , a = a ∈ A ∑ π i , a ( q i ⋆ − q i , a ) = a ∈ / A i ⋆ ∑ π i , a ( q i ⋆ − q i , a ) . (34)
In particular, q i ⋆ − q ˉ i ( τ ) ≥ 0 q_i^\star-\bar{q}_i^{(\tau)} \ge0 q i ⋆ − q ˉ i ( τ ) ≥ 0 . Since ∣ q i , a ∣ ≤ B q |q_{i,a}| \le B_q ∣ q i , a ∣ ≤ B q and ∣ q i ⋆ ∣ ≤ B q |q_i^\star| \le B_q ∣ q i ⋆ ∣ ≤ B q , we have 0 ≤ q i ⋆ − q i , a ≤ ∣ q i ⋆ ∣ + ∣ q i , a ∣ ≤ 2 B q 0 \le q_i^\star-q_{i,a} \le|q_i^\star|+|q_{i,a}| \le2B_q 0 ≤ q i ⋆ − q i , a ≤ ∣ q i ⋆ ∣ + ∣ q i , a ∣ ≤ 2 B q . Therefore, 0 ≤ q i ⋆ − q ˉ i ( τ ) ≤ 2 B q ∑ a ∉ A i ⋆ π i , a τ 0 \le q_i^\star-\bar{q}_i^{(\tau)} \le2B_q\sum_{a\notin A_i^\star}\pi_{i,a}^{\tau} 0 ≤ q i ⋆ − q ˉ i ( τ ) ≤ 2 B q ∑ a ∈ / A i ⋆ π i , a τ . If A i ⋆ ≠ A A_i^\star\ne A A i ⋆ = A , Lemma A.1 gives
∑ a ∉ A i ⋆ π i , a τ = 1 − ∑ a ∈ A i ⋆ π i , a τ ≤ m − K i K i e − Δ i / τ . (35) \sum_{a\notin A_i^\star}\pi_{i,a}^{\tau}=1-\sum_{a\in A_i^\star}\pi_{i,a}^{\tau}\le\frac{m-K_i}{K_i}e^{-\Delta_i/\tau}. \tag*{(35)} a ∈ / A i ⋆ ∑ π i , a τ = 1 − a ∈ A i ⋆ ∑ π i , a τ ≤ K i m − K i e − Δ i / τ . (35)
Hence
0 ≤ q i ⋆ − q ˉ i ( τ ) ≤ 2 B q m − K i K i e − Δ i / τ . (36) 0\le q_i^\star-\bar{q}_i^{(\tau)}\le2B_q\frac{m-K_i}{K_i}e^{-\Delta_i/\tau}. \tag*{(36)} 0 ≤ q i ⋆ − q ˉ i ( τ ) ≤ 2 B q K i m − K i e − Δ i / τ . (36)
If A i ⋆ = A A_i^\star=A A i ⋆ = A , then all actions have the same value and q i ⋆ − q ˉ i ( τ ) = 0 q_i^\star-\bar{q}_i^{(\tau)}=0 q i ⋆ − q ˉ i ( τ ) = 0 for every τ > 0 \tau>0 τ > 0 .
The difference between the hard Q-learning update and the Transformer update is therefore
w Q − w T F ( τ ) = α n ∑ i = 0 n − 1 ϕ i [ ( r i + 1 + γ q i ⋆ − w ⊤ ϕ i ) − ( r i + 1 + γ q ˉ i ( τ ) − w ⊤ ϕ i ) ] = α γ n ∑ i = 0 n − 1 ϕ i ( q i ⋆ − q ˉ i ( τ ) ) . \mathbf{w}_Q-\mathbf{w}_{\mathrm{TF}}^{(\tau)}
=\frac{\alpha}{n}\sum_{i=0}^{n-1}\boldsymbol{\phi}_i\left[\left(r_{i+1}+\gamma q_i^\star-\mathbf{w}^{\top}\boldsymbol{\phi}_i\right)-\left(r_{i+1}+\gamma\bar{q}_i^{(\tau)}-\mathbf{w}^{\top}\boldsymbol{\phi}_i\right)\right]
=\frac{\alpha\gamma}{n}\sum_{i=0}^{n-1}\boldsymbol{\phi}_i\left(q_i^\star-\bar{q}_i^{(\tau)}\right). w Q − w TF ( τ ) = n α i = 0 ∑ n − 1 ϕ i [ ( r i + 1 + γ q i ⋆ − w ⊤ ϕ i ) − ( r i + 1 + γ q ˉ i ( τ ) − w ⊤ ϕ i ) ] = n α γ i = 0 ∑ n − 1 ϕ i ( q i ⋆ − q ˉ i ( τ ) ) .
By the triangle inequality and ∥ ϕ i ∥ 2 ≤ B ϕ \|\boldsymbol{\phi}_i\|_2\le B_\phi ∥ ϕ i ∥ 2 ≤ B ϕ ,
∥ w Q − w T F ( τ ) ∥ 2 ≤ α γ n ∑ i = 0 n − 1 ∥ ϕ i ∥ 2 ∣ q i ⋆ − q ˉ i ( τ ) ∣ ≤ α γ B ϕ n ∑ i : A i ⋆ ≠ A ( q i ⋆ − q ˉ i ( τ ) ) ≤ 2 α γ B q B ϕ n ∑ i : A i ⋆ ≠ A m − K i K i e − Δ i / τ . (37) \begin{aligned}
\left\|\mathbf{w}_Q-\mathbf{w}_{\mathrm{TF}}^{(\tau)}\right\|_2
\le\frac{\alpha\gamma}{n}\sum_{i=0}^{n-1}\|\boldsymbol{\phi}_i\|_2|q_i^\star-\bar{q}_i^{(\tau)}|
\le\frac{\alpha\gamma B_\phi}{n}\sum_{i:A_i^\star\ne A}\left(q_i^\star-\bar{q}_i^{(\tau)}\right) \\
&\le\frac{2\alpha\gamma B_qB_\phi}{n}\sum_{i:A_i^\star\ne A}\frac{m-K_i}{K_i}e^{-\Delta_i/\tau}. \tag*{(37)}
\end{aligned} w Q − w TF ( τ ) 2 ≤ n α γ i = 0 ∑ n − 1 ∥ ϕ i ∥ 2 ∣ q i ⋆ − q ˉ i ( τ ) ∣ ≤ n α γ B ϕ i : A i ⋆ = A ∑ ( q i ⋆ − q ˉ i ( τ ) ) ≤ n 2 α γ B q B ϕ i : A i ⋆ = A ∑ K i m − K i e − Δ i / τ . (37)
The second inequality uses the nonnegativity of the backup gap and the fact that this gap is zero whenever A i ⋆ = A A_i^\star=A A i ⋆ = A ; the last inequality uses (A.20).
Since the number of transitions is finite and each Δ i > 0 \Delta_i>0 Δ i > 0 in the displayed sum, the right-hand side converges to zero as τ ↓ 0 \tau\downarrow0 τ ↓ 0 . Thus lim τ ↓ 0 w T F ( τ ) = w Q \lim_{\tau\downarrow0}\mathbf{w}_{\mathrm{TF}}^{(\tau)}=\mathbf{w}_Q lim τ ↓ 0 w TF ( τ ) = w Q . In particular, if m ≥ 2 m\ge2 m ≥ 2 and every maximizer is unique, then K i = 1 K_i=1 K i = 1 and 1 − π i , a i ⋆ τ ≤ ( m − 1 ) e − Δ i / τ 1-\pi_{i,a_i^\star}^{\tau}\le(m-1)e^{-\Delta_i/\tau} 1 − π i , a i ⋆ τ ≤ ( m − 1 ) e − Δ i / τ . Since there are finitely many transitions, Δ min : = min 0 ≤ i ≤ n − 1 Δ i > 0 \Delta_{\min}:=\min_{0\le i\le n-1}\Delta_i>0 Δ m i n := min 0 ≤ i ≤ n − 1 Δ i > 0 . Consequently, e − Δ i / τ ≤ e − Δ min / τ e^{-\Delta_i/\tau}\le e^{-\Delta_{\min}/\tau} e − Δ i / τ ≤ e − Δ m i n / τ , and hence
∥ w Q − w T F ( τ ) ∥ 2 ≤ 2 α γ B q B ϕ ( m − 1 ) n ∑ i = 0 n − 1 e − Δ i / τ ≤ 2 α γ B q B ϕ ( m − 1 ) n n e − Δ min / τ = 2 α γ B q B ϕ ( m − 1 ) e − Δ min / τ . \begin{aligned}
\left\|\mathbf{w}_Q-\mathbf{w}_{\mathrm{TF}}^{(\tau)}\right\|_2
\le\frac{2\alpha\gamma B_qB_\phi(m-1)}{n}\sum_{i=0}^{n-1}e^{-\Delta_i/\tau}
\le\frac{2\alpha\gamma B_qB_\phi(m-1)}{n}ne^{-\Delta_{\min}/\tau} \\
&=2\alpha\gamma B_qB_\phi(m-1)e^{-\Delta_{\min}/\tau}.
\end{aligned} w Q − w TF ( τ ) 2 ≤ n 2 α γ B q B ϕ ( m − 1 ) i = 0 ∑ n − 1 e − Δ i / τ ≤ n 2 α γ B q B ϕ ( m − 1 ) n e − Δ m i n / τ = 2 α γ B q B ϕ ( m − 1 ) e − Δ m i n / τ .
If m = 1 m=1 m = 1 , all backup gaps are zero and w T F ( τ ) = w Q \mathbf{w}_{\mathrm{TF}}^{(\tau)}=\mathbf{w}_Q w TF ( τ ) = w Q for every τ > 0 \tau>0 τ > 0 . This proves the claimed exponential approximation bound.
We next consider whether emergence of tabular Q-learning algorithms can be achieved within Transformers. Let e ( s , a ) e(s,a) e ( s , a ) denote the one-hot basis vector for state-action pair ( s , a ) (s,a) ( s , a ) .
Corollary A.3 (Transformer implements tabular Q-learning). Under the conditions of the preceding theorem, let S S S and A A A be finite, and consider ϕ ( s , a ) = e ( s , a ) ∈ R ∣ S ∣ ∣ A ∣ \phi(s,a)=e_{(s,a)}\in\mathbb{R}^{|S||A|} ϕ ( s , a ) = e ( s , a ) ∈ R ∣ S ∣∣ A ∣ , w ( s , a ) = Q ( s , a ) \mathbf{w}_{(s,a)}=Q(s,a) w ( s , a ) = Q ( s , a ) . The two-layer Transformer constructed in the preceding theorem implements the batch tabular Q-learning update up to softmax approximation error.
Proof. According to Theorem 1 , the batch-update formula using n n n samples is
TF τ ( H ( 0 ) ; P 1 , V 1 , P 2 , V 2 ) = w + α n ∑ i = 0 n − 1 e ( s i , a i ) [ r i + 1 + γ ∑ b ∈ A π i , b τ w ( s i + 1 , b ) − w ( s i , a i ) ] . \operatorname{TF}_{\tau}\left(\mathrm{H}^{(0)};\mathbf{P}_1,\mathbf{V}_1,\mathbf{P}_2,\mathbf{V}_2\right)
=\mathbf{w}+\frac{\alpha}{n}\sum_{i=0}^{n-1}e_{(s_i,a_i)}\left[r_{i+1}+\gamma\sum_{b\in A}\pi_{i,b}^{\tau}\mathbf{w}(s_{i+1},b)-\mathbf{w}(s_i,a_i)\right]. TF τ ( H ( 0 ) ; P 1 , V 1 , P 2 , V 2 ) = w + n α i = 0 ∑ n − 1 e ( s i , a i ) [ r i + 1 + γ b ∈ A ∑ π i , b τ w ( s i + 1 , b ) − w ( s i , a i ) ] .
where π i , a τ : = exp ( Q ( s i + 1 , a ) / τ ) / ∑ b ∈ A exp ( Q ( s i + 1 , b ) / τ ) \pi_{i,a}^{\tau}:=\exp(Q(s_{i+1},a)/\tau)/\sum_{b\in A}\exp(Q(s_{i+1},b)/\tau) π i , a τ := exp ( Q ( s i + 1 , a ) / τ ) / ∑ b ∈ A exp ( Q ( s i + 1 , b ) / τ ) . Only the weight components corresponding to visited ( s i , a i ) (s_i,a_i) ( s i , a i ) samples are updated; all remaining coordinates are multiplied by zero and thus remain unchanged.
The equivalent update rule for the Q-values reads
[ TF τ ( H ( 0 ) ; P 1 , V 1 , P 2 , V 2 ) ] ( s , a ) = Q ( s , a ) + α n ∑ i : ( s i , a i ) = ( s , a ) [ r i + 1 + γ ∑ b ∈ A π i , b τ Q ( s i + 1 , b ) − Q ( s i , a i ) ] . \left[\operatorname{TF}_{\tau}\left(\mathrm{H}^{(0)};\mathbf{P}_1,\mathbf{V}_1,\mathbf{P}_2,\mathbf{V}_2\right)\right]_{(s,a)}
=Q(s,a)+\frac{\alpha}{n}\sum_{i:(s_i,a_i)=(s,a)}
\left[r_{i+1}+\gamma\sum_{b\in A}\pi_{i,b}^{\tau}Q(s_{i+1},b)-Q(s_i,a_i)\right]. [ TF τ ( H ( 0 ) ; P 1 , V 1 , P 2 , V 2 ) ] ( s , a ) = Q ( s , a ) + n α i : ( s i , a i ) = ( s , a ) ∑ [ r i + 1 + γ b ∈ A ∑ π i , b τ Q ( s i + 1 , b ) − Q ( s i , a i ) ] .
Notably, only state-action pairs ( s , a ) (s,a) ( s , a ) appearing within the mini-batch receive updates; all other entries stay fixed.
Training Algorithm
Independent-context gradient variance
Let ℓ ( θ ; z ) : = 1 2 ∥ TF θ ( H ( z ) ) − w s o f t ( τ ) ∥ 2 2 \ell(\theta;\mathbf{z}) := \frac{1}{2}\lVert\operatorname{TF}_{\theta}(\mathbf{H}(\mathbf{z}))-\mathbf{w}_{\mathrm{soft}}^{(\tau)}\rVert_{2}^{2} ℓ ( θ ; z ) := 2 1 ∥ TF θ ( H ( z )) − w soft ( τ ) ∥ 2 2 , and L ( θ ) : = E z ∼ D [ ℓ ( θ ; z ) ] \mathcal{L}(\theta) := \mathbb{E}_{\mathbf{z}\sim\mathcal{D}}[\ell(\theta;\mathbf{z})] L ( θ ) := E z ∼ D [ ℓ ( θ ; z )] . Fix θ \theta θ , and let z 1 , … , z B ∼ i . i . d . D \mathbf{z}_{1},\ldots,\mathbf{z}_{B} \mathrel{\overset{\mathrm{i.i.d.}}{\sim}} \mathcal{D} z 1 , … , z B ∼ i.i.d. D be independent of θ \theta θ . Define g ( θ ; z ) = ∇ θ ℓ ( θ ; z ) g(\theta;\mathbf{z})=\nabla_{\theta}\ell(\theta;\mathbf{z}) g ( θ ; z ) = ∇ θ ℓ ( θ ; z ) , g ^ B ( θ ) = 1 B ∑ b = 1 B g ( θ ; z b ) \widehat{g}_{B}(\theta)=\frac{1}{B}\sum_{b=1}^{B}g(\theta;\mathbf{z}_{b}) g B ( θ ) = B 1 ∑ b = 1 B g ( θ ; z b ) .
The following proposition shows that independent-context minibatching preserves the population-gradient direction in expectation while reducing context-specific gradient fluctuations.
Proposition B.1 (Independent-context minibatch gradient). Assume E ∥ g ( θ ; z ) ∥ 2 2 < ∞ \mathbb{E}\lVert g(\theta;\mathbf{z})\rVert_{2}^{2}<\infty E ∥ g ( θ ; z ) ∥ 2 2 < ∞ and that differentiation and expectation can be interchanged. Then
E [ g ^ B ( θ ) ∣ θ ] = ∇ L ( θ ) , (38) \mathbb{E}[\widehat{g}_{B}(\theta)\mid\theta]=\nabla\mathcal{L}(\theta), \tag*{(38)} E [ g B ( θ ) ∣ θ ] = ∇ L ( θ ) , (38) Cov ( g ^ B ( θ ) ∣ θ ) = 1 B Cov ( g ( θ ; z ) ∣ θ ) , (39) \operatorname{Cov}(\widehat{g}_{B}(\theta)\mid\theta)=\frac{1}{B}\operatorname{Cov}(g(\theta;\mathbf{z})\mid\theta), \tag*{(39)} Cov ( g B ( θ ) ∣ θ ) = B 1 Cov ( g ( θ ; z ) ∣ θ ) , (39) E [ ∥ g ^ B ( θ ) − ∇ L ( θ ) ∥ 2 2 | θ ] = 1 B E [ ∥ g ( θ ; z ) − ∇ L ( θ ) ∥ 2 2 | θ ] . (40) \mathbb{E}\left[\left\lVert\widehat{g}_{B}(\theta)-\nabla\mathcal{L}(\theta)\right\rVert_{2}^{2}\middle|\theta\right]=\frac{1}{B}\mathbb{E}\left[\left\lVert g(\theta;\mathbf{z})-\nabla\mathcal{L}(\theta)\right\rVert_{2}^{2}\middle|\theta\right]. \tag*{(40)} E [ ∥ g B ( θ ) − ∇ L ( θ ) ∥ 2 2 θ ] = B 1 E [ ∥ g ( θ ; z ) − ∇ L ( θ ) ∥ 2 2 θ ] . (40) Equivalently, for every deterministic direction v v v , Var ( v T g ^ B ( θ ) ∣ θ ) = 1 B Var ( v T g ( θ ; z ) ∣ θ ) \operatorname{Var}(v^{\mathsf{T}}\widehat{g}_{B}(\theta)\mid\theta)=\frac{1}{B}\operatorname{Var}(v^{\mathsf{T}}g(\theta;\mathbf{z})\mid\theta) Var ( v T g B ( θ ) ∣ θ ) = B 1 Var ( v T g ( θ ; z ) ∣ θ ) .
Proof. (i) Let μ ( θ ) : = E z ∼ D [ g ( θ ; z ) ∣ θ ] \mu(\theta):=\mathbb{E}_{\mathbf{z}\sim\mathcal{D}}[g(\theta;\mathbf{z})\mid\theta] μ ( θ ) := E z ∼ D [ g ( θ ; z ) ∣ θ ] . By the interchange of differentiation and expectation,
μ ( θ ) = E z ∼ D [ ∇ θ ℓ ( θ ; z ) ] = ∇ θ E z ∼ D [ ℓ ( θ ; z ) ] = ∇ L ( θ ) . \mu(\theta)=\mathbb{E}_{\mathbf{z}\sim\mathcal{D}}[\nabla_{\theta}\ell(\theta;\mathbf{z})]=\nabla_{\theta}\mathbb{E}_{\mathbf{z}\sim\mathcal{D}}[\ell(\theta;\mathbf{z})]=\nabla\mathcal{L}(\theta). μ ( θ ) = E z ∼ D [ ∇ θ ℓ ( θ ; z )] = ∇ θ E z ∼ D [ ℓ ( θ ; z )] = ∇ L ( θ ) .
Therefore, E [ g ^ B ( θ ) ∣ θ ] = 1 B ∑ b = 1 B E [ g ( θ ; z b ) ∣ θ ] = μ ( θ ) = ∇ L ( θ ) \mathbb{E}[\widehat{g}_{B}(\theta)\mid\theta]=\frac{1}{B}\sum_{b=1}^{B}\mathbb{E}[g(\theta;\mathbf{z}_{b})\mid\theta]=\mu(\theta)=\nabla\mathcal{L}(\theta) E [ g B ( θ ) ∣ θ ] = B 1 ∑ b = 1 B E [ g ( θ ; z b ) ∣ θ ] = μ ( θ ) = ∇ L ( θ ) , which proves (B.1).
(ii) Now define the centered gradients ξ b : = g ( θ ; z b ) − μ ( θ ) \xi_{b}:=g(\theta;\mathbf{z}_{b})-\mu(\theta) ξ b := g ( θ ; z b ) − μ ( θ ) . Conditioned on θ \theta θ , the random vectors ξ 1 , … , ξ B \xi_{1},\ldots,\xi_{B} ξ 1 , … , ξ B are independent and identically distributed, with E [ ξ b ∣ θ ] = 0 \mathbb{E}[\xi_{b}\mid\theta]=0 E [ ξ b ∣ θ ] = 0 . Moreover, g ^ B ( θ ) − ∇ L ( θ ) = 1 B ∑ b = 1 B ξ b \widehat{g}_{B}(\theta)-\nabla\mathcal{L}(\theta)=\frac{1}{B}\sum_{b=1}^{B}\xi_{b} g B ( θ ) − ∇ L ( θ ) = B 1 ∑ b = 1 B ξ b . Hence
Cov ( g ^ B ∣ θ ) = E [ ( 1 B ∑ b = 1 B ξ b ) ( 1 B ∑ b ′ = 1 B ξ b ′ ) T ∣ θ ] = 1 B 2 ∑ b = 1 B E [ ξ b ξ b T ∣ θ ] + 1 B 2 ∑ b ≠ b ′ E [ ξ b ξ b ′ T ∣ θ ] . \begin{aligned}
\operatorname{Cov}(\widehat{g}_{B}\mid\theta)=\mathbb{E}\left[\left.\left(\frac{1}{B}\sum_{b=1}^{B}\xi_{b}\right)\left(\frac{1}{B}\sum_{b'=1}^{B}\xi_{b'}\right)^{\mathsf{T}}\right|\theta\right] \\
&=\frac{1}{B^{2}}\sum_{b=1}^{B}\mathbb{E}[\xi_{b}\xi_{b}^{\mathsf{T}}\mid\theta]+\frac{1}{B^{2}}\sum_{b\ne b'}\mathbb{E}[\xi_{b}\xi_{b'}^{\mathsf{T}}\mid\theta].
\end{aligned} Cov ( g B ∣ θ ) = E ( B 1 b = 1 ∑ B ξ b ) ( B 1 b ′ = 1 ∑ B ξ b ′ ) T θ = B 2 1 b = 1 ∑ B E [ ξ b ξ b T ∣ θ ] + B 2 1 b = b ′ ∑ E [ ξ b ξ b ′ T ∣ θ ] .
For b ≠ b ′ b\ne b' b = b ′ , conditional independence and centering give E [ ξ b ξ b ′ T ∣ θ ] = E [ ξ b ∣ θ ] E [ ξ b ′ T ∣ θ ] = 0 \mathbb{E}[\xi_{b}\xi_{b'}^{\mathsf{T}}\mid\theta]=\mathbb{E}[\xi_{b}\mid\theta]\mathbb{E}[\xi_{b'}^{\mathsf{T}}\mid\theta]=0 E [ ξ b ξ b ′ T ∣ θ ] = E [ ξ b ∣ θ ] E [ ξ b ′ T ∣ θ ] = 0 . Thus Cov ( g ^ B ∣ θ ) = B B 2 Cov ( g ( θ ; z ) ∣ θ ) = 1 B Cov ( g ( θ ; z ) ∣ θ ) \operatorname{Cov}(\widehat{g}_{B}\mid\theta)=\frac{B}{B^{2}}\operatorname{Cov}(g(\theta;\mathbf{z})\mid\theta)=\frac{1}{B}\operatorname{Cov}(g(\theta;\mathbf{z})\mid\theta) Cov ( g B ∣ θ ) = B 2 B Cov ( g ( θ ; z ) ∣ θ ) = B 1 Cov ( g ( θ ; z ) ∣ θ ) , which proves (B.2).
(iii) Taking the trace of the covariance identity yields
E [ ∥ g ^ B − ∇ L ( θ ) ∥ 2 2 ∣ θ ] = 1 B E [ ∥ g ( θ ; z ) − ∇ L ( θ ) ∥ 2 2 ∣ θ ] , \mathbb{E}\left[\left.\left\lVert\widehat{g}_{B}-\nabla\mathcal{L}(\theta)\right\rVert_{2}^{2}\right|\theta\right]=\frac{1}{B}\mathbb{E}\left[\left.\left\lVert g(\theta;\mathbf{z})-\nabla\mathcal{L}(\theta)\right\rVert_{2}^{2}\right|\theta\right], E [ ∥ g B − ∇ L ( θ ) ∥ 2 2 θ ] = B 1 E [ ∥ g ( θ ; z ) − ∇ L ( θ ) ∥ 2 2 θ ] ,
which is (B.3). Finally, for any deterministic v v v ,
Var ( v T g ^ B ∣ θ ) = v T Cov ( g ^ B ∣ θ ) v = 1 B v T Cov ( g ( θ ; z ) ∣ θ ) v , \operatorname{Var}(v^{\mathsf{T}}\widehat{g}_{B}\mid\theta)=v^{\mathsf{T}}\operatorname{Cov}(\widehat{g}_{B}\mid\theta)v=\frac{1}{B}v^{\mathsf{T}}\operatorname{Cov}(g(\theta;\mathbf{z})\mid\theta)v, Var ( v T g B ∣ θ ) = v T Cov ( g B ∣ θ ) v = B 1 v T Cov ( g ( θ ; z ) ∣ θ ) v ,
giving the directional variance identity.
Invariant parameter groups
Proposition B.2 (Invariant parameter groups). Assume that the context distribution D n \mathcal{D}_{n} D n is independent of θ \theta θ and satisfies the boundedness condition in Assumption 1 (i).
Let θ o u t \theta_{\mathrm{out}} θ out collect all entries of θ = ( P 1 , V 1 , P 2 , V 2 ) \theta=(P_{1},V_{1},P_{2},V_{2}) θ = ( P 1 , V 1 , P 2 , V 2 ) outside the following 16 blocks:
P 1 , Ψ K , V 1 , I Ψ , V 1 , W W , P 2 , I W , V 2 , W o u t I . P_{1,\Psi K},\ V_{1,I\Psi},\ V_{1,WW},\ P_{2,IW},\ V_{2,W_{\mathrm{out}}I}. P 1 , Ψ K , V 1 , I Ψ , V 1 , W W , P 2 , I W , V 2 , W out I . Under the update θ k + 1 = θ k − η k ∇ L ^ B ( θ k ) \theta^{k+1}=\theta^{k}-\eta_{k}\nabla\widehat{\mathcal{L}}_{B}(\theta^{k}) θ k + 1 = θ k − η k ∇ L B ( θ k ) , if θ o u t 0 = 0 \theta_{\mathrm{out}}^{0}=0 θ out 0 = 0 , then θ o u t k = 0 \theta_{\mathrm{out}}^{k}=0 θ out k = 0 for all k > 0 k>0 k > 0 .
Proof. Let S 16 = { θ : θ o u t = 0 } S_{16}=\{\theta:\theta_{\mathrm{out}}=0\} S 16 = { θ : θ out = 0 } . We will prove the pointwise identity
∇ θ o u t ℓ ( θ ; z ) = 0 , for every context z and every θ ∈ S 16 , (41) \nabla_{\theta_{\mathrm{out}}}\ell(\theta;z)=0,\qquad\text{for every context }z\text{ and every }\theta\in S_{16}, \tag*{(41)} ∇ θ out ℓ ( θ ; z ) = 0 , for every context z and every θ ∈ S 16 , (41)
where ℓ ( θ ; z ) = 1 2 ∥ f θ ( z ) − y τ ( z ) ∥ 2 2 \ell(\theta;z)=\frac{1}{2}\lVert f_\theta(z)-y_\tau(z)\rVert_2^2 ℓ ( θ ; z ) = 2 1 ∥ f θ ( z ) − y τ ( z ) ∥ 2 2 , f θ ( z ) = TF θ ( H ( z ) ) f_\theta(z)=\operatorname{TF}_\theta(H(z)) f θ ( z ) = TF θ ( H ( z )) , and y τ ( z ) = w s o f t ( τ ) ( z ) y_\tau(z)=w_{\mathrm{soft}}^{(\tau)}(z) y τ ( z ) = w soft ( τ ) ( z ) .
Here the context and teacher target are fixed when differentiating with respect to θ \theta θ . Throughout the proof, derivatives are taken in the full space of the four matrices. The condition θ ∈ S 16 \theta\in S_{16} θ ∈ S 16 is imposed only when evaluating these derivatives.
Fix z z z and θ ∈ S 16 \theta\in S_{16} θ ∈ S 16 . The input tokens t i t_i t i , c i , a c_{i,a} c i , a , and p p p are supported in K \mathcal{K} K , Ψ \Psi Ψ , and W W W , respectively. The first-layer mask allows t i t_i t i to attend only to { c i , a : a ∈ A } \{c_{i,a}:a\in\mathcal{A}\} { c i , a : a ∈ A } . Write
u i , a = c i , a T P 1 t i , π i , a = e u i , a ∑ b ∈ A e u i , b , c ˉ i = ∑ a ∈ A π i , a c i , a . (42) u_{i,a}=c_{i,a}^{\mathsf{T}}P_1t_i,\qquad\pi_{i,a}=\frac{e^{u_{i,a}}}{\sum_{b\in\mathcal{A}}e^{u_{i,b}}},\qquad\bar{c}_i=\sum_{a\in\mathcal{A}}\pi_{i,a}c_{i,a}. \tag*{(42)} u i , a = c i , a T P 1 t i , π i , a = ∑ b ∈ A e u i , b e u i , a , c ˉ i = a ∈ A ∑ π i , a c i , a . (42)
The probabilities π i , a \pi_{i,a} π i , a are the student’s current attention weights; no teacher parameter value is imposed on P 1 P_1 P 1 . Since each c i , a c_{i,a} c i , a is supported in Ψ \Psi Ψ , so is c ˉ i \bar{c}_i c ˉ i . Every candidate query and the parameter query have exactly one allowed key, namely p p p . Their attention weights are identically one, for arbitrary full matrices P 1 P_1 P 1 and V 1 V_1 V 1 . Consequently, the first-layer tokens satisfy
h i = t i + V 1 c ˉ i , c ^ i , a = c i , a + V 1 p , q = p + V 1 p . (43) h_i=t_i+V_1\bar{c}_i,\qquad\widehat{c}_{i,a}=c_{i,a}+V_1p,\qquad q=p+V_1p. \tag*{(43)} h i = t i + V 1 c ˉ i , c i , a = c i , a + V 1 p , q = p + V 1 p . (43)
On S 16 S_{16} S 16 , the only possibly nonzero blocks of V 1 V_1 V 1 are V 1 , I Ψ V_{1,I\Psi} V 1 , I Ψ and V 1 , W W V_{1,WW} V 1 , W W . Therefore supp ( V 1 c ˉ i ) ⊆ I \operatorname{supp}(V_1\bar{c}_i)\subseteq I supp ( V 1 c ˉ i ) ⊆ I , supp ( V 1 p ) ⊆ W \operatorname{supp}(V_1p)\subseteq W supp ( V 1 p ) ⊆ W . Because K ⊆ I \mathcal{K}\subseteq I K ⊆ I and the coordinate sets I I I , Ψ \Psi Ψ , W W W are pairwise disjoint, (B.6) gives
supp ( h i ) ⊆ I , supp ( c ^ i , a ) ⊆ Ψ ∪ W , supp ( q ) ⊆ W . (44) \operatorname{supp}(h_i)\subseteq I,\qquad\operatorname{supp}(\widehat{c}_{i,a})\subseteq\Psi\cup W,\qquad\operatorname{supp}(q)\subseteq W. \tag*{(44)} supp ( h i ) ⊆ I , supp ( c i , a ) ⊆ Ψ ∪ W , supp ( q ) ⊆ W . (44)
Neither q = p q=p q = p nor c ^ i , a = c i , a \widehat{c}_{i,a}=c_{i,a} c i , a = c i , a is required. In particular, V 1 , W W V_{1,WW} V 1 , W W can be any ( d + 1 ) × ( d + 1 ) (d+1)\times(d+1) ( d + 1 ) × ( d + 1 ) matrix.
Let Π = [ 0 d × ( 4 d + 2 ) , I d ] \Pi=[0_{d\times(4d+2)},I_d] Π = [ 0 d × ( 4 d + 2 ) , I d ] , V ~ 2 = Π V 2 \widetilde{V}_2=\Pi V_2 V 2 = Π V 2 . Write h 1 , … , h N h_1,\ldots,h_N h 1 , … , h N for all first-layer tokens, in their original order, with h N = q h_N=q h N = q . For arbitrary full matrices, the second-layer readout is
f θ ( z ) = Π q + 1 n ∑ j = 1 N ( V ~ 2 h j ) ( h j T P 2 q ) . (45) f_\theta(z)=\Pi q+\frac{1}{n}\sum_{j=1}^{N}(\widetilde{V}_2h_j)(h_j^{\mathsf{T}}P_2q). \tag*{(45)} f θ ( z ) = Π q + n 1 j = 1 ∑ N ( V 2 h j ) ( h j T P 2 q ) . (45)
To compute its full differential, define v j = V ~ 2 h j v_j=\widetilde{V}_2h_j v j = V 2 h j and σ j = h j T P 2 q \sigma_j=h_j^{\mathsf{T}}P_2q σ j = h j T P 2 q . The product rule gives
d ( v j σ j ) = σ j ( Π d V 2 h j + V ~ 2 d h j ) + v j ( ( d h j ) T P 2 q + h j T ( d P 2 ) q + h j T P 2 d q ) . (46) \mathrm{d}(v_j\sigma_j)=\sigma_j\left(\Pi\,\mathrm{d}V_2\,h_j+\widetilde{V}_2\,\mathrm{d}h_j\right)+v_j\left((\mathrm{d}h_j)^{\mathsf{T}}P_2q+h_j^{\mathsf{T}}(\mathrm{d}P_2)q+h_j^{\mathsf{T}}P_2\,\mathrm{d}q\right). \tag*{(46)} d ( v j σ j ) = σ j ( Π d V 2 h j + V 2 d h j ) + v j ( ( d h j ) T P 2 q + h j T ( d P 2 ) q + h j T P 2 d q ) . (46)
We now evaluate this differential at θ ∈ S 16 \theta\in S_{16} θ ∈ S 16 . Since V 2 V_2 V 2 has nonzero entries only in ( W o u t , I ) (W_{\mathrm{out}},I) ( W out , I ) , V ~ 2 \widetilde{V}_2 V 2 has nonzero columns only in I I I . Similarly, P 2 P_2 P 2 has nonzero entries only in ( I , W ) (I,W) ( I , W ) , and q q q is supported in W W W , so supp ( P 2 q ) ⊆ I \operatorname{supp}(P_2q)\subseteq I supp ( P 2 q ) ⊆ I . For every candidate token and for the parameter token considered as a key/value token, (B.7) therefore implies
v j = V ~ 2 h j = 0 d , σ j = h j T P 2 q = 0. (47) v_j=\widetilde{V}_2h_j=0_d,\qquad\sigma_j=h_j^{\mathsf{T}}P_2q=0. \tag*{(47)} v j = V 2 h j = 0 d , σ j = h j T P 2 q = 0. (47)
Substituting (B.10) into (B.9), every term vanishes:
d ( v j σ j ) = 0 for every full-matrix perturbation d θ . \mathrm{d}(v_j\sigma_j)=0\quad\text{for every full-matrix perturbation }\mathrm{d}\theta. d ( v j σ j ) = 0 for every full-matrix perturbation d θ .
For a transition token, write a i = V ~ 2 h i a_i=\widetilde{V}_2h_i a i = V 2 h i , s i = h i T P 2 q s_i=h_i^{\mathsf{T}}P_2q s i = h i T P 2 q , and e = f θ ( z ) − y τ ( z ) e=f_\theta(z)-y_\tau(z) e = f θ ( z ) − y τ ( z ) . The full differential evaluated on S 16 S_{16} S 16 is
d f θ ( z ) = Π d q + 1 n ∑ i = 0 n − 1 s i ( Π d V 2 h i + V ~ 2 d h i ) + 1 n ∑ i = 0 n − 1 a i ( ( d h i ) T P 2 q + h i T ( d P 2 ) q + h i T P 2 d q ) . (48) \begin{aligned}
\mathrm{d}f_\theta(z)
&=\Pi\,\mathrm{d}q+\frac{1}{n}\sum_{i=0}^{n-1}s_i\left(\Pi\,\mathrm{d}V_2\,h_i+\widetilde{V}_2\,\mathrm{d}h_i\right)\\
&\quad+\frac{1}{n}\sum_{i=0}^{n-1}a_i\left((\mathrm{d}h_i)^{\mathsf{T}}P_2q+h_i^{\mathsf{T}}(\mathrm{d}P_2)q+h_i^{\mathsf{T}}P_2\,\mathrm{d}q\right). \tag*{(48)}
\end{aligned} d f θ ( z ) = Π d q + n 1 i = 0 ∑ n − 1 s i ( Π d V 2 h i + V 2 d h i ) + n 1 i = 0 ∑ n − 1 a i ( ( d h i ) T P 2 q + h i T ( d P 2 ) q + h i T P 2 d q ) . (48)
The sample-loss differential is d ℓ = e T d f θ ( z ) \mathrm{d}\ell=e^{\mathsf{T}}\mathrm{d}f_\theta(z) d ℓ = e T d f θ ( z ) .
Gradient of P 2 \mathbf{P}_2 P 2 and V 2 \mathbf{V}_2 V 2 . Holding the first-layer tokens fixed, the terms involving d P 2 \mathrm{d}\mathbf{P}_2 d P 2 in (B.11) give
d P 2 ℓ = 1 n ∑ i = 0 n − 1 ( e ⊤ a i ) h i ⊤ ( d P 2 ) q . \mathrm{d}_{\mathbf{P}_2}\ell= \frac{1}{n}\sum_{i=0}^{n-1}(\mathbf{e}^{\top}\mathbf{a}_i)\mathbf{h}_i^{\top}(\mathrm{d}\mathbf{P}_2)\mathbf{q}. d P 2 ℓ = n 1 i = 0 ∑ n − 1 ( e ⊤ a i ) h i ⊤ ( d P 2 ) q .
Since ⟨ A , B ⟩ F = tr ( A ⊤ B ) \langle A,B\rangle_F=\operatorname{tr}(A^{\top}B) ⟨ A , B ⟩ F = tr ( A ⊤ B ) and h i ⊤ ( d P 2 ) q = ⟨ h i q ⊤ , d P 2 ⟩ F \mathbf{h}_i^{\top}(\mathrm{d}\mathbf{P}_2)\mathbf{q}=\langle\mathbf{h}_i\mathbf{q}^{\top},\mathrm{d}\mathbf{P}_2\rangle_F h i ⊤ ( d P 2 ) q = ⟨ h i q ⊤ , d P 2 ⟩ F , we obtain ∇ P 2 ℓ ( θ ; z ) = 1 n ∑ i = 0 n − 1 ( e ⊤ a i ) h i q ⊤ \nabla_{\mathbf{P}_2}\ell(\theta;z)=\frac{1}{n}\sum_{i=0}^{n-1}(\mathbf{e}^{\top}\mathbf{a}_i)\mathbf{h}_i\mathbf{q}^{\top} ∇ P 2 ℓ ( θ ; z ) = n 1 ∑ i = 0 n − 1 ( e ⊤ a i ) h i q ⊤ . Each h i \mathbf{h}_i h i is supported in I \mathcal{I} I and q \mathbf{q} q is supported in W W W . Thus h i q ⊤ \mathbf{h}_i\mathbf{q}^{\top} h i q ⊤ has nonzero entries only in rows I \mathcal{I} I and columns W W W , and supp ( ∇ P 2 ℓ ) ⊆ ( I , W ) \operatorname{supp}(\nabla_{\mathbf{P}_2}\ell)\subseteq(\mathcal{I},W) supp ( ∇ P 2 ℓ ) ⊆ ( I , W ) . Entrywise, for a row coordinate r r r and column coordinate s s s , ( ∇ P 2 ℓ ) r s = 1 n ∑ i ( e ⊤ a i ) ( h i ) r q s = 0 (\nabla_{\mathbf{P}_2}\ell)_{rs}=\frac{1}{n}\sum_i(\mathbf{e}^{\top}\mathbf{a}_i)(\mathbf{h}_i)_r\mathbf{q}_s=0 ( ∇ P 2 ℓ ) r s = n 1 ∑ i ( e ⊤ a i ) ( h i ) r q s = 0 if r ∉ I r\notin\mathcal{I} r ∈ / I or s ∉ W s\notin W s ∈ / W .
Likewise, the terms involving d V 2 \mathrm{d}\mathbf{V}_2 d V 2 in (B.11) give
d V 2 ℓ = 1 n ∑ i = 0 n − 1 s i e ⊤ Π ( d V 2 ) h i = ⟨ 1 n ∑ i = 0 n − 1 s i Π ⊤ e h i ⊤ , d V 2 ⟩ F . \mathrm{d}_{\mathbf{V}_2}\ell=\frac{1}{n}\sum_{i=0}^{n-1}s_i\mathbf{e}^{\top}\Pi(\mathrm{d}\mathbf{V}_2)\mathbf{h}_i=\left\langle\frac{1}{n}\sum_{i=0}^{n-1}s_i\Pi^{\top}\mathbf{e}\mathbf{h}_i^{\top},\mathrm{d}\mathbf{V}_2\right\rangle_F. d V 2 ℓ = n 1 i = 0 ∑ n − 1 s i e ⊤ Π ( d V 2 ) h i = ⟨ n 1 i = 0 ∑ n − 1 s i Π ⊤ e h i ⊤ , d V 2 ⟩ F .
Hence ∇ V 2 ℓ ( θ ; z ) = 1 n ∑ i = 0 n − 1 s i Π ⊤ e h i ⊤ \nabla_{\mathbf{V}_2}\ell(\theta;z)=\frac{1}{n}\sum_{i=0}^{n-1}s_i\Pi^{\top}\mathbf{e}\mathbf{h}_i^{\top} ∇ V 2 ℓ ( θ ; z ) = n 1 ∑ i = 0 n − 1 s i Π ⊤ e h i ⊤ . The vector Π ⊤ e \Pi^{\top}\mathbf{e} Π ⊤ e is supported in W o u t W_{\mathrm{out}} W out , while h i \mathbf{h}_i h i is supported in I \mathcal{I} I . Therefore supp ( ∇ V 2 ℓ ) ⊆ ( W o u t , I ) \operatorname{supp}(\nabla_{\mathbf{V}_2}\ell)\subseteq(W_{\mathrm{out}},\mathcal{I}) supp ( ∇ V 2 ℓ ) ⊆ ( W out , I ) . Every row outside W o u t W_{\mathrm{out}} W out , including the first row of the W W W block, has zero gradient; within W o u t W_{\mathrm{out}} W out , the columns in Ψ \Psi Ψ and W W W also have zero gradient.
To propagate the loss gradient through the first layer, collect the d h i \mathrm{d}\mathbf{h}_i d h i and d q \mathrm{d}\mathbf{q} d q terms in (B.11). For each transition token,
d h i ℓ = [ 1 n s i e ⊤ V ~ 2 d h i + ( e ⊤ a i ) ( d h i ) ⊤ P 2 q ] = : λ i ⊤ d h i , \mathrm{d}_{\mathbf{h}_i}\ell=\left[\frac{1}{n}s_i\mathbf{e}^{\top}\widetilde{\mathbf{V}}_2\,\mathrm{d}\mathbf{h}_i+(\mathbf{e}^{\top}\mathbf{a}_i)(\mathrm{d}\mathbf{h}_i)^{\top}\mathbf{P}_2\mathbf{q}\right]=:\lambda_i^{\top}\mathrm{d}\mathbf{h}_i, d h i ℓ = [ n 1 s i e ⊤ V 2 d h i + ( e ⊤ a i ) ( d h i ) ⊤ P 2 q ] =: λ i ⊤ d h i ,
Both V ~ 2 ⊤ e \widetilde{\mathbf{V}}_2^{\top}\mathbf{e} V 2 ⊤ e and P 2 q \mathbf{P}_2\mathbf{q} P 2 q are supported in I \mathcal{I} I , so supp ( λ i ) ⊆ I \operatorname{supp}(\lambda_i)\subseteq\mathcal{I} supp ( λ i ) ⊆ I . For the parameter token, its residual contribution is e ⊤ Π d q \mathbf{e}^{\top}\Pi\,\mathrm{d}\mathbf{q} e ⊤ Π d q , and its query contribution is 1 n ∑ i ( e ⊤ a i ) h i ⊤ P 2 d q \frac{1}{n}\sum_i(\mathbf{e}^{\top}\mathbf{a}_i)\mathbf{h}_i^{\top}\mathbf{P}_2\,\mathrm{d}\mathbf{q} n 1 ∑ i ( e ⊤ a i ) h i ⊤ P 2 d q . Thus
d q ℓ = [ Π ⊤ e + 1 n ∑ i = 0 n − 1 ( e ⊤ a i ) P 2 ⊤ h i ] ⊤ d q = : λ q ⊤ d q . \mathrm{d}_{\mathbf{q}}\ell=\left[\Pi^{\top}\mathbf{e}+\frac{1}{n}\sum_{i=0}^{n-1}(\mathbf{e}^{\top}\mathbf{a}_i)\mathbf{P}_2^{\top}\mathbf{h}_i\right]^{\top}\mathrm{d}\mathbf{q}=:\lambda_q^{\top}\mathrm{d}\mathbf{q}. d q ℓ = [ Π ⊤ e + n 1 i = 0 ∑ n − 1 ( e ⊤ a i ) P 2 ⊤ h i ] ⊤ d q =: λ q ⊤ d q .
There is no additional key/value contribution from h N = q \mathbf{h}_N=\mathbf{q} h N = q , because its summand has zero differential by (B.10). Since P 2 \mathbf{P}_2 P 2 is supported in ( I , W ) (\mathcal{I},W) ( I , W ) , its transpose maps h i \mathbf{h}_i h i into W W W . Also Π ⊤ e \Pi^{\top}\mathbf{e} Π ⊤ e is supported in W o u t ⊆ W W_{\mathrm{out}}\subseteq W W out ⊆ W . Consequently, supp ( λ q ) ⊆ W \operatorname{supp}(\lambda_q)\subseteq W supp ( λ q ) ⊆ W . Each candidate token appears in the second layer only as a key/value token in its own summand. That summand has zero differential, so
∇ c ˉ i , a ℓ = 0. (49) \nabla_{\bar{\mathbf{c}}_{i,a}}\ell=0. \tag*{(49)} ∇ c ˉ i , a ℓ = 0. (49)
Here q \mathbf{q} q and the candidate tokens are treated as separate intermediate variables; their shared dependence on V 1 p \mathbf{V}_1\mathbf{p} V 1 p is included in the next step.
Gradient of V 1 \mathbf{V}_1 V 1 . When varying V 1 \mathbf{V}_1 V 1 and keeping P 1 \mathbf{P}_1 P 1 fixed, the attention weights and c ˉ i \bar{\mathbf{c}}_i c ˉ i are fixed. Differentiating (B.6) yields d h i = ( d V 1 ) c ˉ i \mathrm{d}\mathbf{h}_i=(\mathrm{d}\mathbf{V}_1)\bar{\mathbf{c}}_i d h i = ( d V 1 ) c ˉ i , d c ˉ i , a = ( d V 1 ) p \mathrm{d}\bar{\mathbf{c}}_{i,a}=(\mathrm{d}\mathbf{V}_1)\mathbf{p} d c ˉ i , a = ( d V 1 ) p , d q = ( d V 1 ) p \mathrm{d}\mathbf{q}=(\mathrm{d}\mathbf{V}_1)\mathbf{p} d q = ( d V 1 ) p . By the chain rule, including all three token types,
d V 1 ℓ = ∑ i = 0 n − 1 λ i ⊤ ( d V 1 ) c ˉ i + ∑ i , a ( ∇ c ˉ i , a ℓ ) ⊤ ( d V 1 ) p + λ q ⊤ ( d V 1 ) p = ∑ i = 0 n − 1 λ i ⊤ ( d V 1 ) c ˉ i + λ q ⊤ ( d V 1 ) p , \begin{aligned}
\mathrm{d}_{\mathbf{V}_1}\ell
&=\sum_{i=0}^{n-1}\lambda_i^{\top}(\mathrm{d}\mathbf{V}_1)\bar{\mathbf{c}}_i+\sum_{i,a}(\nabla_{\bar{\mathbf{c}}_{i,a}}\ell)^{\top}(\mathrm{d}\mathbf{V}_1)\mathbf{p}+\lambda_q^{\top}(\mathrm{d}\mathbf{V}_1)\mathbf{p}\\
&=\sum_{i=0}^{n-1}\lambda_i^{\top}(\mathrm{d}\mathbf{V}_1)\bar{\mathbf{c}}_i+\lambda_q^{\top}(\mathrm{d}\mathbf{V}_1)\mathbf{p},
\end{aligned} d V 1 ℓ = i = 0 ∑ n − 1 λ i ⊤ ( d V 1 ) c ˉ i + i , a ∑ ( ∇ c ˉ i , a ℓ ) ⊤ ( d V 1 ) p + λ q ⊤ ( d V 1 ) p = i = 0 ∑ n − 1 λ i ⊤ ( d V 1 ) c ˉ i + λ q ⊤ ( d V 1 ) p ,
where the candidate terms vanish by (B.12). It follows that ∇ V 1 ℓ ( θ ; z ) = ∑ i = 0 n − 1 λ i c ˉ i ⊤ + λ q p ⊤ \nabla_{\mathbf{V}_1}\ell(\theta;z)=\sum_{i=0}^{n-1}\lambda_i\bar{\mathbf{c}}_i^{\top}+\lambda_q\mathbf{p}^{\top} ∇ V 1 ℓ ( θ ; z ) = ∑ i = 0 n − 1 λ i c ˉ i ⊤ + λ q p ⊤ . For the first sum, λ i \lambda_i λ i is supported in I \mathcal{I} I and c ˉ i \bar{\mathbf{c}}_i c ˉ i in Ψ \Psi Ψ , so its support is contained in ( I , Ψ ) (\mathcal{I},\Psi) ( I , Ψ ) . For the second term, both λ q \lambda_q λ q and p \mathbf{p} p are supported in W W W , so its support is contained in ( W , W ) (W,W) ( W , W ) . Hence
supp ( ∇ V 1 ℓ ) ⊆ ( I , Ψ ) ∪ ( W , W ) . \operatorname{supp}(\nabla_{\mathbf{V}_1}\ell)\subseteq(\mathcal{I},\Psi)\cup(W,W). supp ( ∇ V 1 ℓ ) ⊆ ( I , Ψ ) ∪ ( W , W ) .
Equivalently, the only possibly nonzero gradient blocks of V 1 \mathbf{V}_1 V 1 are ( Φ , Ψ ) (\Phi,\Psi) ( Φ , Ψ ) , ( G , Ψ ) (G,\Psi) ( G , Ψ ) , ( R , Ψ ) (R,\Psi) ( R , Ψ ) , ( U , Ψ ) (U,\Psi) ( U , Ψ ) , ( W , W ) (W,W) ( W , W ) . Every entry outside these five blocks therefore has zero sample gradient.
Gradient of P 1 \mathbf{P}_1 P 1 (including the softmax derivative). Only transition queries have nonconstant first-layer attention weights. For a candidate query or the parameter query, the unique allowed-key weight is e u / e u = 1 e^u/e^u=1 e u / e u = 1 , whose derivative with respect to every entry of P 1 \mathbf{P}_1 P 1 is zero.
For a transition query, differentiating (B.5) gives
d π i , a = π i , a ( d u i , a − ∑ b ∈ A π i , b d u i , b ) , \mathrm{d}\pi_{i,a}=\pi_{i,a}\left(\mathrm{d}u_{i,a}-\sum_{b\in A}\pi_{i,b}\,\mathrm{d}u_{i,b}\right), d π i , a = π i , a ( d u i , a − b ∈ A ∑ π i , b d u i , b ) ,
d c ˉ i = ∑ a ∈ A c i , a d π i , a = ∑ a ∈ A π i , a c i , a d u i , a − c ˉ i ∑ b ∈ A π i , b d u i , b = ∑ a ∈ A π i , a ( c i , a − c ˉ i ) d u i , a . \mathrm{d}\bar{c}_i=\sum_{a\in A}c_{i,a}\,\mathrm{d}\pi_{i,a}=\sum_{a\in A}\pi_{i,a}c_{i,a}\,\mathrm{d}u_{i,a}-\bar{c}_i\sum_{b\in A}\pi_{i,b}\,\mathrm{d}u_{i,b}=\sum_{a\in A}\pi_{i,a}(c_{i,a}-\bar{c}_i)\,\mathrm{d}u_{i,a}. d c ˉ i = a ∈ A ∑ c i , a d π i , a = a ∈ A ∑ π i , a c i , a d u i , a − c ˉ i b ∈ A ∑ π i , b d u i , b = a ∈ A ∑ π i , a ( c i , a − c ˉ i ) d u i , a .
When only P 1 P_1 P 1 varies, d h i = V 1 d c ˉ i \mathrm{d}h_i=V_1\,\mathrm{d}\bar{c}_i d h i = V 1 d c ˉ i , while d q = 0 \mathrm{d}q=0 d q = 0 and d c ^ i , a = 0 \mathrm{d}\hat{c}_{i,a}=0 d c ^ i , a = 0 . Therefore
d P 1 ℓ = ∑ i = 0 n − 1 λ i ⊤ V 1 d c ˉ i = ∑ i = 0 n − 1 ∑ a ∈ A π i , a λ i ⊤ V 1 ( c i , a − c ˉ i ) d u i , a . \mathrm{d}_{P_1}\ell=\sum_{i=0}^{n-1}\lambda_i^{\top}V_1\,\mathrm{d}\bar{c}_i=\sum_{i=0}^{n-1}\sum_{a\in A}\pi_{i,a}\lambda_i^{\top}V_1(c_{i,a}-\bar{c}_i)\,\mathrm{d}u_{i,a}. d P 1 ℓ = i = 0 ∑ n − 1 λ i ⊤ V 1 d c ˉ i = i = 0 ∑ n − 1 a ∈ A ∑ π i , a λ i ⊤ V 1 ( c i , a − c ˉ i ) d u i , a .
Define the scalar κ i , a : = π i , a λ i ⊤ V 1 ( c i , a − c ˉ i ) \kappa_{i,a}:=\pi_{i,a}\lambda_i^{\top}V_1(c_{i,a}-\bar{c}_i) κ i , a := π i , a λ i ⊤ V 1 ( c i , a − c ˉ i ) . Since the input tokens are fixed, d u i , a = c i , a ⊤ ( d P 1 ) t i = ⟨ c i , a t i ⊤ , d P 1 ⟩ F \mathrm{d}u_{i,a}=c_{i,a}^{\top}(\mathrm{d}P_1)t_i=\langle c_{i,a}t_i^{\top},\mathrm{d}P_1\rangle_F d u i , a = c i , a ⊤ ( d P 1 ) t i = ⟨ c i , a t i ⊤ , d P 1 ⟩ F . Consequently, ∇ P 1 ℓ ( θ ; z ) = ∑ i = 0 n − 1 ∑ a ∈ A κ i , a c i , a t i ⊤ \nabla_{P_1}\ell(\theta;z)=\sum_{i=0}^{n-1}\sum_{a\in A}\kappa_{i,a}c_{i,a}t_i^{\top} ∇ P 1 ℓ ( θ ; z ) = ∑ i = 0 n − 1 ∑ a ∈ A κ i , a c i , a t i ⊤ . Each c i , a c_{i,a} c i , a is supported in Ψ \Psi Ψ and each input transition token t i t_i t i is supported in K = ( Φ , R , U ) \mathcal{K}=(\Phi,R,U) K = ( Φ , R , U ) . Hence
supp ( ∇ P 1 ℓ ) ⊆ ( Ψ , K ) . \operatorname{supp}(\nabla_{P_1}\ell)\subseteq(\Psi,\mathcal{K}). supp ( ∇ P 1 ℓ ) ⊆ ( Ψ , K ) .
Explicitly, only P 1 , Ψ Φ P_{1,\Psi\Phi} P 1 , ΨΦ , P 1 , Ψ R P_{1,\Psi R} P 1 , Ψ R , and P 1 , Ψ U P_{1,\Psi U} P 1 , Ψ U can have nonzero gradients.
Population gradients and zero coordinates. The calculations above hold for every fixed context z z z . Taking expectations gives the full-matrix population gradient formulas, evaluated at any θ ∈ S 16 \theta\in\mathcal{S}_{16} θ ∈ S 16 :
∇ P 1 L ( θ ) = E z [ ∑ i , a κ i , a c i , a t i ⊤ ] , ∇ V 1 L ( θ ) = E z [ ∑ i λ i c ˉ i ⊤ + λ q p ⊤ ] , \nabla_{P_1}\mathcal{L}(\theta)=\mathbb{E}_z\left[\sum_{i,a}\kappa_{i,a}c_{i,a}t_i^{\top}\right],\qquad\nabla_{V_1}\mathcal{L}(\theta)=\mathbb{E}_z\left[\sum_i\lambda_i\bar{c}_i^{\top}+\lambda_qp^{\top}\right], ∇ P 1 L ( θ ) = E z [ i , a ∑ κ i , a c i , a t i ⊤ ] , ∇ V 1 L ( θ ) = E z [ i ∑ λ i c ˉ i ⊤ + λ q p ⊤ ] ,
∇ P 2 L ( θ ) = 1 n E z [ ∑ i ( e ⊤ a i ) h i q ⊤ ] , ∇ V 2 L ( θ ) = 1 n E z [ ∑ i s i Π ⊤ e i h i ⊤ ] . \nabla_{P_2}\mathcal{L}(\theta)=\frac{1}{n}\mathbb{E}_z\left[\sum_i(e^{\top}a_i)h_iq^{\top}\right],\qquad\nabla_{V_2}\mathcal{L}(\theta)=\frac{1}{n}\mathbb{E}_z\left[\sum_i s_i\Pi^{\top}e_i h_i^{\top}\right]. ∇ P 2 L ( θ ) = n 1 E z [ i ∑ ( e ⊤ a i ) h i q ⊤ ] , ∇ V 2 L ( θ ) = n 1 E z [ i ∑ s i Π ⊤ e i h i ⊤ ] .
Their supports are therefore contained in
supp ( ∇ P 1 L ) ⊆ ( Ψ , K ) , supp ( ∇ V 1 L ) ⊆ ( I , Ψ ) ∪ ( W , W ) , \operatorname{supp}(\nabla_{P_1}\mathcal{L})\subseteq(\Psi,\mathcal{K}),\qquad\operatorname{supp}(\nabla_{V_1}\mathcal{L})\subseteq(\mathcal{I},\Psi)\cup(\mathcal{W},\mathcal{W}), supp ( ∇ P 1 L ) ⊆ ( Ψ , K ) , supp ( ∇ V 1 L ) ⊆ ( I , Ψ ) ∪ ( W , W ) ,
supp ( ∇ P 2 L ) ⊆ ( I , W ) , supp ( ∇ V 2 L ) ⊆ ( W o u t , I ) . (50) \operatorname{supp}(\nabla_{P_2}\mathcal{L})\subseteq(\mathcal{I},\mathcal{W}),\qquad\operatorname{supp}(\nabla_{V_2}\mathcal{L})\subseteq(\mathcal{W}_{\mathrm{out}},\mathcal{I}). \tag*{(50)} supp ( ∇ P 2 L ) ⊆ ( I , W ) , supp ( ∇ V 2 L ) ⊆ ( W out , I ) . (50)
These are exactly the 16 retained blocks. Thus
∇ θ o u t L ( θ ) = 0 whenever θ o u t = 0. (51) \nabla_{\theta_{\mathrm{out}}}\mathcal{L}(\theta)=0\quad\text{whenever }\theta_{\mathrm{out}}=0. \tag*{(51)} ∇ θ out L ( θ ) = 0 whenever θ out = 0. (51)
The boundedness condition in Assumption 1 (i) justifies differentiation under the expectation: on each compact parameter set, the fixed-mask softmax and the two attention layers have uniformly bounded derivatives of every fixed order on these bounded inputs. The teacher target is bounded as well. Thus the sample loss and its first two parameter derivatives admit an integrable bound there, so L \mathcal{L} L is C 2 C^2 C 2 and the displayed expectation formulas are valid.
It remains to show that (B.14) holds along the entire training trajectory, rather than only at initialization. Write θ = ( x , y ) \theta=(x,y) θ = ( x , y ) , where x x x collects the retained coordinates and y = θ o u t y=\theta_{\mathrm{out}} y = θ out . Then the full gradient-flow system is
x ˙ = − ∇ x L ( x , y ) , y ˙ = − ∇ y L ( x , y ) . (52) \dot{x}=-\nabla_x\mathcal{L}(x,y),\qquad\dot{y}=-\nabla_y\mathcal{L}(x,y). \tag*{(52)} x ˙ = − ∇ x L ( x , y ) , y ˙ = − ∇ y L ( x , y ) . (52)
By (B.14), ∇ y L ( x , 0 ) = 0 \nabla_y\mathcal{L}(x,0)=0 ∇ y L ( x , 0 ) = 0 for every x x x , not merely for the initial value x ( 0 ) x(0) x ( 0 ) . Consider the restricted system x ˉ ˙ = − ∇ x L ( x ˉ , 0 ) \dot{\bar{x}}=-\nabla_x\mathcal{L}(\bar{x},0) x ˉ ˙ = − ∇ x L ( x ˉ , 0 ) , x ˉ ( 0 ) = x ( 0 ) \bar{x}(0)=x(0) x ˉ ( 0 ) = x ( 0 ) , y ˉ ( t ) ≡ 0 \bar{y}(t)\equiv0 y ˉ ( t ) ≡ 0 . It satisfies y ˉ ˙ ( t ) = 0 = − ∇ y L ( x ˉ ( t ) , 0 ) \dot{\bar{y}}(t)=0=-\nabla_y\mathcal{L}(\bar{x}(t),0) y ˉ ˙ ( t ) = 0 = − ∇ y L ( x ˉ ( t ) , 0 ) , so ( x ˉ ( t ) , y ˉ ( t ) ) (\bar{x}(t),\bar{y}(t)) ( x ˉ ( t ) , y ˉ ( t )) solves the full system (B.15) with the same initial condition as ( x ( t ) , y ( t ) ) (x(t),y(t)) ( x ( t ) , y ( t )) . Since L \mathcal{L} L is C 2 C^2 C 2 , its gradient is locally Lipschitz, and the initial-value problem has a unique local solution. The full solution therefore coincides with the restricted solution. Repeating this uniqueness argument along the trajectory gives y ( t ) = 0 y(t)=0 y ( t ) = 0 throughout its maximal interval of existence.
For completeness, this interval contains every t ≥ 0 t\geq0 t ≥ 0 . Along a gradient-flow solution, using the product Frobenius norm, d d t L ( θ ( t ) ) = ⟨ ∇ L ( θ ( t ) ) , θ ˙ ( t ) ⟩ = − ∥ ∇ L ( θ ( t ) ) ∥ 2 = − ∥ θ ˙ ( t ) ∥ 2 \frac{\mathrm{d}}{\mathrm{d}t}\mathcal{L}(\theta(t))=\langle\nabla\mathcal{L}(\theta(t)),\dot{\theta}(t)\rangle=-\|\nabla\mathcal{L}(\theta(t))\|^2=-\|\dot{\theta}(t)\|^2 d t d L ( θ ( t )) = ⟨ ∇ L ( θ ( t )) , θ ˙ ( t )⟩ = − ∥∇ L ( θ ( t )) ∥ 2 = − ∥ θ ˙ ( t ) ∥ 2 . Integrating and using L ≥ 0 \mathcal{L}\geq0 L ≥ 0 yields ∫ 0 t ∥ θ ˙ ( s ) ∥ 2 d s = L ( θ ( 0 ) ) − L ( θ ( t ) ) ≤ L ( θ ( 0 ) ) \int_0^t\|\dot{\theta}(s)\|^2\,\mathrm{d}s=\mathcal{L}(\theta(0))-\mathcal{L}(\theta(t))\leq\mathcal{L}(\theta(0)) ∫ 0 t ∥ θ ˙ ( s ) ∥ 2 d s = L ( θ ( 0 )) − L ( θ ( t )) ≤ L ( θ ( 0 )) . By the triangle inequality and Cauchy–Schwarz,
∥ θ ( t ) − θ ( 0 ) ∥ ≤ ∫ 0 t ∥ θ ˙ ( s ) ∥ d s ≤ t ( ∫ 0 t ∥ θ ˙ ( s ) ∥ 2 d s ) 1 / 2 ≤ t L ( θ ( 0 ) ) . \|\theta(t)-\theta(0)\|\leq\int_0^t\|\dot{\theta}(s)\|\,\mathrm{d}s\leq\sqrt{t}\left(\int_0^t\|\dot{\theta}(s)\|^2\,\mathrm{d}s\right)^{1/2}\leq\sqrt{t\,\mathcal{L}(\theta(0))}. ∥ θ ( t ) − θ ( 0 ) ∥ ≤ ∫ 0 t ∥ θ ˙ ( s ) ∥ d s ≤ t ( ∫ 0 t ∥ θ ˙ ( s ) ∥ 2 d s ) 1/2 ≤ t L ( θ ( 0 )) .
If the maximal existence time were finite, this bound would keep the trajectory inside a compact subset of the full parameter space up to that time. The locally Lipschitz vector field then permits continuation, contradicting maximality. Thus the solution is global, and θ o u t ( t ) = 0 \theta_{\mathrm{out}}(t)=0 θ out ( t ) = 0 for all t ≥ 0 t\ge0 t ≥ 0 .
For any batch z 1 , … , z B z_1,\ldots,z_B z 1 , … , z B , at every θ ∈ S 16 \theta\in S_{16} θ ∈ S 16 , ∇ θ o u t L ^ B ( θ ) = 1 B ∑ b = 1 B ∇ θ o u t ℓ ( θ ; z b ) = 0 \nabla_{\theta_{\mathrm{out}}\!}\widehat{L}_B(\theta)=\frac{1}{B}\sum_{b=1}^{B}\nabla_{\theta_{\mathrm{out}}\!}\ell(\theta;z_b)=0 ∇ θ out L B ( θ ) = B 1 ∑ b = 1 B ∇ θ out ℓ ( θ ; z b ) = 0 . Hence an update θ k + 1 = θ k − η k ∇ L ^ B ( θ k ) \theta^{k+1}=\theta^k-\eta_k\nabla\widehat{L}_B(\theta^k) θ k + 1 = θ k − η k ∇ L B ( θ k ) gives θ o u t k + 1 = θ o u t k − η k 0 = 0 \theta_{\mathrm{out}}^{k+1}=\theta_{\mathrm{out}}^k-\eta_k0=0 θ out k + 1 = θ out k − η k 0 = 0 whenever θ o u t k = 0 \theta_{\mathrm{out}}^k=0 θ out k = 0 . Induction proves invariance at every discrete iteration, without projecting the gradients or explicitly freezing these coordinates.
Support parameter blocks
Denote the six blocks by
A = ( P 1 ) Ψ , U , L = ( V 1 ) G , Ψ , B − = ( P 2 ) Φ , W , A=(P_1)_{\Psi,U},\quad L=(V_1)_{G,\Psi},\quad B_-=(P_2)_{\Phi,W}, A = ( P 1 ) Ψ , U , L = ( V 1 ) G , Ψ , B − = ( P 2 ) Φ , W ,
B + = ( P 2 ) G , W , B r = ( P 2 ) R , W , C = ( V 2 ) W o u t , Φ . B_+=(P_2)_{G,W},\quad B_r=(P_2)_{R,W},\quad C=(V_2)_{W_{\mathrm{out}},\Phi}. B + = ( P 2 ) G , W , B r = ( P 2 ) R , W , C = ( V 2 ) W out , Φ .
Let S 6 = { A , L , B − , B + , B r , C } S_6=\{A,L,B_-,B_+,B_r,C\} S 6 = { A , L , B − , B + , B r , C } . For S ⊆ S 6 S\subseteq S_6 S ⊆ S 6 , let Θ ( S ) \Theta(S) Θ ( S ) be the parameter space in which the blocks in S S S are unrestricted and every other entry of the four matrices is zero. Set Θ s u p = Θ ( S 6 ) \Theta_{\mathrm{sup}}=\Theta(S_6) Θ sup = Θ ( S 6 ) . Define
F τ ( H ) = w + α n ∑ i = 1 n ϕ i ( r i + γ ( μ i τ ) T w − ϕ i T w ) . (53) F_\tau(\mathrm{H})=\mathbf{w}+\frac{\alpha}{n}\sum_{i=1}^{n}\phi_i\left(r_i+\gamma(\mu_i^\tau)^{\mathsf T}\mathbf{w}-\phi_i^{\mathsf T}\mathbf{w}\right). \tag*{(53)} F τ ( H ) = w + n α i = 1 ∑ n ϕ i ( r i + γ ( μ i τ ) T w − ϕ i T w ) . (53)
where μ i ( A ) = ∑ a = 1 m exp ( ( ϕ i , a ) T A w ) ∑ b = 1 m exp ( ( ϕ i , b ) T A w ) ϕ i , a + \mu_i(A)=\sum_{a=1}^{m}\frac{\exp((\phi_{i,a})^{\mathsf T}A\mathbf{w})}{\sum_{b=1}^{m}\exp((\phi_{i,b})^{\mathsf T}A\mathbf{w})}\phi_{i,a}^{+} μ i ( A ) = ∑ a = 1 m ∑ b = 1 m e x p (( ϕ i , b ) T A w ) e x p (( ϕ i , a ) T A w ) ϕ i , a + , and μ i τ = μ i ( τ − 1 I d ) \mu_i^\tau=\mu_i(\tau^{-1}I_d) μ i τ = μ i ( τ − 1 I d ) .
The following Proposition shows that the six-block support realizes the target update F τ ( H ) F_\tau(\mathrm{H}) F τ ( H ) exactly, whereas none of its proper subsets does so on all original prompts.
Proposition B.3 (Sufficiency and inclusion-minimality of the six-block support). Let H \mathcal{H} H denote the class of prompts of the form (7), d , n ≥ 1 d,n\ge1 d , n ≥ 1 , m ≥ 2 m\ge2 m ≥ 2 , α > 0 \alpha>0 α > 0 , 0 < γ < 1 0<\gamma<1 0 < γ < 1 , and 0 < τ < ∞ 0<\tau<\infty 0 < τ < ∞ . Then
(i) There exists θ ∈ Θ s u p \theta\in\Theta_{\mathrm{sup}} θ ∈ Θ sup , such that for all H ∈ H \mathrm{H}\in\mathcal{H} H ∈ H , T F θ ( H ) = F τ ( H ) T F_\theta(\mathrm{H})=F_\tau(\mathrm{H}) T F θ ( H ) = F τ ( H ) .
(ii) For all S ⊊ S 6 S\subsetneq S_6 S ⊊ S 6 , and θ ∈ Θ ( S ) \theta\in\Theta(S) θ ∈ Θ ( S ) , there exists H ∈ H \mathrm{H}\in\mathcal{H} H ∈ H , such that T F θ ( H ) ≠ F τ ( H ) T F_\theta(\mathrm{H})\ne F_\tau(\mathrm{H}) T F θ ( H ) = F τ ( H ) .
Proof. (i) For arbitrary parameters in Θ s u p \Theta_{\mathrm{sup}} Θ sup , the first-layer transition token is
t i ( 1 ) = [ ϕ i ; L μ i ( A ) ; r i ; 0 d ; w ; 0 d + 1 ] . t_i^{(1)}=[\phi_i;L\mu_i(A);r_i;0_d;\mathbf{w};0_{d+1}]. t i ( 1 ) = [ ϕ i ; L μ i ( A ) ; r i ; 0 d ; w ; 0 d + 1 ] .
Indeed, the mask restricts transition i i i to its own successor candidates, whose scores are ψ i a T A w \psi_{ia}^{\mathsf T}A\mathbf{w} ψ ia T A w . The candidates and final query are unchanged, since each attends only to the final query p p p and V 1 p = 0 V_1p=0 V 1 p = 0 . In the second layer, P 2 p P_2p P 2 p is supported on Φ , G , R \Phi,G,R Φ , G , R . Consequently, the candidate and final-query scores against p p p are zero; only the transition tokens contribute. Their scores are σ i = ϕ i T B − w ~ + μ i ( A ) T L T B + w ~ + r i B r w ~ \sigma_i=\phi_i^{\mathsf T}B_-\widetilde{\mathbf{w}}+\mu_i(A)^{\mathsf T}L^{\mathsf T}B_+\widetilde{\mathbf{w}}+r_iB_r\widetilde{\mathbf{w}} σ i = ϕ i T B − w + μ i ( A ) T L T B + w + r i B r w , and their value vectors in the output coordinates are C ϕ i C\phi_i C ϕ i . Including the residual readout gives
T F θ ( H ) − w = 1 n ∑ i = 1 n C ϕ i ( ϕ i T B − w ~ + μ i ( A ) T L T B + w ~ + r i B r w ~ ) . (54) T F_\theta(\mathrm{H})-\mathbf{w}=\frac{1}{n}\sum_{i=1}^{n}C\phi_i\left(\phi_i^{\mathsf T}B_-\widetilde{\mathbf{w}}+\mu_i(A)^{\mathsf T}L^{\mathsf T}B_+\widetilde{\mathbf{w}}+r_iB_r\widetilde{\mathbf{w}}\right). \tag*{(54)} T F θ ( H ) − w = n 1 i = 1 ∑ n C ϕ i ( ϕ i T B − w + μ i ( A ) T L T B + w + r i B r w ) . (54)
For any c ≠ 0 c\ne0 c = 0 and any L ∈ GL ( d ) L\in\operatorname{GL}(d) L ∈ GL ( d ) , choose A = τ − 1 I d A=\tau^{-1}I_d A = τ − 1 I d , B − = − c J B_-=-cJ B − = − c J , B r = c e 0 T B_r=c e_0^{\mathsf T} B r = c e 0 T , B + = γ c L − T J B_+=\gamma cL^{-\mathsf T}J B + = γ c L − T J , C = α c I d C=\frac{\alpha}{c}I_d C = c α I d . Then J w ~ = w J\widetilde{\mathbf{w}}=\mathbf{w} J w = w , e 0 T w ~ = 1 e_0^{\mathsf T}\widetilde{\mathbf{w}}=1 e 0 T w = 1 , and L T B + = γ c J L^{\mathsf T}B_+=\gamma cJ L T B + = γ c J . Thus σ i = c ( r i + γ ( μ i τ ) T w − ϕ i T w ) \sigma_i=c(r_i+\gamma(\mu_i^\tau)^{\mathsf T}\mathbf{w}-\phi_i^{\mathsf T}\mathbf{w}) σ i = c ( r i + γ ( μ i τ ) T w − ϕ i T w ) , C ϕ i = α c ϕ i C\phi_i=\frac{\alpha}{c}\phi_i C ϕ i = c α ϕ i . Equation (B.17) becomes (B.16).
(ii) Fix a unit vector e ∈ R d e\in\mathbb{R}^d e ∈ R d . In every counterexample below, take ϕ 1 = e \phi_1=e ϕ 1 = e and ϕ i = 0 \phi_i=0 ϕ i = 0 for i ≥ 2 i\ge2 i ≥ 2 . Accordingly only transition 1 contributes to either update, regardless of the fixed context length n n n . These inputs can be realized by a trajectory that moves from an initial state to a second state and subsequently selects a zero-feature action there. The successor feature lists used below are either all zero or ( e , 0 , … , 0 ) (e,0,\ldots,0) ( e , 0 , … , 0 ) , so such an action exists because m ≥ 2 m\ge2 m ≥ 2 . Set the later rewards to zero.
If C = 0 C=0 C = 0 , (B.17) gives T F θ ( H ) = w T F_\theta(\mathrm{H})=\mathbf{w} T F θ ( H ) = w for every input. Choose w = 0 \mathbf{w}=0 w = 0 , r 1 = 1 r_1=1 r 1 = 1 , and all first-transition successor features zero. The target increment is α e / n ≠ 0 \alpha e/n\ne0 α e / n = 0 , which cannot be reproduced.
If B r = 0 B_r=0 B r = 0 , the output in (B.17) does not depend on any reward. Fix w = 0 \mathbf{w}=0 w = 0 and the first-transition successor features at zero, and compare otherwise identical inputs with r 1 = 0 r_1=0 r 1 = 0 and r 1 = 1 r_1=1 r 1 = 1 . Their target outputs differ by α e / n \alpha e/n α e / n , while the model outputs coincide. No fixed choice of the other blocks can fit both inputs; Set w = e \mathbf{w}=\mathbf{e} w = e , r 1 = 0 r_1=0 r 1 = 0 , and all first-transition successor features to zero. Then μ 1 ( A ) = 0 \mu_1(\mathbf{A})=0 μ 1 ( A ) = 0 for every A \mathbf{A} A .
If B − = 0 \mathbf{B}_{-}=0 B − = 0 , the model increment is zero, but the target increment is − α e / n ≠ 0 -\alpha e/n\ne0 − α e / n = 0 .
If L = 0 \mathbf{L}=0 L = 0 or B + = 0 \mathbf{B}_{+}=0 B + = 0 , then L ⊤ B + = 0 \mathbf{L}^{\top}\mathbf{B}_{+}=0 L ⊤ B + = 0 , so the output is independent of the successor features. Fix w = e \mathbf{w}=\mathbf{e} w = e and r 1 = 0 r_1=0 r 1 = 0 , and compare successor lists ( 0 , … , 0 ) (0,\ldots,0) ( 0 , … , 0 ) and ( e , 0 , … , 0 ) (e,0,\ldots,0) ( e , 0 , … , 0 ) . The target outputs differ by α γ n exp ( 1 / τ ) exp ( 1 / τ ) + m − 1 e ≠ 0 \frac{\alpha\gamma}{n}\frac{\exp(1/\tau)}{\exp(1/\tau)+m-1}e\ne0 n α γ e x p ( 1/ τ ) + m − 1 e x p ( 1/ τ ) e = 0 . Again the model outputs coincide, so they cannot both equal the targets.
If A = 0 \mathbf{A}=0 A = 0 , attention weights are uniform. Holding the features and rewards fixed, μ i ( 0 ) \mu_i(0) μ i ( 0 ) is independent of w \mathbf{w} w , and the increment in (B.17) is an affine function of w \mathbf{w} w . Choose the first-transition successor list ( e , 0 , … , 0 ) (e,0,\ldots,0) ( e , 0 , … , 0 ) , r 1 = 0 r_1=0 r 1 = 0 , and w = t e \mathbf{w}=t\mathbf{e} w = t e , with t t t varying in an interval about zero. The target increment is g ( t ) = α n e [ γ t p ( t ) − t ] g(t)=\frac{\alpha}{n}e[\gamma tp(t)-t] g ( t ) = n α e [ γ tp ( t ) − t ] , p ( t ) = exp ( t / τ ) exp ( t / τ ) + m − 1 p(t)=\frac{\exp(t/\tau)}{\exp(t/\tau)+m-1} p ( t ) = e x p ( t / τ ) + m − 1 e x p ( t / τ ) . Since p ′ ( 0 ) = ( m − 1 ) / ( τ m 2 ) p'(0)=(m-1)/(\tau m^2) p ′ ( 0 ) = ( m − 1 ) / ( τ m 2 ) ,
g ′ ′ ( 0 ) = 2 α γ ( m − 1 ) n τ m 2 e ≠ 0. g''(0)=\frac{2\alpha\gamma(m-1)}{n\tau m^2}e\ne0. g ′′ ( 0 ) = n τ m 2 2 α γ ( m − 1 ) e = 0.
Thus the target increment is not affine in t t t , whereas the model increment is affine. They cannot agree for all these inputs.
Every proper subset of S 6 S_6 S 6 omits at least one of these blocks. The corresponding case applies irrespective of the values of the remaining blocks.
Experimental reproducibility and implementation details
We evaluate parameter recovery and cross-task generalization in a structured two-layer Q-learning Transformer trained by output-only supervision. All models use cosine learning-rate decay from the first Adam update. Batch-size and context-length comparisons further reveal distinct effects on parameter recovery and functional accuracy under fixed task budgets. Frozen models transfer to 512 unseen tabular tasks, achieving returns close to their soft teachers.
Table 1. Notation. A task is one independently sampled MDP/feature realization; a context is a valid trajectory window generated in that task. In the training, one task supplies one context.
Task budget and optimization. Each independently sampled task contributes one context. Let B B B denote the number of contexts per optimizer update, n n n the number of transitions within a context, and U B U_B U B the number of optimizer updates. At update k = 0 , … , U B − 1 k=0,\ldots,U_B-1 k = 0 , … , U B − 1 , let m k = k B m_k=kB m k = k B be the number of tasks already consumed. The learning rate is η ( m k ) = 10 − 6 + 10 − 3 − 10 − 6 2 [ 1 + cos ( π m k N t a s k ) ] \eta(m_k)=10^{-6}+\frac{10^{-3}-10^{-6}}{2}\left[1+\cos\left(\pi\frac{m_k}{N_{\mathrm{task}}}\right)\right] η ( m k ) = 1 0 − 6 + 2 1 0 − 3 − 1 0 − 6 [ 1 + cos ( π N task m k ) ] . All blocks follow this schedule from the first update at 10 − 3 10^{-3} 1 0 − 3 , without warm-up, restarts, or an additional phase. Its minimum is 10 − 6 10^{-6} 1 0 − 6 at the budget boundary; the last actual update occurs at m k = N t a s k − B m_k=N_{\mathrm{task}}-B m k = N task − B and uses a slightly larger value. Adam uses ( β 1 , β 2 ) = ( 0.9 , 0.999 ) (\beta_1,\beta_2)=(0.9,0.999) ( β 1 , β 2 ) = ( 0.9 , 0.999 ) , ϵ A d a m = 10 − 8 \epsilon_{\mathrm{Adam}}=10^{-8} ϵ Adam = 1 0 − 8 , no weight decay, and float32 parameters and moment buffers.
The study uses five paired seeds for each configuration. For experiments on valid parameter blocks, the cosine schedule terminates at 20.48 × 10 6 20.48\times10^6 20.48 × 1 0 6 tasks. Training continues at a learning rate of 10 − 6 10^{-6} 1 0 − 6 to 25.60 × 10 6 25.60\times10^6 25.60 × 1 0 6 tasks, then 10 − 4 10^{-4} 1 0 − 4 , with the rate lowered to 10 − 5 10^{-5} 1 0 − 5 beyond 37.76 × 10 6 37.76\times10^6 37.76 × 1 0 6 tasks. The rate is finally switched to 10 − 6 10^{-6} 1 0 − 6 , ending at 46.40 × 10 6 46.40\times10^6 46.40 × 1 0 6 tasks per seed. For experiments on structured parameter blocks, the cosine schedule terminates at 20.48 × 10 6 20.48\times10^6 20.48 × 1 0 6 tasks.
Experiments on Valid Parameter Blocks
Evaluating the accuracy of approximate Q updates. We adopt three metrics, namely Soft error err s o f t \operatorname{err}_{\mathrm{soft}} err soft , Hard error err h a r d \operatorname{err}_{\mathrm{hard}} err hard , and Greedy agreement, to quantify how closely the Transformer proposed in this work approximates the Q-learning update rule. Specifically,
err s o f t = ∑ z ∈ Z ∥ u ^ ( z ) − u τ ( z ) ∥ 2 2 ∑ z ∈ Z ∥ u τ ( z ) ∥ 2 2 , err h a r d = ∑ z ∈ Z ∥ u ^ ( z ) − u max ( z ) ∥ 2 2 ∑ z ∈ Z ∥ u max ( z ) ∥ 2 2 . (55) \operatorname{err}_{\mathrm{soft}}=\sqrt{\frac{\sum_{z\in\mathcal{Z}}\lVert\hat{u}(z)-u_{\tau}(z)\rVert_{2}^{2}}{\sum_{z\in\mathcal{Z}}\lVert u_{\tau}(z)\rVert_{2}^{2}}},\qquad\operatorname{err}_{\mathrm{hard}}=\sqrt{\frac{\sum_{z\in\mathcal{Z}}\lVert\hat{u}(z)-u_{\max}(z)\rVert_{2}^{2}}{\sum_{z\in\mathcal{Z}}\lVert u_{\max}(z)\rVert_{2}^{2}}}. \tag*{(55)} err soft = ∑ z ∈ Z ∥ u τ ( z ) ∥ 2 2 ∑ z ∈ Z ∥ u ^ ( z ) − u τ ( z ) ∥ 2 2 , err hard = ∑ z ∈ Z ∥ u m a x ( z ) ∥ 2 2 ∑ z ∈ Z ∥ u ^ ( z ) − u m a x ( z ) ∥ 2 2 . (55)
where u τ ( z ) = α n ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ V τ , i − w ⊤ ϕ i ] u_{\tau}(z)=\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i[r_{i+1}+\gamma V_{\tau,i}-\mathbf{w}^{\top}\phi_i] u τ ( z ) = n α ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ V τ , i − w ⊤ ϕ i ] , u max ( z ) = α n ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ max a q i , a + − w ⊤ ϕ i ] u_{\max}(z)=\frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i[r_{i+1}+\gamma\max_a q_{i,a}^{+}-\mathbf{w}^{\top}\phi_i] u m a x ( z ) = n α ∑ i = 0 n − 1 ϕ i [ r i + 1 + γ max a q i , a + − w ⊤ ϕ i ] , and q i , a + = w ⊤ ϕ i , a q_{i,a}^{+}=\mathbf{w}^{\top}\phi_{i,a} q i , a + = w ⊤ ϕ i , a , V τ , i = ∑ a π i q i , a + V_{\tau,i}=\sum_a\pi_iq_{i,a}^{+} V τ , i = ∑ a π i q i , a + . The two greedy metrics quantify action agreement at distinct granularities: G r e e d y t r \mathrm{Greedy}_{\mathrm{tr}} Greedy tr reports the fraction of individual transitions for which the model’s attention-selected action matches the teacher’s greedy action, i.e., the action with the maximum Q-value; G r e e d y c t x \mathrm{Greedy}_{\mathrm{ctx}} Greedy ctx is a stricter metric, defined as the fraction of contexts where such a match holds across all 20 transitions within the context. The Teacher bias is obtained by replacing the numerator of err h a r d \operatorname{err}_{\mathrm{hard}} err hard with ∑ z ∥ u τ − u max ∥ 2 \sum_z\lVert u_{\tau}-u_{\max}\rVert^2 ∑ z ∥ u τ − u m a x ∥ 2 . Teacher bias is deterministic on the common corpus and is not assigned an artificial seed confidence interval.
Update errors and greedy agreement are reported as percentages. The identity/zero-update predictor yields a 100% update error: the residual w \mathbf{w} w cannot mask an unlearned update. ± \pm ± denotes a 95% Student-t interval across trained seeds.
Table 2 (dense features) demonstrates close reproduction of the soft-Q update by the model, yielding 0.01256% NRMSE and 99.990% transition-level greedy agreement; by contrast, the one-hot feature setting (Table 3) exhibits noticeably weaker performance, attaining 0.07950% NRMSE and 99.989% transition-level greedy agreement.
Table 2. Dense held-out contexts: update errors and greedy agreement
Table 3. One-hot held-out contexts: update errors and greedy agreement
Emergence of Parameters. To distinguish scalar calibration from nonscalar distortion, let β a t t = tr ( A θ ) / d \beta_{att} = \operatorname{tr}(A_\theta)/d β a tt = tr ( A θ ) / d . Frobenius orthogonality of A θ − β a t t I A_\theta- \beta_{att}I A θ − β a tt I and I I I gives
E A 2 = ( τ β a t t − 1 ) 2 ⏟ E A , s c a l e 2 + τ 2 d ∥ A θ − β a t t I ∥ F 2 ⏟ E A , s h a p e 2 . E_A^2 = \underbrace{(\tau\beta_{att}-1)^2}_{E_{A,\mathrm{scale}}^2} + \underbrace{\frac{\tau^2}{d}\lVert A_\theta-\beta_{att}I\rVert_F^2}_{E_{A,\mathrm{shape}}^2}. E A 2 = E A , scale 2 ( τ β a tt − 1 ) 2 + E A , shape 2 d τ 2 ∥ A θ − β a tt I ∥ F 2 .
When β a t t > 0 \beta_{att} > 0 β a tt > 0 , 1 / β a t t 1/\beta_{att} 1/ β a tt summarizes the effective temperature of the scalar projection; it is not an exact temperature when nonscalar components remain. A visible diagonal in a heatmap is therefore insufficient evidence of inverse-temperature recovery. As can be seen in Table 4 , both residual components decrease substantially toward the end of training, demonstrating the emergence of an action-selection mechanism. Figure 3 presents heatmaps of the key matrices under τ = 0.2 \tau= 0.2 τ = 0.2 , revealing that the training algorithm successfully induces the constructed parameters to emerge.
Table 4. Attention residual and scale across training.
Figure 3. Terminal detail of all 16 initialized blocks for seed 0. Each block has its own color range, shared across seeds for that block. This view complements the full matrices; it does not replace structural zeros by cropped or normalized values in the full-matrix figures.
Generalization to unseen tabular tasks We evaluate frozen Transformers on a common bank of 512 independent unseen MDPs. Deployment features are one-hot, ϕ ( s , a ) = e 4 s + a \phi(s,a) = e_{4s+a} ϕ ( s , a ) = e 4 s + a , whereas training uses dense features. These experiments assess dense-to-tabular transfer, not direct tabular training. Each learner recursively updates its own Q parameter w \mathbf{w} w and generates its own ϵ \epsilon ϵ -greedy actions and successor states. The Transformer parameters θ \theta θ remain fixed, with no teacher parameters, actions, or states injected into its rollout. The primary comparison uses w 0 = 0 \mathbf{w}_0 = 0 w 0 = 0 , n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 , and 20,000 environment interactions per learner.
Every temperature comparison includes the Transformer, hard and soft window-Q teachers, Oracle, and Random. The window teachers, or their hard-max counterpart, maintain a fixed w \mathbf{w} w for each trajectory segment. Standard online Q-learning instead updates after every transition; we report both a constant step size of 0.2 and a visit-count step size of 1 / N s a 1/N_{sa} 1/ N s a . Oracle uses the true transition and reward model to compute an optimal policy and is therefore a privileged upper reference. Random uses a uniform action policy rather than a greedy policy induced by a random Q table.
We evaluate the exact discounted return J ( π ) = P π T ( I − γ P π ) − 1 r π J(\pi) = P_\pi^T(I-\gamma P_\pi)^{-1}r_\pi J ( π ) = P π T ( I − γ P π ) − 1 r π , r ( s , a ) = ∑ s ′ P ( s ′ ∣ s , a ) R ( a , s ′ , s ) r(s,a) = \sum_{s'}P(s' \mid s,a)R(a,s',s) r ( s , a ) = ∑ s ′ P ( s ′ ∣ s , a ) R ( a , s ′ , s ) , where P π P_\pi P π and r π r_\pi r π are the policy-induced transition matrix and expected reward vector. For learned methods and Q-learning baselines, π \pi π is the current greedy policy; Oracle and Random use their specified policies. Thus, J J J is a policy-evaluation metric.
Table 5. Exact greedy-policy return after 20,000 interactions on 512 unseen MDPs.
Figure 4 deploys frozen dense-feature-trained Transformers on unseen tabular MDPs and measures exact policy returns under a common interaction budget. Comparisons include hard and soft window Q-learning, a model-informed Oracle, and uniform Random. The Transformer achieves returns close to those of the soft window teacher and a higher sample-mean return than the hard window-Q baseline using the same fixed step size.
Figure 4. Frozen dense-feature-trained Transformers on unseen tabular MDPs and measures exact policy returns under a common interaction budget.
Experiments on Structured Parameter Blocks
Evaluating the accuracy of approximate Q updates. Learning error across different temperatures τ \tau τ . Table 6 gives an analysis of the impacts of τ \tau τ . The τ = 0.1 \tau= 0.1 τ = 0.1 model has a soft-update error of 0.07575% despite its appreciable parameter residual; the τ = 1 \tau= 1 τ = 1 model closely matches its soft teacher but has a large hard-update error, reflecting the finite-temperature teacher discrepancy. Here, Greedy agreement quantifies the fraction of contexts where the argmax action from the attention module matches the optimal maximizing next action of the Q-learning target.
Table 6. Update accuracy on 8,192 common dense-feature contexts.
Table 7 illustrates how different batch sizes B B B affect the approximation error. The soft error decreases first and then rises with increasing batch size, minimized at B = 64 B = 64 B = 64 . Greedy agreement stays near 100%. The fitted effective temperature τ e f f = 1 / β a t t \tau_{\mathrm{eff}} = 1/\beta_{\mathrm{att}} τ eff = 1/ β att , with β a t t = tr ( A θ ) / d > 0 \beta_{\mathrm{att}} = \operatorname{tr}(A_{\theta})/d > 0 β att = tr ( A θ ) / d > 0 acting as a scalar projection diagnostic, remains around 0.2.
Table 7. Final checkpoints on 8,192 new shared contexts.
To compare the effects of different optimizations on experimental results, we also evaluated the following methods. 1. Constant Adam: All six blocks retain learning rate 10 − 3 10^{-3} 1 0 − 3 , with moments (0.9, 0.999) and numerical constant 10 − 8 10^{-8} 1 0 − 8 ; 2. Uniform cosine decay: separately labeled optimizer change. After the common 100,000-step prefix, all block learning rates decrease from 10 − 3 10^{-3} 1 0 − 3 to 10 − 5 10^{-5} 1 0 − 5 . For an update indexed by j ∈ { 0 , … , 219999 } j \in\{0, \ldots, 219999\} j ∈ { 0 , … , 219999 } after the fork, the rate for block k k k is η k ( j ) = 10 − 5 + η k , 0 − 10 − 5 2 [ 1 + cos ( π j 219999 ) ] \eta_k(j) = 10^{-5} + \frac{\eta_{k,0}-10^{-5}}{2}\left[1+\cos\left(\frac{\pi j}{219999}\right)\right] η k ( j ) = 1 0 − 5 + 2 η k , 0 − 1 0 − 5 [ 1 + cos ( 219999 π j ) ] ; 3. Low-rate extension: a larger, adaptively chosen budget. After observing the completed uniform-cosine runs and the aggressive schedule’s training/validation overscaling, we continue all five uniform-cosine endpoints to 20.48 million tasks. Every block uses η ( j ) = 10 − 6 + 10 − 5 − 10 − 6 2 [ 1 + cos ( π j 3199999 ) ] \eta(j) = 10^{-6} + \frac{10^{-5}-10^{-6}}{2}\left[1+\cos\left(\frac{\pi j}{3199999}\right)\right] η ( j ) = 1 0 − 6 + 2 1 0 − 5 − 1 0 − 6 [ 1 + cos ( 3199999 π j ) ] , j = 0 , … , 3199999 j = 0, \ldots, 3199999 j = 0 , … , 3199999 . Table 8 reports three metrics under τ = 0.2 \tau= 0.2 τ = 0.2 with above learning rate schedules. Each dense-feature experiment uses B = 32 B = 32 B = 32 and n = 20 n = 20 n = 20 .
Table 8. Results of Soft error, Hard error, and Greedy agreement with three learning rate schedules.
Emergence of Parameters. Figure 5 presents the final learned matrices P 1 P_1 P 1 , V 1 V_1 V 1 , P 2 P_2 P 2 , and V 2 V_2 V 2 obtained after training with τ = 0.2 \tau= 0.2 τ = 0.2 . Remarkably, the learned matrices recover the parameter structure predicted in Theorem 1 . In particular, the diagonal entries of A θ A_\theta A θ in P 1 P_1 P 1 approach 1 / τ 1/\tau 1/ τ , indicating that the Transformer has learned the internal action-selection computation required by the soft Q-learning update. This provides direct evidence of parameter emergence.
Figure 5. Final learned P 1 P_1 P 1 , V 1 V_1 V 1 , P 2 P_2 P 2 and V 2 V_2 V 2 matrices after training at τ = 0.2 \tau= 0.2 τ = 0.2 , B = 32 B = 32 B = 32 , and n = 20 n = 20 n = 20 . the non-zero structure matches the theoretical constructions (P 1 P_1 P 1 , V 1 V_1 V 1 , P 2 P_2 P 2 , V 2 V_2 V 2 ) in (9) and (11).
We define some evaluation metrics to demonstrate whether the final parameters emerge. Write B − = [ b − , K − ] B_- = [b_-, K_-] B − = [ b − , K − ] and B + = [ b + , K + ] B_+ = [b_+, K_+] B + = [ b + , K + ] . The analytical construction defines a sufficient family satisfying A θ = τ − 1 I A_\theta= \tau^{-1}I A θ = τ − 1 I , K − = − c I K_- = -cI K − = − c I , B r = c [ 1 , 0 ] B_r = c[1,0] B r = c [ 1 , 0 ] , L ⊤ K + = γ c I L^\top K_+ = \gamma cI L ⊤ K + = γ c I , c C = α I cC = \alpha I c C = α I , b − = 0 b_- = 0 b − = 0 , L ⊤ b + = 0 L^\top b_+ = 0 L ⊤ b + = 0 , where c ≠ 0 c \ne0 c = 0 may be positive or negative. For each trained model, we estimate c ^ = ( ( B r ) 0 − tr K − ) / ( d + 1 ) \hat{c} = ((B_r)_0 - \operatorname{tr} K_-)/(d+1) c ^ = (( B r ) 0 − tr K − ) / ( d + 1 ) separately for each model, allowing either sign. The product L ⊤ K + L^\top K_+ L ⊤ K + removes the arbitrary invertible representation of the intermediate greedy feature. Likewise L ⊤ b + L^\top b_+ L ⊤ b + , rather than b + b_+ b + alone, is the appropriate product entering the output relation. Low residuals indicate agreement with these sufficient relations. The complete diagnostics used in every table are
E A θ = ∥ τ A θ − I ∥ F d , E − = ∥ K − + c ^ I ∥ F ∣ c ^ ∣ d (56) E_{A_\theta} = \frac{\lVert\tau A_\theta- I\rVert_F}{\sqrt{d}}, \qquad E_- = \frac{\lVert K_- + \hat{c}I\rVert_F}{|\hat{c}|\sqrt{d}} \tag*{(56)} E A θ = d ∥ τ A θ − I ∥ F , E − = ∣ c ^ ∣ d ∥ K − + c ^ I ∥ F (56)
E r = ∥ B r − c ^ [ 1 , 0 ] ∥ F ∣ c ^ ∣ , E + = ∥ L ⊤ K + − γ c ^ I ∥ F γ ∣ c ^ ∣ d (57) E_r = \frac{\lVert B_r - \hat{c}[1,0]\rVert_F}{|\hat{c}|}, \qquad E_+ = \frac{\lVert L^\top K_+ - \gamma\hat{c}I\rVert_F}{\gamma|\hat{c}|\sqrt{d}} \tag*{(57)} E r = ∣ c ^ ∣ ∥ B r − c ^ [ 1 , 0 ] ∥ F , E + = γ ∣ c ^ ∣ d ∥ L ⊤ K + − γ c ^ I ∥ F (57)
E C = ∥ c ^ C − α I ∥ F α d , E − , 0 = ∥ b − ∥ 2 ∣ c ^ ∣ d (58) E_C = \frac{\lVert\hat{c}C - \alpha I\rVert_F}{\alpha\sqrt{d}}, \qquad E_{-,0} = \frac{\lVert b_-\rVert_2}{|\hat{c}|\sqrt{d}} \tag*{(58)} E C = α d ∥ c ^ C − α I ∥ F , E − , 0 = ∣ c ^ ∣ d ∥ b − ∥ 2 (58)
E + , 0 = ∥ L ⊤ b + ∥ 2 γ ∣ c ^ ∣ d , E T D 2 = E − 2 + E r 2 + E + 2 + E C 2 + E − , 0 2 + E + , 0 2 . (59) E_{+,0} = \frac{\lVert L^\top b_+\rVert_2}{\gamma|\hat{c}|\sqrt{d}}, \qquad E_{\mathrm{TD}}^2 = E_-^2 + E_r^2 + E_+^2 + E_C^2 + E_{-,0}^2 + E_{+,0}^2. \tag*{(59)} E + , 0 = γ ∣ c ^ ∣ d ∥ L ⊤ b + ∥ 2 , E TD 2 = E − 2 + E r 2 + E + 2 + E C 2 + E − , 0 2 + E + , 0 2 . (59)
and E a l l = E A θ 2 + E T D 2 E_{\mathrm{all}} = \sqrt{E_{A_\theta}^2 + E_{\mathrm{TD}}^2} E all = E A θ 2 + E TD 2 , τ ^ e f f = 1 / β a t t \hat{\tau}_{\mathrm{eff}} = 1/\beta_{\mathrm{att}} τ ^ eff = 1/ β att with β a t t = tr ( A θ ) / d > 0 \beta_{\mathrm{att}} = \operatorname{tr}(A_\theta)/d > 0 β att = tr ( A θ ) / d > 0 is a scalar projection diagnostic, not an exact temperature when A θ A_\theta A θ has nonscalar components. The scalar estimate is allowed to be negative. The full completed models have nondegenerate c ^ \hat{c} c ^ ; a normalization near zero is not interpreted as a zero residual. For arbitrary active blocks, E a l l E_{\mathrm{all}} E all is not an established Euclidean distance to all minimizers. Figures 6 and 7 present heatmaps of the key matrices and their relations under τ = 0.2 \tau= 0.2 τ = 0.2 , respectively, revealing that the training algorithm successfully induces the constructed parameters to emerge.
Figure 6. All six actual trained blocks, seed 0. A θ A_\theta A θ , L L L , C C C are 36 × 36 36 \times36 36 × 36 ; B − B_- B − , B + B_+ B + are 36 × 37 36 \times37 36 × 37 ; B r B_r B r is 1 × 37 1 \times37 1 × 37 . The fitted scalar is c ^ = 0.967893 \hat{c} = 0.967893 c ^ = 0.967893 . Dense L L L and B + B_+ B + are compatible with a nontrivial invertible gauge and are not replaced by identity-shaped pictures.
Figure 7. Normalized relations for the same model. The first four targets are I I I , the reward-row target is [ 1 , 0 , … , 0 ] [1,0,\ldots,0] [ 1 , 0 , … , 0 ] , and the two bias targets are zero. These are display-only diagnostics, not raw weights. Common limits are used for each named relation across seeds and methods, including the failed control.
For the relationship between the emergence of parameters and cumulative task exposure . Figure 8 tracks recovery along one training trajectory under growing cumulative task exposure. Reduced final TD residual shows attention-scale calibration dominates aggregate residual. Since task exposure and optimizer updates rise together, the curves cannot isolate task diversity’s fixed-compute effect.
Figure 8. Parameter recovery versus cumulative fresh tasks at B = 32 B = 32 B = 32 , n = 20 n = 20 n = 20 , and τ = 0.2 \tau= 0.2 τ = 0.2 . Left: attention residual E A E_{\mathrm{A}} E A . Right: the aggregate of the six remaining TD and bias residuals, E T D E_{\mathrm{TD}} E TD .
Table 9 shows close agreement with the analytical relations at temperature τ = 1 , 0.8 , 0.5 , \tau= 1, 0.8, 0.5, τ = 1 , 0.8 , 0.5 , and 0.2 0.2 0.2 , while recovery remains incomplete at τ = 0.1 \tau= 0.1 τ = 0.1 . At τ = 0.2 \tau= 0.2 τ = 0.2 , the learned scalar projection is β a t t = 4.992236 \beta_{\mathrm{att}} = 4.992236 β att = 4.992236 against a target of 5 5 5 . At τ = 0.1 \tau= 0.1 τ = 0.1 , it is 8.174396 8.174396 8.174396 against a target of 10 10 10 , and E a l l = 0.1826 E_{\mathrm{all}} = 0.1826 E all = 0.1826 . Figure 9 makes this scale discrepancy explicit rather than inferring recovery from matrix appearance alone. No temperature-specific tuning is performed; the tested values do not establish a critical temperature or an impossibility result for lower-temperature recovery.
Table 9. Final parameter recovery at 20.48 million tasks, B = 32 B = 32 B = 32 , and n = 20 n = 20 n = 20 . Entries are five-seed means; E a l l E_{\mathrm{all}} E all includes a pointwise 95% interval half-width. Residuals are dimensionless. The scalar projection β a t t \beta_{\mathrm{att}} β att is compared with 1 / τ 1/\tau 1/ τ without removing nonscalar distortion.
Figure 9. Temperature-dependent recovery at B = 32 B = 32 B = 32 and n = 20 n = 20 n = 20 . Left: attention residual versus cumulative tasks, with five paired seeds per temperature. Right: the learned scalar projection β a t t \beta_{\mathrm{att}} β att and its target 1 / τ 1/\tau 1/ τ . The target is shown only for evaluation; no matrix target is supplied during training.
For the relationship between the emergence of parameters and batch size . We report scale calibration and matrix shape in Figure 10 . The lowest endpoint mean of E a l l E_{\mathrm{all}} E all occurs at B = 128 B = 128 B = 128 , with value 7.204 × 10 − 4 7.204 \times10^{-4} 7.204 × 1 0 − 4 . By contrast, mean soft-update error continues to decrease up to B = 64 B = 64 B = 64 in Table 7 . Thus, the best observed parameter recovery and the lowest observed functional error do not coincide in this sweep. At fixed N t a s k N_{\mathrm{task}} N task , reducing B B B increases the number of Adam updates, whereas increasing B B B averages more tasks in each update. Adam’s moment memories are defined in update units, so their span in task units also changes. The observed ranking is consequently specific to the shared schedule, numerical precision, architecture, and task budget; it does not establish a universally optimal batch size.
Figure 10. Batch-size effects under a fixed task budget. Left: attention scale and traceless-shape residuals, whose squares sum to E A 2 E_A^2 E A 2 for each model. Right: aggregate residuals at four checkpoints of the same training runs. Intermediate curves are not independently retrained short-budget experiments.
For the relationship between the emergence of parameters and Training context length . For each training length, only the first n t r a i n n_{\mathrm{train}} n train transitions of the common 80-step trajectory enter the loss. The teacher increment is recomputed from that prefix with normalization α / n t r a i n \alpha/n_{\mathrm{train}} α / n train . The n t r a i n = 20 n_{\mathrm{train}} = 20 n train = 20 default uses the same paired generator and is shared across the three sweeps.
Table 10 : Training-length comparison at τ = 0.2 \tau= 0.2 τ = 0.2 and B = 32 B = 32 B = 32 . Every model receives 20.48 million tasks and 640,000 updates; supplied transitions differ. Residuals are five-seed means, with the 95% interval half-width for E a l l E_{\mathrm{all}} E all in the final column. The default is shared across sweeps.
Table 10.
Table 11 : Length-specific models on matched-length and common-n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 dense tests, and matched-length one-hot tests. Entries are update NRMSE percentages with pointwise 95% seed-interval half-widths. The tabular column measures feature transfer without one-hot training.
Table 11.
Among the tested lengths, n t r a i n = 20 n_{\mathrm{train}} = 20 n train = 20 yields the lowest sample mean of E a l l E_{\mathrm{all}} E all , 1.554 × 10 − 3 1.554 \times10^{-3} 1.554 × 1 0 − 3 (Table 10 ). This is a fixed-task, fixed-update comparison, not a fixed-transition or fixed-compute comparison: n = 80 n = 80 n = 80 supplies 80 times as many transitions per task as n = 1 n = 1 n = 1 . Context length also changes the distribution and variance of the window-averaged target. Table 11 therefore reports both matched-length tests and tests at the common length n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 . The common-length evaluation holds the test window fixed when comparing models trained with different lengths. The one-hot results measure dense-to-tabular feature transfer, not performance after one-hot training.
Figure 11. Training context length at τ = 0.2 \tau= 0.2 τ = 0.2 and B = 32 B = 32 B = 32 , with 20.48 million tasks per model. Left: final parameter residuals. Right: update errors on matched-length and common-length dense-feature tests.
Generalization to unseen tabular tasks. At τ = 0.2 \tau= 0.2 τ = 0.2 , the Transformer achieves mean return 0.4880, compared with 0.4861 for its soft teacher and 0.5374 for Oracle. The paired Transformer-minus-soft difference is 0.00188. This comparison does not resolve a return advantage and does not establish equivalence or noninferiority. The visit-count online Q-learning baseline reaches 0.5318, exceeding the Transformer means in the primary comparison. The evidence therefore supports useful self-fed transfer (Figure 12 ). Deployment intervals use 5,000 percentile-bootstrap replicates with independent resampling of the training-seed and test-task axes, preserving paired methods and complete trajectories.
Figure 12. Online Q-learning is included in the comparisons; the variant with decaying visit-count learning rate yields the best performance.
Table 12 and Figure 13 complete the five-temperature comparison; τ = 0.2 \tau= 0.2 τ = 0.2 appears in the main text. All curves use the same task bank, interaction axis, and evaluation protocol, and include Transformer, hard window-Q, soft window-Q, Oracle, and Random.
Table 12. Final returns on 512 unseen tabular tasks: n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 , zero Q initialization.
Figure 13. Tabular transfer at τ = 1 \tau= 1 τ = 1 , τ = 0.8 \tau= 0.8 τ = 0.8 , τ = 0.5 \tau= 0.5 τ = 0.5 , and τ = 0.1 \tau= 0.1 τ = 0.1 , with n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 , zero Q initialization, and 20,000 interactions. Error bars denote pointwise 95% intervals. Transformer weights are frozen throughout. All experiments use the same 512 tasks and 20,000-interaction budget.
For training and deployment context lengths. We distinguish three evaluations. The frozen-length test varies n t e s t n_{\mathrm{test}} n test for models trained with n t r a i n = 20 n_{\mathrm{train}} = 20 n train = 20 . The matched-length test deploys each length-specific model at its training length. The common-length test deploys all length-specific models at n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 . Every learner receives 20,000 interactions, so a window-based learner performs 20 , 000 / n t e s t 20,000/n_{\mathrm{test}} 20 , 000/ n test updates. Varying the deployment length therefore changes both the window-averaging coefficient and the update frequency.
In the frozen-length test, n t e s t = 5 n_{\mathrm{test}} = 5 n test = 5 yields the highest observed Transformer mean return, 0.5194, whereas n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 yields 0.4880. The window teachers exhibit a similar dependence on deployment length. With common n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 , the length-specific models instead have mean returns between 0.4868 and 0.4884. Thus, training-context effects should be distinguished from deployment update frequency; longer windows do not uniformly improve finite-budget control.
Figure 14. Separating training-length and deployment-length effects at τ = 0.2 \tau= 0.2 τ = 0.2 . Left: models trained at n t r a i n = 20 n_{\mathrm{train}} = 20 n train = 20 and deployed with different windows. Right: models trained at different lengths and all deployed at n t e s t = 20 n_{\mathrm{test}} = 20 n test = 20 . Both evaluations use the same task bank and 20,000-interaction budget.
Theoretical analysis
Fix integers d ≥ 1 d \ge1 d ≥ 1 , m ≥ 2 m \ge2 m ≥ 2 , n ≥ 1 n \ge1 n ≥ 1 and real constants α > 0 \alpha> 0 α > 0 , 0 < γ < 1 0 < \gamma< 1 0 < γ < 1 , τ > 0 \tau> 0 τ > 0 . The meanings of these fixed quantities are given below. The temperature τ \tau τ is fixed during optimization, let
z = ( w , { ϕ i , r i + 1 , ψ i , a : 0 ≤ i < n , a ∈ [ m ] } ) ∼ D n . z = \left(\mathbf{w}, \{\phi_i,r_{i+1},\psi_{i,a}: 0 \le i < n,\ a \in[m]\}\right) \sim\mathcal{D}_n. z = ( w , { ϕ i , r i + 1 , ψ i , a : 0 ≤ i < n , a ∈ [ m ]} ) ∼ D n .
Here w ∈ R d \mathbf{w} \in\mathbb{R}^d w ∈ R d is an input vector, held fixed within a context. The vector ϕ i ∈ R d \phi_i \in\mathbb{R}^d ϕ i ∈ R d is the current state–action feature, r i + 1 ∈ R r_{i+1} \in\mathbb{R} r i + 1 ∈ R is the observed reward, and ψ i , a ∈ R d \psi_{i,a} \in\mathbb{R}^d ψ i , a ∈ R d is the feature of candidate action a a a at the successor state. These are allowed to be statistically dependent. The symbol D n \mathcal{D}_n D n denotes their joint probability law, let
π i , a τ ( z ) = exp ( w ⊤ ψ i , a / τ ) ∑ b = 1 m exp ( w ⊤ ψ i , b / τ ) , ψ ˉ i τ ( z ) = ∑ a = 1 m π i , a τ ( z ) ψ i , a , (60) \pi^\tau_{i,a}(z) = \frac{\exp(\mathbf{w}^{\top}\psi_{i,a}/\tau)}{\sum_{b=1}^{m}\exp(\mathbf{w}^{\top}\psi_{i,b}/\tau)}, \qquad\bar{\psi}^{\tau}_i(z) = \sum_{a=1}^{m}\pi^\tau_{i,a}(z)\psi_{i,a}, \tag*{(60)} π i , a τ ( z ) = ∑ b = 1 m exp ( w ⊤ ψ i , b / τ ) exp ( w ⊤ ψ i , a / τ ) , ψ ˉ i τ ( z ) = a = 1 ∑ m π i , a τ ( z ) ψ i , a , (60)
δ i τ ( z ) = r i + 1 − w ⊤ ϕ i + γ w ⊤ ψ ˉ i τ ( z ) , F τ , n ( z ) = α n ∑ i = 0 n − 1 ϕ i δ i τ ( z ) . (61) \delta^\tau_i(z) = r_{i+1} - \mathbf{w}^{\top}\phi_i + \gamma\mathbf{w}^{\top}\bar{\psi}^{\tau}_i(z), \qquad F_{\tau,n}(z) = \frac{\alpha}{n}\sum_{i=0}^{n-1}\phi_i\delta^\tau_i(z). \tag*{(61)} δ i τ ( z ) = r i + 1 − w ⊤ ϕ i + γ w ⊤ ψ ˉ i τ ( z ) , F τ , n ( z ) = n α i = 0 ∑ n − 1 ϕ i δ i τ ( z ) . (61)
The probabilities π i , a τ \pi^\tau_{i,a} π i , a τ average successor features; they are not the behavior policy that generated the trajectory. The scalar δ i τ \delta^\tau_i δ i τ is the specified temporal-difference target minus the current score. The vector F τ , n ∈ R d F_{\tau,n} \in\mathbb{R}^d F τ , n ∈ R d is the update increment to imitate. Thus the teacher’s full prediction is w + F τ , n \mathbf{w} + F_{\tau,n} w + F τ , n .
In this appendix, we explicitly restrict optimization to the six-block support of Proposition B.3, with every other block fixed at zero. The six-block support θ s u p = ( A θ , L , B − , B + , B r , C ) ∈ Θ s u p \theta_{\mathrm{sup}} = (A_\theta,\mathbf{L},B_-,B_+,B_r,C) \in\Theta_{\mathrm{sup}} θ sup = ( A θ , L , B − , B + , B r , C ) ∈ Θ sup can be broken down into following blocks
θ = ( A , L , b − , K − , b + , K + , β , q , C ) ∈ Θ , dim Θ = 5 d 2 + 3 d + 1. (62) \theta= (A,L,b_-,K_-,b_+,K_+,\beta,q,C) \in\Theta, \qquad\dim\Theta= 5d^2 + 3d + 1. \tag*{(62)} θ = ( A , L , b − , K − , b + , K + , β , q , C ) ∈ Θ , dim Θ = 5 d 2 + 3 d + 1. (62)
where A = A θ A = A_\theta A = A θ , L = L L = \mathbf{L} L = L , B − = [ b − , K − ] B_- = [b_-,K_-] B − = [ b − , K − ] , B + = [ b + , K + ] B_+ = [b_+,K_+] B + = [ b + , K + ] , B r = [ β , q ⊤ ] B_r = [\beta,q^{\top}] B r = [ β , q ⊤ ] . The trainable matrix L L L is not assumed invertible; invertibility is imposed only on the exact-realization manifold.
p i , a ( A ; z ) = exp ( ψ i , a ⊤ A w ) ∑ b = 1 m exp ( ψ i , b ⊤ A w ) , ψ ˉ i ( A ; z ) = ∑ a p i , a ( A ; z ) ψ i , a , (63) p_{i,a}(A;z) = \frac{\exp(\psi_{i,a}^{\top}A\mathbf{w})}{\sum_{b=1}^{m}\exp(\psi_{i,b}^{\top}A\mathbf{w})}, \qquad\bar{\psi}_i(A;z) = \sum_a p_{i,a}(A;z)\psi_{i,a}, \tag*{(63)} p i , a ( A ; z ) = ∑ b = 1 m exp ( ψ i , b ⊤ A w ) exp ( ψ i , a ⊤ A w ) , ψ ˉ i ( A ; z ) = a ∑ p i , a ( A ; z ) ψ i , a , (63)
s i ( θ ; z ) = ϕ i ⊤ ( b − + K − w ) + ( L ψ ˉ i ( A ; z ) ) ⊤ ( b + + K + w ) + r i + 1 ( β + q ⊤ w ) , (64) s_i(\theta;z) = \phi_i^{\top}(b_- + K_-\mathbf{w}) + (L\bar{\psi}_i(A;z))^{\top}(b_+ + K_+\mathbf{w}) + r_{i+1}(\beta+ q^{\top}\mathbf{w}), \tag*{(64)} s i ( θ ; z ) = ϕ i ⊤ ( b − + K − w ) + ( L ψ ˉ i ( A ; z ) ) ⊤ ( b + + K + w ) + r i + 1 ( β + q ⊤ w ) , (64)
F θ , n ( z ) = 1 n ∑ i = 0 n − 1 C ϕ i s i ( θ ; z ) . (65) F_{\theta,n}(z) = \frac{1}{n}\sum_{i=0}^{n-1}C\phi_i s_i(\theta;z). \tag*{(65)} F θ , n ( z ) = n 1 i = 0 ∑ n − 1 C ϕ i s i ( θ ; z ) . (65)
Both full outputs add the same w \mathbf{w} w , so their difference is the increment error e θ ( z ) : = F θ , n ( z ) − F τ , n ( z ) e_\theta(z) := F_{\theta,n}(z) - F_{\tau,n}(z) e θ ( z ) := F θ , n ( z ) − F τ , n ( z ) . For the fixed context length n n n , we write the loss as L n ( θ ) = L ( θ ) L_n(\theta) = \mathcal{L}(\theta) L n ( θ ) = L ( θ ) , i.e.
L n ( θ ) = 1 2 E z ∼ D n ∥ F θ , n ( z ) − F τ , n ( z ) ∥ 2 2 . (66) L_n(\theta) = \frac{1}{2}\mathbb{E}_{z\sim\mathcal{D}_n}\lVert F_{\theta,n}(z) - F_{\tau,n}(z)\rVert_2^2. \tag*{(66)} L n ( θ ) = 2 1 E z ∼ D n ∥ F θ , n ( z ) − F τ , n ( z ) ∥ 2 2 . (66)
We prove Theorem 2 in three parts. First, we characterize the local geometry and normal curvature of the optimal parameter manifold. Second, we establish a one-step contraction of gradient descent toward this manifold. Finally, we use these results to prove convergence to a single optimal parameter and derive the matching worst-case iteration complexity over the admissible initialization class.
Geometry and Curvature of the Optimal Parameter Manifold
A perturbation U ∈ Θ U \in\Theta U ∈ Θ has blocks denoted by Δ A , … , Δ C \Delta A,\ldots,\Delta C Δ A , … , Δ C in the same order as (D.3).
∥ U ∥ Θ 2 = ∥ Δ A ∥ F 2 + ∥ Δ L ∥ F 2 + ∥ Δ b − ∥ 2 2 + ∥ Δ K − ∥ F 2 + ∥ Δ b + ∥ 2 2 + ∥ Δ K + ∥ F 2 + ∥ Δ β ∥ 2 2 + ∥ Δ q ∥ 2 2 + ∥ Δ C ∥ F 2 . \lVert U\rVert_{\Theta}^{2} = \lVert\Delta A\rVert_{F}^{2} + \lVert\Delta L\rVert_{F}^{2} + \lVert\Delta b_-\rVert_{2}^{2} + \lVert\Delta K_-\rVert_{F}^{2} + \lVert\Delta b_+\rVert_{2}^{2}
+ \lVert\Delta K_+\rVert_{F}^{2} + \lVert\Delta\beta\rVert_{2}^{2} + \lVert\Delta q\rVert_{2}^{2} + \lVert\Delta C\rVert_{F}^{2}. ∥ U ∥ Θ 2 = ∥ Δ A ∥ F 2 + ∥ Δ L ∥ F 2 + ∥ Δ b − ∥ 2 2 + ∥ Δ K − ∥ F 2 + ∥ Δ b + ∥ 2 2 + ∥ Δ K + ∥ F 2 + ∥ Δ β ∥ 2 2 + ∥ Δ q ∥ 2 2 + ∥ Δ C ∥ F 2 .
For a vector, ∥ x ∥ 2 2 = ∑ j x j 2 \lVert x\rVert_2^2 = \sum_j x_j^2 ∥ x ∥ 2 2 = ∑ j x j 2 ; for a matrix, ∥ M ∥ F 2 = tr ( M ⊤ M ) \lVert M\rVert_F^2 = \operatorname{tr}(M^{\top}M) ∥ M ∥ F 2 = tr ( M ⊤ M ) . The product inner product is the corresponding sum of vector dot products and matrix Frobenius inner products. We abbreviate ∥ U ∥ Θ \lVert U\rVert_{\Theta} ∥ U ∥ Θ to ∥ U ∥ \lVert U\rVert ∥ U ∥ when the space is unambiguous. Norms of operators are induced by their domain and codomain norms, not entrywise norms unless specified.
For a fixed context z z z , let J θ , n ( z ) : = D θ F θ , n ( z ) : Θ → R d J_{\theta,n}(z) := D_{\theta}F_{\theta,n}(z) : \Theta\to\mathbb{R}^{d} J θ , n ( z ) := D θ F θ , n ( z ) : Θ → R d denote the Jacobian of the Transformer output with respect to its parameters. Thus, for a parameter perturbation U ∈ Θ U \in\Theta U ∈ Θ , J θ , n ( z ) [ U ] = d d t F θ + t U , n ( z ) ∣ t = 0 J_{\theta,n}(z)[U] = \left.\frac{\mathrm{d}}{\mathrm{d}t}F_{\theta+tU,n}(z)\right|_{t=0} J θ , n ( z ) [ U ] = d t d F θ + t U , n ( z ) t = 0 . Equivalently, F θ + t U , n ( z ) = F θ , n ( z ) + t J θ , n ( z ) [ U ] + o ( t ) F_{\theta+tU,n}(z) = F_{\theta,n}(z) + tJ_{\theta,n}(z)[U] + o(t) F θ + t U , n ( z ) = F θ , n ( z ) + t J θ , n ( z ) [ U ] + o ( t ) . Hence J θ , n ( z ) [ U ] J_{\theta,n}(z)[U] J θ , n ( z ) [ U ] measures the first-order change of the Transformer output, on the particular context z z z , when the parameters are perturbed in direction U U U .
Since our training objective is the population loss (D.7), we now introduce the population Jacobian. We therefore consider the Hilbert space
H n = L 2 ( D n ; R d ) , ⟨ f , h ⟩ H n = E ⟨ f ( z ) , h ( z ) ⟩ 2 , \mathcal{H}_n = L^2(\mathcal{D}_n;\mathbb{R}^d), \qquad\langle f,h\rangle_{\mathcal{H}_n} = \mathbb{E}\langle f(z),h(z)\rangle_2, H n = L 2 ( D n ; R d ) , ⟨ f , h ⟩ H n = E ⟨ f ( z ) , h ( z ) ⟩ 2 ,
with norm ∥ f ∥ H n 2 = E ∥ f ( z ) ∥ 2 2 \lVert f\rVert_{\mathcal{H}_n}^2 = \mathbb{E}\lVert f(z)\rVert_2^2 ∥ f ∥ H n 2 = E ∥ f ( z ) ∥ 2 2 , and define the population Jacobian J θ , n : Θ → H n J_{\theta,n} : \Theta\to\mathcal{H}_n J θ , n : Θ → H n , ( J θ , n U ) ( z ) = J θ , n ( z ) [ U ] (J_{\theta,n}U)(z) = J_{\theta,n}(z)[U] ( J θ , n U ) ( z ) = J θ , n ( z ) [ U ] . Thus ∥ J θ , n U ∥ H n 2 = E ∥ J θ , n ( z ) [ U ] ∥ 2 2 \lVert J_{\theta,n}U\rVert_{\mathcal{H}_n}^2 = \mathbb{E}\lVert J_{\theta,n}(z)[U]\rVert_2^2 ∥ J θ , n U ∥ H n 2 = E ∥ J θ , n ( z ) [ U ] ∥ 2 2 measures the average squared first-order output change caused by the parameter perturbation U U U over the entire context distribution.
Let J θ , n ∗ J_{\theta,n}^{*} J θ , n ∗ denote the adjoint of the population Jacobian, defined by ⟨ J θ , n U , f ⟩ H n = ⟨ U , J θ , n ∗ f ⟩ Θ \langle J_{\theta,n}U,f\rangle_{\mathcal{H}_n} = \langle U,J_{\theta,n}^{*}f\rangle_{\Theta} ⟨ J θ , n U , f ⟩ H n = ⟨ U , J θ , n ∗ f ⟩ Θ . Equivalently, J θ , n ∗ f = E [ J θ , n ( z ) ∗ f ( z ) ] J_{\theta,n}^{*}f = \mathbb{E}[J_{\theta,n}(z)^{*}f(z)] J θ , n ∗ f = E [ J θ , n ( z ) ∗ f ( z )] .
At an exact realization θ ˉ ∈ M τ \bar{\theta} \in\mathcal{M}_{\tau} θ ˉ ∈ M τ , define the population Gauss-Newton operator G ( θ ˉ ) : = J θ ˉ , n ∗ J θ ˉ , n G(\bar{\theta}) := J_{\bar{\theta},n}^{*}J_{\bar{\theta},n} G ( θ ˉ ) := J θ ˉ , n ∗ J θ ˉ , n . For every parameter direction U U U ,
⟨ U , G ( θ ˉ ) U ⟩ = ∥ J θ ˉ , n U ∥ H n 2 = E ∥ J θ ˉ , n ( z ) [ U ] ∥ 2 2 . \langle U,G(\bar{\theta})U\rangle= \lVert J_{\bar{\theta},n}U\rVert_{\mathcal{H}_n}^{2} = \mathbb{E}\lVert J_{\bar{\theta},n}(z)[U]\rVert_2^2. ⟨ U , G ( θ ˉ ) U ⟩ = ∥ J θ ˉ , n U ∥ H n 2 = E ∥ J θ ˉ , n ( z ) [ U ] ∥ 2 2 .
Therefore G ( θ ˉ ) G(\bar{\theta}) G ( θ ˉ ) quantifies how strongly the Transformer output responds, to first order, to perturbations of its parameters around an exact realization. The minimum normal curvature over the chosen target patch U τ ⊂ M τ \mathcal{U}_{\tau} \subset\mathcal{M}_{\tau} U τ ⊂ M τ is defined by κ : = inf θ ˉ ∈ U τ , U ∈ N θ ˉ M τ , ∥ U ∥ = 1 ∥ J θ ˉ , n U ∥ H n 2 \kappa:= \inf_{\bar{\theta}\in\mathcal{U}_{\tau},\,U\in N_{\bar{\theta}}\mathcal{M}_{\tau},\,\lVert U\rVert=1}\lVert J_{\bar{\theta},n}U\rVert_{\mathcal{H}_n}^{2} κ := inf θ ˉ ∈ U τ , U ∈ N θ ˉ M τ , ∥ U ∥ = 1 ∥ J θ ˉ , n U ∥ H n 2 .
The quantity κ \kappa κ has a direct optimization interpretation. A large κ \kappa κ means that every unit perturbation away from the exact-realization manifold produces a substantial change in the Transformer output, so the population loss has appreciable curvature in every identifiable parameter direction. A small κ \kappa κ means that at least one identifiable direction is nearly flat and is therefore harder to learn by training.
Throughout the remainder of Appendix D, n n n and τ \tau τ are fixed. We use the abbreviations J θ = J θ , n J_{\theta}=J_{\theta,n} J θ = J θ , n , G = G n G=G_n G = G n , H = H n \mathcal{H}=\mathcal{H}_n H = H n , and H = H n ( τ ) H=H_n(\tau) H = H n ( τ ) . Below we mainly analyze the geometric and curvature information of the optimal parameter manifold, as detailed in Lemmas D.1, D.2 and D.3 below.
Structure of the optimal parameter manifold. The structure of the optimal parameter manifold establishes that every parameter on the manifold exactly realizes the target update and achieves zero loss, that the collection of such optimal parameters forms a smooth embedded manifold, and that the Hessian ∇ 2 L n ( θ ˉ ) \nabla^2L_n(\bar{\theta}) ∇ 2 L n ( θ ˉ ) is degenerate exactly along the tangent directions of this manifold, which means motion within M τ \mathcal{M}_{\tau} M τ preserves zero loss, whereas every nonzero normal direction has strictly positive Hessian curvature.
Lemma D.1 (Structure of the optimal parameter manifold). For every θ ˉ = θ ˉ τ ( L , c ) ∈ M τ \bar{\theta}=\bar{\theta}_{\tau}(L,c)\in\mathcal{M}_{\tau} θ ˉ = θ ˉ τ ( L , c ) ∈ M τ , F θ ˉ , n ( z ) = F τ , n ( z ) F_{\bar{\theta},n}(z)=F_{\tau,n}(z) F θ ˉ , n ( z ) = F τ , n ( z ) for every admissible input z z z , and
(i) L n ( θ ˉ ) = 0 = min θ ∈ Θ L n ( θ ) L_n(\bar{\theta})=0=\min_{\theta\in\Theta}L_n(\theta) L n ( θ ˉ ) = 0 = min θ ∈ Θ L n ( θ ) , and M τ ⊆ arg min θ ∈ Θ L n ( θ ) \mathcal{M}_{\tau}\subseteq\arg\min_{\theta\in\Theta}L_n(\theta) M τ ⊆ arg min θ ∈ Θ L n ( θ ) .
(ii) M τ \mathcal{M}_{\tau} M τ is a closed smooth embedded submanifold of Θ \Theta Θ , dim ( M τ ) = d 2 + 1 \dim(\mathcal{M}_{\tau})=d^2+1 dim ( M τ ) = d 2 + 1 .
(iii) Under Assumption 1, ker G n ( θ ˉ ) = T θ ˉ M τ \ker G_n(\bar{\theta})=T_{\bar{\theta}}\mathcal{M}_{\tau} ker G n ( θ ˉ ) = T θ ˉ M τ and ∇ 2 L n ( θ ˉ ) = G n ( θ ˉ ) \nabla^2L_n(\bar{\theta})=G_n(\bar{\theta}) ∇ 2 L n ( θ ˉ ) = G n ( θ ˉ ) , where ker T \ker T ker T denotes the set of directions that the operator T T T maps to zero, i.e., the directions along which T T T has no effect.
Proof. (i) Since the population loss is L n ( θ ) = 1 2 E [ ∥ F θ , n ( z ) − F τ , n ( z ) ∥ 2 2 ] L_n(\theta)=\frac{1}{2}\mathbb{E}\left[\lVert F_{\theta,n}(z)-F_{\tau,n}(z)\rVert_2^2\right] L n ( θ ) = 2 1 E [ ∥ F θ , n ( z ) − F τ , n ( z ) ∥ 2 2 ] , Theorem 1 immediately gives L n ( θ ˉ ) = 0 L_n(\bar{\theta})=0 L n ( θ ˉ ) = 0 and L n ( θ ) ≥ 0 L_n(\theta)\geq0 L n ( θ ) ≥ 0 for every θ ∈ Θ \theta\in\Theta θ ∈ Θ . Therefore L n ( θ ˉ ) = 0 = min θ ∈ Θ L n ( θ ) L_n(\bar{\theta})=0=\min_{\theta\in\Theta}L_n(\theta) L n ( θ ˉ ) = 0 = min θ ∈ Θ L n ( θ ) . Since θ ˉ ∈ M τ \bar{\theta}\in\mathcal{M}_{\tau} θ ˉ ∈ M τ was arbitrary, M τ ⊆ arg min θ ∈ Θ L n ( θ ) \mathcal{M}_{\tau}\subseteq\arg\min_{\theta\in\Theta}L_n(\theta) M τ ⊆ arg min θ ∈ Θ L n ( θ ) .
(ii) Define G : = G L ( d ) × ( R ∖ { 0 } ) \mathcal{G}:=GL(d)\times(\mathbb{R}\setminus\{0\}) G := G L ( d ) × ( R ∖ { 0 }) . Since G L ( d ) = { L ∈ R d × d : det ( L ) ≠ 0 } GL(d)=\{L\in\mathbb{R}^{d\times d}:\det(L)\ne0\} G L ( d ) = { L ∈ R d × d : det ( L ) = 0 } , and the determinant map is continuous, G L ( d ) GL(d) G L ( d ) is an open subset of R d 2 ≃ R d 2 \mathbb{R}^{d^2}\simeq\mathbb{R}^{d^2} R d 2 ≃ R d 2 . Likewise, R ∖ { 0 } \mathbb{R}\setminus\{0\} R ∖ { 0 } is open in R \mathbb{R} R . Therefore G ⊂ R d 2 + 1 \mathcal{G}\subset\mathbb{R}^{d^2+1} G ⊂ R d 2 + 1 is an open smooth manifold of dimension dim ( G ) = d 2 + 1 \dim(\mathcal{G})=d^2+1 dim ( G ) = d 2 + 1 .
Define the parameterization Φ τ : G → Θ \Phi_{\tau}:\mathcal{G}\to\Theta Φ τ : G → Θ , Φ τ ( L , c ) : = θ ˉ τ ( L , c ) \Phi_{\tau}(L,c):=\bar{\theta}_{\tau}(L,c) Φ τ ( L , c ) := θ ˉ τ ( L , c ) . Then, by definition, M τ = Φ τ ( G ) \mathcal{M}_{\tau}=\Phi_{\tau}(\mathcal{G}) M τ = Φ τ ( G ) . Matrix inversion L ↦ L − 1 L\mapsto L^{-1} L ↦ L − 1 is smooth on G L ( d ) GL(d) G L ( d ) , while the scalar map c ↦ c − 1 c\mapsto c^{-1} c ↦ c − 1 is smooth on R ∖ { 0 } \mathbb{R}\setminus\{0\} R ∖ { 0 } . Consequently, ( L , c ) ↦ c γ L − 1 (L,c)\mapsto c\gamma L^{-1} ( L , c ) ↦ c γ L − 1 , ( L , c ) ↦ α c I d (L,c)\mapsto\frac{\alpha}{c}I_d ( L , c ) ↦ c α I d are smooth, and hence Φ τ \Phi_{\tau} Φ τ is a smooth map. In order to prove M τ = Φ τ ( G ) \mathcal{M}_{\tau}=\Phi_{\tau}(\mathcal{G}) M τ = Φ τ ( G ) is an embedded submanifold of Θ \Theta Θ , it suffices to verify that Φ τ \Phi_{\tau} Φ τ is an injective immersion which is a homeomorphism onto its image. Since Φ τ ( L 1 , c 1 ) = Φ τ ( L 2 , c 2 ) ⇒ ( L 1 , c 1 ) = ( L 2 , c 2 ) \Phi_{\tau}(L_{1},c_{1})=\Phi_{\tau}(L_{2},c_{2})\mathbin{\Rightarrow}(L_{1},c_{1})=(L_{2},c_{2}) Φ τ ( L 1 , c 1 ) = Φ τ ( L 2 , c 2 ) ⇒ ( L 1 , c 1 ) = ( L 2 , c 2 ) , Φ τ \Phi_{\tau} Φ τ is injective. For a perturbation ( Z , ξ ) ∈ R d × d × R ≃ T ( L , c ) G (Z,\xi)\in\mathbb{R}^{d\times d}\times\mathbb{R}\simeq T_{(L,c)}\mathcal{G} ( Z , ξ ) ∈ R d × d × R ≃ T ( L , c ) G , where T ( L , c ) G T_{(L,c)}\mathcal{G} T ( L , c ) G is the tangent space of G \mathcal{G} G at the point ( L , c ) (L,c) ( L , c ) , the differential of Φ τ \Phi_{\tau} Φ τ is
D Φ τ ( L , c ) [ Z , ξ ] = ( 0 , Z , 0 , − ξ I d , 0 , γ ξ L − T − c γ L − T Z T L − T , ξ , 0 , − α ξ c − 2 I d ) . D\Phi_{\tau}(L,c)[Z,\xi]=\left(0,Z,0,-\xi I_{d},0,\gamma\xi L^{-\mathsf{T}}-c\gamma L^{-\mathsf{T}}Z^{\mathsf{T}}L^{-\mathsf{T}},\xi,0,-\alpha\xi c^{-2}I_{d}\right). D Φ τ ( L , c ) [ Z , ξ ] = ( 0 , Z , 0 , − ξ I d , 0 , γ ξ L − T − c γ L − T Z T L − T , ξ , 0 , − α ξ c − 2 I d ) .
This follows from differentiating L − T L T = I d L^{-\mathsf{T}}L^{\mathsf{T}}=I_{d} L − T L T = I d in the direction Z Z Z , which gives D ( L − T ) [ Z ] = − L − T Z T L − T D(L^{-\mathsf{T}})[Z]=-L^{-\mathsf{T}}Z^{\mathsf{T}}L^{-\mathsf{T}} D ( L − T ) [ Z ] = − L − T Z T L − T . Suppose D Φ τ ( L , c ) [ Z , ξ ] = 0 D\Phi_{\tau}(L,c)[Z,\xi]=0 D Φ τ ( L , c ) [ Z , ξ ] = 0 , we have ( Z , ξ ) = ( 0 , 0 ) (Z,\xi)=(0,0) ( Z , ξ ) = ( 0 , 0 ) , which means D Φ τ ( L , c ) D\Phi_{\tau}(L,c) D Φ τ ( L , c ) is injective at every ( L , c ) ∈ G (L,c)\in\mathcal{G} ( L , c ) ∈ G , i.e. Φ τ \Phi_{\tau} Φ τ is an immersion. For any θ = ( A , L , b − , K − , b + , K + , β , q , C ) ∈ M τ \theta=(A,L,b_{-},K_{-},b_{+},K_{+},\beta,q,C)\in\mathcal{M}_{\tau} θ = ( A , L , b − , K − , b + , K + , β , q , C ) ∈ M τ , the inverse parameterization on M τ \mathcal{M}_{\tau} M τ is simply Φ τ − 1 ( θ ) = ( L , β ) \Phi_{\tau}^{-1}(\theta)=(L,\beta) Φ τ − 1 ( θ ) = ( L , β ) . Since coordinate projections are continuous, Φ τ − 1 \Phi_{\tau}^{-1} Φ τ − 1 is continuous on its image. Therefore, M τ = Φ τ ( G ) \mathcal{M}_{\tau}=\Phi_{\tau}(\mathcal{G}) M τ = Φ τ ( G ) is an embedded submanifold of Θ \Theta Θ , and dim ( M τ ) = d 2 + 1 \dim(\mathcal{M}_{\tau})=d^{2}+1 dim ( M τ ) = d 2 + 1 by the fact that an embedding preserves dimension.
It remains to show that M τ \mathcal{M}_{\tau} M τ is closed as a subset of Θ \Theta Θ . Consider an arbitrary convergent sequence θ j = θ ˉ τ ( L j , c j ) ∈ M τ \theta_{j}=\bar{\theta}_{\tau}(L_{j},c_{j})\in\mathcal{M}_{\tau} θ j = θ ˉ τ ( L j , c j ) ∈ M τ , θ j → θ ⋆ \theta_{j}\to\theta_{\star} θ j → θ ⋆ in Θ \Theta Θ . We show that θ ⋆ ∈ M τ \theta_{\star}\in\mathcal{M}_{\tau} θ ⋆ ∈ M τ . Since convergence in Θ \Theta Θ implies convergence of every parameter block, L j → L ⋆ L_{j}\to L_{\star} L j → L ⋆ . Since the seventh block satisfies β j = c j \beta_{j}=c_{j} β j = c j , c j → c ⋆ : = β ⋆ c_{j}\to c_{\star}:=\beta_{\star} c j → c ⋆ := β ⋆ . We need to verify that c ⋆ ≠ 0 c_{\star}\ne0 c ⋆ = 0 and L ⋆ ∈ G L ( d ) L_{\star}\in GL(d) L ⋆ ∈ G L ( d ) .
Suppose, for contradiction, that c ⋆ = 0 c_{\star}=0 c ⋆ = 0 , then c j → 0 c_{j}\to0 c j → 0 . However, the ninth parameter block is C j = α c j I d C_{j}=\frac{\alpha}{c_{j}}I_{d} C j = c j α I d .
Since α > 0 \alpha>0 α > 0 , ∥ C j ∥ F = α ∣ c j ∣ ∥ I d ∥ F = α d ∣ c j ∣ → ∞ \lVert C_{j}\rVert_{F}=\frac{\alpha}{\lvert c_{j}\rvert}\lVert I_{d}\rVert_{F}=\frac{\alpha\sqrt{d}}{\lvert c_{j}\rvert}\to\infty ∥ C j ∥ F = ∣ c j ∣ α ∥ I d ∥ F = ∣ c j ∣ α d → ∞ . This contradicts the assumed convergence of θ j \theta_{j} θ j in the finite-dimensional parameter space Θ \Theta Θ , thus c ⋆ ≠ 0 c_{\star}\ne0 c ⋆ = 0 .
Similarly, suppose that L ⋆ L_{\star} L ⋆ is singular. Since L j ∈ G L ( d ) L_{j}\in GL(d) L j ∈ G L ( d ) , L j → L ⋆ L_{j}\to L_{\star} L j → L ⋆ , with L ⋆ L_{\star} L ⋆ singular, the smallest singular value satisfies σ min ( L j ) → 0 \sigma_{\min}(L_{j})\to0 σ m i n ( L j ) → 0 . Consequently, ∥ L j − 1 ∥ o p = 1 σ min ( L j ) → ∞ \lVert L_{j}^{-1}\rVert_{\mathrm{op}}=\frac{1}{\sigma_{\min}(L_{j})}\to\infty ∥ L j − 1 ∥ op = σ m i n ( L j ) 1 → ∞ . On the other hand, c j → c ⋆ ≠ 0 c_{j}\to c_{\star}\ne0 c j → c ⋆ = 0 , so for sufficiently large j j j , ∣ c j ∣ ≥ ∣ c ⋆ ∣ 2 > 0 \lvert c_{j}\rvert\ge\frac{\lvert c_{\star}\rvert}{2}>0 ∣ c j ∣ ≥ 2 ∣ c ⋆ ∣ > 0 . The sixth parameter block is K + , j = c j γ L j − T K_{+,j}=c_{j}\gamma L_{j}^{-\mathsf{T}} K + , j = c j γ L j − T . Therefore ∥ K + , j ∥ o p = γ ∣ c j ∣ ∥ L j − T ∥ o p = γ ∣ c j ∣ σ min ( L j ) ⟶ ∞ \lVert K_{+,j}\rVert_{\mathrm{op}}=\gamma\lvert c_{j}\rvert\lVert L_{j}^{-\mathsf{T}}\rVert_{\mathrm{op}}=\frac{\gamma\lvert c_{j}\rvert}{\sigma_{\min}(L_{j})}\longrightarrow\infty ∥ K + , j ∥ op = γ ∣ c j ∣ ∥ L j − T ∥ op = σ m i n ( L j ) γ ∣ c j ∣ ⟶ ∞ , contradicting convergence of the sixth block of θ j \theta_{j} θ j , thus L ⋆ ∈ G L ( d ) L_{\star}\in GL(d) L ⋆ ∈ G L ( d ) . Since L ⋆ ∈ G L ( d ) L_{\star}\in GL(d) L ⋆ ∈ G L ( d ) and c ⋆ ≠ 0 c_{\star}\ne0 c ⋆ = 0 , the pair ( L ⋆ , c ⋆ ) (L_{\star},c_{\star}) ( L ⋆ , c ⋆ ) belongs to G \mathcal{G} G . Moreover, continuity of matrix inversion on G L ( d ) GL(d) G L ( d ) gives L j − 1 → L ⋆ − 1 L_{j}^{-1}\to L_{\star}^{-1} L j − 1 → L ⋆ − 1 , and continuity of c ⋆ ↦ 1 / c ⋆ c_{\star}\mapsto1/c_{\star} c ⋆ ↦ 1/ c ⋆ gives 1 c j → 1 c ⋆ \frac{1}{c_{j}}\to\frac{1}{c_{\star}} c j 1 → c ⋆ 1 .
Therefore every block of θ j \theta_{j} θ j converges to the corresponding block of θ ˉ τ ( L , c ) \bar{\theta}_{\tau}(L,c) θ ˉ τ ( L , c ) , so that θ ⋆ = θ ˉ τ ( L ⋆ , c ⋆ ) ∈ M τ \theta_{\star}=\bar{\theta}_{\tau}(L_{\star},c_{\star})\in\mathcal{M}_{\tau} θ ⋆ = θ ˉ τ ( L ⋆ , c ⋆ ) ∈ M τ . Hence every convergent sequence in M τ \mathcal{M}_{\tau} M τ whose limit exists in Θ \Theta Θ has its limit again in M τ \mathcal{M}_{\tau} M τ . Since Θ \Theta Θ is finite dimensional, this proves that M τ \mathcal{M}_{\tau} M τ is closed.
(iii) We prove ker G ( θ ˉ ) = T θ ˉ M τ \ker G(\bar{\theta})=T_{\bar{\theta}}\mathcal{M}_{\tau} ker G ( θ ˉ ) = T θ ˉ M τ and ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) : = J θ ⋆ J θ \nabla^{2}L_{n}(\bar{\theta})=G(\bar{\theta}):=J_{\theta}^{\star}J_{\theta} ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) := J θ ⋆ J θ in the following four steps.
Step 1: Tangent space of the optimal parameter manifold M τ \mathcal{M}_{\tau} M τ .
Consider a smooth curve t ↦ ( L ( t ) , c ( t ) ) t\mapsto(L(t),c(t)) t ↦ ( L ( t ) , c ( t )) in G L ( d ) × ( R ∖ { 0 } ) GL(d)\times(\mathbb{R}\setminus\{0\}) G L ( d ) × ( R ∖ { 0 }) such that L ( 0 ) = L L(0)=L L ( 0 ) = L , c ( 0 ) = c c(0)=c c ( 0 ) = c . Write Z : = L ˙ ( 0 ) Z:=\dot{L}(0) Z := L ˙ ( 0 ) , ξ : = c ˙ ( 0 ) \xi:=\dot{c}(0) ξ := c ˙ ( 0 ) . Differentiating L ( t ) − 1 L ( t ) = I d L(t)^{-1}L(t)=I_{d} L ( t ) − 1 L ( t ) = I d at t = 0 t=0 t = 0 gives
d d t L ( t ) − T ∣ t = 0 = − L − T Z T L − T . \left.\frac{d}{dt}L(t)^{-\mathsf{T}}\right|_{t=0}=-L^{-\mathsf{T}}Z^{\mathsf{T}}L^{-\mathsf{T}}. d t d L ( t ) − T t = 0 = − L − T Z T L − T .
Hence differentiating θ ˉ τ ( L ( t ) , c ( t ) ) \bar{\theta}_{\tau}(L(t),c(t)) θ ˉ τ ( L ( t ) , c ( t )) gives
Δ A = 0 , Δ L = Z , Δ b − = 0 , Δ K − = − ξ I d , \Delta A=0,\quad\Delta L=Z,\quad\Delta b_{-}=0,\quad\Delta K_{-}=-\xi I_{d}, Δ A = 0 , Δ L = Z , Δ b − = 0 , Δ K − = − ξ I d ,
Δ b + = 0 , Δ q = 0 , Δ β = ξ , Δ C = − α ξ c − 2 I d , \Delta b_{+}=0,\quad\Delta q=0,\quad\Delta\beta=\xi,\quad\Delta C=-\alpha\xi c^{-2}I_{d}, Δ b + = 0 , Δ q = 0 , Δ β = ξ , Δ C = − α ξ c − 2 I d ,
Δ K + = d d t [ γ c ( t ) L ( t ) − T ] ∣ t = 0 = γ ξ L − T − c γ L − T Z T L − T . \Delta K_{+}=\left.\frac{d}{dt}\left[\gamma c(t)L(t)^{-\mathsf{T}}\right]\right|_{t=0}
=\gamma\xi L^{-\mathsf{T}}-c\gamma L^{-\mathsf{T}}Z^{\mathsf{T}}L^{-\mathsf{T}}. Δ K + = d t d [ γ c ( t ) L ( t ) − T ] t = 0 = γ ξ L − T − c γ L − T Z T L − T .
Therefore
T θ ˉ M τ = { ( 0 , Z , 0 , − ξ I d , 0 , γ ξ L − T − c γ L − T Z T L − T , ξ , 0 , − α ξ c − 2 I d ) : Z ∈ R d × d , ξ ∈ R } . (67) T_{\bar{\theta}}\mathcal{M}_{\tau}
=
\left\{
(0,Z,0,-\xi I_{d},0,\gamma\xi L^{-\mathsf{T}}-c\gamma L^{-\mathsf{T}}Z^{\mathsf{T}}L^{-\mathsf{T}},\xi,0,-\alpha\xi c^{-2}I_{d})
: Z\in\mathbb{R}^{d\times d},\ \xi\in\mathbb{R}
\right\}. \tag*{(67)} T θ ˉ M τ = { ( 0 , Z , 0 , − ξ I d , 0 , γ ξ L − T − c γ L − T Z T L − T , ξ , 0 , − α ξ c − 2 I d ) : Z ∈ R d × d , ξ ∈ R } . (67)
These are precisely the infinitesimal gauge directions.
Step 2: Sample Jacobian and collect the observable parameter combinations. Recall p i , a ( A ) p_{i,a}(A) p i , a ( A ) and ψ ˉ i ( A ) \bar{\psi}_i(A) ψ ˉ i ( A ) defined in (D.4). Let Σ i τ = ∑ a π i , a τ ( ψ i , a − ψ ˉ i τ ) ( ψ i , a − ψ ˉ i τ ) ⊤ \Sigma_i^\tau= \sum_a \pi_{i,a}^\tau(\psi_{i,a}-\bar{\psi}_i^\tau)(\psi_{i,a}-\bar{\psi}_i^\tau)^\top Σ i τ = ∑ a π i , a τ ( ψ i , a − ψ ˉ i τ ) ( ψ i , a − ψ ˉ i τ ) ⊤ . The softmax derivative gives D p i , a ( τ − 1 I d ) [ Δ A ] = π i , a τ ( ψ i , a − ψ ˉ i τ ) ⊤ Δ A w D p_{i,a}(\tau^{-1}I_d)[\Delta A] = \pi_{i,a}^\tau(\psi_{i,a}-\bar{\psi}_i^\tau)^\top\Delta A\,w D p i , a ( τ − 1 I d ) [ Δ A ] = π i , a τ ( ψ i , a − ψ ˉ i τ ) ⊤ Δ A w . Consequently,
D ψ ˉ i ( τ − 1 I d ) [ Δ A ] = ∑ a ψ i , a D p i , a ( τ − 1 I d ) [ Δ A ] = Σ i τ Δ A w . (68) D\bar{\psi}_i(\tau^{-1}I_d)[\Delta A] = \sum_a \psi_{i,a}D p_{i,a}(\tau^{-1}I_d)[\Delta A] = \Sigma_i^\tau\Delta A\,w. \tag*{(68)} D ψ ˉ i ( τ − 1 I d ) [ Δ A ] = a ∑ ψ i , a D p i , a ( τ − 1 I d ) [ Δ A ] = Σ i τ Δ A w . (68)
Recall s i ( θ ; z ) = ϕ i ⊤ ( b − + K − w ) + b + ⊤ L ψ ˉ i ( A ) + w ⊤ K + ⊤ L ψ ˉ i ( A ) + r i + 1 ( β + q ⊤ w ) s_i(\theta;z)=\phi_i^\top(b_-+K_-w)+b_+^\top L\bar{\psi}_i(A)+w^\top K_+^\top L\bar{\psi}_i(A)+r_{i+1}(\beta+q^\top w) s i ( θ ; z ) = ϕ i ⊤ ( b − + K − w ) + b + ⊤ L ψ ˉ i ( A ) + w ⊤ K + ⊤ L ψ ˉ i ( A ) + r i + 1 ( β + q ⊤ w ) defined in (D.5). At θ ˉ = θ ˉ τ ( L , c ) \bar{\theta}=\bar{\theta}_\tau(L,c) θ ˉ = θ ˉ τ ( L , c ) , we have b + = 0 b_+=0 b + = 0 and K + = c γ L − ⊤ K_+=c\gamma L^{-\top} K + = c γ L − ⊤ . For an arbitrary perturbation U U U , write ξ : = Δ β \xi:=\Delta\beta ξ := Δ β . Using the product rule and (D.9), we obtain
s ˙ i [ U ] = ϕ i ⊤ ( Δ b − + Δ K − w ) + ( ψ ˉ i τ ) ⊤ [ L ⊤ Δ b + + ( L ⊤ Δ K + + c γ Δ L ⊤ L − ⊤ ) w ] + r i + 1 ( ξ + Δ q ⊤ w ) + γ c w ⊤ Σ i τ Δ A w . (69) \dot{s}_i[U]=\phi_i^\top(\Delta b_-+\Delta K_-w)+(\bar{\psi}_i^\tau)^\top\left[L^\top\Delta b_++(L^\top\Delta K_++c\gamma\Delta L^\top L^{-\top})w\right]+r_{i+1}(\xi+\Delta q^\top w)+\gamma c w^\top\Sigma_i^\tau\Delta A\,w. \tag*{(69)} s ˙ i [ U ] = ϕ i ⊤ ( Δ b − + Δ K − w ) + ( ψ ˉ i τ ) ⊤ [ L ⊤ Δ b + + ( L ⊤ Δ K + + c γ Δ L ⊤ L − ⊤ ) w ] + r i + 1 ( ξ + Δ q ⊤ w ) + γ c w ⊤ Σ i τ Δ A w . (69)
Since F θ , n ( z ) = 1 n ∑ i C ϕ i s i ( θ ; z ) F_{\theta,n}(z)=\frac{1}{n}\sum_i C\phi_i s_i(\theta;z) F θ , n ( z ) = n 1 ∑ i C ϕ i s i ( θ ; z ) and C = α c I d C=\frac{\alpha}{c}I_d C = c α I d , s i ( θ ˉ ; z ) = c δ i τ s_i(\bar{\theta};z)=c\delta_i^\tau s i ( θ ˉ ; z ) = c δ i τ , the sample Jacobian satisfies
J θ ˉ ( z ) [ U ] = 1 n ∑ i [ c Δ C ϕ i δ i τ + α c ϕ i s ˙ i [ U ] ] . (70) J_{\bar{\theta}}(z)[U]=\frac{1}{n}\sum_i\left[c\Delta C\,\phi_i\delta_i^\tau+\frac{\alpha}{c}\phi_i\dot{s}_i[U]\right]. \tag*{(70)} J θ ˉ ( z ) [ U ] = n 1 i ∑ [ c Δ C ϕ i δ i τ + c α ϕ i s ˙ i [ U ] ] . (70)
Then we collect the observable parameter combinations. Define the linear map Q L , c : Θ → V Q_{L,c}:\Theta\to\mathcal{V} Q L , c : Θ → V , Q L , c U = ( E C , e q , e − , E − , e + , E + , E A ) Q_{L,c}U=(E_C,e_q,e_-,E_-,e_+,E_+,E_A) Q L , c U = ( E C , e q , e − , E − , e + , E + , E A ) , by
E C = c 2 α Δ C + ξ I d , e q = Δ q , e − = Δ b − , E − = Δ K − + ξ I d , (71) E_C=\frac{c^2}{\alpha}\Delta C+\xi I_d,\qquad e_q=\Delta q,\qquad e_-=\Delta b_-,\qquad E_-=\Delta K_-+\xi I_d, \tag*{(71)} E C = α c 2 Δ C + ξ I d , e q = Δ q , e − = Δ b − , E − = Δ K − + ξ I d , (71)
e + = L ⊤ Δ b + , E A = γ c Δ A , E + = c γ Δ L ⊤ L − ⊤ + L ⊤ Δ K + − γ ξ I d . (72) e_+=L^\top\Delta b_+,\qquad E_A=\gamma c\Delta A,\qquad E_+=c\gamma\Delta L^\top L^{-\top}+L^\top\Delta K_+-\gamma\xi I_d. \tag*{(72)} e + = L ⊤ Δ b + , E A = γ c Δ A , E + = c γ Δ L ⊤ L − ⊤ + L ⊤ Δ K + − γ ξ I d . (72)
Subtracting ξ δ i τ \xi\delta_i^\tau ξ δ i τ from (D.10), where δ i τ = r i + 1 − w ⊤ ϕ i + γ w ⊤ ψ ˉ i τ \delta_i^\tau=r_{i+1}-w^\top\phi_i+\gamma w^\top\bar{\psi}_i^\tau δ i τ = r i + 1 − w ⊤ ϕ i + γ w ⊤ ψ ˉ i τ , gives
s ˙ i [ U ] − ξ δ i τ = ϕ i ⊤ ( e − + E − w ) + ( ψ ˉ i τ ) ⊤ ( e + + E + w ) + r i + 1 e q ⊤ w + w ⊤ Σ i τ E A w . \dot{s}_i[U]-\xi\delta_i^\tau=\phi_i^\top(e_-+E_-w)+(\bar{\psi}_i^\tau)^\top(e_++E_+w)+r_{i+1}e_q^\top w+w^\top\Sigma_i^\tau E_Aw. s ˙ i [ U ] − ξ δ i τ = ϕ i ⊤ ( e − + E − w ) + ( ψ ˉ i τ ) ⊤ ( e + + E + w ) + r i + 1 e q ⊤ w + w ⊤ Σ i τ E A w .
Likewise, c Δ C = α c ( E C − ξ I d ) c\Delta C=\frac{\alpha}{c}(E_C-\xi I_d) c Δ C = c α ( E C − ξ I d ) . Substitution into (D.11) shows that the terms proportional to ξ δ i τ \xi\delta_i^\tau ξ δ i τ cancel exactly. Thus
J θ ˉ ( z ) [ U ] = α c B τ , n ( z ) [ Q L , c U ] . (73) J_{\bar{\theta}}(z)[U]=\frac{\alpha}{c}B_{\tau,n}(z)[Q_{L,c}U]. \tag*{(73)} J θ ˉ ( z ) [ U ] = c α B τ , n ( z ) [ Q L , c U ] . (73)
Step 3: The kernels of Q L , c Q_{L,c} Q L , c and G n ( θ ˉ ) G_n(\bar{\theta}) G n ( θ ˉ ) are exactly the tangent space.
Suppose Q L , c U = 0 Q_{L,c}U=0 Q L , c U = 0 . Then E A = e q = e − = e + = 0 E_A=e_q=e_-=e_+=0 E A = e q = e − = e + = 0 . Since γ > 0 \gamma>0 γ > 0 , c ≠ 0 c\ne0 c = 0 , and L L L is invertible, this implies Δ A = 0 \Delta A=0 Δ A = 0 , Δ q = 0 \Delta q=0 Δ q = 0 , Δ b − = 0 \Delta b_-=0 Δ b − = 0 , Δ b + = 0 \Delta b_+=0 Δ b + = 0 . Moreover, E C = 0 E_C=0 E C = 0 implies Δ C = − α ξ c − 2 I d \Delta C=-\alpha\xi c^{-2}I_d Δ C = − α ξ c − 2 I d , while E − = 0 E_-=0 E − = 0 gives Δ K − = − ξ I d \Delta K_-=-\xi I_d Δ K − = − ξ I d . Finally, E + = 0 E_+=0 E + = 0 gives L ⊤ Δ K + = γ ξ I d − c γ Δ L ⊤ L − ⊤ L^\top\Delta K_+=\gamma\xi I_d-c\gamma\Delta L^\top L^{-\top} L ⊤ Δ K + = γ ξ I d − c γ Δ L ⊤ L − ⊤ . Then Δ K + = γ ξ L − ⊤ − c γ L − ⊤ Δ L ⊤ L − ⊤ \Delta K_+=\gamma\xi L^{-\top}-c\gamma L^{-\top}\Delta L^\top L^{-\top} Δ K + = γ ξ L − ⊤ − c γ L − ⊤ Δ L ⊤ L − ⊤ . Set Z : = Δ L Z:=\Delta L Z := Δ L . Together with the preceding identities, this is precisely the tangent form in (D.8). Hence ker Q L , c ⊂ T θ ˉ M τ \ker Q_{L,c}\subset T_{\bar{\theta}}\mathcal{M}_\tau ker Q L , c ⊂ T θ ˉ M τ .
Conversely, take any U ∈ T θ ˉ M τ U\in T_{\bar{\theta}}\mathcal{M}_\tau U ∈ T θ ˉ M τ . Then for some Z Z Z and ξ \xi ξ , direct substitution of (D.8) into (D.12)–(D.13) gives Q L , c U = 0 Q_{L,c}U=0 Q L , c U = 0 . Therefore T θ ˉ M τ ⊂ ker Q L , c T_{\bar{\theta}}\mathcal{M}_\tau\subset\ker Q_{L,c} T θ ˉ M τ ⊂ ker Q L , c , which means
ker Q L , c = T θ ˉ M τ . (74) \ker Q_{L,c}=T_{\bar{\theta}}\mathcal{M}_\tau. \tag*{(74)} ker Q L , c = T θ ˉ M τ . (74)
Since H = L 2 ( D n ; R d ) \mathcal{H}=L^2(\mathcal{D}_n;\mathbb{R}^d) H = L 2 ( D n ; R d ) is the population output space, and G ( θ ˉ ) = J θ ˉ ∗ J θ ˉ G(\bar{\theta})=J_{\bar{\theta}}^*J_{\bar{\theta}} G ( θ ˉ ) = J θ ˉ ∗ J θ ˉ , then, for every perturbation U U U , by (D.14), we have
⟨ U , G ( θ ˉ ) U ⟩ = ∥ J θ ˉ U ∥ H 2 = α 2 c 2 E [ ∥ B τ , n ( z ) [ Q L , c U ] ∥ 2 2 ] = α 2 c 2 ⟨ Q L , c U , H Q L , c U ⟩ V , (75) \langle U,G(\bar{\theta})U\rangle=\|J_{\bar{\theta}}U\|_{\mathcal{H}}^2=\frac{\alpha^2}{c^2}\mathbb{E}\left[\|B_{\tau,n}(z)[Q_{L,c}U]\|_2^2\right]=\frac{\alpha^2}{c^2}\langle Q_{L,c}U,H Q_{L,c}U\rangle_{\mathcal{V}}, \tag*{(75)} ⟨ U , G ( θ ˉ ) U ⟩ = ∥ J θ ˉ U ∥ H 2 = c 2 α 2 E [ ∥ B τ , n ( z ) [ Q L , c U ] ∥ 2 2 ] = c 2 α 2 ⟨ Q L , c U , H Q L , c U ⟩ V , (75)
where H = E [ B τ , n ( z ) ∗ B τ , n ( z ) ] H=\mathbb{E}[B_{\tau,n}(z)^*B_{\tau,n}(z)] H = E [ B τ , n ( z ) ∗ B τ , n ( z )] . By Assumption 1 (ii), H ≻ 0 H\succ0 H ≻ 0 . Therefore ⟨ Q L , c U , H Q L , c U ⟩ V = 0 \langle Q_{L,c}U,H Q_{L,c}U\rangle_{\mathcal{V}}=0 ⟨ Q L , c U , H Q L , c U ⟩ V = 0 if and only if Q L , c U = 0 Q_{L,c}U=0 Q L , c U = 0 . Since G ( θ ˉ ) = J θ ˉ ∗ J θ ˉ G(\bar{\theta})=J_{\bar{\theta}}^*J_{\bar{\theta}} G ( θ ˉ ) = J θ ˉ ∗ J θ ˉ is positive semi-definite,
⟨ U , G ( θ ˉ ) U ⟩ = 0 ⟺ G ( θ ˉ ) U = 0. \langle U,G(\bar{\theta})U\rangle=0\quad\Longleftrightarrow\quad G(\bar{\theta})U=0. ⟨ U , G ( θ ˉ ) U ⟩ = 0 ⟺ G ( θ ˉ ) U = 0.
Combining this with (D.16) and (D.15), we obtain
ker G ( θ ˉ ) = ker Q L , c = T θ ˉ M τ . (76) \ker G(\bar{\theta})=\ker Q_{L,c}=T_{\bar{\theta}}\mathcal{M}_\tau. \tag*{(76)} ker G ( θ ˉ ) = ker Q L , c = T θ ˉ M τ . (76)
Step 4: Prove ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) \nabla^2L_n(\bar{\theta})=G(\bar{\theta}) ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) . Recall that L n ( θ ) = 1 2 E ∥ e θ ( z ) ∥ 2 2 L_n(\theta)=\frac{1}{2}\mathbb{E}\|e_\theta(z)\|_2^2 L n ( θ ) = 2 1 E ∥ e θ ( z ) ∥ 2 2 , where e θ ( z ) : = F θ , n ( z ) − F τ , n ( z ) e_\theta(z):=F_{\theta,n}(z)-F_{\tau,n}(z) e θ ( z ) := F θ , n ( z ) − F τ , n ( z ) . Under Assumption 1 (i), the data are bounded. On a sufficiently small bounded parameter neighborhood, softmax smoothness gives common integrable bounds on the predictor and its first two derivatives. Hence differentiation under the expectation is valid. For arbitrary directions U , V \mathrm{U},\mathrm{V} U , V ,
D 2 L n ( θ ) [ U , V ] = E [ ⟨ J θ ( z ) [ U ] , J θ ( z ) [ V ] ⟩ ] + E [ ⟨ e θ ( z ) , D 2 F θ , n ( z ) [ U , V ] ⟩ ] . (77) D^2L_n(\theta)[\mathrm{U},\mathrm{V}]=\mathbb{E}\left[\langle J_\theta(z)[\mathrm{U}],J_\theta(z)[\mathrm{V}]\rangle\right]+\mathbb{E}\left[\langle e_\theta(z),D^2F_{\theta,n}(z)[\mathrm{U},\mathrm{V}]\rangle\right]. \tag*{(77)} D 2 L n ( θ ) [ U , V ] = E [ ⟨ J θ ( z ) [ U ] , J θ ( z ) [ V ]⟩ ] + E [ ⟨ e θ ( z ) , D 2 F θ , n ( z ) [ U , V ]⟩ ] . (77)
By part (i), at every correct parameter θ ˉ ∈ M τ \bar{\theta}\in\mathcal{M}_\tau θ ˉ ∈ M τ we have the samplewise identity e θ ˉ ( z ) = 0 e_{\bar{\theta}}(z)=0 e θ ˉ ( z ) = 0 . Therefore the second term in (D.18) vanishes identically, and
D 2 L n ( θ ˉ ) [ U , V ] = E [ ⟨ J θ ˉ ( z ) [ U ] , J θ ˉ ( z ) [ V ] ⟩ ] = ⟨ U , J θ ˉ ∗ J θ ˉ V ⟩ . D^2L_n(\bar{\theta})[\mathrm{U},\mathrm{V}]=\mathbb{E}\left[\langle J_{\bar{\theta}}(z)[\mathrm{U}],J_{\bar{\theta}}(z)[\mathrm{V}]\rangle\right]=\langle\mathrm{U},J_{\bar{\theta}}^*J_{\bar{\theta}}\mathrm{V}\rangle. D 2 L n ( θ ˉ ) [ U , V ] = E [ ⟨ J θ ˉ ( z ) [ U ] , J θ ˉ ( z ) [ V ]⟩ ] = ⟨ U , J θ ˉ ∗ J θ ˉ V ⟩ .
Hence, as operators,
∇ 2 L n ( θ ˉ ) = J θ ˉ ∗ J θ ˉ = G ( θ ˉ ) . (78) \nabla^2L_n(\bar{\theta})=J_{\bar{\theta}}^*J_{\bar{\theta}}=G(\bar{\theta}). \tag*{(78)} ∇ 2 L n ( θ ˉ ) = J θ ˉ ∗ J θ ˉ = G ( θ ˉ ) . (78)
Combining (D.19) with (D.17) yields
ker ∇ 2 L n ( θ ˉ ) = T θ ˉ M τ . \ker\nabla^2L_n(\bar{\theta})=T_{\bar{\theta}}\mathcal{M}_\tau. ker ∇ 2 L n ( θ ˉ ) = T θ ˉ M τ .
Equivalently, if U ∉ T θ ˉ M τ \mathrm{U}\notin T_{\bar{\theta}}\mathcal{M}_\tau U ∈ / T θ ˉ M τ , then ⟨ U , ∇ 2 L n ( θ ˉ ) U ⟩ > 0 \langle\mathrm{U},\nabla^2L_n(\bar{\theta})\mathrm{U}\rangle>0 ⟨ U , ∇ 2 L n ( θ ˉ ) U ⟩ > 0 . In particular, for every nonzero normal direction U ∈ N θ ˉ M τ ∖ { 0 } \mathrm{U}\in N_{\bar{\theta}}\mathcal{M}_\tau\setminus\{0\} U ∈ N θ ˉ M τ ∖ { 0 } , we have ⟨ U , ∇ 2 L n ( θ ˉ ) U ⟩ > 0 \langle\mathrm{U},\nabla^2L_n(\bar{\theta})\mathrm{U}\rangle>0 ⟨ U , ∇ 2 L n ( θ ˉ ) U ⟩ > 0 .
Uniform normal curvature of the optimal parameter manifold By Lemma D.1, we have ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) \nabla^2L_n(\bar{\theta})=G(\bar{\theta}) ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) . It follows that the curvature κ \kappa κ defined in (16) characterizes the weakest second-order growth of the loss when moving away from the optimal manifold.
Lemma D.2 shows that the loss has uniformly positive curvature in all normal, non-gauge directions around the optimal parameter manifold, and that this curvature is quantitatively comparable to the data-richness constant: κ ≍ χ : = λ min ( H n ( τ ) ) \kappa\asymp\chi:=\lambda_{\min}(H_n(\tau)) κ ≍ χ := λ m i n ( H n ( τ )) , where H : = E [ B τ , n ( z ) ∗ B τ , n ( z ) ] H:=\mathbb{E}[\mathcal{B}_{\tau,n}(z)^*\mathcal{B}_{\tau,n}(z)] H := E [ B τ , n ( z ) ∗ B τ , n ( z )] . Thus, stronger data identifiability leads to stronger local curvature and faster contraction toward the optimal manifold.
Recall that Ω ‾ ⋐ G L ( d ) × ( R ∖ { 0 } ) \overline{\Omega}\Subset GL(d)\times(\mathbb{R}\setminus\{0\}) Ω ⋐ G L ( d ) × ( R ∖ { 0 }) , U τ : = { θ ˉ τ ( L , c ) : ( L , c ) ∈ Ω } ⊂ M τ \mathcal{U}_\tau:=\{\bar{\theta}_\tau(L,c):(L,c)\in\Omega\}\subset\mathcal{M}_\tau U τ := { θ ˉ τ ( L , c ) : ( L , c ) ∈ Ω } ⊂ M τ .
Lemma D.2 (Uniform normal curvature). Under Assumptions 1, there exists constants 0 < c Ω ≤ C Ω < ∞ 0<c_\Omega\le C_\Omega<\infty 0 < c Ω ≤ C Ω < ∞ such that, uniformly over θ ˉ = θ ˉ τ ( L , c ) ∈ U τ \bar{\theta}=\bar{\theta}_\tau(L,c)\in\mathcal{U}_\tau θ ˉ = θ ˉ τ ( L , c ) ∈ U τ , c Ω χ ≤ λ min ( ∇ 2 L n ( θ ˉ ) ∣ N θ ˉ M τ ) ≤ C Ω χ c_\Omega\chi\le\lambda_{\min}(\nabla^2L_n(\bar{\theta})|_{N_{\bar{\theta}}\mathcal{M}_\tau})\le C_\Omega\chi c Ω χ ≤ λ m i n ( ∇ 2 L n ( θ ˉ ) ∣ N θ ˉ M τ ) ≤ C Ω χ . Equivalently, 0 < c Ω χ ≤ κ ≤ C Ω χ 0<c_\Omega\chi\le\kappa\le C_\Omega\chi 0 < c Ω χ ≤ κ ≤ C Ω χ .
Proof. Fix θ ˉ = θ ˉ τ ( L , c ) ∈ U τ \bar{\theta}=\bar{\theta}_\tau(L,c)\in\mathcal{U}_\tau θ ˉ = θ ˉ τ ( L , c ) ∈ U τ . From (D.14), J θ ˉ ( z ) [ U ] = α c B τ , n ( z ) [ Q L , c U ] J_{\bar{\theta}}(z)[\mathrm{U}]=\frac{\alpha}{c}\mathcal{B}_{\tau,n}(z)[Q_{L,c}\mathrm{U}] J θ ˉ ( z ) [ U ] = c α B τ , n ( z ) [ Q L , c U ] , where Q L , c : T θ ˉ Θ → V Q_{L,c}:T_{\bar{\theta}}\Theta\to\mathcal{V} Q L , c : T θ ˉ Θ → V is the linear map collecting the effective observable coefficients. Moreover, ker Q L , c = T θ ˉ M τ \ker Q_{L,c}=T_{\bar{\theta}}\mathcal{M}_\tau ker Q L , c = T θ ˉ M τ .
We first show that the restriction Q L , c ∣ N θ ˉ M τ : N θ ˉ M τ → V Q_{L,c}|_{N_{\bar{\theta}}\mathcal{M}_\tau}:N_{\bar{\theta}}\mathcal{M}_\tau\to\mathcal{V} Q L , c ∣ N θ ˉ M τ : N θ ˉ M τ → V is an isomorphism (a bijective linear map that preserves linear operations). Since N θ ˉ M τ ∩ ker Q L , c = { 0 } N_{\bar{\theta}}\mathcal{M}_\tau\cap\ker Q_{L,c}=\{0\} N θ ˉ M τ ∩ ker Q L , c = { 0 } , the restriction is injective. Furthermore, dim N θ ˉ M τ = ( 5 d 2 + 3 d + 1 ) − ( d 2 + 1 ) = 4 d 2 + 3 d \dim N_{\bar{\theta}}\mathcal{M}_\tau=(5d^2+3d+1)-(d^2+1)=4d^2+3d dim N θ ˉ M τ = ( 5 d 2 + 3 d + 1 ) − ( d 2 + 1 ) = 4 d 2 + 3 d . The dimension of observable coefficient space is dim V = 4 d 2 + 3 d \dim\mathcal{V}=4d^2+3d dim V = 4 d 2 + 3 d , thus the restriction is bijective. For completeness, one may construct an explicit right inverse R L , c : V → T θ ˉ Θ R_{L,c}:\mathcal{V}\to T_{\bar{\theta}}\Theta R L , c : V → T θ ˉ Θ . Specifically, for ζ = ( E C , e q , e − , E − , e + , E + , E A ) ∈ V \zeta=(E_C,e_q,e_-,E_-,e_+,E_+,E_A)\in\mathcal{V} ζ = ( E C , e q , e − , E − , e + , E + , E A ) ∈ V , set
Δ A = ( γ c ) − 1 E A , Δ L = 0 , Δ β = 0 , Δ C = α c − 2 E C , Δ b − = e − , Δ K − = E − , Δ q = e q , Δ b + = L − T e + , Δ K + = L − T E + . \begin{aligned}
\Delta A&=(\gamma c)^{-1}E_A, & \Delta L&=0, & \Delta\beta&=0,\\
\Delta C&=\alpha c^{-2}E_C, & \Delta b_-&=e_-, & \Delta K_-&=E_-,\\
\Delta q&=e_q, & \Delta b_+&=L^{-\mathsf{T}}e_+, & \Delta K_+&=L^{-\mathsf{T}}E_+.
\end{aligned} Δ A Δ C Δ q = ( γ c ) − 1 E A , = α c − 2 E C , = e q , Δ L Δ b − Δ b + = 0 , = e − , = L − T e + , Δ β Δ K − Δ K + = 0 , = E − , = L − T E + .
Then Q L , c R L , c = I V Q_{L,c}R_{L,c}=I_{\mathcal{V}} Q L , c R L , c = I V . Let P N P_N P N denote the orthogonal projection onto N θ ˉ M τ N_{\bar{\theta}}\mathcal{M}_\tau N θ ˉ M τ . Since Q L , c Q_{L,c} Q L , c vanishes on T θ ˉ M τ T_{\bar{\theta}}\mathcal{M}_\tau T θ ˉ M τ , Q L , c P N = Q L , c Q_{L,c}P_N=Q_{L,c} Q L , c P N = Q L , c . Therefore P N R L , c P_NR_{L,c} P N R L , c is the inverse of Q L , c ∣ N θ ˉ M τ Q_{L,c}|_{N_{\bar{\theta}}\mathcal{M}_\tau} Q L , c ∣ N θ ˉ M τ .
Since Ω ‾ \overline{\Omega} Ω is compact and L L L , L − 1 L^{-1} L − 1 , c c c , c − 1 c^{-1} c − 1 are uniformly bounded on Ω ‾ \overline{\Omega} Ω , the operator norms of Q L , c Q_{L,c} Q L , c and R L , c R_{L,c} R L , c are uniformly bounded. Hence there exist constants 0 < t − ≤ t + < ∞ 0<t_-\le t_+<\infty 0 < t − ≤ t + < ∞ such that, for every θ ˉ ∈ U τ \bar{\theta}\in\mathcal{U}_\tau θ ˉ ∈ U τ and every U ∈ N θ ˉ M τ \mathrm{U}\in N_{\bar{\theta}}\mathcal{M}_\tau U ∈ N θ ˉ M τ ,
t − ∥ U ∥ ≤ ∥ Q L , c U ∥ V ≤ t + ∥ U ∥ . (79) t_-\|\mathrm{U}\|\le\|Q_{L,c}\mathrm{U}\|_{\mathcal{V}}\le t_+\|\mathrm{U}\|. \tag*{(79)} t − ∥ U ∥ ≤ ∥ Q L , c U ∥ V ≤ t + ∥ U ∥. (79)
where one may take t − = ( sup ( L , c ) ∈ Ω ‾ ∥ R L , c ∥ o p ) − 1 t_-=(\sup_{(L,c)\in\overline{\Omega}}\|R_{L,c}\|_{\mathrm{op}})^{-1} t − = ( sup ( L , c ) ∈ Ω ∥ R L , c ∥ op ) − 1 , t + = sup ( L , c ) ∈ Ω ‾ ∥ Q L , c ∥ o p t_+=\sup_{(L,c)\in\overline{\Omega}}\|Q_{L,c}\|_{\mathrm{op}} t + = sup ( L , c ) ∈ Ω ∥ Q L , c ∥ op .
We now transfer Assumption 1 from coefficient space to parameter space. Since H ⪰ χ I V H\succeq\chi I_{\mathcal{V}} H ⪰ χ I V , we can obtain ⟨ Q L , c U , H Q L , c U ⟩ ≥ χ ∥ Q L , c U ∥ V 2 \langle Q_{L,c}\mathrm{U},H Q_{L,c}\mathrm{U}\rangle\ge\chi\|Q_{L,c}\mathrm{U}\|_{\mathcal{V}}^2 ⟨ Q L , c U , H Q L , c U ⟩ ≥ χ ∥ Q L , c U ∥ V 2 by (D.16). Thus, for every unit vector U ∈ N θ ˉ M τ U \in N_{\bar{\theta}}\mathcal{M}_{\tau} U ∈ N θ ˉ M τ , ∥ U ∥ = 1 \lVert U\rVert= 1 ∥ U ∥ = 1 , yields ⟨ U , G ( θ ˉ ) U ⟩ ≥ α 2 c + 2 χ t + 2 \langle U,G(\bar{\theta})U\rangle\ge\frac{\alpha^2}{c_+^2}\chi t_+^2 ⟨ U , G ( θ ˉ ) U ⟩ ≥ c + 2 α 2 χ t + 2 from (D.20). Let c + : = max ( L , c ) ∈ Ω ∣ c ∣ c_+ := \max_{(L,c)\in\Omega}|c| c + := max ( L , c ) ∈ Ω ∣ c ∣ , then 1 c 2 ≥ 1 c + 2 \frac{1}{c^2} \ge\frac{1}{c_+^2} c 2 1 ≥ c + 2 1 , and hence ⟨ U , G ( θ ˉ ) U ⟩ ≥ α 2 t + 2 c + 2 χ \langle U,G(\bar{\theta})U\rangle\ge\frac{\alpha^2t_+^2}{c_+^2}\chi ⟨ U , G ( θ ˉ ) U ⟩ ≥ c + 2 α 2 t + 2 χ . Therefore, by taking c Ω = α 2 t + 2 c + 2 c_{\Omega} = \frac{\alpha^2t_+^2}{c_+^2} c Ω = c + 2 α 2 t + 2 , we have
λ min ( G ( θ ˉ ) ∣ N θ ˉ M τ ) ≥ c Ω χ . (80) \lambda_{\min}\left(G(\bar{\theta})\big|_{N_{\bar{\theta}}\mathcal{M}_{\tau}}\right) \ge c_{\Omega}\chi. \tag*{(80)} λ m i n ( G ( θ ˉ ) N θ ˉ M τ ) ≥ c Ω χ . (80)
Let ζ ∗ ∈ V \zeta_* \in\mathcal{V} ζ ∗ ∈ V , ∥ ζ ∗ ∥ V = 1 \lVert\zeta_*\rVert_{\mathcal{V}} = 1 ∥ ζ ∗ ∥ V = 1 , be a unit eigenvector of H H H corresponding to its smallest eigenvalue H ζ ∗ = χ ζ ∗ H\zeta_* = \chi\zeta_* H ζ ∗ = χ ζ ∗ . Since Q L , c ∣ N θ ˉ M τ Q_{L,c}|_{N_{\bar{\theta}}\mathcal{M}_{\tau}} Q L , c ∣ N θ ˉ M τ is invertible, define U ∗ = ( Q L , c ∣ N θ ˉ M τ ) − 1 ζ ∗ U_* = (Q_{L,c}|_{N_{\bar{\theta}}\mathcal{M}_{\tau}})^{-1}\zeta_* U ∗ = ( Q L , c ∣ N θ ˉ M τ ) − 1 ζ ∗ . Then Q L , c U ∗ = ζ ∗ Q_{L,c}U_* = \zeta_* Q L , c U ∗ = ζ ∗ . By the upper estimate in (D.20), 1 = ∥ Q L , c U ∗ ∥ V ≤ t + ∥ U ∗ ∥ 1 = \lVert Q_{L,c}U_*\rVert_{\mathcal{V}} \le t_+\lVert U_*\rVert 1 = ∥ Q L , c U ∗ ∥ V ≤ t + ∥ U ∗ ∥ , so ∥ U ∗ ∥ ≥ 1 t + \lVert U_*\rVert\ge\frac{1}{t_+} ∥ U ∗ ∥ ≥ t + 1 . Using (D.16),
⟨ U ^ ∗ , G ( θ ˉ ) U ^ ∗ ⟩ = α 2 c 2 ⟨ ζ ∗ , H ζ ∗ ⟩ ∥ U ∗ ∥ 2 = α 2 c 2 χ ∥ U ∗ ∥ 2 ≤ α 2 t + 2 c 2 χ , U ^ ∗ = U ∗ ∥ U ∗ ∥ . \langle\widehat{U}_*,G(\bar{\theta})\widehat{U}_*\rangle= \frac{\alpha^2}{c^2}\frac{\langle\zeta_*,H\zeta_*\rangle}{\lVert U_*\rVert^2} = \frac{\alpha^2}{c^2}\frac{\chi}{\lVert U_*\rVert^2} \le\frac{\alpha^2t_+^2}{c^2}\chi,\qquad\widehat{U}_* = \frac{U_*}{\lVert U_*\rVert}. ⟨ U ∗ , G ( θ ˉ ) U ∗ ⟩ = c 2 α 2 ∥ U ∗ ∥ 2 ⟨ ζ ∗ , H ζ ∗ ⟩ = c 2 α 2 ∥ U ∗ ∥ 2 χ ≤ c 2 α 2 t + 2 χ , U ∗ = ∥ U ∗ ∥ U ∗ .
Let c − : = min ( L , c ) ∈ Ω ∣ c ∣ > 0 c_- := \min_{(L,c)\in\Omega}|c| > 0 c − := min ( L , c ) ∈ Ω ∣ c ∣ > 0 . Then 1 c 2 ≤ 1 c − 2 \frac{1}{c^2} \le\frac{1}{c_-^2} c 2 1 ≤ c − 2 1 , and therefore, by taking C Ω = α 2 t + 2 c − 2 C_{\Omega} = \frac{\alpha^2t_+^2}{c_-^2} C Ω = c − 2 α 2 t + 2 ,
λ min ( G ( θ ˉ ) ∣ N θ ˉ M τ ) ≤ C Ω χ . (81) \lambda_{\min}\left(G(\bar{\theta})\big|_{N_{\bar{\theta}}\mathcal{M}_{\tau}}\right) \le C_{\Omega}\chi. \tag*{(81)} λ m i n ( G ( θ ˉ ) N θ ˉ M τ ) ≤ C Ω χ . (81)
Finally, by Lemma D.1, ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) \nabla^2L_n(\bar{\theta}) = G(\bar{\theta}) ∇ 2 L n ( θ ˉ ) = G ( θ ˉ ) for every θ ˉ ∈ M τ \bar{\theta} \in\mathcal{M}_{\tau} θ ˉ ∈ M τ . Combining (D.21) and (D.22) gives
c Ω χ ≤ λ min ( ∇ 2 L n ( θ ˉ ) ∣ N θ ˉ M τ ) ≤ C Ω χ . c_{\Omega}\chi\le\lambda_{\min}\left(\nabla^2L_n(\bar{\theta})\big|_{N_{\bar{\theta}}\mathcal{M}_{\tau}}\right) \le C_{\Omega}\chi. c Ω χ ≤ λ m i n ( ∇ 2 L n ( θ ˉ ) N θ ˉ M τ ) ≤ C Ω χ .
Taking the infimum over θ ˉ ∈ U τ \bar{\theta} \in\mathcal{U}_{\tau} θ ˉ ∈ U τ and over unit normal directions yields c Ω χ ≤ κ ≤ C Ω χ c_{\Omega}\chi\le\kappa\le C_{\Omega}\chi c Ω χ ≤ κ ≤ C Ω χ . Since χ > 0 \chi> 0 χ > 0 by Assumption 1 and c Ω > 0 c_{\Omega} > 0 c Ω > 0 , we conclude that κ > 0 \kappa> 0 κ > 0 .
Local tubular geometry and unique projection. Lemma D.3 provides a precise local notion of distance to the optimal parameter manifold.
For any parameter θ \theta θ sufficiently close to M τ \mathcal{M}_{\tau} M τ , define,
d ( θ ) : = dist ( θ , M τ ) = inf ϑ ∈ M τ ∥ θ − ϑ ∥ . d(\theta) := \operatorname{dist}(\theta,\mathcal{M}_{\tau}) = \inf_{\vartheta\in\mathcal{M}_{\tau}}\lVert\theta-\vartheta\rVert. d ( θ ) := dist ( θ , M τ ) = ϑ ∈ M τ inf ∥ θ − ϑ ∥ .
Lemma D.3 guarantees that this distance is attained at a unique nearest point θ ˉ = Π ( θ ) \bar{\theta} = \Pi(\theta) θ ˉ = Π ( θ ) . Moreover, the displacement Δ = θ − Π ( θ ) \Delta= \theta-\Pi(\theta) Δ = θ − Π ( θ ) is normal to the manifold, i.e. d ( θ ) = ∥ θ − Π ( θ ) ∥ d(\theta) = \lVert\theta-\Pi(\theta)\rVert d ( θ ) = ∥ θ − Π ( θ )∥ .
Lemma D.3 (Local tubular geometry and unique projection). There exists a constant r g e o > 0 r_{\mathrm{geo}} > 0 r geo > 0 such that the following statements hold.
(i) For every θ ˉ ∈ U ‾ τ \bar{\theta} \in\overline{\mathcal{U}}_{\tau} θ ˉ ∈ U τ and Δ ∈ N θ ˉ M τ \Delta\in N_{\bar{\theta}}\mathcal{M}_{\tau} Δ ∈ N θ ˉ M τ with ∥ Δ ∥ < r g e o \lVert\Delta\rVert< r_{\mathrm{geo}} ∥ Δ ∥ < r geo , the point θ = θ ˉ + Δ \theta= \bar{\theta}+\Delta θ = θ ˉ + Δ has θ ˉ \bar{\theta} θ ˉ as its unique nearest point on the full manifold M τ \mathcal{M}_{\tau} M τ .
(ii) Define the normal tube T r g e o ( U τ ) = { θ ˉ + Δ : θ ˉ ∈ U τ , Δ ∈ N θ ˉ M τ , ∥ Δ ∥ < r g e o } T_{r_{\mathrm{geo}}}(\mathcal{U}_{\tau}) = \{\bar{\theta}+\Delta: \bar{\theta} \in\mathcal{U}_{\tau},\ \Delta\in N_{\bar{\theta}}\mathcal{M}_{\tau},\ \lVert\Delta\rVert< r_{\mathrm{geo}}\} T r geo ( U τ ) = { θ ˉ + Δ : θ ˉ ∈ U τ , Δ ∈ N θ ˉ M τ , ∥ Δ ∥ < r geo } . For every θ ∈ T r g e o ( U τ ) \theta\in T_{r_{\mathrm{geo}}}(\mathcal{U}_{\tau}) θ ∈ T r geo ( U τ ) , the nearest-point projection Π ( θ ) \Pi(\theta) Π ( θ ) onto M τ \mathcal{M}_{\tau} M τ is uniquely defined and satisfies θ − Π ( θ ) ∈ N Π ( θ ) M τ \theta-\Pi(\theta) \in N_{\Pi(\theta)}\mathcal{M}_{\tau} θ − Π ( θ ) ∈ N Π ( θ ) M τ and d ( θ ) = ∥ θ − Π ( θ ) ∥ d(\theta) = \lVert\theta-\Pi(\theta)\rVert d ( θ ) = ∥ θ − Π ( θ )∥ . Moreover, T r g e o ( U τ ) T_{r_{\mathrm{geo}}}(\mathcal{U}_{\tau}) T r geo ( U τ ) is an open neighborhood of U τ \mathcal{U}_{\tau} U τ in the ambient parameter space.
Proof. By Lemma D.1, M τ \mathcal{M}_{\tau} M τ is a smooth closed embedded submanifold of the finite-dimensional Euclidean parameter space, and U ‾ τ \overline{\mathcal{U}}_{\tau} U τ is compact. By the tubular neighborhood theorem [8 Theorem 6.24] , every point sufficiently close to M τ \mathcal{M}_{\tau} M τ can be uniquely represented as θ = θ ˉ + Δ \theta= \bar{\theta}+\Delta θ = θ ˉ + Δ , where θ ˉ ∈ M τ \bar{\theta} \in\mathcal{M}_{\tau} θ ˉ ∈ M τ and Δ ∈ N θ ˉ M τ \Delta\in N_{\bar{\theta}}\mathcal{M}_{\tau} Δ ∈ N θ ˉ M τ is a sufficiently small normal displacement.
For each θ ˉ ∈ U ‾ τ \bar{\theta} \in\overline{\mathcal{U}}_{\tau} θ ˉ ∈ U τ , there exist a neighborhood V θ ˉ ⊂ M τ V_{\bar{\theta}} \subset\mathcal{M}_{\tau} V θ ˉ ⊂ M τ and a radius r θ ˉ > 0 r_{\bar{\theta}} > 0 r θ ˉ > 0 such that the above normal representation remains unique for all normal perturbations of size smaller than r θ ˉ r_{\bar{\theta}} r θ ˉ from points in V θ ˉ V_{\bar{\theta}} V θ ˉ . Since U ‾ τ \overline{\mathcal{U}}_{\tau} U τ is compact, finitely many such neighborhoods, say V 1 , … , V L V_1,\ldots,V_L V 1 , … , V L , cover U ‾ τ \overline{\mathcal{U}}_{\tau} U τ . Define V = ⋃ j = 1 L V j \mathcal{V} = \bigcup_{j=1}^{L}V_j V = ⋃ j = 1 L V j and r 0 = min 1 ≤ j ≤ L r j r_0 = \min_{1\le j\le L}r_j r 0 = min 1 ≤ j ≤ L r j . Since the minimum is taken over finitely many positive radii, r 0 > 0 r_0 > 0 r 0 > 0 . Thus every normal perturbation of norm smaller than r 0 r_0 r 0 from a point in V \mathcal{V} V lies in the region where the normal representation is unique.
(i) We choose the radius small enough so that the nearest point cannot leave V \mathcal{V} V . Since U τ ⊂ V \mathcal{U}_{\tau} \subset\mathcal{V} U τ ⊂ V , U τ \mathcal{U}_{\tau} U τ is compact, and M τ ∖ V \mathcal{M}_{\tau}\setminus\mathcal{V} M τ ∖ V is closed, we have δ : = dist ( U ‾ τ , M τ ∖ V ) > 0 \delta:= \operatorname{dist}(\overline{\mathcal{U}}_{\tau},\mathcal{M}_{\tau}\setminus\mathcal{V}) > 0 δ := dist ( U τ , M τ ∖ V ) > 0 . Choose r g e o > 0 r_{\mathrm{geo}} > 0 r geo > 0 such that r g e o < min { r 0 , δ / 2 } r_{\mathrm{geo}} < \min\{r_0,\delta/2\} r geo < min { r 0 , δ /2 } . Now take θ ˉ ∈ U ‾ τ \bar{\theta} \in\overline{\mathcal{U}}_{\tau} θ ˉ ∈ U τ and Δ ∈ N θ ˉ M τ \Delta\in N_{\bar{\theta}}\mathcal{M}_{\tau} Δ ∈ N θ ˉ M τ with ∥ Δ ∥ < r g e o \lVert\Delta\rVert< r_{\mathrm{geo}} ∥ Δ ∥ < r geo , and set θ = θ ˉ + Δ \theta= \bar{\theta}+\Delta θ = θ ˉ + Δ . Since M τ \mathcal{M}_{\tau} M τ is closed, there exists at least one nearest point θ ∗ ∈ M τ \theta^* \in\mathcal{M}_{\tau} θ ∗ ∈ M τ to θ \theta θ . Because θ ˉ ∈ M τ \bar{\theta} \in\mathcal{M}_{\tau} θ ˉ ∈ M τ ,
∥ θ − θ ∗ ∥ ≤ ∥ θ − θ ˉ ∥ = ∥ Δ ∥ < r g e o . \lVert\theta-\theta^*\rVert\le\lVert\theta-\bar{\theta}\rVert= \lVert\Delta\rVert< r_{\mathrm{geo}}. ∥ θ − θ ∗ ∥ ≤ ∥ θ − θ ˉ ∥ = ∥ Δ ∥ < r geo .
The triangle inequality then gives ∥ θ ⋆ − θ ˉ ∥ < 2 r g e o < δ \lVert\theta^\star-\bar{\theta}\rVert< 2r_{\mathrm{geo}} < \delta ∥ θ ⋆ − θ ˉ ∥ < 2 r geo < δ . Hence θ ⋆ ∈ V \theta^\star\in\mathcal{V} θ ⋆ ∈ V .
Since θ ⋆ \theta^\star θ ⋆ minimizes the Euclidean distance from θ \theta θ to M τ \mathcal{M}_\tau M τ , the first-order optimality condition implies θ − θ ⋆ ∈ N θ ⋆ M τ \theta-\theta^\star\in N_{\theta^\star}\mathcal{M}_\tau θ − θ ⋆ ∈ N θ ⋆ M τ . Therefore θ \theta θ has two normal representations: θ = θ ˉ + Δ \theta=\bar{\theta}+\Delta θ = θ ˉ + Δ and θ = θ ⋆ + ( θ − θ ⋆ ) \theta=\theta^\star+(\theta-\theta^\star) θ = θ ⋆ + ( θ − θ ⋆ ) . Both base points lie in V \mathcal{V} V , and both normal displacements have norm smaller than r 0 r_0 r 0 . By uniqueness of the tubular representation, we must have θ ⋆ = θ ˉ \theta^\star=\bar{\theta} θ ⋆ = θ ˉ . Thus θ ˉ \bar{\theta} θ ˉ is the unique nearest point to θ \theta θ on the full manifold M τ \mathcal{M}_\tau M τ . Consequently,
Π ( θ ) = θ ˉ , θ − Π ( θ ) ∈ N Π ( θ ) M τ , d ( θ ) = ∥ θ − Π ( θ ) ∥ . \Pi(\theta)=\bar{\theta},\qquad\theta-\Pi(\theta)\in N_{\Pi(\theta)}\mathcal{M}_\tau,\qquad d(\theta)=\lVert\theta-\Pi(\theta)\rVert. Π ( θ ) = θ ˉ , θ − Π ( θ ) ∈ N Π ( θ ) M τ , d ( θ ) = ∥ θ − Π ( θ )∥ .
(ii) Since U τ U_\tau U τ is relatively open in M τ \mathcal{M}_\tau M τ , the normal perturbations of norm smaller than r g e o r_{\mathrm{geo}} r geo based at points of U τ U_\tau U τ form an open set in the tubular coordinates. The tubular-neighborhood map sends this set to an open subset of the ambient parameter space containing U τ U_\tau U τ . Hence the corresponding normal tube is an open neighborhood of U τ U_\tau U τ .
A Direct Parameter-Distance Estimate for One GD Step
The identity d ( θ ) = ∥ Δ ∥ d(\theta)=\lVert\Delta\rVert d ( θ ) = ∥ Δ ∥ is essential for the convergence analysis, where Δ = θ − Π ( θ ) \Delta=\theta-\Pi(\theta) Δ = θ − Π ( θ ) is the normal displacement from the current parameter to its nearest point on the optimal manifold. The operator J Π ( θ ) , n [ Δ ] J_{\Pi(\theta),n}[\Delta] J Π ( θ ) , n [ Δ ] describes the first-order change of the model output when the parameter moves from the nearest optimal point Π ( θ ) \Pi(\theta) Π ( θ ) in the direction Δ \Delta Δ . Since Δ \Delta Δ is normal to the manifold, the normal-curvature bound in Lemma D.2 can be applied directly, giving
∥ J Π ( θ ) , n [ Δ ] ∥ L 2 ( D n ) 2 ≥ κ ∥ Δ ∥ 2 = κ d ( θ ) 2 . \lVert J_{\Pi(\theta),n}[\Delta]\rVert_{L^2(D_n)}^2\ge\kappa\lVert\Delta\rVert^2=\kappa d(\theta)^2. ∥ J Π ( θ ) , n [ Δ ] ∥ L 2 ( D n ) 2 ≥ κ ∥ Δ ∥ 2 = κ d ( θ ) 2 .
Lemma D.4 shows that one gradient-descent step moves the current parameter closer to the optimal manifold. We first prove that the gradient has a sufficiently large component in the direction that reduces the normal displacement from the manifold. We then control the overall gradient norm to ensure that the update does not overshoot. Combining these two estimates yields a one-step contraction of the distance to M τ \mathcal{M}_\tau M τ .
Lemma D.4 (One-step contraction toward the optimal manifold). Under Assumption 1.
(i) There exist constants M J > 0 M_J>0 M J > 0 , L J > 0 L_J>0 L J > 0 , and 0 < ρ 0 < r g e o 0<\rho_0<r_{\mathrm{geo}} 0 < ρ 0 < r geo such that, for all θ , θ ′ ∈ T ρ 0 ( U τ ) \theta,\theta'\in T_{\rho_0}(U_\tau) θ , θ ′ ∈ T ρ 0 ( U τ ) , ∥ J θ , n ∥ o p ≤ M J \lVert J_{\theta,n}\rVert_{\mathrm{op}}\le M_J ∥ J θ , n ∥ op ≤ M J , and ∥ J θ , n − J θ ′ , n ∥ o p ≤ L J ∥ θ − θ ′ ∥ \lVert J_{\theta,n}-J_{\theta',n}\rVert_{\mathrm{op}}\le L_J\lVert\theta-\theta'\rVert ∥ J θ , n − J θ ′ , n ∥ op ≤ L J ∥ θ − θ ′ ∥ .
(ii) Let r : = min { ρ 0 , κ 4 L J } r:=\min\left\{\rho_0,\frac{\sqrt{\kappa}}{4L_J}\right\} r := min { ρ 0 , 4 L J κ } , T : = T r ( U τ ) \mathcal{T}:=T_r(U_\tau) T := T r ( U τ ) . For any θ ∈ T \theta\in\mathcal{T} θ ∈ T and every step size 0 < η ≤ 1 / ( 2 M J 2 ) 0<\eta\le1/(2M_J^2) 0 < η ≤ 1/ ( 2 M J 2 ) ,
d ( θ − η ∇ L n ( θ ) ) 2 ≤ ( 1 − η κ 4 ) d ( θ ) 2 , d\left(\theta-\eta\nabla L_n(\theta)\right)^2\le\left(1-\frac{\eta\kappa}{4}\right)d(\theta)^2, d ( θ − η ∇ L n ( θ ) ) 2 ≤ ( 1 − 4 η κ ) d ( θ ) 2 , and η ∥ ∇ L n ( θ ) ∥ ≤ 4 M J κ [ d ( θ ) − d ( θ − η ∇ L n ( θ ) ) ] \eta\lVert\nabla L_n(\theta)\rVert\le\frac{4M_J}{\sqrt{\kappa}}\left[d(\theta)-d\left(\theta-\eta\nabla L_n(\theta)\right)\right] η ∥ ∇ L n ( θ )∥ ≤ κ 4 M J [ d ( θ ) − d ( θ − η ∇ L n ( θ ) ) ] , where 1 − η κ / 4 ∈ [ 7 / 8 , 1 ) 1-\eta\kappa/4\in[7/8,1) 1 − η κ /4 ∈ [ 7/8 , 1 ) .
Proof. (i) Write the parameter as θ = ( A , x ) \theta=(A,x) θ = ( A , x ) , where x x x collects all parameter blocks other than A A A . Since U ‾ τ \overline{U}_\tau U τ is compact, there exists M 0 < ∞ M_0<\infty M 0 < ∞ such that ∥ x ∥ ≤ M 0 \lVert x\rVert\le M_0 ∥ x ∥ ≤ M 0 on U ‾ τ \overline{U}_\tau U τ . Choose 0 < ρ 0 < min { r g e o , 1 } 0<\rho_0<\min\{r_{\mathrm{geo}},1\} 0 < ρ 0 < min { r geo , 1 } sufficiently small so that T ρ 0 ( U τ ) T_{\rho_0}(U_\tau) T ρ 0 ( U τ ) and the line segment joining each point in this tube to its projection onto M τ \mathcal{M}_\tau M τ are contained in
C = { ( A , x ) : A ∈ R d × d , ∥ x ∥ < M 0 + 1 } . \mathcal{C}=\{(A,x):A\in\mathbb{R}^{d\times d},\ \lVert x\rVert<M_0+1\}. C = {( A , x ) : A ∈ R d × d , ∥ x ∥ < M 0 + 1 } .
Although A A A is unrestricted in C \mathcal{C} C , it enters the model through the softmax logits. The derivatives of the softmax are uniformly bounded, the features and weights are bounded by Assumption 1, and all remaining parameter blocks are bounded on C \mathcal{C} C . Hence there exist constants M J > 0 M_J>0 M J > 0 and L J > 0 L_J>0 L J > 0 such that, for all θ , θ ′ ∈ T ρ 0 ( U τ ) \theta,\theta'\in T_{\rho_0}(U_\tau) θ , θ ′ ∈ T ρ 0 ( U τ ) ,
∥ J θ , n ∥ o p ≤ M J , ∥ J θ , n − J θ ′ , n ∥ o p ≤ L J ∥ θ − θ ′ ∥ . (82) \lVert J_{\theta,n}\rVert_{\mathrm{op}}\le M_J,\qquad\lVert J_{\theta,n}-J_{\theta',n}\rVert_{\mathrm{op}}\le L_J\lVert\theta-\theta'\rVert. \tag*{(82)} ∥ J θ , n ∥ op ≤ M J , ∥ J θ , n − J θ ′ , n ∥ op ≤ L J ∥ θ − θ ′ ∥ . (82)
Since κ \kappa κ is the minimum curvature over unit normal directions on the selected optimal patch, the first bound in (D.23) also gives κ ≤ M J 2 \kappa\le M_J^2 κ ≤ M J 2 . For a fixed gauge domain Ω \Omega Ω and temperature-independent data bounds, the constants M J M_J M J and L J L_J L J can be chosen independently of τ \tau τ . Indeed, the non-A A A coordinates of the realization patch do not depend on τ \tau τ , while A A A enters the model only through the softmax logits, whose derivatives with respect to those logits are uniformly bounded.
(ii) Fix θ ∈ T r ( U τ ) \theta\in T_r(U_\tau) θ ∈ T r ( U τ ) and let θ ˉ = Π ( θ ) \bar{\theta}=\Pi(\theta) θ ˉ = Π ( θ ) and Δ = θ − θ ˉ \Delta=\theta-\bar{\theta} Δ = θ − θ ˉ . By Lemma D.3 , Δ ∈ N θ ˉ M τ \Delta\in N_{\bar{\theta}}\mathcal{M}_\tau Δ ∈ N θ ˉ M τ and ∥ Δ ∥ = d ( θ ) \lVert\Delta\rVert=d(\theta) ∥ Δ ∥ = d ( θ ) . If d ( θ ) = 0 d(\theta)=0 d ( θ ) = 0 , then θ ∈ M τ \theta\in\mathcal{M}_\tau θ ∈ M τ and ∇ L n ( θ ) = 0 \nabla L_n(\theta)=0 ∇ L n ( θ ) = 0 , so the conclusions are immediate. Hence assume d ( θ ) > 0 d(\theta)>0 d ( θ ) > 0 . Define θ + = θ − η ∇ L n ( θ ) \theta^{+}=\theta-\eta\nabla L_n(\theta) θ + = θ − η ∇ L n ( θ ) and d + : = d ( θ + ) d_{+}:=d(\theta^{+}) d + := d ( θ + ) . Since θ ˉ ∈ M τ \bar{\theta}\in\mathcal{M}_{\tau} θ ˉ ∈ M τ is a valid comparison point in the definition of d + d_{+} d + ,
d + 2 ≤ ∥ θ − η ∇ L n ( θ ) − θ ˉ ∥ 2 = d ( θ ) 2 − 2 η ⟨ ∇ L n ( θ ) , Δ ⟩ + η 2 ∥ ∇ L n ( θ ) ∥ 2 . (83) d_{+}^{2}\leq\left\|\theta-\eta\nabla L_n(\theta)-\bar{\theta}\right\|^{2}=d(\theta)^{2}-2\eta\langle\nabla L_n(\theta),\Delta\rangle+\eta^{2}\left\|\nabla L_n(\theta)\right\|^{2}. \tag*{(83)} d + 2 ≤ θ − η ∇ L n ( θ ) − θ ˉ 2 = d ( θ ) 2 − 2 η ⟨ ∇ L n ( θ ) , Δ ⟩ + η 2 ∥ ∇ L n ( θ ) ∥ 2 . (83)
Thus, it is enough to show that the directional component ⟨ ∇ L n ( θ ) , Δ ⟩ \langle\nabla L_n(\theta),\Delta\rangle ⟨ ∇ L n ( θ ) , Δ ⟩ is uniformly positive and that the total gradient norm is controlled by this same quantity. We establish these two bounds below.
For ⟨ ∇ L n ( θ ) , Δ ⟩ \langle\nabla L_n(\theta),\Delta\rangle ⟨ ∇ L n ( θ ) , Δ ⟩ . Since θ ˉ ∈ M τ \bar{\theta}\in\mathcal{M}_{\tau} θ ˉ ∈ M τ , F θ ˉ , n = F τ , n F_{\bar{\theta},n}=F_{\tau,n} F θ ˉ , n = F τ , n , and the fundamental theorem of calculus gives
F θ , n − F τ , n = ∫ 0 1 J θ ˉ + t Δ , n [ Δ ] d t . (84) F_{\theta,n}-F_{\tau,n}=\int_{0}^{1}\mathcal{J}_{\bar{\theta}+t\Delta,n}[\Delta]\,dt. \tag*{(84)} F θ , n − F τ , n = ∫ 0 1 J θ ˉ + t Δ , n [ Δ ] d t . (84)
Moreover, for every parameter direction U \mathbf{U} U ,
⟨ ∇ L n ( θ ) , U ⟩ = ⟨ F θ , n − F τ , n , J θ , n [ U ] ⟩ L 2 ( D n ) . (85) \langle\nabla L_n(\theta),\mathbf{U}\rangle=\left\langle F_{\theta,n}-F_{\tau,n},\mathcal{J}_{\theta,n}[\mathbf{U}]\right\rangle_{L^{2}(D_n)}. \tag*{(85)} ⟨ ∇ L n ( θ ) , U ⟩ = ⟨ F θ , n − F τ , n , J θ , n [ U ] ⟩ L 2 ( D n ) . (85)
Because Δ \Delta Δ is normal to M τ \mathcal{M}_{\tau} M τ , Lemma D.2 gives ∥ J θ ˉ , n [ Δ ] ∥ L 2 ( D n ) ≥ κ d ( θ ) \left\|\mathcal{J}_{\bar{\theta},n}[\Delta]\right\|_{L^{2}(D_n)}\geq\sqrt{\kappa}\,d(\theta) J θ ˉ , n [ Δ ] L 2 ( D n ) ≥ κ d ( θ ) . Using the Jacobian Lipschitz bound in (D.23),
∥ J θ , n [ Δ ] ∥ L 2 ( D n ) ≥ ∥ J θ ˉ , n [ Δ ] ∥ L 2 ( D n ) − L J ∥ θ − θ ˉ ∥ ∥ Δ ∥ ≥ κ d ( θ ) − L J d ( θ ) 2 . \left\|\mathcal{J}_{\theta,n}[\Delta]\right\|_{L^{2}(D_n)}\geq\left\|\mathcal{J}_{\bar{\theta},n}[\Delta]\right\|_{L^{2}(D_n)}-L_J\left\|\theta-\bar{\theta}\right\|\left\|\Delta\right\|\geq\sqrt{\kappa}\,d(\theta)-L_Jd(\theta)^2. ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) ≥ J θ ˉ , n [ Δ ] L 2 ( D n ) − L J θ − θ ˉ ∥ Δ ∥ ≥ κ d ( θ ) − L J d ( θ ) 2 .
Since d ( θ ) < r d(\theta)<r d ( θ ) < r and r ≤ κ / ( 4 L J ) r\leq\sqrt{\kappa}/(4L_J) r ≤ κ / ( 4 L J ) ,
∥ J θ , n [ Δ ] ∥ L 2 ( D n ) ≥ 3 4 κ d ( θ ) . (86) \left\|\mathcal{J}_{\theta,n}[\Delta]\right\|_{L^{2}(D_n)}\geq\frac{3}{4}\sqrt{\kappa}\,d(\theta). \tag*{(86)} ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) ≥ 4 3 κ d ( θ ) . (86)
Using (D.25), write
F θ , n − F τ , n = J θ , n [ Δ ] + R , (87) F_{\theta,n}-F_{\tau,n}=\mathcal{J}_{\theta,n}[\Delta]+R, \tag*{(87)} F θ , n − F τ , n = J θ , n [ Δ ] + R , (87)
where R : = ∫ 0 1 ( J θ ˉ + t Δ , n − J θ , n ) [ Δ ] d t R:=\int_{0}^{1}\left(\mathcal{J}_{\bar{\theta}+t\Delta,n}-\mathcal{J}_{\theta,n}\right)[\Delta]\,dt R := ∫ 0 1 ( J θ ˉ + t Δ , n − J θ , n ) [ Δ ] d t . By the Jacobian Lipschitz bound,
∥ R ∥ L 2 ( D n ) ≤ ∫ 0 1 L J ( 1 − t ) ∥ Δ ∥ 2 d t = L J 2 d ( θ ) 2 ≤ 1 8 κ d ( θ ) . (88) \left\|R\right\|_{L^{2}(D_n)}\leq\int_{0}^{1}L_J(1-t)\left\|\Delta\right\|^{2}\,dt=\frac{L_J}{2}d(\theta)^2\leq\frac{1}{8}\sqrt{\kappa}\,d(\theta). \tag*{(88)} ∥ R ∥ L 2 ( D n ) ≤ ∫ 0 1 L J ( 1 − t ) ∥ Δ ∥ 2 d t = 2 L J d ( θ ) 2 ≤ 8 1 κ d ( θ ) . (88)
Combining this with (D.27) gives ∥ R ∥ L 2 ( D n ) ≤ 1 6 ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) \left\|R\right\|_{L^{2}(D_n)}\leq\frac{1}{6}\left\|\mathcal{J}_{\theta,n}[\Delta]\right\|_{L^{2}(D_n)} ∥ R ∥ L 2 ( D n ) ≤ 6 1 ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) . Taking U = Δ \mathbf{U}=\Delta U = Δ in (D.26) and using (D.28), we have
⟨ ∇ L n ( θ ) , Δ ⟩ = ⟨ J θ , n [ Δ ] + R , J θ , n [ Δ ] ⟩ L 2 ( D n ) ≥ 5 6 ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) 2 . (89) \langle\nabla L_n(\theta),\Delta\rangle=\left\langle\mathcal{J}_{\theta,n}[\Delta]+R,\mathcal{J}_{\theta,n}[\Delta]\right\rangle_{L^{2}(D_n)}\geq\frac{5}{6}\left\|\mathcal{J}_{\theta,n}[\Delta]\right\|_{L^{2}(D_n)}^{2}. \tag*{(89)} ⟨ ∇ L n ( θ ) , Δ ⟩ = ⟨ J θ , n [ Δ ] + R , J θ , n [ Δ ] ⟩ L 2 ( D n ) ≥ 6 5 ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) 2 . (89)
Together with (D.27), this yields
⟨ ∇ L n ( θ ) , Δ ⟩ ≥ 15 32 κ d ( θ ) 2 . (90) \langle\nabla L_n(\theta),\Delta\rangle\geq\frac{15}{32}\kappa d(\theta)^2. \tag*{(90)} ⟨ ∇ L n ( θ ) , Δ ⟩ ≥ 32 15 κ d ( θ ) 2 . (90)
For ∥ ∇ L n ( θ ) ∥ \left\|\nabla L_n(\theta)\right\| ∥ ∇ L n ( θ ) ∥ . By (D.28), ∥ F θ , n − F τ , n ∥ L 2 ( D n ) ≤ 7 6 ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) \left\|F_{\theta,n}-F_{\tau,n}\right\|_{L^{2}(D_n)}\leq\frac{7}{6}\left\|\mathcal{J}_{\theta,n}[\Delta]\right\|_{L^{2}(D_n)} ∥ F θ , n − F τ , n ∥ L 2 ( D n ) ≤ 6 7 ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) . Using (D.26), (D.23), and (D.30), we obtain
∥ ∇ L n ( θ ) ∥ 2 ≤ 49 30 M J 2 ⟨ ∇ L n ( θ ) , Δ ⟩ . (91) \left\|\nabla L_n(\theta)\right\|^{2}\leq\frac{49}{30}M_J^{2}\langle\nabla L_n(\theta),\Delta\rangle. \tag*{(91)} ∥ ∇ L n ( θ ) ∥ 2 ≤ 30 49 M J 2 ⟨ ∇ L n ( θ ) , Δ ⟩ . (91)
We now return to the distance expansion (D.24). Using (D.32),
d + 2 ≤ d ( θ ) 2 − η ( 2 − 49 30 η M J 2 ) ⟨ ∇ L n ( θ ) , Δ ⟩ . (92) d_{+}^{2}\leq d(\theta)^{2}-\eta\left(2-\frac{49}{30}\eta M_J^{2}\right)\langle\nabla L_n(\theta),\Delta\rangle. \tag*{(92)} d + 2 ≤ d ( θ ) 2 − η ( 2 − 30 49 η M J 2 ) ⟨ ∇ L n ( θ ) , Δ ⟩ . (92)
If η ≤ 1 / ( 2 M J 2 ) \eta\leq1/(2M_J^{2}) η ≤ 1/ ( 2 M J 2 ) , then 2 − ( 49 / 30 ) η M J 2 ≥ 71 / 60 > 1 2-(49/30)\eta M_J^{2}\geq71/60>1 2 − ( 49/30 ) η M J 2 ≥ 71/60 > 1 . Therefore, by (D.31),
d + 2 ≤ d ( θ ) 2 − η ⟨ ∇ L n ( θ ) , Δ ⟩ ≤ ( 1 − 15 32 η κ ) d ( θ ) 2 ≤ ( 1 − η κ 4 ) d ( θ ) 2 . (93) d_{+}^{2}\leq d(\theta)^{2}-\eta\langle\nabla L_n(\theta),\Delta\rangle\leq\left(1-\frac{15}{32}\eta\kappa\right)d(\theta)^{2}\leq\left(1-\frac{\eta\kappa}{4}\right)d(\theta)^{2}. \tag*{(93)} d + 2 ≤ d ( θ ) 2 − η ⟨ ∇ L n ( θ ) , Δ ⟩ ≤ ( 1 − 32 15 η κ ) d ( θ ) 2 ≤ ( 1 − 4 η κ ) d ( θ ) 2 . (93)
Since κ ≤ M J 2 \kappa\leq M_J^{2} κ ≤ M J 2 and η ≤ 1 / ( 2 M J 2 ) \eta\leq1/(2M_J^{2}) η ≤ 1/ ( 2 M J 2 ) , the contraction factor satisfies 1 − η κ / 4 ∈ [ 7 / 8 , 1 ) 1-\eta\kappa/4\in[7/8,1) 1 − η κ /4 ∈ [ 7/8 , 1 ) .
It remains to control the step length. From (D.33) and the same step-size condition,
η ⟨ ∇ L n ( θ ) , Δ ⟩ ≤ d ( θ ) 2 − d + 2 ≤ 2 d ( θ ) ( d ( θ ) − d + ) , (94) \eta\langle\nabla L_n(\theta),\Delta\rangle\leq d(\theta)^{2}-d_{+}^{2}\leq2d(\theta)\left(d(\theta)-d_{+}\right), \tag*{(94)} η ⟨ ∇ L n ( θ ) , Δ ⟩ ≤ d ( θ ) 2 − d + 2 ≤ 2 d ( θ ) ( d ( θ ) − d + ) , (94)
where d + ≤ d ( θ ) d_+ \le d(\theta) d + ≤ d ( θ ) follows from (D.34). Furthermore, by (D.30), (D.27), and the bound ∥ F θ , n − F τ , n ∥ L 2 ( D n ) ≤ ( 7 / 6 ) ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) \|F_{\theta,n}-F_{\tau,n}\|_{L^2(D_n)} \le(7/6)\|\mathcal{J}_{\theta,n}[\Delta]\|_{L^2(D_n)} ∥ F θ , n − F τ , n ∥ L 2 ( D n ) ≤ ( 7/6 ) ∥ J θ , n [ Δ ] ∥ L 2 ( D n ) ,
∥ ∇ L n ( θ ) ∥ ⟨ ∇ L n ( θ ) , Δ ⟩ ≤ 28 M J 15 κ d ( θ ) . (95) \frac{\|\nabla L_n(\theta)\|}{\langle\nabla L_n(\theta),\Delta\rangle} \le\frac{28M_J}{15\sqrt{\kappa}d(\theta)}. \tag*{(95)} ⟨ ∇ L n ( θ ) , Δ ⟩ ∥∇ L n ( θ ) ∥ ≤ 15 κ d ( θ ) 28 M J . (95)
Combining (D.35) and (D.36) yields
η ∥ ∇ L n ( θ ) ∥ ≤ 56 M J 15 κ ( d ( θ ) − d + ) ≤ 4 M J κ [ d ( θ ) − d ( θ − η ∇ L n ( θ ) ) ] . \eta\|\nabla L_n(\theta)\| \le\frac{56M_J}{15\sqrt{\kappa}}\left(d(\theta)-d_+\right) \le\frac{4M_J}{\sqrt{\kappa}}\left[d(\theta)-d\left(\theta-\eta\nabla L_n(\theta)\right)\right]. η ∥∇ L n ( θ ) ∥ ≤ 15 κ 56 M J ( d ( θ ) − d + ) ≤ κ 4 M J [ d ( θ ) − d ( θ − η ∇ L n ( θ ) ) ] .
This proves both the one-step contraction and the step-length estimate. □
The proof of Theorem 2
Let q η : = 1 − η κ / 4 q_\eta:= 1-\eta\kappa/4 q η := 1 − η κ /4 . By Lemma D.4, if 0 < η ≤ 1 / ( 2 M J 2 ) 0<\eta\le1/(2M_J^2) 0 < η ≤ 1/ ( 2 M J 2 ) , then q η ∈ ( 0 , 1 ) q_\eta\in(0,1) q η ∈ ( 0 , 1 ) .
Convergence of the full parameter sequence and its limit. Let d k : = d ( θ k ) d_k:=d(\theta_k) d k := d ( θ k ) . Assume d 0 > 0 d_0>0 d 0 > 0 . Define Λ 0 : = 4 M J κ d 0 \Lambda_0:=\frac{4M_J}{\sqrt{\kappa}}d_0 Λ 0 := κ 4 M J d 0 . By the initialization condition, Λ 0 < b T ( θ 0 ) \Lambda_0<b_{\mathcal{T}}(\theta_0) Λ 0 < b T ( θ 0 ) , where b T ( θ ) : = dist ( θ , T c ) b_{\mathcal{T}}(\theta):=\operatorname{dist}(\theta,\mathcal{T}^c) b T ( θ ) := dist ( θ , T c ) . Therefore the closed ball B ‾ ( θ 0 , Λ 0 ) \overline{B}(\theta_0,\Lambda_0) B ( θ 0 , Λ 0 ) is contained in T \mathcal{T} T .
We prove inductively that every iterate and every update segment remain in this ball and that d k ≤ q η k / 2 d 0 d_k\le q_\eta^{k/2}d_0 d k ≤ q η k /2 d 0 . Suppose θ k ∈ T \theta_k\in\mathcal{T} θ k ∈ T . By Lemma D.4,
d k + 1 ≤ q η d k , ∥ θ k + 1 − θ k ∥ ≤ 4 M J κ ( d k − d k + 1 ) . (96) d_{k+1}\le\sqrt{q_\eta}\,d_k,\qquad\|\theta_{k+1}-\theta_k\|\le\frac{4M_J}{\sqrt{\kappa}}(d_k-d_{k+1}). \tag*{(96)} d k + 1 ≤ q η d k , ∥ θ k + 1 − θ k ∥ ≤ κ 4 M J ( d k − d k + 1 ) . (96)
The first inequality gives d k + 1 ≤ q η ( k + 1 ) / 2 d 0 d_{k+1}\le q_\eta^{(k+1)/2}d_0 d k + 1 ≤ q η ( k + 1 ) /2 d 0 .
Now consider any point y = θ k + s ( θ k + 1 − θ k ) y=\theta_k+s(\theta_{k+1}-\theta_k) y = θ k + s ( θ k + 1 − θ k ) , with 0 ≤ s ≤ 1 0\le s\le1 0 ≤ s ≤ 1 , on the new update segment. Using (D.37) and the induction hypothesis,
∥ y − θ 0 ∥ ≤ ∑ j = 0 k − 1 ∥ θ j + 1 − θ j ∥ + s ∥ θ k + 1 − θ k ∥ ≤ 4 M J κ ∑ j = 0 k ( d j − d j + 1 ) = 4 M J κ ( d 0 − d k + 1 ) ≤ Λ 0 . (97) \begin{aligned}
\|y-\theta_0\|\le\sum_{j=0}^{k-1}\|\theta_{j+1}-\theta_j\|+s\|\theta_{k+1}-\theta_k\| \\
&\le\frac{4M_J}{\sqrt{\kappa}}\sum_{j=0}^{k}(d_j-d_{j+1})=\frac{4M_J}{\sqrt{\kappa}}(d_0-d_{k+1})\le\Lambda_0. \tag*{(97)}
\end{aligned} ∥ y − θ 0 ∥ ≤ j = 0 ∑ k − 1 ∥ θ j + 1 − θ j ∥ + s ∥ θ k + 1 − θ k ∥ ≤ κ 4 M J j = 0 ∑ k ( d j − d j + 1 ) = κ 4 M J ( d 0 − d k + 1 ) ≤ Λ 0 . (97)
Hence the entire update segment remains in B ‾ ( θ 0 , Λ 0 ) ⊂ T \overline{B}(\theta_0,\Lambda_0)\subset\mathcal{T} B ( θ 0 , Λ 0 ) ⊂ T . Every iterate remains in T \mathcal{T} T , and d k ≤ q η k / 2 d 0 d_k\le q_\eta^{k/2}d_0 d k ≤ q η k /2 d 0 holds for all k ≥ 0 k\ge0 k ≥ 0 .
The decay d k → 0 d_k\to0 d k → 0 alone does not guarantee convergence of the full parameter sequence, since the iterates could in principle drift along the optimal manifold. The step-length estimate in (D.37) rules out this possibility. For integers ℓ > k \ell>k ℓ > k , summing the step-length bound gives
∑ j = k ℓ − 1 ∥ θ j + 1 − θ j ∥ ≤ 4 M J κ ( d k − d ℓ ) ≤ 4 M J κ d k ≤ Λ 0 q η k / 2 . (98) \sum_{j=k}^{\ell-1}\|\theta_{j+1}-\theta_j\|\le\frac{4M_J}{\sqrt{\kappa}}(d_k-d_\ell)\le\frac{4M_J}{\sqrt{\kappa}}d_k\le\Lambda_0q_\eta^{k/2}. \tag*{(98)} j = k ∑ ℓ − 1 ∥ θ j + 1 − θ j ∥ ≤ κ 4 M J ( d k − d ℓ ) ≤ κ 4 M J d k ≤ Λ 0 q η k /2 . (98)
The right-hand side tends to zero as k → ∞ k\to\infty k → ∞ . Hence ( θ k ) (\theta_k) ( θ k ) is a Cauchy sequence. Since the parameter space is finite-dimensional, there exists θ ∞ \theta_\infty θ ∞ such that θ k → θ ∞ \theta_k\to\theta_\infty θ k → θ ∞ .
Letting ℓ → ∞ \ell\to\infty ℓ → ∞ in (D.39) yields
∥ θ k − θ ∞ ∥ ≤ Λ 0 q η k / 2 . (99) \|\theta_k-\theta_\infty\|\le\Lambda_0q_\eta^{k/2}. \tag*{(99)} ∥ θ k − θ ∞ ∥ ≤ Λ 0 q η k /2 . (99)
Together with d k ≤ q η k / 2 d 0 d_k\le q_\eta^{k/2}d_0 d k ≤ q η k /2 d 0 , this proves geometric convergence both to the optimal manifold and to a single parameter limit. The distance function d ( θ ) = dist ( θ , M τ ) d(\theta)=\operatorname{dist}(\theta,\mathcal{M}_\tau) d ( θ ) = dist ( θ , M τ ) is 1-Lipschitz. Since θ k → θ ∞ \theta_k\to\theta_\infty θ k → θ ∞ and d k → 0 d_k\to0 d k → 0 , we obtain d ( θ ∞ ) = 0 d(\theta_\infty)=0 d ( θ ∞ ) = 0 . Because M τ \mathcal{M}_\tau M τ is closed, θ ∞ ∈ M τ \theta_\infty\in\mathcal{M}_\tau θ ∞ ∈ M τ .
Moreover, all iterates lie in the closed ball B ‾ ( θ 0 , Λ 0 ) \overline{B}(\theta_0,\Lambda_0) B ( θ 0 , Λ 0 ) , so the limit also lies in this ball and therefore in T \mathcal{T} T . Since T = T r ( U τ ) \mathcal{T}=\mathcal{T}_r(\mathcal{U}_\tau) T = T r ( U τ ) , there exist θ ˉ ∈ U τ \bar{\theta}\in\mathcal{U}_\tau θ ˉ ∈ U τ and Δ ∈ N θ ˉ M τ \Delta\in N_{\bar{\theta}}\mathcal{M}_\tau Δ ∈ N θ ˉ M τ , with ∥ Δ ∥ < r \|\Delta\|<r ∥Δ∥ < r , such that θ ∞ = θ ˉ + Δ \theta_\infty=\bar{\theta}+\Delta θ ∞ = θ ˉ + Δ .
By Lemma D.3, θ ˉ \bar{\theta} θ ˉ is the unique nearest point of θ ∞ \theta_\infty θ ∞ on M τ \mathcal{M}_\tau M τ . But θ ∞ ∈ M τ \theta_\infty\in\mathcal{M}_\tau θ ∞ ∈ M τ , so θ ∞ \theta_\infty θ ∞ itself is a nearest point. Uniqueness therefore implies Δ = 0 \Delta=0 Δ = 0 and θ ∞ = θ ˉ ∈ U τ \theta_\infty=\bar{\theta}\in\mathcal{U}_\tau θ ∞ = θ ˉ ∈ U τ . Hence there exist ( L ∞ , c ∞ ) ∈ Ω (L_\infty,c_\infty)\in\Omega ( L ∞ , c ∞ ) ∈ Ω such that θ ∞ = θ ˉ τ ( L ∞ , c ∞ ) \theta_\infty=\bar{\theta}_\tau(L_\infty,c_\infty) θ ∞ = θ ˉ τ ( L ∞ , c ∞ ) . By exact realization on M τ \mathcal{M}_\tau M τ , F θ ∞ , n = F τ , n F_{\theta_\infty,n}=F_{\tau,n} F θ ∞ , n = F τ , n , and therefore L n ( θ ∞ ) = 0 = min θ ∈ Θ L n ( θ ) L_n(\theta_\infty)=0=\min_{\theta\in\Theta}L_n(\theta) L n ( θ ∞ ) = 0 = min θ ∈ Θ L n ( θ ) . Iteration-complexity bound. By d k ≤ q η k / 2 d 0 d_k \le q_\eta^{k/2}d_0 d k ≤ q η k /2 d 0 , d ( θ K ) ≤ q η K / 2 d 0 d(\theta_K) \le q_\eta^{K/2}d_0 d ( θ K ) ≤ q η K /2 d 0 . Since q η = 1 − η κ / 4 q_\eta= 1-\eta\kappa/4 q η = 1 − η κ /4 and 1 − x ≤ e − x 1-x \le e^{-x} 1 − x ≤ e − x , d ( θ K ) ≤ exp ( − η κ K / 8 ) d 0 d(\theta_K) \le\exp(-\eta\kappa K/8)d_0 d ( θ K ) ≤ exp ( − η κ K /8 ) d 0 . Thus K ≥ 8 η κ log ( 1 / ε ) K \ge\frac{8}{\eta\kappa}\log(1/\varepsilon) K ≥ η κ 8 log ( 1/ ε ) is sufficient to guarantee d ( θ K ) ≤ ε d 0 d(\theta_K) \le\varepsilon d_0 d ( θ K ) ≤ ε d 0 . Consequently, K G D ( ε ; θ 0 ) ≤ ⌈ 8 η κ log 1 ε ⌉ K_{\mathrm{GD}}(\varepsilon;\theta_0) \le\left\lceil\frac{8}{\eta\kappa}\log\frac{1}{\varepsilon}\right\rceil K GD ( ε ; θ 0 ) ≤ ⌈ η κ 8 log ε 1 ⌉ .
We prove the lower bound by considering a small perturbation along the normal direction with the smallest local curvature. This direction is the locally slowest contraction direction of gradient descent.
Choose an interior point θ ˉ ∘ ∈ U τ \bar{\theta}^{\circ} \in\mathcal{U}_{\tau} θ ˉ ∘ ∈ U τ and define
ℓ : = λ min ( ∇ 2 L n ( θ ˉ ∘ ) ∣ N θ ˉ ∘ M τ ) . (100) \ell:= \lambda_{\min}\left(\left.\nabla^2 L_n(\bar{\theta}^{\circ})\right|_{N_{\bar{\theta}^{\circ}}\mathcal{M}_{\tau}}\right). \tag*{(100)} ℓ := λ m i n ( ∇ 2 L n ( θ ˉ ∘ ) N θ ˉ ∘ M τ ) . (100)
Thus, ℓ \ell ℓ is the smallest Hessian curvature over the normal directions at θ ˉ ∘ \bar{\theta}^{\circ} θ ˉ ∘ . By Lemma D.2, κ ≤ ℓ ≤ ( C Ω / c Ω ) κ \kappa\le\ell\le(C_{\Omega}/c_{\Omega})\kappa κ ≤ ℓ ≤ ( C Ω / c Ω ) κ . At an optimal parameter, ∇ 2 L n ( θ ˉ ∘ ) = J θ ˉ ∘ , n T J θ ˉ ∘ , n \nabla^2 L_n(\bar{\theta}^{\circ}) = J_{\bar{\theta}^{\circ},n}^{\mathsf{T}}J_{\bar{\theta}^{\circ},n} ∇ 2 L n ( θ ˉ ∘ ) = J θ ˉ ∘ , n T J θ ˉ ∘ , n . Hence the local Jacobian bound gives ℓ ≤ M J 2 \ell\le M_J^2 ℓ ≤ M J 2 . Since the Hessian is symmetric and ker ( ∇ 2 L n ( θ ˉ ∘ ) ) = T θ ˉ ∘ M τ \ker(\nabla^2 L_n(\bar{\theta}^{\circ}))=T_{\bar{\theta}^{\circ}}\mathcal{M}_{\tau} ker ( ∇ 2 L n ( θ ˉ ∘ )) = T θ ˉ ∘ M τ , the normal space is invariant under the Hessian. Therefore, there exists a unit vector U ∘ ∈ N θ ˉ ∘ M τ \mathrm{U}^{\circ}\in N_{\bar{\theta}^{\circ}}\mathcal{M}_{\tau} U ∘ ∈ N θ ˉ ∘ M τ such that
∇ 2 L n ( θ ˉ ∘ ) U ∘ = ℓ U ∘ . (101) \nabla^2 L_n(\bar{\theta}^{\circ})\mathrm{U}^{\circ}=\ell\mathrm{U}^{\circ}. \tag*{(101)} ∇ 2 L n ( θ ˉ ∘ ) U ∘ = ℓ U ∘ . (101)
Thus, U ∘ \mathrm{U}^{\circ} U ∘ is a normal direction with the smallest local curvature.
For t > 0 t>0 t > 0 , define θ t = θ ˉ ∘ + t U ∘ \theta_t=\bar{\theta}^{\circ}+t\mathrm{U}^{\circ} θ t = θ ˉ ∘ + t U ∘ . For sufficiently small t t t , Lemma D.3 gives d ( θ t ) = t d(\theta_t)=t d ( θ t ) = t . We first verify that these perturbations are admissible initializations. Let b ∘ : = b T ( θ ˉ ∘ ) > 0 b^{\circ}:=b_{\mathcal{T}}(\bar{\theta}^{\circ})>0 b ∘ := b T ( θ ˉ ∘ ) > 0 . Since the distance to T c \mathcal{T}^{c} T c is 1-Lipschitz, b T ( θ t ) ≥ b ∘ − t b_{\mathcal{T}}(\theta_t)\ge b^{\circ}-t b T ( θ t ) ≥ b ∘ − t . Thus, if t t t is sufficiently small so that t < r t<r t < r , t < b ∘ / 2 t<b^{\circ}/2 t < b ∘ /2 , and t < b ∘ κ / ( 8 M J ) t<b^{\circ}\sqrt{\kappa}/(8M_J) t < b ∘ κ / ( 8 M J ) , then
4 M J κ d ( θ t ) < b T ( θ t ) . (102) \frac{4M_J}{\sqrt{\kappa}}d(\theta_t)<b_{\mathcal{T}}(\theta_t). \tag*{(102)} κ 4 M J d ( θ t ) < b T ( θ t ) . (102)
Hence all sufficiently small nonzero θ t \theta_t θ t are admissible initializations.
We next determine how fast gradient descent contracts this perturbation. Define T η ( θ ) = θ − η ∇ L n ( θ ) T_{\eta}(\theta)=\theta-\eta\nabla L_n(\theta) T η ( θ ) = θ − η ∇ L n ( θ ) . Since ∇ L n ( θ ˉ ∘ ) = 0 \nabla L_n(\bar{\theta}^{\circ})=0 ∇ L n ( θ ˉ ∘ ) = 0 , the point θ ˉ ∘ \bar{\theta}^{\circ} θ ˉ ∘ is a fixed point of T η T_{\eta} T η . Moreover, D T η ( θ ˉ ∘ ) = I − η ∇ 2 L n ( θ ˉ ∘ ) DT_{\eta}(\bar{\theta}^{\circ})=I-\eta\nabla^2L_n(\bar{\theta}^{\circ}) D T η ( θ ˉ ∘ ) = I − η ∇ 2 L n ( θ ˉ ∘ ) . Therefore, using (D.42), for every fixed finite integer K K K ,
D ( T η K ) ( θ ˉ ∘ ) U ∘ = ( 1 − η ℓ ) K U ∘ . (103) D(T_{\eta}^{K})(\bar{\theta}^{\circ})\mathrm{U}^{\circ}=(1-\eta\ell)^K\mathrm{U}^{\circ}. \tag*{(103)} D ( T η K ) ( θ ˉ ∘ ) U ∘ = ( 1 − η ℓ ) K U ∘ . (103)
Hence, to first order, the perturbation along U ∘ \mathrm{U}^{\circ} U ∘ is reduced by the factor ( 1 − η ℓ ) K (1-\eta\ell)^K ( 1 − η ℓ ) K after K K K gradient-descent steps.
We now make this local linearization precise. Fix K K K and then let t t t tend to zero. Since L n L_n L n is twice continuously differentiable in the local regularity region, T η T_{\eta} T η is continuously differentiable there. For sufficiently small t t t , the first K K K iterates remain in this region, and
T η K ( θ t ) = θ ˉ ∘ + t ( 1 − η ℓ ) K U ∘ + R K ( t ) , ∥ R K ( t ) ∥ t ⟶ 0 as t ↓ 0. (104) T_{\eta}^{K}(\theta_t)=\bar{\theta}^{\circ}+t(1-\eta\ell)^K\mathrm{U}^{\circ}+R_K(t),\qquad\frac{\lVert R_K(t)\rVert}{t}\longrightarrow0\quad\text{as }t\downarrow0. \tag*{(104)} T η K ( θ t ) = θ ˉ ∘ + t ( 1 − η ℓ ) K U ∘ + R K ( t ) , t ∥ R K ( t )∥ ⟶ 0 as t ↓ 0. (104)
Here K K K is fixed before taking the limit t ↓ 0 t\downarrow0 t ↓ 0 . Since ℓ ≤ M J 2 \ell\le M_J^2 ℓ ≤ M J 2 and η ≤ 1 / ( 2 M J 2 ) \eta\le1/(2M_J^2) η ≤ 1/ ( 2 M J 2 ) , we have 0 < η ℓ ≤ 1 / 2 0<\eta\ell\le1/2 0 < η ℓ ≤ 1/2 , and therefore ( 1 − η ℓ ) K > 0 (1-\eta\ell)^K>0 ( 1 − η ℓ ) K > 0 . For sufficiently small t t t , Lemma D.3 gives d ( θ ˉ ∘ + t ( 1 − η ℓ ) K U ∘ ) = t ( 1 − η ℓ ) K d(\bar{\theta}^{\circ}+t(1-\eta\ell)^K\mathrm{U}^{\circ})=t(1-\eta\ell)^K d ( θ ˉ ∘ + t ( 1 − η ℓ ) K U ∘ ) = t ( 1 − η ℓ ) K . Because the distance to M τ \mathcal{M}_{\tau} M τ is 1-Lipschitz, (D.45) implies
lim t ↓ 0 d ( T η K ( θ t ) ) d ( θ t ) = ( 1 − η ℓ ) K . (105) \lim_{t\downarrow0}\frac{d(T_{\eta}^{K}(\theta_t))}{d(\theta_t)}=(1-\eta\ell)^K. \tag*{(105)} t ↓ 0 lim d ( θ t ) d ( T η K ( θ t )) = ( 1 − η ℓ ) K . (105)
Suppose that K K K iterations guarantee d ( T η K ( θ 0 ) ) ≤ ε d ( θ 0 ) d(T_{\eta}^{K}(\theta_0))\le\varepsilon d(\theta_0) d ( T η K ( θ 0 )) ≤ ε d ( θ 0 ) for every admissible initialization. Since all sufficiently small θ t \theta_t θ t constructed above are admissible, (D.46) implies ( 1 − η ℓ ) K ≤ ε (1-\eta\ell)^K\le\varepsilon ( 1 − η ℓ ) K ≤ ε . Therefore, K ≥ log ( 1 / ε ) / [ − log ( 1 − η ℓ ) ] K\ge\log(1/\varepsilon)/[-\log(1-\eta\ell)] K ≥ log ( 1/ ε ) / [ − log ( 1 − η ℓ )] . Since 0 < η ℓ ≤ 1 / 2 0<\eta\ell\le1/2 0 < η ℓ ≤ 1/2 and − log ( 1 − x ) ≤ 2 x -\log(1-x)\le2x − log ( 1 − x ) ≤ 2 x for 0 < x ≤ 1 / 2 0<x\le1/2 0 < x ≤ 1/2 , we obtain
sup θ 0 ∈ A τ K G D ( ε ; θ 0 ) ≥ 1 2 η ℓ log 1 ε ≥ c Ω 2 C Ω 1 η κ log 1 ε . (106) \sup_{\theta^{0}\in\mathcal{A}_{\tau}}K_{\mathrm{GD}}(\varepsilon;\theta^{0})\ge\frac{1}{2\eta\ell}\log\frac{1}{\varepsilon}\ge\frac{c_{\Omega}}{2C_{\Omega}}\frac{1}{\eta\kappa}\log\frac{1}{\varepsilon}. \tag*{(106)} θ 0 ∈ A τ sup K GD ( ε ; θ 0 ) ≥ 2 η ℓ 1 log ε 1 ≥ 2 C Ω c Ω η κ 1 log ε 1 . (106)
Verification for a Concrete Population Model
In this section, we provide simple sufficient conditions under which the richness condition in Assumption 1 holds, showing that it is satisfied by a broad class of task distributions, including our experimental setting. We then quantify its dependence on the temperature parameter for the experimental distribution.
Let a task consist of an initial distribution P 0 P_0 P 0 , transition kernel P P P , feature table Φ : S × A → R d \Phi: \mathcal{S} \times\mathcal{A} \to\mathbb{R}^d Φ : S × A → R d , reward table R ( a , s ′ ) R(a,s') R ( a , s ′ ) , and an input weight w w w . Given a task, a trajectory is generated by a fixed behavior policy π b \pi_b π b , and ϕ i = Φ ( s i , a i ) \phi_i = \Phi(s_i,a_i) ϕ i = Φ ( s i , a i ) , ψ i , a = Φ ( s i + 1 , a ) \psi_{i,a} = \Phi(s_{i+1},a) ψ i , a = Φ ( s i + 1 , a ) , and r i + 1 = R ( a i , s i + 1 ) r_{i+1} = R(a_i,s_{i+1}) r i + 1 = R ( a i , s i + 1 ) .
Qualitative verification of observable richness
Theorem E.1 (Continuous-population verification). Under Assumption 1(i), assume that:
(i) the finite-dimensional random vector formed by w w w , the entries of the feature Φ \Phi Φ , and the entries of the reward R R R has a nonzero absolutely continuous component with respect to Lebesgue measure;
(ii) there exist distinct states s 0 , s 1 s_0,s_1 s 0 , s 1 and, when n > 1 n > 1 n > 1 , distinct actions a x , a z a_x,a_z a x , a z such that, almost surely over tasks, P 0 ( s 0 ) > 0 P_0(s_0) > 0 P 0 ( s 0 ) > 0 , P ( s 1 ∣ s 0 , a x ) > 0 P(s_1 \mid s_0,a_x) > 0 P ( s 1 ∣ s 0 , a x ) > 0 , P ( s 1 ∣ s 1 , a z ) > 0 P(s_1 \mid s_1,a_z) > 0 P ( s 1 ∣ s 1 , a z ) > 0 , and π b ( a x ∣ s 0 ) > 0 \pi_b(a_x \mid s_0) > 0 π b ( a x ∣ s 0 ) > 0 , π b ( a z ∣ s 1 ) > 0 \pi_b(a_z \mid s_1) > 0 π b ( a z ∣ s 1 ) > 0 . For n = 1 n = 1 n = 1 , only P 0 ( s 0 ) > 0 P_0(s_0) > 0 P 0 ( s 0 ) > 0 , P ( s 1 ∣ s 0 , a x ) > 0 P(s_1 \mid s_0,a_x) > 0 P ( s 1 ∣ s 0 , a x ) > 0 , and π b ( a x ∣ s 0 ) > 0 \pi_b(a_x \mid s_0) > 0 π b ( a x ∣ s 0 ) > 0 are required.
Then, for every fixed n ≥ 1 n \ge1 n ≥ 1 and τ > 0 \tau> 0 τ > 0 , Assumption 1(ii) holds.
Proof. Fix n ≥ 1 n \ge1 n ≥ 1 and τ > 0 \tau> 0 τ > 0 . Recall that H τ , n = E z [ B τ , n ( z ) ∗ B τ , n ( z ) ] H_{\tau,n} = \mathbb{E}_z[\mathcal{B}_{\tau,n}(z)^*\mathcal{B}_{\tau,n}(z)] H τ , n = E z [ B τ , n ( z ) ∗ B τ , n ( z )] . Hence, for every coefficient vector ζ \zeta ζ , ⟨ ζ , H τ , n ζ ⟩ = E [ ∥ B τ , n ( z ) [ ζ ] ∥ 2 ] \langle\zeta,H_{\tau,n}\zeta\rangle= \mathbb{E}[\lVert\mathcal{B}_{\tau,n}(z)[\zeta]\rVert^2] ⟨ ζ , H τ , n ζ ⟩ = E [∥ B τ , n ( z ) [ ζ ] ∥ 2 ] . Therefore, it is enough to prove that B τ , n ( z ) [ ζ ] = 0 \mathcal{B}_{\tau,n}(z)[\zeta] = 0 B τ , n ( z ) [ ζ ] = 0 almost surely implies ζ = 0 \zeta= 0 ζ = 0 . Let T n T_n T n denote the random discrete trajectory and E n = { T n = ω n } \mathcal{E}_n = \{T_n = \omega_n\} E n = { T n = ω n } denote the calibration family. Since E [ ∥ B τ , n ( z ) [ ζ ] ∥ 2 ] ≥ E [ ∥ B τ , n ( z ) [ ζ ] ∥ 2 1 E n ] \mathbb{E}[\lVert\mathcal{B}_{\tau,n}(z)[\zeta]\rVert^2] \ge\mathbb{E}[\lVert\mathcal{B}_{\tau,n}(z)[\zeta]\rVert^2 1_{\mathcal{E}_n}] E [∥ B τ , n ( z ) [ ζ ] ∥ 2 ] ≥ E [∥ B τ , n ( z ) [ ζ ] ∥ 2 1 E n ] , it suffices to show that every ζ ≠ 0 \zeta\ne0 ζ = 0 is detected on E n \mathcal{E}_n E n , i.e., E [ ∥ B τ , n ( z ) [ ζ ] ∥ 2 1 E n ] > 0 \mathbb{E}[\lVert\mathcal{B}_{\tau,n}(z)[\zeta]\rVert^2 1_{\mathcal{E}_n}] > 0 E [∥ B τ , n ( z ) [ ζ ] ∥ 2 1 E n ] > 0 .
Consider the deterministic calibration path ω n \omega_n ω n consisting of s 0 → a x s 1 s_0 \xrightarrow{a_x} s_1 s 0 a x s 1 , followed, when n > 1 n > 1 n > 1 , by n − 1 n-1 n − 1 repetitions of s 1 → a z s 1 s_1 \xrightarrow{a_z} s_1 s 1 a z s 1 . For n = 1 n = 1 n = 1 , only the first transition is retained. Let X n X_n X n collect the continuous coordinates W = w W = w W = w , Y = Φ ( s 0 , a x ) Y = \Phi(s_0,a_x) Y = Φ ( s 0 , a x ) , Ψ a = Φ ( s 1 , a ) \Psi_a = \Phi(s_1,a) Ψ a = Φ ( s 1 , a ) , a ∈ [ m ] a \in[m] a ∈ [ m ] , together with R 0 = R ( a x , s 1 ) R_0 = R(a_x,s_1) R 0 = R ( a x , s 1 ) and, when n > 1 n > 1 n > 1 , R 1 = R ( a z , s 1 ) R_1 = R(a_z,s_1) R 1 = R ( a z , s 1 ) . Define the subprobability measure ν n ( E ) : = P ( X n ∈ E , T n = ω n ) \nu_n(E) := \mathbb{P}(X_n \in E,T_n = \omega_n) ν n ( E ) := P ( X n ∈ E , T n = ω n ) .
The calibration path ω n \omega_n ω n is not a null event. Let μ \mu μ denote the task distribution, and define p ω n ( Ξ ) : = Pr ( T n = ω n ∣ Ξ ) p_{\omega_n}(\Xi) := \Pr(T_n = \omega_n \mid\Xi) p ω n ( Ξ ) := Pr ( T n = ω n ∣ Ξ ) , where Ξ \Xi Ξ denotes the sampled task variables. By assumption (ii), every factor in p ω n ( Ξ ) p_{\omega_n}(\Xi) p ω n ( Ξ ) is strictly positive almost surely. Hence p ω n ( Ξ ) > 0 p_{\omega_n}(\Xi) > 0 p ω n ( Ξ ) > 0 for μ \mu μ -almost every task, and Pr ( T n = ω n ) = E μ [ p ω n ( Ξ ) ] > 0 \Pr(T_n = \omega_n) = \mathbb{E}_{\mu}[p_{\omega_n}(\Xi)] > 0 Pr ( T n = ω n ) = E μ [ p ω n ( Ξ )] > 0 . Let μ X \mu_X μ X denote the marginal distribution of X n X_n X n , and define ℓ n ( x ) : = E μ [ p ω n ( Ξ ) ∣ X n = x ] \ell_n(x) := \mathbb{E}_{\mu}[p_{\omega_n}(\Xi) \mid X_n = x] ℓ n ( x ) := E μ [ p ω n ( Ξ ) ∣ X n = x ] . Since p ω n ( Ξ ) > 0 p_{\omega_n}(\Xi) > 0 p ω n ( Ξ ) > 0 almost surely, we have ℓ n ( x ) > 0 \ell_n(x) > 0 ℓ n ( x ) > 0 for μ X \mu_X μ X -almost every x x x . By the tower property, for every Borel set E E E , ν n ( E ) = Pr ( X n ∈ E , T n = ω n ) = ∫ E ℓ n ( x ) μ X ( d x ) \nu_n(E) = \Pr(X_n \in E,T_n = \omega_n) = \int_E \ell_n(x)\mu_X(dx) ν n ( E ) = Pr ( X n ∈ E , T n = ω n ) = ∫ E ℓ n ( x ) μ X ( d x ) . By assumption (i), the joint distribution of ( w , Φ , R ) (w,\Phi,R) ( w , Φ , R ) has a nonzero absolutely continuous component. Since X n X_n X n is a coordinate subvector of ( w , Φ , R ) (w,\Phi,R) ( w , Φ , R ) , its marginal distribution μ X \mu_X μ X also has a nonzero absolutely continuous component, denoted by μ X a c \mu_X^{\mathrm{ac}} μ X ac . The measure ν ~ n ( d x ) : = ℓ n ( x ) μ X a c ( d x ) \widetilde{\nu}_n(dx) := \ell_n(x)\mu_X^{\mathrm{ac}}(dx) ν n ( d x ) := ℓ n ( x ) μ X ac ( d x ) is absolutely continuous with respect to Lebesgue measure. Moreover, it is nonzero since μ X a c ≠ 0 \mu_X^{\mathrm{ac}} \ne0 μ X ac = 0 and ℓ n > 0 \ell_n > 0 ℓ n > 0 μ X a c \mu_X^{\mathrm{ac}} μ X ac -almost everywhere. Since μ X a c ≤ μ X \mu_X^{\mathrm{ac}} \le\mu_X μ X ac ≤ μ X , we also have ν ~ n ≤ ν n \widetilde{\nu}_n \le\nu_n ν n ≤ ν n . Therefore, ν n \nu_n ν n has a nonzero absolutely continuous component.
Suppose that B τ , n ( z ) [ ζ ] = 0 \mathcal{B}_{\tau,n}(z)[\zeta] = 0 B τ , n ( z ) [ ζ ] = 0 almost surely under the joint task-trajectory distribution. Restricting to the event T n = ω n T_n = \omega_n T n = ω n gives B τ , n ( z ω n ( x ) ) [ ζ ] = 0 \mathcal{B}_{\tau,n}(z_{\omega_n}(x))[\zeta] = 0 B τ , n ( z ω n ( x )) [ ζ ] = 0 for ν n \nu_n ν n -almost every x x x . Each component of the left-hand side is real analytic in the continuous coordinates x x x , since it is formed from finite sums, products, exponentials, and divisions by strictly positive softmax denominators. Because ν n \nu_n ν n has a nonzero absolutely continuous component, each component vanishes on a set of positive Lebesgue measure. A nonzero real-analytic scalar function on R q \mathbb{R}^q R q has a Lebesgue-null zero set. Hence every component must vanish identically. Therefore, B τ , n ( z ) [ ζ ] = 0 \mathcal{B}_{\tau,n}(z)[\zeta] = 0 B τ , n ( z ) [ ζ ] = 0 implies
B τ , n ( z ω n ( x ) ) [ ζ ] = 0 , for all x . \mathcal{B}_{\tau,n}(z_{\omega_n}(x))[\zeta] = 0,\quad\text{for all } x. B τ , n ( z ω n ( x )) [ ζ ] = 0 , for all x .
We now use this identity to identify the coefficient blocks in ζ \zeta ζ . Let a x = 1 a_x=1 a x = 1 , set Y = y Y=y Y = y , Ψ 1 = x \Psi_1=x Ψ 1 = x , and Ψ a = 0 \Psi_a=0 Ψ a = 0 for every a ≠ 1 a\ne1 a = 1 . Since a z ≠ a x a_z\ne a_x a z = a x when n > 1 n>1 n > 1 , all later current-state features on the calibration path vanish. Writing r = R 0 r=R_0 r = R 0 , n B τ , n [ ζ ] = 0 n\mathcal{B}_{\tau,n}[\zeta]=0 n B τ , n [ ζ ] = 0 reduces to
0 = E C y ( r − w T y + γ w T ψ ˉ ) + y [ y ˉ T ( e − + E − w ) + ψ ˉ T ( e + + E + w ) + r e q T w + w T Σ E A w ] . 0=E_Cy\left(r-\mathbf{w}^{\mathsf T}y+\gamma\mathbf{w}^{\mathsf T}\bar{\psi}\right)+y\left[\bar{y}^{\mathsf T}(e_-+E_-\mathbf{w})+\bar{\psi}^{\mathsf T}(e_++E_+\mathbf{w})+r e_q^{\mathsf T}\mathbf{w}+\mathbf{w}^{\mathsf T}\Sigma E_A\mathbf{w}\right]. 0 = E C y ( r − w T y + γ w T ψ ˉ ) + y [ y ˉ T ( e − + E − w ) + ψ ˉ T ( e + + E + w ) + r e q T w + w T Σ E A w ] .
for every x , y , w ∈ R d x,y,\mathbf{w}\in\mathbb{R}^d x , y , w ∈ R d and r ∈ R r\in\mathbb{R} r ∈ R .
The coefficient of r r r is [ E C + ( e q T w ) I d ] y [E_C+(e_q^{\mathsf T}\mathbf{w})I_d]y [ E C + ( e q T w ) I d ] y . Setting w = 0 \mathbf{w}=0 w = 0 and varying y y y gives E C = 0 E_C=0 E C = 0 . The remaining identity ( e q T w ) y = 0 (e_q^{\mathsf T}\mathbf{w})y=0 ( e q T w ) y = 0 for every w , y \mathbf{w},y w , y then gives e q = 0 e_q=0 e q = 0 . After substituting E C = e q = 0 E_C=e_q=0 E C = e q = 0 , the scalar multiplying y y y must vanish for every y ≠ 0 y\ne0 y = 0 . Its dependence on y y y is affine, so its linear coefficient satisfies e − + E − w = 0 e_-+E_-\mathbf{w}=0 e − + E − w = 0 for every w \mathbf{w} w . Setting w = 0 \mathbf{w}=0 w = 0 gives e − = 0 e_-=0 e − = 0 , and varying w \mathbf{w} w then yields E − = 0 E_-=0 E − = 0 . The remaining identity is
ψ ˉ T ( e + + E + w ) + w T Σ E A w = 0. (107) \bar{\psi}^{\mathsf T}(e_++E_+\mathbf{w})+\mathbf{w}^{\mathsf T}\Sigma E_A\mathbf{w}=0. \tag*{(107)} ψ ˉ T ( e + + E + w ) + w T Σ E A w = 0. (107)
For the candidate feature set ( x , 0 , … , 0 ) (x,0,\ldots,0) ( x , 0 , … , 0 ) , define p = exp ( w T x / τ ) exp ( w T x / τ ) + m − 1 p=\frac{\exp(\mathbf{w}^{\mathsf T}x/\tau)}{\exp(\mathbf{w}^{\mathsf T}x/\tau)+m-1} p = e x p ( w T x / τ ) + m − 1 e x p ( w T x / τ ) . Then ψ ˉ = p x \bar{\psi}=px ψ ˉ = p x and Σ = p ( 1 − p ) x x T \Sigma=p(1-p)xx^{\mathsf T} Σ = p ( 1 − p ) x x T . Since m ≥ 2 m\ge2 m ≥ 2 , we have 0 < p < 1 0<p<1 0 < p < 1 . Dividing (E.1) by p p p gives
x T ( e + + E + w ) + ( 1 − p ) ( w T x ) ( x T E A w ) = 0. (108) x^{\mathsf T}(e_++E_+\mathbf{w})+(1-p)(\mathbf{w}^{\mathsf T}x)(x^{\mathsf T}E_A\mathbf{w})=0. \tag*{(108)} x T ( e + + E + w ) + ( 1 − p ) ( w T x ) ( x T E A w ) = 0. (108)
Set x = t v x=tv x = t v with t ≠ 0 t\ne0 t = 0 and divide (E.2) by t t t . The second term is O ( t ) O(t) O ( t ) as t → 0 t\to0 t → 0 , while the first term becomes v T ( e + + E + w ) v^{\mathsf T}(e_++E_+\mathbf{w}) v T ( e + + E + w ) . Letting t → 0 t\to0 t → 0 gives v T ( e + + E + w ) = 0 v^{\mathsf T}(e_++E_+\mathbf{w})=0 v T ( e + + E + w ) = 0 for every v , w v,\mathbf{w} v , w . Hence e + + E + w = 0 e_++E_+\mathbf{w}=0 e + + E + w = 0 for every w \mathbf{w} w , and therefore e + = 0 e_+=0 e + = 0 and E + = 0 E_+=0 E + = 0 .
Equation (E.2) now reduces to
( w T x ) ( x T E A w ) = 0 for every x , w . (109) (\mathbf{w}^{\mathsf T}x)(x^{\mathsf T}E_A\mathbf{w})=0 \qquad\text{for every }x,\mathbf{w}. \tag*{(109)} ( w T x ) ( x T E A w ) = 0 for every x , w . (109)
Suppose, for contradiction, that E A w ≠ 0 E_A\mathbf{w}\ne0 E A w = 0 for some w \mathbf{w} w . Then w ≠ 0 \mathbf{w}\ne0 w = 0 , and the two proper hyperplanes { x : w T x = 0 } \{x:\mathbf{w}^{\mathsf T}x=0\} { x : w T x = 0 } and { x : x T E A w = 0 } \{x:x^{\mathsf T}E_A\mathbf{w}=0\} { x : x T E A w = 0 } cannot cover R d \mathbb{R}^d R d . Hence there exists x x x for which both factors in (E.3) are nonzero, a contradiction. Therefore E A w = 0 E_A\mathbf{w}=0 E A w = 0 for every w \mathbf{w} w , and thus E A = 0 E_A=0 E A = 0 . We have shown that all seven coefficient blocks vanish: E C = e q = e − = E − = e + = E + = E A = 0 E_C=e_q=e_-=E_-=e_+=E_+=E_A=0 E C = e q = e − = E − = e + = E + = E A = 0 . Hence ζ = 0 \zeta=0 ζ = 0 .
Corollary E.2 (Verification under the experimental generator). Let N s ≥ 2 N_s\ge2 N s ≥ 2 and m ≥ 2 m\ge2 m ≥ 2 . Suppose that P 0 P_0 P 0 and all transition rows are mutually independent Dirichlet( 1 , … , 1 ) (1,\ldots,1) ( 1 , … , 1 ) random vectors, independent of ( w , Φ , R ) (\mathbf{w},\Phi,R) ( w , Φ , R ) , whose scalar entries are mutually independent Unif( − 1 , 1 ) (-1,1) ( − 1 , 1 ) random variables. Let the behavior policy be ϵ b \epsilon_b ϵ b -greedy with uniform exploration for some 0 < ϵ b ≤ 1 0<\epsilon_b\le1 0 < ϵ b ≤ 1 . Then the hypotheses of Theorem E.1 are satisfied. Consequently, for every fixed n ≥ 1 n\ge1 n ≥ 1 and τ > 0 \tau>0 τ > 0 , Assumption 1 holds.
Proof. We verify the two conditions of Theorem E.1. First, collect all scalar coordinates of w \mathbf{w} w , Φ \Phi Φ , and R R R into a finite-dimensional random vector X = ( w , vec ( Φ ) , vec ( R ) ) ∈ R q X=(\mathbf{w},\operatorname{vec}(\Phi),\operatorname{vec}(R))\in\mathbb{R}^q X = ( w , vec ( Φ ) , vec ( R )) ∈ R q . By assumption, the coordinates of X X X are mutually independent Unif( − 1 , 1 ) (-1,1) ( − 1 , 1 ) random variables. Hence X X X has density f X ( x ) = 2 − q 1 ( − 1 , 1 ) q ( x ) f_X(x)=2^{-q}\mathbf{1}_{(-1,1)^q}(x) f X ( x ) = 2 − q 1 ( − 1 , 1 ) q ( x ) with respect to q q q -dimensional Lebesgue measure. In particular, the law of X X X is absolutely continuous, with a nonzero density on the open set ( − 1 , 1 ) q (-1,1)^q ( − 1 , 1 ) q . Thus condition (i) of Theorem E.1 holds.
We next verify condition (ii). A Dirichlet( 1 , … , 1 ) (1,\ldots,1) ( 1 , … , 1 ) random vector is uniformly distributed on the probability simplex and lies in its relative interior almost surely. Therefore every coordinate is strictly positive almost surely. In particular, for any two distinct states s 0 , s 1 s_0,s_1 s 0 , s 1 , P 0 ( s 0 ) > 0 P_0(s_0)>0 P 0 ( s 0 ) > 0 a.s. and, for every action a a a , P ( s 1 ∣ s 0 , a ) > 0 P(s_1\mid s_0,a)>0 P ( s 1 ∣ s 0 , a ) > 0 , P ( s 1 ∣ s 1 , a ) > 0 P(s_1\mid s_1,a)>0 P ( s 1 ∣ s 1 , a ) > 0 a.s.
It remains to check the behavior-policy probabilities. Because the behavior policy is ϵ b \epsilon_b ϵ b -greedy with uniform exploration, every action receives at least its exploration probability: π b ( a ∣ s ) ≥ ϵ b m > 0 \pi_b(a\mid s)\ge\frac{\epsilon_b}{m}>0 π b ( a ∣ s ) ≥ m ϵ b > 0 for every ( s , a ) (s,a) ( s , a ) , independently of which action is greedy and of how ties are broken.
Hence, when n > 1 n>1 n > 1 , choose any distinct states s 0 , s 1 s_0,s_1 s 0 , s 1 and any distinct actions a x , a z a_x,a_z a x , a z . Then, almost surely, P 0 ( s 0 ) > 0 P_0(s_0)>0 P 0 ( s 0 ) > 0 , P ( s 1 ∣ s 0 , a x ) > 0 P(s_1\mid s_0,a_x)>0 P ( s 1 ∣ s 0 , a x ) > 0 , P ( s 1 ∣ s 1 , a z ) > 0 P(s_1\mid s_1,a_z)>0 P ( s 1 ∣ s 1 , a z ) > 0 , and π b ( a x ∣ s 0 ) > 0 \pi_b(a_x\mid s_0)>0 π b ( a x ∣ s 0 ) > 0 , π b ( a z ∣ s 1 ) > 0 \pi_b(a_z\mid s_1)>0 π b ( a z ∣ s 1 ) > 0 . Thus condition (ii) holds. For n = 1 n=1 n = 1 , only the first transition is needed, and the same argument gives P 0 ( s 0 ) > 0 P_0(s_0)>0 P 0 ( s 0 ) > 0 , P ( s 1 ∣ s 0 , a x ) > 0 P(s_1\mid s_0,a_x)>0 P ( s 1 ∣ s 0 , a x ) > 0 , π b ( a x ∣ s 0 ) > 0 \pi_b(a_x\mid s_0)>0 π b ( a x ∣ s 0 ) > 0 a.s. Therefore all hypotheses of Theorem E.1 are satisfied. Applying this yields Assumption 1 for every fixed n ≥ 1 n\ge1 n ≥ 1 and τ > 0. □ \tau>0. \quad\square τ > 0. □
Effect of Temperature on Convergence Rate
In this section, we establish the lower bound on κ ( τ ) \kappa(\tau) κ ( τ ) and then construct a matching normal direction for the upper bound. By the normal-curvature comparison established in Lemma D.2, it is sufficient for the lower bound to control the smallest eigenvalue χ τ , n : = λ min ( H τ , n ) \chi_{\tau,n} := \lambda_{\min}(H_{\tau,n}) χ τ , n := λ m i n ( H τ , n ) of the coefficient-space Gram matrix. Equivalently, we need to prove a uniform lower bound of E D n ∥ B τ , n ( z ) [ ζ ] ∥ 2 2 \mathbb{E}_{D_n}\lVert B_{\tau,n}(z)[\zeta]\rVert_2^2 E D n ∥ B τ , n ( z ) [ ζ ] ∥ 2 2 for every coefficient direction ζ \zeta ζ .
Lemma E.3 further reduces this task to the reference law U n U_n U n on the calibration path. Hence it suffices to establish the corresponding coercivity bound for E U n ∥ B τ , n ( z ω n ) [ ζ ] ∥ 2 2 \mathbb{E}_{U_n}\lVert B_{\tau,n}(z_{\omega_n})[\zeta]\rVert_2^2 E U n ∥ B τ , n ( z ω n ) [ ζ ] ∥ 2 2 . The only coefficient block whose response degenerates is the attention-score block in the first layer of Transformer. We therefore first isolate the successor-value and attention contribution K τ = Ψ ˉ T ( e + + E + W ) + W T Σ τ E A W K_\tau= \bar{\Psi}^{\mathsf{T}}(e_+ + E_+W) + W^{\mathsf{T}}\Sigma_\tau E_AW K τ = Ψ ˉ T ( e + + E + W ) + W T Σ τ E A W and derive a quantitative lower bound for E U n K τ 2 \mathbb{E}_{U_n}K_\tau^2 E U n K τ 2 , which shows in Lemma E.4. We then combine this estimate with orthogonal projections controlling the remaining coefficient blocks ( E C , e q , e − , E − ) (E_C,e_q,e_-,E_-) ( E C , e q , e − , E − ) , which yields the lower bound of κ ( τ ) \kappa(\tau) κ ( τ ) .
Lemma E.3 (Calibration-path reduction). Under the experimental generator, let ω n \omega_n ω n be the calibration path used in Theorem E.1, and let U n U_n U n denote the product-uniform law of the continuous coordinates appearing along this path. Then, for every coefficient direction ζ \zeta ζ ,
E D n ∥ B τ , n ( z ) [ ζ ] ∥ 2 2 ≥ p n E U n ∥ B τ , n ( z ω n ) [ ζ ] ∥ 2 2 , \mathbb{E}_{D_n}\lVert B_{\tau,n}(z)[\zeta]\rVert_2^2 \ge p_n\mathbb{E}_{U_n}\lVert B_{\tau,n}(z_{\omega_n})[\zeta]\rVert_2^2, E D n ∥ B τ , n ( z ) [ ζ ] ∥ 2 2 ≥ p n E U n ∥ B τ , n ( z ω n ) [ ζ ] ∥ 2 2 , where
p n = p min n N s 2 Γ ( N s ) Γ ( n ) Γ ( N s + n − 1 ) > 0 , p min : = ϵ b m . p_n = \frac{p_{\min}^n}{N_s^2}\frac{\Gamma(N_s)\Gamma(n)}{\Gamma(N_s+n-1)} > 0,\qquad p_{\min}:=\frac{\epsilon_b}{m}. p n = N s 2 p m i n n Γ ( N s + n − 1 ) Γ ( N s ) Γ ( n ) > 0 , p m i n := m ϵ b .
Proof. We use the same calibration path as in Theorem E.1, s 0 → a x s 1 s_0 \xrightarrow{a_x} s_1 s 0 a x s 1 , s 1 → a z s 1 s_1 \xrightarrow{a_z} s_1 s 1 a z s 1 for the remaining n − 1 n-1 n − 1 transitions, with the second part omitted when n = 1 n=1 n = 1 . Let U n U_n U n denote the product-uniform law of the continuous coordinates appearing along this path, and let z ω n z_{\omega_n} z ω n be the corresponding context.
Because the behavior policy selects every action with probability at least p min p_{\min} p m i n , the conditional probability of following the prescribed action sequence is at least p min n p_{\min}^n p m i n n . The remaining state-transition contribution is
Q n = P 0 ( s 0 ) P ( s 1 ∣ s 0 , a x ) P ( s 1 ∣ s 1 , a z ) n − 1 , Q_n = P_0(s_0)P(s_1\mid s_0,a_x)P(s_1\mid s_1,a_z)^{n-1}, Q n = P 0 ( s 0 ) P ( s 1 ∣ s 0 , a x ) P ( s 1 ∣ s 1 , a z ) n − 1 ,
where the final factor is omitted for $n=1. Hence the probability of the calibration path, conditional on the task, is bounded below by p min n Q n p_{\min}^nQ_n p m i n n Q n . Since the initial-state probability P 0 ( s 0 ) P_0(s_0) P 0 ( s 0 ) and the transition probability P ( s 1 ∣ s 0 , a x ) P(s_1\mid s_0,a_x) P ( s 1 ∣ s 0 , a x ) each have mean $1/N_s$. The repeated self-transition probability P ( s 1 ∣ s 1 , a z ) P(s_1\mid s_1,a_z) P ( s 1 ∣ s 1 , a z ) has the Beta( 1 , N s − 1 ) (1,N_s-1) ( 1 , N s − 1 ) distribution, so
E Q n = E P 0 ( s 0 ) E P ( s 1 ∣ s 0 , a x ) E P ( s 1 ∣ s 1 , a z ) n − 1 = 1 N s 2 Γ ( N s ) Γ ( n ) Γ ( N s + n − 1 ) . \mathbb{E}Q_n = \mathbb{E}P_0(s_0)\mathbb{E}P(s_1\mid s_0,a_x)\mathbb{E}P(s_1\mid s_1,a_z)^{n-1} = \frac{1}{N_s^2}\frac{\Gamma(N_s)\Gamma(n)}{\Gamma(N_s+n-1)}. E Q n = E P 0 ( s 0 ) E P ( s 1 ∣ s 0 , a x ) E P ( s 1 ∣ s 1 , a z ) n − 1 = N s 2 1 Γ ( N s + n − 1 ) Γ ( N s ) Γ ( n ) .
Under the experimental generator, the environment variables in Q n Q_n Q n are independent of the selected continuous coordinates ( w , Φ , R ) (w,\Phi,R) ( w , Φ , R ) . Therefore, for every nonnegative measurable function f f f ,
E D n f ( Z ) ≥ E D n [ f ( Z ) 1 { T n = ω n } ] = E [ f ( z ω n ( X n ) ) P ( T n = ω n ∣ Ξ ) ] ≥ p min n E [ f ( z ω n ( X n ) ) Q n ] = p min n E [ f ( z ω n ( X n ) ) ] E [ Q n ] ≥ p n E U n f ( z ω n ) . \begin{aligned}
\mathbb{E}_{D_n}f(Z) \ge\mathbb{E}_{D_n}\left[f(Z)\mathbf{1}_{\{T_n=\omega_n\}}\right] = \mathbb{E}\left[f(z_{\omega_n}(X_n))\mathbb{P}(T_n=\omega_n\mid\Xi)\right] \\
&\ge p_{\min}^n\mathbb{E}\left[f(z_{\omega_n}(X_n))Q_n\right] = p_{\min}^n\mathbb{E}\left[f(z_{\omega_n}(X_n))\right]\mathbb{E}[Q_n] \ge p_n\mathbb{E}_{U_n}f(z_{\omega_n}).
\end{aligned} E D n f ( Z ) ≥ E D n [ f ( Z ) 1 { T n = ω n } ] = E [ f ( z ω n ( X n )) P ( T n = ω n ∣ Ξ ) ] ≥ p m i n n E [ f ( z ω n ( X n )) Q n ] = p m i n n E [ f ( z ω n ( X n )) ] E [ Q n ] ≥ p n E U n f ( z ω n ) .
where p n = p min n N s 2 Γ ( N s ) Γ ( n ) Γ ( N s + n − 1 ) > 0 p_n = \frac{p_{\min}^n}{N_s^2}\frac{\Gamma(N_s)\Gamma(n)}{\Gamma(N_s+n-1)} > 0 p n = N s 2 p m i n n Γ ( N s + n − 1 ) Γ ( N s ) Γ ( n ) > 0 . Let f ( z ) = ∥ B τ , n ( z ) [ ζ ] ∥ 2 f(z)=\lVert B_{\tau,n}(z)[\zeta]\rVert^2 f ( z ) = ∥ B τ , n ( z ) [ ζ ] ∥ 2 , we have the desired result. □ \square □
Let ζ = ( E C , e q , e − , E − , e + , E + , E A ) \zeta=(E_C,e_q,e_-,E_-,e_+,E_+,E_A) ζ = ( E C , e q , e − , E − , e + , E + , E A ) be the observable coefficient direction induced by U U U . We decompose the attention coefficient E A E_A E A as D : = E A = D 0 + a I d D:=E_A=D_0+aI_d D := E A = D 0 + a I d , a : = tr ( D ) d a:=\frac{\operatorname{tr}(D)}{d} a := d tr ( D ) , tr ( D 0 ) = 0 \operatorname{tr}(D_0)=0 tr ( D 0 ) = 0 . We first isolate the part of the response associated with the successor and attention coefficients. Under the reference law U n U_n U n , let W W W denote the weight vector and Ψ 1 , … , Ψ m \Psi_1,\ldots,\Psi_m Ψ 1 , … , Ψ m the successor features. Their contribution is summarized by K τ : = Ψ ˉ T ( e + + E + W ) + W T Σ τ D W K_\tau:=\bar{\Psi}^{\mathsf{T}}(e_+ + E_+W)+W^{\mathsf{T}}\Sigma_\tau D W K τ := Ψ ˉ T ( e + + E + W ) + W T Σ τ D W .
Lemma E.4 shows that the temperature dependence of K τ K_\tau K τ determines the weakest curvature contributed by the attention block and, in particular, reveals the τ 5 \tau^5 τ 5 scaling of the scalar attention direction.
Lemma E.4. Assume d ≥ 2 d\ge2 d ≥ 2 . Under the reference law U n U_n U n , there exist constants b a t t > 0 b_{\mathrm{att}}>0 b att > 0 and τ ∗ > 0 \tau_*>0 τ ∗ > 0 , independent of τ \tau τ and of the coefficient direction, such that for every 0 < τ ≤ τ ∗ 0<\tau\le\tau_* 0 < τ ≤ τ ∗ ,
E U n K τ 2 ≥ b a t t ( ∥ e + ∥ 2 + ∥ E + ∥ F 2 + τ 3 ∥ D 0 ∥ F 2 + τ 5 d a 2 ) . \mathbb{E}_{U_n}K_\tau^2 \ge b_{\mathrm{att}}\left(\lVert e_+\rVert^2+\lVert E_+\rVert_F^2+\tau^3\lVert D_0\rVert_F^2+\tau^5da^2\right). E U n K τ 2 ≥ b att ( ∥ e + ∥ 2 + ∥ E + ∥ F 2 + τ 3 ∥ D 0 ∥ F 2 + τ 5 d a 2 ) .
Proof. (i) We first lower-bound E [ ( W T Σ τ D W ) 2 ] \mathbb{E}[(W^{\mathsf T}\Sigma_\tau DW)^2] E [( W T Σ τ D W ) 2 ] . The difficulty is that D 0 D_0 D 0 may point in an arbitrary trace-free matrix direction. We first construct a finite collection of measurements u T D 0 v u^{\mathsf T}D_0v u T D 0 v that controls the entire matrix D 0 D_0 D 0 . Define
F = { ( e i , e j ) : i ≠ j } ∪ { ( e i − e j 2 , e i + e j 2 ) , ( e i + e j 2 , e i − e j 2 ) : i < j } . \mathcal{F}=\{(e_i,e_j):i\ne j\}\cup\left\{\left(\frac{e_i-e_j}{\sqrt{2}},\frac{e_i+e_j}{\sqrt{2}}\right),\left(\frac{e_i+e_j}{\sqrt{2}},\frac{e_i-e_j}{\sqrt{2}}\right):i<j\right\}. F = {( e i , e j ) : i = j } ∪ { ( 2 e i − e j , 2 e i + e j ) , ( 2 e i + e j , 2 e i − e j ) : i < j } .
The pairs ( e i , e j ) (e_i,e_j) ( e i , e j ) directly measure the off-diagonal entries of D 0 D_0 D 0 , while the rotated pairs also measure differences between its diagonal entries. Since tr ( D 0 ) = 0 \operatorname{tr}(D_0)=0 tr ( D 0 ) = 0 , we have
∑ ( u , v ) ∈ F ( u T D 0 v ) 2 = ∑ i ≠ j ( D 0 ) i j 2 + ∑ i < j 1 2 ( ( D 0 ) i i − ( D 0 ) j j ) 2 + 1 2 ( ( D 0 ) i j − ( D 0 ) j i ) 2 = ∑ i ≠ j ( D 0 ) i j 2 + d 2 ∑ i ( D 0 ) i i 2 + 1 2 ∑ i < j ( ( D 0 ) i j − ( D 0 ) j i ) 2 ≥ ∑ i ≠ j ( D 0 ) i j 2 + ∑ i ( D 0 ) i i 2 = ∥ D 0 ∥ F 2 . (110) \begin{aligned}
\sum_{(u,v)\in\mathcal{F}}(u^{\mathsf T}D_0v)^2
&=\sum_{i\ne j}(D_0)_{ij}^2+\sum_{i<j}\frac{1}{2}\bigl((D_0)_{ii}-(D_0)_{jj}\bigr)^2+\frac{1}{2}\bigl((D_0)_{ij}-(D_0)_{ji}\bigr)^2\\
&=\sum_{i\ne j}(D_0)_{ij}^2+\frac{d}{2}\sum_i(D_0)_{ii}^2+\frac{1}{2}\sum_{i<j}\bigl((D_0)_{ij}-(D_0)_{ji}\bigr)^2\\
&\ge\sum_{i\ne j}(D_0)_{ij}^2+\sum_i(D_0)_{ii}^2=\lVert D_0\rVert_{\mathrm F}^2. \tag*{(110)}
\end{aligned} ( u , v ) ∈ F ∑ ( u T D 0 v ) 2 = i = j ∑ ( D 0 ) ij 2 + i < j ∑ 2 1 ( ( D 0 ) ii − ( D 0 ) j j ) 2 + 2 1 ( ( D 0 ) ij − ( D 0 ) j i ) 2 = i = j ∑ ( D 0 ) ij 2 + 2 d i ∑ ( D 0 ) ii 2 + 2 1 i < j ∑ ( ( D 0 ) ij − ( D 0 ) j i ) 2 ≥ i = j ∑ ( D 0 ) ij 2 + i ∑ ( D 0 ) ii 2 = ∥ D 0 ∥ F 2 . (110)
Hence the finite family F \mathcal{F} F detects every nonzero trace-free direction.
For each ( u , v ) ∈ F (u,v)\in\mathcal{F} ( u , v ) ∈ F , we construct a local configuration in which the attention response contains the measurement u T D 0 v u^{\mathsf T}D_0v u T D 0 v . Choose fixed sufficiently small constants s , t , b > 0 s,t,b>0 s , t , b > 0 and set W = s v W=sv W = s v , V : = Ψ 1 − Ψ 2 = t u V:=\Psi_1-\Psi_2=tu V := Ψ 1 − Ψ 2 = t u , and M : = ( Ψ 1 + Ψ 2 ) / 2 = b v M:=(\Psi_1+\Psi_2)/2=bv M := ( Ψ 1 + Ψ 2 ) /2 = b v , with Ψ a = − b v \Psi_a=-bv Ψ a = − b v for a ≥ 3 a\ge3 a ≥ 3 . Equivalently, Ψ 1 = b v + ( t / 2 ) u \Psi_1=bv+(t/2)u Ψ 1 = b v + ( t /2 ) u and Ψ 2 = b v − ( t / 2 ) u \Psi_2=bv-(t/2)u Ψ 2 = b v − ( t /2 ) u .
Since u T v = 0 u^{\mathsf T}v=0 u T v = 0 , actions 1 and 2 have the same score, W T Ψ 1 = W T Ψ 2 = s b W^{\mathsf T}\Psi_1=W^{\mathsf T}\Psi_2=sb W T Ψ 1 = W T Ψ 2 = s b , whereas every action a ≥ 3 a\ge3 a ≥ 3 has score − s b -sb − s b . Thus actions 1 and 2 are tied, while all remaining actions are separated from them by a fixed positive margin. Let g : = W T V = W T ( Ψ 1 − Ψ 2 ) g:=W^{\mathsf T}V=W^{\mathsf T}(\Psi_1-\Psi_2) g := W T V = W T ( Ψ 1 − Ψ 2 ) denote the score gap between actions 1 and 2. At the center, g = 0 g=0 g = 0 . In a sufficiently small neighborhood of each center, we use g g g , together with the remaining local coordinates υ \upsilon υ , as coordinates. The corresponding reference density can be written as j ℓ ( υ , g ) d υ d g j_\ell(\upsilon,g)\,d\upsilon\,dg j ℓ ( υ , g ) d υ d g , with 0 < j − ≤ j ℓ ( υ , g ) ≤ j + < ∞ 0<j_-\le j_\ell(\upsilon,g)\le j_+<\infty 0 < j − ≤ j ℓ ( υ , g ) ≤ j + < ∞ . Since only finitely many charts are used, these constants can be chosen uniformly.
We restrict each chart to the near-tie region τ ≤ ∣ g ∣ ≤ 2 τ \tau\le|g|\le2\tau τ ≤ ∣ g ∣ ≤ 2 τ . In this region, actions 1 and 2 both receive nonnegligible softmax mass, whereas all other actions remain separated by a fixed score gap and contribute only exponentially small terms. Using the pairwise representation of Σ τ \Sigma_\tau Σ τ , we obtain
W T Σ τ D W = π 1 τ π 2 τ g V T D W + R τ , ∣ R τ ∣ ≤ C e − g 0 / τ ∥ D ∥ F . (111) W^{\mathsf T}\Sigma_\tau DW=\pi_1^\tau\pi_2^\tau\,g\,V^{\mathsf T}DW+R_\tau,\qquad|R_\tau|\le Ce^{-g_0/\tau}\lVert D\rVert_{\mathrm F}. \tag*{(111)} W T Σ τ D W = π 1 τ π 2 τ g V T D W + R τ , ∣ R τ ∣ ≤ C e − g 0 / τ ∥ D ∥ F . (111)
Since D = D 0 + a I d D=D_0+aI_d D = D 0 + a I d and V T W = g V^{\mathsf T}W=g V T W = g ,
g V T D W = g V T D 0 W + a g 2 . (112) gV^{\mathsf T}DW=gV^{\mathsf T}D_0W+ag^2. \tag*{(112)} g V T D W = g V T D 0 W + a g 2 . (112)
The trace-free component therefore contains one factor of the small gap g g g , whereas the scalar component contains two. To make the dependence on τ \tau τ explicit, set g = τ x g=\tau x g = τ x and a e : = τ a a_e:=\tau a a e := τ a . Then
g V T D 0 W + a g 2 = τ ( x V T D 0 W + a e x 2 ) . (113) gV^{\mathsf T}D_0W+ag^2=\tau\left(xV^{\mathsf T}D_0W+a_ex^2\right). \tag*{(113)} g V T D 0 W + a g 2 = τ ( x V T D 0 W + a e x 2 ) . (113)
Squaring contributes a factor τ 2 \tau^2 τ 2 , while d g = τ d x dg=\tau\,dx d g = τ d x contributes one additional factor τ \tau τ . Hence the near-tie contribution has an overall factor τ 3 \tau^3 τ 3 . After removing this common factor, the corresponding quadratic forms converge to
G 0 ( D 0 , a e ) = ∑ ℓ ∫ Z ℓ j ℓ ( υ , 0 ) ∫ 1 ≤ ∣ x ∣ ≤ 2 k ( x ) ( x f ℓ ( υ ; D 0 ) + a e x 2 ) 2 d x d υ , (114) G_0(D_0,a_e)=\sum_\ell\int_{Z_\ell}j_\ell(\upsilon,0)\int_{1\le|x|\le2}k(x)\left(xf_\ell(\upsilon;D_0)+a_ex^2\right)^2\,dx\,d\upsilon, \tag*{(114)} G 0 ( D 0 , a e ) = ℓ ∑ ∫ Z ℓ j ℓ ( υ , 0 ) ∫ 1 ≤ ∣ x ∣ ≤ 2 k ( x ) ( x f ℓ ( υ ; D 0 ) + a e x 2 ) 2 d x d υ , (114)
where k ( x ) : = e 2 x / ( 1 + e x ) 4 > 0 k(x):=e^{2x}/(1+e^x)^4>0 k ( x ) := e 2 x / ( 1 + e x ) 4 > 0 and f ℓ ( υ ; D 0 ) : = V ℓ ( υ , 0 ) T D 0 W ℓ ( υ , 0 ) f_\ell(\upsilon;D_0):=V_\ell(\upsilon,0)^{\mathsf T}D_0W_\ell(\upsilon,0) f ℓ ( υ ; D 0 ) := V ℓ ( υ , 0 ) T D 0 W ℓ ( υ , 0 ) . The role of G 0 G_0 G 0 is to rule out cancellation between the trace-free part D 0 D_0 D 0 and the scalar part a I d aI_d a I d . Suppose G 0 ( D 0 , a e ) = 0 G_0(D_0,a_e)=0 G 0 ( D 0 , a e ) = 0 . Since the integrand is nonnegative and the weights are strictly positive, we must have x f ℓ ( υ ; D 0 ) + a e x 2 = 0 x f_\ell(\upsilon;D_0)+a_ex^2=0 x f ℓ ( υ ; D 0 ) + a e x 2 = 0 throughout each chart. Evaluating this identity at x x x and − x -x − x , with 1 < x < 2 1<x<2 1 < x < 2 , gives x f ℓ + a e x 2 = 0 xf_\ell+a_ex^2=0 x f ℓ + a e x 2 = 0 , − x f ℓ + a e x 2 = 0 -xf_\ell+a_ex^2=0 − x f ℓ + a e x 2 = 0 . Hence a e = 0 a_e=0 a e = 0 and f ℓ = 0 f_\ell=0 f ℓ = 0 . At the center of the ℓ \ell ℓ -th chart, V ℓ = t u ℓ V_\ell=t u_\ell V ℓ = t u ℓ and W ℓ = s v ℓ W_\ell=s v_\ell W ℓ = s v ℓ , and therefore f ℓ ( 0 ; D 0 ) = s t u ℓ T D 0 v ℓ = 0 f_\ell(0;D_0)=st\,u_\ell^{\mathsf T}D_0v_\ell=0 f ℓ ( 0 ; D 0 ) = s t u ℓ T D 0 v ℓ = 0 . Since this holds for every ( u ℓ , v ℓ ) ∈ F (u_\ell,v_\ell)\in\mathcal{F} ( u ℓ , v ℓ ) ∈ F , (E.5) implies D 0 = 0 D_0=0 D 0 = 0 . Thus G 0 G_0 G 0 is positive definite. Because the coefficient space is finite dimensional, compactness of its unit sphere gives a constant λ 0 > 0 \lambda_0>0 λ 0 > 0 such that
G 0 ( D 0 , a e ) ≥ λ 0 ( ∥ D 0 ∥ F 2 + d a e 2 ) . (115) G_0(D_0,a_e)\ge\lambda_0\left(\lVert D_0\rVert_{\mathrm F}^2+da_e^2\right). \tag*{(115)} G 0 ( D 0 , a e ) ≥ λ 0 ( ∥ D 0 ∥ F 2 + d a e 2 ) . (115)
Moreover, after the rescaling g = τ x g=\tau x g = τ x and a = a e / τ a=a_e/\tau a = a e / τ , the contribution of the remaining actions to the rescaled response is uniformly O ( τ − 2 e − g 0 / τ ) = o ( 1 ) O(\tau^{-2}e^{-g_0/\tau})=o(1) O ( τ − 2 e − g 0 / τ ) = o ( 1 ) on the coefficient unit sphere tr ( D 0 ) = 0 \operatorname{tr}(D_0)=0 tr ( D 0 ) = 0 , ∥ D 0 ∥ F 2 + d a e 2 = 1 \lVert D_0\rVert_F^2+da_e^2=1 ∥ D 0 ∥ F 2 + d a e 2 = 1 . The coordinate maps and densities also converge uniformly on the fixed chart domains, chosen with compact closures. Thus G τ G_\tau G τ converges uniformly to G 0 G_0 G 0 on this unit sphere, equivalently in operator norm for the associated Gram operators. Hence, for all sufficiently small τ > 0 \tau>0 τ > 0 ,
G τ ( D 0 , a e ) : = τ − 3 ∑ ℓ ∫ C ℓ , τ [ W T Σ τ ( D 0 + a e τ I d ) W ] 2 d P ≥ λ 0 2 ( ∥ D 0 ∥ F 2 + d a e 2 ) . (116) G_\tau(D_0,a_e):=\tau^{-3}\sum_{\ell}\int_{\mathcal{C}_{\ell,\tau}}\left[W^{\mathsf T}\Sigma^\tau\left(D_0+\frac{a_e}{\tau}I_d\right)W\right]^2\,dP\geq\frac{\lambda_0}{2}\left(\lVert D_0\rVert_F^2+da_e^2\right). \tag*{(116)} G τ ( D 0 , a e ) := τ − 3 ℓ ∑ ∫ C ℓ , τ [ W T Σ τ ( D 0 + τ a e I d ) W ] 2 d P ≥ 2 λ 0 ( ∥ D 0 ∥ F 2 + d a e 2 ) . (116)
Let C ℓ , τ \mathcal{C}_{\ell,\tau} C ℓ , τ denote the near-tie region in the ℓ \ell ℓ -th chart and define E t i e ( τ ) : = ⋃ ℓ C ℓ , τ \mathcal{E}_{\mathrm{tie}}(\tau):=\bigcup_{\ell}\mathcal{C}_{\ell,\tau} E tie ( τ ) := ⋃ ℓ C ℓ , τ . Since there are only L : = ∣ F ∣ L:=|\mathcal{F}| L := ∣ F ∣ charts, their overlap multiplicity is at most L L L . Therefore, for every nonnegative function h h h ,
∑ ℓ ∫ C ℓ , τ h d P ≤ L E [ h 1 E t i e ( τ ) ] . (117) \sum_{\ell}\int_{\mathcal{C}_{\ell,\tau}}h\,dP\leq L\mathbb{E}\left[h1_{\mathcal{E}_{\mathrm{tie}}(\tau)}\right]. \tag*{(117)} ℓ ∑ ∫ C ℓ , τ h d P ≤ L E [ h 1 E tie ( τ ) ] . (117)
Combining this finite-overlap bound with (E.11), and recalling that a e = τ a a_e=\tau a a e = τ a , gives
E [ ( W T Σ τ D W ) 2 1 E t i e ( τ ) ] ≥ b 3 τ 3 ∥ D 0 ∥ F 2 + b 5 τ 5 d a 2 − C e − g 0 / τ ∥ D ∥ F 2 . (118) \mathbb{E}\left[\left(W^{\mathsf T}\Sigma_\tau DW\right)^2 1_{\mathcal{E}_{\mathrm{tie}}(\tau)}\right]\geq b_3\tau^3\lVert D_0\rVert_F^2+b_5\tau^5da^2-Ce^{-g_0/\tau}\lVert D\rVert_F^2. \tag*{(118)} E [ ( W T Σ τ D W ) 2 1 E tie ( τ ) ] ≥ b 3 τ 3 ∥ D 0 ∥ F 2 + b 5 τ 5 d a 2 − C e − g 0 / τ ∥ D ∥ F 2 . (118)
Thus the near-tie regions provide order-τ 3 \tau^3 τ 3 control of the trace-free component D 0 D_0 D 0 and the weaker order-τ 5 \tau^5 τ 5 control of the scalar component a I d aI_d a I d .
(ii) We next control cancellation with E + E_+ E + . All expectations below are under the reference law U n U_n U n . Write X τ : = Ψ ˉ τ T E + W X_\tau:=\bar{\Psi}^{\mathsf T}_\tau E_+W X τ := Ψ ˉ τ T E + W , Y τ : = W T Σ τ D W Y_\tau:=W^{\mathsf T}\Sigma_\tau DW Y τ := W T Σ τ D W , Z τ : = Ψ ˉ τ T e + Z_\tau:=\bar{\Psi}^{\mathsf T}_\tau e_+ Z τ := Ψ ˉ τ T e + , where D = D 0 + a I d D=D_0+aI_d D = D 0 + a I d and tr ( D 0 ) = 0 \operatorname{tr}(D_0)=0 tr ( D 0 ) = 0 . In particular, K τ = Z τ + X τ + Y τ K_\tau=Z_\tau+X_\tau+Y_\tau K τ = Z τ + X τ + Y τ , ∥ D ∥ F 2 = ∥ D 0 ∥ F 2 + d a 2 \lVert D\rVert_F^2=\lVert D_0\rVert_F^2+da^2 ∥ D ∥ F 2 = ∥ D 0 ∥ F 2 + d a 2 . We choose all constants independently of τ \tau τ and the coefficient direction. The parameters d d d and m m m are fixed.
Choose fixed, sufficiently small positive numbers r ∗ , a ∗ , b ∗ r_*,a_*,b_* r ∗ , a ∗ , b ∗ , and consider the following d 2 d^2 d 2 configurations in the interior of the product-uniform support:
W = r ∗ e j , Ψ 1 = b ∗ e j , Ψ a = − b ∗ e j ( a ≥ 2 ) , j = 1 , … , d ; W = r ∗ e j , Ψ 1 = a ∗ e i + b ∗ e j , Ψ a = − b ∗ e j ( a ≥ 2 ) , i ≠ j . \begin{aligned}
W&=r_*e_j,\qquad\Psi_1=b_*e_j,\qquad\Psi_a=-b_*e_j\quad(a\geq2),\qquad j=1,\ldots,d;\\
W&=r_*e_j,\qquad\Psi_1=a_*e_i+b_*e_j,\qquad\Psi_a=-b_*e_j\quad(a\geq2),\qquad i\ne j.
\end{aligned} W W = r ∗ e j , Ψ 1 = b ∗ e j , Ψ a = − b ∗ e j ( a ≥ 2 ) , j = 1 , … , d ; = r ∗ e j , Ψ 1 = a ∗ e i + b ∗ e j , Ψ a = − b ∗ e j ( a ≥ 2 ) , i = j .
At each configuration, action 1 has a fixed positive winning gap. Take sufficiently small, fixed open neighborhoods of these configurations whose closures lie inside the support, and denote their union by E s e p \mathcal{E}_{\mathrm{sep}} E sep . On this union, every gap W T ( Ψ 1 − Ψ a ) W^{\mathsf T}(\Psi_1-\Psi_a) W T ( Ψ 1 − Ψ a ) , a ≥ 2 a\geq2 a ≥ 2 , is bounded below by a common constant g s e p > 0 g_{\mathrm{sep}}>0 g sep > 0 .
For X 0 ( E ) : = Ψ 1 T E W X_0(E):=\Psi_1^{\mathsf T}EW X 0 ( E ) := Ψ 1 T E W , the center measurements are b ∗ r ∗ E j j b_*r_*E_{jj} b ∗ r ∗ E j j and a ∗ r ∗ E i j + b ∗ r ∗ E j j a_*r_*E_{ij}+b_*r_*E_{jj} a ∗ r ∗ E ij + b ∗ r ∗ E j j . They jointly determine every entry of E E E . Hence the quadratic form E [ X 0 ( E ) 2 1 E s e p ] \mathbb{E}[X_0(E)^2 1_{\mathcal{E}_{\mathrm{sep}}}] E [ X 0 ( E ) 2 1 E sep ] is positive definite: if it vanished, positivity of the reference density and continuity would force X 0 ( E ) X_0(E) X 0 ( E ) to vanish on each neighborhood, including at every center, and therefore E = 0 E=0 E = 0 . The diagonal centers similarly show that E [ ( Ψ 1 T e ) 2 1 E s e p ] \mathbb{E}[(\Psi_1^{\mathsf T}e)^2 1_{\mathcal{E}_{\mathrm{sep}}}] E [( Ψ 1 T e ) 2 1 E sep ] is positive definite in e e e . Compactness of the respective unit spheres therefore gives constants λ E , λ e > 0 \lambda_E,\lambda_e>0 λ E , λ e > 0 such that
E [ X 0 ( E ) 2 1 E s e p ] ≥ λ E ∥ E ∥ F 2 , E [ ( Ψ 1 T e ) 2 1 E s e p ] ≥ λ e ∥ e ∥ 2 . (119) \mathbb{E}[X_0(E)^2 1_{\mathcal{E}_{\mathrm{sep}}}]\geq\lambda_E\lVert E\rVert_F^2,\qquad\mathbb{E}[(\Psi_1^{\mathsf T}e)^2 1_{\mathcal{E}_{\mathrm{sep}}}]\geq\lambda_e\lVert e\rVert^2. \tag*{(119)} E [ X 0 ( E ) 2 1 E sep ] ≥ λ E ∥ E ∥ F 2 , E [( Ψ 1 T e ) 2 1 E sep ] ≥ λ e ∥ e ∥ 2 . (119)
All features and W W W are bounded. The uniform winning gap gives
∥ Ψ ˉ τ − Ψ 1 ∥ + ∥ Σ τ ∥ ≤ C e − g s e p / τ on E s e p . (120) \lVert\bar{\Psi}_\tau-\Psi_1\rVert+\lVert\Sigma_\tau\rVert\leq Ce^{-g_{\mathrm{sep}}/\tau}\quad\text{on }\mathcal{E}_{\mathrm{sep}}. \tag*{(120)} ∥ Ψ ˉ τ − Ψ 1 ∥ + ∥ Σ τ ∥ ≤ C e − g sep / τ on E sep . (120)
For example, the total softmax mass outside action 1 is at most ( m − 1 ) e − g s e p / τ (m-1)e^{-g_{\mathrm{sep}}/\tau} ( m − 1 ) e − g sep / τ , which bounds both quantities in (E.15) up to fixed constants. The reverse triangle inequality in the restricted L 2 L^2 L 2 norm, together with (E.14), implies that, for all sufficiently small τ \tau τ ,
E [ X τ 2 1 E s e p ] ≥ λ E 4 ∥ E + ∥ F 2 , E [ Z τ 2 1 E s e p ] ≥ λ e 4 ∥ e + ∥ 2 . (121) \mathbb{E}[X_\tau^2 1_{\mathcal{E}_{\mathrm{sep}}}]\geq\frac{\lambda_E}{4}\lVert E_+\rVert_F^2,\qquad\mathbb{E}[Z_\tau^2 1_{\mathcal{E}_{\mathrm{sep}}}]\geq\frac{\lambda_e}{4}\lVert e_+\rVert^2. \tag*{(121)} E [ X τ 2 1 E sep ] ≥ 4 λ E ∥ E + ∥ F 2 , E [ Z τ 2 1 E sep ] ≥ 4 λ e ∥ e + ∥ 2 . (121)
These estimates hold simultaneously for all coefficient directions, because the L 2 L^2 L 2 approximation errors are bounded by C e − g s e p / τ ∥ E + ∥ F Ce^{-g_{\mathrm{sep}}/\tau}\lVert E_+\rVert_F C e − g sep / τ ∥ E + ∥ F and C e − g s e p / τ ∥ e + ∥ Ce^{-g_{\mathrm{sep}}/\tau}\lVert e_+\rVert C e − g sep / τ ∥ e + ∥ , respectively. Also, (E.15) yields E [ Y τ 2 1 E s e p ] ≤ C s e p e − 2 g s e p / τ ∥ D ∥ F 2 \mathbb{E}[Y_\tau^2 1_{\mathcal{E}_{\mathrm{sep}}}]\leq C_{\mathrm{sep}}e^{-2g_{\mathrm{sep}}/\tau}\lVert D\rVert_F^2 E [ Y τ 2 1 E sep ] ≤ C sep e − 2 g sep / τ ∥ D ∥ F 2 . The elementary inequality ( u + v ) 2 ≥ 1 2 u 2 − v 2 (u+v)^2\geq\frac{1}{2}u^2-v^2 ( u + v ) 2 ≥ 2 1 u 2 − v 2 for u , v ∈ R u,v\in\mathbb{R} u , v ∈ R follows by completing the square. Applying it with u = X τ u=X_\tau u = X τ and v = Y τ v=Y_\tau v = Y τ , and weakening the exponential remainder if necessary, gives
E [ ( X τ + Y τ ) 2 1 E s e p ] ≥ b E ∥ E + ∥ F 2 − C s e p e − g s e p / τ ∥ D ∥ F 2 , b E : = λ E 8 > 0. (122) \mathbb{E}\left[(X_\tau+Y_\tau)^2\mathbf{1}_{\mathcal{E}_{\mathrm{sep}}}\right]\ge b_E\lVert E_+\rVert_F^2-C_{\mathrm{sep}}e^{-g_{\mathrm{sep}}/\tau}\lVert D\rVert_F^2,\qquad b_E:=\frac{\lambda_E}{8}>0. \tag*{(122)} E [ ( X τ + Y τ ) 2 1 E sep ] ≥ b E ∥ E + ∥ F 2 − C sep e − g sep / τ ∥ D ∥ F 2 , b E := 8 λ E > 0. (122)
Let E t i e ( τ ) \mathcal{E}_{\mathrm{tie}}(\tau) E tie ( τ ) be the union of the near-tie charts from part (i). Their bounded densities, fixed bounded coordinate domains, and gap restriction τ ≤ ∣ g ∣ ≤ 2 τ \tau\leq|g|\leq2\tau τ ≤ ∣ g ∣ ≤ 2 τ imply P ( E t i e ( τ ) ) ≤ C t τ \mathbb{P}(\mathcal{E}_{\mathrm{tie}}(\tau))\leq C_t\tau P ( E tie ( τ )) ≤ C t τ . Indeed, each chart contributes at most its upper density bound times its coordinate-domain volume times the gap-interval length 2 τ 2\tau 2 τ ; summing over the finitely many charts gives this bound regardless of overlap. Since ∥ Ψ ‾ τ ∥ , ∥ W ∥ ≤ d \lVert\overline{\Psi}_\tau\rVert,\lVert W\rVert\leq\sqrt{d} ∥ Ψ τ ∥ , ∥ W ∥ ≤ d ,
E [ X τ 2 1 E t i e ( τ ) ] ≤ C X τ ∥ E + ∥ F 2 , C X : = d 2 C t . (123) \mathbb{E}\left[X_\tau^2\mathbf{1}_{\mathcal{E}_{\mathrm{tie}}(\tau)}\right]\leq C_X\tau\lVert E_+\rVert_F^2,\qquad C_X:=d^2C_t. \tag*{(123)} E [ X τ 2 1 E tie ( τ ) ] ≤ C X τ ∥ E + ∥ F 2 , C X := d 2 C t . (123)
Rewrite (E.13), retaining its coefficient-independent constants, as
E [ Y τ 2 1 E t i e ( τ ) ] ≥ b 3 τ 3 ∥ D 0 ∥ F 2 + b 5 τ 5 d a 2 − C t i e e − g 0 / τ ∥ D ∥ F 2 . (124) \mathbb{E}\left[Y_\tau^2\mathbf{1}_{\mathcal{E}_{\mathrm{tie}}(\tau)}\right]\geq b_3\tau^3\lVert D_0\rVert_F^2+b_5\tau^5da^2-C_{\mathrm{tie}}e^{-g_0/\tau}\lVert D\rVert_F^2. \tag*{(124)} E [ Y τ 2 1 E tie ( τ ) ] ≥ b 3 τ 3 ∥ D 0 ∥ F 2 + b 5 τ 5 d a 2 − C tie e − g 0 / τ ∥ D ∥ F 2 . (124)
Apply ( u + v ) 2 ≥ 1 2 u 2 − v 2 (u+v)^2\geq\frac{1}{2}u^2-v^2 ( u + v ) 2 ≥ 2 1 u 2 − v 2 with u = Y τ u=Y_\tau u = Y τ and v = X τ v=X_\tau v = X τ . Equations (E.18) and (E.19) give
E [ ( X τ + Y τ ) 2 1 E t i e ( τ ) ] ≥ b 3 2 τ 3 ∥ D 0 ∥ F 2 + b 5 2 τ 5 d a 2 − C X τ ∥ E + ∥ F 2 − C t i e 2 e − g 0 / τ ∥ D ∥ F 2 . (125) \mathbb{E}\left[(X_\tau+Y_\tau)^2\mathbf{1}_{\mathcal{E}_{\mathrm{tie}}(\tau)}\right]\geq\frac{b_3}{2}\tau^3\lVert D_0\rVert_F^2+\frac{b_5}{2}\tau^5da^2-C_X\tau\lVert E_+\rVert_F^2-\frac{C_{\mathrm{tie}}}{2}e^{-g_0/\tau}\lVert D\rVert_F^2. \tag*{(125)} E [ ( X τ + Y τ ) 2 1 E tie ( τ ) ] ≥ 2 b 3 τ 3 ∥ D 0 ∥ F 2 + 2 b 5 τ 5 d a 2 − C X τ ∥ E + ∥ F 2 − 2 C tie e − g 0 / τ ∥ D ∥ F 2 . (125)
No disjointness of the two regions is needed: their indicators sum to at most two. Consequently,
E [ ( X τ + Y τ ) 2 ] ≥ 1 2 ( E [ ( X τ + Y τ ) 2 1 E s e p ] + E [ ( X τ + Y τ ) 2 1 E t i e ( τ ) ] ) . \mathbb{E}\left[(X_\tau+Y_\tau)^2\right]\geq\frac{1}{2}\left(\mathbb{E}\left[(X_\tau+Y_\tau)^2\mathbf{1}_{\mathcal{E}_{\mathrm{sep}}}\right]+\mathbb{E}\left[(X_\tau+Y_\tau)^2\mathbf{1}_{\mathcal{E}_{\mathrm{tie}}(\tau)}\right]\right). E [ ( X τ + Y τ ) 2 ] ≥ 2 1 ( E [ ( X τ + Y τ ) 2 1 E sep ] + E [ ( X τ + Y τ ) 2 1 E tie ( τ ) ] ) .
Set c = min { g 0 , g s e p } > 0 c=\min\{g_0,g_{\mathrm{sep}}\}>0 c = min { g 0 , g sep } > 0 and C 0 = C s e p / 2 + C t i e / 4 C_0=C_{\mathrm{sep}}/2+C_{\mathrm{tie}}/4 C 0 = C sep /2 + C tie /4 . Combining the two regional lower bounds yields
E [ ( X τ + Y τ ) 2 ] ≥ ( b E 2 − C X τ 2 ) ∥ E + ∥ F 2 + b 3 4 τ 3 ∥ D 0 ∥ F 2 + b 5 4 τ 5 d a 2 − C 0 e − c / τ ( ∥ D 0 ∥ F 2 + d a 2 ) . (126) \mathbb{E}\left[(X_\tau+Y_\tau)^2\right]\geq\left(\frac{b_E}{2}-\frac{C_X\tau}{2}\right)\lVert E_+\rVert_F^2+\frac{b_3}{4}\tau^3\lVert D_0\rVert_F^2+\frac{b_5}{4}\tau^5da^2-C_0e^{-c/\tau}\left(\lVert D_0\rVert_F^2+da^2\right). \tag*{(126)} E [ ( X τ + Y τ ) 2 ] ≥ ( 2 b E − 2 C X τ ) ∥ E + ∥ F 2 + 4 b 3 τ 3 ∥ D 0 ∥ F 2 + 4 b 5 τ 5 d a 2 − C 0 e − c / τ ( ∥ D 0 ∥ F 2 + d a 2 ) . (126)
Choose τ ∗ > 0 \tau_*>0 τ ∗ > 0 smaller than the thresholds used above and in part (i), so that for every 0 < τ ≤ τ ∗ 0<\tau\leq\tau_* 0 < τ ≤ τ ∗ ,
τ ≤ 1 , C X τ ≤ b E 2 , C 0 e − c / τ ≤ min { b 3 , b 5 } 8 τ 5 . (127) \tau\leq1,\qquad C_X\tau\leq\frac{b_E}{2},\qquad C_0e^{-c/\tau}\leq\frac{\min\{b_3,b_5\}}{8}\tau^5. \tag*{(127)} τ ≤ 1 , C X τ ≤ 2 b E , C 0 e − c / τ ≤ 8 min { b 3 , b 5 } τ 5 . (127)
Such a choice exists because e − c / τ / τ 5 → 0 e^{-c/\tau}/\tau^5\to0 e − c / τ / τ 5 → 0 as τ ↓ 0 \tau\downarrow0 τ ↓ 0 . Every quantity used to choose this threshold is independent of e + e_+ e + , E + E_+ E + , and D D D . Using τ 5 ≤ τ 3 \tau^5\leq\tau^3 τ 5 ≤ τ 3 and (E.22) in (E.21) gives
E [ ( X τ + Y τ ) 2 ] ≥ b E 4 ∥ E + ∥ F 2 + b 3 8 τ 3 ∥ D 0 ∥ F 2 + b 5 8 τ 5 d a 2 . (128) \mathbb{E}\left[(X_\tau+Y_\tau)^2\right]\geq\frac{b_E}{4}\lVert E_+\rVert_F^2+\frac{b_3}{8}\tau^3\lVert D_0\rVert_F^2+\frac{b_5}{8}\tau^5da^2. \tag*{(128)} E [ ( X τ + Y τ ) 2 ] ≥ 4 b E ∥ E + ∥ F 2 + 8 b 3 τ 3 ∥ D 0 ∥ F 2 + 8 b 5 τ 5 d a 2 . (128)
The product-uniform law of ( W , Ψ 1 , … , Ψ m ) (W,\Psi_1,\ldots,\Psi_m) ( W , Ψ 1 , … , Ψ m ) is invariant under simultaneous sign reversal. This transformation preserves all softmax logits and Σ τ \Sigma_\tau Σ τ , reverses Ψ ‾ τ \overline{\Psi}_\tau Ψ τ , and makes Z τ Z_\tau Z τ odd while X τ + Y τ X_\tau+Y_\tau X τ + Y τ is even. Therefore E [ Z τ ( X τ + Y τ ) ] = 0 \mathbb{E}[Z_\tau(X_\tau+Y_\tau)]=0 E [ Z τ ( X τ + Y τ )] = 0 , E [ K τ 2 ] = E [ Z τ 2 ] + E [ ( X τ + Y τ ) 2 ] \mathbb{E}[K_\tau^2]=\mathbb{E}[Z_\tau^2]+\mathbb{E}[(X_\tau+Y_\tau)^2] E [ K τ 2 ] = E [ Z τ 2 ] + E [( X τ + Y τ ) 2 ] . The second estimate in (E.16) implies E [ Z τ 2 ] ≥ ( λ e / 4 ) ∥ e + ∥ 2 \mathbb{E}[Z_\tau^2]\geq(\lambda_e/4)\lVert e_+\rVert^2 E [ Z τ 2 ] ≥ ( λ e /4 ) ∥ e + ∥ 2 . Combining this with (E.23) proves
E [ K τ 2 ] ≥ b a t t ( ∥ e + ∥ 2 + ∥ E + ∥ F 2 + τ 3 ∥ D 0 ∥ F 2 + τ 5 d a 2 ) , (129) \mathbb{E}[K_\tau^2]\geq b_{\mathrm{att}}\left(\lVert e_+\rVert^2+\lVert E_+\rVert_F^2+\tau^3\lVert D_0\rVert_F^2+\tau^5da^2\right), \tag*{(129)} E [ K τ 2 ] ≥ b att ( ∥ e + ∥ 2 + ∥ E + ∥ F 2 + τ 3 ∥ D 0 ∥ F 2 + τ 5 d a 2 ) , (129)
where one may take b a t t = min { λ e 4 , b E 4 , b 3 8 , b 5 8 } > 0 b_{\mathrm{att}}=\min\left\{\frac{\lambda_e}{4},\frac{b_E}{4},\frac{b_3}{8},\frac{b_5}{8}\right\}>0 b att = min { 4 λ e , 4 b E , 8 b 3 , 8 b 5 } > 0 . Both b a t t b_{\mathrm{att}} b att and τ ∗ \tau_* τ ∗ are independent of the coefficient direction. They can also be chosen independently of n n n , since all quantities in this argument, including the near-tie construction in part (i), depend only on the same product-uniform marginal of ( W , Ψ 1 , … , Ψ m ) (W,\Psi_1,\ldots,\Psi_m) ( W , Ψ 1 , … , Ψ m ) under every U n U_n U n . □
The proof of Corollary 3. (i) Since B τ , n ( z ) [ ζ ] = 0 B_{\tau,n}(z)[\zeta]=0 B τ , n ( z ) [ ζ ] = 0 , D n D_n D n -a.s. ⟹ ζ = 0 \Longrightarrow\zeta=0 ⟹ ζ = 0 has already been established in Corollary E.2; This step is quantitative only. Lemma E.4 analyzed e + e_+ e + , E + E_+ E + , E A E_A E A , we now incorporate E C E_C E C , e − e_- e − , E − E_- E − .
On the calibration path, let Y : = Φ ( s 0 , a X ) Y:=\Phi(s_0,a_X) Y := Φ ( s 0 , a X ) , R 0 : = R ( a X , s 1 ) R_0:=R(a_X,s_1) R 0 := R ( a X , s 1 ) , Z Y : = Y Y ⊤ − 1 3 I d Z_Y:=YY^\top-\frac{1}{3}I_d Z Y := Y Y ⊤ − 3 1 I d , and v τ : = W ⊤ Ψ ‾ τ v_\tau:=W^\top\overline{\Psi}_\tau v τ := W ⊤ Ψ τ . Conditional on all variables other than Y Y Y and R 0 R_0 R 0 , the observable response can be written as
n B τ , n ( z ω n ) [ ζ ] = R 0 A r ( Y ) + A 0 ( Y ) + A 2 ( Y ) + A c o n s t . (130) nB_{\tau,n}(z_{\omega_n})[\zeta]=R_0A_r(Y)+A_0(Y)+A_2(Y)+A_{\mathrm{const}}. \tag*{(130)} n B τ , n ( z ω n ) [ ζ ] = R 0 A r ( Y ) + A 0 ( Y ) + A 2 ( Y ) + A const . (130)
where A r ( Y ) = [ E C + ( e q ⊤ W ) I d ] Y A_r(Y) = [E_C + (e_q^\top W)I_d]Y A r ( Y ) = [ E C + ( e q ⊤ W ) I d ] Y , A o ( Y ) = γ v τ E C Y + K τ Y A_o(Y) = \gamma v_\tau E_CY + K_\tau Y A o ( Y ) = γ v τ E C Y + K τ Y , A 2 ( Y ) = − E C Z Y W + Z Y ( e − + E − W ) A_2(Y) = -E_CZ_YW + Z_Y(e_- + E_-W) A 2 ( Y ) = − E C Z Y W + Z Y ( e − + E − W ) , and A c o n s t = 1 3 ( − E C W + e − + E − W ) + A l a t e r A_{\mathrm{const}} = \frac{1}{3}(-E_CW + e_- + E_-W) + A_{\mathrm{later}} A const = 3 1 ( − E C W + e − + E − W ) + A later . Here A l a t e r A_{\mathrm{later}} A later is the sum of the contributions from transitions 1 , … , n − 1 1,\ldots,n-1 1 , … , n − 1 , and is zero when n = 1 n=1 n = 1 .
The calibration path has s 0 ≠ s 1 s_0 \ne s_1 s 0 = s 1 , and all later transitions use features associated with s 1 s_1 s 1 . Hence, under the product reference law, A l a t e r A_{\mathrm{later}} A later is independent of Y = Φ ( s 0 , a x ) Y = \Phi(s_0,a_x) Y = Φ ( s 0 , a x ) and of R 0 R_0 R 0 . Thus A c o n s t A_{\mathrm{const}} A const is constant with respect to the conditional variables ( Y , R 0 ) (Y,R_0) ( Y , R 0 ) .
The four terms in (E.25) are mutually orthogonal in L 2 ( Y , R 0 ) L^2(Y,R_0) L 2 ( Y , R 0 ) . Indeed, E R 0 = 0 \mathbb{E}R_0 = 0 E R 0 = 0 and R 0 R_0 R 0 independent on Y Y Y ; A o A_o A o is odd in Y Y Y , i.e., A o ( − Y ) = − A o ( Y ) A_o(-Y) = -A_o(Y) A o ( − Y ) = − A o ( Y ) ; Since Z − Y = Z Y Z_{-Y} = Z_Y Z − Y = Z Y , A 2 A_2 A 2 is even in Y Y Y and centered because E Z Y = 0 \mathbb{E}Z_Y = 0 E Z Y = 0 ; and A c o n s t A_{\mathrm{const}} A const is constant in ( Y , R 0 ) (Y,R_0) ( Y , R 0 ) . Odd and even functions are orthogonal under symmetric distributions. In particular, later transitions cannot cancel any of the first three components.
The uniform moments satisfy E [ Y Y ⊤ ] = E [ W W ⊤ ] = 1 3 I d \mathbb{E}[YY^\top] = \mathbb{E}[WW^\top] = \frac{1}{3}I_d E [ Y Y ⊤ ] = E [ W W ⊤ ] = 3 1 I d , E R 0 2 = 1 3 \mathbb{E}R_0^2 = \frac{1}{3} E R 0 2 = 3 1 , and E Z Y 2 = ν I d \mathbb{E}Z_Y^2 = \nu I_d E Z Y 2 = ν I d , ν : = 5 d − 1 45 > 0 \nu:= \frac{5d-1}{45} > 0 ν := 45 5 d − 1 > 0 . For the reward projection,
E ∥ R 0 A r ( Y ) ∥ 2 = 1 9 E ∥ E C + ( e q ⊤ W ) I d ∥ F 2 = 1 9 ∥ E C ∥ F 2 + d 27 ∥ e q ∥ 2 , (131) \mathbb{E}\lVert R_0A_r(Y)\rVert^2 = \frac{1}{9}\mathbb{E}\lVert E_C + (e_q^\top W)I_d\rVert_F^2 = \frac{1}{9}\lVert E_C\rVert_F^2 + \frac{d}{27}\lVert e_q\rVert^2, \tag*{(131)} E ∥ R 0 A r ( Y ) ∥ 2 = 9 1 E ∥ E C + ( e q ⊤ W ) I d ∥ F 2 = 9 1 ∥ E C ∥ F 2 + 27 d ∥ e q ∥ 2 , (131)
where the cross term vanishes because E W = 0 \mathbb{E}W = 0 E W = 0 .
For 0 < δ < 1 0 < \delta< 1 0 < δ < 1 , we use ∥ x + y ∥ 2 ≥ δ ∥ y ∥ 2 − δ 1 − δ ∥ x ∥ 2 \lVert x+y\rVert^2 \ge\delta\lVert y\rVert^2 - \frac{\delta}{1-\delta}\lVert x\rVert^2 ∥ x + y ∥ 2 ≥ δ ∥ y ∥ 2 − 1 − δ δ ∥ x ∥ 2 . Since ∣ v τ ∣ ≤ d \lvert v_\tau\rvert\le d ∣ v τ ∣ ≤ d ,
E ∥ A o ( Y ) ∥ 2 ≥ δ o d 3 E K τ 2 − δ o 1 − δ o γ 2 d 2 3 ∥ E C ∥ F 2 . (132) \mathbb{E}\lVert A_o(Y)\rVert^2 \ge\frac{\delta_o d}{3}\mathbb{E}K_\tau^2 - \frac{\delta_o}{1-\delta_o}\frac{\gamma^2d^2}{3}\lVert E_C\rVert_F^2. \tag*{(132)} E ∥ A o ( Y ) ∥ 2 ≥ 3 δ o d E K τ 2 − 1 − δ o δ o 3 γ 2 d 2 ∥ E C ∥ F 2 . (132)
Moreover, Z Y e − Z_Ye_- Z Y e − is orthogonal to the terms linear in the centered variable W W W . Using E ∥ Z Y E − W ∥ 2 = ν 3 ∥ E − ∥ F 2 \mathbb{E}\lVert Z_YE_-W\rVert^2 = \frac{\nu}{3}\lVert E_-\rVert_F^2 E ∥ Z Y E − W ∥ 2 = 3 ν ∥ E − ∥ F 2 , E ∥ E C Z Y W ∥ 2 = ν 3 ∥ E C ∥ F 2 \mathbb{E}\lVert E_CZ_YW\rVert^2 = \frac{\nu}{3}\lVert E_C\rVert_F^2 E ∥ E C Z Y W ∥ 2 = 3 ν ∥ E C ∥ F 2 , we obtain
E ∥ A 2 ( Y ) ∥ 2 ≥ ν ∥ e − ∥ 2 + δ 2 ν 3 ∥ E − ∥ F 2 − δ 2 1 − δ 2 ν 3 ∥ E C ∥ F 2 . (133) \mathbb{E}\lVert A_2(Y)\rVert^2 \ge\nu\lVert e_-\rVert^2 + \frac{\delta_2\nu}{3}\lVert E_-\rVert_F^2 - \frac{\delta_2}{1-\delta_2}\frac{\nu}{3}\lVert E_C\rVert_F^2. \tag*{(133)} E ∥ A 2 ( Y ) ∥ 2 ≥ ν ∥ e − ∥ 2 + 3 δ 2 ν ∥ E − ∥ F 2 − 1 − δ 2 δ 2 3 ν ∥ E C ∥ F 2 . (133)
Choose δ o = min { 1 2 , 1 48 γ 2 d 2 } \delta_o = \min\left\{\frac{1}{2},\frac{1}{48\gamma^2d^2}\right\} δ o = min { 2 1 , 48 γ 2 d 2 1 } , δ 2 = min { 1 2 , 1 48 } \delta_2 = \min\left\{\frac{1}{2},\frac{1}{48}\right\} δ 2 = min { 2 1 , 48 1 } . Since δ / ( 1 − δ ) ≤ 2 δ \delta/(1-\delta) \le2\delta δ / ( 1 − δ ) ≤ 2 δ for δ ≤ 1 / 2 \delta\le1/2 δ ≤ 1/2 , each negative coefficient multiplying ∥ E C ∥ F 2 \lVert E_C\rVert_F^2 ∥ E C ∥ F 2 in (E.27) and (E.28) is at most 1 / 72 1/72 1/72 . Hence the coefficient 1 / 9 1/9 1/9 in (E.26) retains at least 1 12 \frac{1}{12} 12 1 . Combining the orthogonal decomposition, (E.4), (E.26), (E.27), and (E.28), there exists b r e f > 0 b_{\mathrm{ref}} > 0 b ref > 0 , independent of n n n , τ \tau τ , and ζ \zeta ζ , such that for all sufficiently small 0 < τ ≤ 1 0 < \tau\le1 0 < τ ≤ 1 ,
E U n ∥ B τ , n ( z ω n ) [ ζ ] ∥ 2 2 ≥ b r e f n 2 ( ∥ E C ∥ F 2 + ∥ e q ∥ 2 + ∥ e − ∥ 2 + ∥ E − ∥ F 2 + ∥ e + ∥ 2 + ∥ E + ∥ F 2 + τ 3 ∥ D 0 ∥ F 2 + τ 5 d a 2 ) . (134) \mathbb{E}_{U_n}\lVert B_{\tau,n}(z_{\omega_n})[\zeta]\rVert_2^2 \ge\frac{b_{\mathrm{ref}}}{n^2}\left(\lVert E_C\rVert_F^2 + \lVert e_q\rVert^2 + \lVert e_-\rVert^2 + \lVert E_-\rVert_F^2 + \lVert e_+\rVert^2 + \lVert E_+\rVert_F^2 + \tau^3\lVert D_0\rVert_F^2 + \tau^5 d a^2\right). \tag*{(134)} E U n ∥ B τ , n ( z ω n ) [ ζ ] ∥ 2 2 ≥ n 2 b ref ( ∥ E C ∥ F 2 + ∥ e q ∥ 2 + ∥ e − ∥ 2 + ∥ E − ∥ F 2 + ∥ e + ∥ 2 + ∥ E + ∥ F 2 + τ 3 ∥ D 0 ∥ F 2 + τ 5 d a 2 ) . (134)
Since ∥ D ∥ F 2 = ∥ D 0 ∥ F 2 + d a 2 \lVert D\rVert_F^2 = \lVert D_0\rVert_F^2 + da^2 ∥ D ∥ F 2 = ∥ D 0 ∥ F 2 + d a 2 and 0 < τ ≤ 1 0 < \tau\le1 0 < τ ≤ 1 , the right-hand side is bounded below by b r e f n 2 τ 5 ∥ ζ ∥ 2 \frac{b_{\mathrm{ref}}}{n^2}\tau^5\lVert\zeta\rVert^2 n 2 b ref τ 5 ∥ ζ ∥ 2 . Using Lemma E.3 ,
E D n ∥ B τ , n ( z ) [ ζ ] ∥ 2 2 ≥ p n b r e f n 2 τ 5 ∥ ζ ∥ 2 . (135) \mathbb{E}_{D_n}\lVert B_{\tau,n}(z)[\zeta]\rVert_2^2 \ge\frac{p_n b_{\mathrm{ref}}}{n^2}\tau^5\lVert\zeta\rVert^2. \tag*{(135)} E D n ∥ B τ , n ( z ) [ ζ ] ∥ 2 2 ≥ n 2 p n b ref τ 5 ∥ ζ ∥ 2 . (135)
Therefore χ τ , n ≥ p n b r e f n 2 τ 5 \chi_{\tau,n} \ge\frac{p_n b_{\mathrm{ref}}}{n^2}\tau^5 χ τ , n ≥ n 2 p n b ref τ 5 . By Lemma D.2 , κ ( τ , n ) ≥ c Ω p n b r e f n 2 τ 5 \kappa(\tau,n) \ge c_\Omega\frac{p_n b_{\mathrm{ref}}}{n^2}\tau^5 κ ( τ , n ) ≥ c Ω n 2 p n b ref τ 5 . Since N \mathcal{N} N is finite, c e x p : = c Ω b r e f min n ∈ N p n n 2 > 0 c_{\mathrm{exp}} := c_\Omega b_{\mathrm{ref}}\min_{n\in\mathcal{N}}\frac{p_n}{n^2} > 0 c exp := c Ω b ref min n ∈ N n 2 p n > 0 , and hence κ ( τ ) ≥ c e x p τ 5 \kappa(\tau) \ge c_{\mathrm{exp}}\tau^5 κ ( τ ) ≥ c exp τ 5 , n ∈ N n \in\mathcal{N} n ∈ N .
(ii) For the upper bound, it suffices to exhibit a single unit normal direction whose response is O ( τ 5 ) O(\tau^5) O ( τ 5 ) . Consider the pure scalar attention perturbation U s c = ( I d d , 0 , … , 0 ) U_{\mathrm{sc}} = \left(\frac{I_d}{\sqrt d},0,\ldots,0\right) U sc = ( d I d , 0 , … , 0 ) . Every tangent vector to M τ \mathcal{M}_\tau M τ has zero A A A -block, so U s c ∈ N θ ˉ M τ U_{\mathrm{sc}} \in N_{\bar{\theta}}\mathcal{M}_\tau U sc ∈ N θ ˉ M τ at every θ ˉ ∈ M τ \bar{\theta} \in\mathcal{M}_\tau θ ˉ ∈ M τ , and ∥ U s c ∥ = 1 \lVert U_{\mathrm{sc}}\rVert= 1 ∥ U sc ∥ = 1 .
For a fixed successor state, define g a b = W ⊤ ( Ψ a − Ψ b ) g_{ab} = W^\top(\Psi_a - \Psi_b) g ab = W ⊤ ( Ψ a − Ψ b ) . This random variable has a uniformly bounded density. Conditional on W ≠ 0 W \ne0 W = 0 , let M W : = max j ∣ W j ∣ M_W := \max_j\lvert W_j\rvert M W := max j ∣ W j ∣ and choose a coordinate attaining this maximum. Since the difference of two independent Unif ( − 1 , 1 ) \operatorname{Unif}(-1,1) Unif ( − 1 , 1 ) variables has density bounded by 1 / 2 1/2 1/2 , convolution with the remaining independent coordinates yields ∥ f g a b ∣ W ∥ ∞ ≤ 1 2 M W \lVert f_{g_{ab}\mid W}\rVert_\infty\le\frac{1}{2M_W} ∥ f g ab ∣ W ∥ ∞ ≤ 2 M W 1 . Furthermore, P ( M W ≤ t ) = t d \mathbb{P}(M_W \le t) = t^d P ( M W ≤ t ) = t d , E M W − 1 = d d − 1 \mathbb{E}M_W^{-1} = \frac{d}{d-1} E M W − 1 = d − 1 d , so, because d ≥ 2 d \ge2 d ≥ 2 , ∥ f g a b ∥ ∞ ≤ d 2 ( d − 1 ) < ∞ \lVert f_{g_{ab}}\rVert_\infty\le\frac{d}{2(d-1)} < \infty ∥ f g ab ∥ ∞ ≤ 2 ( d − 1 ) d < ∞ .
Set V τ : = W ⊤ Σ τ W V_\tau:= W^\top\Sigma_\tau W V τ := W ⊤ Σ τ W . The pairwise covariance identity gives V τ = ∑ a < b π a τ π b τ g a b 2 V_\tau= \sum_{a<b}\pi_a^\tau\pi_b^\tau g_{ab}^2 V τ = ∑ a < b π a τ π b τ g ab 2 . Moreover, π a τ π b τ ≤ e − ∣ g a b ∣ / τ \pi_a^\tau\pi_b^\tau\le e^{-\lvert g_{ab}\rvert/\tau} π a τ π b τ ≤ e − ∣ g ab ∣ / τ . Indeed, if the larger of the two logits is q a q_a q a , the softmax denominator is at least e 2 q a / τ e^{2q_a/\tau} e 2 q a / τ after multiplying the two probabilities. Let P m : = m ( m − 1 ) / 2 P_m := m(m-1)/2 P m := m ( m − 1 ) /2 . By Cauchy–Schwarz,
E V τ 2 ≤ P m ∑ a < b E [ g a b 4 e − 2 ∣ g a b ∣ / τ ] ≤ 2 L d P m 2 ∫ 0 ∞ x 4 e − 2 x / τ d x = C V τ 5 , (136) \mathbb{E}V_\tau^2 \leq P_m \sum_{a<b}\mathbb{E}\left[g_{ab}^4 e^{-2|g_{ab}|/\tau}\right] \leq2L_dP_m^2\int_0^\infty x^4e^{-2x/\tau}\,\mathrm{d}x = C_V\tau^5, \tag*{(136)} E V τ 2 ≤ P m a < b ∑ E [ g ab 4 e − 2∣ g ab ∣/ τ ] ≤ 2 L d P m 2 ∫ 0 ∞ x 4 e − 2 x / τ d x = C V τ 5 , (136)
where C V < ∞ C_V < \infty C V < ∞ depends only on d d d and m m m .
Direct differentiation in the direction U s c U_{\mathrm{sc}} U sc gives J θ ˉ ( z ) [ U s c ] = α γ n d ∑ i = 0 n − 1 ϕ i V τ , i J_{\bar{\theta}}(z)[U_{\mathrm{sc}}] = \frac{\alpha\gamma}{n\sqrt{d}}\sum_{i=0}^{n-1}\phi_iV_{\tau,i} J θ ˉ ( z ) [ U sc ] = n d α γ ∑ i = 0 n − 1 ϕ i V τ , i . Using convexity of the squared norm and ∥ ϕ i ∥ 2 ≤ d \lVert\phi_i\rVert^2 \leq d ∥ ϕ i ∥ 2 ≤ d ,
E ∥ J θ ˉ ( z ) [ U s c ] ∥ 2 ≤ α 2 γ 2 n ∑ i = 0 n − 1 E V τ , i 2 . \mathbb{E}\lVert J_{\bar{\theta}}(z)[U_{\mathrm{sc}}]\rVert^2 \leq\frac{\alpha^2\gamma^2}{n}\sum_{i=0}^{n-1}\mathbb{E}V_{\tau,i}^2. E ∥ J θ ˉ ( z ) [ U sc ] ∥ 2 ≤ n α 2 γ 2 i = 0 ∑ n − 1 E V τ , i 2 .
The visited successor state may depend on the task, so we do not condition on it. If V τ ( s ) V_\tau(s) V τ ( s ) denotes the same scalar covariance computed using the feature table at a fixed state s s s , then
E V τ , i 2 = ∑ s ∈ S E [ 1 { s i + 1 = s } V τ ( s ) 2 ] ≤ ∑ s ∈ S E V τ ( s ) 2 ≤ N s C V τ 5 . \mathbb{E}V_{\tau,i}^2 = \sum_{s\in\mathcal{S}}\mathbb{E}\left[\mathbf{1}_{\{s_{i+1}=s\}}V_\tau(s)^2\right] \leq\sum_{s\in\mathcal{S}}\mathbb{E}V_\tau(s)^2 \leq N_sC_V\tau^5. E V τ , i 2 = s ∈ S ∑ E [ 1 { s i + 1 = s } V τ ( s ) 2 ] ≤ s ∈ S ∑ E V τ ( s ) 2 ≤ N s C V τ 5 .
Therefore E ∥ J θ ˉ ( z ) [ U s c ] ∥ 2 ≤ α 2 γ 2 N s C V τ 5 \mathbb{E}\lVert J_{\bar{\theta}}(z)[U_{\mathrm{sc}}]\rVert^2 \leq\alpha^2\gamma^2N_sC_V\tau^5 E ∥ J θ ˉ ( z ) [ U sc ] ∥ 2 ≤ α 2 γ 2 N s C V τ 5 . Since κ ( τ ) \kappa(\tau) κ ( τ ) is the minimum squared response over unit normal directions, κ ( τ , n ) ≤ C exp τ 5 \kappa(\tau,n) \leq C_{\exp}\tau^5 κ ( τ , n ) ≤ C e x p τ 5 , C exp : = α 2 γ 2 N s C V C_{\exp}:=\alpha^2\gamma^2N_sC_V C e x p := α 2 γ 2 N s C V , uniformly over all n ≥ 1 n\geq1 n ≥ 1 .
Finally, by the uniform local derivative bounds established in Lemma D.4 , the same admissible step size η \eta η may be used throughout the small-temperature regime. Applying the parameter-distance complexity result of Theorem 2 and substituting κ ( τ ) = Θ ( τ 5 ) \kappa(\tau)=\Theta(\tau^5) κ ( τ ) = Θ ( τ 5 ) yields sup θ 0 ∈ A τ K G D ( ϵ ; θ 0 , τ , n ) = Θ Ω , N ( 1 η τ 5 log 1 ϵ ) \sup_{\theta^0\in\mathcal{A}_\tau}K_{\mathrm{GD}}(\epsilon;\theta^0,\tau,n)=\Theta_{\Omega,N}\left(\frac{1}{\eta\tau^5}\log\frac{1}{\epsilon}\right) sup θ 0 ∈ A τ K GD ( ϵ ; θ 0 , τ , n ) = Θ Ω , N ( η τ 5 1 log ϵ 1 ) .