Introduction
Reinforcement learning (RL) studies how an agent learns to make decisions through interaction with an environment to maximize cumulative reward [40 ] . In conventional RL, this adaptation typically involves updating the parameters of a policy or value network from collected experience. More recently, with the growing ability of sequence models to use long interaction histories, in-context reinforcement learning (ICRL) has emerged as a different mode of adaptation: a pretrained agent can improve on a new task by conditioning on its interaction history while keeping its model parameters fixed [29 ] . In-context RL has demonstrated strong empirical success across a range of domains including navigation, continuous-control tasks, and open-ended embodied environments [8 , 3 , 28 , 13 ] .
The empirical success naturally raises the question of why ICRL can adapt to unseen tasks using context. Recent theoretical work interprets ICRL as the Transformer forward pass executing an implicit RL algorithm, and can be divided into supervised pretraining and reinforcement pretraining . Under supervised pretraining, theoretical results show that Transformers can implement a range of classical RL algorithms [22 , 23 , 27 , 25 , 6 ] . Under reinforcement pretraining, both linear and softmax Transformers can provably implement TD-style updates, with the corresponding computation emerging from policy-evaluation pretraining (Wang et al., 2025a,b; Xie et al., 2026b,a).
However, identifying the algorithm implemented in context does not reveal how much information must be retained to reproduce its update process. Existing in-context RL theory typically retains the full interaction history in the prompt. In several representative theoretical constructions, states or state–action pairs along a trajectory are represented using either one-hot embeddings in tabular settings [27 , 44 ] , or more general d d d -dimensional feature maps, such as ϕ : S → R d \phi:\mathcal{S}\to\mathbb{R}^{d} ϕ : S → R d [43 , 25 , 48 ] . Consequently, for a trajectory of N N N transitions { ( s t , a t , r t , s t + 1 ) } t = 1 N \{(s_t,a_t,r_t,s_{t+1})\}_{t=1}^{N} {( s t , a t , r t , s t + 1 ) } t = 1 N , the task-specific memory of these constructions scales as Θ ( d N ) \Theta(dN) Θ ( d N ) . Such linear growth with the interaction horizon can become a substantial bottleneck in long-horizon or high-dimensional RL problems, as storing and processing an ever-growing context incurs increasing inference-time memory and computational costs. Existing constructions therefore establish that retaining the full interaction history is sufficient, but leave open whether it is necessary. Taking TD learning for policy evaluation as a canonical example, this raises two natural questions:
(Q1) Necessary context requirement: What is the minimum context dimension, and the corresponding memory requirement, needed to exactly reproduce the TD iterates?
(Q2) Approximation with limited context: When the available context dimension falls below this threshold, what is the best achievable approximation error?
To answer these questions, we consider a trajectory D N = { ( s t , a t , r t , s t + 1 ) } t = 1 N D_N=\{(s_t,a_t,r_t,s_{t+1})\}_{t=1}^{N} D N = {( s t , a t , r t , s t + 1 ) } t = 1 N collected under a fixed policy, and n n n is the state number. Then we study the exact context required to preserve these iterates and the approximation error when the available context is limited. Our main contributions are as follows.
Context complexity. We characterize the intrinsic context dimension required for in-context TD learning. With a shared linear decoder, we show that the minimum context dimension required to exactly reproduce L L L empirical TD iterates is the Krylov dimension k L k_L k L [38 ] . When the available context dimension m m m falls below this threshold, we further characterize the best achievable approximation and establish matching upper and lower error bounds of order Θ ( γ m max { 1 , 1 / ( m ( 1 − γ ) ) } ) \Theta(\gamma^m\max\{1,1/(m(1-\gamma))\}) Θ ( γ m max { 1 , 1/ ( m ( 1 − γ ))}) .
Memory complexity. We distinguish context dimension, peak memory, and retained task memory. For representations with encoders continuous in empirical model, we characterize the minimum retained memory required to answer all state–depth TD queries exactly as Θ ( n k L ) \Theta(nk_L) Θ ( n k L ) real registers2 ^2 2 . On a sampled task of full exact rank but small numerical rank, a context accurate to 10 − 2 10^{-2} 1 0 − 2 retains 88.7% less memory than the sparse TD statistics. We further show that the optimal retained memory for answering all state–depth queries within error ϵ \epsilon ϵ is Θ γ ( n min { n , L , log ( 1 / ϵ ) } log ( 1 / ϵ ) ) \Theta_{\gamma}(n\min\{n,L,\log(1/\epsilon)\}\log(1/\epsilon)) Θ γ ( n min { n , L , log ( 1/ ϵ )} log ( 1/ ϵ )) bits.
Learnability and experiment. Finally, we study whether the compressed TD computation can be learned through pretraining. Under suitable task diversity, we show that an auxiliary objective is globally strongly convex in the effective attention parameters and provide provable global convergence to the target TD update. Extensive experiments further validate parameter recovery, the predicted context–accuracy tradeoff, and substantial memory savings.
To the best of our knowledge, we are the first to characterize the context and memory requirements for preserving an in-context RL computation, as well as the approximation error below the exact-representation threshold. We require recovery across all TD depths, rather than only the terminal output, because our goal is to reproduce the algorithmic computation itself rather than merely its final result. Unlike classical compression methods, we realize the compression end-to-end within a fixed-parameter linear-attention network operating directly on raw transitions. Table 1 compares our work with existing ICRL constructions.
Table 1. Constructions that execute TD policy evaluation in the forward pass. N , n , d , L N,n,d,L N , n , d , L denote transitions, states, feature dimension, and TD depth; k L = dim K L ( P ^ , r ^ ) k_L = \dim\mathcal{K}_L(\widehat{P},\hat{r}) k L = dim K L ( P , r ^ ) . Theory counts task scalars; buffers are float32 array bytes/1024 over 100 encodings at N = 2000 N=2000 N = 2000 , n = d = 24 n=d=24 n = d = 24 , L = 30 L=30 L = 30 , k L = 12 k_L=12 k L = 12 , excluding parameters and forward scratch. Constructions for other in-context RL problems ([27 , 6 , 25 ] ) retain different objects and are listed in Appendix § 16 as not comparable.
Related Work
Theoretical Mechanisms of In-Context Reinforcement Learning. Recent theory studies ICRL by viewing the Transformer forward pass as implementing an RL algorithm. Under supervised pre-training, Lin et al. [27 ] construct Transformers that approximate classical online decision-making algorithms, while Liang & Lai [25 ] extend this perspective to SARSA and actor–critic, and Chen et al. [6 ] analyze strategies for non-stationary RL. Without explicitly supervising the internal update rule, Wang et al. [43 ] show that linear-attention Transformers can implement TD updates, and Wang et al. [44 ] characterize parameters realizing such computations as global minimizers of a pretraining objective. Xie et al. [48 ] extend the mechanism to standard softmax attention, whereas Xie et al. [47 ] interpret chain-of-thought generation as repeated TD computation.
Reinforcement Learning and Traditional Compression. Reinforcement learning studies sequential decision making through interaction with an environment, with classical methods including temporal-difference learning, Q-learning, and policy-gradient methods ([39 , 45 , 46 ] ). For TD policy evaluation, classical compression replaces raw trajectories with sufficient statistics, as in LSTD and iLSTD ([5 , 4 , 11 , 19 ] ), and Krylov subspaces also arise in value approximation and model reduction ([32 , 33 , 34 ] ). Classical model-reduction methods provide a variety of low-dimensional representations for dynamical and Markov systems ([15 , 9 , 1 , 20 , 12 ] ). Unlike classical compression methods, we characterize the context needed for TD evaluation and realize the compression end-to-end within a fixed-parameter linear-attention network operating directly on raw transitions.
Context Compression. Context compression has been widely studied to reduce the computational and memory costs of models. Existing approaches either compress long contexts into compact learned representations ([37 , 30 , 7 , 10 ] (Zhang et al. 2025)), or reduce the input through token/segment selection and retrieval compression ([24 , 17 , 18 , 31 , 49 ] ). In contrast, we characterize the memory–accuracy limits of in-context TD compression and realize them directly from raw transitions with fixed-parameter attention.
Preliminaries
Reinforcement Learning Setting. We consider an infinite-horizon discounted Markov decision process (MDP) with finite4 state space S = [ n ] S=[n] S = [ n ] , action space A A A , transition kernel P M D P ( s ′ ∣ s , a ) P_{\mathrm{MDP}}(s' \mid s,a) P MDP ( s ′ ∣ s , a ) , reward function r M D P ( s , a ) r_{\mathrm{MDP}}(s,a) r MDP ( s , a ) , and discount factor γ ∈ [ 0 , 1 ) \gamma\in[0,1) γ ∈ [ 0 , 1 ) ([36 ] ). For a fixed policy π \pi π , the MDP induces a Markov reward process (MRP) with transition matrix P π ∈ R n × n P^\pi\in\mathbb{R}^{n \times n} P π ∈ R n × n and expected one-step reward vector r π ∈ R n r^\pi\in\mathbb{R}^n r π ∈ R n , where P i j π : = ∑ a ∈ A π ( a ∣ i ) P M D P ( j ∣ i , a ) P^\pi_{ij}:=\sum_{a\in A}\pi(a\mid i)P_{\mathrm{MDP}}(j\mid i,a) P ij π := ∑ a ∈ A π ( a ∣ i ) P MDP ( j ∣ i , a ) and r i π : = ∑ a ∈ A π ( a ∣ i ) r M D P ( i , a ) r^\pi_i:=\sum_{a\in A}\pi(a\mid i)r_{\mathrm{MDP}}(i,a) r i π := ∑ a ∈ A π ( a ∣ i ) r MDP ( i , a ) . The policy-evaluation problem is to estimate the value function v π ( i ) : = E π [ ∑ t = 0 ∞ γ t R t + 1 ∣ S 0 = i ] v^\pi(i) := \mathbb{E}_\pi\left[\sum_{t=0}^{\infty}\gamma^t R_{t+1}\mid S_0=i\right] v π ( i ) := E π [ ∑ t = 0 ∞ γ t R t + 1 ∣ S 0 = i ] . Temporal-difference (TD) learning estimates this value function by bootstrapping from consecutive transitions [39 , 40 ] . In general, a single TD(0) update takes the form v t + 1 = v t + α t ( R t + 1 + γ v t ( S t + 1 ) − v t ( S t ) ) ∇ v t v t ( S t ) v_{t+1}=v_t+\alpha_t\left(R_{t+1}+\gamma v_t(S_{t+1})-v_t(S_t)\right)\nabla_{v_t}v_t(S_t) v t + 1 = v t + α t ( R t + 1 + γ v t ( S t + 1 ) − v t ( S t ) ) ∇ v t v t ( S t ) . In the remainder of the paper, we therefore work directly with the induced MRP and focus on the corresponding TD-learning dynamics for fixed-policy evaluation. Let D N = { ( S t , A t , R t + 1 , S t + 1 ) } t = 0 N − 1 D_N=\{(S_t,A_t,R_{t+1},S_{t+1})\}_{t=0}^{N-1} D N = {( S t , A t , R t + 1 , S t + 1 ) } t = 0 N − 1 contain N N N transitions collected under π \pi π . We define N i : = ∑ t = 0 N − 1 1 { S t = i } N_i:=\sum_{t=0}^{N-1}\mathbf{1}\{S_t=i\} N i := ∑ t = 0 N − 1 1 { S t = i } and N i j : = ∑ t = 0 N − 1 1 { S t = i , S t + 1 = j } N_{ij}:=\sum_{t=0}^{N-1}\mathbf{1}\{S_t=i,S_{t+1}=j\} N ij := ∑ t = 0 N − 1 1 { S t = i , S t + 1 = j } , then assume full state coverage , i.e., N i > 0 N_i>0 N i > 0 for all i ∈ [ n ] i\in[n] i ∈ [ n ] . Appendix A.1 discusses the rationale for this assumption. The empirical transition and reward estimates are P ^ i j : = N i j N i \widehat{P}_{ij}:=\frac{N_{ij}}{N_i} P ij := N i N ij and r ^ i : = 1 N i ∑ t : S t = i R t + 1 \widehat{r}_i:=\frac{1}{N_i}\sum_{t:S_t=i}R_{t+1} r i := N i 1 ∑ t : S t = i R t + 1 . For a value vector v ∈ R n v\in\mathbb{R}^n v ∈ R n , define the empirical TD error δ ^ t ( v ) : = R t + 1 + γ v ( S t + 1 ) − v ( S t ) \widehat{\delta}_t(v):=R_{t+1}+\gamma v(S_{t+1})-v(S_t) δ t ( v ) := R t + 1 + γ v ( S t + 1 ) − v ( S t ) and the empirical state-visitation matrix D ^ N : = diag ( N 1 N , … , N n N ) \widehat{D}_N:=\operatorname{diag}\left(\frac{N_1}{N},\ldots,\frac{N_n}{N}\right) D N := diag ( N N 1 , … , N N n ) . Starting from v ^ 0 = 0 \widehat{v}_0=0 v 0 = 0 , let v ^ ℓ ∈ R n \widehat{v}_\ell\in\mathbb{R}^n v ℓ ∈ R n denote the empirical value estimate after ℓ \ell ℓ iterations of visitation-normalized batch TD(0) [52 ] :
v ^ ℓ + 1 = v ^ ℓ + D ^ N − 1 1 N ∑ t = 0 N − 1 δ ^ t ( v ^ ℓ ) e S t = ∑ j = 0 ℓ ( γ P ^ ) j r ^ . (1) \widehat{v}_{\ell+1}=\widehat{v}_\ell+\widehat{D}_N^{-1}\frac{1}{N}\sum_{t=0}^{N-1}\widehat{\delta}_t(\widehat{v}_\ell)e_{S_t}=\sum_{j=0}^{\ell}(\gamma\widehat{P})^j\widehat{r}. \tag*{(1)} v ℓ + 1 = v ℓ + D N − 1 N 1 t = 0 ∑ N − 1 δ t ( v ℓ ) e S t = j = 0 ∑ ℓ ( γ P ) j r . (1)
Therefore, letting A ^ : = γ P ^ \widehat{A}:=\gamma\widehat{P} A := γ P , reproducing the first L L L TD iterates amounts to preserving the successive directions r ^ , A ^ r ^ , … , A ^ L − 1 r ^ \widehat{r},\widehat{A}\widehat{r},\ldots,\widehat{A}^{L-1}\widehat{r} r , A r , … , A L − 1 r . This motivates the Krylov space [38 ]
K L ( A ^ , r ^ ) : = span { r ^ , A ^ r ^ , … , A ^ L − 1 r ^ } , k L : = dim K L ( A ^ , r ^ ) . \mathcal{K}_L(\widehat{A},\widehat{r}):=\operatorname{span}\{\widehat{r},\widehat{A}\widehat{r},\ldots,\widehat{A}^{L-1}\widehat{r}\},\qquad k_L:=\dim\mathcal{K}_L(\widehat{A},\widehat{r}). K L ( A , r ) := span { r , A r , … , A L − 1 r } , k L := dim K L ( A , r ) .
Context and Memory Complexity of In-Context TD
We study the representation and memory required to reproduce the empirical TD dynamics in (1) , and the approximation error when the available context falls below the exact requirement. Our construction is end-to-end: an encoder compresses the raw transitions D N D_N D N into a task-specific context within the forward pass, and an executor operates on this context to reproduce the queried TD values without parameter updates; linear attention is the canonical realization, and softmax attention is treated in Appendix B.
Context representation. Let z ℓ , i ∈ R d m o d e l z_{\ell,i}\in\mathbb{R}^{d_{\mathrm{model}}} z ℓ , i ∈ R d model denote the i i i th active source token after ℓ \ell ℓ TD updates, and Z ℓ : = [ z ℓ , 1 , … , z ℓ , m ] ∈ R d m o d e l × m Z_\ell:=[z_{\ell,1},\ldots,z_{\ell,m}]\in\mathbb{R}^{d_{\mathrm{model}}\times m} Z ℓ := [ z ℓ , 1 , … , z ℓ , m ] ∈ R d model × m denote the query-independent source context. For a state query q q q , let z ℓ , ⋆ ( q ) z_{\ell,\star}(q) z ℓ , ⋆ ( q ) be a masked query token and define Z ℓ ( q ) : = [ Z ℓ , z ℓ , ⋆ ( q ) ] Z_\ell(q):=[Z_\ell,z_{\ell,\star}(q)] Z ℓ ( q ) := [ Z ℓ , z ℓ , ⋆ ( q )] . Note that the query token is not counted among the m m m active sources.
Definition 4.1 (m m m -dimensional context representation). We call { Z ℓ } ℓ = 0 L − 1 \{Z_\ell\}_{\ell=0}^{L-1} { Z ℓ } ℓ = 0 L − 1 an m m m -dimensional context representation of a value trajectory { v ~ ℓ } ℓ = 0 L \{\widetilde{v}_\ell\}_{\ell=0}^{L} { v ℓ } ℓ = 0 L if there exist a shared linear decoder D ∈ R n × m D\in\mathbb{R}^{n\times m} D ∈ R n × m and a fixed readout ρ ∈ R d m o d e l \rho\in\mathbb{R}^{d_{\mathrm{model}}} ρ ∈ R d model with s ℓ : = Z ℓ T ρ ∈ R m s_\ell:=Z_\ell^{\mathsf{T}}\rho\in\mathbb{R}^m s ℓ := Z ℓ T ρ ∈ R m and
v ~ ℓ = D ∑ j = 0 ℓ − 1 s j , 0 ≤ ℓ ≤ L . \widetilde{v}_\ell=D\sum_{j=0}^{\ell-1}s_j,\qquad0\leq\ell\leq L. v ℓ = D j = 0 ∑ ℓ − 1 s j , 0 ≤ ℓ ≤ L .
The representation is exact if v ~ ℓ = v ^ ℓ \widetilde{v}_\ell=\widehat{v}_\ell v ℓ = v ℓ for every ℓ ≤ L \ell\leq L ℓ ≤ L . We write E m \mathcal{E}_m E m for the set of trajectories that admit an m m m -dimensional context representation.
The m m m active source tokens carry the reduced TD increments s ℓ s_\ell s ℓ , and the shared decoder D D D maps them back to the state space where the value is v ~ ℓ ( q ) = e q T D ∑ j < ℓ s j \widetilde{v}_\ell(q)=e_q^{\mathsf{T}}D\sum_{j<\ell}s_j v ℓ ( q ) = e q T D ∑ j < ℓ s j . Context dimension is measured in tokens rather than scalar values and does not directly reflect storage or memory requirements. We therefore analyze the memory costs. For a stored object X X X , let Loc ( X ) \operatorname{Loc}(X) Loc ( X ) be the set of distinct scalar locations occupied by X X X . Aliased locations are counted once and stored copies separately; both quantities count real registers and exclude shared parameters.
Definition 4.2 (Retained and peak task memory). For one query q q q , the retained task memory is M r e t : = ∣ Loc ( Z ‾ ℓ ( q ) ) ∪ Loc ( D ) ∣ M_{\mathrm{ret}}:=|\operatorname{Loc}(\overline{Z}_\ell(q))\cup\operatorname{Loc}(D)| M ret := ∣ Loc ( Z ℓ ( q )) ∪ Loc ( D ) ∣ , the number of locations that must persist after encoding in order to execute the compressed TD computation. Let M e n c M_{\mathrm{enc}} M enc be the largest number of distinct locations occupied during encoding, and let W ( ℓ ) W(\ell) W ( ℓ ) be the temporary workspace of execution layer ℓ \ell ℓ . The peak task memory is M p e a k : = max { M e n c , max 0 ≤ ℓ < L ∣ Loc ( Z ‾ ℓ ( q ) ) ∪ Loc ( D ) ∪ Loc ( W ( ℓ ) ) ∣ } M_{\mathrm{peak}}:=\max\{M_{\mathrm{enc}},\max_{0\leq\ell<L}|\operatorname{Loc}(\overline{Z}_\ell(q))\cup\operatorname{Loc}(D)\cup\operatorname{Loc}(W(\ell))|\} M peak := max { M enc , max 0 ≤ ℓ < L ∣ Loc ( Z ℓ ( q )) ∪ Loc ( D ) ∪ Loc ( W ( ℓ )) ∣ } .
End-to-End Construction: Encoder and Executor
The iterates (1) depend on the data only through ( A ^ , r ^ ) (\widehat{A},\widehat{r}) ( A , r ) and their increments lie in K L \mathcal{K}_L K L , which suggests compressing in two stages, N → n → k L N \to n \to k_L N → n → k L : both are carried out by attention heads with fixed parameters directly on the raw records, so compression is part of the forward pass.
Selector heads. During encoding, let U = [ u 1 , … , u M ] ∈ R d m o d e l × M U = [u_1,\ldots,u_M] \in\mathbb{R}^{d_{\mathrm{model}}\times M} U = [ u 1 , … , u M ] ∈ R d model × M collect the active tokens, each partitioned into named coordinate blocks with selectors E a E_a E a , so that E a u i = u i [ a ] E_a u_i = u_i[a] E a u i = u i [ a ] . An encoder head is a residual linear-attention update [19 , 42 ]
U + = U + P U [ R ⊙ ( U ⊤ Q U ) ] , P = σ E o ⊤ E v , Q = E k ⊤ E q , σ ∈ { ± 1 } , (2) U^{+}=U+PU[\mathcal{R}\odot(U^\top Q U)],\qquad P=\sigma E_o^\top E_v,\qquad Q=E_k^\top E_q,\qquad\sigma\in\{\pm1\}, \tag*{(2)} U + = U + P U [ R ⊙ ( U ⊤ Q U )] , P = σ E o ⊤ E v , Q = E k ⊤ E q , σ ∈ { ± 1 } , (2)
which adds σ ∑ i u i [ v ] ( u i [ k ] ⊤ u t [ q ] ) \sigma\sum_i u_i[v](u_i[k]^\top u_t[q]) σ ∑ i u i [ v ] ( u i [ k ] ⊤ u t [ q ]) to block o o o of token t t t over the source tokens i i i allowed by the fixed routing mask R ∈ { 0 , 1 } M × M \mathcal{R}\in\{0,1\}^{M\times M} R ∈ { 0 , 1 } M × M . Q Q Q selects the key and query blocks that form the score, P P P selects the source value block and writes it with sign σ \sigma σ , into the output block, and R \mathcal{R} R specifies which source–target pairs may interact. We also allow recip 0 ( x ) = 1 / x \operatorname{recip}_0(x)=1/x recip 0 ( x ) = 1/ x for x > 0 x>0 x > 0 , recip 0 ( 0 ) = 0 \operatorname{recip}_0(0)=0 recip 0 ( 0 ) = 0 , and the release of tokens at stage boundaries.
Stage 1: raw records to statistics (N → n N\to n N → n ). Raw token u t r a w u_t^{\mathrm{raw}} u t raw carries ( e S t , e S t + 1 , R t + 1 , 1 ) (e_{S_t},e_{S_{t+1}},R_{t+1},1) ( e S t , e S t + 1 , R t + 1 , 1 ) , and state token u i s t a t e u_i^{\mathrm{state}} u i state carries e i e_i e i with zero-initialized statistic blocks. Routing every raw token to every state token with the matching score e S t ⊤ e i = 1 { S t = i } e_{S_t}^{\top}e_i=1\{S_t=i\} e S t ⊤ e i = 1 { S t = i } , three heads accumulate N i N_i N i , ∑ t : S t = i R t + 1 \sum_{t:S_t=i}R_{t+1} ∑ t : S t = i R t + 1 , and N i N_i N i in state token i i i ; recip 0 ( N i ) \operatorname{recip}_0(N_i) recip 0 ( N i ) and the input γ \gamma γ then form P ^ i , : \widehat{P}_{i,:} P i , : , r ^ i \widehat{r}_i r i , and A ^ i , : \widehat{A}_{i,:} A i , : by self-routed heads. The raw tokens are released, and the n n n state tokens carry ( A ^ , r ^ ) (\widehat{A},\widehat{r}) ( A , r ) Appendix § 10 .§ 3 .
Stage 2: from n n n states to k L k_L k L Krylov directions (n → k L n\to k_L n → k L ). The state-level context already reproduces TD exactly with the executor below Appendix § 10 .§ 4 , but it uses n n n tokens although the first L L L increments span only the corresponding Krylov space K L \mathcal{K}_L K L . Let h = min { n , L } h=\min\{n,L\} h = min { n , L } . Starting from b 1 = r ^ b_1=\widehat{r} b 1 = r in a work token, fixed heads run h h h rounds of an unnormalized Arnoldi recurrence in primal–dual form [38 ] , i.e.,
d j = b j ⊤ b j , ω j = recip 0 ( d j ) b j , η j = d j recip 0 ( d j ) , b j + 1 = A ^ b j − ∑ i ≤ j b i ω i ⊤ A ^ b j , (3) d_j=b_j^\top b_j,\qquad\omega_j=\operatorname{recip}_0(d_j)b_j,\qquad\eta_j=d_j\operatorname{recip}_0(d_j),\qquad b_{j+1}=\widehat{A}b_j-\sum_{i\le j}b_i\omega_i^\top\widehat{A}b_j, \tag*{(3)} d j = b j ⊤ b j , ω j = recip 0 ( d j ) b j , η j = d j recip 0 ( d j ) , b j + 1 = A b j − i ≤ j ∑ b i ω i ⊤ A b j , (3)
The nonzero b j b_j b j are orthogonal and span K L \mathcal{K}_L K L , and the gate η j \eta_j η j is one exactly on them, so token release keeps exactly k L k_L k L candidates. With B ‾ = [ b 1 , … , b k L ] \overline{B}=[b_1,\ldots,b_{k_L}] B = [ b 1 , … , b k L ] and Ω ‾ = [ ω 1 , … , ω k L ] \overline{\Omega}=[\omega_1,\ldots,\omega_{k_L}] Ω = [ ω 1 , … , ω k L ] , further heads compile
H = Ω ‾ ⊤ A ^ B ‾ , g = Ω ‾ ⊤ r ^ , Y = B ‾ + Ω ‾ ( H − I k L ) ⊤ , Z 0 = [ B ; Y ; g ⊤ ] ∈ R ( 2 n + 1 ) × k L . (4) H=\overline{\Omega}^{\top}\widehat{A}\overline{B},\qquad g=\overline{\Omega}^{\top}\widehat{r},\qquad Y=\overline{B}+\overline{\Omega}(H-I_{k_L})^\top,\qquad Z_0=[B;Y;g^\top]\in\mathbb{R}^{(2n+1)\times k_L}. \tag*{(4)} H = Ω ⊤ A B , g = Ω ⊤ r , Y = B + Ω ( H − I k L ) ⊤ , Z 0 = [ B ; Y ; g ⊤ ] ∈ R ( 2 n + 1 ) × k L . (4)
Here B B B provides coordinates in the Krylov subspace, H H H and g g g are the reduced operator and reward, and Y Y Y stores H H H inside width-n n n blocks so that the executor can read it through inner products.
Executor. Write the context at depth ℓ \ell ℓ as Z ‾ ℓ = [ B ; Y ; s ℓ ⊤ ] \overline{Z}_\ell=[B;Y;s_\ell^\top] Z ℓ = [ B ; Y ; s ℓ ⊤ ] with s 0 = g s_0=g s 0 = g , and the masked query token as z ℓ , ∗ ( q ) = ( e q , 0 n , c ℓ ) z_{\ell,*}(q)=(e_q,0_n,c_\ell) z ℓ , ∗ ( q ) = ( e q , 0 n , c ℓ ) with c 0 = 0 c_0=0 c 0 = 0 . Execution uses one linear-attention layer at every depth [51 ] ,
Z ‾ ℓ + 1 = Z ‾ ℓ + P T D Z ‾ ℓ M k L ( Z ‾ ℓ ⊤ Q T D Z ‾ ℓ ) , P T D = diag ( 0 2 n , 1 ) , Q T D = [ − I n I n 0 0 0 0 ] , (5) \overline{Z}_{\ell+1}=\overline{Z}_\ell+P_{\mathrm{TD}}\overline{Z}_\ell M_{k_L}(\overline{Z}_\ell^\top Q_{\mathrm{TD}}\overline{Z}_\ell),\qquad P_{\mathrm{TD}}=\operatorname{diag}(0_{2n},1),\qquad Q_{\mathrm{TD}}=\begin{bmatrix}-I_n&I_n&0\\0&0&0\end{bmatrix}, \tag*{(5)} Z ℓ + 1 = Z ℓ + P TD Z ℓ M k L ( Z ℓ ⊤ Q TD Z ℓ ) , P TD = diag ( 0 2 n , 1 ) , Q TD = [ − I n 0 I n 0 0 0 ] , (5)
with the mask M k L = diag ( I k L , 0 ) M_{k_L}=\operatorname{diag}(I_{k_L},0) M k L = diag ( I k L , 0 ) letting only the k L k_L k L source tokens act as sources. The static blocks B , Y B,Y B , Y never change, the last row evolves as s ℓ + 1 = H s ℓ s_{\ell+1}=Hs_\ell s ℓ + 1 = H s ℓ and c ℓ + 1 = c ℓ − e q ⊤ B s ℓ c_{\ell+1}=c_\ell-e_q^\top Bs_\ell c ℓ + 1 = c ℓ − e q ⊤ B s ℓ . Hence − c ℓ ( q ) = e q ⊤ B ∑ j < ℓ H j g = v ^ ℓ ( q ) -c_\ell(q)=e_q^\top B\sum_{j<\ell}H^jg=\widehat{v}_\ell(q) − c ℓ ( q ) = e q ⊤ B ∑ j < ℓ H j g = v ℓ ( q ) by Krylov moment matching, and { Z ℓ } \{Z_\ell\} { Z ℓ } is an exact k L k_L k L -dimensional context representation with D = B D=B D = B and s ℓ = H ℓ g s_\ell=H^\ell g s ℓ = H ℓ g .
Theorem 4.3. Let the empirical TD system be covered and L ≥ 1 L\ge1 L ≥ 1 , we have: (a) Context dimension. The minimum dimension of an exact context representation is the corresponding Krylov dimension k L k_L k L . (b) Construction. For fixed n n n and L L L , a task-independent encoder maps every covered raw transition in its forward pass, to the context (4) with exactly k L k_L k L tokens, and the executor (5) exactly outputs v ^ ℓ ( q ) \widehat{v}_\ell(q) v ℓ ( q ) for all q q q and ℓ \ell ℓ . (c) Retained memory. The construction uses O ( n k L ) O(nk_L) O ( n k L ) retained task memory and is optimal up to a factor of two among continuous exact encoders, even with arbitrary decoders. Hence the optimal retained memory is Θ ( n k L ) \Theta(nk_L) Θ ( n k L ) .
Part (a) is the exact context requirement: every increment A ^ v ^ j = v ~ j + 1 − v ~ j = D s j \hat{A}\hat{v}_j=\tilde{v}_{j+1}-\tilde{v}_j=Ds_j A ^ v ^ j = v ~ j + 1 − v ~ j = D s j lies in col ( D ) \operatorname{col}(D) col ( D ) , so m ≥ rank D ≥ k L m \ge\operatorname{rank} D \ge k_L m ≥ rank D ≥ k L , and (4) attains it. Part (b) is the constructive content: the k L k_L k L tokens, the decoder, and the reduced operator are produced by a fixed attention network in its forward pass, so compression is not a preprocessing step. What’s more, we can get the corresponding upper bounds M r e t = ( 2 n + 1 ) ( k L + 1 ) M_{\mathrm{ret}}=(2n+1)(k_L+1) M ret = ( 2 n + 1 ) ( k L + 1 ) and M p e a k = O ( N n + n 2 + n h ) M_{\mathrm{peak}}=O(Nn+n^2+nh) M peak = O ( N n + n 2 + nh ) with h = min { n , L } h=\min\{n,L\} h = min { n , L } .
For Part (c), fix 1 ≤ k ≤ min { n − 1 , L − 1 } 1\le k\le\min\{n-1,L-1\} 1 ≤ k ≤ min { n − 1 , L − 1 } . On any open set5 of covered systems with k L = k k_L=k k L = k containing a model with 1 ∉ K L \mathbf{1}\notin\mathcal{K}_L 1 ∈ / K L , every encoder continuous in ( A ^ , r ^ ) (\hat{A},\hat{r}) ( A ^ , r ^ ) and exact for all state–depth queries must retain at least n k + k nk+k nk + k real registers, even with an arbitrary nonlinear decoder (Appendix C); our context retains ( 2 n + 1 ) k (2n+1)k ( 2 n + 1 ) k for the source tokens, within a factor two, plus one query token. The bound is class-level: on a restricted family with fewer degrees of freedom, such as the block-cycle tasks of Section 5 where 1 ∈ K L \mathbf{1}\in\mathcal{K}_L 1 ∈ K L , a family-specific encoder can retain far less; the theorem controls task-uniform encoders such as ours. If k L = n k_L=n k L = n and L ≥ n + 1 L\ge n+1 L ≥ n + 1 , at least n 2 n^2 n 2 registers are necessary, so the statistics are optimal up to ( n + 1 ) / n (n+1)/n ( n + 1 ) / n . For offline coding with arbitrary encoders and decoders, the optimal memory for all state–depth queries within error ϵ \epsilon ϵ is Θ γ ( n min { n , L , log ( 1 / ϵ ) } log ( 1 / ϵ ) ) \Theta_\gamma(n\min\{n,L,\log(1/\epsilon)\}\log(1/\epsilon)) Θ γ ( n min { n , L , log ( 1/ ϵ )} log ( 1/ ϵ )) bits (Appendix C.2). The same context is also executed exactly by one looped layer of standard two-head softmax attention (Appendix B), and a single-depth query needs Θ ( log L ) \Theta(\log L) Θ ( log L ) layers (Appendix E).
Linear features and existing in-context TD constructions. Existing constructions run TD with linear features on N N N transition tokens and expose the corresponding TD value in every iterate, one per layer (Wang et al., [43 ] ) or per generated token (Xie et al., [47 ] ), and a looped network can be read out at any loop (Yang et al., [51 ] ). Our goal is to replace the original O ( N ) O(N) O ( N ) -token contexts with our k L k_L k L -token contexts and allow a fixed executor to reproduce the TD computations. Let ϕ : S → R d \phi:S\to\mathbb{R}^d ϕ : S → R d , ϕ t = ϕ ( S t ) \phi_t=\phi(S_t) ϕ t = ϕ ( S t ) , ϕ t ′ = ϕ ( S t + 1 ) \phi'_t=\phi(S_{t+1}) ϕ t ′ = ϕ ( S t + 1 ) , and consider batch TD(0) in sum form with a public step size α \alpha α , the update of Wang et al. [43 ] with C ℓ = α I C_\ell=\alpha I C ℓ = α I and their 1 / N 1/N 1/ N absorbed into α \alpha α :
A N = ∑ t ϕ t ( ϕ t − γ ϕ t ′ ) ⊤ , b N = ∑ t ϕ t R t + 1 , θ 0 = 0 θ ℓ + 1 = θ ℓ + α ( b N − A N θ ℓ ) . (6) A_N=\sum_t\phi_t(\phi_t-\gamma\phi'_t)^\top,\qquad b_N=\sum_t\phi_tR_{t+1},\qquad\theta_0=0\qquad\theta_{\ell+1}=\theta_\ell+\alpha(b_N-A_N\theta_\ell). \tag*{(6)} A N = t ∑ ϕ t ( ϕ t − γ ϕ t ′ ) ⊤ , b N = t ∑ ϕ t R t + 1 , θ 0 = 0 θ ℓ + 1 = θ ℓ + α ( b N − A N θ ℓ ) . (6)
With M : = I d − α A N M:=I_d-\alpha A_N M := I d − α A N and s 0 : = α b N s_0:=\alpha b_N s 0 := α b N , the iterates are θ ℓ = ∑ j < ℓ M j s 0 \theta_\ell=\sum_{j<\ell}M^js_0 θ ℓ = ∑ j < ℓ M j s 0 , so their increments span K L ( M , s 0 ) ⊆ R d \mathcal{K}_L(M,s_0)\subseteq\mathbb{R}^d K L ( M , s 0 ) ⊆ R d . Let k L ϕ : = dim K L ( M , s 0 ) k^\phi_L:=\dim\mathcal{K}_L(M,s_0) k L ϕ := dim K L ( M , s 0 ) , and let a context representation of { θ ℓ } \{\theta_\ell\} { θ ℓ } have a decoder D ∈ R d × m D\in\mathbb{R}^{d\times m} D ∈ R d × m with answer ϕ ( q ) ⊤ D ∑ j < ℓ δ j \phi(q)^\top D\sum_{j<\ell}\delta_j ϕ ( q ) ⊤ D ∑ j < ℓ δ j .
Theorem 4.4 (Feature-based TD). (a) The minimum dimension of an exact context representation of { θ ℓ } ℓ ≤ L \{\theta_\ell\}_{\ell\le L} { θ ℓ } ℓ ≤ L is k L ϕ k^\phi_L k L ϕ . (b) For fixed d d d , L L L and public α , γ \alpha,\gamma α , γ , a fixed-parameter encoder whose first stage uses no reciprocal (its second stage is that of Theorem 4.3) maps every batch of feature transitions in its forward pass to a context with exactly k L ϕ k^\phi_L k L ϕ tokens, and the executor (5) outputs ϕ ( q ) ⊤ θ ℓ \phi(q)^\top\theta_\ell ϕ ( q ) ⊤ θ ℓ for all q q q and ℓ ≤ L \ell\le L ℓ ≤ L . Moreover, M r e t = ( 2 d + 1 ) ( k L ϕ + 1 ) M_{\mathrm{ret}}=(2d+1)(k^\phi_L+1) M ret = ( 2 d + 1 ) ( k L ϕ + 1 ) , M p e a k = O ( N d + d 2 + d h ) M_{\mathrm{peak}}=O(Nd+d^2+dh) M peak = O ( N d + d 2 + d h ) . (c) Retained memory. For each 1 ≤ k ≤ min { d , L } 1\le k\le\min\{d,L\} 1 ≤ k ≤ min { d , L } , any encoder continuous in ( M , s 0 ) (M,s_0) ( M , s 0 ) and exact for all inputs with k L ϕ = k k^\phi_L=k k L ϕ = k requires at least d k dk d k real registers, even with arbitrary decoders. Hence the optimal retained memory is Θ ( d k L ϕ ) \Theta(dk^\phi_L) Θ ( d k L ϕ ) .
Stage 1 forms A N , b N A_N,b_N A N , b N by two heads (key ϕ t \phi_t ϕ t , query e i e_i e i ) and needs no reciprocal because (6) is un-normalized, unlike the visitation-normalized tabular statistics. Stage 2, which does use reciprocal as in Section 4.1, and the executor run on ( M , s 0 ) (M,s_0) ( M , s 0 ) , so the context has at most d d d tokens against N N N (Appendix A.6). Thus, Theorem 4.4 extends the Krylov-context construction and memory guarantees from one-hot state representations to general linear features under the unnormalized batch TD update (6).
Approximation with Limited Context
When m < k L m<k_L m < k L , exact reproduction through depth L L L is impossible, and we ask how accurately an m m m -dimensional context can approximate the TD trajectory. With ∥ x ∥ μ 2 = ∑ i μ i x i 2 \|x\|_\mu^2=\sum_i\mu_i x_i^2 ∥ x ∥ μ 2 = ∑ i μ i x i 2 , the normalized worst-case error of the depth-L L L problem of Definition 4.1 is
E m , L ( γ ) : = sup ( P ^ , r ^ , μ ) inf v ~ ∈ C m max 0 ≤ ℓ ≤ L ∥ v ^ ℓ − v ~ ℓ ∥ μ ∥ r ^ ∥ μ , \mathcal{E}_{m,L}(\gamma):=\sup_{(\hat{P},\hat{r},\mu)}\inf_{\tilde{v}\in\mathcal{C}_m}\max_{0\le\ell\le L}\frac{\|\hat{v}_\ell-\tilde{v}_\ell\|_\mu}{\|\hat{r}\|_\mu}, E m , L ( γ ) := ( P ^ , r ^ , μ ) sup v ~ ∈ C m inf 0 ≤ ℓ ≤ L max ∥ r ^ ∥ μ ∥ v ^ ℓ − v ~ ℓ ∥ μ ,
where the outer supremum is over covered empirical systems of any size with a strictly positive stationary distribution μ \mu μ and r ^ ≠ 0 \hat{r}\ne0 r ^ = 0 , and C m \mathcal{C}_m C m is the class of Definition 4.1 . E m ( γ ) \mathcal{E}_m(\gamma) E m ( γ ) is the depth-free version (L = ∞ L=\infty L = ∞ , sup ℓ ≥ 0 \sup_{\ell\ge0} sup ℓ ≥ 0 ), which dominates E m , L ( γ ) \mathcal{E}_{m,L}(\gamma) E m , L ( γ ) for every L L L . The law below is stated for E m \mathcal{E}_m E m , and the finite-depth case follows it. We seek to characterize the optimal worst-case error jointly in context dimension m m m and discount factor γ \gamma γ , and to construct a context that attains it. Classical Krylov approximation ([9 , 26 ] ) does not: it spends the whole budget on the first m m m increments, so its worst-case error is exactly γ m / ( 1 − γ ) \gamma^m/(1-\gamma) γ m / ( 1 − γ ) (Proposition D.1 ), which below the horizon barely decays with m m m .
Instead of preserving only the first m m m TD increments, we approximate the TD trajectory by storing its values at selected depths and using the most recently stored value between samples. To choose these depths, let J = ⌊ 1 / ( 1 − γ ) ⌋ J=\lfloor1/(1-\gamma)\rfloor J = ⌊ 1/ ( 1 − γ )⌋ , which reflects how slowly the discounted TD increments decay. We divide the m m m -token budget into two parts, m = k + j m=k+j m = k + j : the first k k k tokens preserve the initial k k k TD increments exactly, while the remaining j j j tokens capture changes at later depths. Specifically, we set
( k , j ) = { ( m , 0 ) , γ < 1 2 , ( 0 , m ) , γ ≥ 1 2 , m ≤ J , ( m − J , J ) , γ ≥ 1 2 , m > J . (k,j)=
\begin{cases}
(m,0), & \gamma< \frac{1}{2},\\
(0,m), & \gamma\ge\frac{1}{2},\ m\le J,\\
(m-J,J), & \gamma\ge\frac{1}{2},\ m>J.
\end{cases} ( k , j ) = ⎩ ⎨ ⎧ ( m , 0 ) , ( 0 , m ) , ( m − J , J ) , γ < 2 1 , γ ≥ 2 1 , m ≤ J , γ ≥ 2 1 , m > J .
The first k k k sampling depths are 1 , … , k 1,\ldots,k 1 , … , k . For the remaining j j j tokens, we select later depths k + i s k+i_s k + i s , where
i s = min { i ≥ 0 : 1 − γ i ≥ s j + 1 } i_s=\min\left\{i\ge0:1-\gamma^i\ge\frac{s}{j+1}\right\} i s = min { i ≥ 0 : 1 − γ i ≥ j + 1 s }
for s ∈ [ j ] s\in[j] s ∈ [ j ] . This approximately divides the remaining discounted weight into equal portions, allowing larger gaps between samples at later depths. The complete set of sampled depths is therefore
T m ( γ ) = { 1 , … , k } ∪ { k + i s : 1 ≤ s ≤ j } . \mathcal{T}_m(\gamma)=\{1,\ldots,k\}\cup\{k+i_s:1\le s\le j\}. T m ( γ ) = { 1 , … , k } ∪ { k + i s : 1 ≤ s ≤ j } .
Write the selected depths in increasing order as τ 1 < ⋯ < τ m \tau_1<\cdots<\tau_m τ 1 < ⋯ < τ m , with τ 0 = 0 \tau_0=0 τ 0 = 0 . Each token u u u stores the difference between two consecutive sampled iterates, i.e., x u = v ^ τ u − v ^ τ u − 1 x_u=\hat{v}_{\tau_u}-\hat{v}_{\tau_{u-1}} x u = v ^ τ u − v ^ τ u − 1 . These differences allow the sampled iterates to be recovered by accumulation. A fixed five-head encoder constructs the tokens by recording the TD trajectory at the selected depths (Appendix § 10 .12).
To answer a query at depth ℓ \ell ℓ , we use the query accumulator of the looped executor (5) , but update it only at the selected sampling depths. A counter tracks the current depth, and the gate s ℓ , u = 1 { ℓ + 1 = τ u } s_{\ell,u}=\mathbf{1}\{\ell+1=\tau_u\} s ℓ , u = 1 { ℓ + 1 = τ u } determines when token u u u contributes e q ⊤ x u e_q^\top x_u e q ⊤ x u to the accumulator. Between sampling depths, the output remains unchanged. Consequently,
v ~ ℓ ( q ) = ∑ τ u ≤ ℓ e q ⊤ x u = e q ⊤ v ^ σ ( ℓ ) , σ ( ℓ ) = max ( { 0 } ∪ { τ u : τ u ≤ ℓ } ) , \widetilde{v}_{\ell}(q)=\sum_{\tau_u\le\ell}e_q^\top x_u=e_q^\top\hat{v}_{\sigma(\ell)},\qquad
\sigma(\ell)=\max\left(\{0\}\cup\{\tau_u:\tau_u\le\ell\}\right), v ℓ ( q ) = τ u ≤ ℓ ∑ e q ⊤ x u = e q ⊤ v ^ σ ( ℓ ) , σ ( ℓ ) = max ( { 0 } ∪ { τ u : τ u ≤ ℓ } ) ,
where σ ( ℓ ) \sigma(\ell) σ ( ℓ ) is the most recent sampled depth not exceeding ℓ \ell ℓ . With D = [ x 1 , … , x m ] D=[x_1,\ldots,x_m] D = [ x 1 , … , x m ] , this gives an m m m -dimensional context representation.
Theorem 4.5. For every m ≥ 1 m\ge1 m ≥ 1 and γ ∈ ( 0 , 1 ) \gamma\in(0,1) γ ∈ ( 0 , 1 ) , with Ψ m ( γ ) = γ m max { 1 , 1 m ( 1 − γ ) } \Psi_m(\gamma)=\gamma^m\max\left\{1,\frac{1}{m(1-\gamma)}\right\} Ψ m ( γ ) = γ m max { 1 , m ( 1 − γ ) 1 } ,
1 64 Ψ m ( γ ) ≤ E m ( γ ) ≤ e 2 Ψ m ( γ ) . \frac{1}{64}\Psi_m(\gamma)\le\mathcal{E}_m(\gamma)\le e^2\Psi_m(\gamma). 64 1 Ψ m ( γ ) ≤ E m ( γ ) ≤ e 2 Ψ m ( γ ) . The upper bound is attained on every covered system by the sample-and-hold context of dimension m m m , consequently E m ( γ ) = Θ ( γ m max { 1 , 1 m ( 1 − γ ) } ) \mathcal{E}_m(\gamma)=\Theta\left(\gamma^m\max\left\{1,\frac{1}{m(1-\gamma)}\right\}\right) E m ( γ ) = Θ ( γ m max { 1 , m ( 1 − γ ) 1 } ) .
For m < 1 / ( 1 − γ ) m<1/(1-\gamma) m < 1/ ( 1 − γ ) , any m m m -dimensional context has worst-case error at least Ψ m / 64 ≳ 1 / [ m ( 1 − γ ) ] \Psi_m/64\gtrsim1/[m(1-\gamma)] Ψ m /64 ≳ 1/ [ m ( 1 − γ )] , regardless of how it is encoded. Thus, in this range, increasing the context dimension cannot guarantee geometric decay in error; the lower bound decreases only as 1 / m 1/m 1/ m . Since tabular systems are a special case of feature-based systems with ϕ ( s ) = e s \phi(s)=e_s ϕ ( s ) = e s , the same lower bound applies to feature-based contexts. However, Krylov truncation ([9 , 26 ] ) incurs a multiplicative gap relative to the minimax upper bound, quantified by min { m , 1 / ( 1 − γ ) } / e 2 \min\{m,1/(1-\gamma)\}/e^2 min { m , 1/ ( 1 − γ )} / e 2 . The proof of this gap is given in Appendix § 13 .§ 6 , while the minimax upper and lower bounds are proved in Appendix § 13 .
Finite depth. Definition 4.1 considers a fixed number L L L of iterations. For every L L L , the optimal error satisfies E m , L ≤ E m ≤ e 2 Ψ m \mathcal{E}_{m,L}\le\mathcal{E}_m\le e^2\Psi_m E m , L ≤ E m ≤ e 2 Ψ m , and it is zero exactly when m ≥ k L m\ge k_L m ≥ k L . The constructions used to prove the lower bound require at most m + 4 / ( 1 − γ ) m+4/(1-\gamma) m + 4/ ( 1 − γ ) iterations. Thus, when L ≥ m + 4 / ( 1 − γ ) L\ge m+4/(1-\gamma) L ≥ m + 4/ ( 1 − γ ) , the same lower bound applies: E m , L ≥ Ψ m / 64 \mathcal{E}_{m,L}\ge\Psi_m/64 E m , L ≥ Ψ m /64 . For smaller L L L , the error bounds also depend on the number of iterations. By choosing the sampled depths to divide the total discounted weight over the first L L L iterations into approximately equal parts, sample-and-hold achieves error at most e 2 γ m max { 1 , ( 1 − γ L ) / ( m ( 1 − γ ) ) } e^{2}\gamma^{m}\max\{1,(1-\gamma^{L})/(m(1-\gamma))\} e 2 γ m max { 1 , ( 1 − γ L ) / ( m ( 1 − γ ))} . In particular, when 8 m ≤ L ≤ 1 / ( 1 − γ ) 8m \le L \le1/(1-\gamma) 8 m ≤ L ≤ 1/ ( 1 − γ ) , the optimal error is Θ ( L / m ) \Theta(L/m) Θ ( L / m ) . The proof is given in Appendix D.5.
Learnability of the TD Update
The construction above uses the fixed parameters ( P T D , Q T D ) (P_{\mathrm{TD}},Q_{\mathrm{TD}}) ( P TD , Q TD ) defined in equation 5 to execute TD on the compressed context, and we now ask whether pretraining recovers them with the encoder kept fixed. First, we should note that ( P T D , Q T D ) (P_{\mathrm{TD}},Q_{\mathrm{TD}}) ( P TD , Q TD ) is not unique: linear attention is invariant to the reciprocal rescaling, i.e.,
P Z M ( Z ⊤ Q Z ) = ( a P ) Z M ( Z ⊤ ( a − 1 Q ) Z ) , a ≠ 0. PZM(Z^{\top}QZ)=(aP)ZM(Z^{\top}(a^{-1}Q)Z),\qquad a\ne0. P Z M ( Z ⊤ QZ ) = ( a P ) Z M ( Z ⊤ ( a − 1 Q ) Z ) , a = 0.
So the correct parameters form an equivalence class rather than a point. To remove this ambiguity we fix P = P T D P=P_{\mathrm{TD}} P = P TD and parameterize the trainable query–key interaction as Q e f f ( C , W ) : = [ C W ⊤ 0 0 0 0 0 0 0 0 ] Q_{\mathrm{eff}}(C,W):=\begin{bmatrix}CW^{\top}&0&0\\0&0&0\\0&0&0\end{bmatrix} Q eff ( C , W ) := C W ⊤ 0 0 0 0 0 0 0 0 with C , W ∈ R n × n C,W\in\mathbb{R}^{n\times n} C , W ∈ R n × n , whose target is C ⋆ = − I n C^{\star}=-I_n C ⋆ = − I n and W ⋆ = I n W^{\star}=I_n W ⋆ = I n , for which Q e f f ( C ⋆ , W ⋆ ) = Q T D Q_{\mathrm{eff}}(C^{\star},W^{\star})=Q_{\mathrm{TD}} Q eff ( C ⋆ , W ⋆ ) = Q TD .
Let τ \tau τ denote a pretraining task with empirical quantities ( A ^ τ , r ^ τ ) (\widehat{A}_{\tau},\widehat{r}_{\tau}) ( A τ , r τ ) . Given the state-level context from Stage 1, the executor with Q e f f ( C , W ) Q_{\mathrm{eff}}(C,W) Q eff ( C , W ) maintains a vector s τ , ℓ s_{\tau,\ell} s τ , ℓ , initialized at s τ , 0 = r ^ τ s_{\tau,0}=\widehat{r}_{\tau} s τ , 0 = r τ , and updates it at each depth according to
s τ , ℓ + 1 = F τ ( C , W ) s τ , ℓ , F τ ( C , W ) : = I n + C ⊤ + A ^ τ W . s_{\tau,\ell+1}=F_{\tau}(C,W)s_{\tau,\ell},\qquad F_{\tau}(C,W):=I_n+C^{\top}+\widehat{A}_{\tau}W. s τ , ℓ + 1 = F τ ( C , W ) s τ , ℓ , F τ ( C , W ) := I n + C ⊤ + A τ W .
At each step, the vector s τ , ℓ s_{\tau,\ell} s τ , ℓ produces an output increment − C ⊤ s τ , ℓ -C^{\top}s_{\tau,\ell} − C ⊤ s τ , ℓ . At the target parameters, s τ , ℓ = A ^ τ ℓ r ^ τ s_{\tau,\ell}=\widehat{A}_{\tau}^{\ell}\widehat{r}_{\tau} s τ , ℓ = A τ ℓ r τ , so these increments exactly match the empirical TD updates. Summing the increments, the executor’s output at depth ℓ \ell ℓ is v τ , ℓ θ = − C ⊤ ∑ j < ℓ s τ , j v_{\tau,\ell}^{\theta}=-C^{\top}\sum_{j<\ell}s_{\tau,j} v τ , ℓ θ = − C ⊤ ∑ j < ℓ s τ , j .
Which pretraining signal identifies the executor? The endpoint objective J e n d ( C , W ) = 1 2 E τ ∥ v τ , ∞ θ − v ^ τ , ∞ ∥ 2 2 \mathcal{J}_{\mathrm{end}}(C,W)=\frac{1}{2}\mathbb{E}_{\tau}\|v_{\tau,\infty}^{\theta}-\widehat{v}_{\tau,\infty}\|_{2}^{2} J end ( C , W ) = 2 1 E τ ∥ v τ , ∞ θ − v τ , ∞ ∥ 2 2 , which supervises only the converged output as in equilibrium-based learning [2 ] , cannot uniquely identify the TD update rule. This non-identifiability is illustrated by the parameter family ( C , W ) = ( − a I n , a I n ) (C,W)=(-aI_n,aI_n) ( C , W ) = ( − a I n , a I n ) , 0 < a ≤ 1 0<a\le1 0 < a ≤ 1 , under which the executor performs TD with step size a a a , while its fixed point remains unchanged. Thus, whenever the iterations converge, different step sizes yield the same final prediction, giving a continuum of minimizers of J e n d \mathcal{J}_{\mathrm{end}} J end . In contrast, supervising the entire trajectory with J t r a j ( C , W ) = 1 2 E τ ∑ ℓ ≤ L ∥ v τ , ℓ θ − v ^ τ , ℓ ∥ 2 2 \mathcal{J}_{\mathrm{traj}}(C,W)=\frac{1}{2}\mathbb{E}_{\tau}\sum_{\ell\le L}\|v_{\tau,\ell}^{\theta}-\widehat{v}_{\tau,\ell}\|_{2}^{2} J traj ( C , W ) = 2 1 E τ ∑ ℓ ≤ L ∥ v τ , ℓ θ − v τ , ℓ ∥ 2 2 distinguishes these update rules and removes this ambiguity.
Proposition 4.6 (Local identifiability). Suppose L ≥ 2 L\ge2 L ≥ 2 and
E τ [ r ^ τ r ^ τ ⊤ ] ≻ 0 , E τ [ ( r ^ τ r ^ τ ⊤ ) ⊗ ( A ^ τ ⊤ A ^ τ ) ] ≻ 0. \mathbb{E}_{\tau}[\widehat{r}_{\tau}\widehat{r}_{\tau}^{\top}]\succ0,\qquad\mathbb{E}_{\tau}[(\widehat{r}_{\tau}\widehat{r}_{\tau}^{\top})\otimes(\widehat{A}_{\tau}^{\top}\widehat{A}_{\tau})]\succ0. E τ [ r τ r τ ⊤ ] ≻ 0 , E τ [( r τ r τ ⊤ ) ⊗ ( A τ ⊤ A τ )] ≻ 0. At the target parameters ( − I n , I n ) (-I_n,I_n) ( − I n , I n ) , the Jacobian of the trajectory map ( C , W ) ↦ ( v τ , ℓ θ ) ℓ ≤ L (C,W)\mapsto(v_{\tau,\ell}^{\theta})_{\ell\le L} ( C , W ) ↦ ( v τ , ℓ θ ) ℓ ≤ L is injective. Consequently, the target is a strict local minimizer of J t r a j \mathcal{J}_{\mathrm{traj}} J traj . In contrast, the Jacobian of the endpoint map ( C , W ) ↦ v τ , ∞ θ (C,W)\mapsto v_{\tau,\infty}^{\theta} ( C , W ) ↦ v τ , ∞ θ has the nonzero null direction ( − I n , I n ) (-I_n,I_n) ( − I n , I n ) , so endpoint supervision cannot identify the TD step size.
The proof in Appendix F uses only the first two depths: the first identifies C C C , and the second identifies W W W . To obtain a global guarantee, we replace r ^ τ \widehat{r}_{\tau} r τ at these depths with a calibration input u u u satisfying E [ u u ⊤ ] = I n \mathbb{E}[uu^{\top}]=I_n E [ u u ⊤ ] = I n . This ensures that all input directions are represented, providing the input-side richness needed for global identification. And it yields the following quadratic objective:
J ( C , W ) : = 1 2 E τ , u [ ∥ − C ⊤ u − u ∥ 2 2 + ∥ F τ ( C , W ) u − A ^ τ u ∥ 2 2 ] . (7) \mathcal{J}(C,W):=\frac{1}{2}\mathbb{E}_{\tau,u}\left[\left\|-C^{\top}u-u\right\|_{2}^{2}+\left\|F_{\tau}(C,W)u-\widehat{A}_{\tau}u\right\|_{2}^{2}\right]. \tag*{(7)} J ( C , W ) := 2 1 E τ , u [ − C ⊤ u − u 2 2 + F τ ( C , W ) u − A τ u 2 2 ] . (7)
The first term identifies the TD increment, while the second identifies the update dynamics. This objective does not require a precomputed value function. Global identification then requires the pretraining tasks to distinguish all operator directions.
Assumption 4.7 (Task richness). There are constants 0 < κ ≤ β ′ 0<\kappa\le\beta' 0 < κ ≤ β ′ such that κ I n ⪯ E τ [ A ^ τ ⊤ A ^ τ ] ⪯ β ′ I n \kappa I_n\preceq\mathbb{E}_{\tau}[\widehat{A}_{\tau}^{\top}\widehat{A}_{\tau}]\preceq\beta'I_n κ I n ⪯ E τ [ A τ ⊤ A τ ] ⪯ β ′ I n . The lower bound ensures that the pretraining tasks collectively cover every operator direction, while the upper bound controls the average magnitude of their effects.
Algorithm 1 Pretraining procedure for the effective TD parameters ( C , W ) (C, W) ( C , W ) .
Require: Pretraining task distribution D p r e \mathcal{D}_{\mathrm{pre}} D pre , step size η > 0 \eta> 0 η > 0 , number of iterations T T T , fixed P = P T D P = P_{\mathrm{TD}} P = P TD , fixed encoder, initial C 0 , W 0 ∈ R n × n C_0, W_0 \in\mathbb{R}^{n \times n} C 0 , W 0 ∈ R n × n
for i = 0 , … , T − 1 i = 0, \ldots, T - 1 i = 0 , … , T − 1 do
For each task τ \tau τ , run the encoder to obtain ( A ^ τ , r ^ τ ) (\widehat{A}_{\tau}, \widehat{r}_{\tau}) ( A τ , r τ ) and form F τ ( C i , W i ) = I n + C i T + A ^ τ W i F_{\tau}(C_i, W_i) = I_n + C_i^{\mathsf{T}} + \widehat{A}_{\tau}W_i F τ ( C i , W i ) = I n + C i T + A τ W i .
Evaluate the full-batch objective J ( C i , W i ) \mathcal{J}(C_i, W_i) J ( C i , W i ) in (7) with the calibration input u u u .
Update C i + 1 = C i − η ∇ C J ( C i , W i ) C_{i+1} = C_i - \eta\nabla_C \mathcal{J}(C_i, W_i) C i + 1 = C i − η ∇ C J ( C i , W i ) and W i + 1 = W i − η ∇ W J ( C i , W i ) W_{i+1} = W_i - \eta\nabla_W \mathcal{J}(C_i, W_i) W i + 1 = W i − η ∇ W J ( C i , W i ) .
end for
return ( P T D , Q e f f ( C T , W T ) ) (P_{\mathrm{TD}}, Q_{\mathrm{eff}}(C_T, W_T)) ( P TD , Q eff ( C T , W T )) with Q e f f Q_{\mathrm{eff}} Q eff as in § 4.3 .
Under Assumption 4.7, we apply the full-batch gradient descent procedure in Algorithm 1 to minimize J \mathcal{J} J with step size η \eta η . Let ( C t , W t ) (C_t, W_t) ( C t , W t ) denote the resulting parameters after t t t iterations.
Theorem 4.8 (Global convergence in the effective parameter space). Under Assumption 4.7, J \mathcal{J} J is a globally strongly convex and smooth quadratic with the unique minimizer ( C ⋆ , W ⋆ ) = ( − I n , I n ) (C^\star, W^\star) = (-I_n, I_n) ( C ⋆ , W ⋆ ) = ( − I n , I n ) .
With λ − = 3 − 5 2 min { 1 , κ } \lambda_- = \frac{3-\sqrt{5}}{2}\min\{1, \kappa\} λ − = 2 3 − 5 min { 1 , κ } , λ + = 3 + 5 2 max { 1 , β ′ } \lambda_+ = \frac{3+\sqrt{5}}{2}\max\{1, \beta'\} λ + = 2 3 + 5 max { 1 , β ′ } , and any η ≤ 1 / λ + \eta\le1/\lambda_+ η ≤ 1/ λ + ,
∥ C t − C ⋆ ∥ F 2 + ∥ W t − W ⋆ ∥ F 2 ≤ ( 1 − η λ − ) 2 t ( ∥ C 0 − C ⋆ ∥ F 2 + ∥ W 0 − W ⋆ ∥ F 2 ) . \lVert C_t - C^\star\rVert_F^2 + \lVert W_t - W^\star\rVert_F^2 \le(1 - \eta\lambda_-)^{2t}\left(\lVert C_0 - C^\star\rVert_F^2 + \lVert W_0 - W^\star\rVert_F^2\right). ∥ C t − C ⋆ ∥ F 2 + ∥ W t − W ⋆ ∥ F 2 ≤ ( 1 − η λ − ) 2 t ( ∥ C 0 − C ⋆ ∥ F 2 + ∥ W 0 − W ⋆ ∥ F 2 ) .
Thus the target is the unique global minimizer, reached from any initialization (Appendix § 15 ); the theorem identifies the executor, not the encoder, and what a jointly trained encoder learns is examined in § 5 .
Experiments
Effective parameter recovery. On 2,400 raw-batch tasks (n = 24 n = 24 n = 24 , L = 30 L = 30 L = 30 , five paired initializations) we compare the three signals of § 4.3 . Full-batch gradient descent on the calibration objective (7) recovers C = − I 24 C = -I_{24} C = − I 24 , W = I 24 W = I_{24} W = I 24 to normalized parameter error 1.0 × 10 − 15 1.0 \times10^{-15} 1.0 × 1 0 − 15 in 3,000 steps, as Theorem 4.8 predicts, and Adam on (7) reaches 3.2 × 10 − 16 3.2 \times10^{-16} 3.2 × 1 0 − 16 ; Adam on J t r a j \mathcal{J}_{\mathrm{traj}} J traj reaches 7.4 × 10 − 2 7.4 \times10^{-2} 7.4 × 1 0 − 2 in 6,000 steps and 3.3 × 10 − 3 3.3 \times10^{-3} 3.3 × 1 0 − 3 in 20,000, in line with Proposition 4.6; Adam on J e n d ( 30 ) \mathcal{J}_{\mathrm{end}}^{(30)} J end ( 30 ) , the depth-30 bootstrapped form of J e n d \mathcal{J}_{\mathrm{end}} J end (Appendix § 17 .§ 6 ), stops at 0.51: its depth-30 output is within 0.04 of TD on held-out tasks, but its trajectory is off by up to 0.63, since J e n d \mathcal{J}_{\mathrm{end}} J end constrains only the fixed point (Figure 1 , Appendix § 17 .§ 6 ).
Figure 1. Parameter identification. Learned C , W C, W C , W : calibration (7) with full-batch gradient descent (a,b), trajectory supervision with Adam (c,d), and the depth-30 endpoint surrogate with Adam (e,f).
Context–accuracy tradeoff. Figure 2 varies the context dimension m m m for Krylov projection and truncation, sample-and-hold, and the Krylov-anchored hold (Appendix § 13 .§ 1 ). On 100 covered 12-block cyclic MRPs with k L = 12 k_L = 12 k L = 12 (panel a), Krylov projection becomes exact at the threshold of Theorem 4.3 (a) (0.86 at m = 11 m = 11 m = 11 , 6 × 10 − 16 6 \times10^{-16} 6 × 1 0 − 16 at m = 12 m = 12 m = 12 ), while truncation and sample-and-hold improve gradually; on reversible MRPs with k L = 24 k_L = 24 k L = 24 (panel b) Krylov projection still drops from 1.1 × 10 − 1 1.1 \times10^{-1} 1.1 × 1 0 − 1 at m = 4 m = 4 m = 4 to 2.2 × 10 − 7 2.2 \times10^{-7} 2.2 × 1 0 − 7 at m = 12 m = 12 m = 12 . On worst-case rings at γ = 0.99 \gamma= 0.99 γ = 0.99 (panel c), sample-and-hold and the anchored hold stay within [ 0.45 , 2.7 ] × Ψ m [0.45, 2.7] \times\Psi_m [ 0.45 , 2.7 ] × Ψ m , with sub-horizon slopes − 0.89 -0.89 − 0.89 and − 0.93 -0.93 − 0.93 against the predicted − 1 -1 − 1 , whereas Krylov truncation has slope − 0.14 -0.14 − 0.14 and is up to 37 × 37 \times 37 × worse, as Theorem 4.5 predicts.
Figure 2. Context-dimension–accuracy tradeoff. (a) Cyclic MRPs with k L = 12 k_L = 12 k L = 12 and (b) reversible MRPs: mean error over 100 tasks per panel (n = 24 n = 24 n = 24 , γ = 0.9 \gamma= 0.9 γ = 0.9 , L = 30 L = 30 L = 30 ), interquartile ranges shaded, dashed lines at k L k_L k L . (c) Worst-case rings at γ = 0.99 \gamma= 0.99 γ = 0.99 against Ψ m \Psi_m Ψ m of Theorem 4.5 and a certified lower bound (vertical line: m = 1 / ( 1 − γ ) m = 1/(1-\gamma) m = 1/ ( 1 − γ ) ).
Memory usage. In Table 2 , the block cycles (k L = 12 k_L = 12 k L = 12 by construction) check the exact threshold: the context retains ( 2 n + 1 ) ( k L + 1 ) (2n + 1)(k_L + 1) ( 2 n + 1 ) ( k L + 1 ) values independent of N N N , is not smaller than the statistics at n = 24 n = 24 n = 24 , and is 94.6% smaller at n = 480 n = 480 n = 480 ; the bound n k L + k L nk_L + k_L n k L + k L of Theorem 4.3 (c) is a class-level reference, not an instance-level certificate for these tasks, whose trajectories are fixed by the block labels alone (peak memory: Appendix § 17 .§ 5 ). The feature rows run TD (6) through the encoder of Theorem 4.4 : on Boyan’s chain (d = 4 d = 4 d = 4 , k L = 4 k_L = 4 k L = 4 ) nothing is saved over the d 2 + d d^2 + d d 2 + d LSTD statistics; on mountain car with tile-coded features (d = 512 d = 512 d = 512 ) the trajectory has full exact rank but at most 10 singular values above 10 − 2 L 10^{-2}\sqrt{L} 1 0 − 2 L , and a context of dimension 32 is accurate to 1.1 × 10 − 2 1.1 \times10^{-2} 1.1 × 1 0 − 2 or better with 108–117 KiB, 6–7× below the LSTD statistics and independent of N N N . On sampled tabular tasks of full exact rank, contexts accurate to 10 − 2 10^{-2} 1 0 − 2 are 9× smaller than sparse TD on a dense kernel but not on a sparse gridworld (Appendix § 17 .§ 5 ).
Table 2. Retained memory (KiB, float32). Top: 12-block cycles with k L = 12 k_L = 12 k L = 12 . Bottom: feature TD (6), Statistics = ( A N , b N ) = (A_N, b_N) = ( A N , b N ) , Ours = = = the exact context (Boyan) or the dimension-32 context with error ≤ 1.1 × 10 − 2 \le1.1 \times10^{-2} ≤ 1.1 × 1 0 − 2 (mountain car; Raw stored sparsely). Peak as in Definition 4.2 .
Learned bottleneck encoders. Finally we train standard softmax Transformers that compress the TD iterates of the fixed first stage into m m m latent tokens by cross-attention and emit a context for the executors of Appendix § 10 .7, so every model lies in C m \mathcal{C}_m C m (Appendix § 17 .9; three seeds, 8,000 updates per point). The learned encoders beat sample-and-hold on held-out tasks for m ≤ 8 m \le8 m ≤ 8 (0.50–0.89 against 1.00–1.72) and the anchored hold for m ≤ 4 m \le4 m ≤ 4 , but their error does not decrease with m m m : it stays at 0.61–0.63 (clocked, m ≥ 4 m \ge4 m ≥ 4 ) and 0.50–0.54 (time-invariant, m ≥ 8 m \ge8 m ≥ 8 ) up to m = 24 m = 24 m = 24 , where the compiled contexts reach 0.10 and 0.03; standard bottleneck encoders do not discover the Krylov or clock structure that turns tokens into accuracy, which the compiled encoders supply.
Conclusion
In this paper, we study how much context a Transformer needs to reproduce TD evaluation without updating its parameters. We show that the minimum context dimension required to reproduce the first L L L TD iterates is the Krylov dimension k L k_L k L . We construct a fixed-parameter linear-attention network that produces this compressed context directly from raw transitions, with retained memory within a factor of two of the optimum. When the context is too small for exact recovery, we characterize the best achievable worst-case approximation error and show that a simple sample-and-hold method achieves the same rate. We further show that pretraining can recover the shared executor under suitable task diversity, whereas supervising only the final output cannot identify the TD update rule. Our theoretical guarantees focus on TD policy evaluation with explicitly constructed encoders. Whether jointly learned encoders can achieve the same memory and accuracy guarantees and whether these results extend to policy control, remain open questions.
AI Use Statement
In this work, we used ChatGPT Astra and Claude Fable 5.1 as AI-assisted research tools. Their use included polishing the writing and presentation of the paper, simplifying and improving the exposition of several proofs, assisting with the implementation and execution of part of the experiments, and helping extend the analysis from one-hot state representations to general d d d -dimensional feature representations. All AI-assisted mathematical arguments, derivations, and proofs were independently reviewed and verified by the authors. The authors take full responsibility for the correctness of all theoretical claims, proofs, experimental results, and the final content of the paper.
Ethics Statement
This work does not involve human subjects, personal or sensitive data, or experiments that raise specific ethical concerns. The study is primarily theoretical and computational in nature, and all experiments are conducted using controlled settings without involving real-world participants or private information. We therefore do not identify any significant ethical issues associated with this work.
Reproducibility Statement
We provide detailed descriptions of the theoretical constructions, experimental settings, and implementation procedures in the appendices. The appendices include the necessary architectural specifications, proof details, experimental configurations, task-generation procedures, and evaluation protocols required to reproduce the reported results. In particular, the complete code for all experiments is included in the supplementary material, together with the corresponding scripts and configurations needed to reproduce the main figures, tables, and quantitative results reported in the paper. Where applicable, random seeds, training budgets, hyperparameters, and model configurations are also provided to facilitate independent verification and reproduction of our experiments.
Architecture, Head Library, and End-to-End Exactness
This appendix specifies the encoder of § 4.1 at the level of individual heads and proves Theorem 4.3 (a)–(b). All head parameters are fixed for public n n n , L L L , a context dimension m m m where relevant, and, for the sample-and-hold context, the discount γ \gamma γ . Raw records, statistics, Krylov directions, duals, reduced matrices, and sampled iterates are activations. Routes may depend on public quantities and on the current stage, never on task values; only the gates computed in the forward pass decide how many candidate tokens survive release.
Coverage and Empirical Scope
Full state coverage means N i > 0 N_i > 0 N i > 0 for every state; it does not require every transition i → j i \to j i → j to be observed. It makes the empirical rows, reward means, and the visitation normalization in (1) well defined, and expanding the sample update gives the closed form v ^ ℓ = ∑ j < ℓ A ^ j r ^ \hat{v}_{\ell} = \sum_{j<\ell}\hat{A}^{j}\hat{r} v ^ ℓ = ∑ j < ℓ A ^ j r ^ without any independence assumption. Coverage neither implies that P ^ \hat{P} P ^ is irreducible nor controls the statistical error of v ^ ℓ \hat{v}_{\ell} v ^ ℓ relative to the population trajectory; the statistical error is measured separately in Appendix § 17 .§ 4 . The exact results and the memory law of Appendix § 12 require no irreducibility. The stationary-norm statements of § 4.2 add their own positive-stationary-distribution or contraction condition. For data that do not cover every state, a completion or a restricted query domain must be specified before the target is defined; we do not impute missing rows.
Token Layout and Selector Heads
Every encoder token has the same block layout, so that one selector matrix E a E_a E a addresses block a a a in every token. The blocks are, in order: three width-n n n blocks id, succ, and slot for the current state, the successor state, and the candidate-position tag; three scalars one, γ \gamma γ , and rew for a constant, the input discount, and the observed reward; the statistics counts ∈ R n \in\mathbb{R}^{n} ∈ R n , rsum, visits, and inv; the model blocks Prow, Arow ∈ R n \in\mathbb{R}^{n} ∈ R n , r, and a work vector Rvec ∈ R n \in\mathbb{R}^{n} ∈ R n ; the Krylov blocks B B B , dual, A B AB A B , Hcol, Hminus, Y ∈ R n Y \in\mathbb{R}^{n} Y ∈ R n with the scalars norm, α \alpha α , g g g , and gate. The total width is 13 n + 11 13n+11 13 n + 11 . A head is specified by its key block k k k , query block q q q , value block v v v , output block o o o , and sign σ \sigma σ , meaning P = σ E o T E v P = \sigma E_o^{\mathsf{T}} E_v P = σ E o T E v and Q = E k T E q Q = E_k^{\mathsf{T}} E_q Q = E k T E q in (2); equivalently W K = E k W_K = E_k W K = E k , W Q = E q W_Q = E_q W Q = E q , W V = E v W_V = E_v W V = E v , W O = σ E o T W_O = \sigma E_o^{\mathsf{T}} W O = σ E o T , so every nonzero projection entry is ± 1 \pm1 ± 1 . All heads of one layer read the activations before any head writes, which is what makes simultaneous projection subtraction possible; if a block is overwritten, a fixed linear reset clears it first.
Stage 1: Raw Records to Statistics
Let E S = [ e S 0 , … , e S N − 1 ] E_S = [e_{S_0}, \ldots, e_{S_{N-1}}] E S = [ e S 0 , … , e S N − 1 ] , E S + = [ e S 1 , … , e S N ] E_{S+} = [e_{S_1}, \ldots, e_{S_N}] E S + = [ e S 1 , … , e S N ] , and R + T = [ R 1 , … , R N ] R_+^{\mathsf{T}} = [R_1, \ldots, R_N] R + T = [ R 1 , … , R N ] . Displaying the transpose of the active-token matrix, with the raw tokens in the first block row and the state tokens in the second,
( U 0 ( 1 ) ) T = [ E S T E S + T R + 1 N 0 0 0 0 1 n γ 1 n ] , i d s u c c r e w o n e γ (8) \left(U_0^{(1)}\right)^{\mathsf{T}} =
\begin{bmatrix}
E_S^{\mathsf{T}} & E_{S+}^{\mathsf{T}} & R_+ & \mathbf{1}_N & 0 \\
0 & 0 & 0 & \mathbf{1}_n & \gamma\mathbf{1}_n
\end{bmatrix},
\qquad
\underset{\mathrm{id}\quad\mathrm{succ}\quad\mathrm{rew}\quad\mathrm{one}\quad\gamma}{} \tag*{(8)} ( U 0 ( 1 ) ) T = [ E S T 0 E S + T 0 R + 0 1 N 1 n 0 γ 1 n ] , id succ rew one γ (8)
where the statistic blocks of the state tokens are initialized to zero. To aggregate raw records into state statistics, every raw token t t t is routed to every state token with Q m a t c h [ i d , i d ] = I n Q_{\mathrm{match}}[\mathrm{id},\mathrm{id}] = I_n Q match [ id , id ] = I n , so that the score between raw token t t t and state token i i i is e S t e i T = 1 { S t = i } e_{S_t}e_i^{\mathsf{T}} = \mathbf{1}\{S_t=i\} e S t e i T = 1 { S t = i } . Keeping this score, three heads with value–output maps P c o u n t [ c o u n t s , s u c c ] = I n P_{\mathrm{count}}[\mathrm{counts},\mathrm{succ}] = I_n P count [ counts , succ ] = I n , P r e w a r d [ r s u m , r e w ] = 1 P_{\mathrm{reward}}[\mathrm{rsum},\mathrm{rew}] = 1 P reward [ rsum , rew ] = 1 , and P v i s i t [ v i s i t s , o n e ] = 1 P_{\mathrm{visit}}[\mathrm{visits},\mathrm{one}] = 1 P visit [ visits , one ] = 1 give
u i s t a t e [ c o u n t s ] = N i , : , u i s t a t e [ r s u m ] = ∑ t : S t = i R t + 1 , u i s t a t e [ v i s i t s ] = N i . u_i^{\mathrm{state}}[\mathrm{counts}] = N_{i,:}, \qquad
u_i^{\mathrm{state}}[\mathrm{rsum}] = \sum_{t:S_t=i} R_{t+1}, \qquad
u_i^{\mathrm{state}}[\mathrm{visits}] = N_i. u i state [ counts ] = N i , : , u i state [ rsum ] = t : S t = i ∑ R t + 1 , u i state [ visits ] = N i .
Then u i s t a t e [ i n v ] = recip 0 ( N i ) u_i^{\mathrm{state}}[\mathrm{inv}] = \operatorname{recip}_0(N_i) u i state [ inv ] = recip 0 ( N i ) . With state self-routing and Q n o r m [ o n e , i n v ] = 1 Q_{\mathrm{norm}}[\mathrm{one},\mathrm{inv}] = 1 Q norm [ one , inv ] = 1 , the heads P P [ P r o w , c o u n t s ] = I n P_P[\mathrm{Prow},\mathrm{counts}] = I_n P P [ Prow , counts ] = I n and P r [ r , r s u m ] = 1 P_r[r,\mathrm{rsum}] = 1 P r [ r , rsum ] = 1 produce u i s t a t e [ P r o w ] = N i , : / N i = P ^ i , : u_i^{\mathrm{state}}[\mathrm{Prow}] = N_{i,:}/N_i = \hat{P}_{i,:} u i state [ Prow ] = N i , : / N i = P ^ i , : and u i s t a t e [ r ] = r ^ i u_i^{\mathrm{state}}[r] = \hat{r}_i u i state [ r ] = r ^ i , and a further self-routed head with Q γ [ o n e , γ ] = 1 Q_\gamma[\mathrm{one},\gamma] = 1 Q γ [ one , γ ] = 1 and P A [ A r o w , P r o w ] = I n P_A[\mathrm{Arow},\mathrm{Prow}] = I_n P A [ Arow , Prow ] = I n gives u i s t a t e [ A r o w ] = γ P ^ i , : = A ^ i , : u_i^{\mathrm{state}}[\mathrm{Arow}] = \gamma\hat{P}_{i,:} = \hat{A}_{i,:} u i state [ Arow ] = γ P ^ i , : = A ^ i , : . The raw tokens are then released. Because the three aggregation heads are sums over raw tokens with a fixed query per state token, they can be evaluated one chunk of C C C records at a time, adding each chunk’s contribution before the next chunk is loaded, as in the recurrent form of linear attention [19 ] ; the result is identical and the live raw storage is O ( C n ) O(Cn) O ( C n ) rather than O ( N n ) O(Nn) O ( N n ) . Our implementation uses this chunked evaluation.
The State-Level Context
Before compressing further, note that the n n n state tokens already form an exact n n n -dimensional context representation. Take B = I n B=I_n B = I n , Y = A ^ T Y=\widehat{A}^{\mathsf{T}} Y = A T , and s 0 = r ^ s_0=\widehat{r} s 0 = r , i.e.,
Z ‾ 0 ( q ) = [ I n e q A ^ T 0 r ^ T 0 ] ∈ R ( 2 n + 1 ) × ( n + 1 ) , (9) \overline{Z}_0(q)=
\begin{bmatrix}
I_n & e_q\\
\widehat{A}^{\mathsf{T}} & 0\\
\widehat{r}^{\mathsf{T}} & 0
\end{bmatrix}
\in\mathbb{R}^{(2n+1)\times(n+1)}, \tag*{(9)} Z 0 ( q ) = I n A T r T e q 0 0 ∈ R ( 2 n + 1 ) × ( n + 1 ) , (9)
so that the i i i th source token contains its state identity e i e_i e i , its discounted empirical transition row, and its empirical reward. With the executor (5) and mask M n = diag ( I n , 0 ) M_n=\operatorname{diag}(I_n,0) M n = diag ( I n , 0 ) , Lemma A.2 gives s ℓ + 1 = [ I + ( A ^ T − I ) T I ] s ℓ = A ^ s ℓ s_{\ell+1}=[I+(\widehat{A}^{\mathsf{T}}-I)^{\mathsf{T}}I]s_\ell=\widehat{A}s_\ell s ℓ + 1 = [ I + ( A T − I ) T I ] s ℓ = A s ℓ , hence s ℓ = A ^ ℓ r ^ s_\ell=\widehat{A}^{\ell}\widehat{r} s ℓ = A ℓ r and − c ℓ = e q T ∑ j < ℓ A ^ j r ^ = v ^ ℓ ( q ) -c_\ell=e_q^{\mathsf{T}}\sum_{j<\ell}\widehat{A}^{j}\widehat{r}=\widehat{v}_\ell(q) − c ℓ = e q T ∑ j < ℓ A j r = v ℓ ( q ) . The first 2 n 2n 2 n rows never change, so the sampled RL information and the query remain intact throughout the forward pass, and the empirical value is exactly recoverable after compressing N N N records into n n n state tokens. This is the context on which the learnability analysis of § 4.3 operates.
Stage 2: Discovering and Compiling Krylov Directions
Let h = min { n , L } h=\min\{n,L\} h = min { n , L } . Stage 2 retains the n n n state tokens, introduces one work token, and allocates h h h candidate tokens with fixed position tags J h = [ e 1 , … , e h ] J_h=[e_1,\ldots,e_h] J h = [ e 1 , … , e h ] in the block slot:
( U 0 ( 2 ) ) T = [ I n 1 n A ^ r ^ 0 0 1 0 0 0 0 1 h 0 0 J h T ] , (10) \left(U_0^{(2)}\right)^{\mathsf{T}}=
\begin{bmatrix}
I_n & \mathbf{1}_n & \widehat{A} & \widehat{r} & 0\\
0 & 1 & 0 & 0 & 0\\
0 & \mathbf{1}_h & 0 & 0 & J_h^{\mathsf{T}}
\end{bmatrix}, \tag*{(10)} ( U 0 ( 2 ) ) T = I n 0 0 1 n 1 1 h A 0 0 r 0 0 0 0 J h T , (10)
where the block rows are the state, work, and candidate tokens. Each candidate token j j j uses B B B for the current Krylov direction b j b_j b j , norm for d j = b j T b j d_j=b_j^{\mathsf{T}}b_j d j = b j T b j , α \alpha α for recip 0 ( d j ) \operatorname{recip}_0(d_j) recip 0 ( d j ) , dual for ω j \omega_j ω j , A B AB A B for A ^ b j \widehat{A}b_j A b j , Hcol for a column of the reduced operator, Hminus for that column minus its tag, Y Y Y for the compiled block, g g g for the initial reduced coefficient, and gate for the active-direction indicator; these blocks start at zero.
Initialization and one Arnoldi round. A state-to-work head with Q g a t h e r [ r , o n e ] = 1 Q_{\mathrm{gather}}[r,\mathrm{one}]=1 Q gather [ r , one ] = 1 and P g a t h e r [ R v e c , i d ] = I n P_{\mathrm{gather}}[\mathrm{Rvec},\mathrm{id}]=I_n P gather [ Rvec , id ] = I n forms u w o r k [ R v e c ] = ∑ i e i r ^ i = r ^ u^{\mathrm{work}}[\mathrm{Rvec}]=\sum_i e_i\widehat{r}_i=\widehat{r} u work [ Rvec ] = ∑ i e i r i = r , which a work-to-candidate copy (Q [ o n e , o n e ] = 1 Q[\mathrm{one},\mathrm{one}]=1 Q [ one , one ] = 1 , P [ B , R v e c ] = I n P[B,\mathrm{Rvec}]=I_n P [ B , Rvec ] = I n ) writes into the first candidate as b 1 = r ^ b_1=\widehat{r} b 1 = r . At round j j j , candidate self-attention forms the squared norm (Q [ B , B ] = I n Q[B,B]=I_n Q [ B , B ] = I n , P [ n o r m , o n e ] = 1 P[\mathrm{norm},\mathrm{one}]=1 P [ norm , one ] = 1 ), then α j = recip 0 ( d j ) \alpha_j=\operatorname{recip}_0(d_j) α j = recip 0 ( d j ) , the dual ω j = α j b j \omega_j=\alpha_jb_j ω j = α j b j (Q [ o n e , α ] = 1 Q[\mathrm{one},\alpha]=1 Q [ one , α ] = 1 , P [ d u a l , B ] = I n P[\mathrm{dual},B]=I_n P [ dual , B ] = I n ), and the gate η j = d j α j \eta_j=d_j\alpha_j η j = d j α j (Q [ n o r m , α ] = 1 Q[\mathrm{norm},\alpha]=1 Q [ norm , α ] = 1 , P [ g a t e , o n e ] = 1 P[\mathrm{gate},\mathrm{one}]=1 P [ gate , one ] = 1 ). The operator application and the projection use
Q o p [ A r o w , B ] = I n , P o p [ A B , i d ] = I n , Q p r o j [ d u a l , B ] = I n , P p r o j [ B , B ] = − I n , Q_{\mathrm{op}}[\mathrm{Arow},B]=I_n,\qquad P_{\mathrm{op}}[AB,\mathrm{id}]=I_n,\qquad Q_{\mathrm{proj}}[\mathrm{dual},B]=I_n,\qquad P_{\mathrm{proj}}[B,B]=-I_n, Q op [ Arow , B ] = I n , P op [ A B , id ] = I n , Q proj [ dual , B ] = I n , P proj [ B , B ] = − I n ,
routed from the states to candidate j j j and from candidates 1 , … , j 1,\ldots,j 1 , … , j to candidate j + 1 j+1 j + 1 respectively, after a copy of A B AB A B from candidate j j j into the block B B B of candidate j + 1 j+1 j + 1 . Thus u j c a n d [ A B ] = ∑ i e i ( A ^ i , b j ) = A ^ b j u_j^{\mathrm{cand}}[AB]=\sum_i e_i(\widehat{A}_i,b_j)=\widehat{A}b_j u j cand [ A B ] = ∑ i e i ( A i , b j ) = A b j and b j + 1 = A ^ b j − ∑ i ≤ j b i ω i T A ^ b j b_{j+1}=\widehat{A}b_j-\sum_{i\leq j}b_i\omega_i^{\mathsf{T}}\widehat{A}b_j b j + 1 = A b j − ∑ i ≤ j b i ω i T A b j , which is (3) . Since η j = 1 { b j ≠ 0 } \eta_j=\mathbf{1}\{b_j\ne0\} η j = 1 { b j = 0 } and breakdown is permanent (Lemma A.3), ( η 1 , … , η h ) = ( 1 k L , 0 h − k L ) (\eta_1,\ldots,\eta_h)=(\mathbf{1}^{k_L},0^{h-k_L}) ( η 1 , … , η h ) = ( 1 k L , 0 h − k L ) , and token release keeps exactly the first k L k_L k L candidates.
Compilation. With B = [ b 1 , … , b k L ] B=[b_1,\ldots,b_{k_L}] B = [ b 1 , … , b k L ] and Ω = [ ω 1 , … , ω k L ] \Omega=[\omega_1,\ldots,\omega_{k_L}] Ω = [ ω 1 , … , ω k L ] , heads over all candidate pairs form the reduced operator column by column with Q H [ d u a l , A B ] = I n Q_H[\mathrm{dual},AB]=I_n Q H [ dual , A B ] = I n and P H [ H c o l , s l o t ] = I n P_H[\mathrm{Hcol},\mathrm{slot}]=I_n P H [ Hcol , slot ] = I n , so that candidate t t t receives ∑ i e i ( ω i T A ^ b t ) \sum_i e_i(\omega_i^{\mathsf{T}}\widehat{A}b_t) ∑ i e i ( ω i T A b t ) , the t t t th column of H = Ω T A ^ B H=\Omega^{\mathsf{T}}\widehat{A}B H = Ω T A B ; a copy and a subtraction of the tag form Hminus[Hcol − - − slot; a copy of B B B into Y Y Y followed by Q Y [ H m i n u s , s l o t ] = I n Q_Y[\mathrm{Hminus},\mathrm{slot}]=I_n Q Y [ Hminus , slot ] = I n , P Y [ Y , d u a l ] = I n P_Y[Y,\mathrm{dual}]=I_n P Y [ Y , dual ] = I n adds ∑ i ω i ( H t i − δ t i ) \sum_i\omega_i(H_{ti}-\delta_{ti}) ∑ i ω i ( H t i − δ t i ) to candidate t t t , giving Y = B + Ω ( H − I ) T Y=B+\Omega(H-I)^{\mathsf{T}} Y = B + Ω ( H − I ) T ; and a work-to-candidate head with Q g [ R v e c , d u a l ] = I n Q_g[\mathrm{Rvec},\mathrm{dual}]=I_n Q g [ Rvec , dual ] = I n , P g [ g , o n e ] = 1 P_g[g,\mathrm{one}]=1 P g [ g , one ] = 1 gives g t = ω t T r ^ g_t=\omega_t^{\mathsf{T}}\widehat{r} g t = ω t T r . The retained context is (4). In total the exact schedule uses 6 h + 12 6h+12 6 h + 12 head calls, two reciprocal overwrites, and explicit release. Seven further heads implement the terminal correction used by Krylov truncation. in Appendix D.6: they gather g g g into the work vector, advance it through m m m reduced multiplications by H H H (key slot, query Rvec, value Hcol into A B AB A B , then copied back into Rvec), read the leading coefficient, and subtract H m g H^{m}g H m g from the last column of H H H through a gate and a scaled inverse.
Balancing. The implementation used in the experiments additionally rescales each active candidate to unit ℓ 1 \ell_1 ℓ 1 norm before it is used, with ∥ b j ∥ 1 \lVert b_j\rVert_1 ∥ b j ∥ 1 formed by a ReLU absolute value and a summation head, and applies the projection subtraction twice. Balancing multiplies b j b_j b j and divides ω j \omega_j ω j by the same positive scalar, so B Ω ⊤ B\Omega^\top B Ω ⊤ , H H H , g g g , and the executed trajectory are unchanged (Lemma D.10), while the dual entries stay bounded (Appendix H.7).
Linear Features: Proof of Theorem 4.4
Stage 1 for features. Raw token t t t carries ( ϕ t , ϕ t − γ ϕ t ′ , R t + 1 ) (\phi_t,\phi_t-\gamma\phi'_t,R_{t+1}) ( ϕ t , ϕ t − γ ϕ t ′ , R t + 1 ) , where the difference block is a fixed linear map of the input ( ϕ t , ϕ t ′ ) (\phi_t,\phi'_t) ( ϕ t , ϕ t ′ ) and the public γ \gamma γ ; coordinate token i ∈ [ d ] i\in[d] i ∈ [ d ] carries e i e_i e i with zero-initialized blocks A c o l ∈ R d A_{\mathrm{col}}\in\mathbb{R}^d A col ∈ R d and b b b . Two heads routed from every raw token to every coordinate token, with key ϕ \phi ϕ and query id, so that the score between raw token t t t and coordinate token i i i is ϕ i ( S t ) \phi_i(S_t) ϕ i ( S t ) , and with values ϕ t − γ ϕ t ′ \phi_t-\gamma\phi'_t ϕ t − γ ϕ t ′ and R t + 1 R_{t+1} R t + 1 , give
u i [ A c o l ] = ∑ t ϕ i ( S t ) ( ϕ t − γ ϕ t ′ ) = ( A N ) i , : , u i [ b ] = ∑ t ϕ i ( S t ) R t + 1 = ( b N ) i . \begin{aligned}
u_i[A_{\mathrm{col}}]&=\sum_t\phi_i(S_t)(\phi_t-\gamma\phi'_t)=(A_N)_{i,:},\\
u_i[b]&=\sum_t\phi_i(S_t)R_{t+1}=(b_N)_i.
\end{aligned} u i [ A col ] u i [ b ] = t ∑ ϕ i ( S t ) ( ϕ t − γ ϕ t ′ ) = ( A N ) i , : , = t ∑ ϕ i ( S t ) R t + 1 = ( b N ) i .
A self-routed head with key one, query the public α \alpha α , value Acol, output Arow, and σ = − 1 \sigma=-1 σ = − 1 , followed by adding id, forms A r o w = e i − α ( A N ) i , : = M i , : A_{\mathrm{row}}=e_i-\alpha(A_N)_{i,:}=M_{i,:} A row = e i − α ( A N ) i , : = M i , : , and the same head on b b b forms s 0 = α b N s_0=\alpha b_N s 0 = α b N . No reciprocal is used in this stage: in the tabular case the visitation normalization 1 / N i 1/N_i 1/ N i is what requires recip 0 \operatorname{recip}_0 recip 0 , whereas (6) is un-normalized. As in Appendix A.3, the sums can be streamed one chunk at a time. Stage 2 (Appendix A.5) runs unchanged on ( M , s 0 ) (M,s_0) ( M , s 0 ) in place of ( A ^ , r ^ ) (\widehat A,\widehat r) ( A , r ) , including its reciprocals recip 0 ( d j ) \operatorname{recip}_0(d_j) recip 0 ( d j ) in ω j \omega_j ω j and η j \eta_j η j ; the reciprocal-free claim of Theorem 4.4(b) concerns Stage 1 only. Nothing in Lemmas A.3 and A.4 uses stochasticity of the operator.
Proof of Theorem 4.4. (a) The increments θ j + 1 − θ j = M j s 0 = D s j \theta_{j+1}-\theta_j=M_js_0=Ds_j θ j + 1 − θ j = M j s 0 = D s j lie in col ( D ) \operatorname{col}(D) col ( D ) for j < L j<L j < L , so m ≥ rank D ≥ k L ϕ m\ge\operatorname{rank}D\ge k_L^\phi m ≥ rank D ≥ k L ϕ ; the Krylov context of (b) attains it. (b) By the heads above, the coordinate tokens carry ( M , s 0 ) (M,s_0) ( M , s 0 ) exactly. Lemmas A.3 and A.4 applied to ( M , s 0 ) (M,s_0) ( M , s 0 ) give the context [ B ; Y ; g ⊤ ] [B;Y;g^\top] [ B ; Y ; g ⊤ ] with exactly k L ϕ k_L^\phi k L ϕ tokens, and the argument of Theorem 4.3(b) gives s ℓ = H ℓ g s_\ell=H^\ell g s ℓ = H ℓ g and − c ℓ ( q ) = ϕ ( q ) ⊤ B ∑ j < ℓ H j g = ϕ ( q ) ⊤ ∑ j < ℓ M j s 0 = ϕ ( q ) ⊤ θ ℓ -c_\ell(q)=\phi(q)^\top B\sum_{j<\ell}H^jg=\phi(q)^\top\sum_{j<\ell}M^js_0=\phi(q)^\top\theta_\ell − c ℓ ( q ) = ϕ ( q ) ⊤ B ∑ j < ℓ H j g = ϕ ( q ) ⊤ ∑ j < ℓ M j s 0 = ϕ ( q ) ⊤ θ ℓ , where the query token carries ϕ ( q ) \phi(q) ϕ ( q ) in its first block. The memory counts are those of Appendix A.14 with d d d for n n n ; Stage 1 keeps a chunk of raw tokens of width 2 d + 1 2d+1 2 d + 1 and d d d coordinate tokens of width O ( d ) O(d) O ( d ) . (c) Fix a base pair ( M 0 , s 0 ) (M_0,s_0) ( M 0 , s 0 ) with dim K L ( M 0 , s 0 ) = k \dim\mathcal{K}_L(M_0,s_0)=k dim K L ( M 0 , s 0 ) = k in the open set, put Δ 0 = [ s 0 , M 0 s 0 , … , M 0 k − 1 s 0 ] \Delta_0=[s_0,M_0s_0,\ldots,M_0^{k-1}s_0] Δ 0 = [ s 0 , M 0 s 0 , … , M 0 k − 1 s 0 ] and M 0 k s 0 = Δ 0 α 0 M_0^ks_0=\Delta_0\alpha_0 M 0 k s 0 = Δ 0 α 0 . For θ = ( θ 0 , Δ ) ∈ R d × k × R k \theta=(\theta_0,\Delta)\in\mathbb{R}^{d\times k}\times\mathbb{R}^k θ = ( θ 0 , Δ ) ∈ R d × k × R k near θ 0 \theta_0 θ 0 define, with the companion matrix C ( α ) C(\alpha) C ( α ) of Lemma C.3, M ( θ ) = M 0 + ( Δ C ( α ) − M 0 Δ ) Δ + M(\theta)=M_0+(\Delta C(\alpha)-M_0\Delta)\Delta^+ M ( θ ) = M 0 + ( Δ C ( α ) − M 0 Δ ) Δ + and s ( θ ) = Δ e 1 s(\theta)=\Delta e_1 s ( θ ) = Δ e 1 . Near θ 0 \theta_0 θ 0 , Δ \Delta Δ has full column rank, so Δ + \Delta^+ Δ + is continuous, M ( θ ) Δ = Δ C ( α ) M(\theta)\Delta=\Delta C(\alpha) M ( θ ) Δ = Δ C ( α ) , and hence M ( θ ) j s ( θ ) = Δ C ( α ) j e 1 M(\theta)^js(\theta)=\Delta C(\alpha)^je_1 M ( θ ) j s ( θ ) = Δ C ( α ) j e 1 : the Krylov dimension is k k k and the pair stays on the open set for θ \theta θ close to θ 0 \theta_0 θ 0 . The trajectory determines Δ \Delta Δ (the first k k k increments) and then α \alpha α (the ( k + 1 ) (k+1) ( k + 1 ) st increment, using L ≥ k + 1 L\ge k+1 L ≥ k + 1 ), so Enc composed with θ ↦ ( M ( θ ) , s ( θ ) ) \theta\mapsto(M(\theta),s(\theta)) θ ↦ ( M ( θ ) , s ( θ )) is a continuous injection of an open subset of R d k + k \mathbb{R}^{dk+k} R d k + k , and invariance of domain gives M ≥ d k + k M\ge dk+k M ≥ d k + k exactly as in the proof of Theorem C.1(1). The context of (b) retains ( 2 d + 1 ) k (2d+1)k ( 2 d + 1 ) k registers, within the factor ( 2 d + 1 ) / ( d + 1 ) < 2 (2d+1)/(d+1)<2 ( 2 d + 1 ) / ( d + 1 ) < 2 .
Executors
Definition A.1 (Time-invariant and depth-counter executors). An m m m -dimensional context has static source blocks X , Y ∈ R n × m X,Y\in\mathbb{R}^{n\times m} X , Y ∈ R n × m , source scalars s 0 ∈ R m s_0\in\mathbb{R}^m s 0 ∈ R m , and a query token ( e q , θ n , c 0 = 0 ) (e_q,\theta_n,c_0=0) ( e q , θ n , c 0 = 0 ) , so that Z ‾ 0 ( q ) = [ X , e q ; Y , θ n ; s 0 ⊤ , 0 ] \overline Z_0(q)=[X,e_q;Y,\theta_n;s_0^\top,0] Z 0 ( q ) = [ X , e q ; Y , θ n ; s 0 ⊤ , 0 ] . The time-invariant executor is the looped layer (5) with mask M m = diag ‾ ( I m , 0 ) M_m=\overline{\operatorname{diag}}(I_m,0) M m = diag ( I m , 0 ) ; its output is − c ℓ -c_\ell − c ℓ , and it gives s ℓ + 1 = [ I + ( Y − X ) ⊤ X ] s ℓ s_{\ell+1}=[I+(Y-X)^\top X]s_\ell s ℓ + 1 = [ I + ( Y − X ) ⊤ X ] s ℓ and c ℓ + 1 = c ℓ − e q ⊤ X ∑ j ≤ ℓ s j c_{\ell+1}=c_\ell-e_q^\top X\sum_{j\le\ell}s_j c ℓ + 1 = c ℓ − e q ⊤ X ∑ j ≤ ℓ s j . The depth-counter executor replaces the public time stamps τ u \tau_u τ u and a counter t ℓ = ℓ t_\ell=\ell t ℓ = ℓ : the gate s ℓ , u = 1 − δ 2 recip 0 ( δ 2 ) s_{\ell,u}=1-\delta^2\operatorname{recip}_0(\delta^2) s ℓ , u = 1 − δ 2 recip 0 ( δ 2 ) with δ = t ℓ + 1 − τ u \delta=t_\ell+1-\tau_u δ = t ℓ + 1 − τ u equals 1 { ℓ + 1 = τ u } \mathbf{1}\{\ell+1=\tau_u\} 1 { ℓ + 1 = τ u } , and the same query head gives − c ℓ = ∑ u : τ u ≤ ℓ e q ⊤ x u -c_\ell=\sum_{u:\tau_u\le\ell}e_q^\top x_u − c ℓ = ∑ u : τ u ≤ ℓ e q ⊤ x u .
In both cases − c ℓ ( q ) = e q ⊤ X ∑ j < ℓ s j -c_\ell(q)=e_q^\top X\sum_{j<\ell}s_j − c ℓ ( q ) = e q ⊤ X ∑ j < ℓ s j , so every output is an m m m -dimensional context representation in the sense of Definition 4.1 with D = X D=X D = X . The time-invariant executor realizes the recurrences s ℓ + 1 = K s ℓ s_{\ell+1}=Ks_{\ell} s ℓ + 1 = K s ℓ , which is how looped attention without timestep information behaves Yang et al. [51 ] ; the depth-counter executor adds a timestep signal in the sense of Xu & Sato [50 ] . The two can share a looped block and write into one query scalar.
Lemma A.2 (Executor identities). For any query-independent X X X , Y Y Y , s 0 s_0 s 0 , the time-invariant executor satisfies s ℓ + 1 = [ I + ( Y − X ) T X ] s ℓ s_{\ell+1}=[I+(Y-X)^{\mathsf{T}}X]s_{\ell} s ℓ + 1 = [ I + ( Y − X ) T X ] s ℓ and c ℓ + 1 − c ℓ = − e q T X s ℓ c_{\ell+1}-c_{\ell}=-e_q^{\mathsf{T}}Xs_{\ell} c ℓ + 1 − c ℓ = − e q T X s ℓ . For the depth-counter executor,
c ℓ + 1 − c ℓ = − ∑ u 1 { ℓ + 1 = τ u } e q T x u . c_{\ell+1}-c_{\ell}=-\sum_u \mathbf{1}\{\ell+1=\tau_u\}e_q^{\mathsf{T}}x_u. c ℓ + 1 − c ℓ = − u ∑ 1 { ℓ + 1 = τ u } e q T x u .
Proof. The only nonzero entry of P T D P_{\mathrm{TD}} P TD is its last diagonal entry, so static rows never change. The score between source tokens i i i and t t t is x i T ( y t − x t ) x_i^{\mathsf{T}}(y_t-x_t) x i T ( y t − x t ) and the source–query score is − x i T e q -x_i^{\mathsf{T}}e_q − x i T e q . Transposing the last-row update gives both identities. The masked query never acts as a source, so the source scalars do not depend on q q q . For the depth-counter executor, δ 2 recip 0 ( δ 2 ) = 1 { δ ≠ 0 } \delta^2\operatorname{recip}_0(\delta^2)=\mathbf{1}\{\delta\ne0\} δ 2 recip 0 ( δ 2 ) = 1 { δ = 0 } because δ 2 ≥ 0 \delta^2\ge0 δ 2 ≥ 0 , and the query head is identical.
Exactness and Minimality
Lemma A.3 (Primal–dual orthogonality and saturation). In exact arithmetic, the nonzero vectors produced by (3) are mutually orthogonal, their duals satisfy ω i T b j = δ i j \omega_i^{\mathsf{T}}b_j=\delta_{ij} ω i T b j = δ ij , and a zero candidate is followed only by zeros. After h = min { n , L } h=\min\{n,L\} h = min { n , L } rounds the nonzero columns span K L \mathcal{K}_L K L , and their number is k L k_L k L .
Proof. If b j ≠ 0 b_j\ne0 b j = 0 , then d j > 0 d_j>0 d j > 0 and ω j = b j / d j \omega_j=b_j/d_j ω j = b j / d j . If the preceding columns are nonzero and orthogonal, then for p ≤ j p\le j p ≤ j , b p T b j + 1 = b p T A ^ b j − ∑ i ≤ j b p T b i ω i T A ^ b j = 0 b_p^{\mathsf{T}}b_{j+1}=b_p^{\mathsf{T}}\widehat{A}b_j-\sum_{i\le j}b_p^{\mathsf{T}}b_i\omega_i^{\mathsf{T}}\widehat{A}b_j=0 b p T b j + 1 = b p T A b j − ∑ i ≤ j b p T b i ω i T A b j = 0 . A zero b j b_j b j gives d j = 0 d_j=0 d j = 0 , ω j = 0 \omega_j=0 ω j = 0 , A ^ b j = 0 \widehat{A}b_j=0 A b j = 0 , and hence b j + 1 = 0 b_{j+1}=0 b j + 1 = 0 . Before breakdown, induction gives b j = A ^ j − 1 r ^ + u j b_j=\widehat{A}^{j-1}\widehat{r}+u_j b j = A j − 1 r + u j with u j ∈ K j − 1 u_j\in\mathcal{K}_{j-1} u j ∈ K j − 1 , so the first j j j columns span K j \mathcal{K}_j K j . If b k + 1 = 0 b_{k+1}=0 b k + 1 = 0 after k k k nonzero columns, the rearranged recurrence A ^ b i = b i + 1 + ∑ p ≤ i b p ω p T A ^ b i \widehat{A}b_i=b_{i+1}+\sum_{p\le i}b_p\omega_p^{\mathsf{T}}\widehat{A}b_i A b i = b i + 1 + ∑ p ≤ i b p ω p T A b i shows that the first k k k columns span an invariant subspace containing r ^ \widehat{r} r . If no breakdown occurs, the h h h columns span K h = K L \mathcal{K}_h=\mathcal{K}_L K h = K L when L ≤ n L\le n L ≤ n , and R n \mathbb{R}^n R n otherwise. The case r ^ = 0 \widehat{r}=0 r = 0 gives the zero sequence.
Lemma A.4 (Forward compilation). The heads of Appendix A.5 form (4), and every inactive candidate carries a zero payload.
Proof. With candidate tags p i p_i p i , the reduced-column head produces h j = ∑ i p i ( ω i T A ^ b j ) h_j=\sum_i p_i(\omega_i^{\mathsf{T}}\widehat{A}b_j) h j = ∑ i p i ( ω i T A b j ) , whose coordinates form column j j j of the padded H H H . The scalar head gives g j = ω j T r ^ g_j=\omega_j^{\mathsf{T}}\widehat{r} g j = ω j T r . The compilation head writes y j = b j + ∑ i ω i ( h i − p i ) T p j = b j + ∑ i ω i ( H j i − δ j i ) y_j=b_j+\sum_i\omega_i(h_i-p_i)^{\mathsf{T}}p_j=b_j+\sum_i\omega_i(H_{ji}-\delta_{ji}) y j = b j + ∑ i ω i ( h i − p i ) T p j = b j + ∑ i ω i ( H j i − δ j i ) , which on active columns is B + Ω ( H − I ) T B+\Omega(H-I)^{\mathsf{T}} B + Ω ( H − I ) T . For j > k L j>k_L j > k L all of b j b_j b j , ω j \omega_j ω j , A ^ b j \widehat{A}b_j A b j vanish, so the corresponding row and column of H H H and the entries g j , y j g_j,y_j g j , y j are zero. The gate d j recip 0 ( d j ) d_j\operatorname{recip}_0(d_j) d j recip 0 ( d j ) is one exactly on nonzero columns, and by Lemma A.3 the gate pattern is a prefix.
Proof of Theorem 4.3(a) and (b). (a) Let { Z ℓ } \{Z_\ell\} { Z ℓ } be an exact m m m -dimensional context representation with decoder D D D . Each increment A ^ j r ^ = v ^ j + 1 − v ^ j = D s j \widehat{A}^j\widehat{r}=\widehat{v}_{j+1}-\widehat{v}_j=Ds_j A j r = v j + 1 − v j = D s j lies in col ( D ) \operatorname{col}(D) col ( D ) for j < L j<L j < L , so K L ⊆ col ( D ) \mathcal{K}_L\subseteq\operatorname{col}(D) K L ⊆ col ( D ) and m ≥ rank D ≥ k L m\ge\operatorname{rank}D\ge k_L m ≥ rank D ≥ k L . The context (4) attains m = k L m=k_L m = k L by part (b).
(b) Stage 1 produces ( N i , : , ∑ t R t + 1 1 { S t = i } , N i ) (N_{i,:},\sum_t R_{t+1}\mathbf{1}\{S_t=i\},N_i) ( N i , : , ∑ t R t + 1 1 { S t = i } , N i ) in state token i i i , since ∑ t [ e S t + 1 , : , R t + 1 , 1 { e S t e i } ] \sum_t[e_{S_{t+1},:},R_{t+1},\mathbf{1}\{e_{S_t}e_i\}] ∑ t [ e S t + 1 , : , R t + 1 , 1 { e S t e i }] equals these quantities; multiplying by recip 0 ( N i ) = 1 / N i \operatorname{recip}_0(N_i)=1/N_i recip 0 ( N i ) = 1/ N i and then by γ \gamma γ yields ( A ^ i , : , r ^ i ) (\widehat{A}_{i,:},\widehat{r}_i) ( A i , : , r i ) . Lemmas A.3 and A.4 give (4) with exactly k L k_L k L retained tokens. Let Π = B Ω T \Pi=B\Omega^{\mathsf{T}} Π = B Ω T , which is an orthogonal projection onto K L \mathcal{K}_L K L because Ω = B ( B T B ) − 1 \Omega=B(B^{\mathsf{T}}B)^{-1} Ω = B ( B T B ) − 1 for orthogonal columns. Then B g ^ = Π r ^ = r ^ B\widehat{g}=\Pi\widehat{r}=\widehat{r} B g = Π r = r , and if B H j g ^ = A ^ j r ^ B H^j\widehat{g}=\widehat{A}^j\widehat{r} B H j g = A j r with j + 1 < L j+1<L j + 1 < L , then B H j + 1 g ^ = Π A ^ j + 1 r ^ = A ^ j + 1 r ^ BH^{j+1}\widehat{g}=\Pi\widehat{A}^{j+1}\widehat{r}=\widehat{A}^{j+1}\widehat{r} B H j + 1 g = Π A j + 1 r = A j + 1 r . Lemma A.2 with ( Y − B ) T B = ( H − I ) Ω T B = H − I (Y-B)^{\mathsf{T}}B=(H-I)\Omega^{\mathsf{T}}B=H-I ( Y − B ) T B = ( H − I ) Ω T B = H − I gives s ℓ = H ℓ g ^ s_\ell=H^\ell\widehat{g} s ℓ = H ℓ g and − c ℓ = e q T ∑ j < ℓ B H j g ^ = v ^ ℓ ( q ) -c_\ell=e_q^{\mathsf{T}}\sum_{j<\ell}BH^j\widehat{g}=\widehat{v}_\ell(q) − c ℓ = e q T ∑ j < ℓ B H j g = v ℓ ( q ) for ℓ ≤ L \ell\le L ℓ ≤ L . If k L < L k_L<L k L < L , breakdown implies invariance of K L \mathcal{K}_L K L , and exactness holds at every depth. The memory counts are established in Appendix A.14.
Continuity within Rank Strata
Let Σ k = { ( A ^ , r ^ ) : dim K L ( A ^ , r ^ ) = k } \Sigma_k = \{(\widehat{A}, \widehat{r}) : \dim K_L(\widehat{A}, \widehat{r}) = k\} Σ k = {( A , r ) : dim K L ( A , r ) = k } . By Lemma A.3 , the recurrence (3) depends only on ( A ^ , r ^ ) (\widehat{A}, \widehat{r}) ( A , r ) and uses neither stochasticity nor rationality, so the second stage is exact for every real input.
Lemma A.5 (Continuity within each rank stratum). Restricted to Σ k \Sigma_k Σ k , the second-stage encoder is a rational function whose denominators do not vanish on Σ k \Sigma_k Σ k . It is therefore continuous on Σ k \Sigma_k Σ k . The same holds with positive ℓ 1 \ell_1 ℓ 1 balancing, which replaces b b b by b / ∥ b ∥ 1 b/\lVert b\rVert_1 b / ∥ b ∥ 1 with ∥ b ∥ 1 \lVert b\rVert_1 ∥ b ∥ 1 computed by ReLU absolute values.
Proof. On Σ k \Sigma_k Σ k the gates are identically ( 1 k , 0 h − k ) (1^k,0^{h-k}) ( 1 k , 0 h − k ) . For j ≤ k j \le k j ≤ k , b j b_j b j is a rational function whose denominators are products of d 1 , … , d j − 1 > 0 d_1,\ldots,d_{j-1} > 0 d 1 , … , d j − 1 > 0 , so recip 0 ( d j ) = 1 / d j \operatorname{recip}_0(d_j) = 1/d_j recip 0 ( d j ) = 1/ d j is continuous there. For j > k j > k j > k every quantity is identically zero. The retained quantities H H H , g g g , Y ^ \widehat{Y} Y are polynomials in these. Balancing multiplies each active b j b_j b j by 1 / ∥ b j ∥ 1 1/\lVert b_j\rVert_1 1/ ∥ b j ∥ 1 , which is continuous away from b j = 0 b_j = 0 b j = 0 .
Rank Discontinuity across Strata
For P = [ 0 1 1 0 ] P = \begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix} P = [ 0 1 1 0 ] and r ε = ( 1 , 1 + ε ) T r_\varepsilon= (1,1+\varepsilon)^{\mathsf{T}} r ε = ( 1 , 1 + ε ) T , det [ r ε , γ P r ε ] = − γ ε ( 2 + ε ) \det[r_\varepsilon,\gamma P r_\varepsilon] = -\gamma\varepsilon(2+\varepsilon) det [ r ε , γ P r ε ] = − γ ε ( 2 + ε ) . Hence the exact rank is 1 at ε = 0 \varepsilon= 0 ε = 0 and 2 for 0 < ∣ ε ∣ < 1 0 < \lvert\varepsilon\rvert< 1 0 < ∣ ε ∣ < 1 . No finite composition of continuous maps can output the corresponding binary gate on this family, which is why recip 0 \operatorname{recip}_0 recip 0 and release are declared primitives. This is consistent with the memory law of Appendix § 12 : an exact rank-adaptive encoder must be discontinuous across strata, yet it can be continuous within each stratum (Lemma A.5 ). On an input class whose nonzero reciprocal arguments are separated from zero by a margin Δ > 0 \Delta> 0 Δ > 0 , the reciprocal can be replaced by a ReLU interpolant plus plateau gates with arbitrarily small output error and identical prefix decisions. Without a margin, tiny residuals yield large duals; positive ℓ 1 \ell_1 ℓ 1 balancing removes this growth in our experiments (Appendix § 17 .7), but a tolerance-based rank is then a numerical policy, not the algebraic rank. The numerical-rank bound of Proposition D.3 (b) and the threshold certificate of Appendix § 13 .9 give the certified replacements.
Visit-Weighted Inner Product
Replacing b T b b^{\mathsf{T}}b b T b by ⟨ b , b ⟩ w = b T D w b \langle b,b\rangle_w = b^{\mathsf{T}}D_wb ⟨ b , b ⟩ w = b T D w b with w i = N i w_i = N_i w i = N i requires two more blocks, wid = N i e i \operatorname{wid} = N_i e_i wid = N i e i in the state tokens, and DB = D w b j \operatorname{DB} = D_wb_j DB = D w b j in the candidates, and four heads: forming wid (key one, query visits, value id, state self-route), weighting B B B (key id, query B B B , value wid, states to candidate j j j ), the squared norm (key B B B , query DB, value one, self-route), and the dual (key one, query α \alpha α , value DB, self-route). The duals ω j = D w b j / ⟨ b j , b j ⟩ w \omega_j = D_wb_j/\langle b_j,b_j\rangle_w ω j = D w b j / ⟨ b j , b j ⟩ w are invariant to rescaling w w w , so no division by N N N is needed. Lemma A.3 holds for every positive definite inner product, so exactness and Lemma A.5 are unchanged. A budget-m m m encoder runs m m m rounds instead of h h h .
Sample-and-Hold Encoder and Depth-Counter Executor
The schedule T = T m ( γ ) ∩ [ 1 , L ] \mathcal{T} = \mathcal{T}_m(\gamma) \cap[1,L] T = T m ( γ ) ∩ [ 1 , L ] is public. Besides the state tokens, the encoder uses one trajectory token with blocks cur (initially 0) and inc, and m ′ = ∣ T ∣ ≤ m m' = \lvert\mathcal{T}\rvert\le m m ′ = ∣ T ∣ ≤ m sample tokens with a block y y y . Five heads suffice: an initialization head (key γ \gamma γ , query one, value id, states to trajectory, first layer only) sets inc = r ^ \operatorname{inc} = \widehat{r} inc = r ; in every layer an accumulation head (key one, query one, value inc, output cur, self-route), a step head (key Arow, query inc, value id, output inc, states to trajectory), and a clearing head (same as the accumulation head with σ = − 1 \sigma=-1 σ = − 1 and output inc) perform cur ← cur + inc \operatorname{cur} \leftarrow\operatorname{cur}+\operatorname{inc} cur ← cur + inc and inc ← A ^ inc \operatorname{inc} \leftarrow\widehat{A}\operatorname{inc} inc ← A inc , because heads read synchronously; and at layer τ u \tau_u τ u a latch head (key one, query one, value cur, output y y y , trajectory to sample u u u ) stores y u = v ^ τ u y_u=\widehat{v}_{\tau_u} y u = v τ u . By induction, layer t t t begins with cur = v ^ t \operatorname{cur}=\widehat{v}_t cur = v t and inc = A ^ T r ^ \operatorname{inc}=\widehat{A}^{\mathsf{T}}\widehat{r} inc = A T r . A difference head (route u − 1 → u u-1 \to u u − 1 → u , σ = − 1 \sigma=-1 σ = − 1 ) forms x u = y u − y u − 1 x_u=y_u-y_{u-1} x u = y u − y u − 1 . The encoder has max T + 1 ≤ L + 1 \max\mathcal{T}+1 \le L+1 max T + 1 ≤ L + 1 layers and peak O ( n 2 + n m ) O(n^2+nm) O ( n 2 + nm ) live scalars; after release the context retains m ′ ( n + 1 ) m'(n+1) m ′ ( n + 1 ) scalars, x u x_u x u and one time stamp per token. Using repeated squaring as in Appendix § 14 .§ 2 , the depth can be reduced to O ( log L ) O(\log L) O ( log L ) at the same peak.
The depth-counter executor of Definition A.1 uses the following fixed sublayers: a token-wise affine map δ ← t + 1 − τ \delta\leftarrow t+1-\tau δ ← t + 1 − τ ; a self-routed head computing δ 2 \delta^2 δ 2 ; recip 0 \operatorname{recip}_0 recip 0 ; a self-routed head computing s = 1 − δ 2 recip 0 ( δ 2 ) s=1-\delta^2\operatorname{recip}_0(\delta^2) s = 1 − δ 2 recip 0 ( δ 2 ) ; the query head (key x x x , query e q e_q e q , value s s s , σ = − 1 \sigma=-1 σ = − 1 , source tokens to query), which has the form of the TD executor’s query head; and the counter increment. If one prefers to avoid recip 0 \operatorname{recip}_0 recip 0 , an unrolled version whose layer ℓ \ell ℓ routes only the tokens with τ u = ℓ + 1 \tau_u=\ell+1 τ u = ℓ + 1 uses pure linear attention. When γ \gamma γ is an input rather than public, the schedule can be computed in the network by threshold gates on 1 − γ i 1-\gamma^{i} 1 − γ i maintained in a work token; we do not use this variant.
Krylov-Anchored Encoder
The anchored encoder of Appendix § 13 .§ 1 first runs the budget-k k k visit-weighted Krylov encoder and packs its k k k tokens. A work token then accumulates two trajectories in parallel: the TD trajectory, with the heads of Appendix § 10 .12, and the projected trajectory v ~ ℓ G = B ∑ i < t s i \widetilde{v}^{\mathrm{G}}_{\ell}=B\sum_{i<t}s_i v ℓ G = B ∑ i < t s i , using the TD executor’s source heads on the packed Krylov tokens together with a head with key s s s , query one, value B B B , and target g c u r \mathrm{gcur} gcur . At layer k + i s k+i_s k + i s a fixed linear map forms c u r − g c u r = e k + i s \mathrm{cur}-\mathrm{gcur}=e_{k+i_s} cur − gcur = e k + i s , and a latch head stores it; a difference head forms the increments. Execution uses one looped block containing both the TD source and query heads (for the Krylov tokens) and the depth-counter heads (for the residual tokens); all heads write the same query scalar, so the output is v ~ ℓ G + e σ ( ℓ ) \widetilde{v}^{\mathrm{G}}_{\ell}+e_{\sigma(\ell)} v ℓ G + e σ ( ℓ ) . The implementation matches this closed form to 2.8 × 10 − 15 2.8\times10^{-15} 2.8 × 1 0 − 15 (Appendix § 17 .§ 1 ).
Retained, Peak, and Shared Memory
The stored objects of the exact construction and their treatment are as follows. Raw transition tokens occupy O ( C n ) O(Cn) O ( C n ) locations when streamed and O ( N n ) O(Nn) O ( N n ) in a batch, and are released after Stage 1. State tokens and statistics occupy O ( n 2 ) O(n^2) O ( n 2 ) locations and are released after the context is packed. Candidates, duals, images, and the columns of H H H occupy O ( n h + h 2 ) O(nh+h^2) O ( nh + h 2 ) locations at fixed capacity h h h (or m m m ) and are released after packing. The retained context B , Y , g B,Y,g B , Y , g occupies ( 2 n + 1 ) k L (2n+1)kL ( 2 n + 1 ) k L locations, of which B B B is the decoder; the sample-and-hold tokens x u , τ u x_u,\tau_u x u , τ u occupy m ( n + 1 ) m(n+1) m ( n + 1 ) ; the query token and its accumulator occupy 2 n + 1 2n+1 2 n + 1 . Scores and workspace occupy O ( n 2 + n h ) O(n^2+nh) O ( n 2 + nh ) temporary locations and are charged at peak. The fixed selectors and routes are shared parameters and are counted separately.
Memory bounds in Theorem 4.3 (b). After packing, the context blocks occupy n k L + n k L + k L + ( 2 n + 1 ) = ( 2 n + 1 ) ( k L + 1 ) nkL+nkL+kL+(2n+1)=(2n+1)(kL+1) nk L + nk L + k L + ( 2 n + 1 ) = ( 2 n + 1 ) ( k L + 1 ) locations, which is M r e t M_{\mathrm{ret}} M ret in Definition 4.2 : the decoder D = B D=B D = B aliases the first block and is counted once, and c ℓ c_{\ell} c ℓ accumulates the queried value, so no cumulative coefficient vector is stored. During Stage 1, the state-matching heads need score blocks of size C × n C\times n C × n (or N × n N\times n N × n ) and output blocks of size n × n n\times n n × n , never an all-token square score matrix. After release, the model, candidates, reduced columns, and routed scores fit in O ( n 2 + n h ) O(n^2+nh) O ( n 2 + nh ) locations. Execution scores have k L ( k L + 1 ) kL(kL+1) k L ( k L + 1 ) entries. Hence M p e a k = O ( N n + n 2 + n h ) M_{\mathrm{peak}}=O(Nn+n^2+nh) M peak = O ( N n + n 2 + nh ) in the batch form and O ( C n + n 2 + n h ) O(Cn+n^2+nh) O ( C n + n 2 + nh ) in the streamed form. The measured peaks of our implementation appear in Appendix § 17 .§ 5 . □
Two-Head Softmax Realization of the Executors
This appendix realizes both executors of Definition A.1 with one looped layer of standard masked softmax attention with two heads. The construction is a compilation : the encoder writes log-probability codes into the tokens, and the output map applies a gain that is fixed for the whole task family. It shows that nothing in § 4.1 –E depends on the attention being linear, and it changes the retained-memory counts by at most a constant factor. It says nothing about what a trained softmax model does; the models trained in this paper are the exactor parameters of Appendix § 17 .§ 6 and the bottleneck encoders of Appendix § 17 .9. Earlier softmax compilations of TD are of the same kind [48 ] .
Reduced systems. For this appendix an m m m -dimensional context is described by a triple ( X , H , g ) (X,H,g) ( X , H , g ) with X ∈ R n × m X\in\mathbb{R}^{n\times m} X ∈ R n × m , H ∈ R m × m H\in\mathbb{R}^{m\times m} H ∈ R m × m , and g ∈ R m g\in\mathbb{R}^{m} g ∈ R m ; the executor runs s ℓ + 1 = H s ℓ s_{\ell+1}=Hs_{\ell} s ℓ + 1 = H s ℓ from s 0 = g s_0=g s 0 = g and outputs v ~ ℓ ( q ) = e q T X ∑ j ≤ ℓ s j \widetilde{v}_{\ell}(q)=e_q^{\mathsf{T}}X\sum_{j\le\ell}s_j v ℓ ( q ) = e q T X ∑ j ≤ ℓ s j . The Krylov context (4) is ( B , Ω T A ^ B , Ω T r ^ ) (B,\Omega^{\mathsf{T}}\widehat{A}B,\Omega^{\mathsf{T}}\widehat{r}) ( B , Ω T A B , Ω T r ) , with Y Y Y no longer needed because H H H is stored in the codes; the state-level prompt is ( I n , A ^ , r ^ ) (I_n,\widehat{A},\widehat{r}) ( I n , A , r ) . A family of reduced systems is admissible for the gain Λ > 0 \Lambda>0 Λ > 0 if
m max { ∥ H − I m ∥ max , ∥ X ∥ max } < Λ for every member, (11) m\max\{\lVert H-I_m\rVert_{\max},\lVert X\rVert_{\max}\}<\Lambda\qquad\text{for every member,} \tag*{(11)} m max {∥ H − I m ∥ m a x , ∥ X ∥ m a x } < Λ for every member, (11)
where ∥ ⋅ ∥ max \lVert\cdot\rVert_{\max} ∥ ⋅ ∥ m a x is the largest absolute entry.
Codes and tokens. Fix the target types T = { 0 } ∪ [ m ] ∪ { ( ⋆ , q ) : q ∈ [ n ] } \mathcal{T} = \{0\} \cup[m] \cup\{(\star,q) : q \in[n]\} T = { 0 } ∪ [ m ] ∪ {( ⋆ , q ) : q ∈ [ n ]} , of size d k = 1 + m + n d_k = 1 + m + n d k = 1 + m + n , and a bijection ι : T → [ d k ] \iota: \mathcal{T} \to[d_k] ι : T → [ d k ] that depends only on n n n and m m m . Put b ( 0 ) = 0 b^{(0)} = 0 b ( 0 ) = 0 , b ( j ) = ( H − I m ) j i b^{(j)} = (H - I_m)_{j i} b ( j ) = ( H − I m ) j i for j ∈ [ m ] j \in[m] j ∈ [ m ] , and b ( ⋆ , q ) = X q i b^{(\star,q)} = X_{q i} b ( ⋆ , q ) = X q i . For i ∈ [ m ] i \in[m] i ∈ [ m ] and t ∈ T t \in\mathcal{T} t ∈ T define the probabilities
π i ∣ t ± = 1 2 m ± b i ( t ) 2 Λ , π 0 ∣ t ± = 1 2 ∓ 1 ⊤ b ( t ) 2 Λ . (12) \pi^{\pm}_{i|t} = \frac{1}{2m} \pm\frac{b_i^{(t)}}{2\Lambda}, \qquad\pi^{\pm}_{0|t} = \frac{1}{2} \mp\frac{\mathbf{1}^{\top} b^{(t)}}{2\Lambda}. \tag*{(12)} π i ∣ t ± = 2 m 1 ± 2Λ b i ( t ) , π 0∣ t ± = 2 1 ∓ 2Λ 1 ⊤ b ( t ) . (12)
Source token i ∈ { 0 , … , m } i \in\{0,\ldots,m\} i ∈ { 0 , … , m } (index 0 is a null source) carries two key codes κ i ± ∈ R d k \kappa_i^{\pm} \in\mathbb{R}^{d_k} κ i ± ∈ R d k with ( κ i ± ) ι ( t ) = log π i ∣ t ± (\kappa_i^{\pm})_{\iota(t)} = \log\pi^{\pm}_{i|t} ( κ i ± ) ι ( t ) = log π i ∣ t ± , a tag χ i = d k e ι ( i ) \chi_i = \sqrt{d_k}\,e_{\iota(i)} χ i = d k e ι ( i ) , and a scalar u i u_i u i ; the query token for state q q q carries the tag χ ( ⋆ , q ) \chi_{(\star,q)} χ ( ⋆ , q ) and a scalar u ⋆ u_{\star} u ⋆ . The projections are fixed block selectors, W Q ± z = χ W_Q^{\pm}z = \chi W Q ± z = χ , W K ± z = κ ± W_K^{\pm}z = \kappa^{\pm} W K ± z = κ ± , W V ± z = u W_V^{\pm}z = u W V ± z = u , and the output map writes Λ ( a + − a − ) \Lambda(a^+ - a^-) Λ ( a + − a − ) into the scalar of the target, where a ± a^{\pm} a ± are the two head outputs. The query is masked as a source; all heads read synchronously. Initialize u i = g i u_i = g_i u i = g i for i ∈ [ m ] i \in[m] i ∈ [ m ] and u 0 = u ⋆ = 0 u_0 = u_{\star} = 0 u 0 = u ⋆ = 0 .
Lemma B.1 (Two-head softmax executor). For a family admissible for Λ \Lambda Λ , the single set of projections above, which depends only on n n n , m m m , and Λ \Lambda Λ , satisfies ( u ℓ , 1 , … , u ℓ , m ) = H ℓ g (u_{\ell,1},\ldots,u_{\ell,m}) = H^{\ell}g ( u ℓ , 1 , … , u ℓ , m ) = H ℓ g and u ℓ , ⋆ ( q ) = e q ⊤ X ∑ j < ℓ H j g u_{\ell,\star(q)} = e_q^{\top} X \sum_{j<\ell} H^j g u ℓ , ⋆ ( q ) = e q ⊤ X ∑ j < ℓ H j g for all ℓ \ell ℓ . Its context retains ( m + 2 ) ( 3 ( n + m + 1 ) + 1 ) (m+2)(3(n+m+1)+1) ( m + 2 ) ( 3 ( n + m + 1 ) + 1 ) reals, at most five times the ( 2 n + 1 ) ( m + 1 ) (2n+1)(m+1) ( 2 n + 1 ) ( m + 1 ) reals of the linear prompt.
Proof. By (11) , ∣ b i ( t ) ∣ < Λ / m |b_i^{(t)}| < \Lambda/m ∣ b i ( t ) ∣ < Λ/ m and ∣ 1 ⊤ b ( t ) ∣ < Λ |\mathbf{1}^{\top}b^{(t)}| < \Lambda ∣ 1 ⊤ b ( t ) ∣ < Λ , so every probability in (12) is positive, and for each t t t they sum to one over i ∈ { 0 , … , m } i \in\{0,\ldots,m\} i ∈ { 0 , … , m } . The scaled score of source i i i at target t t t is ( κ i ± ) ⊤ χ t / d k = log π i ∣ t ± (\kappa_i^{\pm})^{\top}\chi_t/\sqrt{d_k} = \log\pi^{\pm}_{i|t} ( κ i ± ) ⊤ χ t / d k = log π i ∣ t ± , so the masked softmax returns exactly π i ∣ t ± \pi^{\pm}_{i|t} π i ∣ t ± , and the layer adds Λ ∑ i ( π i ∣ t + − π i ∣ t − ) u i = ∑ i > 1 b i ( t ) u i \Lambda\sum_i(\pi^+_{i|t}-\pi^-_{i|t})u_i = \sum_{i>1} b_i^{(t)}u_i Λ ∑ i ( π i ∣ t + − π i ∣ t − ) u i = ∑ i > 1 b i ( t ) u i to the scalar of target t t t , using u 0 = 0 u_0 = 0 u 0 = 0 . At the null target this is zero, at source target j j j it is ( ( H − I ) s ) j ((H-I)s)_j (( H − I ) s ) j , so s ← H s s \leftarrow Hs s ← H s , and at the query it is e q ⊤ X s e_q^{\top}Xs e q ⊤ X s . Induction and summation give the identities. Each of the m + 1 m+1 m + 1 source tokens and the query stores two codes, a tag, and a scalar, which is 3 d k + 1 3d_k+1 3 d k + 1 reals; since m ≤ n m \le n m ≤ n , ( m + 2 ) ( 3 ( n + m + 1 ) + 1 ) ≤ ( m + 2 ) ( 6 n + 4 ) ≤ 5 ( 2 n + 1 ) ( m + 1 ) (m+2)(3(n+m+1)+1) \le(m+2)(6n+4) \le5(2n+1)(m+1) ( m + 2 ) ( 3 ( n + m + 1 ) + 1 ) ≤ ( m + 2 ) ( 6 n + 4 ) ≤ 5 ( 2 n + 1 ) ( m + 1 ) , using ( m + 2 ) / ( m + 1 ) ≤ 3 / 2 (m+2)/(m+1) \le3/2 ( m + 2 ) / ( m + 1 ) ≤ 3/2 and ( 6 n + 4 ) / ( 2 n + 1 ) ≤ 10 / 3 (6n+4)/(2n+1) \le10/3 ( 6 n + 4 ) / ( 2 n + 1 ) ≤ 10/3 . □ \square □
Corollary B.2 (Task-uniform gains). (a) *For the ℓ 1 \ell_1 ℓ 1 -balanced Euclidean Krylov encoder with any budget m ≤ n m \le n m ≤ n , on every covered n n n -state batch, every reward, and every γ ∈ ( 0 , 1 ) \gamma\in(0,1) γ ∈ ( 0 , 1 ) , the family is admissible for Λ n = 2 n ( n + 1 ) \Lambda_n = 2n(n+1) Λ n = 2 n ( n + 1 ) . The Galerkin contexts are budget-m m m instances of the same encoder. For the visit-weighted encoder the bound holds with Λ n \Lambda_n Λ n multiplied by max i N i / min i N i \sqrt{\max_i N_i/\min_i N_i} max i N i / min i N i . (b) The clocked executor is the same layer with H = I m H = I_m H = I m , with the gates 1 { ℓ + 1 = τ u } \mathbf{1}\{\ell+1=\tau_u\} 1 { ℓ + 1 = τ u } of Definition A.1 as the source scalars u u u_u u u (computed by recip0 as before), and with X X X the block of held increments. For sample-and-hold with ∥ r b ∥ ∞ ≤ R \lVert r_b\rVert_{\infty} \le R ∥ r b ∥ ∞ ≤ R the family is admissible for Λ m , γ = 2 m R / ( 1 − γ ) \Lambda_{m,\gamma} = 2mR/(1-\gamma) Λ m , γ = 2 m R / ( 1 − γ ) , which is public when γ \gamma γ is. The anchored hold uses both heads in one looped block, writing the same query scalar.
Proof. (a) Balancing gives ∥ b j ∥ 1 = 1 \lVert b_j\rVert_1 = 1 ∥ b j ∥ 1 = 1 , so ∥ B ∥ max ≤ 1 \lVert B\rVert_{\max} \le1 ∥ B ∥ m a x ≤ 1 and ∥ P b j ∥ ∞ ≤ 1 \lVert P b_j\rVert_{\infty} \le1 ∥ P b j ∥ ∞ ≤ 1 , hence ∥ A ^ b j ∥ 2 ≤ γ n \lVert\widehat{A}b_j\rVert_2 \le\gamma\sqrt{n} ∥ A b j ∥ 2 ≤ γ n . The dual is ω i = b i / ∥ b i ∥ 2 \omega_i = b_i/\lVert b_i\rVert_2 ω i = b i / ∥ b i ∥ 2 with ∥ b i ∥ 2 ≥ ∥ b i ∥ 1 / n = 1 / n \lVert b_i\rVert_2 \ge\lVert b_i\rVert_1/\sqrt{n} = 1/\sqrt{n} ∥ b i ∥ 2 ≥ ∥ b i ∥ 1 / n = 1/ n , so ∣ H i j ∣ ≤ ∥ ω i ⊤ A ^ b j ∥ 2 ≤ γ n / ∥ b i ∥ 2 |H_{ij}| \le\lVert\omega_i^{\top}\widehat{A}b_j\rVert_2 \le\gamma n/\lVert b_i\rVert_2 ∣ H ij ∣ ≤ ∥ ω i ⊤ A b j ∥ 2 ≤ γ n / ∥ b i ∥ 2 and ∥ H − I ∥ max ≤ γ n + 1 \lVert H-I\rVert_{\max} \le\gamma n+1 ∥ H − I ∥ m a x ≤ γ n + 1 . Then max { n + 1 , 1 } γ n ( n + 1 ) < Λ n \max\{n+1,1\}\gamma n(n+1) < \Lambda_n max { n + 1 , 1 } γ n ( n + 1 ) < Λ n . With weights w = N w=N w = N , ω i = D w b i / ⟨ b i , b i ⟩ w \omega_i = D_w b_i/\langle b_i,b_i\rangle_w ω i = D w b i / ⟨ b i , b i ⟩ w and Cauchy–Schwarz give ∣ H i j ∣ ≤ ∥ D w 1 / 2 A ^ b j ∥ 2 / ∥ D w 1 / 2 b i ∥ 2 ≤ γ n max i N i / min i N i |H_{ij}| \le\lVert D_w^{1/2}\widehat{A}b_j\rVert_2/\lVert D_w^{1/2}b_i\rVert_2 \le\gamma n\sqrt{\max_i N_i/\min_i N_i} ∣ H ij ∣ ≤ ∥ D w 1/2 A b j ∥ 2 / ∥ D w 1/2 b i ∥ 2 ≤ γ n max i N i / min i N i . (b) With H = I H=I H = I all source targets receive zero, and the query receives ∑ u u u e q ⊤ x u \sum_u u_u e_q^{\top}x_u ∑ u u u e q ⊤ x u , which is the depth-counter update. Each held increment satisfies ∥ x u ∥ ∞ ≤ ∑ τ = τ u − 1 τ u − 1 γ τ ∥ r τ ∥ ∞ ≤ R / ( 1 − γ ) \lVert x_u\rVert_{\infty} \le\sum_{\tau=\tau_{u-1}}^{\tau_u-1}\gamma^{\tau}\lVert r^{\tau}\rVert_{\infty} \le R/(1-\gamma) ∥ x u ∥ ∞ ≤ ∑ τ = τ u − 1 τ u − 1 γ τ ∥ r τ ∥ ∞ ≤ R / ( 1 − γ ) , so m ∥ X ∥ max ≤ m R / ( 1 − γ ) < Λ m , γ m\lVert X\rVert_{\max} \le mR/(1-\gamma) < \Lambda_{m,\gamma} m ∥ X ∥ m a x ≤ m R / ( 1 − γ ) < Λ m , γ . □ \square □
What the construction does and does not show. The codes log π i ∣ t ± \log\pi^{\pm}_{i|t} log π i ∣ t ± are written by the encoder, which therefore needs a logarithm as a declared primitive in addition to those of Appendix I. The softmax weights are prescribed by the codes rather than computed from a similarity between learned representations, exactly as in earlier softmax compilations of TD; this is why the main text uses linear attention, whose heads compute the same recurrence from the raw statistics without codes. The gain Λ \Lambda Λ multiplies the rounding error of the probabilities, so the realization is exact in real arithmetic but loses about log 10 Λ \log_{10}\Lambda log 10 Λ digits in floating point, which Table 3 shows.
Table 3. Softmax realization checks on 60 random covered batches (4 ≤ n ≤ 24 4 \le n \le24 4 ≤ n ≤ 24 , γ ∈ { 0.5 , 0.8 , 0.9 , 0.95 } \gamma\in\{0.5, 0.8, 0.9, 0.95\} γ ∈ { 0.5 , 0.8 , 0.9 , 0.95 } , 10 ≤ L ≤ 60 10 \le L \le60 10 ≤ L ≤ 60 , ∥ r ^ ∥ ∞ = 1 \lVert\hat r \rVert_\infty= 1 ∥ r ^ ∥ ∞ = 1 ). Errors are maximum absolute deviations divided by max ℓ , s ∣ v ^ ℓ ( s ) ∣ \max_{\ell,s} |\hat v_\ell(s)| max ℓ , s ∣ v ^ ℓ ( s ) ∣ . The gain ratio is the family quantity in (11) divided by the task-uniform gain of Corollary B.2; all 60 batches were admissible.
The linear executor reaches 4 × 10 − 15 4 \times10^{-15} 4 × 1 0 − 15 on the same contexts (Table 4); the difference is the gain. These checks compare the two-head softmax construction with the linear-attention executor and the reference TD or sample-and-hold trajectory on the same encoded contexts.
Memory Lower Bounds: Real Registers and Bits
This appendix proves Theorem 4.3(c). The register statement is the following theorem, of which parts (1)–(4) give, respectively, the lower bound n k + k nk+k nk + k , its tightness, the factor-two statement for our context, and the full-rank case. The bit statement is Theorem C.7 in Appendix C.2.
Let Σ k + \Sigma_k^+ Σ k + denote the set of models ( γ P ^ , r ^ ) (\gamma\widehat P,\hat r) ( γ P , r ^ ) with strictly positive stochastic P ^ \widehat P P and k L = k k_L=k k L = k . A continuous exact representation of size M M M on a set O ⊆ Σ k + \mathcal O \subseteq\Sigma_k^+ O ⊆ Σ k + consists of a continuous map Enc : O → R M \operatorname{Enc}:\mathcal O \to\mathbb{R}^M Enc : O → R M and an arbitrary map Dec \operatorname{Dec} Dec with Dec ( Enc ( A ^ , r ^ ) , s , ℓ ) = v ^ ℓ ( s ) \operatorname{Dec}(\operatorname{Enc}(\widehat A,\hat r),s,\ell)=\hat v_\ell(s) Dec ( Enc ( A , r ^ ) , s , ℓ ) = v ^ ℓ ( s ) for all s ∈ [ n ] s \in[n] s ∈ [ n ] and ℓ ≤ L \ell\le L ℓ ≤ L .
Theorem C.1 (Continuous-encoding memory law). Let n ≥ 2 n \ge2 n ≥ 2 , 1 ≤ k ≤ min { n − 1 , L − 1 } 1 \le k \le\min\{n-1,L-1\} 1 ≤ k ≤ min { n − 1 , L − 1 } , and let O \mathcal O O be relatively open in Σ k + \Sigma_k^+ Σ k + and contain a model with 1 ∉ K L \mathbf{1} \notin K_L 1 ∈ / K L (such models exist for every such k k k ).
(Lower bound ) Every continuous exact representation on O \mathcal O O has M ≥ n k + k M \ge nk+k M ≥ nk + k .
(Tightness ) A continuous exact representation of size exactly n k + k nk+k nk + k exists on all of Σ k + \Sigma_k^+ Σ k + .
(Attention ) On each rank stratum, the encoder of Theorem 4.3(b) is continuous in ( A ^ , r ^ ) (\widehat A,\hat r) ( A , r ^ ) , and its ( 2 n + 1 ) k (2n+1)k ( 2 n + 1 ) k context reals are within the factor ( 2 n + 1 ) / ( n + 1 ) < 2 (2n+1)/(n+1)<2 ( 2 n + 1 ) / ( n + 1 ) < 2 of optimal.
(Full rank ) If L ≥ n + 1 L \ge n+1 L ≥ n + 1 , every continuous exact representation on a nonempty relatively open subset of Σ n + \Sigma_n^+ Σ n + has M ≥ n 2 M \ge n^2 M ≥ n 2 . The statistics ( A ^ , r ^ ) (\widehat A,\hat r) ( A , r ^ ) are therefore optimal up to a factor ( n + 1 ) / n (n+1)/n ( n + 1 ) / n , and the second stage helps only when k L < n k_L<n k L < n .
Proof idea. Near a base chain whose Krylov space avoids 1 \mathbf{1} 1 , we build an ( n k + k ) (nk+k) ( nk + k ) -parameter family: the increments Δ = [ r ^ , … , A ^ k − 1 r ^ ] \Delta=[\hat r,\ldots,\widehat A^{k-1}\hat r] Δ = [ r ^ , … , A k − 1 r ^ ] and the coefficients α \alpha α of A ^ k r ^ \widehat A^k\hat r A k r ^ in this basis vary freely. A stochastic matrix is continuously completed via P ( θ ) = P 0 + ( T − P 0 W ) W + P(\theta)=P_0+(T-P_0W)W^+ P ( θ ) = P 0 + ( T − P 0 W ) W + with W = [ Δ , 1 ] W=[\Delta,\mathbf{1}] W = [ Δ , 1 ] . The trajectory determines ( Δ , α ) (\Delta,\alpha) ( Δ , α ) , so Enc \operatorname{Enc} Enc restricted to the family is a continuous injection from an open subset of R n k + k \mathbb{R}^{nk+k} R nk + k , and Brouwer’s invariance of domain [14 ] forces M ≥ n k + k M \ge nk+k M ≥ nk + k . The remainder of this appendix carries this out.
Scope of the bound. In Theorem 4.3(c) an “open set of covered systems” means a relatively open subset of Σ k + \Sigma_k^+ Σ k + , as in Theorem C.1. The bound concerns encoders defined on such a set: it says that no continuous encoder can do with fewer than n k + k nk+k nk + k registers on all models of the set, because the set contains an ( n k + k ) (nk+k) ( nk + k ) -parameter family whose trajectories are distinct. It is not an instance-level statement, and it does not apply to restricted families on which the trajectory has fewer degrees of freedom. Two examples make the quantifier explicit. If the rewards are restricted to r ^ = c 1 \hat r=c\mathbf{1} r ^ = c 1 , then k L = 1 k_L=1 k L = 1 and v ^ ℓ = c 1 − γ ℓ 1 − γ 1 \hat v_\ell=c\frac{1-\gamma^\ell}{1-\gamma}\mathbf{1} v ^ ℓ = c 1 − γ 1 − γ ℓ 1 , so a single register holding c c c suffices when n n n and γ \gamma γ are public. For the block-cycle tasks of Section 5, every row of P ^ \widehat P P moves to the next block and the reward is the indicator of block 0, so v ^ ℓ = ∑ j < ℓ γ j 1 B − j \widehat{v}_{\ell}=\sum_{j<\ell}\gamma^{j}1_{B_{-j}} v ℓ = ∑ j < ℓ γ j 1 B − j depends on the model only through the block partition; here 1 ∈ K L 1\in\mathcal{K}_{L} 1 ∈ K L and P ^ \widehat{P} P has zero entries, so the family lies outside the hypotheses, and an encoder for this family alone needs only the n n n block labels. What the theorem does control is a task-uniform encoder: the Krylov context of Theorem 4.3 (b) retains ( 2 n + 1 ) k L (2n+1)k_{L} ( 2 n + 1 ) k L registers on every rank-k L k_{L} k L system, and no continuous encoder that works on all dense rank-k L k_{L} k L systems can retain fewer than n k L + k L nk_{L}+k_{L} n k L + k L on all of them. This is the sense in which the lower-bound column of Table 5 is to be read (Appendix § 17 .§ 5 ). Remark C.5 adds the corresponding caveat on the interface: the bound is stated at the level of the real-valued empirical model, not of a fixed finite batch of records.
Table 5. Retained memory (KiB, float32) on exact and sampled tasks. Exact rows: dense-block cycles, γ = 0.9 \gamma= 0.9 γ = 0.9 , L = 100 L = 100 L = 100 , N = 40 n N = 40n N = 40 n ; LB is n k L + k L nk_L + k_L n k L + k L (Theorem 4.3(c)). Approximate rows: γ = 0.99 \gamma= 0.99 γ = 0.99 , L = 300 L = 300 L = 300 , smallest context dimension with error ≤ 10 − 2 \le10^{-2} ≤ 1 0 − 2 (Krylov projection / anchored hold). Bold marks the smallest entry in each row.
Proof of the Memory Law
Throughout, γ ∈ ( 0 , 1 ) \gamma\in(0,1) γ ∈ ( 0 , 1 ) , L L L , and n n n are fixed. We write Σ k + \Sigma_{k}^{+} Σ k + for the models ( γ P , r ) (\gamma P,r) ( γ P , r ) with P P P row stochastic and entrywise positive and with dim K L ( γ P , r ) = k \dim\mathcal{K}_{L}(\gamma P,r)=k dim K L ( γ P , r ) = k . Positive P P P are irreducible and have strictly positive stationary distributions, so they belong to the system class of Section 4.2. The theorem concerns model-level encoders, which is the interface at which the second-stage compression operates (Remark C.5).
Lemma C.2 (A base point). Let η ∈ ( 0 , 1 ) \eta\in(0,1) η ∈ ( 0 , 1 ) and let Q Q Q be the reflecting random walk on a path, with Q i , i ± 1 = 1 2 Q_{i,i\pm1}=\frac{1}{2} Q i , i ± 1 = 2 1 and Q 11 = Q n n = 1 2 Q_{11}=Q_{nn}=\frac{1}{2} Q 11 = Q nn = 2 1 . Put P 0 = ( 1 − η ) 11 ⊤ / n + η Q P_{0}=(1-\eta)11^{\top}/n+\eta Q P 0 = ( 1 − η ) 1 1 ⊤ / n + η Q and ψ j ( i ) = cos ( π j ( i − 1 2 ) / n ) \psi_{j}(i)=\cos(\pi j(i-\frac{1}{2})/n) ψ j ( i ) = cos ( π j ( i − 2 1 ) / n ) . Then P 0 P_{0} P 0 is entrywise at least ( 1 − η ) / n (1-\eta)/n ( 1 − η ) / n , P 0 1 = 1 P_{0}1=1 P 0 1 = 1 , and P 0 ψ j = η cos ( π j / n ) ψ j P_{0}\psi_{j}=\eta\cos(\pi j/n)\psi_{j} P 0 ψ j = η cos ( π j / n ) ψ j with ψ j ⊥ 1 \psi_{j}\perp1 ψ j ⊥ 1 for 1 ≤ j ≤ n − 1 1\leq j\leq n-1 1 ≤ j ≤ n − 1 . For 1 ≤ k ≤ n − 1 1\leq k\leq n-1 1 ≤ k ≤ n − 1 and r 0 = ∑ j = 1 k ψ j r_{0}=\sum_{j=1}^{k}\psi_{j} r 0 = ∑ j = 1 k ψ j , we have K L ( γ P 0 , r 0 ) = span { ψ 1 , … , ψ k } \mathcal{K}_{L}(\gamma P_{0},r_{0})=\operatorname{span}\{\psi_{1},\ldots,\psi_{k}\} K L ( γ P 0 , r 0 ) = span { ψ 1 , … , ψ k } whenever L ≥ k L\geq k L ≥ k . This space has dimension k k k and does not contain 1 1 1 .
Proof. For interior i i i , the sum-to-product identity gives ( Q ψ j ) ( i ) = cos ( π j / n ) ψ j ( i ) (Q\psi_{j})(i)=\cos(\pi j/n)\psi_{j}(i) ( Q ψ j ) ( i ) = cos ( π j / n ) ψ j ( i ) . At the two boundaries the reflection gives the same identity, using cos ( π j − x ) = ( − 1 ) j cos x \cos(\pi j-x)=(-1)^{j}\cos x cos ( π j − x ) = ( − 1 ) j cos x . The matrix Q Q Q is symmetric with distinct eigenvalues cos ( π j / n ) \cos(\pi j/n) cos ( π j / n ) , so ψ j ⊥ ψ 0 = 1 \psi_{j}\perp\psi_{0}=1 ψ j ⊥ ψ 0 = 1 and 11 ⊤ ψ j = 0 11^{\top}\psi_{j}=0 1 1 ⊤ ψ j = 0 . The Krylov matrix is [ ψ 1 , … , ψ k ] V [\psi_{1},\ldots,\psi_{k}]V [ ψ 1 , … , ψ k ] V , where V V V is the Vandermonde matrix of the distinct nodes γ η cos ( π j / n ) \gamma\eta\cos(\pi j/n) γ η cos ( π j / n ) and is therefore invertible. The resulting space is orthogonal to 1 ≠ 0 1\ne0 1 = 0 .
Lemma C.3 (An ( n k + k ) (nk+k) ( nk + k ) -parameter family). Let ( γ P 0 , r 0 ) ∈ Σ k + (\gamma P_{0},r_{0})\in\Sigma_{k}^{+} ( γ P 0 , r 0 ) ∈ Σ k + with 1 ∉ K L 1\notin\mathcal{K}_{L} 1 ∈ / K L and k ≤ L − 1 k\leq L-1 k ≤ L − 1 . Put A 0 = γ P 0 A_{0}=\gamma P_{0} A 0 = γ P 0 and Δ 0 = [ r 0 , A 0 r 0 , … , A 0 k − 1 r 0 ] \Delta_{0}=[r_{0},A_{0}r_{0},\ldots,A_{0}^{k-1}r_{0}] Δ 0 = [ r 0 , A 0 r 0 , … , A 0 k − 1 r 0 ] , and choose α 0 \alpha_{0} α 0 with A 0 k r 0 = Δ 0 α 0 A_{0}^{k}r_{0}=\Delta_{0}\alpha_{0} A 0 k r 0 = Δ 0 α 0 ; it exists because K L = K k \mathcal{K}_{L}=\mathcal{K}_{k} K L = K k is invariant. For θ = ( Δ , α ) ∈ R n × k × R k \theta=(\Delta,\alpha)\in\mathbb{R}^{n\times k}\times\mathbb{R}^{k} θ = ( Δ , α ) ∈ R n × k × R k , let C ( α ) C(\alpha) C ( α ) be the companion matrix (C e i = e i + 1 Ce_{i}=e_{i+1} C e i = e i + 1 for i < k i<k i < k , C e k = α Ce_{k}=\alpha C e k = α ) and set
W = [ Δ , 1 ] , T = [ γ − 1 Δ C ( α ) , 1 ] , P ( θ ) = P 0 + ( T − P 0 W ) W + , r ( θ ) = Δ e 1 . W=[\Delta,1],\qquad T=[\gamma^{-1}\Delta C(\alpha),1],\qquad P(\theta)=P_{0}+(T-P_{0}W)W^{+},\qquad r(\theta)=\Delta e_{1}. W = [ Δ , 1 ] , T = [ γ − 1 Δ C ( α ) , 1 ] , P ( θ ) = P 0 + ( T − P 0 W ) W + , r ( θ ) = Δ e 1 .
There is a neighborhood N \mathcal{N} N of θ 0 = ( Δ 0 , α 0 ) \theta_{0}=(\Delta_{0},\alpha_{0}) θ 0 = ( Δ 0 , α 0 ) on which the following hold: (a) P ( θ ) P(\theta) P ( θ ) is continuous in θ \theta θ , entrywise positive, and row stochastic; (b) γ P ( θ ) Δ = Δ C ( α ) \gamma P(\theta)\Delta=\Delta C(\alpha) γ P ( θ ) Δ = Δ C ( α ) ; (c) A ^ j r = Δ C ( α ) j e 1 \widehat{A}^{j}r=\Delta C(\alpha)^{j}e_{1} A j r = Δ C ( α ) j e 1 for all j j j , so in particular A ^ j r = Δ e j + 1 \widehat{A}^{j}r=\Delta e_{j+1} A j r = Δ e j + 1 for j < k j<k j < k and A ^ k r = Δ α \widehat{A}^{k}r=\Delta\alpha A k r = Δ α ; (d) ( γ P ( θ ) , r ( θ ) ) ∈ Σ k + (\gamma P(\theta),r(\theta))\in\Sigma_{k}^{+} ( γ P ( θ ) , r ( θ )) ∈ Σ k + .
Proof. At θ 0 \theta_{0} θ 0 , W 0 W_{0} W 0 has full column rank because Δ 0 \Delta_{0} Δ 0 does and 1 ∉ col Δ 0 1\notin\operatorname{col}\Delta_{0} 1 ∈ / col Δ 0 . Full column rank is an open condition, so near θ 0 \theta_{0} θ 0 the map W + = ( W ⊤ W ) − 1 W ⊤ W^{+}=(W^{\top}W)^{-1}W^{\top} W + = ( W ⊤ W ) − 1 W ⊤ is continuous and W + W = I W^{+}W=I W + W = I . Hence P ( θ ) W = T P(\theta)W=T P ( θ ) W = T , which gives (b) and P 1 = 1 P1=1 P 1 = 1 . At θ 0 \theta_{0} θ 0 , A 0 Δ 0 = Δ 0 C ( α 0 ) A_{0}\Delta_{0}=\Delta_{0}C(\alpha_{0}) A 0 Δ 0 = Δ 0 C ( α 0 ) and P 0 1 = 1 P_{0}1=1 P 0 1 = 1 , so T 0 = P 0 W 0 T_{0}=P_{0}W_{0} T 0 = P 0 W 0 and P ( θ 0 ) = P 0 > 0 P(\theta_{0})=P_{0}>0 P ( θ 0 ) = P 0 > 0 ; positivity persists nearby. Part (c) follows from (b) by induction. For (d), K L ⊆ col Δ \mathcal{K}_{L}\subseteq\operatorname{col}\Delta K L ⊆ col Δ by (c), and K L \mathcal{K}_{L} K L contains Δ e 1 , … , Δ e k \Delta e_{1},\ldots,\Delta e_{k} Δ e 1 , … , Δ e k because k ≤ L k\leq L k ≤ L ; Δ \Delta Δ keeps full column rank nearby.
Proof of Theorem C.1. (1) Take a model in O \mathcal{O} O with 1 ∉ K L 1\notin\mathcal{K}_{L} 1 ∈ / K L and let ι ( θ ) = ( γ P ( θ ) , r ( θ ) ) \iota(\theta)=(\gamma P(\theta),r(\theta)) ι ( θ ) = ( γ P ( θ ) , r ( θ )) be the family of Lemma C.3. Since ι \iota ι is continuous, ι ( N ) ⊆ Σ k + \iota(\mathcal{N})\subseteq\Sigma_{k}^{+} ι ( N ) ⊆ Σ k + , and O \mathcal{O} O is relatively open, we may shrink N \mathcal{N} N so that ι ( N ) ⊆ O \iota(\mathcal{N})\subseteq\mathcal{O} ι ( N ) ⊆ O . By Lemma C.3(c), the trajectory of Φ ( θ ) = ( v ^ ℓ ( θ ) ) ℓ ≤ L \Phi(\theta)=(\widehat{v}_{\ell}(\theta))_{\ell\leq L} Φ ( θ ) = ( v ℓ ( θ ) ) ℓ ≤ L determines the increments v ^ j + 1 − v ^ j = Δ e j + 1 \widehat{v}_{j+1}-\widehat{v}_{j}=\Delta e_{j+1} v j + 1 − v j = Δ e j + 1 for j < k j<k j < k and v ^ k + 1 − v ^ k = Δ α \widehat{v}_{k+1}-\widehat{v}_{k}=\Delta\alpha v k + 1 − v k = Δ α (using L ≥ k + 1 L\geq k+1 L ≥ k + 1 ). Hence it determines Δ \Delta Δ and, since Δ \Delta Δ has full column rank, α \alpha α . So Φ \Phi Φ is injective on N \mathcal{N} N . Because Dec ( Enc ( ι ( θ ) ) , ⋅ ) = Φ ( θ ) \operatorname{Dec}(\operatorname{Enc}(\iota(\theta)),\cdot)=\Phi(\theta) Dec ( Enc ( ι ( θ )) , ⋅ ) = Φ ( θ ) , the map F = Enc ∘ ι F=\operatorname{Enc}\circ\iota F = Enc ∘ ι is a continuous injection on the open set N ⊆ R n k + k \mathcal{N}\subseteq\mathbb{R}^{nk+k} N ⊆ R nk + k into R M \mathbb{R}^{M} R M . If M < n k + k M<nk+k M < nk + k , compose with the inclusion x ↦ ( x , 0 ) ∈ R n k + k x\mapsto(x,0)\in\mathbb{R}^{nk+k} x ↦ ( x , 0 ) ∈ R nk + k . The result is a continuous injection between open subsets of the same dimension, so its image is open by invariance of domain [14 ] . But the image lies in the hyperplane R M × { 0 } \mathbb{R}^{M}\times\{0\} R M × { 0 } , which has empty interior, a contradiction. (2) On Σ k + \Sigma_k^+ Σ k + set Enc ( A ^ , r ^ ) = ( Δ , α ) \operatorname{Enc}(\widehat{A},\widehat{r})=(\Delta,\alpha) Enc ( A , r ) = ( Δ , α ) with Δ = [ r ^ , … , A ^ k − 1 r ^ ] \Delta=[\widehat{r},\ldots,\widehat{A}^{k-1}\widehat{r}] Δ = [ r , … , A k − 1 r ] and α = ( Δ ⊤ Δ ) − 1 Δ ⊤ A ^ k r ^ \alpha=(\Delta^\top\Delta)^{-1}\Delta^\top\widehat{A}^k\widehat{r} α = ( Δ ⊤ Δ ) − 1 Δ ⊤ A k r . Before saturation the Krylov spaces grow strictly, so Δ \Delta Δ has full column rank on Σ k + \Sigma_k^+ Σ k + and α \alpha α is continuous. Since L ≥ k + 1 L\ge k+1 L ≥ k + 1 , K k + 1 = K k K_{k+1}=K_k K k + 1 = K k , so A ^ k r ^ = Δ α \widehat{A}^k\widehat{r}=\Delta\alpha A k r = Δ α and A ^ Δ = Δ C ( α ) \widehat{A}\Delta=\Delta C(\alpha) A Δ = Δ C ( α ) . Then Dec ( ⋅ , s , ℓ ) = e s ⊤ Δ ∑ j < ℓ C ( α ) j e 1 \operatorname{Dec}(\cdot,s,\ell)=e_s^\top\Delta\sum_{j<\ell}C(\alpha)^j e_1 Dec ( ⋅ , s , ℓ ) = e s ⊤ Δ ∑ j < ℓ C ( α ) j e 1 is exact.
(3) Continuity is Lemma A.5 , and exactness is Theorem 4.3 . Each source token stores b j , y j , g j b_j,y_j,g_j b j , y j , g j , i.e., 2 n + 1 2n+1 2 n + 1 reals, and ( 2 n + 1 ) k / ( n k + k ) = ( 2 n + 1 ) / ( n + 1 ) (2n+1)k/(nk+k)=(2n+1)/(n+1) ( 2 n + 1 ) k / ( nk + k ) = ( 2 n + 1 ) / ( n + 1 ) .
(4) The stratum Σ n + \Sigma_n^+ Σ n + is nonempty: take P 0 P_0 P 0 from Lemma C.2 and r 0 = ∑ j = 0 n − 1 ψ j r_0=\sum_{j=0}^{n-1}\psi_j r 0 = ∑ j = 0 n − 1 ψ j , whose n n n eigenvalues are distinct. Fix any model ( γ P 1 , r 1 ) (\gamma P_1,r_1) ( γ P 1 , r 1 ) in the given open set. Parameterize positive stochastic matrices near P 1 P_1 P 1 by their first n − 1 n-1 n − 1 columns (n ( n − 1 ) n(n-1) n ( n − 1 ) parameters) and rewards near r 1 r_1 r 1 (n n n parameters). The rank-n n n condition is open. The trajectory determines r = v ^ 1 r=\widehat{v}_1 r = v 1 and A ^ = [ δ 1 , … , δ n ] [ δ 0 , … , δ n − 1 ] − 1 \widehat{A}=[\delta_1,\ldots,\delta_n][\delta_0,\ldots,\delta_{n-1}]^{-1} A = [ δ 1 , … , δ n ] [ δ 0 , … , δ n − 1 ] − 1 with δ j = v ^ j + 1 − v ^ j \delta_j=\widehat{v}_{j+1}-\widehat{v}_j δ j = v j + 1 − v j , so it is injective in these n 2 n^2 n 2 parameters. The argument of (1) gives M ≥ n 2 M\ge n^2 M ≥ n 2 .
Remark C.4 (The case L = k L=k L = k and gauge counting). If L = k L=k L = k , fix α = α 0 \alpha=\alpha_0 α = α 0 ; the same argument gives M ≥ n k M\ge nk M ≥ nk , and storing Δ \Delta Δ attains it. A numerical realization ( B , H , g ) (B,H,g) ( B , H , g ) has n k + k 2 + k nk+k^2+k nk + k 2 + k entries but carries a GL ( k ) \operatorname{GL}(k) GL ( k ) gauge freedom ( B , H , g ) ↦ ( B G , G − 1 H G , G − 1 g ) (B,H,g)\mapsto(BG,G^{-1}HG,G^{-1}g) ( B , H , g ) ↦ ( B G , G − 1 H G , G − 1 g ) . Removing its k 2 k^2 k 2 dimensions leaves exactly n k + k nk+k nk + k , so the bound is tight modulo gauge.
Remark C.5 (Why continuity, and the raw-data interface). Without continuity, a set-theoretic bijection R d → R \mathbb{R}^d\to\mathbb{R} R d → R (e.g., interleaving decimal digits) gives M = 1 M=1 M = 1 . Linear decoders exclude this pathology by fiat, whereas continuity of the encoder excludes it naturally and permits arbitrary decoders. Empirical models from finite batches have rational entries, so continuity is stated at the model level, where the second stage operates. If one instead fixes the observed transitions and lets only rewards vary continuously, the same argument gives only M ≥ k M\ge k M ≥ k . Lower bounds for record-level interfaces need counting arguments such as the bit law of Appendix § 12 .§ 2 , which is consistent with Theorem C.1 : each real carries Θ ( log ( 1 / ϵ ) ) \Theta(\log(1/\epsilon)) Θ ( log ( 1/ ϵ )) bits.
Offline Retained-Bit Complexity
This subsection concerns unrestricted offline codes, not the context of Theorem 4.3 (b). It complements Theorem C.1 : there, reals are counted under continuity; here, bits are counted with arbitrary encoders and decoders.
Definition C.6 (Offline coding problem). For public n n n , L ≥ 1 L\ge1 L ≥ 1 , ϵ > 0 \epsilon>0 ϵ > 0 , and γ ∈ ( 0 , 1 ) \gamma\in(0,1) γ ∈ ( 0 , 1 ) , let M n = { ( P , r ) : P ≥ 0 , P 1 = 1 , ∥ r ∥ ∞ ≤ 1 } \mathcal{M}_n=\{(P,r):P\ge0,\ P\mathbf{1}=\mathbf{1},\ \lVert r\rVert_\infty\le1\} M n = {( P , r ) : P ≥ 0 , P 1 = 1 , ∥ r ∥ ∞ ≤ 1 } . A B B B -bit code consists of Enc : M n → { 0 , 1 } B \operatorname{Enc}:\mathcal{M}_n\to\{0,1\}^B Enc : M n → { 0 , 1 } B and a decoder satisfying max s sup ℓ ≤ L ∣ Dec ( Enc ( P , r ) , s , ℓ ) − e s ⊤ ∑ j < ℓ ( γ P ) j r ∣ ≤ ϵ \max_s\sup_{\ell\le L}\lvert\operatorname{Dec}(\operatorname{Enc}(P,r),s,\ell)-e_s^\top\sum_{j<\ell}(\gamma P)^j r\rvert\le\epsilon max s sup ℓ ≤ L ∣ Dec ( Enc ( P , r ) , s , ℓ ) − e s ⊤ ∑ j < ℓ ( γ P ) j r ∣ ≤ ϵ . Let B n , L ∗ ( ϵ , γ ) B^*_{n,L}(\epsilon,\gamma) B n , L ∗ ( ϵ , γ ) be the minimum such B B B .
Theorem C.7 (Retained-bit law). For fixed γ \gamma γ and sufficiently small ϵ \epsilon ϵ , uniformly in n n n and L L L (including L = ∞ L=\infty L = ∞ ), B n , L ∗ ( ϵ , γ ) = Θ γ ( n min { n , L , ln ( 1 / ϵ ) } ln ( 1 / ϵ ) ) B^*_{n,L}(\epsilon,\gamma)=\Theta_\gamma(n\min\{n,L,\ln(1/\epsilon)\}\ln(1/\epsilon)) B n , L ∗ ( ϵ , γ ) = Θ γ ( n min { n , L , ln ( 1/ ϵ )} ln ( 1/ ϵ )) .
Proof sketch with explicit γ \gamma γ -dependence. Let t = ln ( 1 / ϵ ) t=\ln(1/\epsilon) t = ln ( 1/ ϵ ) , a = ln ( 1 / γ ) a=\ln(1/\gamma) a = ln ( 1/ γ ) , and V = ( 1 − γ ) − 1 V=(1-\gamma)^{-1} V = ( 1 − γ ) − 1 .
Upper bound. Let J 0 = ⌈ ln ( 4 V / ϵ ) / a ⌉ J_0=\lceil\ln(4V/\epsilon)/a\rceil J 0 = ⌈ ln ( 4 V / ϵ ) / a ⌉ and J = min { L , J 0 } J=\min\{L,J_0\} J = min { L , J 0 } . The prefix code quantizes v ^ 1 , … , v ^ J \widehat{v}_1,\ldots,\widehat{v}_J v 1 , … , v J to accuracy ϵ / 4 \epsilon/4 ϵ /4 with ⌈ log 2 ( 3 + 4 V / ϵ ) ⌉ \lceil\log_2(3+4V/\epsilon)\rceil ⌈ log 2 ( 3 + 4 V / ϵ )⌉ bits per coordinate and holds v ^ J \widehat{v}_J v J afterwards, since the tail satisfies V γ J ≤ ϵ / 4 V\gamma^J\le\epsilon/4 V γ J ≤ ϵ /4 . The model code quantizes rewards to accuracy ϵ ( 1 − γ ) / 4 \epsilon(1-\gamma)/4 ϵ ( 1 − γ ) /4 and each transition row to ℓ 1 \ell_1 ℓ 1 -accuracy ϵ ( 1 − γ ) 2 / ( 4 γ ) \epsilon(1-\gamma)^2/(4\gamma) ϵ ( 1 − γ ) 2 / ( 4 γ ) using integer rows summing to M M M , since ∥ p − k / M ∥ 1 ≤ n / M \lVert p-k/M\rVert_1\le n/M ∥ p − k / M ∥ 1 ≤ n / M . The perturbation bound sup ℓ ∥ v ~ ℓ − v ℓ ∥ ∞ ≤ δ r / ( 1 − γ ) + γ δ p / ( 1 − γ ) 2 \sup_\ell\lVert\widetilde{v}_\ell-v_\ell\rVert_\infty\le\delta_r/(1-\gamma)+\gamma\delta_p/(1-\gamma)^2 sup ℓ ∥ v ℓ − v ℓ ∥ ∞ ≤ δ r / ( 1 − γ ) + γ δ p / ( 1 − γ ) 2 then gives accuracy ϵ / 2 \epsilon/2 ϵ /2 . Using the prefix code if J < n J<n J < n and the model code otherwise yields O ( n min { n , J } ln ( V / ϵ ) ) O(n\min\{n,J\}\ln(V/\epsilon)) O ( n min { n , J } ln ( V / ϵ )) bits.
Lower bound. Consider rewards with P = I P=I P = I gives n log 2 ( 1 / ( 4 ϵ ) ) n\log_2(1/(4\epsilon)) n log 2 ( 1/ ( 4 ϵ )) bits. For the delayed-reward family, use p = n − h − 1 p=n-h-1 p = n − h − 1 source states, a deterministic delay chain c h → ⋯ → c 1 → c 0 c_h\to\cdots\to c_1\to c_0 c h → ⋯ → c 1 → c 0 rewarded at c 1 c_1 c 1 , and transition probabilities θ i j ∈ [ 0 , 1 / ( 2 h ) ] \theta_{ij}\in[0,1/(2h)] θ ij ∈ [ 0 , 1/ ( 2 h )] from source i i i into c j c_j c j . This family satisfies v ^ j + 1 ( u i ) − v ^ j ( u i ) = γ j θ i j \widehat{v}_{j+1}(u_i)-\widehat{v}_j(u_i)=\gamma^j\theta_{ij} v j + 1 ( u i ) − v j ( u i ) = γ j θ ij . Choose h = min { ( n − 1 ) / 2 , L − 1 , ⌈ t / ( 8 ( 1 + a ) ) ⌉ } h=\min\{(n-1)/2,L-1,\lceil t/(8(1+a))\rceil\} h = min {( n − 1 ) /2 , L − 1 , ⌈ t / ( 8 ( 1 + a ))⌉} and pack each θ i j \theta_{ij} θ ij on a grid of spacing ϵ γ − j \epsilon\gamma^{-j} ϵ γ − j . For ϵ ≤ exp ( − max { 16 , 8 ( 1 + a ) } ) \epsilon\le\exp(-\max\{16,8(1+a)\}) ϵ ≤ exp ( − max { 16 , 8 ( 1 + a )}) , this gives B ∗ ≥ n min { n , L , t } t / ( 96 ( 1 + a ) ln 2 ) B^*\ge n\min\{n,L,t\}t/(96(1+a)\ln2) B ∗ ≥ n min { n , L , t } t / ( 96 ( 1 + a ) ln 2 ) .
:::
Remark C.8 (Dependence on γ \gamma γ ). The constants are explicit. The upper bound’s effective depth is J 0 ≈ t / ( 1 − γ ) J_0\approx t/(1-\gamma) J 0 ≈ t / ( 1 − γ ) as γ → 1 \gamma\to1 γ → 1 , whereas the lower bound’s delay length is h ≈ t / 8 h\approx t/8 h ≈ t /8 . For ln ( 1 / ϵ ) < min { n , L } \ln(1/\epsilon)<\min\{n,L\} ln ( 1/ ϵ ) < min { n , L } , the two therefore differ by a factor of order 1 / ( 1 − γ ) 1/(1-\gamma) 1/ ( 1 − γ ) in the depth term. Closing this factor, the analogue of Theorem 4.5 for bits, is open. The law ranges over all real stochastic models; a fixed finite batch has finite information, which can saturate as ϵ ↓ 0 \epsilon\downarrow0 ϵ ↓ 0 . For comparison, coding only the fixed point ( I − γ P ) − 1 r (I-\gamma P)^{-1}r ( I − γ P ) − 1 r needs Θ γ ( n ln ( 1 / ϵ ) ) \Theta_\gamma(n\ln(1/\epsilon)) Θ γ ( n ln ( 1/ ϵ )) bits.
Limited Context: Proofs, the Krylov-Anchored Hold, and Instance-Dependent Rates
This appendix proves Theorem 4.5 and states and proves the results referred to in § 4.2 : the suboptimality of Krylov moment matching, the Krylov-anchored hold, and instance-dependent rates. Throughout, an m m m -dimensional context is one of Definition 4.1 , and C m \mathcal{C}_m C m is the corresponding class of trajectories.
Statements
Proposition D.1 (Moment matching is not minimax). (a) *Krylov truncation, i.e., the terminal-corrected context that equals TD stopped after m m m steps, has worst-case error exactly γ m / ( 1 − γ ) \gamma^m/(1-\gamma) γ m / ( 1 − γ ) over systems with k L > m k_L>m k L > m . This exceeds e 2 Ψ m e^{2}\Psi_m e 2 Ψ m by the factor min { m , 1 / ( 1 − γ ) } / e 2 \min\{m,1/(1-\gamma)\}/e^2 min { m , 1/ ( 1 − γ )} / e 2 . (b) Krylov projection (the Galerkin context v ~ ℓ = B ∑ j < ℓ H j g \widetilde{v}_\ell=B\sum_{j<\ell}H^j g v ℓ = B ∑ j < ℓ H j g obtained from the budget-m m m encoder with Euclidean or visit-weighted Arnoldi) has error at least 0.657 γ m / 1 − γ ≥ 0.089 e 2 Ψ m / 1 − γ 0.657\,\gamma^m/\sqrt{1-\gamma}\geq0.089\,e^{2}\Psi_m/\sqrt{1-\gamma} 0.657 γ m / 1 − γ ≥ 0.089 e 2 Ψ m / 1 − γ on a directed ring with one rewarded state, whenever γ ≥ 1 2 \gamma\geq\frac{1}{2} γ ≥ 2 1 and m ≥ 1 / ( 1 − γ ) m\geq1/(1-\gamma) m ≥ 1/ ( 1 − γ ) .
Both encoders spend their whole budget on the first m m m increments, whereas the optimal context must also represent late ones. The loss comes from moment matching rather than from time invariance: on the ring of (b), numerically optimized time-invariant recurrences come within a factor 1.8 1.8 1.8 of the certified lower bound, closer than sample-and-hold itself (Appendix § 13 .10); whether a uniformly computable time-invariant encoder attains Θ ( Ψ m ) \Theta(\Psi_m) Θ ( Ψ m ) remains open. Moment matching does, however, adapt to spectral structure that sample-and-hold ignores, which motivates the following hybrid.
Krylov-anchored hold. Split m = k + j m=k+j m = k + j with j = 0 j=0 j = 0 if γ < 1 2 \gamma<\frac{1}{2} γ < 2 1 and j = min { J , ⌊ m / 4 ⌋ } j=\min\{J,\lfloor m/4\rfloor\} j = min { J , ⌊ m /4 ⌋} otherwise, where J = ⌊ 1 / ( 1 − γ ) ⌋ J=\lfloor1/(1-\gamma)\rfloor J = ⌊ 1/ ( 1 − γ )⌋ . Run k k k rounds of visit-weighted Arnoldi (Appendix § 10 .11), and let v ~ ℓ G \widetilde{v}^{G}_\ell v ℓ G be the resulting projected trajectory. With the depth-counter executor, hold the residual e ℓ = v ~ ℓ − v ~ ℓ G e_\ell=\widetilde{v}_\ell-\widetilde{v}^{G}_\ell e ℓ = v ℓ − v ℓ G at the j j j depths k + i s k+i_s k + i s of T j ( γ ) T_j(\gamma) T j ( γ ) . The output is v ~ ℓ = v ~ ℓ G + e σ ( ℓ ) \widetilde{v}_\ell=\widetilde{v}^{G}_\ell+e_{\sigma(\ell)} v ℓ = v ℓ G + e σ ( ℓ ) , with e σ ( ℓ ) = 0 e_{\sigma(\ell)}=0 e σ ( ℓ ) = 0 before the first sample. One looped block contains both the TD heads and the depth-counter heads (Appendix § 10 .13).
Theorem D.2 (Minimax optimality and instance adaptivity). Suppose the encoder weights w w w satisfy ∥ P x b ∥ w ≤ ∥ x ∥ w \|P x_b\|_w\leq\|x\|_w ∥ P x b ∥ w ≤ ∥ x ∥ w (e.g., w = μ w=\mu w = μ , or visit counts of a balanced batch). Let E k G = sup ℓ ∥ v ~ ℓ − v ~ ℓ G ∥ w / ∥ r b ∥ w \mathcal{E}^{G}_k=\sup_\ell\|\widetilde{v}_\ell-\widetilde{v}^{G}_\ell\|_w/\|r_b\|_w E k G = sup ℓ ∥ v ℓ − v ℓ G ∥ w /∥ r b ∥ w . Then the Krylov-anchored hold is an m m m -dimensional context with k + j = m k+j=m k + j = m and satisfies
sup ℓ ≥ 0 ∥ v ~ ℓ − v ~ ℓ ∥ w ∥ r b ∥ w ≤ min { 2 e 2 Ψ m ( γ ) , 2 E k G } , k ≥ ⌈ 3 m / 4 ⌉ . \sup_{\ell\geq0}\frac{\|\widetilde{v}_\ell-\widetilde{v}_\ell\|_w}{\|r_b\|_w}\leq\min\{2e^2\Psi_m(\gamma),\,2\mathcal{E}^{G}_k\},\qquad k\geq\lceil3m/4\rceil. ℓ ≥ 0 sup ∥ r b ∥ w ∥ v ℓ − v ℓ ∥ w ≤ min { 2 e 2 Ψ m ( γ ) , 2 E k G } , k ≥ ⌈ 3 m /4 ⌉ . Its retained memory is ( 2 n + 1 ) ( k + 1 ) + j ( n + 1 ) ≤ ( 2 n + 1 ) ( m + 1 ) (2n+1)(k+1)+j(n+1)\leq(2n+1)(m+1) ( 2 n + 1 ) ( k + 1 ) + j ( n + 1 ) ≤ ( 2 n + 1 ) ( m + 1 ) , and it is exact whenever k L ≤ k k_L\leq k k L ≤ k .
Proposition D.3 (Instance-dependent rates and robustness). (a) Reversible chains. If N i j = N j i N_{ij}=N_{ji} N ij = N j i , then visit-weighted Krylov projection with context dimension m m m satisfies E m m ≤ 4 β m / ( 1 − β 2 ) ≤ 8 β m / ( 1 − γ 2 ) \mathcal{E}^{m}_m\leq4\beta^m/\sqrt{(1-\beta^2)}\leq8\beta^m/(1-\gamma^2) E m m ≤ 4 β m / ( 1 − β 2 ) ≤ 8 β m / ( 1 − γ 2 ) with β = γ / ( 1 + 1 − γ 2 ) \beta=\gamma/(1+\sqrt{1-\gamma^2}) β = γ / ( 1 + 1 − γ 2 ) . The anchored hold is therefore also at most 16 β ⌈ 3 m / 4 ⌉ / ( 1 − γ 2 ) 16\beta^{\lceil3m/4\rceil}/(1-\gamma^2) 16 β ⌈ 3 m /4 ⌉ / ( 1 − γ 2 ) . (b) Low-rank. Let σ i \sigma_i σ i be the singular values of V L = D w 1 / 2 [ v ~ 1 , … , v ~ L ] V_L=D_w^{1/2}[\widetilde{v}_1,\ldots,\widetilde{v}_L] V L = D w 1/2 [ v 1 , … , v L ] . Every m m m -dimensional context in C m \mathcal{C}_m C m has sup ℓ ≤ L ∥ v ~ ℓ − v ~ ℓ ′ ∥ w ≥ σ m + 1 / L \sup_{\ell\leq L}\|\widetilde{v}_\ell-\widetilde{v}'_\ell\|_w\geq\sigma_{m+1}/\sqrt{L} sup ℓ ≤ L ∥ v ℓ − v ℓ ′ ∥ w ≥ σ m + 1 / L , while the best m m m -dimensional subspace achieves σ m + 1 \sigma_{m+1} σ m + 1 . Moreover, ∣ σ i ( V L ) − σ i ( V L ′ ) ∣ ≤ L sup ℓ ∥ v ~ ℓ − v ~ ℓ ′ ∥ w |\sigma_i(V_L)-\sigma_i(V'_L)|\leq\sqrt{L}\sup_\ell\|\widetilde{v}_\ell-\widetilde{v}'_\ell\|_w ∣ σ i ( V L ) − σ i ( V L ′ ) ∣ ≤ L sup ℓ ∥ v ℓ − v ℓ ′ ∥ w , and the latter is O ( δ r / ( 1 − γ ) + δ A ∥ r ∥ w / ( 1 − γ ) 2 ) O(\delta_r/(1-\gamma)+\delta_A\|r\|_w/(1-\gamma)^2) O ( δ r / ( 1 − γ ) + δ A ∥ r ∥ w / ( 1 − γ ) 2 ) under model perturbations of size ( δ A , δ r ) (\delta_A,\delta_r) ( δ A , δ r ) .
Part (a) is a square-root acceleration: the effective horizon becomes 1 / 1 − γ 1/\sqrt{1-\gamma} 1/ 1 − γ instead of 1 / ( 1 − γ ) 1/(1-\gamma) 1/ ( 1 − γ ) , because the Chebyshev coefficients of every partial sum ∑ j < ℓ x j \sum_{j<\ell}x^j ∑ j < ℓ x j on [ − γ , γ ] [-\gamma,\gamma] [ − γ , γ ] are nonnegative and dominated by those of 1 / ( 1 − x ) 1/(1-x) 1/ ( 1 − x ) . Part (b) replaces the discontinuous exact rank by the stable ϵ \epsilon ϵ -rank # { i : σ i > ϵ L } \#\{i:\sigma_i>\epsilon\sqrt{L}\} # { i : σ i > ϵ L } , a lower bound on the context dimension that any method needs for accuracy ϵ \epsilon ϵ ; it is what makes compression meaningful on sampled tasks whose exact rank is full (Appendix § 17 .§ 4 ). A threshold gate on Arnoldi residuals gives a certified adaptive rank as well (Appendix § 13 .9).
Three Tools
Lemma D.4 (Contraction). If P P P is row stochastic and μ > 0 \mu> 0 μ > 0 satisfies μ ⊤ P = μ ⊤ \mu^{\top}P = \mu^{\top} μ ⊤ P = μ ⊤ , then ∥ P x ∥ μ ≤ ∥ x ∥ μ \lVert Px\rVert_{\mu} \le\lVert x\rVert_{\mu} ∥ P x ∥ μ ≤ ∥ x ∥ μ . For every row-stochastic P P P , ∥ P x ∥ ∞ ≤ ∥ x ∥ ∞ \lVert Px\rVert_{\infty} \le\lVert x\rVert_{\infty} ∥ P x ∥ ∞ ≤ ∥ x ∥ ∞ .
Proof. By Jensen’s inequality, ( ∑ j P i j x j ) 2 ≤ ∑ j P i j x j 2 \left(\sum_j P_{ij}x_j\right)^2 \le\sum_j P_{ij}x_j^2 ( ∑ j P ij x j ) 2 ≤ ∑ j P ij x j 2 . Weighting by μ i \mu_i μ i and summing gives ∑ j μ j x j 2 \sum_j \mu_jx_j^2 ∑ j μ j x j 2 . The sup-norm statement is immediate.
Lemma D.5 (Error controls block-increment width). If v ~ ∈ C m \tilde{v} \in\mathcal{C}_m v ~ ∈ C m and sup ℓ ∥ v ^ ℓ − v ~ ℓ ∥ ≤ ε \sup_{\ell}\lVert\hat{v}_{\ell} - \tilde{v}_{\ell}\rVert\le\varepsilon sup ℓ ∥ v ^ ℓ − v ~ ℓ ∥ ≤ ε , then U = col ( D ) U = \operatorname{col}(D) U = col ( D ) has dim U ≤ m \dim U \le m dim U ≤ m and satisfies dist ( v ^ b − v ^ a , U ) ≤ 2 ε \operatorname{dist}(\hat{v}_b - \hat{v}_a, U) \le2\varepsilon dist ( v ^ b − v ^ a , U ) ≤ 2 ε for all 0 ≤ a < b 0 \le a < b 0 ≤ a < b .
Proof. v ~ b − v ~ a = D ∑ a ≤ j < b s j ∈ U \tilde{v}_b - \tilde{v}_a = D\sum_{a\le j<b}s_j \in U v ~ b − v ~ a = D ∑ a ≤ j < b s j ∈ U , and the triangle inequality gives ∥ ( v ^ b − v ^ a ) − ( v ~ b − v ~ a ) ∥ ≤ 2 ε \lVert(\hat{v}_b - \hat{v}_a) - (\tilde{v}_b - \tilde{v}_a)\rVert\le2\varepsilon ∥( v ^ b − v ^ a ) − ( v ~ b − v ~ a )∥ ≤ 2 ε .
Lemma D.6 (Width of orthogonal geometric families). Let x 0 , … , x T − 1 x_0,\ldots,x_{T-1} x 0 , … , x T − 1 be orthogonal in an inner-product norm with ∥ x t ∥ = a 0 ρ t \lVert x_t\rVert= a_0\rho^t ∥ x t ∥ = a 0 ρ t , ρ ∈ ( 0 , 1 ) \rho\in(0,1) ρ ∈ ( 0 , 1 ) , and T ≥ m + 1 + 1 / ( 1 − ρ 2 ) T \ge m+1+1/(1-\rho^2) T ≥ m + 1 + 1/ ( 1 − ρ 2 ) . Then every subspace U U U of dimension at most m m m satisfies max t dist ( x t , U ) ≥ a 0 ρ m max { 1 − ρ 2 , ρ 1 / ( 1 − ρ 2 ) } ≥ a 0 ρ m / 2 \max_t\operatorname{dist}(x_t,U) \ge a_0\rho^m\max\{\sqrt{1-\rho^2},\rho^{1/(1-\rho^2)}\} \ge a_0\rho^m/2 max t dist ( x t , U ) ≥ a 0 ρ m max { 1 − ρ 2 , ρ 1/ ( 1 − ρ 2 ) } ≥ a 0 ρ m /2 .
Proof. Let Π \Pi Π be the orthogonal projection onto U U U , and suppose all distances are at most ε \varepsilon ε . Put η = ε / a 0 \eta= \varepsilon/a_0 η = ε / a 0 . The unit vectors x ^ t \hat{x}_t x ^ t are orthonormal, so ∑ t ∥ Π x ^ t ∥ 2 ≤ tr Π ≤ m \sum_t\lVert\Pi\hat{x}_t\rVert^2 \le\operatorname{tr}\Pi\le m ∑ t ∥ Π x ^ t ∥ 2 ≤ tr Π ≤ m . Each term also satisfies ∥ Π x ^ t ∥ 2 = 1 − dist ( x t , U ) 2 / ∥ x t ∥ 2 ≥ 1 − η 2 ρ − 2 t \lVert\Pi\hat{x}_t\rVert^2 = 1-\operatorname{dist}(x_t,U)^2/\lVert x_t\rVert^2 \ge1-\eta^2\rho^{-2t} ∥ Π x ^ t ∥ 2 = 1 − dist ( x t , U ) 2 / ∥ x t ∥ 2 ≥ 1 − η 2 ρ − 2 t . Summing over t ≤ m t\le m t ≤ m gives m ≥ m + 1 − η 2 ∑ t ≤ m ρ − 2 t m \ge m+1-\eta^2\sum_{t\le m}\rho^{-2t} m ≥ m + 1 − η 2 ∑ t ≤ m ρ − 2 t , hence η ≥ ρ m 1 − ρ 2 \eta\ge\rho^m\sqrt{1-\rho^2} η ≥ ρ m 1 − ρ 2 . Next let a = 1 / ( 1 − ρ 2 ) a=1/(1-\rho^2) a = 1/ ( 1 − ρ 2 ) and T ′ = ⌈ m + a ⌉ ≤ T T'=\lceil m+a\rceil\le T T ′ = ⌈ m + a ⌉ ≤ T . If η ≤ ρ T ′ − 1 \eta\le\rho^{T'-1} η ≤ ρ T ′ − 1 , then ∑ t < T ′ ( 1 − η 2 ρ − 2 t ) = T ′ − η 2 ρ − 2 T ′ − 1 ρ − 2 − 1 > T ′ − η 2 ρ − 2 ( T ′ − 1 ) a ≥ T ′ − a ≥ m \sum_{t<T'}(1-\eta^2\rho^{-2t})=T'-\eta^2\frac{\rho^{-2T'}-1}{\rho^{-2}-1}>T'-\eta^2\rho^{-2(T'-1)}a\ge T'-a\ge m ∑ t < T ′ ( 1 − η 2 ρ − 2 t ) = T ′ − η 2 ρ − 2 − 1 ρ − 2 T ′ − 1 > T ′ − η 2 ρ − 2 ( T ′ − 1 ) a ≥ T ′ − a ≥ m , a contradiction. Thus η > ρ T ′ − 1 ≥ ρ m + a \eta>\rho^{T'-1}\ge\rho^{m+a} η > ρ T ′ − 1 ≥ ρ m + a . For the final inequality: if ρ 2 ≤ 3 / 4 \rho^2\le3/4 ρ 2 ≤ 3/4 then 1 − ρ 2 ≥ 1 / 2 \sqrt{1-\rho^2}\ge1/2 1 − ρ 2 ≥ 1/2 . Otherwise u = 1 − ρ 2 < 1 / 4 u=1-\rho^2<1/4 u = 1 − ρ 2 < 1/4 , and ln ( 1 − u ) ≥ − u / ( 1 − u ) \ln(1-u)\ge-u/(1-u) ln ( 1 − u ) ≥ − u / ( 1 − u ) gives ρ 1 / u = exp ( ln ( 1 − u ) / ( 2 u ) ) ≥ e − 2 / 3 > 1 / 2 \rho^{1/u}=\exp(\ln(1-u)/(2u))\ge e^{-2/3}>1/2 ρ 1/ u = exp ( ln ( 1 − u ) / ( 2 u )) ≥ e − 2/3 > 1/2 .
The Lower Bound E m ≥ Ψ m / 64 \mathcal{E}_m \ge\Psi_m/64 E m ≥ Ψ m /64
Both instances are directed rings, ( P v ) ( x ) = v ( x + 1 ) (Pv)(x)=v(x+1) ( P v ) ( x ) = v ( x + 1 ) modulo n n n . The empirical model is realized exactly by a covered batch containing one transition per state, and the stationary distribution μ \mu μ is uniform.
Instance I (single rewarded state). Let r = n e 0 r=\sqrt{n}e_0 r = n e 0 , so ∥ r ∥ μ = 1 \lVert r\rVert_{\mu}=1 ∥ r ∥ μ = 1 . The increments A ^ t r = γ t n e − t \hat{A}^t r=\gamma^t\sqrt{n}e_{-t} A ^ t r = γ t n e − t (t < n t<n t < n ) are orthogonal with norms γ t \gamma^t γ t . If n ≥ m + 1 + 1 / ( 1 − γ 2 ) n\ge m+1+1/(1-\gamma^2) n ≥ m + 1 + 1/ ( 1 − γ 2 ) , Lemmas D.5 (with b = a + 1 b=a+1 b = a + 1 ) and D.6 give 2 ε ≥ γ m / 2 2\varepsilon\ge\gamma^m/2 2 ε ≥ γ m /2 , i.e., every v ~ ∈ C m \tilde{v}\in\mathcal{C}_m v ~ ∈ C m has error at least γ m / 4 \gamma^m/4 γ m /4 .
Instance II (rewarded arc). For integers w , T ≥ 1 w,T\ge1 w , T ≥ 1 , let n = ( 2 T + 2 ) w n=(2T+2)w n = ( 2 T + 2 ) w and r = n / w 1 [ 0 , w ) r=\sqrt{n/w}\,\mathbf{1}_{[0,w)} r = n / w 1 [ 0 , w ) , so ∥ r ∥ μ = 1 \lVert r\rVert_{\mu}=1 ∥ r ∥ μ = 1 . The block increments τ i = v ^ ( i + 1 ) w − v ^ i w = ∑ j = i w ( i + 1 ) w − 1 γ j P j r \tau_i=\hat{v}_{(i+1)w}-\hat{v}_{iw}=\sum_{j=iw}^{(i+1)w-1}\gamma^jP^jr τ i = v ^ ( i + 1 ) w − v ^ i w = ∑ j = i w ( i + 1 ) w − 1 γ j P j r are supported on arcs of length 2 w − 1 2w-1 2 w − 1 , because P j r P^jr P j r is supported on [ − j , − j + w ) [-j,-j+w) [ − j , − j + w ) . The even blocks τ 2 t \tau_{2t} τ 2 t , t < T t<T t < T , therefore have pairwise disjoint supports inside the ring and are orthogonal. Moreover, τ 2 t \tau_{2t} τ 2 t is a shifted copy of γ 2 t w τ 0 \gamma^{2tw}\tau_0 γ 2 tw τ 0 . With S w = ∑ j < w γ j S_w=\sum_{j<w}\gamma^j S w = ∑ j < w γ j and S = supp τ 0 S=\operatorname{supp}\tau_0 S = supp τ 0 , Cauchy–Schwarz gives
∥ τ 0 ∥ μ ≥ ⟨ τ 0 , 1 S ⟩ μ ∥ 1 S ∥ μ = n − 1 n / w w S w ( 2 w − 1 ) / n = S w w 2 w − 1 ≥ S w 2 . \lVert\tau_0\rVert_{\mu}\ge\frac{\langle\tau_0,\mathbf{1}_S\rangle_{\mu}}{\lVert\mathbf{1}_S\rVert_{\mu}}=\frac{n^{-1}\sqrt{n/w}\,wS_w}{\sqrt{(2w-1)/n}}=S_w\sqrt{\frac{w}{2w-1}}\ge\frac{S_w}{\sqrt{2}}. ∥ τ 0 ∥ μ ≥ ∥ 1 S ∥ μ ⟨ τ 0 , 1 S ⟩ μ = ( 2 w − 1 ) / n n − 1 n / w w S w = S w 2 w − 1 w ≥ 2 S w .
Applying Lemma D.6 with a 0 = ∥ τ 0 ∥ μ a_0=\lVert\tau_0\rVert_{\mu} a 0 = ∥ τ 0 ∥ μ , ρ = γ 2 w \rho=\gamma^{2w} ρ = γ 2 w , and T ≥ m + 1 + 1 / ( 1 − γ 4 w ) T\ge m+1+1/(1-\gamma^{4w}) T ≥ m + 1 + 1/ ( 1 − γ 4 w ) , together with Lemma D.5 for ( a , b ) = ( ( 2 t ) w , ( 2 t + 1 ) w ) (a,b)=((2t)w,(2t+1)w) ( a , b ) = (( 2 t ) w , ( 2 t + 1 ) w ) , shows that every v ~ ∈ C m \tilde{v}\in\mathcal{C}_m v ~ ∈ C m has error at least S w γ 2 w m / ( 4 2 ) S_w\gamma^{2wm}/(4\sqrt{2}) S w γ 2 w m / ( 4 2 ) .
Proof of the lower bound in Theorem 4.5. Let q = 1 / ( m ( 1 − γ ) ) q=1/(m(1-\gamma)) q = 1/ ( m ( 1 − γ )) , so that Ψ m = γ m max { 1 , q } ≤ max { 1 , q } \Psi_m=\gamma^m\max\{1,q\}\le\max\{1,q\} Ψ m = γ m max { 1 , q } ≤ max { 1 , q } . If q ≤ 16 q\le16 q ≤ 16 , then Ψ m ≤ 16 γ m \Psi_m\le16\gamma^m Ψ m ≤ 16 γ m , and Instance I gives error at least γ m / 4 ≥ Ψ m / 64 \gamma^m/4\ge\Psi_m/64 γ m /4 ≥ Ψ m /64 . If q > 16 q>16 q > 16 , then $1-\gamma<1/16$. Take w = ⌊ q / 4 ⌋ ≥ 4 w=\lfloor q/4\rfloor\ge4 w = ⌊ q /4 ⌋ ≥ 4 , so that w > q / 4 − 1 > 3 q / 16 w>q/4-1>3q/16 w > q /4 − 1 > 3 q /16 , w ( 1 − γ ) ≤ 1 / ( 4 m ) ≤ 1 / 4 w(1-\gamma)\le1/(4m)\le1/4 w ( 1 − γ ) ≤ 1/ ( 4 m ) ≤ 1/4 , and 2 w m ( 1 − γ ) ≤ 1 / 2 2wm(1-\gamma)\le1/2 2 w m ( 1 − γ ) ≤ 1/2 . Bernoulli’s inequality gives $S_w\ge\sum_{j<w}(1-j(1-\gamma))\ge w ( 1 − w ( 1 − γ ) / 2 ) ≥ 7 w / 8 w(1-w(1-\gamma)/2)\ge7w/8 w ( 1 − w ( 1 − γ ) /2 ) ≥ 7 w /8 . From ln γ ≥ − ( 1 − γ ) / γ ≥ − 16 15 ( 1 − γ ) \ln\gamma\ge-(1-\gamma)/\gamma\ge-\frac{16}{15}(1-\gamma) ln γ ≥ − ( 1 − γ ) / γ ≥ − 15 16 ( 1 − γ ) we get γ 2 w m ≥ e − 8 / 15 \gamma^{2wm}\ge e^{-8/15} γ 2 w m ≥ e − 8/15 .
Instance II then gives error at least
1 4 2 ⋅ 7 8 ⋅ 3 q 16 ⋅ e − 8 / 15 ≥ q 59 ≥ Ψ m 59 . \frac{1}{4\sqrt{2}}\cdot\frac{7}{8}\cdot\frac{3q}{16}\cdot e^{-8/15}\ge\frac{q}{59}\ge\frac{\Psi_m}{59}. 4 2 1 ⋅ 8 7 ⋅ 16 3 q ⋅ e − 8/15 ≥ 59 q ≥ 59 Ψ m .
Both cases give at least Ψ m / 64 \Psi_m/64 Ψ m /64 . Taking the infimum over v ~ ∈ C m \widetilde v\in\mathcal{C}_m v ∈ C m and the supremum over systems proves the claim. Both instances have k L > m k_L>m k L > m , so the bound also holds for systems below the exact threshold.
The Upper Bound and the Sample-and-Hold Context
Lemma D.7 (Sample-and-hold error). Let ∥ ⋅ ∥ \lVert\cdot\rVert ∥ ⋅ ∥ be any norm with ∥ P ^ x ∥ ≤ ∥ x ∥ \lVert\widehat{P}x\rVert\le\lVert x\rVert ∥ P x ∥ ≤ ∥ x ∥ . For the schedule with parameters ( k , j ) (k,j) ( k , j ) , every ℓ ≥ 0 \ell\ge0 ℓ ≥ 0 satisfies ∥ v ^ ℓ − v ^ σ ( ℓ ) ∥ < γ k ∥ r ^ ∥ / ( ( j + 1 ) ( 1 − γ ) ) \lVert\widehat{v}_\ell-\widehat{v}_{\sigma(\ell)}\rVert<\gamma^k\lVert\widehat{r}\rVert/((j+1)(1-\gamma)) ∥ v ℓ − v σ ( ℓ ) ∥ < γ k ∥ r ∥ / (( j + 1 ) ( 1 − γ )) .
Proof. For ℓ ≤ k \ell\le k ℓ ≤ k the error is zero. Let ℓ = k + i \ell=k+i ℓ = k + i and s = max { s : i s ≤ i } s=\max\{s:i_s\le i\} s = max { s : i s ≤ i } (with i 0 = 0 i_0=0 i 0 = 0 ), so that σ ( ℓ ) = k + i s \sigma(\ell)=k+i_s σ ( ℓ ) = k + i s . Then ∥ v ^ ℓ − v ^ σ ( ℓ ) ∥ ≤ ∑ t = k + i s k + i − 1 γ t ∥ r ^ ∥ = γ k γ i s − γ i 1 − γ ∥ r ^ ∥ \lVert\widehat{v}_\ell-\widehat{v}_{\sigma(\ell)}\rVert\le\sum_{t=k+i_s}^{k+i-1}\gamma^t\lVert\widehat{r}\rVert=\gamma^k\frac{\gamma^{i_s}-\gamma^i}{1-\gamma}\lVert\widehat{r}\rVert ∥ v ℓ − v σ ( ℓ ) ∥ ≤ ∑ t = k + i s k + i − 1 γ t ∥ r ∥ = γ k 1 − γ γ i s − γ i ∥ r ∥ . By definition 1 − γ i s ≥ s / ( j + 1 ) 1-\gamma^{i_s}\ge s/(j+1) 1 − γ i s ≥ s / ( j + 1 ) . If s < j s<j s < j , then i < i s + 1 i<i_{s+1} i < i s + 1 gives 1 − γ i < ( s + 1 ) / ( j + 1 ) 1-\gamma^i<(s+1)/(j+1) 1 − γ i < ( s + 1 ) / ( j + 1 ) ; if s = j s=j s = j , then 1 − γ i < 1 1-\gamma^i<1 1 − γ i < 1 . In both cases γ i s − γ i < 1 / ( j + 1 ) \gamma^{i_s}-\gamma^i<1/(j+1) γ i s − γ i < 1/ ( j + 1 ) .
Proof of the upper bound in Theorem 4.5 . The increments x u x_u x u span at most m m m dimensions and the executor gives D = X D=X D = X , so the sample-and-hold output lies in C m \mathcal{C}_m C m . It remains to bound F = γ k / ( ( j + 1 ) ( 1 − γ ) ) F=\gamma^k/((j+1)(1-\gamma)) F = γ k / (( j + 1 ) ( 1 − γ )) by e 2 Ψ m e^2\Psi_m e 2 Ψ m ; Lemma D.4 supplies the required norms. If γ < 1 2 \gamma<\frac{1}{2} γ < 2 1 , then F = γ m / ( 1 − γ ) ≤ 2 γ m ≤ 2 Ψ m F=\gamma^m/(1-\gamma)\le2\gamma^m\le2\Psi_m F = γ m / ( 1 − γ ) ≤ 2 γ m ≤ 2 Ψ m . If γ ≥ 1 2 \gamma\ge\frac{1}{2} γ ≥ 2 1 and m ≤ J m\le J m ≤ J , then q ≥ 1 q\ge1 q ≥ 1 , and F < 1 / ( m ( 1 − γ ) ) = γ − m Ψ m ≤ γ − 1 / ( 1 − γ ) Ψ m ≤ e 2 Ψ m F<1/(m(1-\gamma))=\gamma^{-m}\Psi_m\le\gamma^{-1/(1-\gamma)}\Psi_m\le e^2\Psi_m F < 1/ ( m ( 1 − γ )) = γ − m Ψ m ≤ γ − 1/ ( 1 − γ ) Ψ m ≤ e 2 Ψ m , using − ln γ ≤ ( 1 − γ ) / γ ≤ 2 ( 1 − γ ) -\ln\gamma\le(1-\gamma)/\gamma\le2(1-\gamma) − ln γ ≤ ( 1 − γ ) / γ ≤ 2 ( 1 − γ ) . Otherwise m ≥ J + 1 > 1 / ( 1 − γ ) m\ge J+1>1/(1-\gamma) m ≥ J + 1 > 1/ ( 1 − γ ) , so Ψ m = γ m \Psi_m=\gamma^m Ψ m = γ m , and F < γ m − J ≤ γ − J Ψ m ≤ e 2 Ψ m F<\gamma^{m-J}\le\gamma^{-J}\Psi_m\le e^2\Psi_m F < γ m − J ≤ γ − J Ψ m ≤ e 2 Ψ m .
Remark D.8 (The schedule must depend on γ \gamma γ ). For constant reward r ^ = 1 \widehat r=1 r = 1 , v ^ ℓ = 1 − γ ℓ 1 − γ \widehat v_\ell=\frac{1-\gamma^\ell}{1-\gamma} v ℓ = 1 − γ 1 − γ ℓ , and any schedule T \mathcal{T} T has error at least γ max T / ( 1 − γ ) \gamma^{\max\mathcal{T}}/(1-\gamma) γ m a x T / ( 1 − γ ) as ℓ → ∞ \ell\to\infty ℓ → ∞ . If T \mathcal{T} T is fixed independently of γ \gamma γ and γ ≥ 1 2 \gamma\ge\frac{1}{2} γ ≥ 2 1 is close enough to one that max T ≤ 1 / ( 1 − γ ) \max\mathcal{T}\le1/(1-\gamma) max T ≤ 1/ ( 1 − γ ) , this is at least e − 2 / ( 1 − γ ) ≥ e − 2 m Ψ m e^{-2}/(1-\gamma)\ge e^{-2}m\Psi_m e − 2 / ( 1 − γ ) ≥ e − 2 m Ψ m . Dyadic schedules { 1 , 2 , 4 , … } \{1,2,4,\ldots\} { 1 , 2 , 4 , … } and uniform schedules are therefore off by a factor Ω ( m ) \Omega(m) Ω ( m ) . The quantile schedule places samples where the remaining discounted mass decreases by equal fractions.
Finite Depth
This subsection states and proves the finite-depth version of Theorem 4.5 summarized in § 4.2 . Throughout, C m \mathcal{C}_m C m is the depth-L L L class of Definition 4.1 and the error of a context is max 0 ≤ ℓ ≤ L ∥ v ^ ℓ − v ~ ℓ ∥ μ / ∥ r ^ ∥ μ \max_{0\le\ell\le L}\lVert\widehat v_\ell-\widetilde v_\ell\rVert_\mu/\lVert\widehat r\rVert_\mu max 0 ≤ ℓ ≤ L ∥ v ℓ − v ℓ ∥ μ / ∥ r ∥ μ , so that E m , L ( γ ) \mathcal{E}_{m,L}(\gamma) E m , L ( γ ) is the worst case of its infimum over C m \mathcal{C}_m C m . Lemma D.5 applies verbatim to block increments with b ≤ L b\le L b ≤ L , since its proof uses only the errors at depths a a a and b b b .
Proposition D.9 (Finite depth). For all m ≥ 1 m\ge1 m ≥ 1 , γ ∈ ( 0 , 1 ) \gamma\in(0,1) γ ∈ ( 0 , 1 ) and L ≥ 1 L\ge1 L ≥ 1 , with Ψ m , L ( γ ) : = γ m max { 1 , ( 1 − γ L ) / ( m ( 1 − γ ) ) } ≤ Ψ m ( γ ) \Psi_{m,L}(\gamma):=\gamma^m\max\{1,(1-\gamma^L)/(m(1-\gamma))\}\le\Psi_m(\gamma) Ψ m , L ( γ ) := γ m max { 1 , ( 1 − γ L ) / ( m ( 1 − γ ))} ≤ Ψ m ( γ ) : (a) E m , L ( γ ) ≤ E m ( γ ) \mathcal{E}_{m,L}(\gamma)\le\mathcal{E}_m(\gamma) E m , L ( γ ) ≤ E m ( γ ) , and E m , L ( γ ) = 0 \mathcal{E}_{m,L}(\gamma)=0 E m , L ( γ ) = 0 if and only if m ≥ L m\ge L m ≥ L . (b) E m , L ( γ ) ≤ e 2 Ψ m , L ( γ ) \mathcal{E}_{m,L}(\gamma)\le e^2\Psi_{m,L}(\gamma) E m , L ( γ ) ≤ e 2 Ψ m , L ( γ ) , attained by sample-and-hold with sampled depths at the quantiles of the discounted mass through depth L L L . (c) E m , L ( γ ) ≥ γ m / ( 2 m + 1 ) \mathcal{E}_{m,L}(\gamma)\ge\gamma^m/(2\sqrt{m}+1) E m , L ( γ ) ≥ γ m / ( 2 m + 1 ) if L ≥ m + 1 L\ge m+1 L ≥ m + 1 , and E m , L ( γ ) ≥ Ψ m ( γ ) / 64 \mathcal{E}_{m,L}(\gamma)\ge\Psi_m(\gamma)/64 E m , L ( γ ) ≥ Ψ m ( γ ) /64 if L ≥ m + 4 / ( 1 − γ ) L\ge m+4/(1-\gamma) L ≥ m + 4/ ( 1 − γ ) . (d) If γ ≥ 1 2 \gamma\ge\frac{1}{2} γ ≥ 2 1 and 8 m ≤ L ≤ 1 / ( 1 − γ ) 8m\le L\le1/(1-\gamma) 8 m ≤ L ≤ 1/ ( 1 − γ ) , then L / ( 400 m ) ≤ E m , L ( γ ) ≤ e 2 L / m L/(400m)\le\mathcal{E}_{m,L}(\gamma)\le e^2L/m L / ( 400 m ) ≤ E m , L ( γ ) ≤ e 2 L / m .
Proof. (a) Restricting a context of depth L ′ ≥ L L'\ge L L ′ ≥ L , or of unbounded depth, to the depths ℓ ≤ L \ell\le L ℓ ≤ L gives a context of depth L L L with the same decoder, and a maximum over fewer depths is smaller; hence E m , L \mathcal{E}_{m,L} E m , L is nondecreasing in L L L and E m , L ≤ E m \mathcal{E}_{m,L}\le\mathcal{E}_m E m , L ≤ E m . If m ≥ L m\ge L m ≥ L , the Krylov context of Theorem 4.3 (b) is exact with k L ≤ L k_L\le L k L ≤ L tokens (padded with zero tokens), so E m , L = 0 \mathcal{E}_{m,L}=0 E m , L = 0 . If m < L m<L m < L , part (c) gives E m , L ≥ γ m / ( 2 m + 1 ) > 0 \mathcal{E}_{m,L}\ge\gamma^m/(2\sqrt{m}+1)>0 E m , L ≥ γ m / ( 2 m + 1 ) > 0 .
(b) Keep the split ( k , j ) (k,j) ( k , j ) of Section 4.2; if k ≥ L k\ge L k ≥ L the context is exact. Otherwise replace the sampled depths by the quantiles of the discounted mass through depth L L L , T m , L ( γ ) = { 1 , … , k } ∪ { k + i s : 1 ≤ s ≤ j } \mathcal{T}_{m,L}(\gamma)=\{1,\ldots,k\}\cup\{k+i_s:1\le s\le j\} T m , L ( γ ) = { 1 , … , k } ∪ { k + i s : 1 ≤ s ≤ j } with i s = min { i ≥ 0 : 1 − γ i ≥ s j + 1 ( 1 − γ L − k ) } i_s=\min\{i\ge0:1-\gamma^i\ge\frac{s}{j+1}(1-\gamma^{L-k})\} i s = min { i ≥ 0 : 1 − γ i ≥ j + 1 s ( 1 − γ L − k )} , so that i j ≤ L − k i_j\le L-k i j ≤ L − k ; the encoder and executor are those of Appendix A.12 with these stamps, and the output lies in C m \mathcal{C}_m C m as in the proof of Theorem 4.5 . For ℓ ≤ k \ell\le k ℓ ≤ k the error is zero. For ℓ = k + i ≤ L \ell=k+i\le L ℓ = k + i ≤ L let s = max { s : i s ≤ i } s=\max\{s:i_s\le i\} s = max { s : i s ≤ i } ; as Lemma D.7. ∥ v ^ ℓ − v ^ σ ( ℓ ) ∥ μ ≤ γ k ( γ i s − γ i ) ∥ r ^ ∥ μ / ( 1 − γ ) \lVert\widehat v_{\ell}-\widehat v_{\sigma(\ell)}\rVert_{\mu}\leq\gamma^{k}(\gamma^{i s}-\gamma^{i})\lVert\widehat r\rVert_{\mu}/(1-\gamma) ∥ v ℓ − v σ ( ℓ ) ∥ μ ≤ γ k ( γ i s − γ i ) ∥ r ∥ μ / ( 1 − γ ) , and γ i s − γ i = ( 1 − γ i ) − ( 1 − γ i s ) ≤ ( 1 − γ L − k ) / ( j + 1 ) \gamma^{i s}-\gamma^{i}=(1-\gamma^{i})-(1-\gamma^{i s})\leq(1-\gamma^{L-k})/(j+1) γ i s − γ i = ( 1 − γ i ) − ( 1 − γ i s ) ≤ ( 1 − γ L − k ) / ( j + 1 ) : for s < j s<j s < j because 1 − γ i s ≤ s + 1 j + 1 ( 1 − γ L − k ) 1-\gamma^{i s}\leq\frac{s+1}{j+1}(1-\gamma^{L-k}) 1 − γ i s ≤ j + 1 s + 1 ( 1 − γ L − k ) , and for s = j s=j s = j because i ≤ L − k i\leq L-k i ≤ L − k . Hence the error is at most F L : = γ k ( 1 − γ L − k ) ( j + 1 ) ( 1 − γ ) ≤ γ k ( 1 − γ L ) ( j + 1 ) ( 1 − γ ) F_L:=\frac{\gamma^k(1-\gamma^{L-k})}{(j+1)(1-\gamma)}\leq\frac{\gamma^k(1-\gamma^L)}{(j+1)(1-\gamma)} F L := ( j + 1 ) ( 1 − γ ) γ k ( 1 − γ L − k ) ≤ ( j + 1 ) ( 1 − γ ) γ k ( 1 − γ L ) , and the three cases of the proof of Theorem 4.5 give F L ≤ e 2 Ψ m , L F_L\leq e^2\Psi_{m,L} F L ≤ e 2 Ψ m , L : for γ < 1 2 \gamma<\frac{1}{2} γ < 2 1 , F L ≤ γ m 1 − γ ≤ 2 γ m ≤ 2 Ψ m , L F_L\leq\frac{\gamma^m}{1-\gamma}\leq2\gamma^m\leq2\Psi_{m,L} F L ≤ 1 − γ γ m ≤ 2 γ m ≤ 2 Ψ m , L ; for γ ≥ 1 2 \gamma\geq\frac{1}{2} γ ≥ 2 1 and m ≤ J m\leq J m ≤ J , F L < 1 − γ L m ( 1 − γ ) = γ − m ⋅ γ m ( 1 − γ L ) m ( 1 − γ ) ≤ γ − J Ψ m , L ≤ e 2 Ψ m , L F_L<\frac{1-\gamma^L}{m(1-\gamma)}=\gamma^{-m}\cdot\frac{\gamma^m(1-\gamma^L)}{m(1-\gamma)}\leq\gamma^{-J}\Psi_{m,L}\leq e^2\Psi_{m,L} F L < m ( 1 − γ ) 1 − γ L = γ − m ⋅ m ( 1 − γ ) γ m ( 1 − γ L ) ≤ γ − J Ψ m , L ≤ e 2 Ψ m , L ; and for m ≥ J + 1 m\geq J+1 m ≥ J + 1 , F L ≤ γ m − J ( J + 1 ) ( 1 − γ ) < γ − J γ m ≤ e 2 Ψ m , L F_L\leq\frac{\gamma^{m-J}}{(J+1)(1-\gamma)}<\gamma^{-J}\gamma^m\leq e^2\Psi_{m,L} F L ≤ ( J + 1 ) ( 1 − γ ) γ m − J < γ − J γ m ≤ e 2 Ψ m , L .
(c) Let L ≥ m + 1 L\geq m+1 L ≥ m + 1 and take Instance I with n ≥ m + 2 n\geq m+2 n ≥ m + 2 states. The single-step increments x t = A ^ t r = γ t n e − t x_t=\widehat A^t r=\gamma^t\sqrt n\,e_{-t} x t = A t r = γ t n e − t , t = 0 , … , m t=0,\ldots,m t = 0 , … , m , are orthogonal with ∥ x t ∥ μ = γ t \lVert x_t\rVert_{\mu}=\gamma^t ∥ x t ∥ μ = γ t , and each is a block increment with b = t + 1 ≤ L b=t+1\leq L b = t + 1 ≤ L . Let a context have error ε \varepsilon ε , let U = col ( D ) U=\operatorname{col}(D) U = col ( D ) with dim U ≤ m \dim U\leq m dim U ≤ m , let Π \Pi Π be the orthogonal projection onto U U U , and let x ^ t \widehat x_t x t be the normalized vectors. Then ∑ t ≤ m ∥ Π x ^ t ∥ 2 ≤ tr Π ≤ m \sum_{t\leq m}\lVert\Pi\widehat x_t\rVert^2\leq\operatorname{tr}\Pi\leq m ∑ t ≤ m ∥ Π x t ∥ 2 ≤ tr Π ≤ m , so
∑ t ≤ m dist ( x t , U ) 2 = ∑ t ≤ m γ 2 t ( 1 − ∥ Π x ^ t ∥ 2 ) ≥ γ 2 m ∑ t ≤ m ( 1 − ∥ Π x ^ t ∥ 2 ) ≥ γ 2 m , \sum_{t\leq m}\operatorname{dist}(x_t,U)^2=\sum_{t\leq m}\gamma^{2t}(1-\lVert\Pi\widehat x_t\rVert^2)\geq\gamma^{2m}\sum_{t\leq m}(1-\lVert\Pi\widehat x_t\rVert^2)\geq\gamma^{2m}, t ≤ m ∑ dist ( x t , U ) 2 = t ≤ m ∑ γ 2 t ( 1 − ∥ Π x t ∥ 2 ) ≥ γ 2 m t ≤ m ∑ ( 1 − ∥ Π x t ∥ 2 ) ≥ γ 2 m ,
hence max t dist ( x t , U ) ≥ γ m / m + 1 \max_t\operatorname{dist}(x_t,U)\geq\gamma^m/\sqrt{m+1} max t dist ( x t , U ) ≥ γ m / m + 1 , and Lemma D.5 gives 2 ε ≥ γ m / m + 1 2\varepsilon\geq\gamma^m/\sqrt{m+1} 2 ε ≥ γ m / m + 1 . For the second claim, the proof of the lower bound of Theorem 4.5 uses only block increments v ^ b − v ^ a \widehat v_b-\widehat v_a v b − v a with b ≤ L 0 b\leq L_0 b ≤ L 0 : for Instance I, L 0 = n = ⌈ m + 1 + 1 / ( 1 − γ 2 ) ⌉ ≤ m + 2 + 1 / ( 1 − γ ) L_0=n=\lceil m+1+1/(1-\gamma^2)\rceil\leq m+2+1/(1-\gamma) L 0 = n = ⌈ m + 1 + 1/ ( 1 − γ 2 )⌉ ≤ m + 2 + 1/ ( 1 − γ ) ; for Instance II, L 0 = ( 2 T − 1 ) w L_0=(2T-1)w L 0 = ( 2 T − 1 ) w with T = ⌈ m + 1 + 1 / ( 1 − γ 4 w ) ⌉ T=\lceil m+1+1/(1-\gamma^{4w})\rceil T = ⌈ m + 1 + 1/ ( 1 − γ 4 w )⌉ , w = ⌊ q / 4 ⌋ w=\lfloor q/4\rfloor w = ⌊ q /4 ⌋ and q = 1 / ( m ( 1 − γ ) ) > 16 q=1/(m(1-\gamma))>16 q = 1/ ( m ( 1 − γ )) > 16 , which forces γ > 1 2 \gamma>\frac{1}{2} γ > 2 1 . Since x : = 4 w ( 1 − γ ) ≤ q ( 1 − γ ) = 1 / m ≤ 1 x:=4w(1-\gamma)\leq q(1-\gamma)=1/m\leq1 x := 4 w ( 1 − γ ) ≤ q ( 1 − γ ) = 1/ m ≤ 1 and γ 4 w ≤ e − x \gamma^{4w}\leq e^{-x} γ 4 w ≤ e − x , we have 1 − γ 4 w ≥ 1 − e − x ≥ x / 2 1-\gamma^{4w}\geq1-e^{-x}\geq x/2 1 − γ 4 w ≥ 1 − e − x ≥ x /2 , so T ≤ m + 2 + 1 / ( 2 w ( 1 − γ ) ) T\leq m+2+1/(2w(1-\gamma)) T ≤ m + 2 + 1/ ( 2 w ( 1 − γ )) and
( 2 T − 1 ) w ≤ ( 2 m + 3 ) w + 1 1 − γ ≤ 2 m + 3 4 m 1 1 − γ + 1 1 − γ ≤ 9 4 ( 1 − γ ) . (2T-1)w\leq(2m+3)w+\frac{1}{1-\gamma}\leq\frac{2m+3}{4m} \frac{1}{1-\gamma}+\frac{1}{1-\gamma}\leq\frac{9}{4(1-\gamma)}. ( 2 T − 1 ) w ≤ ( 2 m + 3 ) w + 1 − γ 1 ≤ 4 m 2 m + 3 1 − γ 1 + 1 − γ 1 ≤ 4 ( 1 − γ ) 9 .
Both depths are at most m + 4 / ( 1 − γ ) m+4/(1-\gamma) m + 4/ ( 1 − γ ) , so for L ≥ m + 4 / ( 1 − γ ) L\geq m+4/(1-\gamma) L ≥ m + 4/ ( 1 − γ ) every context of depth L L L incurs error at least Ψ m / 64 \Psi_m/64 Ψ m /64 on one of the two instances, exactly as in that proof.
(d) Let γ ≥ 1 2 \gamma\geq\frac{1}{2} γ ≥ 2 1 and 8 m ≤ L ≤ 1 / ( 1 − γ ) 8m\leq L\leq1/(1-\gamma) 8 m ≤ L ≤ 1/ ( 1 − γ ) . Take Instance II with w = ⌊ L / ( 4 m ) ⌋ ≥ 2 w=\lfloor L/(4m)\rfloor\geq2 w = ⌊ L / ( 4 m )⌋ ≥ 2 and T = 2 m T=2m T = 2 m ; its even blocks u t = τ 2 t u_t=\tau_{2t} u t = τ 2 t , t < T t<T t < T , have b = ( 2 t + 1 ) w ≤ ( 4 m − 1 ) w < L b=(2t+1)w\leq(4m-1)w<L b = ( 2 t + 1 ) w ≤ ( 4 m − 1 ) w < L , are orthogonal, and satisfy ∥ u t ∥ μ = γ 2 t w ∥ τ 0 ∥ μ ≥ a : = γ 4 m w S w / 2 \lVert u_t\rVert_{\mu}=\gamma^{2tw}\lVert\tau_0\rVert_{\mu}\geq a:=\gamma^{4mw}S_w/\sqrt2 ∥ u t ∥ μ = γ 2 tw ∥ τ 0 ∥ μ ≥ a := γ 4 m w S w / 2 . For a context with error ε \varepsilon ε and U = col ( D ) U=\operatorname{col}(D) U = col ( D ) , the argument of part (c) gives ∑ t < T dist ( u t , U ) 2 ≥ a 2 ( T − m ) = a 2 m \sum_{t<T}\operatorname{dist}(u_t,U)^2\geq a^2(T-m)=a^2m ∑ t < T dist ( u t , U ) 2 ≥ a 2 ( T − m ) = a 2 m , so max t dist ( u t , U ) ≥ a / 2 \max_t\operatorname{dist}(u_t,U)\geq a/\sqrt2 max t dist ( u t , U ) ≥ a / 2 and, by Lemma D.5, ε ≥ a / ( 2 2 ) ≥ γ 4 m w S w / 4 \varepsilon\geq a/(2\sqrt2)\geq\gamma^{4mw}S_w/4 ε ≥ a / ( 2 2 ) ≥ γ 4 m w S w /4 . Now S w ≥ w γ w S_w\geq w\gamma^w S w ≥ w γ w , ( 4 m + 1 ) w ≤ 4 m + 1 4 m L ≤ 5 4 ( 1 − γ ) (4m+1)w\leq\frac{4m+1}{4m}L\leq\frac{5}{4(1-\gamma)} ( 4 m + 1 ) w ≤ 4 m 4 m + 1 L ≤ 4 ( 1 − γ ) 5 , and − ln γ ≤ 2 ( 1 − γ ) -\ln\gamma\leq2(1-\gamma) − ln γ ≤ 2 ( 1 − γ ) for γ ≥ 1 2 \gamma\geq\frac{1}{2} γ ≥ 2 1 , so γ ( 4 m + 1 ) w ≥ e − 5 / 2 \gamma^{(4m+1)w}\geq e^{-5/2} γ ( 4 m + 1 ) w ≥ e − 5/2 ; with w ≥ L / ( 4 m ) − 1 ≥ L / ( 8 m ) w\geq L/(4m)-1\geq L/(8m) w ≥ L / ( 4 m ) − 1 ≥ L / ( 8 m ) this gives ε ≥ e − 5 / 2 L / ( 32 m ) ≥ L / ( 400 m ) \varepsilon\geq e^{-5/2}L/(32m)\geq L/(400m) ε ≥ e − 5/2 L / ( 32 m ) ≥ L / ( 400 m ) . The upper bound is part (b) with Ψ m , L ≤ γ m max { 1 , L / m } ≤ L / m \Psi_{m,L}\leq\gamma^m\max\{1,L/m\}\leq L/m Ψ m , L ≤ γ m max { 1 , L / m } ≤ L / m , because ( 1 − γ L ) / ( 1 − γ ) ≤ L (1-\gamma^L)/(1-\gamma)\leq L ( 1 − γ L ) / ( 1 − γ ) ≤ L and L ≥ m L\geq m L ≥ m .
Proof of Proposition D.1
Terminal correction (Krylov truncation). For m < k L m<k_L m < k L the budget-m m m encoder gives an upper-Hessenberg H m H_m H m with unit subdiagonal and g m = e 1 g_m=e_1 g m = e 1 . Replacing H m H_m H m by T m = H m − ( H m g m ) e m T T_m=H_m-(H_mg_m)e_m^{\mathsf T} T m = H m − ( H m g m ) e m T preserves T m j g m = H m j g m T_m^jg_m=H_m^jg_m T m j g m = H m j g m for j < m j<m j < m and gives T m m g m = 0 T_m^mg_m=0 T m m g m = 0 , since e m T H m j g m = 0 e_m^{\mathsf T}H_m^jg_m=0 e m T H m j g m = 0 for j < m − 1 j<m-1 j < m − 1 and e m T H m m − 1 g m = 1 e_m^{\mathsf T}H_m^{m-1}g_m=1 e m T H m m − 1 g m = 1 . Seven further heads compute T m T_m T m by m m m reduced multiplications (Appendix § 10 .§ 5 ), and the output is exactly v ^ min { ℓ , m } \widehat v_{\min\{\ell,m\}} v m i n { ℓ , m } , i.e., TD stopped after m m m steps.
Proof of (a). By Lemma D.4, ∥ v ^ ℓ − v ^ m ∥ μ ≤ ∑ i ≥ m γ i ∥ r ^ ∥ μ = γ m ∥ r ^ ∥ μ / ( 1 − γ ) \lVert\widehat v_\ell-\widehat v_m\rVert_{\mu}\leq\sum_{i\geq m}\gamma^i\lVert\widehat r\rVert_{\mu}=\gamma^m\lVert\widehat r\rVert_{\mu}/(1-\gamma) ∥ v ℓ − v m ∥ μ ≤ ∑ i ≥ m γ i ∥ r ∥ μ = γ m ∥ r ∥ μ / ( 1 − γ ) . For the matching lower bound, take the ring with n = m + 2 n=m+2 n = m + 2 , L ≥ m + 1 L\geq m+1 L ≥ m + 1 , and r ε = 1 + ε n e 0 r_\varepsilon=1+\varepsilon\sqrt n\,e_0 r ε = 1 + ε n e 0 . The Krylov vectors γ j ( 1 + ε n e − j ) \gamma^j(1+\varepsilon\sqrt n\,e_{-j}) γ j ( 1 + ε n e − j ) form, up to a column permutation, the matrix 11 T + ε n I \mathbf1\mathbf1^{\mathsf T}+\varepsilon\sqrt n I 1 1 T + ε n I , which is nonsingular; hence k L → ∞ k_L\to\infty k L → ∞ as ε → 0 \varepsilon\to0 ε → 0 and the error tends to ∥ A ^ m v ∞ ∥ μ \lVert\widehat A^m v_\infty\rVert_{\mu} ∥ A m v ∞ ∥ μ , with v ∞ = 1 1 − γ A ^ − 1 e 0 v_\infty=\frac{1}{1-\gamma}\widehat A^{-1}e_0 v ∞ = 1 − γ 1 A − 1 e 0 , which is at least γ m ( 1 − ε ) / ( 1 − γ ) \gamma^m(1-\varepsilon)/(1-\gamma) γ m ( 1 − ε ) / ( 1 − γ ) , while ∥ r ε ∥ μ ≤ 1 + ε \lVert r_\varepsilon\rVert_{\mu}\leq1+\varepsilon ∥ r ε ∥ μ ≤ 1 + ε . Letting ε → 0 \varepsilon\to0 ε → 0 gives the supremum γ m / ( 1 − γ ) \gamma^m/(1-\gamma) γ m / ( 1 − γ ) , and γ m / ( 1 − γ ) Ψ m = min { m , 1 1 − γ } \frac{\gamma^m/(1-\gamma)}{\Psi_m}=\min\{m,\frac{1}{1-\gamma}\} Ψ m γ m / ( 1 − γ ) = min { m , 1 − γ 1 } .
Proof of (b). Take the ring with n = m + p n=m+p n = m + p states, p = ⌈ 1 / ( 1 − γ ) ⌉ p=\lceil1/(1-\gamma)\rceil p = ⌈ 1/ ( 1 − γ )⌉ , r = n e 0 r=\sqrt n\,e_0 r = n e 0 , and L ≥ n L\geq n L ≥ n . Then φ t = P t r \varphi_t=P^tr φ t = P t r (t < n t<n t < n ) are orthonormal in ∥ ⋅ ∥ μ \lVert\cdot\rVert_\mu ∥ ⋅ ∥ μ , and all visit counts are equal, so Euclidean and visit-weighted Arnoldi coincide. The encoder gives b j ∝ φ j − 1 b_j\propto\varphi_{j-1} b j ∝ φ j − 1 for j ≤ m j\leq m j ≤ m , and A ^ b m ∝ φ m ⊥ span ( b 1 , … , b m ) \widehat A b_m\propto\varphi_m\perp\operatorname{span}(b_1,\ldots,b_m) A b m ∝ φ m ⊥ span ( b 1 , … , b m ) , so the last column of H H H vanishes and H H H is nilpotent. Galerkin excitation therefore outputs ∑ t < min { ℓ , m } γ t φ t \sum_{t<\min\{\ell,m\}} \gamma^t\varphi_t ∑ t < m i n { ℓ , m } γ t φ t , and at ℓ = n \ell=n ℓ = n its error is ∥ ∑ t = m n − 1 γ t φ t ∥ μ = γ m ( 1 − γ 2 p ) / ( 1 − γ 2 ) \left\|\sum_{t=m}^{n-1}\gamma^t\varphi_t\right\|_\mu=\gamma^m\sqrt{(1-\gamma^{2p})/(1-\gamma^2)} ∑ t = m n − 1 γ t φ t μ = γ m ( 1 − γ 2 p ) / ( 1 − γ 2 ) . Since γ 2 p ≤ e − 2 \gamma^{2p}\le e^{-2} γ 2 p ≤ e − 2 and 1 − γ 2 ≤ 2 ( 1 − γ ) 1-\gamma^2\le2(1-\gamma) 1 − γ 2 ≤ 2 ( 1 − γ ) , this is at least ( 1 − e − 2 ) / 2 γ m / 1 − γ ≥ 0.657 γ m / 1 − γ \sqrt{(1-e^{-2})/2}\,\gamma^m/\sqrt{1-\gamma}\ge0.657\,\gamma^m/\sqrt{1-\gamma} ( 1 − e − 2 ) /2 γ m / 1 − γ ≥ 0.657 γ m / 1 − γ . For m ≥ 1 / ( 1 − γ ) m\ge1/(1-\gamma) m ≥ 1/ ( 1 − γ ) we have Ψ m = γ m \Psi_m=\gamma^m Ψ m = γ m , which gives the second form. The instance has k L = min { n , L } > m k_L=\min\{n,L\}>m k L = min { n , L } > m .
Proof of Theorem D.2
Lemma D.10 (Normalized Galerkin form). Suppose the budget-k k k w w w -Arnoldi encoder does not break down. Let Q Q Q be its w w w -orthonormalized basis, Q ∗ = Q ⊤ D w Q^*=Q^\top D_w Q ∗ = Q ⊤ D w , and H ^ = Q ∗ A ^ Q \widehat{H}=Q^*\widehat{A}Q H = Q ∗ A Q . Then the executed trajectory is v ^ ℓ Q = ∑ i < ℓ Q H ^ i Q ∗ r ^ \widehat{v}^{\,Q}_\ell=\sum_{i<\ell}Q\widehat{H}^iQ^*\widehat{r} v ℓ Q = ∑ i < ℓ Q H i Q ∗ r , the matrix satisfies ∥ H ^ ∥ 2 ≤ ∥ A ^ ∥ w ≤ γ \|\widehat{H}\|_2\le\|\widehat{A}\|_w\le\gamma ∥ H ∥ 2 ≤ ∥ A ∥ w ≤ γ , and Q H ^ i Q ∗ r ^ = A ^ i r ^ Q\widehat{H}^iQ^*\widehat{r}=\widehat{A}^i\widehat{r} Q H i Q ∗ r = A i r for i < k i<k i < k . Diagonal rescalings of the basis, including ℓ 1 \ell_1 ℓ 1 balancing, leave the trajectory unchanged.
Proof. With D g = diag ( ∥ b i ∥ w ) D_g=\operatorname{diag}(\|b_i\|_w) D g = diag ( ∥ b i ∥ w ) and Q = B D g − 1 Q=BD_g^{-1} Q = B D g − 1 , we have Ω = D w B D g − 2 \Omega=D_wBD_g^{-2} Ω = D w B D g − 2 , H = D g − 1 H ^ D g H=D_g^{-1}\widehat{H}D_g H = D g − 1 H D g , and g = D g − 1 Q ∗ r ^ g=D_g^{-1}Q^*\widehat{r} g = D g − 1 Q ∗ r , so B H i g = Q H ^ i Q ∗ r ^ BH^ig=Q\widehat{H}^iQ^*\widehat{r} B H i g = Q H i Q ∗ r . Q Q Q is an isometry from ( R k , ℓ 2 ) (\mathbb{R}^k,\ell_2) ( R k , ℓ 2 ) into ( R n , ∥ ⋅ ∥ w ) (\mathbb{R}^n,\|\cdot\|_w) ( R n , ∥ ⋅ ∥ w ) , which gives the norm bound. Moment matching for i < k i<k i < k follows as in Theorem 4.3, with the w w w -orthogonal projection Q Q ∗ QQ^* Q Q ∗ .
Proof of Theorem D.2. If breakdown occurs within k k k rounds, K L K_L K L is invariant, all residuals vanish, and the output is exact. Otherwise let e ℓ = v ^ ℓ − v ~ ℓ G e_\ell=\widehat{v}_\ell-\widetilde{v}^{G}_\ell e ℓ = v ℓ − v ℓ G . By Lemma D.10, e ℓ = 0 e_\ell=0 e ℓ = 0 for ℓ ≤ k \ell\le k ℓ ≤ k , and for k ≤ a ≤ b k\le a\le b k ≤ a ≤ b ,
∥ e b − e a ∥ w ≤ ∑ i = a b − 1 ( ∥ A ^ i r ^ ∥ w + ∥ Q H ^ i Q ∗ r ^ ∥ w ) ≤ 2 ∑ i = a b − 1 γ i ∥ r ^ ∥ w . \|e_b-e_a\|_w\le\sum_{i=a}^{b-1}\left(\|\widehat{A}^i\widehat{r}\|_w+\|Q\widehat{H}^iQ^*\widehat{r}\|_w\right)\le2\sum_{i=a}^{b-1}\gamma^i\|\widehat{r}\|_w. ∥ e b − e a ∥ w ≤ i = a ∑ b − 1 ( ∥ A i r ∥ w + ∥ Q H i Q ∗ r ∥ w ) ≤ 2 i = a ∑ b − 1 γ i ∥ r ∥ w .
The anchored output error is ∥ e ℓ − e σ ( ℓ ) ∥ w \|e_\ell-e_{\sigma(\ell)}\|_w ∥ e ℓ − e σ ( ℓ ) ∥ w , where σ ( ℓ ) ∈ { k } ∪ { k + i s } \sigma(\ell)\in\{k\}\cup\{k+is\} σ ( ℓ ) ∈ { k } ∪ { k + i s } and e k = 0 e_k=0 e k = 0 . The argument of Lemma D.7 bounds it by 2 γ k ∥ r ^ ∥ w / ( ( j + 1 ) ( 1 − γ ) ) 2\gamma^k\|\widehat{r}\|_w/((j+1)(1-\gamma)) 2 γ k ∥ r ∥ w / (( j + 1 ) ( 1 − γ )) , and trivially by 2 sup ℓ ∥ e ℓ ∥ w = 2 E G ∥ r ^ ∥ w 2\sup_\ell\|e_\ell\|_w=2E_G\|\widehat{r}\|_w 2 sup ℓ ∥ e ℓ ∥ w = 2 E G ∥ r ∥ w . The increments lie in col ( B ) \operatorname{col}(B) col ( B ) plus the span of j j j held residual increments, so the output is in C m \mathbb{C}^m C m .
It remains to show F : = 2 γ k / ( ( j + 1 ) ( 1 − γ ) ) ≤ 2 e 2 Ψ m F:=2\gamma^k/((j+1)(1-\gamma))\le2e^2\Psi_m F := 2 γ k / (( j + 1 ) ( 1 − γ )) ≤ 2 e 2 Ψ m . If γ < 1 2 \gamma<\frac12 γ < 2 1 , then j = 0 j=0 j = 0 and F ≤ 4 γ m ≤ 4 Ψ m F\le4\gamma^m\le4\Psi_m F ≤ 4 γ m ≤ 4 Ψ m . Let γ ≥ 1 2 \gamma\ge\frac12 γ ≥ 2 1 , J = ⌊ 1 / ( 1 − γ ) ⌋ ≥ 2 J=\lfloor1/(1-\gamma)\rfloor\ge2 J = ⌊ 1/ ( 1 − γ )⌋ ≥ 2 , and x = m ( 1 − γ ) x=m(1-\gamma) x = m ( 1 − γ ) . If m ≤ 3 m\le3 m ≤ 3 , then j = 0 j=0 j = 0 and F / Ψ m = 2 min { m , 1 / ( 1 − γ ) } ≤ 6 F/\Psi_m=2\min\{m,1/(1-\gamma)\}\le6 F / Ψ m = 2 min { m , 1/ ( 1 − γ )} ≤ 6 . If j = J < ⌊ m / 4 ⌋ j=J<\lfloor m/4\rfloor j = J < ⌊ m /4 ⌋ , then J + 1 > 1 / ( 1 − γ ) J+1>1/(1-\gamma) J + 1 > 1/ ( 1 − γ ) gives F < 2 γ − J γ m ≤ 2 e 2 Ψ m F<2\gamma^{-J}\gamma^m\le2e^2\Psi_m F < 2 γ − J γ m ≤ 2 e 2 Ψ m . Otherwise m ≥ 4 m\ge4 m ≥ 4 and j = ⌊ m / 4 ⌋ ≤ J j=\lfloor m/4\rfloor\le J j = ⌊ m /4 ⌋ ≤ J . Then j + 1 ≥ ( m + 1 ) / 4 j+1\ge(m+1)/4 j + 1 ≥ ( m + 1 ) /4 gives F < 8 γ − j γ m / x F<8\gamma^{-j}\gamma^m/x F < 8 γ − j γ m / x , hence F / Ψ m < 8 γ − j min { 1 , 1 / x } F/\Psi_m<8\gamma^{-j}\min\{1,1/x\} F / Ψ m < 8 γ − j min { 1 , 1/ x } . Here γ − j ≤ min { γ − m / 4 , γ − J } ≤ min { e x / 2 , e 2 } \gamma^{-j}\le\min\{\gamma^{-m/4},\gamma^{-J}\}\le\min\{e^{x/2},e^2\} γ − j ≤ min { γ − m /4 , γ − J } ≤ min { e x /2 , e 2 } . The function e x / 2 / x e^{x/2}/x e x /2 / x is convex on [ 1 , 4 ] [1,4] [ 1 , 4 ] , so its maximum there is at an endpoint. The bound is therefore at most 8 e 1 / 2 8e^{1/2} 8 e 1/2 for x ≤ 1 x\le1 x ≤ 1 , at most max { 8 e 1 / 2 , 2 e 2 } = 2 e 2 \max\{8e^{1/2},2e^2\}=2e^2 max { 8 e 1/2 , 2 e 2 } = 2 e 2 for 1 < x ≤ 4 1<x\le4 1 < x ≤ 4 , and at most 8 e 2 / x < 2 e 2 8e^2/x<2e^2 8 e 2 / x < 2 e 2 for x > 4 x>4 x > 4 . Finally, k = m − j ≥ m − ⌊ m / 4 ⌋ = ⌈ 3 m / 4 ⌉ k=m-j\ge m-\lfloor m/4\rfloor=\lceil3m/4\rceil k = m − j ≥ m − ⌊ m /4 ⌋ = ⌈ 3 m /4 ⌉ , and each residual token stores n n n values and one time stamp.
Proof of Proposition D.3
Proof of (a). If N i j = N j i N_{ij}=N_{ji} N ij = N j i , then ∑ i N i j = N j \sum_iN_{ij}=N_j ∑ i N ij = N j , so w = ( N i ) w=(N_i) w = ( N i ) is stationary; moreover w i P ^ i j = N i j w_i\widehat{P}_{ij}=N_{ij} w i P ij = N ij is symmetric, so A ^ \widehat{A} A is w w w -self-adjoint with spectrum in [ − γ , γ ] [-\gamma,\gamma] [ − γ , γ ] . H ^ \widehat{H} H is then symmetric with spectrum in [ − γ , γ ] [-\gamma,\gamma] [ − γ , γ ] . If m ≥ k m\ge k m ≥ k , the Galerkin output is exact. Therefore, for every polynomial q q q of degree less than m m m , Q q ( H ^ ) Q ∗ r ^ = q ( A ^ ) r ^ Qq(\widehat{H})Q^*\widehat{r}=q(\widehat{A})\widehat{r} Qq ( H ) Q ∗ r = q ( A ) r . With p ℓ ( x ) = ∑ j < ℓ x j p_\ell(x)=\sum_{j<\ell}x^j p ℓ ( x ) = ∑ j < ℓ x j ,
v ^ ℓ − v ~ ℓ G = ( p ℓ − q ) ( A ^ ) r ^ − Q ( p ℓ − q ) ( H ^ ) Q ∗ r ^ , ∥ v ^ ℓ − v ~ ℓ G ∥ w ≤ 2 sup ∣ x ∣ ≤ γ ∣ p ℓ ( x ) − q ( x ) ∣ ∥ r ^ ∥ w . \widehat{v}_\ell-\widetilde{v}^{G}_\ell=(p_\ell-q)(\widehat{A})\widehat{r}-Q(p_\ell-q)(\widehat{H})Q^*\widehat{r},\qquad
\|\widehat{v}_\ell-\widetilde{v}^{G}_\ell\|_w\le2\sup_{|x|\le\gamma}|p_\ell(x)-q(x)|\|\widehat{r}\|_w. v ℓ − v ℓ G = ( p ℓ − q ) ( A ) r − Q ( p ℓ − q ) ( H ) Q ∗ r , ∥ v ℓ − v ℓ G ∥ w ≤ 2 ∣ x ∣ ≤ γ sup ∣ p ℓ ( x ) − q ( x ) ∣∥ r ∥ w .
Write x = γ t x=\gamma t x = γ t with t ∈ [ − 1 , 1 ] t\in[-1,1] t ∈ [ − 1 , 1 ] and expand in Chebyshev polynomials T k ( t ) T_k(t) T k ( t ) . The Poisson-kernel identity gives 1 1 − γ cos θ = 1 1 − γ 2 ( 1 + 2 ∑ k ≥ 1 β k cos k θ ) \frac{1}{1-\gamma\cos\theta}=\frac{1}{\sqrt{1-\gamma^2}}\left(1+2\sum_{k\ge1}\beta^k\cos k\theta\right) 1 − γ c o s θ 1 = 1 − γ 2 1 ( 1 + 2 ∑ k ≥ 1 β k cos k θ ) , so f ( x ) = 1 / ( 1 − x ) f(x)=1/(1-x) f ( x ) = 1/ ( 1 − x ) has coefficients c k ( f ) = 2 β k / 1 − γ 2 c_k(f)=2\beta^k/\sqrt{1-\gamma^2} c k ( f ) = 2 β k / 1 − γ 2 for k ≥ 1 k\ge1 k ≥ 1 . Every monomial t j t^j t j has nonnegative Chebyshev coefficients. Hence 0 ≤ c k ( p ℓ ) ≤ c k ( f ) 0\le c_k(p_\ell)\le c_k(f) 0 ≤ c k ( p ℓ ) ≤ c k ( f ) , since c k ( p ℓ ) c_k(p_\ell) c k ( p ℓ ) is nondecreasing in ℓ \ell ℓ and converges to c k ( f ) c_k(f) c k ( f ) by uniform convergence on [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] . Truncating p ℓ p_\ell p ℓ after degree m − 1 m-1 m − 1 gives sup ∣ p ℓ − q ℓ ∣ ≤ ∑ k ≥ m c k ( f ) = 2 β m / ( ( 1 − β ) 1 − γ 2 ) \sup|p_\ell-q_\ell|\le\sum_{k\ge m}c_k(f)=2\beta^m/((1-\beta)\sqrt{1-\gamma^2}) sup ∣ p ℓ − q ℓ ∣ ≤ ∑ k ≥ m c k ( f ) = 2 β m / (( 1 − β ) 1 − γ 2 ) uniformly in ℓ \ell ℓ , which proves the first bound [41 ] . For the second, s = 1 − γ 2 s=\sqrt{1-\gamma^2} s = 1 − γ 2 and 1 − β = ( 1 + s − γ ) / ( 1 + s ) 1-\beta=(1+s-\gamma)/(1+s) 1 − β = ( 1 + s − γ ) / ( 1 + s ) , and ( 1 − β ) s ≥ s 2 / 2 (1-\beta)s\ge s^2/2 ( 1 − β ) s ≥ s 2 /2 is equivalent to ( 1 − γ ) 2 + s ≥ 0 (1-\gamma)^2+s\ge0 ( 1 − γ ) 2 + s ≥ 0 . The anchored bound follows from Theorem D.2 with k ≥ ⌈ 3 m / 4 ⌉ k\ge\lceil3m/4\rceil k ≥ ⌈ 3 m /4 ⌉ .
Proof of (b). Every context in C m \mathcal{C}_m C m has v ~ ℓ ∈ U = col ( D ) \widetilde{v}_{\ell} \in U = \operatorname{col}(D) v ℓ ∈ U = col ( D ) , since the initial output is zero. For any U U U of dimension at most m m m , Eckart–Young gives max ℓ ≤ L dist w ( v ~ ℓ , U ) 2 ≥ 1 L ∑ ℓ ≤ L dist w ( v ~ ℓ , U ) 2 = 1 L ∥ ( I − Π U ) V L ∥ F 2 ≥ σ m + 1 2 / L \max_{\ell\le L} \operatorname{dist}_{w}(\widetilde{v}_{\ell},U)^2 \ge\frac{1}{L}\sum_{\ell\le L}\operatorname{dist}_{w}(\widetilde{v}_{\ell},U)^2 = \frac{1}{L}\lVert(I-\Pi_U)V_L\rVert_F^2 \ge\sigma_{m+1}^2/L max ℓ ≤ L dist w ( v ℓ , U ) 2 ≥ L 1 ∑ ℓ ≤ L dist w ( v ℓ , U ) 2 = L 1 ∥( I − Π U ) V L ∥ F 2 ≥ σ m + 1 2 / L . Projecting onto the top m m m left singular vectors gives residual at most ∥ ( I − Π ) V L ∥ 2 = σ m + 1 \lVert(I-\Pi)V_L\rVert_2 = \sigma_{m+1} ∥( I − Π ) V L ∥ 2 = σ m + 1 in every column. For stability, Weyl’s inequality gives ∣ σ i ( V L ) − σ i ( V L ′ ) ∣ ≤ ∥ V L − V L ′ ∥ F ≤ L sup ℓ ∥ v ~ ℓ − v ~ ℓ ′ ∥ w \lvert\sigma_i(V_L)-\sigma_i(V'_L)\rvert\le\lVert V_L-V'_L\rVert_F \le\sqrt{L}\sup_{\ell}\lVert\widetilde{v}_{\ell}-\widetilde{v}'_{\ell}\rVert_w ∣ σ i ( V L ) − σ i ( V L ′ )∣ ≤ ∥ V L − V L ′ ∥ F ≤ L sup ℓ ∥ v ℓ − v ℓ ′ ∥ w . The recursion e ℓ + 1 = ( r − r ′ ) + A e ℓ + ( A − A ′ ) v ~ ℓ ′ e_{\ell+1}=(r-r')+Ae_{\ell}+(A-A')\widetilde{v}'_{\ell} e ℓ + 1 = ( r − r ′ ) + A e ℓ + ( A − A ′ ) v ℓ ′ with ∥ v ~ ℓ ′ ∥ w ≤ ∥ r ′ ∥ w / ( 1 − γ ) \lVert\widetilde{v}'_{\ell}\rVert_w\le\lVert r'\rVert_w/(1-\gamma) ∥ v ℓ ′ ∥ w ≤ ∥ r ′ ∥ w / ( 1 − γ ) then gives sup ℓ ∥ e ℓ ∥ w ≤ δ r / ( 1 − γ ) + δ A ∥ r ′ ∥ w / ( 1 − γ ) 2 \sup_{\ell}\lVert e_{\ell}\rVert_w\le\delta_r/(1-\gamma)+\delta_A\lVert r'\rVert_w/(1-\gamma)^2 sup ℓ ∥ e ℓ ∥ w ≤ δ r / ( 1 − γ ) + δ A ∥ r ′ ∥ w / ( 1 − γ ) 2 when both models are w w w -contractive.
A Certified Adaptive Rank
Proposition D.11 (Threshold certificate). Add the declared gate thr c ( x ) = 1 { x > c } \operatorname{thr}_c(x)=1\{x>c\} thr c ( x ) = 1 { x > c } . In round j j j of w w w -Arnoldi, multiply b j + 1 b_{j+1} b j + 1 by thr τ 2 ( d j + 1 / d j ) \operatorname{thr}_{\tau^2}(d_{j+1}/d_j) thr τ 2 ( d j + 1 / d j ) , computed as d j + 1 recip 0 ( d j ) d_{j+1}\operatorname{recip}_0(d_j) d j + 1 recip 0 ( d j ) . Let j ⋆ j^\star j ⋆ be the number of retained directions. If the gate fired, i.e., ρ : = ∥ b j ⋆ + 1 ∥ w / ∥ b j ⋆ ∥ w ≤ τ \rho:=\lVert b_{j^\star+1}\rVert_w/\lVert b_{j^\star}\rVert_w\le\tau ρ := ∥ b j ⋆ + 1 ∥ w / ∥ b j ⋆ ∥ w ≤ τ , then under w w w -contraction
sup ℓ ≥ 0 ∥ v ~ ℓ − v ~ ℓ G ∥ w ≤ τ ( 1 − γ ) 2 ∥ r ∥ w . \sup_{\ell\ge0}\lVert\widetilde{v}_{\ell}-\widetilde{v}^{G}_{\ell}\rVert_w\le\frac{\tau}{(1-\gamma)^2}\lVert r\rVert_w. ℓ ≥ 0 sup ∥ v ℓ − v ℓ G ∥ w ≤ ( 1 − γ ) 2 τ ∥ r ∥ w . Otherwise the output is exact through depth L L L . Always j ⋆ ≤ k L j^\star\le k_L j ⋆ ≤ k L , and τ = 0 \tau=0 τ = 0 recovers the exact encoder.
Proof. With q j + 1 = b j + 1 / ∥ b j + 1 ∥ w q_{j+1}=b_{j+1}/\lVert b_{j+1}\rVert_w q j + 1 = b j + 1 / ∥ b j + 1 ∥ w , the Arnoldi relation reads A ^ Q = Q H ^ + ρ q j ⋆ + 1 e j ⋆ T \widehat{A}Q=Q\widehat{H}+\rho q_{j^\star+1}e_{j^\star}^{\mathsf{T}} A Q = Q H + ρ q j ⋆ + 1 e j ⋆ T , where b j ⋆ + 1 b_{j^\star+1} b j ⋆ + 1 is the residual before gating. Let ϵ i = A ^ i r ^ − Q H ^ i Q ∗ r ^ \epsilon_i=\widehat{A}^i\widehat{r}-Q\widehat{H}^iQ^\ast\widehat{r} ϵ i = A i r − Q H i Q ∗ r , so that ϵ 0 = 0 \epsilon_0=0 ϵ 0 = 0 and ϵ i + 1 = A ^ ϵ i + ρ q j ⋆ + 1 e j ⋆ T H ^ i Q ∗ r ^ \epsilon_{i+1}=\widehat{A}\epsilon_i+\rho q_{j^\star+1}e_{j^\star}^{\mathsf{T}}\widehat{H}^iQ^\ast\widehat{r} ϵ i + 1 = A ϵ i + ρ q j ⋆ + 1 e j ⋆ T H i Q ∗ r . Hence ∥ ϵ i + 1 ∥ w ≤ γ ∥ ϵ i ∥ w + ρ γ i ∥ r ^ ∥ w \lVert\epsilon_{i+1}\rVert_w\le\gamma\lVert\epsilon_i\rVert_w+\rho\gamma^i\lVert\widehat{r}\rVert_w ∥ ϵ i + 1 ∥ w ≤ γ ∥ ϵ i ∥ w + ρ γ i ∥ r ∥ w , and induction gives ∥ ϵ i ∥ w ≤ i ρ γ i − 1 ∥ r ^ ∥ w \lVert\epsilon_i\rVert_w\le i\rho\gamma^{i-1}\lVert\widehat{r}\rVert_w ∥ ϵ i ∥ w ≤ i ρ γ i − 1 ∥ r ∥ w . Summing over i ≥ 1 i\ge1 i ≥ 1 gives ρ / ( 1 − γ ) 2 \rho/(1-\gamma)^2 ρ / ( 1 − γ ) 2 .
The certificate controls the error, not the size of j ⋆ j^\star j ⋆ , because Arnoldi residuals can stagnate. Proposition D.3(b) gives the method-independent lower bound against which j ⋆ j^\star j ⋆ can be compared.
Numerically Optimized Time-Invariant Recurrences
For v ~ ℓ = D ∑ j < ℓ K j s 0 \widetilde{v}_{\ell}=D\sum_{j<\ell}K^js_0 v ℓ = D ∑ j < ℓ K j s 0 with context dimension m m m , the increment sequences j ↦ K j s 0 j\mapsto K^js_0 j ↦ K j s 0 span a space of exponential sums whose modes are the eigenvalues of K K K . We parameterize m / 2 m/2 m /2 damped complex modes ρ i e ± i θ i \rho_i e^{\pm i\theta_i} ρ i e ± i θ i . For fixed modes, the minimax problem over D D D is convex, and we solve it with Lawson iterations. The modes are optimized by Nelder–Mead from 12 starts. This is a numerical search, so it certifies achievability of the reported values but not global optimality. On Instance I with γ = 0.9 \gamma=0.9 γ = 0.9 :
Table D.1.
Time-invariant recurrences with instance-optimized modes are therefore within 1.8 × 1.8\times 1.8 × of optimal on this instance, and better than sample-and-hold, whose first sample occurs after depth one. The suboptimality in Proposition D.1 is thus a property of moment matching, not of looping without a clock. What remains open is whether some encoder computable in the forward pass produces time-invariant contexts with error O ( ψ m ) O(\psi_m) O ( ψ m ) on every system. The depth-counter constructions give a positive answer with a simple, fixed encoder.
Execution Depth
The time-invariant executor (5) uses L L L layers and emits every depth along the way. For a single-depth query we ask how few layers suffice, and how few are necessary. A polynomial executor of depth t t t composes t t t maps F ( Z ) = W 0 Z + c 0 + ∑ h P h Z [ R h ⊙ ( Z T Q h Z ) ] F(Z)=W_0Z+c_0+\sum_h P_hZ[R_h\odot(Z^\mathsf{T}Q_hZ)] F ( Z ) = W 0 Z + c 0 + ∑ h P h Z [ R h ⊙ ( Z T Q h Z )] with fixed parameters that may depend on n n n , L L L , m m m but not on γ \gamma γ or the task, followed by a fixed linear readout. The class covers every executor of Appendix A.7 without recursion.
Theorem E.1 (Depth bounds). * (a) Suppose every context entry is a Laurent polynomial in γ \gamma γ with exponents in [ − e , e ] [-e,e] [ − e , e ] , and a depth-t t t polynomial executor outputs v ^ L ( q ) \widehat{v}_L(q) v L ( q ) for all γ \gamma γ in an open interval on a task with e q T P ^ L − 1 r ^ ≠ 0 e_q^{\mathsf T}\widehat{P}^{L-1}\widehat{r}\ne0 e q T P L − 1 r = 0 . Then 3 t e ≥ L − 1 3^t e\ge L-1 3 t e ≥ L − 1 . The unnormalized Krylov context (4) has e = k L e=k_L e = k L , whereas the ℓ 1 \ell_1 ℓ 1 -balanced Krylov context used in Section 5 and the state-level context (9) have e = 1 e=1 e = 1 (Lemma E.3); hence t ≥ log 3 L − 1 k L t\ge\log_3\frac{L-1}{k_L} t ≥ log 3 k L L − 1 in general and t ≥ log 3 ( L − 1 ) t\ge\log_3(L-1) t ≥ log 3 ( L − 1 ) for the balanced and state-level contexts. (b) Retaining the reduced columns of H H H , a fixed executor with two layer types (repeated squaring of H H H and binary accumulation of ∑ j < L H j g \sum_{j<L}H^jg ∑ j < L H j g ) outputs v ^ L ( q ) \widehat{v}_L(q) v L ( q ) exactly in ⌊ log 2 L ⌋ + 2 \lfloor\log_2 L\rfloor+2 ⌊ log 2 L ⌋ + 2 layers. Its retained memory is ( n + h + 2 ) k L + O ( n ) ≤ 2 ( n k L + k L ) + O ( n ) (n+h+2)k_L+O(n)\le2(nk_L+k_L)+O(n) ( n + h + 2 ) k L + O ( n ) ≤ 2 ( n k L + k L ) + O ( n ) .
For single-depth queries on the balanced context, the optimal depth therefore lies between log 3 ( L − 1 ) \log_3(L-1) log 3 ( L − 1 ) and log 2 L + 2 \log_2 L+2 log 2 L + 2 , which agree up to the factor log 2 3 ≈ 1.58 \log_2 3\approx1.58 log 2 3 ≈ 1.58 and an additive constant (a further log 3 k L \log_3 k_L log 3 k L for the unnormalized context); only the base of the logarithm is open. The lower bound is for polynomial executors, which excludes recip 0 \operatorname{recip}_0 recip 0 , so it constrains the doubling and time-invariant executors but not the depth-counter one, whose unrolled recip 0 \operatorname{recip}_0 recip 0 -free variant has depth L L L . Compression reduces memory (Theorem 4.3 ) but not depth, since the uncompressed state-level context can also be squared in O ( log L ) O(\log L) O ( log L ) layers at n 2 n^2 n 2 memory. The looped executor’s linear depth buys all L L L depths in one pass.
Structure of the Context in γ \gamma γ
Lemma E.2 (Laurent structure in γ \gamma γ ). Fix real P , r P,r P , r with k = dim K L ( P , r ) ≥ 1 k=\dim\mathcal{K}_L(P,r)\ge1 k = dim K L ( P , r ) ≥ 1 , and write b ~ j \widetilde{b}_j b j , ω ~ j \widetilde{\omega}_j ω j , H ~ \widetilde{H} H for the unbalanced encoder outputs on ( P , r ) (P,r) ( P , r ) . Then on ( γ P , r ) (\gamma P,r) ( γ P , r ) with γ ≠ 0 \gamma\ne0 γ = 0 , the outputs are b j = γ j − 1 b ~ j b_j=\gamma^{j-1}\widetilde{b}_j b j = γ j − 1 b j , ω j = γ − ( j − 1 ) ω ~ j \omega_j=\gamma^{-(j-1)}\widetilde{\omega}_j ω j = γ − ( j − 1 ) ω j , H i j = γ j − i + 1 H ~ i j H_{ij}=\gamma^{j-i+1}\widetilde{H}_{ij} H ij = γ j − i + 1 H ij , and g = e 1 g=e_1 g = e 1 . Every entry of B B B , Y Y Y , H H H , and g g g is a Laurent polynomial in γ \gamma γ with exponents in [ − k , k ] [-k,k] [ − k , k ] .
Proof. Induct on rounds. If b i = γ i − 1 b ~ i b_i=\gamma^{i-1}\widetilde{b}_i b i = γ i − 1 b i for i ≤ j i\le j i ≤ j , then d i = γ 2 ( i − 1 ) d ~ i d_i=\gamma^{2(i-1)}\widetilde{d}_i d i = γ 2 ( i − 1 ) d i , ω i = γ − ( i − 1 ) ω ~ i \omega_i=\gamma^{-(i-1)}\widetilde{\omega}_i ω i = γ − ( i − 1 ) ω i , and γ P b j = γ j P b ~ j \gamma P b_j=\gamma^jP\widetilde{b}_j γ P b j = γ j P b j . Substituting into (3) gives b j + 1 = γ j b ~ j + 1 b_{j+1}=\gamma^j\widetilde{b}_{j+1} b j + 1 = γ j b j + 1 , and the gates do not depend on γ \gamma γ . Then H i j = ω i T γ P b j = γ j − i + 1 H ~ i j H_{ij}=\omega_i^{\mathsf T}\gamma P b_j=\gamma^{j-i+1}\widetilde{H}_{ij} H ij = ω i T γ P b j = γ j − i + 1 H ij , and g = Ω T b 1 = e 1 g=\Omega^{\mathsf T}b_1=e_1 g = Ω T b 1 = e 1 by duality. H H H is upper Hessenberg, since A ^ b j ∈ span ( b 1 , … , b j + 1 ) \widehat{A}b_j\in\operatorname{span}(b_1,\ldots,b_{j+1}) A b j ∈ span ( b 1 , … , b j + 1 ) , so its nonzero exponents lie in [ 0 , k ] [0,k] [ 0 , k ] . The three terms of y j = b j + ∑ i ω i ( H j i − δ j i ) y_j=b_j+\sum_i\omega_i(H_{ji}-\delta_{ji}) y j = b j + ∑ i ω i ( H j i − δ j i ) have exponents j − 1 j-1 j − 1 , 2 − j 2-j 2 − j (from γ − ( i − 1 ) γ i − j + 1 \gamma^{-(i-1)}\gamma^{i-j+1} γ − ( i − 1 ) γ i − j + 1 ), and 1 − j 1-j 1 − j . All lie in [ − k , k ] [-k,k] [ − k , k ] .
Lemma E.3 (The balanced context is affine in γ \gamma γ ). With positive ℓ 1 \ell_1 ℓ 1 balancing, write b ~ j , ω ~ j , H ~ , g ~ \widetilde{b}_j,\widetilde{\omega}_j,\widetilde{H},\widetilde{g} b j , ω j , H , g for the balanced encoder outputs on ( P , r ) (P,r) ( P , r ) . On ( γ P , r ) (\gamma P,r) ( γ P , r ) with γ > 0 \gamma>0 γ > 0 the outputs are b j = b ~ j b_j=\widetilde{b}_j b j = b j , ω j = ω ~ j \omega_j=\widetilde{\omega}_j ω j = ω j , g = g ~ g=\widetilde{g} g = g , H = γ H ~ H=\gamma\widetilde{H} H = γ H , and Y = B ~ − Ω ~ + γ Ω ~ H ~ T Y=\widetilde{B}-\widetilde{\Omega}+\gamma\widetilde{\Omega}\widetilde{H}^{\mathsf T} Y = B − Ω + γ Ω H T , and the gates do not depend on γ \gamma γ . Every entry of B B B , Y Y Y , H H H , and g g g is therefore a polynomial of degree at most one in γ \gamma γ , i.e., e = 1 e=1 e = 1 in Theorem E.1(a).
Proof. Induct on rounds. The first candidate is r ^ \widehat{r} r , which does not involve γ \gamma γ . If b i = b ~ i b_i=\widetilde{b}_i b i = b i and ω i = ω ~ i \omega_i=\widetilde{\omega}_i ω i = ω i for i ≤ j i\le j i ≤ j , the next candidate before balancing is γ P b j − ∑ i ≤ j b i ω i T γ P b j = γ ( P ~ b ~ j − ∑ i ≤ j b ~ i ω ~ i T P ~ b ~ j ) \gamma Pb_j-\sum_{i\le j}b_i\omega_i^{\mathsf T}\gamma Pb_j=\gamma(\widetilde{P}\widetilde{b}_j-\sum_{i\le j}\widetilde{b}_i\widetilde{\omega}_i^{\mathsf T}\widetilde{P}\widetilde{b}_j) γ P b j − ∑ i ≤ j b i ω i T γ P b j = γ ( P b j − ∑ i ≤ j b i ω i T P b j ) , a positive multiple of the candidate on ( P , r ) (P,r) ( P , r ) . Balancing divides by the ℓ 1 \ell_1 ℓ 1 norm, which removes the factor γ \gamma γ , so b j + 1 = b ~ j + 1 b_{j+1}=\widetilde{b}_{j+1} b j + 1 = b j + 1 ; the squared norm, the dual, and the gate of round j + 1 j+1 j + 1 are functions of b j + 1 b_{j+1} b j + 1 alone. Hence H i j = ω i T γ P b j = γ H ~ i j H_{ij}=\omega_i^{\mathsf T}\gamma Pb_j=\gamma\widetilde{H}_{ij} H ij = ω i T γ P b j = γ H ij , g = Ω T r ^ = g ~ g=\Omega^{\mathsf T}\widehat{r}=\widetilde{g} g = Ω T r = g , and y j = b j + ∑ i ω i ( H j i − δ j i ) y_j=b_j+\sum_i\omega_i(H_{ji}-\delta_{ji}) y j = b j + ∑ i ω i ( H j i − δ j i ) is affine in γ \gamma γ . Numerically, on 30 random covered batches the balanced B B B and Ω \Omega Ω at γ ∈ { 0.5 , 0.8 , 0.95 } \gamma\in\{0.5,0.8,0.95\} γ ∈ { 0.5 , 0.8 , 0.95 } agree to 7.1 × 10 − 15 7.1\times10^{-15} 7.1 × 1 0 − 15 and g g g to 1.8 × 10 − 15 1.8\times10^{-15} 1.8 × 1 0 − 15 , H / γ H/\gamma H / γ agrees to 1.3 × 10 − 15 1.3\times10^{-15} 1.3 × 1 0 − 15 , and Y Y Y is affine to 2.8 × 10 − 14 2.8\times10^{-14} 2.8 × 1 0 − 14 .
Doubling Executor
Each retained Krylov token j j j carries b j b_j b j , a block m j ∈ R h m_j\in\mathbb{R}^h m j ∈ R h initialized to column j j j of H H H , a fixed tag p j = e j p_j=e_j p j = e j , and scalars a j a_j a j (initialized to g j g_j g j ) and c j c_j c j (initialized to 0). Let M M M denote the matrix with columns m j m_j m j . Six token-to-token heads and one readout head are used. The squaring head (key tag, query m m m , value m m m , output m m m , σ = + \sigma=+ σ = + ) adds ∑ i m i ( p i T m t ) = M 2 e t \sum_i m_i(p_i^{\mathsf T}m_t)=M^2e_t ∑ i m i ( p i T m t ) = M 2 e t , and a clearing head (key tag, query tag, value m m m , output m m m , σ = − \sigma=- σ = − ) removes the old column, so together they map M ↦ M 2 M\mapsto M^2 M ↦ M 2 . The advance head (key m m m , query tag, value a a a , output a a a ) adds ( M a ) t (Ma)_t ( M a ) t , so a ↦ a + M a a\mapsto a+Ma a ↦ a + M a . The accumulation heads add ( M c ) t (Mc)_t ( M c ) t to c c c (key m m m , query tag, value c c c ), add a t a_t a t to c c c (key tag, query tag, value a a a , output c c c ), and subtract c t c_t c t (key tag, query tag, value c c c , output c c c , σ = − \sigma=- σ = − ), so together c ↦ a + M c c \mapsto a+Mc c ↦ a + M c . With synchronous reads, a layer of type Λ 0 \Lambda_0 Λ 0 (squaring, clearing, advance) maps ( M , a , c ) (M,a,c) ( M , a , c ) to ( M 2 , a + M a , c ) (M^2,a+Ma,c) ( M 2 , a + M a , c ) , and a layer of type Λ 1 \Lambda_1 Λ 1 (all six heads) maps it to ( M 2 , a + M a , a + M c ) (M^2,a+Ma,a+Mc) ( M 2 , a + M a , a + M c ) . Layer s = 0 , … , ⌊ log 2 L ⌋ s=0,\ldots,\lfloor\log_2 L\rfloor s = 0 , … , ⌊ log 2 L ⌋ uses Λ β s \Lambda_{\beta_s} Λ β s , where L = ∑ s β s 2 s L=\sum_s\beta_s2^s L = ∑ s β s 2 s , and a final readout head (key b b b , query e q e_q e q , value c c c ) outputs e q T B c e_q^\mathsf{T}Bc e q T B c .
Proofs
Lemma E.4 (Degree growth). Each output entry of F ( Z ) = W 0 Z + c 0 + ∑ h P h Z [ R h ⊙ ( Z T Q h Z ) ] F(Z)=W_0Z+c_0+\sum_h P_hZ[R_h\odot(Z^\mathsf{T}Q_hZ)] F ( Z ) = W 0 Z + c 0 + ∑ h P h Z [ R h ⊙ ( Z T Q h Z )] is a polynomial of degree at most 3 in the entries of Z Z Z . A composition of t t t such maps followed by a linear readout therefore has degree at most 3 t 3^t 3 t .
Proof. P h Z P_hZ P h Z is linear, Z T Q h Z Z^\mathsf{T}Q_hZ Z T Q h Z is quadratic, and the masked product is cubic. Degrees multiply under composition.
Proof of Theorem E.1(a). By Lemma E.4, a polynomial of degree at most 3 t 3^t 3 t in Laurent polynomials with exponents in [ − e , e ] [-e,e] [ − e , e ] is a Laurent polynomial O ( γ ) O(\gamma) O ( γ ) with exponents in [ − 3 t e , 3 t e ] [-3^te,3^te] [ − 3 t e , 3 t e ] . The target V ( γ ) = ∑ j < L γ e q T P ^ j r ^ j V(\gamma)=\sum_{j<L}\gamma^{e_q^\mathsf{T}\hat{P}_j\hat{r}_j} V ( γ ) = ∑ j < L γ e q T P ^ j r ^ j is a polynomial whose coefficient of γ L − 1 \gamma^{L-1} γ L − 1 is nonzero. The polynomial γ 3 t e ( O − V ) \gamma^{3^te}(O-V) γ 3 t e ( O − V ) vanishes on an open interval, so it is identically zero. Hence O = V O=V O = V as Laurent polynomials, and L − 1 ≤ 3 t e L-1\leq3^te L − 1 ≤ 3 t e . For the unnormalized Krylov context, Lemma E.2 gives e = k L e=k_L e = k L ; for the balanced context used in the experiments, Lemma E.3 gives e = 1 e=1 e = 1 ; the query token is constant. The state-level context (9) is affine in γ \gamma γ , so e = 1 e=1 e = 1 . Tasks satisfying the hypothesis exist, for example the base point of Lemma C.2 with all cos ( π j / n ) ≠ 0 \cos(\pi j/n)\ne0 cos ( π j / n ) = 0 .
Proof of Theorem E.1(b). Use the heads of Appendix E.2. Since p i T p t = δ i t p_i^\mathsf{T}p_t=\delta_{it} p i T p t = δ i t and M M M is supported on the first k L k_L k L coordinates, the squaring head gives ∑ i m i ( p i T m t ) = M 2 e t \sum_i m_i(p_i^\mathsf{T}m_t)=M^2e_t ∑ i m i ( p i T m t ) = M 2 e t , and the advance head gives ∑ i a i ( m i T p t ) = ( M a ) t \sum_i a_i(m_i^\mathsf{T}p_t)=(Ma)_t ∑ i a i ( m i T p t ) = ( M a ) t . Let p x ( H ) = ∑ j < x H j p_x(H)=\sum_{j<x}H^j p x ( H ) = ∑ j < x H j and x s = ∑ s ′ < s β s ′ 2 s ′ x_s=\sum_{s'<s}\beta_{s'}2^{s'} x s = ∑ s ′ < s β s ′ 2 s ′ . We claim that at the start of step s s s , M = H 2 s M=H^{2^s} M = H 2 s , a = p 2 s ( H ) g a=p_{2^s}(H)g a = p 2 s ( H ) g , and c = p x s ( H ) g c=p_{x_s}(H)g c = p x s ( H ) g . This holds at s = 0 s=0 s = 0 , and it is preserved because p x + y = p y + H y p x p_{x+y}=p_y+H^yp_x p x + y = p y + H y p x gives a + M a = p 2 s + 1 g a+Ma=p_{2^{s+1}}g a + M a = p 2 s + 1 g and a + M c = p x s + 2 s g a+Mc=p_{x_s+2^s}g a + M c = p x s + 2 s g . After step ⌊ log 2 L ⌋ \lfloor\log_2L\rfloor ⌊ log 2 L ⌋ we have c = p L ( H ) g c=p_L(H)g c = p L ( H ) g , and the readout gives e q T B p L ( H ) g = e q T ∑ j < L A j r b j e_q^\mathsf{T}Bp_L(H)g=e_q^\mathsf{T}\sum_{j<L}A^{j}r_b^j e q T B p L ( H ) g = e q T ∑ j < L A j r b j by moment matching. The retained data are B B B (n k L nk_L n k L entries), the columns of H H H (h k L hk_L h k L ), a a a and c c c (2 k L 2k_L 2 k L ), and the query (O ( n ) O(n) O ( n ) ). Since h ≤ n h\leq n h ≤ n , the total is at most 2 ( n k L + k L ) + O ( n ) 2(nk_L+k_L)+O(n) 2 ( n k L + k L ) + O ( n ) . Numerically, the recurrence of Appendix E.2 evaluated as matrix products has relative error at most 7.0 × 10 − 15 7.0\times10^{-15} 7.0 × 1 0 − 15 for L ≤ 200 L\leq200 L ≤ 200 .
Learnability of the Shared Executor
Algorithm 1 in § 4.3 gives the pretraining procedure. This appendix describes its calibration interface, proves the convergence and identifiability results, and relates parameter error to trajectory error.
Calibration interface. The encoder remains fixed. Its first stage produces a state-level context with static blocks I n I_n I n and A ^ T \hat{A}_\mathsf{T} A ^ T . For calibration, the executor initializes its state vector to an input u u u satisfying E [ u u T ] = I n \mathbb{E}[uu^\mathsf{T}]=I_n E [ u u T ] = I n and resets the accumulated query output to zero. Multiplication with Q e f f ( C , W ) Q_{\rm eff}(C,W) Q eff ( C , W ) then produces the output increment − C T u -C^\mathsf{T}u − C T u and the next state F t ( C , W ) u = ( I n + C T + A ^ T W ) u F_t(C,W)u=(I_n+C^\mathsf{T}+\hat{A}_\mathsf{T}W)u F t ( C , W ) u = ( I n + C T + A ^ T W ) u . The two terms of (7) compare these quantities with u u u and A ^ T u \hat{A}_\mathsf{T}u A ^ T u , respectively. Both targets are obtained from the input statistics and u u u ; neither a solved value function nor a target parameter is needed to evaluate the loss.
Proof of Theorem 4.8. Let E C = C + I E_C=C+I E C = C + I and E W = W − I E_W=W-I E W = W − I . Isotropy of u u u gives 2 J = ∥ E C ∥ F 2 + E ∥ E C T + A ^ T E W ∥ F 2 2\mathcal{J}=\lVert E_C\rVert_F^2+\mathbb{E}\lVert E_C^\mathsf{T}+\hat{A}_\mathsf{T}E_W\rVert_F^2 2 J = ∥ E C ∥ F 2 + E ∥ E C T + A ^ T E W ∥ F 2 . For equally shaped arrays a , b a,b a , b , the quadratic form ∥ a ∥ F 2 + ∥ a + b ∥ F 2 \lVert a\rVert_F^2+\lVert a+b\rVert_F^2 ∥ a ∥ F 2 + ∥ a + b ∥ F 2 has coefficient matrix [ 2 1 1 1 ] \begin{bmatrix}2&1\\1&1\end{bmatrix} [ 2 1 1 1 ] , whose eigenvalues are c ± = ( 3 ± 5 ) / 2 c_\pm=(3\pm\sqrt{5})/2 c ± = ( 3 ± 5 ) /2 . Therefore c − ( ∥ E C ∥ F 2 + E ∥ A ^ T E W ∥ F 2 ) ≤ 2 J ≤ c + ( ∥ E C ∥ F 2 + E ∥ A ^ T E W ∥ F 2 ) c_-(\lVert E_C\rVert_F^2+\mathbb{E}\lVert\hat{A}_\mathsf{T}E_W\rVert_F^2)\leq2\mathcal{J}\leq c_+(\lVert E_C\rVert_F^2+\mathbb{E}\lVert\hat{A}_\mathsf{T}E_W\rVert_F^2) c − (∥ E C ∥ F 2 + E ∥ A ^ T E W ∥ F 2 ) ≤ 2 J ≤ c + (∥ E C ∥ F 2 + E ∥ A ^ T E W ∥ F 2 ) . Since E ∥ A ^ T E W ∥ F 2 = tr ( E W T G E W ) \mathbb{E}\lVert\hat{A}_\mathsf{T}E_W\rVert_F^2=\operatorname{tr}(E_W^\mathsf{T}GE_W) E ∥ A ^ T E W ∥ F 2 = tr ( E W T G E W ) with κ I ⪯ G ⪯ β ′ I \kappa I\preceq G\preceq\beta'I κ I ⪯ G ⪯ β ′ I , the Hessian satisfies λ − I ⪯ H ⪯ λ + I \lambda_-I\preceq\mathcal{H}\preceq\lambda_+I λ − I ⪯ H ⪯ λ + I . The unique zero is E C = E W = 0 E_C=E_W=0 E C = E W = 0 , and a GD step is e t + 1 = ( I − η H ) e t e_{t+1}=(I-\eta\mathcal{H})e_t e t + 1 = ( I − η H ) e t , whose eigenvalues lie in [ 0 , 1 − η λ − ] [0,1-\eta\lambda_-] [ 0 , 1 − η λ − ] for η ≤ 1 / λ + \eta\leq1/\lambda_+ η ≤ 1/ λ + .
Necessity of operator diversity. If G G G is singular, take z z z in its nullspace; then A ^ τ z = 0 \widehat{A}_\tau z = 0 A τ z = 0 almost surely. The pair C = − I C=-I C = − I , W = I + z a ⊤ W=I+za^\top W = I + z a ⊤ has zero loss for every a a a , so the probe objective cannot identify unexcited directions. Conversely, if discounted permutations appear with probability p > 0 p>0 p > 0 , then G ⪰ p γ 0 2 I G \succeq p\gamma_0^2 I G ⪰ p γ 0 2 I even when all rewards coincide.
Parameter error and trajectory error. For a fixed exact context with K θ = I + B ⊤ C ⊤ B + Y ⊤ W B K_\theta=I+B^\top C^\top B+Y^\top W B K θ = I + B ⊤ C ⊤ B + Y ⊤ W B and v ℓ θ = − C ⊤ B ∑ j < ℓ K θ j g v^\theta_\ell=-C^\top B\sum_{j<\ell}K_\theta^j g v ℓ θ = − C ⊤ B ∑ j < ℓ K θ j g , let δ C = ∥ C + I ∥ 2 \delta_C=\lVert C+I\rVert_2 δ C = ∥ C + I ∥ 2 , δ W = ∥ W − I ∥ 2 \delta_W=\lVert W-I\rVert_2 δ W = ∥ W − I ∥ 2 , Δ = ∥ B ∥ 2 2 δ C + ∥ Y ∥ 2 ∥ B ∥ 2 δ W \Delta=\lVert B\rVert_2^2\delta_C+\lVert Y\rVert_2\lVert B\rVert_2\delta_W Δ = ∥ B ∥ 2 2 δ C + ∥ Y ∥ 2 ∥ B ∥ 2 δ W , and b = max { ∥ K θ ∥ 2 , ∥ H ∥ 2 } b=\max\{\lVert K_\theta\rVert_2,\lVert H\rVert_2\} b = max {∥ K θ ∥ 2 , ∥ H ∥ 2 } . Then ∥ K θ − H ∥ 2 ≤ Δ \lVert K_\theta-H\rVert_2\leq\Delta ∥ K θ − H ∥ 2 ≤ Δ and ∥ v ℓ θ − v ˉ ℓ ∥ 2 ≤ ∥ B ∥ 2 ∥ g ∥ 2 [ δ C ∑ j < ℓ b j + Δ ∑ 1 ≤ j < ℓ j b j − 1 ] \lVert v^\theta_\ell-\bar v_\ell\rVert_2\leq\lVert B\rVert_2\lVert g\rVert_2[\delta_C\sum_{j<\ell}b^j+\Delta\sum_{1\leq j<\ell}jb^{j-1}] ∥ v ℓ θ − v ˉ ℓ ∥ 2 ≤ ∥ B ∥ 2 ∥ g ∥ 2 [ δ C ∑ j < ℓ b j + Δ ∑ 1 ≤ j < ℓ j b j − 1 ] , by telescoping K θ j − H j = ∑ i K θ j − 1 − i ( K θ − H ) H i K_\theta^j-H^j=\sum_iK_\theta^{j-1-i}(K_\theta-H)H^i K θ j − H j = ∑ i K θ j − 1 − i ( K θ − H ) H i . Hence gradient descent also converges in output on every fixed finite-depth context.
Why an endpoint target differs. Scaling to C = − a I C=-aI C = − a I , W = a I W=aI W = a I (0 < a ≤ 1 0<a\leq1 0 < a ≤ 1 ) gives K a = ( 1 − a ) I + a H K_a=(1-a)I+aH K a = ( 1 − a ) I + a H and increments a B K a j g aBK_a^jg a B K a j g . When H H H is stable, a B ( I − K a ) − 1 g = B ( I − H ) − 1 g aB(I-K_a)^{-1}g=B(I-H)^{-1}g a B ( I − K a ) − 1 g = B ( I − H ) − 1 g for every a a a . Different unit-step rules can therefore share a limit, which is why terminal prediction and identification of the TD step are different objectives.
Proof of Proposition 4.6. Write C = − I + E C C=-I+E_C C = − I + E C and W = I + E W W=I+E_W W = I + E W , so that − C ⊤ = I − E C ⊤ -C^\top=I-E_C^\top − C ⊤ = I − E C ⊤ and F τ = A ^ τ + δ F τ F_\tau=\widehat{A}_\tau+\delta F_\tau F τ = A τ + δ F τ with δ F τ = E C ⊤ + A ^ τ E W \delta F_\tau=E_C^\top+\widehat{A}_\tau E_W δ F τ = E C ⊤ + A τ E W . To first order in ( E C , E W ) (E_C,E_W) ( E C , E W ) ,
δ v τ , 1 θ = − E C ⊤ r ^ τ , δ v τ , 2 θ = − E C ⊤ ( r ^ τ + A ^ τ r ^ τ ) + δ F τ r ^ τ = − E C ⊤ A ^ τ r ^ τ + A ^ τ E W r ^ τ . \delta v^\theta_{\tau,1}=-E_C^\top\widehat r_\tau,\qquad\delta v^\theta_{\tau,2}=-E_C^\top(\widehat r_\tau+\widehat A_\tau\widehat r_\tau)+\delta F_\tau\widehat r_\tau=-E_C^\top\widehat A_\tau\widehat r_\tau+\widehat A_\tau E_W\widehat r_\tau. δ v τ , 1 θ = − E C ⊤ r τ , δ v τ , 2 θ = − E C ⊤ ( r τ + A τ r τ ) + δ F τ r τ = − E C ⊤ A τ r τ + A τ E W r τ .
If the Jacobian applied to ( E C , E W ) (E_C,E_W) ( E C , E W ) vanishes in L 2 ( τ ) L^2(\tau) L 2 ( τ ) , then E τ ∥ E C ⊤ r ^ τ ∥ 2 = tr ( E C ⊤ E [ r ^ τ r ^ τ ⊤ ] E C ) = 0 \mathbb{E}_\tau\lVert E_C^\top\widehat r_\tau\rVert^2=\operatorname{tr}(E_C^\top\mathbb{E}[\widehat r_\tau\widehat r_\tau^\top]E_C)=0 E τ ∥ E C ⊤ r τ ∥ 2 = tr ( E C ⊤ E [ r τ r τ ⊤ ] E C ) = 0 forces E C = 0 E_C=0 E C = 0 , and then E τ ∥ A ^ τ E W r ^ τ ∥ 2 = vec ( E W ) ⊤ E [ ( r ^ τ r ^ τ ⊤ ) ⊗ ( A ^ τ ⊤ A ^ τ ) ] vec ( E W ) = 0 \mathbb{E}_\tau\lVert\widehat A_\tau E_W\widehat r_\tau\rVert^2=\operatorname{vec}(E_W)^\top\mathbb{E}[(\widehat r_\tau\widehat r_\tau^\top)\otimes(\widehat A_\tau^\top\widehat A_\tau)]\operatorname{vec}(E_W)=0 E τ ∥ A τ E W r τ ∥ 2 = vec ( E W ) ⊤ E [( r τ r τ ⊤ ) ⊗ ( A τ ⊤ A τ )] vec ( E W ) = 0 forces E W = 0 E_W=0 E W = 0 . Hence the Jacobian is injective, the Gauss–Newton Hessian of J t r a j J_{\mathrm{traj}} J traj at the target is positive definite, and the target, at which J t r a j = 0 J_{\mathrm{traj}}=0 J traj = 0 , is a strict local minimizer. For the endpoint map, on the curve ( C , W ) = ( − a I , a I ) (C,W)=(-aI,aI) ( C , W ) = ( − a I , a I ) we have − C ⊤ = a I -C^\top=aI − C ⊤ = a I and F τ = ( 1 − a ) I + a A ^ τ F_\tau=(1-a)I+a\widehat A_\tau F τ = ( 1 − a ) I + a A τ , so v τ , ∞ θ = a I ( I − F τ ) − 1 r ^ τ = ( I − A ^ τ ) − 1 r ^ τ v^\theta_{\tau,\infty}=aI(I-F_\tau)^{-1}\widehat r_\tau=(I-\widehat A_\tau)^{-1}\widehat r_\tau v τ , ∞ θ = a I ( I − F τ ) − 1 r τ = ( I − A τ ) − 1 r τ for every a a a ; differentiating at a = 1 a=1 a = 1 shows that the Jacobian of ( C , W ) ↦ v τ , ∞ θ (C,W)\mapsto v^\theta_{\tau,\infty} ( C , W ) ↦ v τ , ∞ θ annihilates ( − I , I ) (-I,I) ( − I , I ) .
The calibration objective (7) is the same two-depth identification with an isotropic input in place of r ^ τ \widehat r_\tau r τ : it removes the reward moments from the conditions and makes the objective exactly quadratic, which is what Theorem 4.8 exploits.
Connections to Classical Statistical and Reduced Models
LSTD and iLSTD. With features x t x_t x t , batch TD depends on the data only through G N = ∑ t x t ( x t − γ x t + 1 ) ⊤ G_N=\sum_t x_t(x_t-\gamma x_{t+1})^\top G N = ∑ t x t ( x t − γ x t + 1 ) ⊤ and b N = ∑ t x t R t + 1 b_N=\sum_t x_tR_{t+1} b N = ∑ t x t R t + 1 . LSTD solves the projected fixed point, and recursive variants update these statistics online [5 , 4 , 11 ] . Our first stage is the tabular, visitation-normalized instance and is not a new principle. Theorem C.1(4) shows that these statistics are optimal up to a factor ( n + 1 ) / n (n+1)/n ( n + 1 ) / n among continuous encoders when k L = n k_L=n k L = n .
BEBFs, Krylov spaces, and model reduction. Reward-initialized Krylov, Bellman-error, and model-error features span the same spaces under the conditions of Parr et al. [33 ] (see also Parr et al., [32 ] ; Petrik [34 ] ). The sequence A ^ j r ^ \widehat A^j\widehat r A j r is the impulse response of a linear system with full-state output. Theorem 4.3 (a) is therefore a finite-horizon minimal-realization statement [15 , 9 , 1 ] . Classical Krylov model reduction matches moments and controls H 2 H_2 H 2 or H ∞ H_\infty H ∞ errors; our error is the supremum over depths of partial sums. Under this error, moment matching is not minimax (Proposition D.1 ).
Lumpability. If P F = P ‾ F PF=\overline{P}F P F = P F and r = F ‾ r r=\overline{F}r r = F r for a partition matrix F F F , then ∑ j < ℓ ( γ P ) j r = F ⊤ ∑ j < ℓ ( γ P ‾ ) j r ‾ \sum_{j<\ell}(\gamma P)^jr=F^\top\sum_{j<\ell}(\gamma\overline P)^j\overline r ∑ j < ℓ ( γ P ) j r = F ⊤ ∑ j < ℓ ( γ P ) j r [20 , 12 ] . A quotient restricts decoding directions to block indicators. Krylov directions are reward specific and exist without a compatible partition; the block-cycle experiments are lumpable, and the sampled experiments are not.
Widths. Lemma D.6 is a Kolmogorov-width computation for orthogonal families [35 ] . The new ingredient is the choice of block increments at the scale 1 / ( m ( 1 − γ ) ) 1/(m(1-\gamma)) 1/ ( m ( 1 − γ )) , which is what removes the γ \gamma γ -dependence of the constant.
Constructions for other in-context RL problems. Table 1 lists only constructions that execute TD policy evaluation in the forward pass, because our retained object, the Krylov context of the TD trajectory, is a compression of that computation. Three further constructions retain other objects and are not comparable in retained memory: Lin et al. [27 ] implement LinUCB and Thompson sampling for bandits and UCB-VI for tabular MDPs from T T T rounds of interaction with ∣ A ∣ |\mathcal{A}| ∣ A ∣ actions, retaining Θ ( T d ∣ A ∣ ) \Theta(Td|\mathcal{A}|) Θ ( T d ∣ A ∣ ) ; Liang & Lai [25 ] implement semi-gradient SARSA and actor–critic on N N N transitions with d d d -dimensional state–action features, retaining Θ ( N d ) \Theta(Nd) Θ ( N d ) ; and Chen et al. [6 ] implement the MASTER strategy for non-stationary bandits over T T T rounds, retaining Θ ( T d log T ) \Theta(Td\log T) Θ ( T d log T ) . Measured with the protocol of Table 1 (T = 2000 T=2000 T = 2000 , d = 24 d=24 d = 24 , ∣ A ∣ = 4 |\mathcal{A}|=4 ∣ A ∣ = 4 , padding to 2048 tokens for the last), their encoded buffers are at least 2000 KiB, 578.41 KiB, and 2824 KiB, respectively; the first excludes unspecified auxiliary padding. Whether the control computations they execute admit a Krylov-type compression is open, since the relevant subspace changes with the policy.
Experimental Details and Additional Results
All experiments start from raw records ( S t , R t + 1 , S t + 1 ) (S_t, R_{t+1}, S_{t+1}) ( S t , R t + 1 , S t + 1 ) . The implementation stores tokens by role, with one array per named field, and evaluates every task-dependent operation as a routed selector head (2) with synchronous reads, plus recip0, release, the ReLU absolute value used by ℓ 1 \ell_1 ℓ 1 balancing, and the clock gate. It does not call QR, SVD, a linear solver, or a rank routine to build any compiled context. Such routines appear only in tests, in the method-free references of Figure 4 , and in the learned time-invariant read-out of Appendix § 17 .9, which rescales its recurrence by a numerically computed spectral norm. Unless stated otherwise, computation uses float64 arithmetic on a CPU. The following subsections specify the task-generation rules, reference calculations, optimization settings, and evaluation metrics. The float32 comparisons are described in Appendix § 17 .§ 5 , and the learned bottleneck models use the precision specified in Appendix § 17 .9.
Figure 4. Sampled noisy tasks. Mean normalized error over five raw trajectories versus the context dimension. The horizontal line is the sampling error of the empirical trajectory v ^ \hat v v ^ relative to the population TD trajectory; the band is the numerical-rank window of Proposition D.3(b).
Identity and Bound Checks
Table 4. Implementation identities and bound checks. “Max” is the maximum over the stated random instances. Ratios below one mean that the bound holds with room to spare.
All entries are float64 comparisons. The first six rows run the attention-level implementation (the Stage-1 heads, the Krylov encoder, the executors, and the sample-and-hold and anchored encoders) on random covered batches against direct numerical references (counting, the TD recurrence, and closed forms). The remaining rows check the stated inequalities numerically: the doubling executor, the terminal-corrected truncation values, and the threshold certificate are evaluated by direct matrix recurrences of the corresponding formulas rather than through selector heads, and the Jacobian row is a finite-difference rank computation on the family of Appendix C, with the perturbed model kept inside the open set of positive kernels. Rank decisions use the finite-precision tolerance of Appendix A.10, so “exact” throughout this appendix means agreement to float64 rounding, not exact arithmetic.
Context–Accuracy Tradeoff (Figure 2)
Panels (a) and (b) use 100 tasks each with n = 24 n = 24 n = 24 , γ = 0.9 \gamma= 0.9 γ = 0.9 , L = 30 L = 30 L = 30 , and N = 960 N = 960 N = 960 covered records, and report the mean and interquartile range of the normalized all-depth error max ℓ ≤ L ∥ v ~ ℓ − e ~ ℓ ∥ w / ∥ r ∥ w \max_{\ell\le L} \lVert\tilde v_\ell-\tilde e_\ell\rVert_w/\lVert r\rVert_w max ℓ ≤ L ∥ v ~ ℓ − e ~ ℓ ∥ w / ∥ r ∥ w with visit weights w w w , for the Krylov projection, Krylov truncation, sample-and-hold, and anchored contexts built from the raw records by the attention-level implementation. Cyclic MRPs : 12 blocks of two states; every record from block b b b moves to a uniformly random state of block b + 1 b+1 b + 1 modulo 12; the reward is a random multiple in { 0.5 , … , 1.5 } \{0.5,\ldots,1.5\} { 0.5 , … , 1.5 } of the indicator of block 0; state labels are permuted (seed 2027). Row sums into the next block are exactly one and rewards are block-constant, so k L = 12 k_L = 12 k L = 12 algebraically, and the balanced encoder returns k L = 12 k_L = 12 k L = 12 on all 100 tasks. Heterogeneous reversible MRPs : symmetric random weights with density 0.4 plus 0.05 on the diagonal, normalized by rows, with deterministic per-state rewards scaled to ∥ r ∥ ∞ = 1 \lVert r\rVert_\infty= 1 ∥ r ∥ ∞ = 1 , observed along one trajectory of 960 steps (seed 2028; one extra visit is appended to any unvisited state). All 100 tasks have k L = 24 k_L = 24 k L = 24 . Panel (c) is the γ = 0.99 \gamma= 0.99 γ = 0.99 panel of Figure 3 , whose instances and certificate are described in the next subsection. The mean Krylov projection error on the cyclic tasks is 0.86 at m = 11 m = 11 m = 11 and 6 × 10 − 16 6 \times10^{-16} 6 × 1 0 − 16 for m ≥ 12 m \ge12 m ≥ 12 ; on the reversible tasks it is 1.1 × 10 − 1 1.1 \times10^{-1} 1.1 × 1 0 − 1 , 2.0 × 10 − 4 2.0 \times10^{-4} 2.0 × 1 0 − 4 , 2.2 × 10 − 7 2.2 \times10^{-7} 2.2 × 1 0 − 7 , and 1.9 × 10 − 14 1.9 \times10^{-14} 1.9 × 1 0 − 14 at m = 4 , 8 , 12 , 20 m = 4, 8, 12, 20 m = 4 , 8 , 12 , 20 , while truncation gives 1.2, 0.73, 0.45, and 0.15 and sample-and-hold 1.1, 1.0, 0.12, and 0.053.
Figure 3. γ \gamma γ -uniform context–accuracy law. Worst normalized all-depth error over structured ring instances, built from raw batches through attention heads, at γ = 0.9 \gamma= 0.9 γ = 0.9 and γ = 0.99 \gamma= 0.99 γ = 0.99 . Triangles give a certified lower bound for any m m m -dimensional context; the vertical line marks m = 1 / ( 1 − γ ) m = 1/(1-\gamma) m = 1/ ( 1 − γ ) . Sample-and-hold and the anchored hold follow Ψ m \Psi_m Ψ m , whereas Krylov truncation plateaus until the effective horizon. The right panel is reproduced in Figure 2(c).
For γ ∈ { 0.9 , 0.99 } \gamma\in\{0.9,0.99\} γ ∈ { 0.9 , 0.99 } , the errors of sample-and-hold and the anchored hold stay within [ 0.45 , 2.7 ] × Ψ m [0.45,2.7] \times\Psi_m [ 0.45 , 2.7 ] × Ψ m and within 21 × 21\times 21 × of the certified bound. Below the horizon at γ = 0.99 \gamma= 0.99 γ = 0.99 (2 ≤ m ≤ 50 2 \le m \le50 2 ≤ m ≤ 50 ), their log–log slopes are − 0.89 -0.89 − 0.89 and − 0.93 -0.93 − 0.93 , against the predicted − 1 -1 − 1 . Krylov truncation has slope − 0.14 -0.14 − 0.14 there and is up to 37 × 37\times 37 × worse, close to the predicted 1 / ( ϵ ( 1 − γ ) ) ≈ 36.8 1/(\epsilon(1-\gamma)) \approx36.8 1/ ( ϵ ( 1 − γ )) ≈ 36.8 . Krylov projection is up to 2.7 × 2.7\times 2.7 × worse, growing with 1 / 1 − γ 1/\sqrt{1-\gamma} 1/ 1 − γ . For each ( γ , m ) (\gamma,m) ( γ , m ) , the instance bank contains the following, all realized as covered raw batches with one transition per state (so P ^ \hat P P ^ is the ring and μ \mu μ is uniform): (i) Instance I with n = ⌈ m + 1 / ( 1 − γ 2 ) ⌉ + 2 + ⌈ 2 / ( 1 − γ ) ⌉ n = \lceil m + 1/(1-\gamma^2)\rceil+ 2 + \lceil2/(1-\gamma)\rceil n = ⌈ m + 1/ ( 1 − γ 2 )⌉ + 2 + ⌈ 2/ ( 1 − γ )⌉ ; (ii) the constant-plus-spike ring of Proposition D.1(a) with n = m + 2 n=m+2 n = m + 2 and ε = 10 − 6 \varepsilon=10^{-6} ε = 1 0 − 6 ; (iii) rewarded-arc rings with B = 2 m B=2m B = 2 m even blocks, n = ( 2 B + 1 ) w + 1 n=(2B+1)w+1 n = ( 2 B + 1 ) w + 1 , and w = round ( 1 / ( c m ( 1 − γ ) ) ) ≥ 2 w=\operatorname{round}(1/(cm(1-\gamma)))\ge2 w = round ( 1/ ( c m ( 1 − γ ))) ≥ 2 for c ∈ { 2 , 4 , 8 } c\in\{2,4,8\} c ∈ { 2 , 4 , 8 } . Errors use depths up to n + 15 / ( 1 − γ ) n+15/(1-\gamma) n + 15/ ( 1 − γ ) . The certified lower bound is the largest, over the bank, of half the exact water-filling width of the orthogonal (block) increments, i.e., the smallest ε \varepsilon ε with ∑ t ( 1 − ε 2 / ∥ x t ∥ 2 ) + ≤ m \sum_t(1-\varepsilon^2/\lVert x_t\rVert^2)_+\le m ∑ t ( 1 − ε 2 / ∥ x t ∥ 2 ) + ≤ m ; this is valid for every method in C m \mathcal{C}_m C m by Lemma D.5. Krylov truncation is evaluated through its exact identity with TD stopped after m m m steps. Galerkin uses the balanced two-pass Arnoldi encoder and the TD executor; sample-and-hold and the anchored hold use their encoders and the depth-counter executor.
Figure 4 uses single trajectories with Gaussian reward noise (σ = 0.5 \sigma=0.5 σ = 0.5 ), γ = 0.99 \gamma=0.99 γ = 0.99 , depths up to 300, and five seeds. On all three tasks the exact rank is generically k L = n k_L=n k L = n , so exact compression gives nothing, but the ε \varepsilon ε -rank is small. On the two spectrally benign tasks the anchored hold stays within twice the projection error at context dimension ⌈ 3 m / 4 ⌉ \lceil3m/4\rceil ⌈ 3 m /4 ⌉ , as Theorem D.2 predicts; on the goal task, where projection stalls, it follows sample-and-hold; neither pure method does both. It falls below the statistical error of v ^ \hat v v ^ (horizontal line) with m = 12 m=12 m = 12 , 30, and 5, against n = 144 n=144 n = 144 , 126, and 200. The shaded band, from Proposition D.3(b), bounds what any m m m -dimensional context can achieve on each task.
Reversible grid walk: a 12 × 12 12\times12 12 × 12 grid with uniform moves, where blocked moves stay in place (symmetric P P P ). The mean reward is the difference of two Gaussian bumps centered at relative positions ( 0.25 , 0.3 ) (0.25,0.3) ( 0.25 , 0.3 ) and ( 0.7 , 0.75 ) (0.7,0.75) ( 0.7 , 0.75 ) , with widths 0.12 a 0.12a 0.12 a and 0.15 a 0.15a 0.15 a and weights 1 and − 0.6 -0.6 − 0.6 . Goal-directed gridworld: a 12 × 12 12\times12 12 × 12 grid with two interior walls, each with one gap (n = 126 n=126 n = 126 free cells). The policy is ε \varepsilon ε -greedy (ε = 0.2 \varepsilon=0.2 ε = 0.2 ) toward the goal along BFS shortest paths; the goal resets to the start cell. The reward is − 0.02 -0.02 − 0.02 per step and + 1 +1 + 1 at the goal. The chain is nonreversible. Dense drifting kernel: n = 200 n=200 n = 200 points on a circle; the transition from x x x follows a Gaussian kernel of width 0.08 centered at x + 0.05 x+0.05 x + 0.05 (dense and nonreversible); the mean reward is sin 2 π x + 0.5 cos 6 π x \sin2\pi x+0.5\cos6\pi x sin 2 π x + 0.5 cos 6 π x . Each run samples a single trajectory of length N N N (10 5 10^5 1 0 5 , 10 5 10^5 1 0 5 , 2 × 10 5 2\times10^5 2 × 1 0 5 ) with i.i.d. Gaussian reward noise of standard deviation 0.5 (seeds 10000–10404); full coverage held in every run. With γ = 0.99 \gamma=0.99 γ = 0.99 and L = 300 L=300 L = 300 , the error is max ℓ ≤ 300 ∥ v ^ ℓ − v ~ ℓ ∥ w / ∥ v ^ ∥ w \max_{\ell\le300}\lVert\hat v_\ell-\tilde v_\ell\rVert_w/\lVert\hat v\rVert_w max ℓ ≤ 300 ∥ v ^ ℓ − v ~ ℓ ∥ w / ∥ v ^ ∥ w with visit weights w w w . The sampling error is the same functional of v ^ ℓ − v ℓ p o p \hat v_\ell-v_\ell^{\mathrm{pop}} v ^ ℓ − v ℓ pop , where v p o p v^{\mathrm{pop}} v pop is the TD trajectory of the population model. The band plots [ σ m + 1 / L , σ m + 1 ] [\sigma_{m+1}/\sqrt{L},\sigma_{m+1}] [ σ m + 1 / L , σ m + 1 ] of the normalized V L V_L V L . In these runs the exact rank is k L = n k_L=n k L = n , while the number of singular values of the normalized V L V_L V L above 10 − 2 10^{-2} 1 0 − 2 is only 9, 25, and 5.
Memory Accounting (Table 5)
Table 5 extends Table 2 with an answer table storing v ^ 1 , … , v ^ L \hat{v}_1,\ldots,\hat{v}_L v ^ 1 , … , v ^ L (n L nL n L values) and with the sampled tasks of Figure 4 . On the dense kernel, contexts accurate to 10 − 2 10^{-2} 1 0 − 2 , well below the statistical error of 0.22, are 9× smaller than sparse TD and 150× smaller than the raw batch; on the sparse goal-directed gridworld, sparse TD remains the most compact representation. Storage counts float32 values and int32 indices of the retained representation only, excluding shared parameters. Raw TD keeps records (12 bytes each), visit counts, the current value vector, and a query: 12 N + 8 n + 4 12N + 8n + 4 12 N + 8 n + 4 bytes. Statistics keep A ^ \hat{A} A ^ , r ^ \hat{r} r ^ , and the value vector: 4 ( n 2 + 2 n ) 4(n^2 + 2n) 4 ( n 2 + 2 n ) bytes. Sparse TD keeps CSR row pointers, column indices and values, reward, value, and an output buffer: 4 ( n + 1 ) + 8 n n z + 12 n 4(n + 1) + 8\,\mathrm{nnz} + 12n 4 ( n + 1 ) + 8 nnz + 12 n bytes. Answers keep v ^ 1 , … , v ^ L \hat{v}_1,\ldots,\hat{v}_L v ^ 1 , … , v ^ L : 4 n L 4nL 4 n L bytes. Krylov keeps 4 ( 2 n + 1 ) ( k + 1 ) 4(2n + 1)(k + 1) 4 ( 2 n + 1 ) ( k + 1 ) bytes, and the anchored hold keeps 4 [ ( 2 n + 1 ) ( k + 1 ) + ( n + 1 ) j ] 4[(2n + 1)(k + 1) + (n + 1)j] 4 [( 2 n + 1 ) ( k + 1 ) + ( n + 1 ) j ] bytes. Dense-block cycles have 12 blocks of size n / 12 n/12 n /12 ; each record’s successor is uniform in the next block; the reward is 1 on block 0; there are N = 40 n N = 40n N = 40 n records, and state labels are permuted (seeds 54000 + n 54000 + n 54000 + n ). Row sums into the next block are exactly one and rewards are block-constant, so k L = 12 k_L = 12 k L = 12 algebraically; the attention encoder retains exactly 12 tokens with error 0 relative to TD. Approximate rows use seed 2000 and search m ∈ { 1 , … , 39 } ∪ { 40 , 45 , … } m \in\{1,\ldots,39\} \cup\{40,45,\ldots\} m ∈ { 1 , … , 39 } ∪ { 40 , 45 , … } for the first budget with error at most 10 − 2 10^{-2} 1 0 − 2 .
Peak memory. The Peak column of Table 2 is the peak task memory of Definition 4.2, the maximum over both encoding stages and execution; Table 6 lists the three terms. The two encoding peaks are measured in the prototype as the live fields of all token groups plus the working storage of the heads of the current layer (every pending output and the largest score block, an upper bound on what is live at any instant). Stage 1 streams the raw records in chunks of C = 2 n C = 2n C = 2 n records, so its live storage is the O ( n 2 ) O(n^2) O ( n 2 ) state tokens, one chunk of C ( 2 n + 2 ) C(2n + 2) C ( 2 n + 2 ) scalars, and the C × n C \times n C × n score block and n × ( n + 2 ) n \times(n + 2) n × ( n + 2 ) outputs of the three heads; Stage 2 holds the state tokens, the h = min { n , L } h = \min\{n,L\} h = min { n , L } candidate tokens, and the scores and outputs of its heads. The execution term is the analytic budget of one query, the retained context plus the k L ( k L + 1 ) k_L(k_L + 1) k L ( k L + 1 ) source–source scores; the prototype executor instead answers all n n n coordinate queries at once and keeps the whole trajectory for the error metric, which is not what Definition 4.2 counts. All three terms are Θ ( n 2 ) \Theta(n^2) Θ ( n 2 ) , the same order as the statistics, and the measured total is 12–16× the statistics because the prototype stores five width-n n n blocks per state token (identity, counts, empirical and discounted rows, and visit weights), fixed-capacity candidate arrays, and the full head outputs; a dense numerical implementation would keep two blocks. The benefit claimed is the retained context, i.e., what must persist to answer all later state and depth queries, not peak memory or speed.
Table 6. Retained and peak live storage (KiB, float32) of the exact dense-block runs, with Stage 1 streamed in chunks of 2 n 2n 2 n records; “chunk” is the part of the Stage-1 peak occupied by one chunk of one-hot records, and both stage peaks include the heads’ working storage. Execution is the analytic budget of one query. Total is the peak task memory of Definition 4.2.
Precision. The identity checks of Appendix § 17 .§ 1 and all curves are computed in float64, whereas the storage in Table 2 counts float32 values. Table 7 reports the same tasks under one data type at a time. Storing the float64 context in float32 and executing in float32 reproduces the TD trajectory to between 2.0 × 10 − 7 2.0 \times10^{-7} 2.0 × 1 0 − 7 and 6.2 × 10 − 7 6.2 \times10^{-7} 6.2 × 1 0 − 7 of its largest entry, i.e., to float32 precision; running the whole pipeline in float32 (statistics heads, Krylov encoder with rank tolerance 10 − 5 10^{-5} 1 0 − 5 , executor, and a reciprocal that keeps the float32 type, so that no float64 intermediate is used) retains k L = 12 k_L = 12 k L = 12 tokens on all four sizes and is accurate to between 2.0 × 10 − 7 2.0 \times10^{-7} 2.0 × 1 0 − 7 and 4.5 × 10 − 7 4.5 \times10^{-7} 4.5 × 1 0 − 7 ; with a different numerical linear-algebra implementation, the float32 results remain within the same order of magnitude. In float64 every storage count doubles, so the savings relative to dense statistics are unchanged, and the reproduction is accurate to between 1.6 × 10 − 16 1.6 \times10^{-16} 1.6 × 1 0 − 16 and 2.9 × 10 − 15 2.9 \times10^{-15} 2.9 × 1 0 − 15 .
Table 7. Memory and TD error under one data type. Retained memory of the Krylov context and total peak in float32 and float64 (KiB), and the maximum absolute error of the executed trajectory relative to max ℓ , s ∣ v ^ ℓ ( s ) ∣ \max_{\ell,s} \lvert\widehat{v}_{\ell}(s)\rvert max ℓ , s ∣ v ℓ ( s )∣ for the float64 pipeline, for the float64 context stored and executed in float32, and for the whole pipeline in float32.
The lower-bound column. The column LB in Table 5 is the bound n k L + k L n k_L + k_L n k L + k L of Theorem 4.3 (c), which holds for every encoder that is continuous on a relatively open set of strictly positive rank-k L k_L k L models (Theorem C.1 ). It is a bound on what such an encoder must retain on some model of that class, not on what the block-cycle tasks themselves require: on these tasks every row of P ^ \widehat{P} P moves to the next block and the reward is block-constant, so v ^ ℓ = ∑ j < ℓ γ j 1 B − j \widehat{v}_{\ell} = \sum_{j<\ell} \gamma^{j}\mathbf{1}_{B_{-j}} v ℓ = ∑ j < ℓ γ j 1 B − j depends on the model only through the block partition, 1 ∈ K L \mathbf{1} \in\mathcal{K}_L 1 ∈ K L , and P ^ \widehat{P} P has zero entries; an encoder built for this family alone would retain the n n n block labels and nothing else (Appendix § 12 , scope of the bound). The comparison in Table 5 is therefore between the retained memory of the task-uniform encoder of Theorem 4.3 (b), which depends on the task only through ( n , k L ) (n, k_L) ( n , k L ) , and the smallest memory that any continuous encoder can achieve uniformly over rank-k L k_L k L dense models. The block-cycle tasks serve to instantiate k L = 12 k_L = 12 k L = 12 exactly; the ratio 2.2 × 2.2\times 2.2 × is a property of the encoder at rank 12, not a certificate of instance-level optimality on these tasks.
Learnability Experiments
Figure 1 in § 5 shows the learned parameter matrices for the three supervision signals. Here we specify the task distribution, training objectives, optimization settings, and results across initializations.
Tasks and initialization. Each of 2,400 training tasks has n = 24 n = 24 n = 24 and eight observations per state (N = 192 N = 192 N = 192 ). The family of each task is drawn uniformly from six (dense Dirichlet, sparse with both cycle neighbours and one further distinct successor, symmetric-weight, six-block, identical-row, and permutation; 410, 394, 405, 410, 384, and 397 tasks), with statewise rewards in { − 1 , − 3 4 , … , 3 4 , 1 } \{-1, -\frac{3}{4}, \ldots, \frac{3}{4}, 1\} { − 1 , − 4 3 , … , 4 3 , 1 } and γ ∈ { 0.5 , 0.7 , 0.8 , 0.9 } \gamma\in\{0.5, 0.7, 0.8, 0.9\} γ ∈ { 0.5 , 0.7 , 0.8 , 0.9 } ; every generated kernel is verified to be row-stochastic, and 120 tasks are held out. The operator Gram matrix E τ [ A ^ τ T A ^ τ ] \mathbb{E}_{\tau}[\widehat{A}_{\tau}^{\mathsf{T}}\widehat{A}_{\tau}] E τ [ A τ T A τ ] of the training bank has eigenvalues in [ 0.199 , 0.545 ] [0.199, 0.545] [ 0.199 , 0.545 ] , so Assumption 4.7 holds with κ = 0.199 \kappa= 0.199 κ = 0.199 . Five paired initializations with entries N ( 0 , 0.1 2 / n ) \mathcal{N}(0, 0.1^{2}/n) N ( 0 , 0. 1 2 / n ) are used for every objective, without checkpoint selection.
Training objectives. The executor is run on the state-level context of Stage 1 with Q e f f ( C , W ) Q_{\mathrm{eff}}(C,W) Q eff ( C , W ) , so that v τ , ℓ θ = − C T ∑ j < ℓ F τ ( C , W ) j r ^ τ v_{\tau,\ell}^{\theta} = -C^{\mathsf{T}}\sum_{j<\ell} F_{\tau}(C,W)^{j}\widehat{r}_{\tau} v τ , ℓ θ = − C T ∑ j < ℓ F τ ( C , W ) j r τ . The three objectives are (7), whose expectation over the isotropic calibration input is taken in closed form, 2 J = ∥ C + I ∥ F 2 + E τ ∥ ( C + I ) T + A ^ τ ( W − I ) ∥ F 2 2\mathcal{J} = \lVert C+I\rVert_{F}^{2}+\mathbb{E}_{\tau}\lVert(C+I)^{\mathsf{T}}+\widehat{A}_{\tau}(W-I)\rVert_{F}^{2} 2 J = ∥ C + I ∥ F 2 + E τ ∥( C + I ) T + A τ ( W − I ) ∥ F 2 as in the proof of Theorem 4.8, so that gradient descent has the exact deterministic iteration of the theorem (the closed form is checked against direct evaluation of (7) on random non-symmetric parameters); J t r a j J_{\mathrm{traj}} J traj , normalized as 1 L ∑ ℓ ≤ L ∥ v τ , ℓ θ − v ^ τ , ℓ ∥ 2 / ∥ r ^ τ ∥ 2 \frac{1}{L}\sum_{\ell\le L}\lVert v^\theta_{\tau,\ell}-\hat{v}_{\tau,\ell}\rVert^2/\lVert\hat{r}_\tau\rVert^2 L 1 ∑ ℓ ≤ L ∥ v τ , ℓ θ − v ^ τ , ℓ ∥ 2 / ∥ r ^ τ ∥ 2 with L = 30 L=30 L = 30 ; and J e n d ( 30 ) : = E τ ∥ v τ , 30 θ − sg ( r ^ τ + A ^ τ v τ , 30 θ ) ∥ 2 / ∥ r ^ τ ∥ 2 J_{\mathrm{end}}^{(30)} := \mathbb{E}_\tau\lVert v^\theta_{\tau,30}-\operatorname{sg}(\hat{r}_\tau+\hat{A}_\tau v^\theta_{\tau,30})\rVert^2/\lVert\hat{r}_\tau\rVert^2 J end ( 30 ) := E τ ∥ v τ , 30 θ − sg ( r ^ τ + A ^ τ v τ , 30 θ ) ∥ 2 / ∥ r ^ τ ∥ 2 , the depth-30 bootstrapped surrogate of J e n d J_{\mathrm{end}} J end with a stopped-gradient target (the infinite-depth J e n d J_{\mathrm{end}} J end of § 4.3 is not computable at finite depth, so the experiment tests the surrogate that a practitioner would minimize).
Optimization and evaluation. Full-batch gradient descent on J / n J/n J / n uses step size 4, below the certified n / λ + ≈ 9.17 n/\lambda_+\approx9.17 n / λ + ≈ 9.17 , for 3,000 steps. Adam (Kingma & Ba, [21 ] ) uses minibatches of 128 tasks, learning rate 10 − 2 10^{-2} 1 0 − 2 with cosine decay to 10 − 4 10^{-4} 1 0 − 4 over 6,000 steps, and gradient clipping at 10, for all three objectives. We report the normalized parameter error ( ∥ C + I ∥ F 2 + ∥ W − I ∥ F 2 ) / ( 2 n ) \sqrt{(\lVert C+I\rVert_F^2+\lVert W-I\rVert_F^2)/(2n)} (∥ C + I ∥ F 2 + ∥ W − I ∥ F 2 ) / ( 2 n ) (equal to 1 at initialization) and the held-out error max ℓ ≤ 30 ∥ v τ , ℓ θ − v ^ τ , ℓ ∥ / ∥ r ^ τ ∥ \max_{\ell\le30}\lVert v^\theta_{\tau,\ell}-\hat{v}_{\tau,\ell}\rVert/\lVert\hat{r}_\tau\rVert max ℓ ≤ 30 ∥ v τ , ℓ θ − v ^ τ , ℓ ∥ / ∥ r ^ τ ∥ averaged over the 120 held-out tasks.
Results. Gradient descent on (7) reaches parameter error 1.0 × 10 − 15 1.0\times10^{-15} 1.0 × 1 0 − 15 on all five seeds (held-out error 6.8 × 10 − 15 6.8\times10^{-15} 6.8 × 1 0 − 15 ), at the geometric rate of Theorem 4.8 ; Adam on the same objective reaches 3.2 × 10 − 16 3.2\times10^{-16} 3.2 × 1 0 − 16 .
Adam on J t r a j J_{\mathrm{traj}} J traj reaches 7.4 × 10 − 2 7.4\times10^{-2} 7.4 × 1 0 − 2 (range 6.5 6.5 6.5 –8.4 × 10 − 2 8.4\times10^{-2} 8.4 × 1 0 − 2 over seeds; held-out error 7.6 × 10 − 2 7.6\times10^{-2} 7.6 × 1 0 − 2 ), with the diagonals of C C C and W W W at − 0.992 -0.992 − 0.992 and 0.992 0.992 0.992 and off-diagonal entries of root-mean-square size 1.4 × 10 − 2 1.4\times10^{-2} 1.4 × 1 0 − 2 ; continuing the same schedule to 20,000 steps on three seeds lowers the parameter error to 3.3 × 10 − 3 3.3\times10^{-3} 3.3 × 1 0 − 3 . The slow tail is a conditioning effect, not a failure of identification: along the scale family ( − a I , a I ) (-aI,aI) ( − a I , a I ) the loss J t r a j J_{\mathrm{traj}} J traj is 0.15 at a = 0.5 a=0.5 a = 0.5 and 5 × 10 − 3 5\times10^{-3} 5 × 1 0 − 3 at a = 0.9 a=0.9 a = 0.9 , a shallow valley, whereas leaving the family changes the fixed point and is penalized by every deep term, so first-order methods progress slowly along the valley; the isotropic objective (7) has no such valley, which is why it carries the global guarantee.
Adam on J e n d ( 30 ) J_{\mathrm{end}}^{(30)} J end ( 30 ) stops at parameter error 0.51 (range 0.50–0.54), with diagonals at − 0.81 -0.81 − 0.81 and 0.82 and off-diagonal entries of size 1.0 × 10 − 1 1.0\times10^{-1} 1.0 × 1 0 − 1 . This is the degeneracy of Proposition 4.6 in action: on held-out tasks the depth-30 output is within 0.038 of TD and its bootstrap residual is 0.011 (TD’s own residual is 0.004), while the trajectory is wrong, with errors 0.50, 0.42, 0.29, 0.17 at depths 1, 2, 5, 10 and a maximum of 0.57 (0.63 averaged over seeds); the endpoint objective fixes the fixed point of the learned update, not the update.
Finite-Precision Rank Boundary
On the two-state swap of Appendix § 10 .10 with rewards ( 1 , 1 + ε ) (1,1+\varepsilon) ( 1 , 1 + ε ) , γ = 0.9 \gamma=0.9 γ = 0.9 , and L = 10 L=10 L = 10 , we compare the literal unbalanced one-pass float64 encoder (L) with the balanced two-pass encoder with tolerance 10 − 12 10^{-12} 1 0 − 12 (B). Unbalanced duals grow like 1 / ε 1/\varepsilon 1/ ε , whereas balancing keeps context entries
Table 8. Rank-boundary sensitivity. Retained rank (L/B), largest context entry, and maximum all-state, all-depth error. At ε = 10 − 16 \varepsilon=10^{-16} ε = 1 0 − 16 the float64 input already equals one.
bounded. The tolerance then suppresses a genuinely nonzero but negligible direction, which is exactly the behavior that the ε \varepsilon ε -rank of Proposition D.3 (b) makes principled.
Feature-Space Policy Evaluation (Table 2)
The bottom rows of Table 2 run the un-normalized TD update (6) of Theorem 4.4 on single sampled trajectories. Boyan’s chain (Boyan, [4 ] ): 13 states, four features, reward − 3 -3 − 3 per step (− 2 -2 − 2 on the last transition), γ = 0.95 \gamma=0.95 γ = 0.95 , one trajectory of N = 20,000 N=20{,}000 N = 20 , 000 steps, L = 100 L=100 L = 100 . Mountain car : the standard dynamics with a fixed energy-pumping policy (a = sign ( x ˙ ) a = \operatorname{sign}(\dot{x}) a = sign ( x ˙ ) , ϵ = 0.1 \epsilon= 0.1 ϵ = 0.1 random actions), reward − 1 -1 − 1 per step, termination at x ≥ 0.5 x \ge0.5 x ≥ 0.5 with zero successor features, γ = 0.99 \gamma= 0.99 γ = 0.99 , L = 200 L = 200 L = 200 ; features are eight 8 × 8 8 \times8 8 × 8 tilings of the position–velocity box with random offsets (d = 512 d = 512 d = 512 , eight active tiles per state), of which 417–452 occur in the trajectories of N ∈ { 5,000 , 20,000 , 80,000 , 320,000 } N \in\{5{,}000, 20{,}000, 80{,}000, 320{,}000\} N ∈ { 5 , 000 , 20 , 000 , 80 , 000 , 320 , 000 } steps. Stage 1 forms A N A_N A N and b N b_N b N on all 512 coordinates by the two heads of Appendix A.6, streamed in chunks of 2 d 2d 2 d records; coordinates that never occur have zero rows and never move, and Stage 2 runs on the active ones. The step size is a public input chosen before encoding from the spectrum of A N A_N A N , α = c / λ max ( sym A N ) \alpha= c/\lambda_{\max}(\operatorname{sym} A_N) α = c / λ m a x ( sym A N ) with the largest c ∈ { 0.9 , 0.45 , … } c \in\{0.9, 0.45, \ldots\} c ∈ { 0.9 , 0.45 , … } for which ∣ 1 − α λ ∣ < 1 \lvert1 - \alpha\lambda\rvert< 1 ∣ 1 − α λ ∣ < 1 for every nonzero eigenvalue λ \lambda λ of A N A_N A N ; this choice is made by the experimenter, not by the selector-head network, which receives α \alpha α as a constant. Eigenvalue zero arises from the tilings, whose indicators sum to one, and is harmless because b N b_N b N has no component along the corresponding left null vectors. Errors are max ℓ ≤ L ∥ Φ ( θ ℓ − θ ^ ℓ ) ∥ w / max ℓ ∥ Φ θ ℓ ∥ w \max_{\ell\le L}\lVert\Phi(\theta_\ell- \widehat{\theta}_\ell)\rVert_w/\max_{\ell}\lVert\Phi\theta_\ell\rVert_w max ℓ ≤ L ∥ Φ ( θ ℓ − θ ℓ ) ∥ w / max ℓ ∥ Φ θ ℓ ∥ w over the visited states with uniform weights, i.e., relative to the scale of the trajectory. On Boyan’s chain the exact context has k L Φ = 4 = d k_L^\Phi= 4 = d k L Φ = 4 = d and reproduces the trajectory to 9.4 × 10 − 16 9.4 \times10^{-16} 9.4 × 1 0 − 16 ; Krylov projection with m = 1 , 2 , 3 m = 1, 2, 3 m = 1 , 2 , 3 has error 0.95, 0.34, 0.14. On mountain car the exact encoder retains h = min { d , L } = 200 h = \min\{d, L\} = 200 h = min { d , L } = 200 tokens at tolerance 10 − 12 10^{-12} 1 0 − 12 , but the trajectory matrix has at most 10 singular values above 10 − 2 L 10^{-2}\sqrt{L} 1 0 − 2 L , and Krylov projection reaches relative error 9.1 × 10 − 3 9.1 \times10^{-3} 9.1 × 1 0 − 3 –1.06 × 10 − 2 1.06 \times10^{-2} 1.06 × 1 0 − 2 at m = 32 m = 32 m = 32 (the largest value at N = 5,000 N = 5{,}000 N = 5 , 000 ), at most 3.0 × 10 − 7 3.0 \times10^{-7} 3.0 × 1 0 − 7 at m = 48 m = 48 m = 48 , and at most 6 × 10 − 15 6 \times10^{-15} 6 × 1 0 − 15 at m = 64 m = 64 m = 64 over the four values of N N N . Sample-and-hold uses the finite-depth schedule of Proposition D.9(b) with the measured contraction factor ρ = max λ ∣ 1 − α λ ∣ ∈ [ 0.99998 , 0.99999 ] \rho= \max_\lambda\lvert1-\alpha\lambda\rvert\in[0.99998, 0.99999] ρ = max λ ∣ 1 − α λ ∣ ∈ [ 0.99998 , 0.99999 ] of I − α A N I-\alpha A_N I − α A N ; since ⌊ 1 / ( 1 − ρ ) ⌋ > L \lfloor1/(1-\rho)\rfloor> L ⌊ 1/ ( 1 − ρ )⌋ > L , all m m m tokens are hold tokens at the quantiles of the mass through depth L L L , which here are nearly uniformly spaced, and the encoder keeps exactly the requested number of tokens up to m = 192 m = 192 m = 192 and 200 tokens for m ≥ 200 m \ge200 m ≥ 200 . Its relative error is 0.31–0.33 at m = 32 m = 32 m = 32 , 0.19–0.21 at m = 64 m = 64 m = 64 , 0.07–0.08 at m = 128 m = 128 m = 128 and m = 192 m = 192 m = 192 , and below 10 − 15 10^{-15} 1 0 − 15 once every depth is sampled (requested m ≥ 200 m \ge200 m ≥ 200 , 200 tokens): the increments do not decay within L = 200 L = 200 L = 200 , so holding misses one full increment wherever two consecutive depths are not both sampled, the short-horizon regime of Proposition D.9(d). The retained memory of the dimension-32 context is 108–117 KiB against 681–800 KiB for the LSTD statistics A N , b N A_N, b_N A N , b N , and it does not depend on N N N , whereas the raw prompt grows from 332 KiB to 21 MiB. The peak column of Table 2 is measured as in Appendix H.5, including the heads’ working storage: on mountain car it is the Stage-1 peak on all 512 coordinates (9,226 KiB, of which one chunk of 2 d 2d 2 d raw records is 4,100 KiB), and on Boyan’s chain the Stage-2 peak (1.1 KiB).
Learned Bottleneck Contexts (Figure 5)
Model. The input is the output of the fixed first stage of Section 4.1, the iterates v ^ 1 , … , v ^ L \widehat{v}_1, \ldots, \widehat{v}_L v 1 , … , v L . During training, they are computed by direct counting of the empirical statistics followed by the TD recurrence, which agrees with the selector-head implementation to 6.3 × 10 − 15 6.3 \times10^{-15} 6.3 × 1 0 − 15 on the training tasks; the heads themselves are not executed during training. The encoder reads the L L L tokens ( v ~ ℓ , ℓ / L ) ∈ R n + 1 (\tilde{v}_{\ell},\ell/L) \in\mathbb{R}^{n+1} ( v ~ ℓ , ℓ / L ) ∈ R n + 1 . They are embedded to width d = 64 d = 64 d = 64 and processed by two standard pre-LayerNorm Transformer encoder layers (four softmax heads, GELU MLP of width 128, full attention over the L L L tokens). m m m learned latent vectors then cross-attend to the encoded records in two rounds, each followed by self-attention among the latents and an MLP, as in Perceiver-style bottlenecks [16 ] ; a final LayerNorm gives z u ∈ R d z_u \in\mathbb{R}^{d} z u ∈ R d for u ∈ [ m ] u \in[m] u ∈ [ m ] . The latents are turned into a context for the executors of Definition A.1. A linear map sends z u z_u z u to the decoder column d u ∈ R n d_u \in\mathbb{R}^{n} d u ∈ R n , giving D ∈ R n × m D \in\mathbb{R}^{n \times m} D ∈ R n × m . In the clocked model the source scalars are depth indexed, s ℓ , u = MLP ( z u , e ( ℓ ) ) s_{\ell,u} = \operatorname{MLP}(z_u,e(\ell)) s ℓ , u = MLP ( z u , e ( ℓ )) with a sinusoidal depth code e ( ℓ ) e(\ell) e ( ℓ ) , which generalizes the gates 1 { ℓ + 1 = τ u } \mathbf{1}\{\ell+ 1 = \tau_u\} 1 { ℓ + 1 = τ u } of the depth-counter executor. In the time-invariant model a linear readout gives s 0 ∈ R m s_0 \in\mathbb{R}^{m} s 0 ∈ R m , a bi-linear form of the latents gives K ∈ R m × m K \in\mathbb{R}^{m \times m} K ∈ R m × m , rescaled so that ∥ K ∥ 2 ≤ γ \lVert K\rVert_2 \leq\gamma ∥ K ∥ 2 ≤ γ (a numerically computed spectral norm, used only in this learned read-out), and s ℓ + 1 = K s ℓ s_{\ell+1} = Ks_\ell s ℓ + 1 = K s ℓ , which is the recurrence of the time-invariant executor with ( D , K , s 0 ) (D,K,s_0) ( D , K , s 0 ) produced by the encoder. In both cases the output is v ~ ℓ = D ∑ j < ℓ s j \tilde{v}_{\ell} = D\sum_{j<\ell}s_j v ~ ℓ = D ∑ j < ℓ s j , so the model lies in C m \mathcal{C}_m C m and the lower bounds of § 4.2 apply. Nothing is hand-set; each model has about 1.9 × 10 5 1.9 \times10^{5} 1.9 × 1 0 5 parameters. Two other interfaces were tried with the same encoder and read-out and are reported below: raw transition tokens ( e S t , e S t + 1 , R t + 1 ) (e_{S_t},e_{S_{t+1}},R_{t+1}) ( e S t , e S t + 1 , R t + 1 ) , and the n n n state-statistics tokens ( e i , A ^ i , : , r ^ i ) (e_i,\hat{A}_{i,:},\hat{r}_i) ( e i , A ^ i , : , r ^ i ) . A pilot with a looped standard Transformer block as the coefficient generator, trained through L = 40 L = 40 L = 40 loops from raw records, did not leave the plateau either (error 1.9 for every m m m , against 2.6 for the zero predictor and 2.1 for the best rank-one context along r ^ \hat{r} r ^ ), which is why the executor classes are used as the read-out.
Tasks and training. n = 24 n = 24 n = 24 , γ = 0.9 \gamma= 0.9 γ = 0.9 , L = 40 L = 40 L = 40 , N = 192 N = 192 N = 192 records per task with every state visited at least once; the empirical model is obtained by direct counting, and its trajectory is computed by the TD recurrence; Appendix § 17 .§ 1 verifies these calculations against the selector-head implementation. Tasks are drawn uniformly from six families: dense Dirichlet rows, sparse rows with two to four successors, symmetric-weight (reversible) chains, four-block cycles, single n n n -cycles, and random permutations; rewards are Gaussian on all states or on one to three states, scaled to ∥ r ^ ∥ ∞ = 1 2 \lVert\hat{r}\rVert_{\infty} = \frac{1}{2} ∥ r ^ ∥ ∞ = 2 1 . The target is the empirical trajectory v ~ 1 , … , v ~ L \tilde{v}_1,\ldots,\tilde{v}_L v ~ 1 , … , v ~ L of the batch, and the loss is 1 L ∑ ℓ ∥ v ~ ℓ − v ~ ℓ ∥ 2 2 \frac{1}{L}\sum_{\ell}\lVert\tilde{v}_{\ell}-\tilde{v}_{\ell}\rVert_{2}^{2} L 1 ∑ ℓ ∥ v ~ ℓ − v ~ ℓ ∥ 2 2 with visit weights w w w . One model is trained per ( m , executor type , seed ) (m,\text{executor type},\text{seed}) ( m , executor type , seed ) with AdamW (learning rate 10 − 3 10^{-3} 1 0 − 3 , cosine decay to 10 − 5 10^{-5} 1 0 − 5 after 200 warmup steps, weight decay 0.01, gradient clipping at 1) for 8,000 steps of 32 fresh tasks each, on a CPU in float32 with two threads per run, with three seeds ( 0 , 1 , 2 ) (0,1,2) ( 0 , 1 , 2 ) for every point of the grid m ∈ { 1 , 2 , 4 , 8 , 16 , 24 } m \in\{1,2,4,8,16,24\} m ∈ { 1 , 2 , 4 , 8 , 16 , 24 } (clocked) and m ∈ { 2 , 4 , 8 , 16 , 24 } m \in\{2,4,8,16,24\} m ∈ { 2 , 4 , 8 , 16 , 24 } (time-invariant); an earlier single-seed sweep used 4,000 steps. No checkpoint or seed selection is used. Evaluation uses the metric of § 5 , max ℓ ≤ L ∥ v ~ ℓ − v ~ ℓ ∥ w / ∥ r ~ ∥ w \max_{\ell\leq L}\lVert\tilde{v}_{\ell}-\tilde{v}_{\ell}\rVert_{w}/\lVert\tilde{r}\rVert_{w} max ℓ ≤ L ∥ v ~ ℓ − v ~ ℓ ∥ w / ∥ r ~ ∥ w , on 256 held-out tasks from the same distribution (seed 777) and on three deterministic ring instances of size n = 24 n = 24 n = 24 realized as covered batches: the single-reward ring and rewarded arcs of width 2 and 3 (Appendix § 13 ). The certified lower bound in Figure 5 (b) is the water-filling width of the orthogonal block increments of these instances (Lemmas D.5 and D.6 ), valid for every context in C m \mathcal{C}_m C m . The compiled contexts are evaluated on exactly the same batches through the attention implementation.
Figure 5. Learned bottleneck encoders against compiled contexts. (a) Mean normalized error on 256 held-out tasks and (b) worst error over three ring instances, for standard Transformer encoders with a clocked or time-invariant executor (three seeds per point, 8,000 updates each; error bars are one standard deviation across seeds), the compiled contexts on the same batches, Ψ m \Psi_m Ψ m , and the certified lower bound for every m m m -dimensional context. The vertical line marks m = 1 / ( 1 − γ ) m = 1/(1-\gamma) m = 1/ ( 1 − γ ) .
Results. Table 9 lists the numbers behind Figure 5 as means and standard deviations over the three seeds. Four facts stand out. First, below the effective horizon the learned encoders are better than the compiled contexts on typical tasks: for m ≤ 8 m \leq8 m ≤ 8 their held-out error (0.50–0.89) is below sample-and-hold (1.00–1.72), and for m ≤ 4 m \leq4 m ≤ 4 below the anchored hold (0.93–2.17); on the rings they are below sample-and-hold for m ≤ 4 m \leq4 m ≤ 4 and far below the worst-case guarantee e 2 Ψ m e^2\Psi_m e 2 Ψ m . The compiled contexts are tuned to the worst case and spend their first tokens on the certificate increments, which a learned encoder need not do. Second, the learned error does not decrease with m m m : on held-out tasks it stays at 0.61–0.63 for every m ≥ 4 m \geq4 m ≥ 4 with the clocked executor and at 0.50–0.54 for every m ≥ 8 m \geq8 m ≥ 8 with the time-invariant one, and on the rings at 1.14–1.19 and 0.95–1.05, with log–log slopes over 2 ≤ m ≤ 8 2 \leq m \leq8 2 ≤ m ≤ 8 of −0.07 and −0.09 on held-out tasks and −0.09 and −0.19 on the rings, against −0.59 for sample-and-hold and −1.46 for Ψ m \Psi_m Ψ m . From m = 8 m = 8 m = 8 on the ring error exceeds Ψ m \Psi_m Ψ m , and at m = 24 m = 24 m = 24 it exceeds the upper bound e 2 Ψ m e^2\Psi_m e 2 Ψ m by 2.0× (clocked) and 1.8× (time-invariant): a learned encoder with the full budget is worse than the sample-and-hold guarantee, while the compiled contexts reach 0.19 (SH) and 0.15 (anchored) and the held-out error of the anchored hold is 0.026. Third, the seed spread is small compared with these gaps: the standard deviations are 0.003–0.06 on held-out tasks (0.11 at m = 2 m = 2 m = 2 for the time-invariant model) and 0.01–0.11 on the rings, so the flatness in m m m is not a seed effect. Fourth, every learned error lies above the certified lower bound, by 3.1 × 3.1\times 3.1 × at m = 1 m = 1 m = 1 and 16 16 16 –19 × 19\times 19 × at m = 16 m = 16 m = 16 , as Lemma D.5 requires of any context in C m \mathcal{C}_m C m . Per family, the learned encoders reach 0.35–0.55 on the dense, reversible, and block tasks, 0.53–0.64 on the sparse ones, and 0.81–0.94 on the deterministic cycles and permutations, at every m m m ; the compiled contexts are worse than this on the deterministic families at m ≤ 4 m \le4 m ≤ 4 , whereas by m = 24 m = 24 m = 24 the anchored hold is exact on the dense, reversible, block, and sparse families and reaches 0.03–0.11 on the deterministic ones. The time-invariant executor is better than the clocked one on held-out tasks for m ≥ 4 m \ge4 m ≥ 4 (0.50–0.56 against 0.61–0.63) and on the rings; with ( K , s 0 ) (K, s_0) ( K , s 0 ) read off the latents it is a learned counterpart of the Krylov context, and its error is also flat in m m m . Doubling the training budget from the earlier 4,000-step single-seed sweep (held-out errors 0.74–0.77 for the clocked and 0.67–0.71 for the time-invariant models at m ≥ 4 m \ge4 m ≥ 4 ) lowered every curve by 0.1–0.2 but did not change its shape, and at the end of training the held-out error was still decreasing by at most 0.02 per 1,000 steps, so a larger budget would lower the curves further but, on this evidence, not make them decrease with m m m . The two other interfaces of the 4,000-step pilots give 1.91 (raw records) and 1.82 (statistics tokens) at m = 8 m = 8 m = 8 with the clocked executor, against 0.75 from the iterates; both are close to the zero predictor (2.58) and to the best rank-one context along r b r_b r b (2.09), so they did not leave a rank-one plateau. We state the finding plainly: a standard Transformer with a bottleneck learns to place a few tokens better than the worst-case-optimal schedules do on typical tasks, but it does not discover the Krylov or clock structure that turns additional tokens into accuracy; supplying that structure is what the compiled encoders of § 4.1 and § 4.2 contribute.
Table 9. Learned bottleneck encoders (trajectory-token interface; mean ± one standard deviation over three seeds, 8,000 updates each) against the compiled sample-and-hold (SH) and anchored contexts on the same batches, the upper bound e 2 Ψ m e^{2}\Psi_m e 2 Ψ m of Theorem 4.5 , and the certified lower bound (LB) of the ring instances. Dashes: budget not trained, or no certificate.
Scope and Limitations
We collect the qualifications here rather than repeating them in each proof. Computational model. Exact statements use real arithmetic and declared primitives: recip 0 \operatorname{recip}_0 recip 0 , token release, and, for certified adaptive rank, a threshold gate. Exact rank selection over arbitrary reals requires a discontinuous primitive (Appendix § 10 .10). Clocked contexts treat γ \gamma γ as public, although in-network schedules are possible. Appendix § 11 realizes both executors with standard two-head masked softmax attention; that realization is a compilation whose encoder writes log-probability codes into the tokens, and it says nothing about what trained softmax models do. The bottleneck encoders of Appendix § 17 .9 are the only trained encoders in this paper; they read the iterates of the fixed first stages and are trained on our task distribution, not on natural pretraining data. What is optimal. Theorem C.1 counts reals for encoders that are continuous in the model on dense model neighborhoods; sparse models can be stored more compactly. Theorem 4.5 is a worst-case statement with absolute but unoptimized constants (measured gaps are within 20 × 20\times 20 × ). Proposition D.3 supplies instance-dependent guarantees. Proposition D.1 concerns moment-matching encoders, not all time-invariant recurrences. The depth bounds of Theorem E.1 are tight up to the base of the logarithm (log 2 3 \log_2 3 log 2 3 ) and additive constants; the lower bound is for polynomial executors, which excludes recip 0 \operatorname{recip}_0 recip 0 , so it constrains the doubling and time-invariant executors but not the depth-counter one, whose unrolled recip 0 \operatorname{recip}_0 recip 0 -free variant has depth L L L . Resources not reduced. Peak memory and arithmetic are not reduced below those of the statistics or direct TD; the benefit is the retained, reusable context. For sparse models, sparse numerical TD can be smaller. Learning. Only the shared executor is shown to be learnable; joint training of encoders is open. Setting. The results cover fixed-policy evaluation of empirical, visitationnormalized TD. In control, the Krylov space changes with the policy, and extending the laws there is open.