Introduction
Hybrid architectures have become the design of choice for frontier models [20 , 25 , 12 ] . This is due to their superior scalability: the quadratic complexity of full self-attention limits the vanilla Transformer architecture on long-context tasks [11 , 24 ] . Hybrid models replace many self-attention layers with efficient subquadratic alternatives that require smaller memory and offer faster inference. Popular choices include state-space layers like linear attention, Mamba, Gated DeltaNet, etc. [8 , 32 ] . The use of these layers produces scalable and highly-performant models.
However, as each layer can be selected from among many variations, layer selection and ordering is a critical design challenge [32 , 8 , 10 ] . Indeed, each layer type brings different constraints when processing sequences: full-attention is memory-bound by retrieval distance while recurrent alternatives are bound by their state size. The most popular layer ordering among frontier models uses a block design that involves one softmax-attention layer followed by many subquadratic layers. This is supported empirically [29 ] . While some work has investigated the selection ratio between softmax-attention and linear attention [30 , 7 ] and others have shown a theoretical separation with hybrids utilizing less memory [6 ] , the benefits and drawbacks of various layer orderings are still unclear. Given the combinatorially large space of different layer orderings, a complete empirical sweep across architectures is intractable.
Figure 1. Structure of tasks that exhibit performance differences among different hybrid architectures. Large gaps need SSM layers to communicate each segment’s query, while the dense computation per segment is done by the Transformers.
A theoretical characterization of hybrid architectures would cut down on this combinatorial space. However, identifying differences between hybrid layer orderings is highly challenging. Tasks can be solved by a variety of algorithms, each best suited for a different hybrid architecture. For instance, the greatest difficulty stems from processing order: some architectures focus on reordering the sequence in early layers to allow for a few later layers to solve the task. These shortcuts can reduce model size and depth compared to more direct algorithms with sequential processing.
In this work, we obtain a new theory-driven approach to hybrid architecture design . Inspired by [6 ] , we study the expressivity of different hybrid architectures under computational resource constraints. We identify tasks and associated architecture designs where no other design (i.e., layer ordering) is able to solve the task under identical constraints. We begin by abstracting full-attention (TF) and sub-quadratic attention variants as generalized windowed functions and generalized state-space models (SSMs), respectively. This allows us to focus on the critical elements constraining layer types: the window width, state size, and embedding precision. For a given layer ordering of generalized SSMs and generalized causal windowed models, we show there exists a task and hybrid architecture such that any architecture deviating from the provided one must use more resources at some layer . This indicates that large-scale hybrid architecture design is situation-specific; in other words, structural properties of a desired task determines the optimal hybrid architecture.
In addition, we zoom in on 2- and 3-layer hybrid architectures to characterize and expand the set of such separating tasks . These tasks are natural, mirroring behaviors found in real-world natural language scenarios. Specifically, we establish tasks where the TF → \to → SSM (TS) and TF → \to → SSM → \to → TF (TST) architectures are resource optimal. The task for TST supplies a natural task that requires layer alternation in a hybrid design. For these tasks, we show a separation in learnability between different layer orderings. By modifying the context window for the Transformers and varying the state in Mamba, we constrain the memory of these hybrid under some fixed budget. We empirically show that the learned hybrids exhibit identical separations as predicted theoretically. For segmented retrieval (designed for the TS architectures) and the TST task, we observe a phenomenon crucial for large-scale design: on hybrids of depth 4 and depth 5, containing TS or TST as a sub-architecture determines performance. This suggests that such “containment” is important in deep hybrids.
We empirically study such deeper hybrids as well. We find that a T* S* architecture achieves higher performance than all S* T* architectures for this task. Mechanistically, through linear probing, we observe that the top-performing model, TTSSSSSS, shows a slow increase in decodability in its SSM layers which are not seen in TTTSSSSS. This supports that hybrid design is nuanced, as slightly different architectures fail to use their SSM layers to improve performance.
The paper is structured as follows. In Section 2, we begin with proving that there are tasks and resource constraints for any hybrid architecture that any other architecture must violate. For shallow hybrids, we establish a natural task family capturing important operations in natural language. In Section 3, we experiment on these natural tasks, identifying that these separations appear for learned hybrids. Lastly, in Section 4, we experiment on 8-layer hybrids on associative recall, observing that mildly different architectures have drastically different performances.
Theoretical Foundations for Hybrid Layer Ordering
In this section, we introduce our main theorem on model superiority, where we show that for each architecture, there is a task on which it is dominant. We begin with a summary of notation in Appendix A before discussing the main theorem separating architectures of differing layer orderings.
Preliminaries and Notation. We consider sequence-to-sequence token prediction problems. Let V \mathcal{V} V be some vocabulary of tokens, V = ∣ V ∣ V = |\mathcal{V}| V = ∣ V ∣ , and x ⃗ = ( x i ) i = 1 L \vec{x} = (x_i)_{i=1}^{L} x = ( x i ) i = 1 L be an input sequence. A language model M M M is a sequence-to-sequence map M : V L → V m M : \mathcal{V}^{L} \to\mathcal{V}^{m} M : V L → V m of the form M ( x ⃗ ) = F N ∘ F N − 1 ∘ ⋯ ∘ F 1 ( x ⃗ ) M(\vec{x}) = F_N \circ F_{N-1} \circ\cdots\circ F_1(\vec{x}) M ( x ) = F N ∘ F N − 1 ∘ ⋯ ∘ F 1 ( x ) , where ∘ \circ ∘ is function composition and each F i F_i F i is a sequence-to-sequence map called a layer. Through the paper, we will consider the input and output of F i F_i F i at each position to be in { 0 , 1 } P \{0,1\}^{P} { 0 , 1 } P , for some P ∈ N + P \in\mathbb{N}_{+} P ∈ N + , where we call P P P the precision of the model. We will consider two types of layers as abstractions of state space models (SSM) and causal windowed attention (TF). The embedded input sequence x ⃗ = ( x 1 , … , x L ) \vec{x} = (x_1, \ldots, x_L) x = ( x 1 , … , x L ) uses P P P precision, i.e x ⃗ \vec{x} x is such that x i ∈ { 0 , 1 } P x_i \in\{0,1\}^{P} x i ∈ { 0 , 1 } P .
Transformer Layer. We say a layer F : ( { 0 , 1 } P ) L → ( { 0 , 1 } P ) L F : (\{0,1\}^{P})^{L} \to(\{0,1\}^{P})^{L} F : ({ 0 , 1 } P ) L → ({ 0 , 1 } P ) L is a T-layer (TF) with window size W W W if there exists a map f f f such that for i ∈ [ L ] i \in[L] i ∈ [ L ] , F ( x ⃗ ) i = f ( x i − W + 1 , … , x i ) ∈ { 0 , 1 } P F(\vec{x})_i = f(x_{i-W+1}, \ldots, x_i) \in\{0,1\}^{P} F ( x ) i = f ( x i − W + 1 , … , x i ) ∈ { 0 , 1 } P . In other words, a T-layer can be an arbitrary P P P -precision causal nonlinear function, whose output depends on the past W W W positions of the input. Standard transformer implementations with the windowed attention mechanism falls into this category (See Appendix A for formal definitions).
State-Space Model Layer. We say a layer F : ( { 0 , 1 } P ) L → ( { 0 , 1 } P ) L F : (\{0,1\}^{P})^{L} \to(\{0,1\}^{P})^{L} F : ({ 0 , 1 } P ) L → ({ 0 , 1 } P ) L is an S-layer (SSM) with bit complexity B B B if there exists a finite set S \mathcal{S} S of size at most 2 B 2^{B} 2 B , an update rule u : S × { 0 , 1 } P → S u : \mathcal{S} \times\{0,1\}^{P} \to\mathcal{S} u : S × { 0 , 1 } P → S and an output function r : S → { 0 , 1 } P r : \mathcal{S} \to\{0,1\}^{P} r : S → { 0 , 1 } P such that S t = u ( S t − 1 , x ⃗ t ) S_t = u(S_{t-1}, \vec{x}_t) S t = u ( S t − 1 , x t ) and F ( x ⃗ ) t = r ( S t ) F(\vec{x})_t = r(S_t) F ( x ) t = r ( S t ) hold.
These definitions capture the core difference between these layers: Transformers perfectly recall their recent context, while SSMs store a compressed version of the context [18 ] .
We define Σ : = { S , T } \Sigma:= \{S, T\} Σ := { S , T } . An architecture profile A A A is a finite word A = A 1 A 2 ⋯ A D ∈ Σ ∗ A = A_1 A_2 \cdots A_D \in\Sigma^{*} A = A 1 A 2 ⋯ A D ∈ Σ ∗ , whose depth is ∣ A ∣ : = D |A| := D ∣ A ∣ := D . For two architecture profiles A , B A, B A , B , we write A ⪯ B A \preceq B A ⪯ B if A A A is a subsequence of B B B : there exist indices 1 ≤ i 1 < ⋯ < i ∣ A ∣ ≤ ∣ B ∣ 1 \le i_1 < \cdots< i_{|A|} \le|B| 1 ≤ i 1 < ⋯ < i ∣ A ∣ ≤ ∣ B ∣ such that ∀ j ∈ [ ∣ A ∣ ] , A j = B i j \forall j \in[|A|], A_j = B_{i_j} ∀ j ∈ [ ∣ A ∣ ] , A j = B i j . Notice that every nonempty architecture profile A A A can be written as A = X 1 r 1 X 2 r 2 ⋯ X k r k A = X_1^{r_1} X_2^{r_2} \cdots X_k^{r_k} A = X 1 r 1 X 2 r 2 ⋯ X k r k , with ∑ i = 1 k r i = ∣ A ∣ \sum_{i=1}^{k} r_i = |A| ∑ i = 1 k r i = ∣ A ∣ and r i ∈ N + r_i \in\mathbb{N}_{+} r i ∈ N + . Here, X i ∈ Σ X_i \in\Sigma X i ∈ Σ and X i ≠ X i + 1 X_i \ne X_{i+1} X i = X i + 1 for i ∈ [ k − 1 ] i \in[k-1] i ∈ [ k − 1 ] . The architecture X i r i X_i^{r_i} X i r i is comprised of r i r_i r i layers of type X i X_i X i without a gap. We define comp ( A ) : = X 1 X 2 ⋯ X k \operatorname{comp}(A) := X_1 X_2 \cdots X_k comp ( A ) := X 1 X 2 ⋯ X k as the compression of A A A . Let B , P , W ∈ N + B, P, W \in\mathbb{N}_{+} B , P , W ∈ N + , and denote M A ( B , P , W ) M_A(B, P, W) M A ( B , P , W ) for the class of hybrid models with profile A A A , such that every S-layer has a state space with size at most 2 B 2^{B} 2 B , every T-layer has a window size at most W W W , and each intermediate tokens between layers belong to a token space with size at most 2 P 2^{P} 2 P .
The empty architecture represents the identity sequence map. Note that since both an S-layer and a T-layer contain the identity map, when A ⪯ B A \preceq B A ⪯ B , a model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) can be simulated by a model M ′ ∈ M B ( B , P , W ) M' \in\mathcal{M}_{B}(B,P,W) M ′ ∈ M B ( B , P , W ) . In particular, if ∣ A ∣ = ∣ B ∣ |A| = |B| ∣ A ∣ = ∣ B ∣ , then A ⪯ B A \preceq B A ⪯ B forces A = B A = B A = B .
Expressivity and Efficiency Tradeoff under Budget Constraints
Our method to evaluate the choice of different layer orderings is to understand, under a given budget B B B , P P P , W W W on the state size, precision, and the window length, whether for a given task there exists a hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that can solve the task with good accuracy. If there exists a model M ∈ M τ ( B , P , W ) M \in\mathcal{M}_{\tau}(B,P,W) M ∈ M τ ( B , P , W ) that solves some given task perfectly, while a model with the same depth but with a different profile must require some computational budgets far beyond B B B , P P P , W W W , then τ \tau τ is called the dominant choice of ordering for this task. Our main theoretical result reveals task-dependence in the choice of hybrid layer ordering, formalized in Theorem 1.
Theorem 1. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ \tau= X_{1}^{r_{1}}X_{2}^{r_{2}}\cdots X_{h}^{r_{h}} \in\Sigma^{*} τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ be an arbitrary architecture profile with depth D D D . Let α : = comp ( τ ) \alpha:= \operatorname{comp}(\tau) α := comp ( τ ) and ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) be an arbitrary fixed constant. There exist constants c τ > 0 c_{\tau} > 0 c τ > 0 , C τ , ϵ > 0 C_{\tau,\epsilon} > 0 C τ , ϵ > 0 , a family of task { F τ , ϵ , m } m ≥ 1 \{F_{\tau,\epsilon,m}\}_{m \ge1} { F τ , ϵ , m } m ≥ 1 , where F τ , ϵ , m : ( V ϵ , m ) L ϵ , m → V ϵ , m F_{\tau,\epsilon,m} : (\mathcal{V}_{\epsilon,m})^{L_{\epsilon,m}} \to\mathcal{V}_{\epsilon,m} F τ , ϵ , m : ( V ϵ , m ) L ϵ , m → V ϵ , m and ∣ V ϵ , m ∣ ≤ poly ϵ ( m ) |\mathcal{V}_{\epsilon,m}| \le\operatorname{poly}_{\epsilon}(m) ∣ V ϵ , m ∣ ≤ poly ϵ ( m ) , L ϵ , m ≤ poly ϵ ( m ) L_{\epsilon,m} \le\operatorname{poly}_{\epsilon}(m) L ϵ , m ≤ poly ϵ ( m ) , and a family of distributions μ m \mu_m μ m over a sequence of tokens with length L m L_m L m parameterized by m ∈ N + m \in\mathbb{N}_{+} m ∈ N + , such that for all m m m sufficiently large, the follows hold.
(Completeness) There exists a hybrid model M τ , m ∈ M τ ( B τ , m , P τ , m , W τ , m ) M_{\tau,m} \in\mathcal{M}_{\tau}(B_{\tau,m},P_{\tau,m},W_{\tau,m}) M τ , m ∈ M τ ( B τ , m , P τ , m , W τ , m ) such that err μ m ( M τ , m , F τ , ϵ , m ) = 0 \operatorname{err}_{\mu_m}(M_{\tau,m},F_{\tau,\epsilon,m}) = 0 err μ m ( M τ , m , F τ , ϵ , m ) = 0 and B τ , m ≤ C τ , ϵ log m B_{\tau,m} \le C_{\tau,\epsilon}\log m B τ , m ≤ C τ , ϵ log m , P τ , m ≤ C τ , ϵ log m P_{\tau,m} \le C_{\tau,\epsilon}\log m P τ , m ≤ C τ , ϵ log m , W τ , m ≤ m + 1 W_{\tau,m} \le m+1 W τ , m ≤ m + 1 .
(Soundness for wrong ordering) Let A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D be an architecture profile with α ⪯̸ A \alpha\not\preceq A α ⪯ A . Then for every hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , F τ , ϵ , m ) ≤ O ( 1 / D ) \operatorname{err}(M,F_{\tau,\epsilon,m}) \le O(1/D) err ( M , F τ , ϵ , m ) ≤ O ( 1/ D ) , must satisfy W ≥ c τ m 1 / ϵ W \ge c_{\tau}m^{1/\epsilon} W ≥ c τ m 1/ ϵ or max { B , P } ≥ c τ m \max\{B,P\} \ge c_{\tau}m max { B , P } ≥ c τ m .
(Soundness for insufficient profile) Let A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D be an architecture profile with α ⪯ A \alpha\preceq A α ⪯ A but τ ⪯̸ A \tau\not\preceq A τ ⪯ A . Then, for every hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , F τ , ϵ , m ) ≤ O ( 1 / D ) \operatorname{err}(M,F_{\tau,\epsilon,m}) \le O(1/D) err ( M , F τ , ϵ , m ) ≤ O ( 1/ D ) , must satisfy W > λ τ ( m + 1 ) W > \lambda_{\tau}(m+1) W > λ τ ( m + 1 ) or B > λ τ B τ , m B > \lambda_{\tau}B_{\tau,m} B > λ τ B τ , m or P > λ τ P τ , m P > \lambda_{\tau}P_{\tau,m} P > λ τ P τ , m , where λ τ \lambda_{\tau} λ τ is a constant that is strictly larger than 1.
We give an interpretation of Theorem 1. Given any target profile τ ∈ Σ D \tau\in\Sigma^{D} τ ∈ Σ D , we would like to evaluate models over a family of tasks { F τ , ϵ , m } \{F_{\tau,\epsilon,m}\} { F τ , ϵ , m } , where the size of the input of F τ , ϵ , m F_{\tau,\epsilon,m} F τ , ϵ , m grows at an order of poly ϵ ( m ) \operatorname{poly}_{\epsilon}(m) poly ϵ ( m ) , for every fixed ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) . In particular, with a resource budget B τ , m B_{\tau,m} B τ , m , P τ , m = O ϵ ( log m ) P_{\tau,m} = O_{\epsilon}(\log m) P τ , m = O ϵ ( log m ) and W τ , m = m + 1 W_{\tau,m} = m+1 W τ , m = m + 1 , a hybrid model in M τ ( B τ , m , P τ , m , W τ , m ) \mathcal{M}_{\tau}(B_{\tau,m},P_{\tau,m},W_{\tau,m}) M τ ( B τ , m , P τ , m , W τ , m ) can perfectly solve F τ , ϵ , m F_{\tau,\epsilon,m} F τ , ϵ , m . On the other hand, we design a distribution μ ϵ , m \mu_{\epsilon,m} μ ϵ , m of inputs such that every model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) with the same depth and τ ⪯̸ A \tau\not\preceq A τ ⪯ A must require more resources to achieve a reasonable accuracy.
To quantify the resource separation, we partition the A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D into 2 categories: (i) architectures satisfying comp ( τ ) ⪯̸ A \operatorname{comp}(\tau) \not\preceq A comp ( τ ) ⪯ A , where A A A is still not more expressive than τ \tau τ with all neighboring layers merged, and (ii) architectures satisfying comp ( τ ) ⪯ A \operatorname{comp}(\tau) \preceq A comp ( τ ) ⪯ A . We say that A A A has the wrong order when comp ( τ ) ⪯̸ A \operatorname{comp}(\tau) \not\preceq A comp ( τ ) ⪯ A , which, by Theorem 1, requires qualitative more resources to solve the task. In particular, a model A A A that can solve the task either requires exponentially larger state spaces/precisions or needs a polynomially larger window size, but with an arbitrarily large rate of growth. When comp ( τ ) ⪯ A \operatorname{comp}(\tau) \preceq A comp ( τ ) ⪯ A but τ ⪯̸ A \tau\not\preceq A τ ⪯ A , a qualitative separation is no longer possible. This is due to our result in Appendix § 7.5 showing that consecutive layers of the same type can be merged. However, we show that the resources required by such a profile are still a constant factor larger than that of τ \tau τ .
We next provide an overview of why Theorem 1 is expected, and the technique we use to prove it. We defer the full technical details of Theorem 1 to Appendix § 7.5 .
Warm Up: Examples for Shallow Hybrid Models. To start with, we consider a simple associative recall [1 ] variant, where we show a TS profile is the dominant architecture. Consider an input sequence I I I of the form ( x 1 , … , x m − 1 , q , 0 ⃗ ) (x_1,\ldots,x_{m-1},q,\vec{0}) ( x 1 , … , x m − 1 , q , 0 ) with length L L L , where q ∈ [ m − 1 ] q \in[m-1] q ∈ [ m − 1 ] and x i x_i x i is drawn from some finite vocabulary of size poly ( m ) \operatorname{poly}(m) poly ( m ) . The task input is I I I , and the output has x q x_q x q at the last position. The T-layer can perform local computations within a window of m m m , so it can output x q x_q x q at position m m m . Following, when the S-layer receives x q x_q x q at position m m m , it only needs O ( log m ) O(\log m) O ( log m ) to memorize it until the end of the sequence. This immediately gives a model M ∈ M T S ( log m , log m , m ) M \in\mathcal{M}_{\mathrm{TS}}(\log m,\log m,m) M ∈ M TS ( log m , log m , m ) that solves the task.
In contrast, the ST architecture requires at least one constraint to be significantly larger. Assuming W ≤ m W \le m W ≤ m , standard communication complexity [27 ] implies that using a T-layer as the last layer requires Ω ( m ) \Omega(m) Ω ( m ) bits from early in the context. Thus, the S-layer must store Ω ( m ) ≫ log m \Omega(m) \gg\log m Ω ( m ) ≫ log m bits to compress sufficient information to perform the task. This establishes a simple example where TS is the dominant architecture. We provide an additional broad family of natural tasks in § 2.2 where TS is the dominant architecture, solvable using standard implementations of attention with Mamba-formed SSMs.
The most natural, yet flawed, task for a deeper target architecture τ \tau τ is a task that iteratively solves the recall problem, separated by long 0 ⃗ \vec{0} 0 vectors. For the τ = T S T \tau= \mathrm{TST} τ = TST architecture, such a task does separate architectures: this simple tensor look-up task makes τ \tau τ the dominant choice and is studied empirically in § 3 . Specifically, we are given input I = ( x ⃗ , q 1 , 0 ⃗ , F ⃗ , q 2 ) I = (\vec{x},q_1,\vec{0},\vec{F},q_2) I = ( x , q 1 , 0 , F , q 2 ) , where each x ⃗ ∈ [ m ] m − 1 \vec{x} \in[\sqrt{m}]^{m-1} x ∈ [ m ] m − 1 , q 1 ∈ [ m − 1 ] q_1 \in[m-1] q 1 ∈ [ m − 1 ] , F ⃗ ∈ V m \vec{F} \in\mathcal{V}^{m} F ∈ V m is a m × m \sqrt{m} \times\sqrt{m} m × m matrix, q 2 ∈ [ m ] q_2 \in[\sqrt{m}] q 2 ∈ [ m ] , we are asked to output F x q 1 , q 2 F_{x_{q_1},q_2} F x q 1 , q 2 . The intuition is clean: a T-layer extracts x q 1 x_{q_1} x q 1 and sends it through the S-layer to the second T-layer to complete the lookup task.
However, for τ = S T S \tau= \mathrm{STS} τ = STS , a similar idea no longer works. For intuition, we modify the tensor lookup task with the input I = ( q 1 , 0 ⃗ , F ⃗ , q 2 , 0 ⃗ ) I = (q_1,\vec{0},\vec{F},q_2,\vec{0}) I = ( q 1 , 0 , F , q 2 , 0 ) and ask a model to output F q 1 , q 2 F_{q_1,q_2} F q 1 , q 2 at the end. Although a small model with an STS profile can solve the task, we find that a small model with a TS profile can also solve the task. The architecture uses a window of a T-layer that entirely contains F ⃗ \vec{F} F , identical to what is used for STS. This layer can copy F ⃗ \vec{F} F and place it after q 2 q_2 q 2 [9 ] . This implies that the S-layer receives q 1 → q 2 → F ⃗ q_1 \to q_2 \to\vec{F} q 1 → q 2 → F , changing the required processing order. This requires an S-layer with O ( log m ) O(\log m) O ( log m ) bits to solve the full task, the same as for STS but with one fewer layer. A core takeaway is that each layer is not only solving some specific task but also compressing and rearranging information for future layers to function more efficiently. A simple task like tensor lookup is too simple to prevent this type of information aggregation from being useful, especially when comparing T-layers, which are any possible causal-window nonlinear function. Thus, to establish Theorem 1, more complicated tasks must be considered.
The task we construct is in Definition 1.
Definition 1 (Sequential Function Composition). Let X k e y \mathcal{X}_{\mathrm{key}} X key be a finite space of keys and C \mathcal{C} C be a finite space of vocabularies. Let k ∈ N + k \in\mathbb{N}_{+} k ∈ N + . A level-k k k recursive chain F τ , ε , m F_{\tau,\varepsilon,m} F τ , ε , m is defined by a sequence of k k k functions { H i } i = 1 k \{H_i\}_{i=1}^{k} { H i } i = 1 k . Specifically, for i ∈ [ k ] i \in[k] i ∈ [ k ] , H i ( z i − 1 , x i ) : X k e y × C m → X k e y H_i(z_{i-1},x_i): \mathcal{X}_{\mathrm{key}} \times\mathcal{C}^{m} \to\mathcal{X}_{\mathrm{key}} H i ( z i − 1 , x i ) : X key × C m → X key , where z i : = H i ( z i − 1 , x i ) z_i := H_i(z_{i-1},x_i) z i := H i ( z i − 1 , x i ) . Given a sequence of input I : = ( z 0 , 0 ⃗ , x 1 , 0 ⃗ 1 , … , x k , 0 ⃗ k ) I := (z_0,\vec{0},x_1,\vec{0}_1,\ldots,x_k,\vec{0}_k) I := ( z 0 , 0 , x 1 , 0 1 , … , x k , 0 k ) of length L m L_m L m , F τ , ε , m ( I ) : = z k F_{\tau,\varepsilon,m}(I) := z_k F τ , ε , m ( I ) := z k , where each 0 ⃗ i \vec{0}_i 0 i is a sequence of 0 0 0 vectors with different lengths.
The task is divided into k k k stages. In each stage, we take a previous answer z i − 1 z_{i-1} z i − 1 and fresh independent context x i x_i x i to produce the next answer, z i = H i ( z i − 1 , x i ) z_i = H_i(z_{i-1},x_i) z i = H i ( z i − 1 , x i ) . If we use a layer ordering that subsumes comp ( τ ) \operatorname{comp}(\tau) comp ( τ ) , then the role of H i H_i H i is similar to the look-up table in the tensor lookup task, where a T-layer computes z i z_i z i and the following S-layer sends it to the next stage after the long zero vectors. Thus, a model with profile τ \tau τ can use a small resource budget to solve the task. However, when we analyze a profile A A A with α ⊈ A \alpha\not\subseteq A α ⊆ A , motivated by the failure of the tensor lookup task discussed earlier, we construct a discrete function H i H_i H i that defeats any other information embedding.
For some intuition, consider α ˉ \bar{\alpha} α ˉ starting with S as an example. We group α ˉ \bar{\alpha} α ˉ into ( S i , T i ) i = 1 k (S_i,T_i)_{i=1}^{k} ( S i , T i ) i = 1 k , where S i S_i S i (resp. T i T_i T i ) is the i i i -th S (resp. T) layer. At stage t + 1 t+1 t + 1 , with the new input block x i + 1 x_{i+1} x i + 1 , the 0 ⃗ \vec{0} 0 prevents T i T_i T i from directly accessing information from the previous block. Let C i C_i C i denote the past states of the first i i i SSM layers before x i + 1 x_{i+1} x i + 1 and let γ \gamma γ denote the state of S i + 1 S_{i+1} S i + 1 right before reading x i + 1 x_{i+1} x i + 1 . Fixing C i C_i C i to its current value c c c , the future output of S i + 1 S_{i+1} S i + 1 is a deterministic function completely determined by γ \gamma γ and x i + 1 x_{i+1} x i + 1 and not previous blocks, i.e. C i + 1 = G c ( γ , x i + 1 ) C_{i+1} = G_c(\gamma, x_{i+1}) C i + 1 = G c ( γ , x i + 1 ) . We refer to Lemma 4 and Lemma 5 for the detailed analysis.
Importantly, since models need not compute z i z_i z i directly to succeed at the task, given the current state record C i C_i C i , we will recursively construct a list of possible L i ( c ) ⊆ X k e y L_i(c) \subseteq\mathcal{X}_{\mathrm{key}} L i ( c ) ⊆ X key such that only when z i ∈ L i ( c ) z_i \in L_i(c) z i ∈ L i ( c ) can the model succeed with a good probability (Lemma 8). The list L i ( c ) L_i(c) L i ( c ) contains all possible z \mathbf{z} z such that for some state γ \gamma γ , z i + 1 z_{i+1} z i + 1 has a large probability to fall into the next list L i + 1 ( C i + 1 ) L_{i+1}(C_{i+1}) L i + 1 ( C i + 1 ) . Lemma 6 and Lemma 7 use a probabilistic method to show that there exists an H i H_i H i such that each of the L i ( c ) L_i(c) L i ( c ) cannot have a large size, which means z 1 z_1 z 1 has a small probability of falling into the list; thus, there exists an H i H_i H i used for the separating task. Using H i H_i H i , the competitive model with a wrong ordering will not succeed with a good probability unless it breaks some resource budget.
A Size-2 Cover Method for Deeper Hybrid Model with Insufficient Layers. We next give a brief overview of the case where comp ( τ ) ⪯ A \operatorname{comp}(\tau) \preceq A comp ( τ ) ⪯ A . We defer to Appendix § 7.5 .§ 2 for full technical details. As discussed earlier, in this case, a qualitative separation is not possible. Instead, we construct tasks and carefully analyze the bit complexity of solving them. In our construction, we use variants of computing the inner product over a binary field. The main obstacle is that unlike the case with wrong orderings, there may be too many different competitive profiles to analyze. Our analysis uses a novel size-2 cover approach to narrow the structures needed to analyze.
Definition 2. Let τ ∈ Σ D \tau\in\Sigma^D τ ∈ Σ D . Let s ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = S } ∣ s(\tau) = |\{i \in[D] \mid\tau_i = S\}| s ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = S } ∣ and t ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = T } ∣ t(\tau) = |\{i \in[D] \mid\tau_i = T\}| t ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = T } ∣ . For i ∈ [ s ( τ ) ] i \in[s(\tau)] i ∈ [ s ( τ )] , we use r i ( τ ) r_i(\tau) r i ( τ ) to denote the number of T-layers in τ \tau τ that is strictly after the i i i -th S-layer and for i ∈ [ t ( τ ) ] i \in[t(\tau)] i ∈ [ t ( τ )] , we use l i ( τ ) l_i(\tau) l i ( τ ) to denote the number of S-layers in τ \tau τ that is strictly after the i i i -th T-layer. We call the following set of architecture profiles the size-2 cover of τ \tau τ .
C 2 ( τ ) = { S s ( τ ) } ∪ { T t ( τ ) } ∪ { S i T r i ( τ ) ∣ i ∈ [ s ( τ ) ] } ∪ { T i S l i ( τ ) ∣ i ∈ [ t ( τ ) ] } \mathcal{C}_2(\tau) = \{S^{s(\tau)}\} \cup\{T^{t(\tau)}\} \cup\{S^iT^{r_i(\tau)} \mid i \in[s(\tau)]\} \cup\{T^iS^{l_i(\tau)} \mid i \in[t(\tau)]\} C 2 ( τ ) = { S s ( τ ) } ∪ { T t ( τ ) } ∪ { S i T r i ( τ ) ∣ i ∈ [ s ( τ )]} ∪ { T i S l i ( τ ) ∣ i ∈ [ t ( τ )]}
Roughly speaking, the size-2 cover of τ \tau τ contains maximal profiles, whose compressed version has length at most 2, subsumed by τ \tau τ . As we show in Lemma 9 that if τ ⪯̸ A \tau\not\preceq A τ ⪯ A and A ∈ Σ ≤ D A \in\Sigma^{\leq D} A ∈ Σ ≤ D , then there must be some profile in C 2 ( τ ) \mathcal{C}_2(\tau) C 2 ( τ ) not subsumed by A A A . Thus, we only need to design hard tasks for profiles of the form in a size-2 cover, a mixture of these creates a single task that is hard for τ ⪯̸ A \tau\not\preceq A τ ⪯ A . However, although for each profile in C 2 ( τ ) \mathcal{C}_2(\tau) C 2 ( τ ) there exists a model with profile τ \tau τ that can solve it exactly, it is not immediate whether there is a model with profile τ \tau τ that can solve the mixture of these tasks exactly. Since S-layers and T-layers contain more general SSMs and causal windowed functions, we show in Lemma 10 that there exists a “meta” model with profile τ \tau τ that can combine these submodels in a black-box way to solve the mixture of tasks.
Natural Tasks for 2-layer Hybrid Models
Although the tasks we constructed for Theorem 1 can be solved by a hybrid model with the target profile using small resource budgets, the tasks themselves are explicitly designed to broaden the family of models for the hardness result. These tasks may not be efficiently solvable using commonly used layer types such as Mamba, DeltaNet, or standard attention. Theorem 1 establishes resource separations across architecture profiles. We next illustrate the role of layer ordering through two more natural tasks that admit a separation favoring TS. We establish lower bounds for ST and give TS constructions in the generalized layer model in Appendix § 7.6 .§ 2 , with full technical details in Appendix § 7.6 . Appendix § 7.6 .§ 3 accounts for accumulated convolutional lookback in these recurrent-state lower bounds, extending their applicability to SSMs with convolutional front-ends, such as Mamba.
The core requirement for tasks with a dominant TS architecture is captured in Assumption 1. This assumption states that, for each task, there is some position τ \tau τ in the context such that changes before some position τ \tau τ require log ∣ Q ∣ \log|Q| log ∣ Q ∣ bits of information from before τ \tau τ , similar to the TS task from § 2 . Under this assumption, we can show that any model with SSM layers first and TF layers second requires a large state or window to perform.
Theorem 2 (SSM → \rightarrow → TF Cut). Let F F F be a length-L L L sequence task with output in Y \mathcal{Y} Y . Suppose there exist a cut position τ \tau τ , a nonempty family U \mathcal{U} U of length-τ \tau τ prefixes, and a nonempty family Q \mathcal{Q} Q of length-( L − τ ) (L-\tau) ( L − τ ) suffixes, such that every concatenation u q uq u q is a legal input and ∀ u ≠ u ′ ∈ U , ∃ q ∈ Q \forall u \ne u' \in\mathcal{U}, \exists q \in\mathcal{Q} ∀ u = u ′ ∈ U , ∃ q ∈ Q such that F ( u q ) ≠ F ( u ′ q ) F(uq) \ne F(u'q) F ( u q ) = F ( u ′ q ) . Let M M M be a deterministic model of architecture ST with recurrent state space S \mathcal{S} S and attention window W W W . If M M M computes F F F correctly on all legal inputs and that τ ≤ L − W \tau\le L-W τ ≤ L − W , then ∣ S ∣ ≥ ∣ U ∣ |\mathcal{S}| \ge|\mathcal{U}| ∣ S ∣ ≥ ∣ U ∣ .
This result stems from how information can be processed in a sequence. Without a large window, only the SSM in ST communicates with the early part of the sequence, forcing a large state. For a TS architecture, the Transformer performs computations that are then carried by the SSM, reducing state size and window length. We now define the two natural tasks for the TS architecture.
Exact Copy. Given a sequence x \mathbf{x} x , the task of exact copy is to output 1 if there exists some repeated subsequence of length l l l , and output 0 otherwise.
Definition 3 (Exact Copy). Given a vocabulary V \mathcal{V} V and an input sequence x ∈ V L \mathbf{x} \in\mathcal{V}^{L} x ∈ V L , we say that x \mathbf{x} x contains an exact copy of repetition c c c and string length l l l if there exists i ∈ [ L ] i \in[L] i ∈ [ L ] s.t.
x i + j + k l = x i + j + ( k + 1 ) l , j ∈ { 0 , ⋯ , l − 1 } , k ∈ { 0 , ⋯ , c − 2 } . x_{i+j+kl}=x_{i+j+(k+1)l},\quad j\in\{0,\cdots,l-1\},\ k\in\{0,\cdots,c-2\}. x i + j + k l = x i + j + ( k + 1 ) l , j ∈ { 0 , ⋯ , l − 1 } , k ∈ { 0 , ⋯ , c − 2 } . The task of Exact Copy is to output y L y_L y L , where y i : = 1 { x 1 : i has an exact copy } y_i:=\mathbf{1}_{\{x_{1:i}\text{ has an exact copy}\}} y i := 1 { x 1 : i has an exact copy } .
This task satisfies Assumption 1 by setting τ \tau τ to be the end of the exact copy. Thus, Theorem 2 applies, ensuring ST architectures require large memory. This task represents situations where a complex operation occurs early in a sequence, but the result needs to be carried much later in the context. For instance, reasoning-style tasks where a model identifies a useful lemma using TF layers early in the sequence can be efficiently propagated to the end of the sequence by SSM layers.
Segmented Retrieval. To define segmented retrieval, we place separator tokens in the sequence to act as a partition. The simplest per-segment operation is a fixed lookup in the past. Concretely, this means that for some fixed λ ≥ 1 \lambda\ge1 λ ≥ 1 , the value at the separator token at position i i i is x i − λ x_{i-\lambda} x i − λ . The task of segmented retrieval is to output the last of these x i − λ x_{i-\lambda} x i − λ in some subset of the vocabulary.
Definition 4 (Segmented Retrieval). Given a vocabulary V \mathcal{V} V , we specify a non-empty subset N ⊆ V \mathcal{N} \subseteq\mathcal{V} N ⊆ V . Given an input sequence ( ( x 1 , b 1 ) , … , ( x L , b L ) ) ∈ ( V × { 0 , 1 } ) L ((x_1,b_1),\ldots,(x_L,b_L))\in(\mathcal{V}\times\{0,1\})^L (( x 1 , b 1 ) , … , ( x L , b L )) ∈ ( V × { 0 , 1 } ) L , where b i b_i b i indicates whether position i i i is an internal segment boundary and is revealed only when position i i i is processed. We define { t 1 , … , t k } : = { i ∈ [ L − 1 ] : b i = 1 } \{t_1,\ldots,t_k\}:=\{i\in[L-1]:b_i=1\} { t 1 , … , t k } := { i ∈ [ L − 1 ] : b i = 1 } , t 0 : = 0 t_0:=0 t 0 := 0 , t k : = L t_k:=L t k := L and refer an element from { t 1 , … , t k − 1 } \{t_1,\ldots,t_{k-1}\} { t 1 , … , t k − 1 } as a boundary and define l : = min j ∈ [ k ] ( t j − t j − 1 ) l:=\min_{j\in[k]}(t_j-t_{j-1}) l := min j ∈ [ k ] ( t j − t j − 1 ) and we set that l ≥ 2 l\ge2 l ≥ 2 . Select 1 ≤ λ < l 1\le\lambda<l 1 ≤ λ < l , and define the largest index of the nonempty set { j ∈ [ k − 1 ] : x t j − λ ∈ N } \{j\in[k-1]:x_{t_j-\lambda}\in\mathcal{N}\} { j ∈ [ k − 1 ] : x t j − λ ∈ N } as λ ∗ \lambda^* λ ∗ . The Segmented Retrieval task is to output the token x t λ ∗ − λ x_{t_{\lambda^*}-\lambda} x t λ ∗ − λ .
Similar to exact copy, this task satisfies Assumption 1. Again, Theorem 2 applies, ensuring ST architectures require large memory. However, the source of the cut τ \tau τ is different. Here, the cut occurs at the partitions, where the model must recall the past λ \lambda λ tokens. The TS architecture uses its TF layer to perform the λ \lambda λ -back recall, and the SSM carries the relevant tokens through the sequence. This is a simplified multi-document task, where information from each document (segment) may need to be carried to the end of the context; this latter component is best suited for SSM layers.
Empirical Results of Natural Tasks
We have established that for certain tasks, there is a theoretical separation in expressivity. However, these theoretical results focus on layerwise resource constraints that may not tie to common constraints in practice. We empirically test small hybrids on these tasks with a total fixed inference memory, showing that hybrids of this specific architecture learn them with the best performance.
Two Layers - Segmented Retrieval and Exact Copy
We begin the experiments with a sweep over the possible 2-layer hybrids on tasks where we expect a TS to be dominant. For two tasks, segmented retrieval and exact copy, we observe that there is a similar separation between architectures as predicted theoretically. These results are conducted under a fixed proxy of inference memory (details in Appendix § 7.3 .§ 3 ).
Setup. On both tasks, we use a small vocabulary of around 20 tokens and sequence lengths of around 150. We select Transformers with RoPE embeddings for T-layers and Mamba for S layers [8 ] . These match the model types used in [9 ] to compare pure SSMs to pure Transformers. For the TT and SS architectures, a fixed memory constraint induces a trade-off between token embedding dimension and window length or state size. For the ST and TS, there are two degrees of freedom to satisfy the memory budget proxy. We select some window-to-state-size ratios; for each, we execute a sweep over token dimension to blanket the space of possible architectures. The memory calculation is described in Appendix § 7.3 .§ 3 . All experiments are averaged across 5 seeds.
Results. Results for both tasks are found in Figure 2 . These results show the performance of each hybrid, plotted against the token embedding dimension. For the TS and ST hybrids, the ratio of window to state dimension is annotated at the end of each associated curve. Each curve ends once the desired ratio is no longer attainable, i.e. the token dimension is so large that the sum of the window and state expansion factors is less than the sum of the ratio components. Moving to the right increases the token embedding size, which requires the window and state expansion factor to decrease. This allows the model to have richer token representations but reduces the available context. Moving to the left increases the window width and state expansion factor but requires a reduction in token precision. While much, if not all, of the context is available, the token embeddings are so small that the model cannot compute with each token sufficiently. The highest average performance of a model other than TS is shown by a dashed horizontal line.
Figure 2. (a) The Segmented Retrieval task. (b) The Exact Copy task. Results for the TS tasks where an inference memory proxy is held constant. The annotations represent the relationship between window storage and state size for Transformer-Mamba hybrids. The only architecture with high performance on the task is the TS architecture. Due to fixed memory, models with larger token dimension have smaller window and state size, making the tasks difficult. Conversely, small token dimension limits expressivity.
Crucially, the only model that achieves high accuracy, and perfect accuracy in one setting, is the TS architecture. This result also confirms that the layer ordering is vital to performance. The ST architectures never achieve high performance, as their ability to capture complex operations early in the sequence is hindered by this layer ordering.
Containing Subarchitectures Predicts Performance
The two-layer experiments in § 3.1 and the three-layer experiments in Appendix § 7.4 .§ 4 identify TS and TST, respectively, as the best-performing profiles under the tested settings. Motivated by our theoretical separations, we next examine whether containing these profiles as subsequences predicts performance at greater depth. We evaluate all four-layer profiles on segmented retrieval (Table 1 ) and all five-layer profiles on tensor lookup (Figure 3 ).
Table 1. Training 4-layer hybrids on segmented retrieval. Left columns are models without TS; the right columns are models with TS as a component. There is a clear dichotomy between hybrids with and without this motif.
Figure 3. Performance of all possible 5-layer Transformer-Mamba hybrids on the task where TST is expected to dominate. Models with TST as a sub-architecture perform above those without.
Setup. For each experiment, we follow the setup for the two- and three-layer architectures. We increase the total allotted memory to account for the models having more layers. For both settings, we test all layer orderings of Transformers and SSM layers. We repeat across 3 seeds for each.
Results. The results for training 4-layer hybrids on segmented retrieval are found in Table 1 . This table separates architectures that contain TS as an architecture and those that do not. Accuracy is taken as the highest across seeds for models without TS and the lowest across seeds for models with TS. Even so, all architectures with TS as a sub-architecture achieve perfect performance, while all architectures without TS do not achieve perfect performance on any of the 3 seeds.
The results for the TST task are shown in Figure 3 . The models are positioned based on their number of Transformer layers and are colored based on their containment of TST as a sub-architecture. Aside from the STSTS architecture, models with TST are notably higher in performance than the other architectures.
Observations on Associative Recall
We have thus far focused on the accuracy of various hybrid architectures. These architectures were trained on tasks where we have clear theoretical results indicating which architecture is predicted to have the highest performance. Here, we probe other aspects of learned hybrids on a variant of associative recall [1 ] , including a mechanistic study of the learned algorithms by different layer orderings.
Setup. We test (2, 1)-AR (two tokens per key, one token per value) on hybrid architectures with 8 layers. This task represents a very compressed version of a multidocument task, where every triplet of tokens is a document identifier and associated value. The chosen architecture families are size-2 cover architectures T ∗ S ∗ T*S* T ∗ S ∗ and S ∗ T ∗ S*T* S ∗ T ∗ . We vary the T-layer count between 0 and 8, repeating each setting with 5 seeds. The median, minimum, and maximum performance are reported. Additionally, for each architecture, we take the last token representations at each layer of the model and linearly probe for the next token. This roughly measures how much of the next token is identified by each layer. Additional details can be found in Appendix § 7.3 .§ 3 .
Results. The results on performance are shown in Figure 4 . As expected, hybrid models outperform pure architectures. However, each architecture family behaves differently, including a different peak TF-to-SSM ratio. Models with Transformers in the first few layers benefit most from having a very small subset of layers as Transformer layers. We also observe that the T ∗ S ∗ T*S* T ∗ S ∗ architecture outperforms the S ∗ T ∗ S*T* S ∗ T ∗ architecture. We predict this is due to the multi-document nature of this task.
Figure 4. Token accuracy of T ∗ S ∗ T*S* T ∗ S ∗ and S ∗ T ∗ S*T* S ∗ T ∗ architectures on (2, 1)-AR. Small differences in architectures affect performance dramatically.
The linear probe results in Figure 5 further support this. Consistently, the first TF layer improves decodability significantly. This TF layer retrieves the key-value pairs within its context window, but cannot capture the rest. More subtle is the behavior of models with many SSM layers stacked back-to-back. With these long strings of SSM layers, the model’s decodability slowly increases as depth increases; we hypothesize the SSM layers are bringing these remaining key-value pairs from outside the context window. We also note that models trained on natural language typically exhibit a similar behavior, with TF layers performing the majority of recall [17 ] .
Figure 5. Probe accuracy from the output stream at each model layer. All models have a significant gain in probe accuracy at their first TF layer, even in the pure TF where all layers are identical. T T T S S S S S TTTSSSSS T T T S S S S S and S T S T S T S T STSTSTST S T S T S T S T both see little increase at S-layers, while the other models do.
Conclusion
Hybrid architectures are critical to building frontier models. Their performance and flexibility come at the cost of an expanded design space that cannot be easily navigated without an understanding of the effect of layer order and design on task performance. We provided an analysis taking the first step towards such an understanding. We showed that for each design, there exist tasks that provably favor a model with this type of architecture over all other choices. We do so by explicitly constructing such models, additionally finding that trained hybrids exhibit matching behaviors. Our general theory relies on deliberately constructed tasks and expressive abstractions of SSM and attention layers, and the corresponding optimal architectures need not always be realizable by standard practical models. While our natural tasks and experiments begin to bridge this gap, an important direction is to extend the theory to practical layer classes, richer mixtures of tasks, and natural-language settings. Ultimately, we hope to identify task-level properties that predict effective layer orderings before expensive model training.
Acknowledgements
John Cooper and Frederic Sala were supported by the National Science Foundation (NSF) (CCF2106707), the Defense Advanced Research Projects Agency (DARPA Young Faculty Award) and the Wisconsin Alumni Research Foundation (WARF). Ilias Diakonikolas was supported by a Guggenheim Fellowship and the ONR (N00014- 25-1-2268). Mingchen Ma was supported by NSF Award CCF-2144298 (CAREER) and the ONR (N00014- 25-1-2268).
AI use statement
In this work, generative AI models including GPT 5.6 sol and GPT 6 Astra are used interactively as a routine for discussion, helping with proof construction, writing code for some of the tasks as well as checking potential flaws during the preparation of the manuscript. The analysis of Case 4 of Theorem 4 was mainly established and proved by GPT 6 Astra based on a hardness construction provided by the authors that contained a non-trivial mathematical flaw. We include the generated proof at https://github.com/SprocketLab/layer-importance , as supplementary material to support the correctness of the theory. We additionally used generative AI tools to polish some grammar in the text. We did not use generative AI tools for any other required-disclosure task, including the core writing or literature review. We have reviewed all AI-assisted work: AI-generated proofs and code were read, executed, and verified for correctness by at least 2 authors, and all suggested grammatical edits were checked to ensure no claims or technical content were altered. We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.
Notation
We provide an overview of the notation used throughout the paper in Table 2 .
Table 2. Notation
An attention head Attn \operatorname{Attn} Attn is defined by matrices W k , W q , W v ∈ R d × d \mathbf{W}_{k},\mathbf{W}_{q},\mathbf{W}_{v} \in\mathbb{R}^{d \times d} W k , W q , W v ∈ R d × d such that Attn ( x ⃗ ) j = ∑ i = 1 n α j i W v x i \operatorname{Attn}(\vec{x})_{j} = \sum_{i=1}^{n} \alpha_{ji}\mathbf{W}_{v}x_{i} Attn ( x ) j = ∑ i = 1 n α j i W v x i , where
α j i : = exp ( ( W q x j ) ⋅ ( W k x i ) ) ∑ i = 1 n exp ( ( W q x j ) ⋅ ( W k x i ) ) . \alpha_{ji} := \frac{\exp((\mathbf{W}_{q}x_{j}) \cdot(\mathbf{W}_{k}x_{i}))}{\sum_{i=1}^{n}\exp((\mathbf{W}_{q}x_{j}) \cdot(\mathbf{W}_{k}x_{i}))}. α j i := ∑ i = 1 n exp (( W q x j ) ⋅ ( W k x i )) exp (( W q x j ) ⋅ ( W k x i )) .
An attention layer A T \mathrm{AT} AT is defined by H H H attention heads Attn 1 , … , Attn H \operatorname{Attn}_{1},\ldots,\operatorname{Attn}_{H} Attn 1 , … , Attn H and a projection matrix W o ∈ R d × d H \mathbf{W}_{o} \in\mathbb{R}^{d \times dH} W o ∈ R d × d H . Denote by O : = ( Attn 1 ( x ⃗ ) ⊤ , … , Attn H ( x ⃗ ) ⊤ ) ⊤ ∈ R d H × L \mathbf{O} := (\operatorname{Attn}_{1}(\vec{x})^{\top},\ldots,\operatorname{Attn}_{H}(\vec{x})^{\top})^{\top} \in\mathbb{R}^{dH \times L} O := ( Attn 1 ( x ) ⊤ , … , Attn H ( x ) ⊤ ) ⊤ ∈ R d H × L the concatenation of the outputs of the H H H attention heads, so the attention layer A T ( x ⃗ ) \mathrm{AT}(\vec{x}) AT ( x ) outputs W o O ∈ R d × L \mathbf{W}_{o}\mathbf{O} \in\mathbb{R}^{d \times L} W o O ∈ R d × L .
A Transformer layer T F \mathrm{TF} TF is defined by an attention layer A T \mathrm{AT} AT and an MLP layer. In particular, an MLP layer is defined as f ( x ) : R d → R d f(x): \mathbb{R}^{d} \to\mathbb{R}^{d} f ( x ) : R d → R d as f ( x ) = U 2 σ ( U 1 x ) f(x) = U_{2}\sigma(U_{1}x) f ( x ) = U 2 σ ( U 1 x ) , where U 1 , U 2 U_{1}, U_{2} U 1 , U 2 are matrices and σ \sigma σ is an activation function applied coordinate-wise. Specifically, T F ( x ⃗ ) = M L P ( A T ( x ⃗ ) ) \mathrm{TF}(\vec{x}) = \mathrm{MLP}(\mathrm{AT}(\vec{x})) TF ( x ) = MLP ( AT ( x )) .
An SSM layer S S M \mathrm{SSM} SSM is defined with a state S t S_{t} S t , an update rule s s s , and an emission rule r r r . Let s 0 ∈ S s_{0} \in\mathcal{S} s 0 ∈ S be some initial state. Given some sequence x 1 , … , x L x_{1},\ldots,x_{L} x 1 , … , x L , the state of the model at iteration i i i is denoted by s i = S i ( x 1 , … , x i ) s_i = S_i(x_1,\ldots,x_i) s i = S i ( x 1 , … , x i ) and the output token is denoted by r i = F ( x ⃗ ) i = R i ( x 1 , … , x i ) r_i = F(\vec{x})_i = R_i(x_1,\ldots,x_i) r i = F ( x ) i = R i ( x 1 , … , x i ) , where the state and output are defined recursively:
S 0 ( ∅ ) = s 0 S_0(\varnothing) = s_0 S 0 ( ∅ ) = s 0 ,
S i ( x 1 , … , x i ) = u ( S i − 1 ( x 1 , … , x i − 1 ) , x i ) S_i(x_1,\ldots,x_i) = u(S_{i-1}(x_1,\ldots,x_{i-1}),x_i) S i ( x 1 , … , x i ) = u ( S i − 1 ( x 1 , … , x i − 1 ) , x i ) ,
R i ( x 1 , … , x i ) = r ( S i ( x 1 , … , x i ) ) R_i(x_1,\ldots,x_i) = r(S_i(x_1,\ldots,x_i)) R i ( x 1 , … , x i ) = r ( S i ( x 1 , … , x i )) .
Related Work
Hybrid Models
Empirical Analysis on Hybrid Models. Hybrid designs now appear throughout frontier-scale open models, where attention placement is conventionally fixed and only the mixing ratio is tuned. Jamba [15 ] is one of the first models to combine attention, Mamba, and mixture-of-experts layers. It interleaves one attention layer for every seven Mamba layers and reports no substantial difference relative to a 1:3 ratio. Nemotron-H [19 ] allocates roughly 8% of layers to attention, spacing them evenly through the stack; Nemotron 3 [20 ] retains only a handful among interleaved Mamba-2 and mixture-of-experts layers; and Nemotron-Flash [7 ] selects its layer sequence via search under a latency budget. Kimi Linear [12 ] , Olmo Hybrid [16 ] , Qwen3-Next [26 ] , and Qwen3.8-Next [25 ] all place one attention layer in every four. Within each period, attention follows the recurrent layers, except in Jamba where it appears among them.
Systematic studies explore hybrid design more broadly but still leave placement largely unexplored. [29 ] show at the 8B-parameter scale that a hybrid with 7% attention layers outperforms a Transformer on all twelve standard tasks. [30 ] sweep six linear-attention variants across five ratios, recommending 3:1 to 6:1 ratios of SSM to TF layers, and find that the best standalone linear model is not the best hybrid component. [14 ] compare sequential and parallel hybrids on memory recall. Only [2 ] vary where attention blocks are placed: at every ratio, placing attention in the early layers underperforms pure models, whereas placing it in the middle performs best. Some works have also observed that pure Transformers learn many heads that can be simulated closely by an SSM, allowing for distillation to more efficient architectures [31 , 4 ] .
Since each configuration requires a full pre-training run, deployed models each commit to a single interleaving, and the one controlled study of placement [2 ] explores only a narrow slice of the design space. Our synthetic sweeps cover a broad set of orderings within an 8-layer stack and show that the best ordering depends on the task.
Theoretical Understanding for Hybrid Models. Hybrid architectures have been studied less in a theoretical setting than in empirical settings. The work by [6 ] established a separation in memory resource constraints between hybrid architectures and pure architectures. We build on this work, studying hybrids of greater depth. Additionally, [16 ] proved hybrid architectures can implement tasks that exist in N C 1 \mathrm{NC}^{1} NC 1 while both SSMs and Transformers are stuck in T C 0 \mathrm{TC}^{0} TC 0 . This work establishes more tasks and distinguishes between layer orderings, which has yet to be studied using tools from communication complexity. Communication complexity is a classical tool for converting information-transfer bottlenecks into computational lower bounds [13 , 27 ] . It has recently become useful for understanding the expressivity of sequence models. [28 ] use communication-complexity arguments to establish representational limitations of attention, while [3 ] obtain separations between Transformers and recurrent architectures through reductions from communication problems. Closer to large language models, [23 ] use communication complexity to prove limitations of Transformers on function composition, and [5 ] introduce an autoregressive communication model to obtain unconditional depth–width lower bounds for multi-layer decoder-only Transformers and a provable advantage for chain-of-thought reasoning.
Mechanistic Tasks
Associative recall. The most common task to test a model’s retrieval abilities is associative recall [22 ] . It probes a model’s capability to maintain an associative memory, keeping track of facts indexed by prior tokens. The original form of associative recall separated pure SSMs from pure TFs as worse at storing large memories.
This task, however, has grown too simple to the point where many similar architectures perform nearly perfectly. A few variants have been proposed, such as MQAR [1 ] —eliminating issues from only querying a single key-value pair—and phonebook [9 ] —where each key and value are made of multiple tokens. We focus on the last of these as a probe into the differences between hybrid architectures.
Experiment Details
We provide some additional experimental details for those conducted in the main body. We begin with a description of the layer architectures used. In Section C.1, we provide the experimental details omitted in the main body. In Section C.2, we detail the learning rate sweeps conducted for each of the experiments. Lastly, in Section C.3, we describe the calculation used to determine the size of memory used by these models.
Transformers. The Transformers come from GPTNeoX and are given RoPE positional embeddings, both in the pure model and in all hybrids. All experiments use Transformer layers with a single head each. We observed that for this scale of experiments, increasing the number of heads by partitioning the square key and query matrices into thin rectangles hindered performance severely.
SSMs. The chosen SSM for all experiments is Mamba. This architecture allows for the state size to be increased independently of token dimension.
Two- and Three- Layer Hybrid Details
Here, we detail the different experimental parameters relevant to each of the tasks tested.
Segmented Retrieval. We use a vocabulary of 40, with half of the vocabulary within the set N \mathcal{N} N . We use sequences of length 150 and a partition of 10 segments. The segment boundaries are chosen uniformly at random in a sequence. We use a lookup distance of λ = 8 \lambda= 8 λ = 8 , halfway to the expected segment length of 15. This prevents too many sequences from being so short as to not have any valid lookup, nor is λ \lambda λ so small that it falls within Mamba’s learned convolution. Using a uniform sampling of positions makes the task easier than if all segments were of length λ \lambda λ or greater. In fact, we observed that when λ \lambda λ is within this convolution length, the pure SSM architectures perform the task nearly as well as TS. It is possible to modify this task so the lookup distance is not fixed, though, circumventing the convolution altogether. Each model has 512 dimensions of memory. Due to the output space containing 20 tokens from the vocabulary, random performance is 0.05.
Exact Copy. For sequence lengths of 100, we have 20 vocabulary tokens. The copied sequence length is 5, which is repeated 3 times in the relevant sequences. To assist with training, we train the model to output 1s at every position after the exact copy is observed rather than only at the last token. Each model has 512 dimensions of memory. Due to the task being binary, random performance is 0.5.
TST Task. We use a sequence length of 150 and a vocabulary size of 7. The selection of 7 puts the final matrix in the last 1/3 of the context, and the initial lookup lies within the initial 1/3 of the context. This leaves a comfortable 1/3 of the middle of the context as null tokens, requiring an SSM layer to prevent large memory usage. We use a special copy of the vocabulary for the query token q q q to perform the first lookup. This helped the task be learnable by separating the tokens that are within the tensors and those which act as queries.
Learning Rate Selection
In all experiments, we conduct a learning rate sweep to identify the best learning rate for each set of hyperparameters. For the segmented retrieval and TST tasks, 9 learning rates are sampled multiplicatively evenly between 10 − 4 10^{-4} 1 0 − 4 and 10 − 3 10^{-3} 1 0 − 3 . Each learning rate is run for one epoch and for 2 different sets. The learning rate with the smallest loss is selected as the learning rate for the 5 seeds tested.
For the exact copy experiments, 4 learning rates are multiplicatively spaced between 10 − 3 10^{-3} 1 0 − 3 and 10 − 1 10^{-1} 1 0 − 1 . For each of these, all 5 seeds are run for complete training runs. The best learning rate on average was selected. These experiments are thus more computationally expensive than the other tasks, although this worked in this setting, as we experimented on the other two tasks with deeper hybrids with more settings.
The learning rates for associative recall were selected with 2 epochs of training and a collection of learning rates between 10 − 5 10^{-5} 1 0 − 5 and 10 − 2 10^{-2} 1 0 − 2 . More details are provided in Appendix § 7.4 .7.
Memory Proxy Calculation
We calculate a proxy for the inference memory used, M M M , by each model in a simplified manner as follows. Let d d d be the hidden dimension of the model.
For a Transformer with window W W W , we account for the memory needed for the Transformer to store the tokens in its context. Thus, we calculate the memory needed as
M T F = d W . M_{\mathrm{TF}} = dW. M TF = d W .
For a Mamba layer (also titled SSM), we use the state expansion factor N N N . The hidden state of a Mamba layer is a matrix of size N × d N \times d N × d . Thus, we calculate the memory needed as
M S S M = d N . M_{\mathrm{SSM}} = dN. M SSM = d N .
Lastly, for the few experiments containing Gated DeltaNet, we only need the token dimension. The state for these layers is a square matrix of the same size as the input. Thus, we calculate the memory needed as
M G D N = d 2 . M_{\mathrm{GDN}} = d^2. M GDN = d 2 .
For a model with N T F N_{\mathrm{TF}} N TF Transformer layers, N S S M N_{\mathrm{SSM}} N SSM Mamba layers, and N G D N N_{\mathrm{GDN}} N GDN GDN layers, the total memory is
M = N T F d W + N S S M d N + N G D N d 2 . M = N_{\mathrm{TF}}dW + N_{\mathrm{SSM}}dN + N_{\mathrm{GDN}}d^2. M = N TF d W + N SSM d N + N GDN d 2 .
Enforcing identical memory. When enforcing that each experiment uses the same allotted memory, we only modify W W W and N N N . The desired token dimension d d d is maintained. Additionally, the ratio W / N W/N W / N is roughly maintained so that a desired weight budget favoring one of these layer types over the other is reflected in the used parameters in the experiment.
When W W W and N N N are calibrated, they are always rounded down to stay under the required budget. However, we select memory budgets and token dimensions as powers of 2 so all experiments have precisely equal memory.
Additional Experiments
We provide some additional experiments covering other design decisions and further observations relevant to deeper hybrids.
We begin with results directly related to those in the main body. Those include experiments on the tasks with dominant two layer architectures with more memory and more experiments between dimensions that are powers of 2. We then include some experiments with DeltaNet hybrids, noting that the available design space is much more limited as the state is tied only to token dimension. Some other tasks are then investigated, including the TST tensor lookup task comparing all 3-layer hybrids as well as a task expected to be optimal for ST. This final task comes from prior work and confirms that the codebase does not only bias towards the TS architecture. Lastly, we investigate the results of 8-layer hybrids on two variants of associative recall. We also report their learning-rate sensitivities, noting that for these tasks, each of these architectures shows a surprisingly large range of usable learning rates.
Segmented Retrieval
In the main body, we showed the results for a sweep of token dimensions, windows, and state sizes. These experiments use token dimensions that are all powers of 2. We conducted additional experiments with more token dimensions, with results shown in Figure 6 . These are no longer powers of two and thus vary slightly in memory. However, the results still mimic those in the main body, where only the TS architecture performs the task.
Figure 6. Extended results for segmented retrieval.
These additional points also allow us to observe an interesting structure between the TT and TS architectures. The TT architecture attains its greatest average performance at a smaller token dimension and larger window than the TS architectures. These optima show a clear improvement in memory efficiency for TS architectures: the TS architectures use their allotted state to increase the computation per token instead of dedicating much of it to a large window to capture only some small components early in the sequence.
Different Quantities of Available Memory
We first showed a separation between hybrid architectures on segmented retrieval and exact copy using 512 dimensions of memory. We also test architectures with larger and small quantities of available memory.
The results for double the memory can be seen in Figure 7 . We still observe that the TS architecture is the highest-performing architecture. However, for exact copy, unlike the 512 memory experiments, the TT architecture gains significantly in performance at small token dimensions. This is likely due to the increased window compared to the main body, where dimension 8 only leaves a window of 128 now, which is large enough to capture most copied subsequences. For the segmented retrieval experiments, we observe that performance on all architectures increases compared to 512 dimensions of memory.
Figure 7. (a) The Segmented Retrieval task. (b) The Exact Copy task. Hybrid performance on exact copy for 1024 dimensions of memory.
Testing DeltaNet Hybrids
The majority of this work focuses on the Mamba SSM architecture. This architecture includes a state-expansion factor that allows the size of the state to be changed independently of other model parameters. This section describes an experiment conducted on hybrids of Transformer and Gated DeltaNet (GDN) layers.
An important note about Gated DeltaNet is that its state matrix, S t S_t S t , exists in R d × d \mathbb{R}^{d \times d} R d × d . This state size is tied to the token dimension. Thus, unlike the Transformer-Mamba hybrids where the window-to-state-size dimension was free, we can only modify the token dimension and window to achieve the desired memory.
The results are in Figure 10 . For the Transformer-Mamba hybrids, we fix the ratio of window to state-expansion to be 15 to 1, matching the highest performance seen across ratios. We observe the same behavior for Gated DeltaNet as with Mamba, with TS mirroring TG closely. However, due to the larger state size of GDN as compared to Mamba, larger token dimensions violate the memory constraints faster; hence, the TG and GT curves end earlier. This confirms that available inference memory is a core bottleneck across a couple of different SSM architectures.
Figure 10. Performance on segmented retrieval, including Gated DeltaNet (G) hybrids. Only the 15:1 ratio of window to SSM state for TS and ST hybrids is shown.
Figure 8. (a) The Segmented Retrieval task. (b) The Exact Copy task. Figure 8: Hybrid performance on exact copy for 256 dimensions of memory.
Three Layers - Tensor Lookup
As established by the theory about deeper hybrids, there is a natural tensor-lookup task that is predicted to have the TST architecture be dominant. We investigate this task empirically as well to test the results in a learned setting.
These experiments mirror closely to those for the two-layer architectures. The architectures used are also Transformers with RoPE and Mamba for the SSM. In these experiments, we also hold memory constant. However, we only test on one window-to-state-size ratio for each architecture: 15 to 1. The results are found in Figure 9 . As expected, the TST model performs the best, reaching an accuracy above 90%, unlike all competing architectures.
Figure 9. Results for training various architectures with different token dimensions on the TST task. All models used the same window size and state size. As expected, only the TST model attains a high accuracy.
We report the exact average performances from Figure 3 in Table 3. This table lists all possible 5-layer architectures. All models with the TST motif, with the exception of 1, performed better than the remaining models. All models were held to roughly the same memory of 6000. One additional takeaway from this table comes from the architectures of the form TS and ST . For the TS models, there is a bias towards more T layers, while for ST , there is a bias towards fewer S layers. Differences such as these support the need for a more principled understanding of various hybrid architecture designs.
An ST Task
In [6 ] , the selective copying task was used to show a separation in hybrid expressivity over pure model expressivity. Empirically, this task was shown to be better suited for ST rather than TS. To confirm that the code used does not artificially bias the TS architecture towards being the dominant architecture, we run the same suite of experiments as used for the 2-layer TS tasks.
The results are found in Figure 11 . We observe that the ST architectures do indeed achieve perfect performance on this task, while the other architectures do not. Thus, the codebase trains architectures in a way that can show various architectures as the highest performing.
Figure 11. Performance of architectures trained on selective copy. We observe that the ST architecture is largely dominant, as expected.
Beyond this confirmation, we observe some additional effects in their own right. First, the TF and SSM architectures plateau at different locations in the figure. In fact, the SSM Mamba continues to increase in
caption: Quantitative results for a deeper hybrids on the TST task. The left architectures contain TST as a sub-architecture, while the other three do not.
:::
performance as the dimension increases and the state expansion factor shrinks. Because of these different regimes of success for each of the component architectures, the hybrid architectures also have two local maxima in their performance curves. This may indicate that for the hybrids with larger token dimension and smaller window and state-expansion factor, the pure-SSM algorithm is favored. In the other regime with moderate token dimension, the TS architecture likely implements an algorithm not too different to the pure TF one.
Associative Recall Variants
We have focused on experiments pertaining to ( 2 , 1 ) (2, 1) ( 2 , 1 ) -AR as this mirrors a compressed version of multidocument tasks. However, we also want to consider the other variant of associative recall, namely ( 1 , 2 ) (1, 2) ( 1 , 2 ) -AR. This task instead has only ∣ V ∣ |V| ∣ V ∣ possible keys instead of ∣ V ∣ 2 |V|^2 ∣ V ∣ 2 , making the key space much easier for an SSM to store.
The results for both are shown in Figure 12 . The new variant of associative recall, ( 1 , 2 ) (1, 2) ( 1 , 2 ) -AR, shows on average a higher performance, likely due to the decreased size in the key space. However, we also see that the top-performing hybrid layer ordering is different for each task. While both tasks favor low Transformer-to-SSM ratios, ( 1 , 2 ) (1, 2) ( 1 , 2 ) recall sees stronger performance with more T-Layers than for ( 2 , 1 ) (2, 1) ( 2 , 1 ) -AR.
Figure 12. (a) Architecture sweep for the ( 2 , 1 ) (2,1) ( 2 , 1 ) -AR task. (b) Architecture sweep for the ( 1 , 2 ) (1,2) ( 1 , 2 ) -AR task. Token accuracy of T ∗ S ∗ T^*S^* T ∗ S ∗ and S ∗ T ∗ S^*T^* S ∗ T ∗ architectures on ( 2 , 1 ) (2,1) ( 2 , 1 ) associative recall. Small differences in architectures affect performance dramatically.
Learning Rate Sensitivity
Prior work has established that Mamba has a large learning rate sensitivity on the associative recall task [21 ] . As a result, we ran learning rate sweeps within our own codebase. The results can be seen in Figure 13 . Surprisingly, SSMs showed remarkable resilience to learning rate selection. However, other SSM-heavy architectures did show a very narrow band of learning rates that resulted in the highest performance.
Figure 13. (a) Sweep for (2, 1)-AR. (b) Sweep for (1, 2)-AR. Figure 13: Learning rate sweep for select architectures trained on associative recall.
However, the order of the different architectures’ optimal performances remains mostly intact when selecting a learning rate in the optimal band between 10 − 4 10^{-4} 1 0 − 4 and 10 − 3 10^{-3} 1 0 − 3 .
Proving Theorem 1
This section is dedicated to the needed machinery and proofs to prove Theorem 1. We begin with two lemmas from prior work that allow for neighboring layers of the same type to be combined. We then complete proofs for the two parts of Theorem 1: the first focuses on hybrids of the wrong order (Theorem 3, while the second focuses on hybrids of the correct order but with insufficient layers (Theorem 4).
Model Merge. We borrow two lemmas from prior work. These allow neighboring layers of common type to be combined.
Lemma 1 (Lemma 3.5 in [6 ] ). Consider a k k k -layer model M M M defined that is a composition of k k k state space layers S S M j \mathrm{SSM}_j SSM j , j ∈ [ k ] j \in[k] j ∈ [ k ] . There is a model S S M ′ \mathrm{SSM}' SSM ′ that only consists of a single layer S S M \mathrm{SSM} SSM , which behaves the same as M M M . In particular, denote the state space of S S M j \mathrm{SSM}_j SSM j as S j S_j S j , j ∈ [ k ] j \in[k] j ∈ [ k ] , and denote by the state space of S S M ′ \mathrm{SSM}' SSM ′ as S ′ S' S ′ , then ∣ S ′ ∣ ≤ ∏ j = 1 k ∣ S j ∣ \lvert S' \rvert\le\prod_{j=1}^{k} \lvert S_j \rvert ∣ S ′ ∣ ≤ ∏ j = 1 k ∣ S j ∣ .
Lemma 2. Consider a k k k -layer model M M M defined that is a composition of k k k causal windowed functions f j f_j f j , j ∈ [ k ] j \in[k] j ∈ [ k ] . There is a model M ′ M' M ′ that only consists of a single layer causal windowed function f f f , which behaves the same as M M M . In particular, denote the window size of f j f_j f j as W j W_j W j , j ∈ [ k ] j \in[k] j ∈ [ k ] , and denote by the window size of f f f as W W W , then W ′ ≤ ∑ j = 1 k W j − k + 1 W' \le\sum_{j=1}^{k} W_j - k + 1 W ′ ≤ ∑ j = 1 k W j − k + 1 .
Wrong use of ordering
We start with the case where a competitive model A A A does not contain comp ( τ ) \operatorname{comp}(\tau) comp ( τ ) as a subsequence.
Theorem 3. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ \tau= X_1^{r_1}X_2^{r_2}\cdots X_h^{r_h} \in\Sigma^* τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ be an arbitrary architecture profile with depth D = ∑ j = 1 h r j D = \sum_{j=1}^{h} r_j D = ∑ j = 1 h r j . Let α : = comp ( τ ) \alpha:= \operatorname{comp}(\tau) α := comp ( τ ) and ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) be an arbitrary fixed constant. There exist constants c τ > 0 c_\tau> 0 c τ > 0 , C τ , ϵ > 0 C_{\tau,\epsilon} > 0 C τ , ϵ > 0 , a family of tasks { F τ , ϵ , m } m ≥ 1 \{F_{\tau,\epsilon,m}\}_{m \ge1} { F τ , ϵ , m } m ≥ 1 and a family of distributions μ m \mu_m μ m over a sequence of tokens of length L m L_m L m parameterized by m ∈ N + m \in\mathbb{N}_{+} m ∈ N + , such that for all m m m sufficiently large, the following hold. Let A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D be an architecture profile with α ⪯̸ A \alpha\not\preceq A α ⪯ A . Then for every hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_A(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , F τ , ϵ , m ) ≤ 1 / 3 \operatorname{err}(M,F_{\tau,\epsilon,m}) \le1/3 err ( M , F τ , ϵ , m ) ≤ 1/3 , must satisfy W ≥ c τ m 1 / ϵ W \ge c_\tau m^{1/\epsilon} W ≥ c τ m 1/ ϵ or max { B , P } ≥ c τ m \max\{B,P\} \ge c_\tau m max { B , P } ≥ c τ m .
To begin with, we present the following model simplification lemma.
Lemma 3. Let τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ \tau= X_1^{r_1}X_2^{r_2}\cdots X_h^{r_h} \in\Sigma^* τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ be an arbitrary architecture with depth D D D and α = comp ( τ ) \alpha= \operatorname{comp}(\tau) α = comp ( τ ) . Denote by α ˉ = X ˉ 1 , … , X ˉ h \bar{\alpha} = \bar{X}_1,\ldots,\bar{X}_h α ˉ = X ˉ 1 , … , X ˉ h be the complementary of α \alpha α , where X ˉ i ≠ X i ∈ Σ \bar{X}_i \ne X_i \in\Sigma X ˉ i = X i ∈ Σ . Let A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D such that α ⪯̸ A \alpha\not\preceq A α ⪯ A , then comp ( A ) ⪯ α ˉ \operatorname{comp}(A) \preceq\bar{\alpha} comp ( A ) ⪯ α ˉ . Furthermore, for B , P , W ∈ N + B,P,W \in\mathbb{N}_{+} B , P , W ∈ N + , and M ∈ M A ( B , P , W ) M \in\mathcal{M}_A(B,P,W) M ∈ M A ( B , P , W ) , there exist a hybrid model M ′ M' M ′ in M α ˉ ( D B , P , D ( W − 1 ) ) \mathcal{M}_{\bar{\alpha}}(DB,P,D(W-1)) M α ˉ ( D B , P , D ( W − 1 )) that can represent M M M .
Proof of Lemma 3. Since α = X 1 , … , X k \alpha= X_1,\ldots,X_k α = X 1 , … , X k and comp ( A ) \operatorname{comp}(A) comp ( A ) is an alternating architecture profile, we consider two cases. In the first case, comp ( A ) \operatorname{comp}(A) comp ( A ) begins with X 1 X_1 X 1 . We claim that it must be the case where $\lvert\operatorname{comp}(A)\rvert \le k − 1 k-1 k − 1 , otherwise, α ⪯ comp ( A ) \alpha\preceq\operatorname{comp}(A) α ⪯ comp ( A ) . This implies that comp ( A ) \operatorname{comp}(A) comp ( A ) must be a substring of α ˉ \bar{\alpha} α ˉ , starting from the second layer. comp ( A ) ⪯ α ˉ \operatorname{comp}(A) \preceq\bar{\alpha} comp ( A ) ⪯ α ˉ . In the second case, comp ( A ) \operatorname{comp}(A) comp ( A ) start with X ˉ 1 \bar{X}_{1} X ˉ 1 . In this case, ∣ comp ( A ) ∣ ≤ k \lvert\operatorname{comp}(A)\rvert\leq k ∣ comp ( A )∣ ≤ k , otherwise α ⪯ comp ( A ) \alpha\preceq\operatorname{comp}(A) α ⪯ comp ( A ) . So, comp ( A ) ⪯ α ˉ \operatorname{comp}(A) \preceq\bar{\alpha} comp ( A ) ⪯ α ˉ .
Since comp ( A ) ⪯ α ˉ \operatorname{comp}(A) \preceq\bar{\alpha} comp ( A ) ⪯ α ˉ , the second part of Lemma 3 follows directly from Lemma 1 and Lemma 2.
Lemma 3 implies that instead of competing with an arbitrary architecture profile, it is sufficient to compete with hybrid models in M α ˉ ( D B , P , D ( W − 1 ) ) \mathcal{M}_{\bar{\alpha}}(DB,P,D(W-1)) M α ˉ ( D B , P , D ( W − 1 )) . A central part of our analysis is to characterize the format and dependence of information through different layers and at different positions.
Before proceeding, we first introduce some notations that we will use in the rest of the analysis to keep track of different types of layers. Let α ˉ = X ˉ 1 X ˉ 2 … X ˉ h \bar{\alpha}=\bar{X}_{1}\bar{X}_{2}\ldots\bar{X}_{h} α ˉ = X ˉ 1 X ˉ 2 … X ˉ h and M ′ ∈ M α ˉ ( D B , P , D ( W − 1 ) ) M'\in\mathcal{M}_{\bar{\alpha}}(DB,P,D(W-1)) M ′ ∈ M α ˉ ( D B , P , D ( W − 1 )) . Denote by k = { i ∈ [ h ] ∣ X ˉ i = S } k=\{i\in[h]\mid\bar{X}_{i}=S\} k = { i ∈ [ h ] ∣ X ˉ i = S } . We introduce indicator δ L = 1 { X ˉ 1 = T } \delta_{L}=\mathbf{1}\{\bar{X}_{1}=T\} δ L = 1 { X ˉ 1 = T } and δ R = 1 { X ˉ h = T } \delta_{R}=\mathbf{1}\{\bar{X}_{h}=T\} δ R = 1 { X ˉ h = T } . That is to say, we can write α ˉ = T 0 δ L S 1 T 1 , … , S k − 1 T k − 1 S k T k δ R \bar{\alpha}=T_{0}^{\delta_{L}}S_{1}T_{1},\ldots,S_{k-1}T_{k-1}S_{k}T_{k}^{\delta_{R}} α ˉ = T 0 δ L S 1 T 1 , … , S k − 1 T k − 1 S k T k δ R , where T 0 0 , T k 0 T_{0}^{0},T_{k}^{0} T 0 0 , T k 0 mean the corresponding boundary layers are absent. In particular, we have h = 2 k − 1 + δ L + δ R h=2k-1+\delta_{L}+\delta_{R} h = 2 k − 1 + δ L + δ R .
We introduce the family of tasks we are considering as well as the format of input.
Definition 5. Let X k e y \mathcal{X}_{key} X k ey be a finite space of keys, and C \mathcal{C} C be a finite space of vocabularies. Let ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) and m ∈ N + m\in\mathbb{N}_{+} m ∈ N + . Let τ \tau τ be an architecture profile with α ˉ = T 0 δ L S 1 T 1 , … , S k − 1 T k − 1 S k T k δ R \bar{\alpha}=T_{0}^{\delta_{L}}S_{1}T_{1},\ldots,S_{k-1}T_{k-1}S_{k}T_{k}^{\delta_{R}} α ˉ = T 0 δ L S 1 T 1 , … , S k − 1 T k − 1 S k T k δ R . A level-k k k recursive chain F τ , ϵ , m F_{\tau,\epsilon,m} F τ , ϵ , m is defined by a sequence of k k k functions. Specifically, for i ∈ [ k ] i\in[k] i ∈ [ k ] , H i ( z i − 1 , x i ) : X k e y × C m → X k e y H_{i}(z_{i-1},x_{i}):\mathcal{X}_{key}\times\mathcal{C}^{m}\to\mathcal{X}_{key} H i ( z i − 1 , x i ) : X k ey × C m → X k ey , where Z i : = H i ( z i − 1 , x i ) Z_{i}:=H_{i}(z_{i-1},x_{i}) Z i := H i ( z i − 1 , x i ) . Given a sequence of input I : = ( z 0 , 0 ⃗ 0 , x 1 , 0 ⃗ 1 , … , x k , 0 ⃗ k ) I:=(z_{0},\vec{0}_{0},x_{1},\vec{0}_{1},\ldots,x_{k},\vec{0}_{k}) I := ( z 0 , 0 0 , x 1 , 0 1 , … , x k , 0 k ) of length L m L_{m} L m , F τ , ϵ , m ( I ) : = z k F_{\tau,\epsilon,m}(I):=z_{k} F τ , ϵ , m ( I ) := z k , where each 0 ⃗ i \vec{0}_{i} 0 i is a sequence of 0 0 0 vectors.
Let Δ m : = D ⌊ m 1 / ϵ ⌋ \Delta_{m}:=D\lfloor m^{1/\epsilon}\rfloor Δ m := D ⌊ m 1/ ϵ ⌋ . We define position variables in the input sequence I I I . We consider two cases. If δ L = 0 \delta_{L}=0 δ L = 0 , we set u 1 = 2 u_{1}=2 u 1 = 2 , otherwise, we set u 1 = Δ m + 1 u_{1}=\Delta_{m}+1 u 1 = Δ m + 1 , v 1 = u 1 + m − 1 v_{1}=u_{1}+m-1 v 1 = u 1 + m − 1 and for i ≥ 1 i\geq1 i ≥ 1 , b i = v i + i Δ m b_{i}=v_{i}+i\Delta_{m} b i = v i + i Δ m , u i + 1 = b i + Δ m + 1 u_{i+1}=b_{i}+\Delta_{m}+1 u i + 1 = b i + Δ m + 1 , v i + 1 = u i + 1 + m − 1 v_{i+1}=u_{i+1}+m-1 v i + 1 = u i + 1 + m − 1 . Then, z 0 = I 1 z_{0}=I_{1} z 0 = I 1 , x i = I [ u i , v i ] x_{i}=I_{[u_{i},v_{i}]} x i = I [ u i , v i ] and the other positions of S S S are 0 0 0 . For the output position, if δ R = 1 \delta_{R}=1 δ R = 1 , we ask the output to be at b k b_{k} b k ; otherwise, o ⃗ k \vec{o}_{k} o k does not exist and we ask the output to be as v k v_{k} v k .
The input distribution μ m \mu_{m} μ m for I I I that we are considering samples an input sequence I I I by sample z 0 z_{0} z 0 and each x i x_{i} x i uniformly and independently from the domains.
We remark that Definition 5 immediately implies the existence of a model in M τ \mathcal{M}_{\tau} M τ that can efficiently solve the task exactly. To see this, we consider a model M M M with profile α = comp ( τ ) \alpha= \operatorname{comp}(\tau) α = comp ( τ ) , for every i ≥ 1 i \ge1 i ≥ 1 , since the window size of a T layer is m + 1 m+1 m + 1 , we use O τ ( log m ) O_{\tau}(\log m) O τ ( log m ) bits to feed ( ( z i − 1 , x i , 1 ) , … , ( z i − 1 , x i , m ) ) ((z_{i-1}, x_{i,1}), \ldots, (z_{i-1}, x_{i,m})) (( z i − 1 , x i , 1 ) , … , ( z i − 1 , x i , m )) to T, which is enough for it to compute z i z_i z i , precisely. This implies that if X k e y X_{\mathrm{key}} X key has size poly τ ( m ) \operatorname{poly}_{\tau}(m) poly τ ( m ) , then the next S-layer can use O τ ( log m ) O_{\tau}(\log m) O τ ( log m ) to feed ( ( z i , x i + 1 , 1 ) , … , ( z i , x i + 1 , m ) ) ((z_i, x_{i+1,1}), \ldots, (z_i, x_{i+1,m})) (( z i , x i + 1 , 1 ) , … , ( z i , x i + 1 , m )) to the next T and thus it can solve the task exactly. So, in the rest of the analysis we focus on the hardness part.
Given an input sequence I I I , we denote by Y ( j ) ( I ) Y^{(j)}(I) Y ( j ) ( I ) the intermediate input of T j \mathrm{T}_j T j and denote by h j ( t ; I ) h_j(t; I) h j ( t ; I ) the internal state of S j \mathrm{S}_j S j after processing position t t t . By Lemma 3, we without loss of generality assume that h j ( t ; I ) ∈ { 0 , 1 } D B h_j(t; I) \in\{0,1\}^{DB} h j ( t ; I ) ∈ { 0 , 1 } D B . Based on the notation of Definition 1, for 0 ≤ j ≤ i 0 \le j \le i 0 ≤ j ≤ i , we define position a i j = v i + j Δ m a_{ij} = v_i + j\Delta_m a ij = v i + j Δ m . In particular, a i 0 = v i a_{i0} = v_i a i 0 = v i and a i i = b i a_{ii} = b_i a ii = b i . We define the state record at stage i i i with input I I I as
C i ( I ) : = ( h 1 ( a i 1 ; I ) , h 2 ( a i 2 ; I ) , … , h i ( a i i ; I ) ) . C_i(I) := (h_1(a_{i1}; I), h_2(a_{i2}; I), \ldots, h_i(a_{ii}; I)). C i ( I ) := ( h 1 ( a i 1 ; I ) , h 2 ( a i 2 ; I ) , … , h i ( a ii ; I )) .
Our first lemma shows that if C i C_i C i is fixed, then for every ℓ > b i \ell> b_i ℓ > b i , Y ℓ ( i ) Y^{(i)}_{\ell} Y ℓ ( i ) is only a deterministic function of the parts of the input after b i b_i b i .
Lemma 4. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ \tau= X^{r_1}_1 X^{r_2}_2 \cdots X^{r_h}_h \in\Sigma^* τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ be an arbitrary architecture with α = comp ( τ ) \alpha= \operatorname{comp}(\tau) α = comp ( τ ) and depth D D D . Denote by α ˉ = X ˉ 1 , … , X ˉ h \bar{\alpha} = \bar{X}_1, \ldots, \bar{X}_h α ˉ = X ˉ 1 , … , X ˉ h be the complementary of α \alpha α , where X ˉ i ≠ X i ∈ Σ \bar{X}_i \ne X_i \in\Sigma X ˉ i = X i ∈ Σ . Let M ′ ∈ M α ˉ ( D B , P , D ( W − 1 ) ) M' \in\mathcal{M}_{\bar{\alpha}}(DB, P, D(W-1)) M ′ ∈ M α ˉ ( D B , P , D ( W − 1 )) be a hybrid model. Let I , I ′ I, I' I , I ′ be two sequences of inputs of the level-k k k recursive chain F τ , ϵ , m F_{\tau,\epsilon,m} F τ , ϵ , m and let i ∈ [ k ] i \in[k] i ∈ [ k ] . Suppose that I ℓ = I ℓ ′ I_{\ell} = I'_{\ell} I ℓ = I ℓ ′ , for every ℓ > v i \ell> v_i ℓ > v i and C i ( I ) = C i ( I ′ ) C_i(I) = C_i(I') C i ( I ) = C i ( I ′ ) , then for every j ∈ [ i ] j \in[i] j ∈ [ i ] and for every ℓ > a i j \ell> a_{ij} ℓ > a ij , Y ( j ) ( I ) ℓ = Y ( j ) ( I ′ ) ℓ Y^{(j)}(I)_{\ell} = Y^{(j)}(I')_{\ell} Y ( j ) ( I ) ℓ = Y ( j ) ( I ′ ) ℓ , and for every ℓ ≥ a i j \ell\ge a_{ij} ℓ ≥ a ij , h j ( ℓ ; I ) = h j ( ℓ ; I ′ ) h_j(\ell; I) = h_j(\ell; I') h j ( ℓ ; I ) = h j ( ℓ ; I ′ ) .
Proof of Lemma 4. We prove the statement by induction. For j = 1 j = 1 j = 1 , we consider two cases. In the first case, δ L = 0 \delta_L = 0 δ L = 0 , which implies that α ˉ \bar{\alpha} α ˉ begins with S1 _1 1 . In this case, the states of h 1 h_1 h 1 only depend on the past states and input and thus we have for every ℓ ≥ a i 1 \ell\ge a_{i1} ℓ ≥ a i 1 h 1 ( ℓ ; I ) = h 1 ( ℓ ; I ′ ) h_1(\ell; I) = h_1(\ell; I') h 1 ( ℓ ; I ) = h 1 ( ℓ ; I ′ ) . In the second case, α ˉ \bar{\alpha} α ˉ begins with T0 _0 0 S1 _1 1 . By the choice of Δ m \Delta_m Δ m , for every ℓ > v i + Δ m = a i 1 \ell> v_i + \Delta_m = a_{i1} ℓ > v i + Δ m = a i 1 , T 0 ( I ) ℓ = T 0 ( I ′ ) ℓ \mathrm{T}_0(I)_{\ell} = \mathrm{T}_0(I')_{\ell} T 0 ( I ) ℓ = T 0 ( I ′ ) ℓ , which implies that h 1 ( ℓ ; I ) = h 1 ( ℓ ; I ′ ) h_1(\ell; I) = h_1(\ell; I') h 1 ( ℓ ; I ) = h 1 ( ℓ ; I ′ ) . The results for the states automatically translate to the results for Y ( 1 ) Y^{(1)} Y ( 1 ) .
Now suppose the statement holds for j j j . We prove it for the case of j + 1 j+1 j + 1 . Since the window size of a transformer layer is at most Δ m \Delta_m Δ m , we know that the input of T j \mathrm{T}_j T j only depends on positions after a i j a_{ij} a ij when evaluating after a i ( j + 1 ) a_{i(j+1)} a i ( j + 1 ) . Since for every ℓ > a i j \ell> a_{ij} ℓ > a ij , Y ( j ) ( I ) ℓ = Y ( j ) ( I ′ ) ℓ Y^{(j)}(I)_{\ell} = Y^{(j)}(I')_{\ell} Y ( j ) ( I ) ℓ = Y ( j ) ( I ′ ) ℓ , we know that T j ( Y ( j ) ( I ) ) ℓ = T j ( Y ( j ) ( I ′ ) ) ℓ \mathrm{T}_j(Y^{(j)}(I))_{\ell} = \mathrm{T}_j(Y^{(j)}(I'))_{\ell} T j ( Y ( j ) ( I ) ) ℓ = T j ( Y ( j ) ( I ′ ) ) ℓ for ℓ > a i ( j + 1 ) \ell> a_{i(j+1)} ℓ > a i ( j + 1 ) . On the other hand, since for every ℓ > a i j \ell> a_{ij} ℓ > a ij , h j ( ℓ ; I ) = h j ( ℓ ; I ′ ) h_j(\ell; I) = h_j(\ell; I') h j ( ℓ ; I ) = h j ( ℓ ; I ′ ) , we know that for every ℓ > a i ( j + 1 ) \ell> a_{i(j+1)} ℓ > a i ( j + 1 ) , h j + 1 ( ℓ ; I ) = h j + 1 ( ℓ ; I ′ ) h_{j+1}(\ell; I) = h_{j+1}(\ell; I') h j + 1 ( ℓ ; I ) = h j + 1 ( ℓ ; I ′ ) and thus Y ( j + 1 ) ( I ) ℓ = Y ( j + 1 ) ( I ′ ) ℓ Y^{(j+1)}(I)_{\ell} = Y^{(j+1)}(I')_{\ell} Y ( j + 1 ) ( I ) ℓ = Y ( j + 1 ) ( I ′ ) ℓ .
Next, we characterize the evolution of C i C_i C i when i i i increases. i.e how the record of the hidden states of each SSM layer changes according to the position.
Lemma 5. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ \tau= X^{r_1}_1 X^{r_2}_2 \cdots X^{r_h}_h \in\Sigma^* τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ ∗ be an arbitrary architecture with α = comp ( τ ) \alpha= \operatorname{comp}(\tau) α = comp ( τ ) and depth D D D . Denote by α ˉ = X ˉ 1 , … , X ˉ h \bar{\alpha} = \bar{X}_1, \ldots, \bar{X}_h α ˉ = X ˉ 1 , … , X ˉ h be the complementary of α \alpha α , where X ˉ i ≠ X i ∈ Σ \bar{X}_i \ne X_i \in\Sigma X ˉ i = X i ∈ Σ . Let M ′ ∈ M α ˉ ( D B , P , D ( W − 1 ) ) M' \in\mathcal{M}_{\bar{\alpha}}(DB, P, D(W-1)) M ′ ∈ M α ˉ ( D B , P , D ( W − 1 )) be a hybrid model. Let I I I be an input of a level-k k k recursive chain, realized by ( z 0 , x 1 , … , x k ) (z_0,x_1,\ldots,x_k) ( z 0 , x 1 , … , x k ) . Denote by J i J_i J i the prefix ( z 0 , x 1 , … , x i ) (z_0,x_1,\ldots,x_i) ( z 0 , x 1 , … , x i ) . For every i ∈ [ k − 1 ] i \in[k-1] i ∈ [ k − 1 ] and for every c c c such that C i ( I ) = c C_i(I) = c C i ( I ) = c , there exists a map H i , c : C i m → { 0 , 1 } D B H_{i,c}: C^m_{i} \to\{0,1\}^{DB} H i , c : C i m → { 0 , 1 } D B , E i , c : C i m → C i + 1 m E_{i,c}: C^m_{i} \to C^m_{i+1} E i , c : C i m → C i + 1 m , Φ h i + 1 ( u i + 1 − 1 ; I ) : C i + 1 − u i + 1 + 1 b i → { 0 , 1 } D B \Phi_{h_{i+1}(u_{i+1}-1;I)}: C^{b_i}_{i+1-u_{i+1}+1} \to\{0,1\}^{DB} Φ h i + 1 ( u i + 1 − 1 ; I ) : C i + 1 − u i + 1 + 1 b i → { 0 , 1 } D B such that ( h 1 ( a i + 1 , 1 ; I ) , h 2 ( a i + 1 , 2 ; I ) , … , h i ( a i + 1 , i ; I ) ) = H i , c ( x i + 1 ) (h_1(a_{i+1,1}; I), h_2(a_{i+1,2}; I), \ldots, h_i(a_{i+1,i}; I)) = H_{i,c}(x_{i+1}) ( h 1 ( a i + 1 , 1 ; I ) , h 2 ( a i + 1 , 2 ; I ) , … , h i ( a i + 1 , i ; I )) = H i , c ( x i + 1 ) and h i + 1 ( a i + 1 ( i + 1 ) ; I ) = Φ h i + 1 ( u i + 1 − 1 ; J i ) ( E i , c ( x i + 1 ) ) h_{i+1}(a_{i+1(i+1)}; I) = \Phi_{h_{i+1}(u_{i+1}-1;J_i)}(E_{i,c}(x_{i+1})) h i + 1 ( a i + 1 ( i + 1 ) ; I ) = Φ h i + 1 ( u i + 1 − 1 ; J i ) ( E i , c ( x i + 1 )) .
In other words, once we have fixed the prefix of the input J i J_i J i as well as the value of C i ( I ) C_i(I) C i ( I ) , there exists maps H i , c , E i , c H_{i,c}, E_{i,c} H i , c , E i , c that only depends on the compressed information C i ( I ) C_i(I) C i ( I ) and a map Φ h i + 1 ( u i + 1 − 1 ; I ) \Phi_{h_{i+1}(u_{i+1}-1;I)} Φ h i + 1 ( u i + 1 − 1 ; I ) that only depends on the state h i + 1 ( u i + 1 − 1 ; I ) h_{i+1}(u_{i+1}-1;I) h i + 1 ( u i + 1 − 1 ; I ) such that C i + 1 ( I ) = ( H i , c ( x i + 1 ) , Φ h i + 1 ( u i + 1 − 1 ; I ) ( E i , c ) ( x i + 1 ) ) C_{i+1}(I)=(H_{i,c}(x_{i+1}),\Phi_{h_{i+1}(u_{i+1}-1;I)}(E_{i,c})(x_{i+1})) C i + 1 ( I ) = ( H i , c ( x i + 1 ) , Φ h i + 1 ( u i + 1 − 1 ; I ) ( E i , c ) ( x i + 1 )) . To simplify the notation, for any fixed i i i , c c c and h i + 1 ( u i + 1 − 1 ; I ) = γ h_{i+1}(u_{i+1}-1;I)=\gamma h i + 1 ( u i + 1 − 1 ; I ) = γ , we denote by C i + 1 ( I ) = Γ i , c , γ ( x i + 1 ) C_{i+1}(I)=\Gamma_{i,c,\gamma}(x_{i+1}) C i + 1 ( I ) = Γ i , c , γ ( x i + 1 ) .
Proof of Lemma 5. We start by proving the existence of H i , c H_{i,c} H i , c . By Lemma 4, we know that once we fix C i ( I ) = c C_i(I)=c C i ( I ) = c , for every j ≤ i j\le i j ≤ i and for every ℓ ≥ a i j \ell\ge a_{ij} ℓ ≥ a ij , the hidden state h j ( ℓ , I ) h_j(\ell,I) h j ( ℓ , I ) is only a function of x i + 1 x_{i+1} x i + 1 . This implies that the vector ( h 1 ( a ( i + 1 ) 1 ; I ) , h 2 ( a ( i + 1 ) 2 ; I ) , … , h i ( a ( i + 1 ) i ; I ) ) (h_1(a_{(i+1)1};I),h_2(a_{(i+1)2};I),\ldots,h_i(a_{(i+1)i};I)) ( h 1 ( a ( i + 1 ) 1 ; I ) , h 2 ( a ( i + 1 ) 2 ; I ) , … , h i ( a ( i + 1 ) i ; I )) only depends on x i + 1 x_{i+1} x i + 1 , given the current state C i ( J i ) C_i(J_i) C i ( J i ) .
We next prove the existence of Φ J i \Phi_{J_i} Φ J i and E i , c E_{i,c} E i , c . We notice that the state h i + 1 ( a ( i + 1 ) ( i + 1 ) ; I ) h_{i+1}(a_{(i+1)(i+1)};I) h i + 1 ( a ( i + 1 ) ( i + 1 ) ; I ) is a function of the state h i + 1 ( b i , I ) h_{i+1}(b_i,I) h i + 1 ( b i , I ) and the input context T i ( Y ( i ) ( I ) ) T_i(Y^{(i)}(I)) T i ( Y ( i ) ( I )) . In particular, if we denote by δ \delta δ the transition function of the state of S i + 1 S_{i+1} S i + 1 . Then, it holds that for j ≥ 0 j\ge0 j ≥ 0 , we have h i + 1 ( u i + 1 + j ; I ) = δ ( h i + 1 ( u i + 1 + j − 1 ; I ) , T i ( Y ( i ) ( I ) ) u i + 1 + j ) h_{i+1}(u_{i+1}+j;I)=\delta(h_{i+1}(u_{i+1}+j-1;I),T_i(Y^{(i)}(I))_{u_{i+1}+j}) h i + 1 ( u i + 1 + j ; I ) = δ ( h i + 1 ( u i + 1 + j − 1 ; I ) , T i ( Y ( i ) ( I ) ) u i + 1 + j ) .
By Lemma 4, we know that for ℓ > a i i \ell>a_{ii} ℓ > a ii , Y ( i ) ( I ) ℓ Y^{(i)}(I)_\ell Y ( i ) ( I ) ℓ is a function that only depends on x i + 1 x_{i+1} x i + 1 . This implies that given C i = c C_i=c C i = c , T i ( Y ( i ) ( I ) ) u i + 1 + j T_i(Y^{(i)}(I))_{u_{i+1}+j} T i ( Y ( i ) ( I ) ) u i + 1 + j , for j = 0 , … , b i − v i j=0,\ldots,b_i-v_i j = 0 , … , b i − v i only depends on x i + 1 x_{i+1} x i + 1 , while the state h i + 1 ( u i + 1 − 1 ; I ) h_{i+1}(u_{i+1}-1;I) h i + 1 ( u i + 1 − 1 ; I ) can depend on the entire prefix J i J_i J i . This implies that there exist maps E i , c : C m → C b i + 1 − u i + 1 + 1 E_{i,c}:\mathcal{C}^m\to\mathcal{C}^{b_{i+1}-u_{i+1}+1} E i , c : C m → C b i + 1 − u i + 1 + 1 , Φ h i + 1 ( u i + 1 − 1 ; I ) : C b i + 1 − u i + 1 + 1 → { 0 , 1 } D B \Phi_{h_{i+1}(u_{i+1}-1;I)}:\mathcal{C}^{b_{i+1}-u_{i+1}+1}\to\{0,1\}^{DB} Φ h i + 1 ( u i + 1 − 1 ; I ) : C b i + 1 − u i + 1 + 1 → { 0 , 1 } D B such that h i + 1 ( a ( i + 1 ) ( i + 1 ) ; I ) = Φ h i + 1 ( u i + 1 − 1 ; I ) ( E i , c ( x i + 1 ) ) h_{i+1}(a_{(i+1)(i+1)};I)=\Phi_{h_{i+1}(u_{i+1}-1;I)}(E_{i,c}(x_{i+1})) h i + 1 ( a ( i + 1 ) ( i + 1 ) ; I ) = Φ h i + 1 ( u i + 1 − 1 ; I ) ( E i , c ( x i + 1 )) .
Based on Lemma 4 and Lemma 5, we now give the construction for the functions H i H_i H i that we are using. Our construction follows the following intuition. By Lemma 4 and Lemma 5, conditioned over C i C_i C i and J i J_i J i , the behavior of the model is a fixed function of x i + 1 x_{i+1} x i + 1 . In particular, the total number of such functions can be bounded. Since each x i x_i x i is drawn uniformly at random, assuming for the time that the model succeed with a good probability at the next stage only if the true key z i + 1 z_{i+1} z i + 1 falls into a small list of candidates of length l l l , we will next show that by carefully choosing the size of X k e y \mathcal{X}_{key} X k ey , there must be some Boolean function H H H such that no matter which function in the class is chosen, there are also at most l l l possible z i z_i z i that makes z i + 1 z_{i+1} z i + 1 fall into the list with a good probability. This implies that if we sequentially choose all the H i H_i H i based on this, then the model finally will only have a small probability to succeed.
To start with, we first show that for a single step such a function H i H_i H i exists. Using a probabilistic construction, we show the following lemma.
Lemma 6. Let K , X , Q , A \mathcal{K},\mathcal{X},\mathcal{Q},\mathcal{A} K , X , Q , A be finite sets. Denote by N = ∣ K ∣ N=|\mathcal{K}| N = ∣ K ∣ and n = ∣ X ∣ n=|\mathcal{X}| n = ∣ X ∣ . Let G : A × X → Q \mathcal{G}:\mathcal{A}\times\mathcal{X}\to\mathcal{Q} G : A × X → Q be a finite set of maps. For l ∈ [ N ] l\in[N] l ∈ [ N ] , let L l = { L : Q → 2 K ∣ ∣ L ( q ) ∣ ≤ l , ∀ q ∈ Q } \mathcal{L}_l=\{L:\mathcal{Q}\to2^{\mathcal{K}}\mid|L(q)|\le l,\ \forall q\in\mathcal{Q}\} L l = { L : Q → 2 K ∣ ∣ L ( q ) ∣ ≤ l , ∀ q ∈ Q } . For θ ∈ ( 0 , 1 ) \theta\in(0,1) θ ∈ ( 0 , 1 ) , if
( N l + 1 ) ∣ G ∣ ∣ L l ∣ [ ( n θ n ) ( l / N ) θ n ] l + 1 < 1 , \binom{N}{l+1}|\mathcal{G}||\mathcal{L}_l|\left[\binom{n}{\theta n}(l/N)^{\theta n}\right]^{l+1}<1, ( l + 1 N ) ∣ G ∣∣ L l ∣ [ ( θ n n ) ( l / N ) θ n ] l + 1 < 1 , then there exists a map H : K × X → K H:\mathcal{K}\times\mathcal{X}\to\mathcal{K} H : K × X → K such that for every G ∈ G G\in\mathcal{G} G ∈ G and every L ∈ L l L\in\mathcal{L}_l L ∈ L l the set
B ( G , L ) : = { z ∈ K ∣ ∃ a ∈ A , Pr x ∼ U ( X ) [ H ( z , x ) ∈ L ( G ( a , x ) ) ] ≥ θ } B(G,L):=\{z\in\mathcal{K}\mid\exists a\in\mathcal{A},\ \Pr_{x\sim\mathcal{U}(\mathcal{X})}[H(z,x)\in L(G(a,x))]\ge\theta\} B ( G , L ) := { z ∈ K ∣ ∃ a ∈ A , x ∼ U ( X ) Pr [ H ( z , x ) ∈ L ( G ( a , x ))] ≥ θ } has cardinality at most l l l .
Proof of Lemma 6. Fix z ∈ K , G ∈ G , L ∈ L l , a ∈ A z\in\mathcal{K},G\in\mathcal{G},L\in\mathcal{L}_l,a\in\mathcal{A} z ∈ K , G ∈ G , L ∈ L l , a ∈ A . We choose H H H from all possible maps uniformly at random. Since for each x ∈ X x\in\mathcal{X} x ∈ X , the list L ( G ( a , x ) ) L(G(a,x)) L ( G ( a , x )) has size at most l l l , we have
Pr H [ H ( z , x ) ∈ L ( G ( a , x ) ) ] ≤ l / N . \Pr_H[H(z,x)\in L(G(a,x))]\le l/N. H Pr [ H ( z , x ) ∈ L ( G ( a , x ))] ≤ l / N .
By taking a union bound over X \mathcal{X} X , we have
Pr H { H : Pr x ∼ U ( X ) [ H ( z , x ) ∈ L ( G ( a , x ) ) ] ≥ θ } ≤ ∑ r ≥ θ n ( n r ) ( l / N ) r ≤ 2 n ( l / N ) θ n . \Pr_H\left\{H:\Pr_{x\sim\mathcal{U}(\mathcal{X})}[H(z,x)\in L(G(a,x))]\ge\theta\right\}\le\sum_{r\ge\theta n}\binom{n}{r}(l/N)^r\le2^n(l/N)^{\theta n}. H Pr { H : x ∼ U ( X ) Pr [ H ( z , x ) ∈ L ( G ( a , x ))] ≥ θ } ≤ r ≥ θ n ∑ ( r n ) ( l / N ) r ≤ 2 n ( l / N ) θ n .
Now we take a union bound over A \mathcal{A} A , for every fixed z ∈ K z \in\mathcal{K} z ∈ K we have
Pr H [ z ∈ B ( G , L ) ] ≤ ∣ A ∣ 2 n ( l / N ) θ n . \Pr_{H}[z \in B(G,\mathcal{L})] \leq|\mathcal{A}|^{2n}(l/N)^{\theta n}. H Pr [ z ∈ B ( G , L )] ≤ ∣ A ∣ 2 n ( l / N ) θ n .
Now we consider the probability that a bad event happens over the randomization of the choice of H H H , which means there exists l + 1 l+1 l + 1 possible values in B ( G , L ) B(G,\mathcal{L}) B ( G , L ) . Fix a list of l + 1 l+1 l + 1 value z ( 1 ) , … , z ( l + 1 ) z^{(1)},\ldots,z^{(l+1)} z ( 1 ) , … , z ( l + 1 ) , since the events z ( i ) ∈ B ( G , L ) z^{(i)} \in B(G,\mathcal{L}) z ( i ) ∈ B ( G , L ) only depend on the function H ( z ( i ) , ⋅ ) H(z^{(i)},\cdot) H ( z ( i ) , ⋅ ) and are independent, we know that
Pr H [ z ( 1 ) , … , z ( l + 1 ) ∈ B ( G , L ) ] ≤ ( ∣ A ∣ 2 n ( l / N ) θ n ) l + 1 . \Pr_{H}[z^{(1)},\ldots,z^{(l+1)} \in B(G,\mathcal{L})] \leq(|\mathcal{A}|^{2n}(l/N)^{\theta n})^{l+1}. H Pr [ z ( 1 ) , … , z ( l + 1 ) ∈ B ( G , L )] ≤ ( ∣ A ∣ 2 n ( l / N ) θ n ) l + 1 .
We now take the union bound of G G G , L \mathcal{L} L and all possible tuples z ( 1 ) , … , z ( l + 1 ) z^{(1)},\ldots,z^{(l+1)} z ( 1 ) , … , z ( l + 1 ) , the assumption of Lemma 6 implies that the probability that we choose an H H H that creates some B ( G , L ) B(G,\mathcal{L}) B ( G , L ) with size more than l l l is strictly less than 1. This implies the existence of H H H that satisfies the statement of Lemma 6.
We next fit Lemma 6 into our framework using Lemma 4 and Lemma 5.
Lemma 7. For ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) , let r ϵ = ⌊ ( 1 / ϵ ) ⌋ + 3 r_{\epsilon}=\lfloor(1/\epsilon)\rfloor+3 r ϵ = ⌊( 1/ ϵ )⌋ + 3 , N m = m 2 r ϵ N_m=m^{2r_{\epsilon}} N m = m 2 r ϵ , l m = m r ϵ l_m=m^{r_{\epsilon}} l m = m r ϵ and let X k e y = [ N m ] \mathcal{X}_{\mathrm{key}}=[N_m] X key = [ N m ] . For all sufficiently large m m m , there exist functions H 1 , … , H k : X k e y × C m → X k e y H_1,\ldots,H_k:\mathcal{X}_{\mathrm{key}}\times\mathcal{C}^m\to\mathcal{X}_{\mathrm{key}} H 1 , … , H k : X key × C m → X key such that for every M ∈ M α ˉ ( D B , P , D ( W − 1 ) ) M\in\mathcal{M}_{\bar{\alpha}}(DB,P,D(W-1)) M ∈ M α ˉ ( D B , P , D ( W − 1 )) , an arbitrary hybrid model that satisfies B , P < c τ m B,P<c_{\tau}m B , P < c τ m and W < c τ m 1 / ϵ W<c_{\tau}m^{1/\epsilon} W < c τ m 1/ ϵ , c τ ≪ 1 c_{\tau}\ll1 c τ ≪ 1 a constant, the follows hold. Fix a level 0 ≤ i < k 0\leq i<k 0 ≤ i < k and c = C i c=C_i c = C i , for every L : Im ( C i + 1 ) → 2 X k e y \mathcal{L}:\operatorname{Im}(C_{i+1})\to2^{\mathcal{X}_{\mathrm{key}}} L : Im ( C i + 1 ) → 2 X key such that ∣ L ( c ′ ) ∣ ≤ l m |\mathcal{L}(c')|\leq l_m ∣ L ( c ′ ) ∣ ≤ l m for all c ′ ∈ Im ( C i + 1 ) c'\in\operatorname{Im}(C_{i+1}) c ′ ∈ Im ( C i + 1 ) , the set { z ∈ X k e y ∣ ∃ γ ∈ { 0 , 1 } D B , Pr x i + 1 ∼ C m [ H i + 1 ( z , x i + 1 ) ∈ L ( Γ i , c , γ ( x i + 1 ) ) ] ≥ 1 / ( 4 k ) } \{z\in\mathcal{X}_{\mathrm{key}}\mid\exists\gamma\in\{0,1\}^{DB},\Pr_{x_{i+1}\sim\mathcal{C}^m}[H_{i+1}(z,x_{i+1})\in\mathcal{L}(\Gamma_{i,c,\gamma}(x_{i+1}))]\geq1/(4k)\} { z ∈ X key ∣ ∃ γ ∈ { 0 , 1 } D B , Pr x i + 1 ∼ C m [ H i + 1 ( z , x i + 1 ) ∈ L ( Γ i , c , γ ( x i + 1 ))] ≥ 1/ ( 4 k )} has size at most l m l_m l m .
Proof of Lemma 7. We apply Lemma 6 to prove Lemma 7. Let K : = X k e y \mathcal{K}:=\mathcal{X}_{\mathrm{key}} K := X key , N = N m N=N_m N = N m and X = C m \mathcal{X}=\mathcal{C}^m X = C m , n = ∣ C ∣ m n=|\mathcal{C}|^m n = ∣ C ∣ m , ∣ C ∣ ≥ 2 |\mathcal{C}|\geq2 ∣ C ∣ ≥ 2 . Let A = { 0 , 1 } D B \mathcal{A}=\{0,1\}^{DB} A = { 0 , 1 } D B be the state space of S i + 1 S_{i+1} S i + 1 and Q = Im ( C i + 1 ) Q=\operatorname{Im}(C_{i+1}) Q = Im ( C i + 1 ) . Define the collection of map G = { G i , c ( γ , x i + 1 ) = Γ i , c , γ ( x i + 1 ) ∣ c ∈ Im ( C i ) } \mathcal{G}=\{G_{i,c}(\gamma,x_{i+1})=\Gamma_{i,c,\gamma}(x_{i+1})\mid c\in\operatorname{Im}(C_i)\} G = { G i , c ( γ , x i + 1 ) = Γ i , c , γ ( x i + 1 ) ∣ c ∈ Im ( C i )} . l = l m l=l_m l = l m and θ = 1 / ( 4 k ) \theta=1/(4k) θ = 1/ ( 4 k ) . We show that these choices of parameters satisfy the assumption of Lemma 6.
We first bound the size of G \mathcal{G} G . By Lemma 5, we know that Γ i , c , γ = ( H i , c ( x i + 1 ) , Φ γ ( E i , c ( x i + 1 ) ) ) \Gamma_{i,c,\gamma}=(H_{i,c}(x_{i+1}),\Phi_{\gamma}(E_{i,c}(x_{i+1}))) Γ i , c , γ = ( H i , c ( x i + 1 ) , Φ γ ( E i , c ( x i + 1 ))) . We count all possible H i , c H_{i,c} H i , c , E i , c E_{i,c} E i , c , Φ γ \Phi_{\gamma} Φ γ . Since the total number of output bits of H i , c H_{i,c} H i , c is at most i D B iDB i D B , we know that there are at most 2 i D B n 2^{iDBn} 2 i D B n possible H i , c H_{i,c} H i , c . Similarly, denote by s i + 1 : = b i + 1 − u i + 1 + 1 = ( i + 1 ) Δ m + m s_{i+1}:=b_{i+1}-u_{i+1}+1=(i+1)\Delta m+m s i + 1 := b i + 1 − u i + 1 + 1 = ( i + 1 ) Δ m + m , then the total number of output bits of E i , c E_{i,c} E i , c is s i + 1 P s_{i+1}P s i + 1 P and thus there are at most 2 s i + 1 P n 2^{s_{i+1}Pn} 2 s i + 1 P n many E i , c E_{i,c} E i , c . Finally, Φ \Phi Φ is determined by the state transition function δ : { 0 , 1 } D B × { 0 , 1 } P → × { 0 , 1 } D B \delta:\{0,1\}^{DB}\times\{0,1\}^{P}\to\times\{0,1\}^{DB} δ : { 0 , 1 } D B × { 0 , 1 } P → × { 0 , 1 } D B and has at most 2 D B 2 D B + P 2^{DB2^{DB+P}} 2 D B 2 D B + P many possibilities. So the total number of Φ \Phi Φ is at most 2 s i + 1 D B 2 D B + P 2^{s_{i+1}DB2^{DB+P}} 2 s i + 1 D B 2 D B + P . This gives
log ( ∣ G ∣ ) ≤ n ( i D B + s i + 1 P ) + s i + 1 D B 2 D B + P ≤ ∣ C ∣ m ( k m 2 + m 1 / ϵ + 1 ) + k 2 3 c τ m m 1 / ϵ + 2 = o ( r ϵ log m ( m r ϵ + 1 ) ∣ C ∣ m / ( 4 k ) ) . \begin{aligned}
\log(|\mathcal{G}|)&\leq n(iDB+s_{i+1}P)+s_{i+1}DB2^{DB+P}\\
&\leq|\mathcal{C}|^m(km^2+m^{1/\epsilon+1})+k2^{3c_{\tau}m}m^{1/\epsilon+2}\\
&=o(r_{\epsilon}\log m(m^{r_{\epsilon}}+1)|\mathcal{C}|^m/(4k)).
\end{aligned} log ( ∣ G ∣ ) ≤ n ( i D B + s i + 1 P ) + s i + 1 D B 2 D B + P ≤ ∣ C ∣ m ( k m 2 + m 1/ ϵ + 1 ) + k 2 3 c τ m m 1/ ϵ + 2 = o ( r ϵ log m ( m r ϵ + 1 ) ∣ C ∣ m / ( 4 k )) .
Next, we upper bound the total number of list functions. For any fix q ∈ Q q\in Q q ∈ Q , the number of subsets of ∣ K ∣ |\mathcal{K}| ∣ K ∣ with size at most l l l is ∑ j = 0 ∣ K ∣ ( ∣ K ∣ j ) ≤ ( l + 1 ) ( e N / l ) l \sum_{j=0}^{|\mathcal{K}|}\binom{|\mathcal{K}|}{j}\leq(l+1)(eN/l)^l ∑ j = 0 ∣ K ∣ ( j ∣ K ∣ ) ≤ ( l + 1 ) ( e N / l ) l . This gives the total number list functions is at most ( ( l m + 1 ) ( e N m / l m ) l m ) ∣ Q ∣ ((l_m+1)(eN_m/l_m)^{l_m})^{|Q|} (( l m + 1 ) ( e N m / l m ) l m ) ∣ Q ∣ . In particular, by taking the logarithm, we have
log ( ( ( l m + 1 ) ( e N m / l m ) l m ) ∣ Q ∣ ) = ∣ Q ∣ log ( l m + 1 ) + l m ∣ Q ∣ log ( e N m / l m ) = o ( r ϵ log m ( m r ϵ + 1 ) ∣ C ∣ m / ( 4 k ) ) . \log(((l_m+1)(eN_m/l_m)^{l_m})^{|Q|})=|Q|\log(l_m+1)+l_m|Q|\log(eN_m/l_m)=o(r_{\epsilon}\log m(m^{r_{\epsilon}}+1)|\mathcal{C}|^m/(4k)). log ((( l m + 1 ) ( e N m / l m ) l m ) ∣ Q ∣ ) = ∣ Q ∣ log ( l m + 1 ) + l m ∣ Q ∣ log ( e N m / l m ) = o ( r ϵ log m ( m r ϵ + 1 ) ∣ C ∣ m / ( 4 k )) .
Finally, we verify the assumption of Lemma 6. By taking the logarithm, the left hand side is.
log ( ∣ G ∣ ) + log ( ∣ L l m ∣ ) + log ( N m l m + 1 ) + ( l m + 1 ) ( log ( ∣ A ∣ ) + n + θ n log ( l m / N m ) ) . \log(|\mathcal{G}|)+\log(|\mathcal{L}_{l_m}|)+\log\binom{N_m}{l_m+1}+(l_m+1)(\log(|\mathcal{A}|)+n+\theta n\log(l_m/N_m)). log ( ∣ G ∣ ) + log ( ∣ L l m ∣ ) + log ( l m + 1 N m ) + ( l m + 1 ) ( log ( ∣ A ∣ ) + n + θ n log ( l m / N m )) .
We notice that the negative term is
( l m + 1 ) θ n log ( l m / N m ) = − r ϵ log m ( m r ϵ + 1 ) ∣ C ∣ m / ( 4 k ) , (l_m+1)\theta n\log(l_m/N_m)=-r_{\epsilon}\log m(m^{r_{\epsilon}}+1)|\mathcal{C}|^m/(4k), ( l m + 1 ) θ n log ( l m / N m ) = − r ϵ log m ( m r ϵ + 1 ) ∣ C ∣ m / ( 4 k ) ,
which dominates the other terms above. Thus, the assumption of Lemma 6 is satisfied.
Now, in the remainder of the proof, we will translate Lemma 7 to the error analysis of a fixed model.
Lemma 8. For ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) , let r ϵ = ⌊ ( 1 / ϵ ) ⌋ + 3 r_{\epsilon}=\lfloor(1/\epsilon)\rfloor+3 r ϵ = ⌊( 1/ ϵ )⌋ + 3 , N m = m 2 r ϵ N_m=m^{2r_{\epsilon}} N m = m 2 r ϵ , l m = m r ϵ l_m=m^{r_{\epsilon}} l m = m r ϵ and let X k e y = [ N m ] \mathcal{X}_{key}=[N_m] X k ey = [ N m ] . Let H 1 , … , H k H_1,\ldots,H_k H 1 , … , H k be functions chosen from Lemma 7. Let M ∈ M α ˉ ( D B , P , D ( W − 1 ) ) M \in\mathcal{M}_{\bar{\alpha}}(DB,P,\mathcal{D}(W-1)) M ∈ M α ˉ ( D B , P , D ( W − 1 )) , an arbitrary hybrid model that satisfies B , P < c τ m B,P<c_{\tau}m B , P < c τ m and W < c τ m 1 / ϵ W<c_{\tau}m^{1/\epsilon} W < c τ m 1/ ϵ , c τ ≪ 1 c_{\tau}\ll1 c τ ≪ 1 a constant. For i ∈ [ k ] i \in[k] i ∈ [ k ] , denote by J i J_i J i the prefix ( z 0 , x 1 , … , x i ) (z_0,x_1,\ldots,x_i) ( z 0 , x 1 , … , x i ) and err i ( J i ) : = Pr I ∼ μ m [ M ( I ) ≠ z k ∣ J i ] \operatorname{err}_i(J_i):=\Pr_{I\sim\mu_m}[M(I)\ne z_k\mid J_i] err i ( J i ) := Pr I ∼ μ m [ M ( I ) = z k ∣ J i ] . For i ∈ [ k − 1 ] i \in[k-1] i ∈ [ k − 1 ] , and c ∈ Im ( C i ) c \in\operatorname{Im}(C_i) c ∈ Im ( C i ) , there exists sets L i ( c ) ⊆ X k e y L_i(c)\subseteq\mathcal{X}_{key} L i ( c ) ⊆ X k ey with size l m l_m l m such that for every J i J_i J i , err i ( J i ) ≤ δ i + 1 : = 1 / 3 + i / ( 6 k ) \operatorname{err}_i(J_i)\le\delta_{i+1}:=1/3+i/(6k) err i ( J i ) ≤ δ i + 1 := 1/3 + i / ( 6 k ) implies that z i ∈ L i ( C i ( J i ) ) z_i\in L_i(C_i(J_i)) z i ∈ L i ( C i ( J i )) .
Proof of Lemma 8. We prove the lemma using a backward induction on i i i . The base case is i = k − 1 i=k-1 i = k − 1 . Notice that if C k C_k C k is given, then the output of M M M is a deterministic function of C k C_k C k . We define the list function L ( C k ) \mathcal{L}(C_k) L ( C k ) to be a set that only contains the output of M M M , given C k C_k C k . By applying Lemma 7 to L \mathcal{L} L , we know that L k − 1 ( c ) : = { z ∈ X k e y ∣ ∃ γ ∈ { 0 , 1 } D B , Pr x k ∼ C m [ H k ( z , x k ) ∈ L ( Γ k − 1 , c , γ ( x k ) ) ] ≥ 1 / ( 3 k ) } L_{k-1}(c):=\{z\in\mathcal{X}_{key}\mid\exists\gamma\in\{0,1\}^{DB},\Pr_{x_k\sim\mathcal{C}_m}[H_k(z,x_k)\in\mathcal{L}(\Gamma_{k-1,c,\gamma}(x_k))]\ge1/(3k)\} L k − 1 ( c ) := { z ∈ X k ey ∣ ∃ γ ∈ { 0 , 1 } D B , Pr x k ∼ C m [ H k ( z , x k ) ∈ L ( Γ k − 1 , c , γ ( x k ))] ≥ 1/ ( 3 k )} has a size at most l m l_m l m . Now fix any J k − 1 J_{k-1} J k − 1 such that err k − 1 ( J k − 1 ) ≤ 1 / 3 + ( k − 1 ) / ( 6 k ) \operatorname{err}_{k-1}(J_{k-1})\le1/3+(k-1)/(6k) err k − 1 ( J k − 1 ) ≤ 1/3 + ( k − 1 ) / ( 6 k ) . By Lemma 4, we know that there there exists some γ \gamma γ such that C k = Γ k − 1 , c , γ ( x k ) C_k=\Gamma_{k-1,c,\gamma}(x_k) C k = Γ k − 1 , c , γ ( x k ) , where C k − 1 ( J k − 1 ) = c C_{k-1}(J_{k-1})=c C k − 1 ( J k − 1 ) = c . The assumption that err k − 1 ( J k − 1 ) ≤ 1 / 3 + ( k − 1 ) / ( 6 k ) \operatorname{err}_{k-1}(J_{k-1})\le1/3+(k-1)/(6k) err k − 1 ( J k − 1 ) ≤ 1/3 + ( k − 1 ) / ( 6 k ) implies that Pr x k ∼ C m [ H k ( z k − 1 , x k ) ∈ L ( Γ k − 1 , c , γ ( x k ) ) ] ≥ 1 / 3 k \Pr_{x_k\sim\mathcal{C}_m}[H_k(z_{k-1},x_k)\in\mathcal{L}(\Gamma_{k-1,c,\gamma}(x_k))]\ge1/3k Pr x k ∼ C m [ H k ( z k − 1 , x k ) ∈ L ( Γ k − 1 , c , γ ( x k ))] ≥ 1/3 k , which implies that z k − 1 ∈ L k − 1 ( C k − 1 ) z_{k-1}\in L_{k-1}(C_{k-1}) z k − 1 ∈ L k − 1 ( C k − 1 ) .
Now suppose that we have proven this for i i i , we prove this inductively for i − 1 i-1 i − 1 . For every c ∈ Im ( C i − 1 ) c\in\operatorname{Im}(C_{i-1}) c ∈ Im ( C i − 1 ) . We define L i − 1 ( c ) = { z ∈ X k e y ∣ ∃ γ ∈ { 0 , 1 } D B , Pr x i ∼ C m [ H i ( z , x i ) ∈ L i ( Γ i − 1 , c , γ ( x i ) ) ] ≥ 1 / ( 3 k ) } L_{i-1}(c)=\{z\in\mathcal{X}_{key}\mid\exists\gamma\in\{0,1\}^{DB},\Pr_{x_i\sim\mathcal{C}_m}[H_i(z,x_i)\in L_i(\Gamma_{i-1,c,\gamma}(x_i))]\ge1/(3k)\} L i − 1 ( c ) = { z ∈ X k ey ∣ ∃ γ ∈ { 0 , 1 } D B , Pr x i ∼ C m [ H i ( z , x i ) ∈ L i ( Γ i − 1 , c , γ ( x i ))] ≥ 1/ ( 3 k )} . By Lemma 7, we know that ∣ L i − 1 ( c ) ∣ ≤ l m |L_{i-1}(c)|\le l_m ∣ L i − 1 ( c ) ∣ ≤ l m . Now, let J i − 1 J_{i-1} J i − 1 such that err i − 1 ( J i − 1 ) ≤ δ i \operatorname{err}_{i-1}(J_{i-1})\le\delta_i err i − 1 ( J i − 1 ) ≤ δ i . Since err i − 1 ( J i − 1 ) = E x i [ err i ( J i − 1 , x i ) ] \operatorname{err}_{i-1}(J_{i-1})=\mathbb{E}_{x_i}[\operatorname{err}_i(J_{i-1},x_i)] err i − 1 ( J i − 1 ) = E x i [ err i ( J i − 1 , x i )] , by Markov’s inequality we know that Pr x i [ err i ( J i − 1 , x i ) > δ i + 1 ] ≤ δ i / δ i + 1 \Pr_{x_i}[\operatorname{err}_i(J_{i-1},x_i)>\delta_{i+1}]\le\delta_i/\delta_{i+1} Pr x i [ err i ( J i − 1 , x i ) > δ i + 1 ] ≤ δ i / δ i + 1 and thus Pr x i [ err i ( J i − 1 , x i ) ≤ δ i + 1 ] ≥ 1 − δ i / δ i + 1 \Pr_{x_i}[\operatorname{err}_i(J_{i-1},x_i)\le\delta_{i+1}]\ge1-\delta_i/\delta_{i+1} Pr x i [ err i ( J i − 1 , x i ) ≤ δ i + 1 ] ≥ 1 − δ i / δ i + 1 . By induction when err i ( J i − 1 , x i ) ≤ δ i + 1 \operatorname{err}_i(J_{i-1},x_i)\le\delta_{i+1} err i ( J i − 1 , x i ) ≤ δ i + 1 , we have z i ∈ L i ( C i ) z_i\in L_i(C_i) z i ∈ L i ( C i ) , which means
Pr x i [ H i ( z i − 1 , x i ) ∈ L i ( Γ i − 1 , c , γ ( x i ) ) ] ≥ 1 / ( 3 k ) . \Pr_{x_i}[H_i(z_{i-1},x_i)\in L_i(\Gamma_{i-1,c,\gamma}(x_i))]\ge1/(3k). x i Pr [ H i ( z i − 1 , x i ) ∈ L i ( Γ i − 1 , c , γ ( x i ))] ≥ 1/ ( 3 k ) .
Thus, z i − 1 ∈ L i − 1 ( c ) z_{i-1}\in L_{i-1}(c) z i − 1 ∈ L i − 1 ( c ) .
We now give the full proof of Theorem 3.
Proof of Theorem 3. By Lemma 3, it suffices to consider a model M ′ ∈ M α ˉ ( D B , P , D ( W − 1 ) ) M'\in\mathcal{M}_{\bar{\alpha}}(DB,P,\mathcal{D}(W-1)) M ′ ∈ M α ˉ ( D B , P , D ( W − 1 )) . Suppose that M ′ M' M ′ has error at most 1 / 3 1/3 1/3 over μ m \mu_m μ m . Then, we have E J 1 [ err 1 ( J 1 ) ] ≤ 1 / 3 \mathbb{E}_{J_1}[\operatorname{err}_1(J_1)]\le1/3 E J 1 [ err 1 ( J 1 )] ≤ 1/3 . Since δ 2 = 1 / 3 + 1 / ( 6 k ) \delta_2=1/3+1/(6k) δ 2 = 1/3 + 1/ ( 6 k ) , by Markov’s inequality, we know that Pr J 1 [ err 1 ( J 1 ) ≤ δ 2 ] ≥ 1 / ( 2 k + 1 ) \Pr_{J_1}[\operatorname{err}_1(J_1)\le\delta_2]\ge1/(2k+1) Pr J 1 [ err 1 ( J 1 ) ≤ δ 2 ] ≥ 1/ ( 2 k + 1 ) . By Lemma 8, we know that z 1 ∈ L 1 ( C 1 ) z_1\in L_1(C_1) z 1 ∈ L 1 ( C 1 ) . In particular, this implies that Pr z 1 [ z 1 ∈ L 1 ( C 1 ) ] ≥ 1 / ( 2 k + 1 ) \Pr_{z_1} [z_1\in L_1(C_1)]\ge1/(2k+1) Pr z 1 [ z 1 ∈ L 1 ( C 1 )] ≥ 1/ ( 2 k + 1 ) . However, by Lemma 6, we will show that the choice of H 1 H_1 H 1 must also have Pr z 1 [ z 1 ∈ L 1 ( C 1 ) ] < 1 / ( 2 k + 1 ) \Pr_{z_1} [z_1\in L_1(C_1)]<1/(2k+1) Pr z 1 [ z 1 ∈ L 1 ( C 1 )] < 1/ ( 2 k + 1 ) . To see this, recall that the set of z 0 ∈ X k e y z_0\in\mathcal{X}_{key} z 0 ∈ X k ey such that there exists some internal state γ \gamma γ such that the probability that H 1 ( z 0 , x 1 ) ∈ L 1 ( Γ γ ( x 1 ) ) H_1(z_0,x_1)\in L_1(\Gamma_\gamma(x_1)) H 1 ( z 0 , x 1 ) ∈ L 1 ( Γ γ ( x 1 )) is more than 1 / 4 k 1/4k 1/4 k has a size at most l m l_m l m . Denote by this set of keys to be B B B , then we have
Pr z 0 , x 1 [ z 1 ∈ L 1 ( C 1 ) ] ≤ Pr z 0 ∈ B [ z 1 ∈ L 1 ( C 1 ) ] + 1 / ( 4 k ) ≤ l m / N m + ( 1 / ( 4 k ) ) < 1 / ( 2 k + 1 ) , \Pr_{z_0,x_1}[z_1\in L_1(C_1)]\le\Pr_{z_0\in B}[z_1\in L_1(C_1)]+1/(4k)\le l_m/N_m+(1/(4k))<1/(2k+1), z 0 , x 1 Pr [ z 1 ∈ L 1 ( C 1 )] ≤ z 0 ∈ B Pr [ z 1 ∈ L 1 ( C 1 )] + 1/ ( 4 k ) ≤ l m / N m + ( 1/ ( 4 k )) < 1/ ( 2 k + 1 ) ,
where m m m is large enough.
Correct ordering but insufficient layers
Theorem 4. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ D \tau= X_{1}^{r_{1}}X_{2}^{r_{2}}\cdots X_{h}^{r_{h}} \in\Sigma^{D} τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ D be an arbitrary architecture profile with depth D D D . Let α : = comp ( τ ) \alpha:= \operatorname{comp}(\tau) α := comp ( τ ) . There exists a constant λ τ > 1 \lambda_{\tau} > 1 λ τ > 1 , C τ > 0 C_{\tau} > 0 C τ > 0 , a family of task { G τ , m } m ≥ 1 \{G_{\tau,m}\}_{m \ge1} { G τ , m } m ≥ 1 and a family of distributions ν m \nu_{m} ν m over a sequence of tokens with length L m L_{m} L m parameterized by m ∈ N + m \in\mathbb{N}_{+} m ∈ N + , such that for all m m m sufficiently large, the follows hold. Let A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D be an architecture profile with α ⪯ A \alpha\preceq A α ⪯ A but τ ⪯̸ A \tau\not\preceq A τ ⪯ A . Then for every hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , G τ , m ) ≤ O ( 1 / D ) \operatorname{err}(M,G_{\tau,m}) \le O(1/D) err ( M , G τ , m ) ≤ O ( 1/ D ) , must satisfy W ≥ λ τ ( m + 1 ) W \ge\lambda_{\tau}(m+1) W ≥ λ τ ( m + 1 ) or max { B , P } ≥ λ τ C τ log m \max\{B,P\} \ge\lambda_{\tau}C_{\tau}\log m max { B , P } ≥ λ τ C τ log m . On the other hand, there exists a model M ′ ∈ M τ ( C τ log m , C τ log m , m + 1 ) M' \in\mathcal{M}_{\tau}(C_{\tau}\log m,C_{\tau}\log m,m+1) M ′ ∈ M τ ( C τ log m , C τ log m , m + 1 ) that can solve G τ , m G_{\tau,m} G τ , m exactly.
The main proof of Theorem 4 will focus on the hardness part. We introduce the following definitions
Definition 6. Let τ ∈ Σ D \tau\in\Sigma^{D} τ ∈ Σ D . Let s ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = S } ∣ s(\tau)=|\{i \in[D] \mid\tau_i=S\}| s ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = S } ∣ and t ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = T } ∣ t(\tau)=|\{i \in[D] \mid\tau_i=T\}| t ( τ ) = ∣ { i ∈ [ D ] ∣ τ i = T } ∣ . For i ∈ [ s ( τ ) ] i \in[s(\tau)] i ∈ [ s ( τ )] , we use r i ( τ ) r_i(\tau) r i ( τ ) to denote the number of T-layers in τ \tau τ that is strictly after the i i i th S-layer and for i ∈ [ t ( τ ) ] i \in[t(\tau)] i ∈ [ t ( τ )] , we use l i ( τ ) l_i(\tau) l i ( τ ) to denote the number of S-layers in τ \tau τ that is strictly after the i i i th T-layer. We call the set of architecture profiles
C 2 ( τ ) = { S s ( τ ) } ∪ { T t ( τ ) } ∪ { S i T r i ( τ ) ∣ i ∈ [ s ( τ ) ] } ∪ { T i S l i ( τ ) ∣ i ∈ [ t ( τ ) ] } , C_2(\tau)=\{S^{s(\tau)}\}\cup\{T^{t(\tau)}\}\cup\{S^iT^{r_i(\tau)}\mid i\in[s(\tau)]\}\cup\{T^iS^{l_i(\tau)}\mid i\in[t(\tau)]\}, C 2 ( τ ) = { S s ( τ ) } ∪ { T t ( τ ) } ∪ { S i T r i ( τ ) ∣ i ∈ [ s ( τ )]} ∪ { T i S l i ( τ ) ∣ i ∈ [ t ( τ )]} , the size-2 cover of τ \tau τ .
We first give the following property of the size-2 cover.
Lemma 9. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ ∈ Σ D \tau\in\Sigma^{D} τ ∈ Σ D . Let A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D such that τ ⪯̸ A \tau\not\preceq A τ ⪯ A , then there exists some σ ∈ C 2 ( τ ) \sigma\in C_2(\tau) σ ∈ C 2 ( τ ) such that σ ⪯̸ A \sigma\not\preceq A σ ⪯ A .
Proof of Lemma 9. Suppose that instead for every σ ∈ C 2 ( τ ) \sigma\in C_2(\tau) σ ∈ C 2 ( τ ) , we have σ ⪯ A \sigma\preceq A σ ⪯ A . In particular, we have S s ( τ ) ⪯ A S^{s(\tau)} \preceq A S s ( τ ) ⪯ A and T t ( τ ) ⪯ A T^{t(\tau)} \preceq A T t ( τ ) ⪯ A . This implies that it must be the case that ∣ A ∣ = D |A|=D ∣ A ∣ = D and s ( A ) = s ( τ ) , t ( A ) = t ( τ ) s(A)=s(\tau),t(A)=t(\tau) s ( A ) = s ( τ ) , t ( A ) = t ( τ ) . We notice that once s ( A ) , t ( A ) s(A),t(A) s ( A ) , t ( A ) and r 1 ( A ) , … , r s ( A ) ( A ) r_1(A),\ldots,r_{s(A)}(A) r 1 ( A ) , … , r s ( A ) ( A ) is fixed, A A A is completely determined. Since for i ∈ s ( τ ) i\in s(\tau) i ∈ s ( τ ) , S i T r i ( τ ) ⪯ A S^iT^{r_i(\tau)}\preceq A S i T r i ( τ ) ⪯ A , we know that r i ( A ) ≥ r i ( τ ) r_i(A)\ge r_i(\tau) r i ( A ) ≥ r i ( τ ) . Notice that the total number of ( i , j ) (i,j) ( i , j ) such that i < j i<j i < j and A i = T , A j = S A_i=T,A_j=S A i = T , A j = S is exactly
∑ i = 1 s ( A ) ( t ( A ) − r i ( A ) ) = ∑ i = 1 t ( A ) l i ( A ) . \sum_{i=1}^{s(A)}(t(A)-r_i(A))=\sum_{i=1}^{t(A)}l_i(A). i = 1 ∑ s ( A ) ( t ( A ) − r i ( A )) = i = 1 ∑ t ( A ) l i ( A ) .
A ≠ τ A\ne\tau A = τ implies that at least one of r i ( A ) > r i ( τ ) r_i(A)>r_i(\tau) r i ( A ) > r i ( τ ) , which implies that ∑ i = 1 t ( A ) l i ( A ) < ∑ i = 1 t ( A ) l i ( τ ) \sum_{i=1}^{t(A)}l_i(A)<\sum_{i=1}^{t(A)}l_i(\tau) ∑ i = 1 t ( A ) l i ( A ) < ∑ i = 1 t ( A ) l i ( τ ) and thus some l i ( τ ) > l i ( A ) l_i(\tau)>l_i(A) l i ( τ ) > l i ( A ) . However, this implies that T i S l i ( τ ) ⪯̸ A T^iS^{l_i(\tau)}\not\preceq A T i S l i ( τ ) ⪯ A .
Given Lemma 9, we next provide a reduction showing that it is enough to construct a hard task for every architecture profile in the size-2 cover.
Lemma 10. Let D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ D \tau= X_{1}^{r_{1}}X_{2}^{r_{2}}\cdots X_{h}^{r_{h}}\in\Sigma^{D} τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ D be an arbitrary architecture profile with depth D D D . Let C C C be a set of R R R architecture profiles such that for σ j ∈ C , j ∈ [ R ] , σ j ⪯ τ \sigma_j\in C,j\in[R],\sigma_j\preceq\tau σ j ∈ C , j ∈ [ R ] , σ j ⪯ τ . Furthermore, suppose there exists constant C > 0 C>0 C > 0 and λ > 1 \lambda>1 λ > 1 such that for each σ j ∈ C \sigma_j\in C σ j ∈ C , there exists a family of task { H j , m } m ≥ 1 \{H_{j,m}\}_{m\ge1} { H j , m } m ≥ 1 , there exists a model M ′ ∈ M σ j ( C log m , C log m , m + 1 ) M'\in\mathcal{M}_{\sigma_j}(C\log m,C\log m,m+1) M ′ ∈ M σ j ( C log m , C log m , m + 1 ) that can solve H j , m H_{j,m} H j , m exactly, while every hybrid model M ∈ M A ( B , P , W ) M\in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , H j , m ) ≤ 1 / 3 \operatorname{err}(M,H_{j,m})\le1/3 err ( M , H j , m ) ≤ 1/3 , must satisfy W ≥ λ ( m + 1 ) W\ge\lambda(m+1) W ≥ λ ( m + 1 ) or max { B , P } ≥ λ C log m \max\{B,P\}\ge\lambda C\log m max { B , P } ≥ λ C log m , if A ∈ Σ ≤ D , σ j ⪯̸ A A\in\Sigma^{\le D},\sigma_j\not\preceq A A ∈ Σ ≤ D , σ j ⪯ A . Then, there exists a family of task { G τ , m } \{G_{\tau,m}\} { G τ , m } such that for every hybrid model M ∈ M A ( B , P , W ) M\in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , G τ , m ) ≤ 1 / ( 3 R ) \operatorname{err}(M,G_{\tau,m})\le1/(3R) err ( M , G τ , m ) ≤ 1/ ( 3 R ) , must satisfy W ≥ λ ( m + 1 ) W\ge\lambda(m+1) W ≥ λ ( m + 1 ) or max { B , P } ≥ λ C log m \max\{B,P\}\ge\lambda C\log m max { B , P } ≥ λ C log m , if A ∈ Σ ≤ D A\in\Sigma^{\le D} A ∈ Σ ≤ D and ∃ σ ∈ C , σ ⪯̸ A \exists\sigma\in C,\sigma\not\preceq A ∃ σ ∈ C , σ ⪯ A . On the other hand, there exists a model M ′ ∈ M τ ( C log m , C log m , m + 1 ) M'\in\mathcal{M}_{\tau}(C\log m,C\log m,m+1) M ′ ∈ M τ ( C log m , C log m , m + 1 ) that can solve G τ , m G_{\tau,m} G τ , m exactly.
Proof of Lemma 10. We start with the design of the task G τ , m G_{\tau,m} G τ , m . Let X \mathcal{X} X be the context space and let H j , m : X L m → X H_{j,m}:\mathcal{X}^{L_m}\to\mathcal{X} H j , m : X L m → X , where L m L_m L m is the length of the input sequence. Let ν j , m \nu_{j,m} ν j , m be the distribution of the input sequence for task H j , m H_{j,m} H j , m . We define the distribution ν m \nu_m ν m over ( [ R ] × X ) L m ([R]\times\mathcal{X})^{L_m} ([ R ] × X ) L m as follows. First, j ∼ [ R ] j\sim[R] j ∼ [ R ] is drawn uniformly. Given j j j , a sequence x ∼ ν j , m x\sim\nu_{j,m} x ∼ ν j , m is drawn and finally the returned sample has x ˉ ∈ ( [ R ] × X ) L m \bar{x}\in([R]\times\mathcal{X})^{L_m} x ˉ ∈ ([ R ] × X ) L m has a form x ˉ i = ( j , x i ) \bar{x}_i=(j,x_i) x ˉ i = ( j , x i ) , where i ∈ [ L m ] i\in[L_m] i ∈ [ L m ] . And the task G τ , m G_{\tau,m} G τ , m is asked to compute H j , m ( x ) H_{j,m}(x) H j , m ( x ) , given x ˉ \bar{x} x ˉ .
The hardness part follows immediately. Since M A ∈ M ( B , P , W ) M_A\in\mathcal{M}(B,P,W) M A ∈ M ( B , P , W ) and some σ j ⋠ A \sigma_j\npreceq A σ j ⋠ A , which implies that M A M_A M A fails to solve H j , m H_{j,m} H j , m over ν j , m \nu_{j,m} ν j , m with probability 1 / 3 1/3 1/3 , this implies that condition j ∼ [ R ] j\sim[R] j ∼ [ R ] is sampled, there is at least 1 / R 1/R 1/ R probability that H j , m H_{j,m} H j , m has to be solved and M A M_A M A has a failure probability 1 / ( 3 R ) 1/(3R) 1/ ( 3 R ) .
We now design the model M M M that can be used to solve the task G τ , m G_{\tau,m} G τ , m . Since the layers we are considering are generalized linear models and non-linear causal window functions, we will just use a selector between layers to select the correct model to use. Specifically, let M j , m = N j , m ∣ σ j ∣ ∘ ⋯ ∘ N j , m 1 M_{j,m}=N_{j,m}^{|\sigma_j|}\circ\cdots\circ N_{j,m}^{1} M j , m = N j , m ∣ σ j ∣ ∘ ⋯ ∘ N j , m 1 , where N j , m i N_{j,m}^{i} N j , m i is the i i i th layer of M j , m M_{j,m} M j , m , which can solve H j , m H_{j,m} H j , m exactly. Importantly, since σ j ⪯ τ \sigma_j\preceq\tau σ j ⪯ τ , we know that there exists a strictly increasing map P j : [ ∣ σ j ∣ ] → [ D ] P_j:[|\sigma_j|]\to[D] P j : [ ∣ σ j ∣ ] → [ D ] , such that τ P j ( i ) = ( σ j ) i \tau_{P_j(i)}=(\sigma_j)_i τ P j ( i ) = ( σ j ) i , for i ∈ [ ∣ σ j ∣ ] i\in[|\sigma_j|] i ∈ [ ∣ σ j ∣ ] . We define the model M M M as follows for the i i i th layer of M M M , it contains identical map and all types of layers N j , m i N_{j,m}^{i} N j , m i if P j ( i ) = i ∗ P_j(i)=i^* P j ( i ) = i ∗ as blocks and it will select which block to use when read an input ( j , x t ) (j,x_t) ( j , x t ) . Specifically, when it reads ( j , x t ) (j,x_t) ( j , x t ) , it will choose to use N j , m P j ( i ) N_{j,m}^{P_j(i)} N j , m P j ( i ) if P j ( i ) = i ∗ P_j(i)=i^* P j ( i ) = i ∗ and identical map otherwise. By the property of M j , m M_{j,m} M j , m , the model M M M has 0 error over ν m \nu_m ν m . Importantly, the structure of M M M is defined independent on j j j and only makes uses one of M j , m M_{j,m} M j , m on a single input sequence and thus is in M τ ( C log m , C log m , m + 1 ) \mathcal{M}_{\tau}(C\log m,C\log m,m+1) M τ ( C log m , C log m , m + 1 ) .
Based on Lemma 10, it suffices to construct hard tasks for target profiles σ ∈ C 2 ( τ ) \sigma\in C_2(\tau) σ ∈ C 2 ( τ ) . In the rest of the proof, we establish Lemma 11 .
Lemma 11. Let D ∈ N + D\in\mathbb{N}_+ D ∈ N + and τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ D \tau=X_1^{r_1}X_2^{r_2}\cdots X_h^{r_h}\in\Sigma^D τ = X 1 r 1 X 2 r 2 ⋯ X h r h ∈ Σ D be an arbitrary architecture profile with depth D D D . There exists constant C > 0 C>0 C > 0 and λ > 1 \lambda>1 λ > 1 such that for j ∈ [ R ] j\in[R] j ∈ [ R ] , there exists a family of task { H σ , m } \{H_{\sigma,m}\} { H σ , m } , σ ∈ C 2 ( τ ) \sigma\in C_2(\tau) σ ∈ C 2 ( τ ) , such that there exists a model M ′ ∈ M σ ( b m , b m , m + 1 ) M'\in\mathcal{M}_{\sigma}(b_m,b_m,m+1) M ′ ∈ M σ ( b m , b m , m + 1 ) that can solve H σ , m H_{\sigma,m} H σ , m exactly, where b m = C log m b_m=C\log m b m = C log m , while every hybrid model M ∈ M A ( B , P , W ) M\in\mathcal{M}_A(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , H σ , m ) ≤ 1 / 3 \operatorname{err}(M,H_{\sigma,m})\leq1/3 err ( M , H σ , m ) ≤ 1/3 , for some input distribution ν σ , m \nu_{\sigma,m} ν σ , m must satisfy W ≥ λ ( m + 1 ) W\geq\lambda(m+1) W ≥ λ ( m + 1 ) or max { B , P } ≥ λ b m \max\{B,P\}\geq\lambda b_m max { B , P } ≥ λ b m , if A ∈ Σ ≤ D , σ ⋠ A A\in\Sigma^{\leq D},\ \sigma\npreceq A A ∈ Σ ≤ D , σ ⋠ A .
Before presenting the proof, we first state some technical lemmas that will be used for the analysis.
Lemma 12. Let x , w x,w x , w be two independent vector sampled from { 0 , 1 } a \{0,1\}^a { 0 , 1 } a for some a ∈ Z + a\in\mathbb{Z}_+ a ∈ Z + . Let E : { 0 , 1 } a → { 0 , 1 } a E:\{0,1\}^a\to\{0,1\}^a E : { 0 , 1 } a → { 0 , 1 } a be an embedding function such that Im ( E ) ⊆ 2 b \operatorname{Im}(E)\subseteq2^b Im ( E ) ⊆ 2 b , for some b < a b<a b < a , then for every function ψ : { 0 , 1 } a × { 0 , 1 } a → { 0 , 1 } \psi:\{0,1\}^a\times\{0,1\}^a\to\{0,1\} ψ : { 0 , 1 } a × { 0 , 1 } a → { 0 , 1 } , Pr x , w [ ψ ( E ( x ) , w ) = ⨁ i = 1 n x i w i ] ≤ ( 1 / 2 ) + 2 − ( a − b ) / 2 − 1 \Pr_{x,w}[\psi(E(x),w)=\bigoplus_{i=1}^n x_iw_i]\leq(1/2)+2^{-(a-b)/2-1} Pr x , w [ ψ ( E ( x ) , w ) = ⨁ i = 1 n x i w i ] ≤ ( 1/2 ) + 2 − ( a − b ) /2 − 1 .
Proof of Lemma 12 . Write Y = ⟨ x , w ⟩ 2 = ⨁ i = 1 a x i w i Y=\langle x,w\rangle_2=\bigoplus_{i=1}^a x_iw_i Y = ⟨ x , w ⟩ 2 = ⨁ i = 1 a x i w i . Let h ∈ Im ( E ) h\in\operatorname{Im}(E) h ∈ Im ( E ) and denote by S h : = { x ∣ E ( x ) = h } S_h:=\{x\mid E(x)=h\} S h := { x ∣ E ( x ) = h } . Let s h = ∣ S h ∣ s_h=|S_h| s h = ∣ S h ∣ . For each w ∈ { 0 , 1 } a w\in\{0,1\}^a w ∈ { 0 , 1 } a , define β h ( w ) : = E x ∼ U ( S h ) [ ( − 1 ) ⟨ x , w ⟩ 2 ] \beta_h(w):=\mathbb{E}_{x\sim U(S_h)}[(-1)^{\langle x,w\rangle_2}] β h ( w ) := E x ∼ U ( S h ) [( − 1 ) ⟨ x , w ⟩ 2 ] . Notice that β h ( w ) = Pr x [ Y = 0 ∣ E ( x ) = h , w ] − Pr x [ Y = 1 ∣ E ( x ) = h , w ] \beta_h(w)=\Pr_x[Y=0\mid E(x)=h,w]-\Pr_x[Y=1\mid E(x)=h,w] β h ( w ) = Pr x [ Y = 0 ∣ E ( x ) = h , w ] − Pr x [ Y = 1 ∣ E ( x ) = h , w ] . This implies that given h , w h,w h , w , the Bayesian optimal prediction has an error of ( 1 + ∣ β h ( w ) ∣ ) / 2 (1+|\beta_h(w)|)/2 ( 1 + ∣ β h ( w ) ∣ ) /2 .
Taking the average over w w w , we have
Pr x , w [ ψ ( E ( x ) , w ) = ⨁ i = 1 a x i w i ∣ E ( x ) = h ] ≤ ( 1 + E w [ ∣ β h ( w ) ∣ ] ) / 2 ≤ ( 1 + E w [ ∣ β h ( w ) ∣ 2 ] ) / 2 = ( 1 + 1 / s h ) / 2 \begin{aligned}
\Pr_{x,w}[\psi(E(x),w)=\bigoplus_{i=1}^a x_iw_i\mid E(x)=h]\leq(1+\mathbb{E}_w[|\beta_h(w)|])/2 \\
&\leq(1+\sqrt{\mathbb{E}_w[|\beta_h(w)|^2]})/2=(1+1/\sqrt{s_h})/2
\end{aligned} x , w Pr [ ψ ( E ( x ) , w ) = i = 1 ⨁ a x i w i ∣ E ( x ) = h ] ≤ ( 1 + E w [ ∣ β h ( w ) ∣ ]) /2 ≤ ( 1 + E w [ ∣ β h ( w ) ∣ 2 ] ) /2 = ( 1 + 1/ s h ) /2
Now we take the average over h h h and get
Pr x , w [ ψ ( E ( x ) , w ) = ⨁ i = 1 n x i w i ] ≤ 1 2 + 1 2 a + 1 ∑ h s h ≤ 1 2 + 1 2 a + 1 ∣ Im ( E ) ∣ ∑ h s h ≤ ( 1 / 2 ) + 2 − ( a − b ) / 2 − 1 . \begin{aligned}
\Pr_{x,w}[\psi(E(x),w)=\bigoplus_{i=1}^n x_iw_i]\leq\frac{1}{2}+\frac{1}{2^{a+1}}\sum_h\sqrt{s_h}\leq\frac{1}{2}+\frac{1}{2^{a+1}}\sqrt{|\operatorname{Im}(E)|\sum_h s_h} \\
&\leq(1/2)+2^{-(a-b)/2-1}.
\end{aligned} x , w Pr [ ψ ( E ( x ) , w ) = i = 1 ⨁ n x i w i ] ≤ 2 1 + 2 a + 1 1 h ∑ s h ≤ 2 1 + 2 a + 1 1 ∣ Im ( E ) ∣ h ∑ s h ≤ ( 1/2 ) + 2 − ( a − b ) /2 − 1 .
Lemma 13. Let n , K ∈ Z + n, K \in\mathbb{Z}_{+} n , K ∈ Z + . Let x ( 1 ) , … , x ( K ) x^{(1)},\ldots,x^{(K)} x ( 1 ) , … , x ( K ) be drawn uniform at random and independently from { 0 , 1 } n \{0,1\}^{n} { 0 , 1 } n and let J J J be drawn uniformly from [ K ] [K] [ K ] . Let Γ \Gamma Γ be a discrete function over ( { 0 , 1 } n ) K (\{0,1\}^{n})^{K} ({ 0 , 1 } n ) K that takes at most 2 a 2^{a} 2 a values, for some a ∈ Z + a \in\mathbb{Z}_{+} a ∈ Z + . Suppose that for every γ ∈ Im ( Γ ) , j ∈ [ K ] \gamma\in\operatorname{Im}(\Gamma),j \in[K] γ ∈ Im ( Γ ) , j ∈ [ K ] , there exists a set L γ , j ⊆ { 0 , 1 } n L_{\gamma,j} \subseteq\{0,1\}^{n} L γ , j ⊆ { 0 , 1 } n with size at most l < 2 n l < 2^{n} l < 2 n . Then we have
Pr x ( 1 ) , … , x ( K ) , J [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( K ) ) , J ] ≤ a / K + 1 n − log l . \Pr_{x^{(1)},\ldots,x^{(K)},J}\left[x^{(J)} \in L_{\Gamma(x^{(1)},\ldots,x^{(K)}),J}\right] \leq\frac{a/K+1}{n-\log l}. x ( 1 ) , … , x ( K ) , J Pr [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( K ) ) , J ] ≤ n − log l a / K + 1 . Proof of Lemma 13. Notice that
∑ i = 1 K I ( x ( i ) ; Γ ) = ∑ i = 1 K H ( x ( i ) ) − ∑ i = 1 K H ( x ( i ) ∣ Γ ) \sum_{i=1}^{K} I(x^{(i)};\Gamma)=\sum_{i=1}^{K}H(x^{(i)})-\sum_{i=1}^{K}H(x^{(i)}\mid\Gamma) i = 1 ∑ K I ( x ( i ) ; Γ ) = i = 1 ∑ K H ( x ( i ) ) − i = 1 ∑ K H ( x ( i ) ∣ Γ ) ≤ K n − H ( x ( 1 ) , … , x ( K ) ∣ Γ ) \leq Kn-H(x^{(1)},\ldots,x^{(K)}\mid\Gamma) ≤ K n − H ( x ( 1 ) , … , x ( K ) ∣ Γ ) = I ( x ( 1 ) , … , x ( K ) ; Γ ) =I(x^{(1)},\ldots,x^{(K)};\Gamma) = I ( x ( 1 ) , … , x ( K ) ; Γ ) ≤ H ( Γ ) ≤ a . \leq H(\Gamma)\leq a. ≤ H ( Γ ) ≤ a . This implies that
I ( x ( J ) ; Γ , J ) = I ( x ( J ) ; J ) + I ( x ( J ) ; Γ ∣ J ) I(x^{(J)};\Gamma,J)=I(x^{(J)};J)+I(x^{(J)};\Gamma\mid J) I ( x ( J ) ; Γ , J ) = I ( x ( J ) ; J ) + I ( x ( J ) ; Γ ∣ J ) = 1 K ∑ i = 1 K I ( x ( i ) ; Γ ) =\frac{1}{K}\sum_{i=1}^{K}I(x^{(i)};\Gamma) = K 1 i = 1 ∑ K I ( x ( i ) ; Γ ) Denote the joint random variable R = ( Γ , J ) R=(\Gamma,J) R = ( Γ , J ) . We show that p : = Pr [ x ( J ) ∈ L R ] ≤ ( I ( x ( J ) ; R ) + 1 ) / ( n − log l ) p:=\Pr[x^{(J)}\in L_R]\leq(I(x^{(J)};R)+1)/(n-\log l) p := Pr [ x ( J ) ∈ L R ] ≤ ( I ( x ( J ) ; R ) + 1 ) / ( n − log l ) . Define random variable B = 1 { x ( J ) ∈ L R } B=\mathbf{1}\{x^{(J)}\in L_R\} B = 1 { x ( J ) ∈ L R } , we have
H ( x ( J ) , B ∣ R ) = H ( x ( J ) ∣ R ) + H ( B ∣ x ( J ) R ) = H ( x ( J ) ∣ R ) . H(x^{(J)},B\mid R)=H(x^{(J)}\mid R)+H(B\mid x^{(J)}R)=H(x^{(J)}\mid R). H ( x ( J ) , B ∣ R ) = H ( x ( J ) ∣ R ) + H ( B ∣ x ( J ) R ) = H ( x ( J ) ∣ R ) . This gives
H ( x ( J ) ∣ R ) = H ( x ( J ) , B ∣ R ) H(x^{(J)}\mid R)=H(x^{(J)},B\mid R) H ( x ( J ) ∣ R ) = H ( x ( J ) , B ∣ R ) = H ( B ∣ R ) + H ( x ( J ) ∣ B , R ) =H(B\mid R)+H(x^{(J)}\mid B,R) = H ( B ∣ R ) + H ( x ( J ) ∣ B , R ) ≤ 1 + H ( x ( J ) ∣ B , R ) = 1 + p H ( x ( J ) ∣ B = 1 , R ) + ( 1 − p ) H ( x ( J ) ∣ B = 0 , R ) \leq1+H(x^{(J)}\mid B,R)=1+pH(x^{(J)}\mid B=1,R)+(1-p)H(x^{(J)}\mid B=0,R) ≤ 1 + H ( x ( J ) ∣ B , R ) = 1 + p H ( x ( J ) ∣ B = 1 , R ) + ( 1 − p ) H ( x ( J ) ∣ B = 0 , R ) ≤ 1 + p log l + ( 1 − p ) n = n + 1 − p ( n − log l ) . \leq1+p\log l+(1-p)n=n+1-p(n-\log l). ≤ 1 + p log l + ( 1 − p ) n = n + 1 − p ( n − log l ) . Thus, we have I ( x ( J ) ; R ) ≥ p ( n − log l ) − 1 I(x^{(J)};R)\geq p(n-\log l)-1 I ( x ( J ) ; R ) ≥ p ( n − log l ) − 1 , which gives Pr [ x ( J ) ∈ L R ] ≤ ( I ( x ( J ) ; R ) + 1 ) / ( n − log l ) \Pr[x^{(J)}\in L_R]\leq(I(x^{(J)};R)+1)/(n-\log l) Pr [ x ( J ) ∈ L R ] ≤ ( I ( x ( J ) ; R ) + 1 ) / ( n − log l ) . Since I ( x ( J ) ; R ) ≤ a / K I(x^{(J)};R)\leq a/K I ( x ( J ) ; R ) ≤ a / K , we get
Pr x ( 1 ) , … , x ( K ) , J [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( K ) ) , J ] ≤ a / K + 1 n − log l . \Pr_{x^{(1)},\ldots,x^{(K)},J}\left[x^{(J)}\in L_{\Gamma(x^{(1)},\ldots,x^{(K)}),J}\right]\leq\frac{a/K+1}{n-\log l}. x ( 1 ) , … , x ( K ) , J Pr [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( K ) ) , J ] ≤ n − log l a / K + 1 .
Lemma 14 (List Decoding for Hadamard Code). Let f : { 0 , 1 } n → { 0 , 1 } f:\{0,1\}^{n}\to\{0,1\} f : { 0 , 1 } n → { 0 , 1 } be an arbitrary Boolean function and let L : = { x ∈ { 0 , 1 } n ∣ Pr u ∼ U ( { 0 , 1 } n ) [ f ( u ) = ⟨ x , u ⟩ 2 ] > ϵ + 1 / 2 } L:=\{x\in\{0,1\}^{n}\mid\Pr_{u\sim U(\{0,1\}^{n})}[f(u)=\langle x,u\rangle_{2}]>\epsilon+1/2\} L := { x ∈ { 0 , 1 } n ∣ Pr u ∼ U ({ 0 , 1 } n ) [ f ( u ) = ⟨ x , u ⟩ 2 ] > ϵ + 1/2 } , ϵ ∈ ( 0 , 1 ) \epsilon\in(0,1) ϵ ∈ ( 0 , 1 ) . Then, ∣ L ∣ ≤ 1 / ( 4 ϵ 2 ) |L|\leq1/(4\epsilon^{2}) ∣ L ∣ ≤ 1/ ( 4 ϵ 2 ) .
Proof of Lemma 11. We will break the proof into 4 cases to consider the cases where σ \sigma σ has the form of S r S^{r} S r , T r T^{r} T r , T r S s T^{r}S^{s} T r S s , S r T s S^{r}T^{s} S r T s , with r + s ≤ D r+s\leq D r + s ≤ D . Let λ = 1 + ( 1 / 4 D ) \lambda=1+(1/4D) λ = 1 + ( 1/4 D ) .
Case 1: σ = S r \sigma= S^r σ = S r In the first case, we consider the case where σ = S r \sigma= S^r σ = S r . Let a m = b m − 1 a_m = b_m - 1 a m = b m − 1 and let n = r a m n = r a_m n = r a m . We design the input distribution ν S r , m \nu_{S^r,m} ν S r , m as follows. To draw an input I I I from ν S r , m \nu_{S^r,m} ν S r , m , we first draw x , w \mathbf{x}, \mathbf{w} x , w uniform at random independently from { 0 , 1 } n \{0,1\}^n { 0 , 1 } n and return I = ( x , 0 ⃗ , w ) I = (\mathbf{x}, \vec{0}, \mathbf{w}) I = ( x , 0 , w ) , where 0 ⃗ \vec{0} 0 is sequence of 0 of length at least D λ ( m + 1 ) D\lambda(m+1) D λ ( m + 1 ) . The task H S r , m ( I ) H_{S^r,m}(I) H S r , m ( I ) asks to compute Y = ⟨ x , w ⟩ 2 = ⨁ i = 1 n x i w i Y = \langle\mathbf{x}, \mathbf{w}\rangle_2 = \bigoplus_{i=1}^{n}x_iw_i Y = ⟨ x , w ⟩ 2 = ⨁ i = 1 n x i w i . By Lemma 1, we show that a single layer SSM with 2 r b m 2^{r b_m} 2 r b m states can solve this task. In fact, this can be done since 2 r b m 2^{r b_m} 2 r b m bits are enough to memorize x , w \mathbf{x}, \mathbf{w} x , w exactly.
We next show that if S r ⪯̸ A S^r \not\preceq A S r ⪯ A , then a model from M A ( B , P , W ) \mathcal{M}_A(B,P,W) M A ( B , P , W ) has a bad accuracy unless B , P , W B,P,W B , P , W are large. Since S r ⪯̸ A S^r \not\preceq A S r ⪯ A , we know that A A A contains at most r − 1 r-1 r − 1 SSM layers. On the other hand, since 0 ⃗ \vec{0} 0 has length at least D λ ( m + 1 ) D\lambda(m+1) D λ ( m + 1 ) , we know that if W < λ ( m + 1 ) W < \lambda(m+1) W < λ ( m + 1 ) , then the T-layers have no direct access to x \mathbf{x} x . This implies that there exist maps ψ \psi ψ and E E E such that M ( I ) = ψ ( E ( x ) , w ) M(I) = \psi(E(\mathbf{x}), \mathbf{w}) M ( I ) = ψ ( E ( x ) , w ) , with log ( ∣ Im ( E ) ∣ ) ≤ ( r − 1 ) λ b m \log(|\operatorname{Im}(E)|) \le(r-1)\lambda b_m log ( ∣ Im ( E ) ∣ ) ≤ ( r − 1 ) λ b m . Since n − ( r − 1 ) λ b m ≥ Ω D ( log m ) n-(r-1)\lambda b_m \ge\Omega_D(\log m) n − ( r − 1 ) λ b m ≥ Ω D ( log m ) , Lemma 12 , we know that M M M has a success probability at most 2 / 3 2/3 2/3 , when m m m is large enough.
Case 2: σ = T r \sigma= T^r σ = T r In the second case, we consider the case where σ = T r \sigma= T^r σ = T r . Let n = 2 D b m n = 2D b_m n = 2 D b m . We design the input distribution ν T r , m \nu_{T^r,m} ν T r , m as follows. To draw an input I I I from ν T r , m \nu_{T^r,m} ν T r , m , we first draw x , w \mathbf{x}, \mathbf{w} x , w uniform at random independently from { 0 , 1 } n \{0,1\}^n { 0 , 1 } n and return I = ( x , 0 ⃗ , w ) I = (\mathbf{x}, \vec{0}, \mathbf{w}) I = ( x , 0 , w ) , where 0 ⃗ \vec{0} 0 is sequence of 0 of length λ ( r − 1 ) m + n < Δ < r m \lambda(r-1)m+n < \Delta< rm λ ( r − 1 ) m + n < Δ < r m (by the choice of λ \lambda λ , such Δ \Delta Δ exists). The task H T r , m ( I ) H_{T^r,m}(I) H T r , m ( I ) asks to compute Y = ⟨ x , w ⟩ 2 = ⨁ i = 1 n x i w i Y = \langle\mathbf{x}, \mathbf{w}\rangle_2 = \bigoplus_{i=1}^{n}x_iw_i Y = ⟨ x , w ⟩ 2 = ⨁ i = 1 n x i w i . Since a T-layer can be any causal nonlinear function with window size m + 1 m+1 m + 1 , by Lemma 2, we can design some M ∈ M T r ( b m , b m , m + 1 ) M \in\mathcal{M}_{T^r}(b_m,b_m,m+1) M ∈ M T r ( b m , b m , m + 1 ) such that it first move x \mathbf{x} x across from 0 ⃗ \vec{0} 0 and computes Y Y Y .
We next show that if T r ⪯̸ A T^r \not\preceq A T r ⪯ A , then a model from M A ( B , P , W ) \mathcal{M}_A(B,P,W) M A ( B , P , W ) has a bad accuracy unless B , P , W B,P,W B , P , W are large. Since T r ⪯̸ A T^r \not\preceq A T r ⪯ A , we know that A A A contains at most r − 1 r-1 r − 1 T-layers, by the choice of Δ \Delta Δ , we know that no after 0 ⃗ \vec{0} 0 , no T layer can reach x \mathbf{x} x directly. Since there are at most SSM-layers, this implies that there exist maps ψ \psi ψ and E E E such that M ( I ) = ψ ( E ( x ) , w ) M(I) = \psi(E(\mathbf{x}), \mathbf{w}) M ( I ) = ψ ( E ( x ) , w ) , with log ( ∣ Im ( E ) ∣ ) ≤ D λ b m \log(|\operatorname{Im}(E)|) \le D\lambda b_m log ( ∣ Im ( E ) ∣ ) ≤ D λ b m . Since n − D λ b m ≥ Ω D ( log m ) n-D\lambda b_m \ge\Omega_D(\log m) n − D λ b m ≥ Ω D ( log m ) , Lemma 12 , we know that M M M has a success probability at most 2 / 3 2/3 2/3 , when m m m is large enough.
Case 3: σ = T r S s \sigma= T^rS^s σ = T r S s In the third case, we consider the case where σ = T r S s \sigma= T^rS^s σ = T r S s , with r + s ≤ D r+s \le D r + s ≤ D . Let a m = b m − 1 a_m = b_m-1 a m = b m − 1 , n = s a m n = s a_m n = s a m , and K = 32 D K = 32D K = 32 D . We design the input distribution ν T r S s , m \nu_{T^rS^s,m} ν T r S s , m as follows. To draw an input I I I from ν T r S s , m \nu_{T^rS^s,m} ν T r S s , m , we first draw x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) and w \mathbf{w} w uniform at random independently from { 0 , 1 } n \{0,1\}^n { 0 , 1 } n and draw some J J J from [ K ] [K] [ K ] uniform at random. The sampled sequence I I I combines x ( 1 ) , … , x ( K ) , J \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J x ( 1 ) , … , x ( K ) , J and w \mathbf{w} w with two 0 ⃗ \vec{0} 0 vectors with different lengths. Specifically, we put x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) at the first K n Kn K n positions. We append x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) with a sequence of 0 vectors with length Δ 1 \Delta_1 Δ 1 that satisfies Δ 1 + 1 > ( r − 1 ) ( λ ( m + 1 ) − 1 ) \Delta_1+1 > (r-1)(\lambda(m+1)-1) Δ 1 + 1 > ( r − 1 ) ( λ ( m + 1 ) − 1 ) and K n + Δ 1 + n − 1 ≤ r m Kn+\Delta_1+n-1 \le rm K n + Δ 1 + n − 1 ≤ r m .
We explain the choice of such Δ 1 \Delta_1 Δ 1 before proceeding. Notice that the position of j j j is q = K n + Δ 1 + 1 q = Kn+\Delta_1+1 q = K n + Δ 1 + 1 , and if W < λ ( m + 1 ) W < \lambda(m+1) W < λ ( m + 1 ) then at the position q q q , a r − 1 r-1 r − 1 -layer T can read input at most ( r − 1 ) ( λ ( m + 1 ) − 1 ) (r-1)(\lambda(m+1)-1) ( r − 1 ) ( λ ( m + 1 ) − 1 ) from q q q . Δ 1 + 1 > ( r − 1 ) ( λ ( m + 1 ) − 1 ) \Delta_1+1 > (r-1)(\lambda(m+1)-1) Δ 1 + 1 > ( r − 1 ) ( λ ( m + 1 ) − 1 ) implies that starting from position q q q no information from x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) is known by Tr − 1 ^{r-1} r − 1 . On the other hand, a T r − 1 T^{r-1} T r − 1 is able to copy x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) to position [ 1 + ( r − 1 ) m , K n + ( r − 1 ) m ] [1+(r-1)m,Kn+(r-1)m] [ 1 + ( r − 1 ) m , K n + ( r − 1 ) m ] . We would like to require a single layer of T with m + 1 m+1 m + 1 window size to see 1 + ( r − 1 ) m 1+(r-1)m 1 + ( r − 1 ) m at position q + n − 1 q+n-1 q + n − 1 , which implies that K n + Δ 1 + n − m ≤ 1 + ( r − 1 ) m Kn+\Delta_1+n-m \le1+(r-1)m K n + Δ 1 + n − m ≤ 1 + ( r − 1 ) m . i.e. K n + Δ 1 + n − 1 ≤ r m Kn+\Delta_1+n-1 \le rm K n + Δ 1 + n − 1 ≤ r m . Notice that r m − ( r − 1 ) λ m = Ω ( m ) rm-(r-1)\lambda m = \Omega(m) r m − ( r − 1 ) λm = Ω ( m ) . So, such a choice of Δ 1 \Delta_1 Δ 1 exists.
Then, after adding J J J to position K n + Δ 1 + 1 Kn+\Delta_1+1 K n + Δ 1 + 1 , we append another 0 ⃗ \vec{0} 0 with size D ( λ ( m + 1 ) − 1 ) D(\lambda(m+1)-1) D ( λ ( m + 1 ) − 1 ) and append w \mathbf{w} w after this 0 ⃗ \vec{0} 0 .
The existence of a model M ∈ M T r S s ( b m , b m , m + 1 ) M \in\mathcal{M}_{T^rS^s}(b_m,b_m,m+1) M ∈ M T r S s ( b m , b m , m + 1 ) that can solve the task exactly follows from the construction of I I I . The first r − 1 r-1 r − 1 layer T can move x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) to [ 1 + ( r − 1 ) m , K n + ( r − 1 ) m ] [1+(r-1)m,Kn+(r-1)m] [ 1 + ( r − 1 ) m , K n + ( r − 1 ) m ] so that another T layer has an exact access to both x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) and J J J , so can write x ( J ) \mathbf{x}^{(J)} x ( J ) after position q q q . Then, an s s s -layer SSM with space size 2 b m 2^{b_m} 2 b m can memorize x ( J ) \mathbf{x}^{(J)} x ( J ) and compute ⟨ x ( J ) , w ⟩ 2 \langle\mathbf{x}^{(J)}, \mathbf{w}\rangle_2 ⟨ x ( J ) , w ⟩ 2 . It remains to show the lower bound part. Let M ∈ M A ( B , P , W ) M \in\mathcal{M}_A(B,P,W) M ∈ M A ( B , P , W ) be a model such that T r S s ⋠ A T^rS^s \npreceq A T r S s ⋠ A . To simplify the terminology, for an S-layer that appears after r r r T-layers, we call it a later S layer, otherwise, we call it an early S-layer. Denote by S ( e ) S^{(e)} S ( e ) the set of early S-layers. Let E E E be the set of states of S layers in S ( e ) S^{(e)} S ( e ) evaluated before position q q q i.e. before j j j is read. Similarly, denote by S ( l ) S^{(l)} S ( l ) the set of late S-layers and let Z Z Z be the set of states of S layers in S ( l ) S^{(l)} S ( l ) evaluated before w w w is read.
By the design of Δ 1 \Delta_1 Δ 1 , we know that E E E is a deterministic function of x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) , while conditioned on E E E , starting from position q q q , the states of layers in S ( e ) S^{(e)} S ( e ) is a deterministic function of ( j , w ) (j,\mathbf{w}) ( j , w ) . In particular, we know that E E E can take at most 2 D λ b m 2^{D\lambda b_m} 2 D λ b m values. Similarly, we know that conditioning on Z Z Z , the states of layers in S ( l ) S^{(l)} S ( l ) after reading w \mathbf{w} w is a deterministic function of w \mathbf{w} w . In particular, Z Z Z can take at most 2 ( s − 1 ) λ b m 2^{(s-1)\lambda b_m} 2 ( s − 1 ) λ b m values, otherwise, T r S s ⪯ A T^rS^s \preceq A T r S s ⪯ A .
Together, this implies that the final output M = ψ ( E , Z , j , w ) M=\psi(E,Z,j,\mathbf{w}) M = ψ ( E , Z , j , w ) for some deterministic function ψ \psi ψ . Now for γ ∈ Im ( E ) \gamma\in\operatorname{Im}(E) γ ∈ Im ( E ) , j ∈ [ K ] j \in[K] j ∈ [ K ] and z ∈ Im ( Z ) z \in\operatorname{Im}(Z) z ∈ Im ( Z ) , we denote by
L γ , j , z = { u ∈ { 0 , 1 } n ∣ Pr w [ ψ ( γ , z , j , w ) = ⟨ u , w ⟩ 2 ] ≥ ( 7 / 12 ) } . L_{\gamma,j,z}=\{u\in\{0,1\}^n\mid\Pr_{\mathbf{w}}[\psi(\gamma,z,j,\mathbf{w})=\langle u,\mathbf{w}\rangle_2]\geq(7/12)\}. L γ , j , z = { u ∈ { 0 , 1 } n ∣ w Pr [ ψ ( γ , z , j , w ) = ⟨ u , w ⟩ 2 ] ≥ ( 7/12 )} .
By Lemma [14 ] , we know that ∣ L γ , j , z ∣ ≤ 36 |L_{\gamma,j,z}|\leq36 ∣ L γ , j , z ∣ ≤ 36 . This implies that if we denote by L γ , j = ⋃ z ∈ Im ( Z ) L_{\gamma,j}=\bigcup_{z\in\operatorname{Im}(Z)} L γ , j = ⋃ z ∈ Im ( Z ) , then we have ∣ L γ , j ∣ ≤ 36 ⋅ 2 ( s − 1 ) λ b m |L_{\gamma,j}|\leq36\cdot2^{(s-1)\lambda b_m} ∣ L γ , j ∣ ≤ 36 ⋅ 2 ( s − 1 ) λ b m . We now apply Lemma [13 ] to L γ , j L_{\gamma,j} L γ , j and x ( 1 ) , … , x ( K ) \mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)} x ( 1 ) , … , x ( K ) and get Pr x ( 1 ) , … , x ( k ) , J [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( k ) ) , J ] < 1 / 5 \Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(k)},J}[\mathbf{x}^{(J)}\in L_{\Gamma(\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(k)}),J}]<1/5 Pr x ( 1 ) , … , x ( k ) , J [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( k ) ) , J ] < 1/5 . We conclude of the proof of the case by analyzing the probability of failure of M M M .
Let p p p be the random variable of Pr w [ M ( I ) = ⟨ x ( J ) , w ⟩ ∣ x ( 1 ) , … , x ( K ) , J ] \Pr_{\mathbf{w}}[M(I)=\langle\mathbf{x}^{(J)},\mathbf{w}\rangle\mid\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J] Pr w [ M ( I ) = ⟨ x ( J ) , w ⟩ ∣ x ( 1 ) , … , x ( K ) , J ] . Assume by contradiction that E [ p ] ≥ 2 / 3 \mathbb{E}[p]\geq2/3 E [ p ] ≥ 2/3 , then we have
2 / 3 ≤ E [ p ] = E [ p ∣ p < 7 / 12 ] Pr x ( 1 ) , … , x ( K ) , J [ p < 7 / 12 ] + E [ p ∣ p ≥ 7 / 12 ] Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7 / 12 ] ≤ 7 Pr x ( 1 ) , … , x ( K ) , J [ p < 7 / 12 ] / 12 + Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7 / 12 ] ≤ 7 / 12 + Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7 / 12 ] . \begin{aligned}
2/3 &\leq\mathbb{E}[p]=\mathbb{E}[p\mid p<7/12]\Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p<7/12]\\
&\quad+\mathbb{E}[p\mid p\geq7/12]\Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p\geq7/12]\\
&\leq7\Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p<7/12]/12+\Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p\geq7/12]\\
&\leq7/12+\Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p\geq7/12].
\end{aligned} 2/3 ≤ E [ p ] = E [ p ∣ p < 7/12 ] x ( 1 ) , … , x ( K ) , J Pr [ p < 7/12 ] + E [ p ∣ p ≥ 7/12 ] x ( 1 ) , … , x ( K ) , J Pr [ p ≥ 7/12 ] ≤ 7 x ( 1 ) , … , x ( K ) , J Pr [ p < 7/12 ] /12 + x ( 1 ) , … , x ( K ) , J Pr [ p ≥ 7/12 ] ≤ 7/12 + x ( 1 ) , … , x ( K ) , J Pr [ p ≥ 7/12 ] .
This implies that Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7 / 12 ] ≥ 1 / 5 \Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p\geq7/12]\geq1/5 Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7/12 ] ≥ 1/5 . But Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7 / 12 ] ≤ Pr x ( 1 ) , … , x ( k ) , J [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( k ) ) , J ] < 1 / 5 \Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(K)},J}[p\geq7/12]\leq\Pr_{\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(k)},J}[\mathbf{x}^{(J)}\in L_{\Gamma(\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(k)}),J}]<1/5 Pr x ( 1 ) , … , x ( K ) , J [ p ≥ 7/12 ] ≤ Pr x ( 1 ) , … , x ( k ) , J [ x ( J ) ∈ L Γ ( x ( 1 ) , … , x ( k ) ) , J ] < 1/5 , which gives a contradiction. Thus, M M M must have a failure probability 1 / 3 1/3 1/3 .
Case 4: σ = S r T s \sigma=S^rT^s σ = S r T s The proof for the case where σ = S r T s \sigma=S^rT^s σ = S r T s is more technical than the other three cases. We refer to Lemma [15 ] for a detailed proof.
Analysis of Case 4: σ = S r T s \sigma=S^rT^s σ = S r T s . The case σ = S r T s \sigma=S^rT^s σ = S r T s is more technical than the other three cases. We isolate the required construction in the following lemma. For the common constant in Lemma [11 ] , we take λ > 1 \lambda>1 λ > 1 to be the minimum of the constants obtained in the four cases. Due to the length and the techniques involved in the proof, in the rest of the section, we will give a brief and compressed version of the proof. We refer the reader to the supplementary materials for a complete rigorous proof.
Lemma 15. Let D ∈ N + D\in\mathbb{N}_+ D ∈ N + . There exist constants C > 0 C>0 C > 0 and λ > 1 \lambda>1 λ > 1 such that for every r , s ∈ N + r,s\in\mathbb{N}_+ r , s ∈ N + with r + s ≤ D r+s\leq D r + s ≤ D , there exists a family of tasks { F m } m ≥ 1 \{F_m\}_{m\geq1} { F m } m ≥ 1 with the following properties. There exists a model M ′ ∈ M S r T s ( b m , b m , m + 1 ) M'\in\mathcal{M}_{S^rT^s}(b_m,b_m,m+1) M ′ ∈ M S r T s ( b m , b m , m + 1 ) , where b m : = ⌈ log 2 m ⌉ b_m:=\lceil\log_2 m\rceil b m := ⌈ log 2 m ⌉ , that solves F m F_m F m exactly. On the other hand, if A ∈ Σ ≤ D A\in\Sigma^{\leq D} A ∈ Σ ≤ D satisfies S r T s ⋠ A S^rT^s\npreceq A S r T s ⋠ A , then every M ∈ M A ( B , P , W ) M\in\mathcal{M}_A(B,P,W) M ∈ M A ( B , P , W ) with error at most 1 / 3 1/3 1/3 on the input distribution ν m \nu_m ν m must satisfy W ≥ λ ( m + 1 ) W\geq\lambda(m+1) W ≥ λ ( m + 1 ) or max { B , P } ≥ λ b m \max\{B,P\}\geq\lambda b_m max { B , P } ≥ λ b m .
We first introduce the notation used in the proof. Fix D ∈ N + D \in\mathbb{N}_{+} D ∈ N + and let d : = max { D , 5 } d := \max\{D,5\} d := max { D , 5 } . We choose the finite constants used in the induction below first, and then choose κ D > 0 \kappa_D > 0 κ D > 0 sufficiently large depending only on D D D . Set C D : = κ D + 10 d C_D := \kappa_D + 10d C D := κ D + 10 d and λ D : = 1 + d / κ D \lambda_D := 1 + d/\kappa_D λ D := 1 + d / κ D . We require κ D > 4 d D \kappa_D > 4dD κ D > 4 d D , so 1 < λ D < 1 + 1 / ( 4 D ) 1 < \lambda_D < 1 + 1/(4D) 1 < λ D < 1 + 1/ ( 4 D ) .
For sufficiently large m m m , define a m : = ⌊ κ D log 2 m ⌋ a_m := \lfloor\kappa_D \log_2 m \rfloor a m := ⌊ κ D log 2 m ⌋ , K : = 2 a m K := 2^{a_m} K := 2 a m , and b m : = ⌈ C D log 2 m ⌉ b_m := \lceil C_D \log_2 m \rceil b m := ⌈ C D log 2 m ⌉ . We further put B ∗ : = P ∗ : = ⌊ λ D b m ⌋ B_* := P_* := \lfloor\lambda_D b_m \rfloor B ∗ := P ∗ := ⌊ λ D b m ⌋ , S ∗ : = 2 B ∗ S_* := 2^{B_*} S ∗ := 2 B ∗ , Q ∗ : = 2 P ∗ Q_* := 2^{P_*} Q ∗ := 2 P ∗ , W ∗ : = ⌊ λ D ( m + 1 ) ⌋ W_* := \lfloor\lambda_D(m + 1) \rfloor W ∗ := ⌊ λ D ( m + 1 )⌋ , and w : = W ∗ − 1 w := W_* - 1 w := W ∗ − 1 . For fixed r , s ≥ 1 r,s \ge1 r , s ≥ 1 with r + s ≤ D r+s \le D r + s ≤ D , let q : = m − r q := m-r q := m − r . The chain task uses a source vector z 0 ∈ [ K ] r z_0 \in[K]^r z 0 ∈ [ K ] r and independent query blocks x 1 , … , x s ∈ [ K ] q x_1,\ldots,x_s \in[K]^q x 1 , … , x s ∈ [ K ] q .
The proof of Lemma 16 fixes constants N 1 , … , N d > 0 N_1,\ldots,N_d > 0 N 1 , … , N d > 0 , depending only on D D D , and sets n j : = ⌊ N j m / κ D ⌋ n_j := \lfloor N_jm/\kappa_D \rfloor n j := ⌊ N j m / κ D ⌋ . They are chosen so that n j = Θ D ( m ) n_j = \Theta_D(m) n j = Θ D ( m ) , every replay cut below lies strictly inside its corresponding query block, and consecutive replay cuts are separated by at least w w w . In particular, we require N j + 1 > N j + d N_{j+1} > N_j + d N j + 1 > N j + d for j ∈ [ d − 1 ] j \in[d-1] j ∈ [ d − 1 ] .
Define L 0 : = ⌊ K r / ( m 10 d S ∗ r − 1 ) ⌋ L_0 := \lfloor K^r/(m^{10d}S_*^{r-1}) \rfloor L 0 := ⌊ K r / ( m 10 d S ∗ r − 1 )⌋ . By taking κ D \kappa_D κ D sufficiently large, for all sufficiently large m m m ,
K m 12 d 2 ≤ L 0 ≤ K 2 , m 2 L 0 = o ( 1 ) . \frac{K}{m^{12d^2}} \le L_0 \le\frac{K}{2}, \qquad\frac{m^2}{L_0} = o(1). m 12 d 2 K ≤ L 0 ≤ 2 K , L 0 m 2 = o ( 1 ) .
We call a consecutive block of one or more S S S -layers a recurrent run. By Lemma 1, a recurrent run may be viewed as one S S S -layer whose state space is the product of the state spaces of the layers in the run. We next formalize the residual computation obtained after cutting a competing model inside the guard.
Definition 7 (Physical j j j -stage replay). Fix lookup tables H = ( H 1 , … , H s ) \mathcal{H} = (H_1,\ldots,H_s) H = ( H 1 , … , H s ) , a stage number 1 ≤ j ≤ d 1 \le j \le d 1 ≤ j ≤ d , an incoming first-query length n ∈ [ n j , q ] n \in[n_j,q] n ∈ [ n j , q ] , a finite source set K \mathcal{K} K , a source variable ζ ∈ K \zeta\in\mathcal{K} ζ ∈ K , and a fixed old context c c c . Let Y 1 ∈ [ K ] n Y_1 \in[K]^n Y 1 ∈ [ K ] n and Y 2 , … , Y j ∈ [ K ] q Y_2,\ldots,Y_j \in[K]^q Y 2 , … , Y j ∈ [ K ] q be the raw query blocks. Write Y : = ( Y 1 , … , Y j ) = ( Y 1 , … , Y L j ( n ) ) \mathbf{Y} := (Y_1,\ldots,Y_j) = (Y^1,\ldots,Y^{L_j(n)} ) Y := ( Y 1 , … , Y j ) = ( Y 1 , … , Y L j ( n ) ) , where L j ( n ) : = n + ( j − 1 ) q L_j(n) := n+(j-1)q L j ( n ) := n + ( j − 1 ) q .
The replay has exactly these L j ( n ) L_j(n) L j ( n ) query positions. It first forms a physical token sequence X ( 0 ) = ( X 1 ( 0 ) , … , X L j ( n ) ( 0 ) ) ∈ [ Q ∗ ] L j ( n ) \mathbf{X}^{(0)} = (X_1^{(0)},\ldots,X_{L_j(n)}^{(0)}) \in[Q_*]^{L_j(n)} X ( 0 ) = ( X 1 ( 0 ) , … , X L j ( n ) ( 0 ) ) ∈ [ Q ∗ ] L j ( n ) causally from the raw queries, where X t ( 0 ) = E t ( Y 1 : t ; H , c ) X_t^{(0)} = E_t(Y^{1:t};\mathcal{H},c) X t ( 0 ) = E t ( Y 1 : t ; H , c ) . Thus E t E_t E t may depend on the lookup tables, the old context, and every raw query symbol that has arrived by position t t t , but not on the particular source value ζ \zeta ζ . No additional token positions are introduced.
The continuation consists of j j j recurrent runs R 1 , … , R j R_1,\ldots,R_j R 1 , … , R j , separated by j − 1 j-1 j − 1 T-layers T 1 , … , T j − 1 T_1,\ldots,T_{j-1} T 1 , … , T j − 1 . Every T-layer has window at most W ∗ W_* W ∗ , every intermediate token belongs to [ Q ∗ ] [Q_*] [ Q ∗ ] , and, if S i S_i S i denotes the state space of R i R_i R i , we require ∏ i = 1 j ∣ S i ∣ ≤ S ∗ d \prod_{i=1}^j |S_i| \le S_*^d ∏ i = 1 j ∣ S i ∣ ≤ S ∗ d .
The first recurrent run may start from an arbitrary post-table state s 0 ( 1 ) = ϕ ( ζ ) ∈ S 1 s_0^{(1)} = \phi(\zeta) \in S_1 s 0 ( 1 ) = ϕ ( ζ ) ∈ S 1 . For 1 ≤ i < j 1 \le i < j 1 ≤ i < j , let t i ( n ) : = n + i q − n j − i t_i(n) := n + iq - n_{j-i} t i ( n ) := n + i q − n j − i . Immediately before R i + 1 R_{i+1} R i + 1 processes position t i ( n ) + 1 t_i(n)+1 t i ( n ) + 1 , its state may be set to s t i ( n ) ( i + 1 ) : = Ξ i s_{t_i(n)}^{(i+1)} := \Xi_i s t i ( n ) ( i + 1 ) := Ξ i , where Ξ i : = ψ i ( ζ , U 0 , Y 1 : t i ( n ) ; H , c ) \Xi_i := \psi_i(\zeta,U_0,Y^{1:t_i(n)};\mathcal{H},c) Ξ i := ψ i ( ζ , U 0 , Y 1 : t i ( n ) ; H , c ) . Here U 0 U_0 U 0 is one common auxiliary seed independent of ( ζ , Y ) (\zeta,\mathbf{Y}) ( ζ , Y ) and shared by all cuts.
After this initialization, R i + 1 R_{i+1} R i + 1 follows its declared S-layer transition and emission rules. In particular, Ξ i \Xi_i Ξ i may depend on the source and on every raw query symbol that has arrived by its cut, but not on any symbol after the cut. We denote the output of the final recurrent run at the last physical position by z ^ \hat{z} z ^ .
The definition provides no additional advice tape: only the original O D ( m ) O_D(m) O D ( m ) physical positions, one bounded token at each position, and the original raw-input arrival schedule are available.
The main technical ingredient for Case 4 is the following random-chain lemma.
Lemma 16 (Random-chain lemma). There exist a constant c D > 0 c_D > 0 c D > 0 and functions H 1 : [ K ] r × [ K ] q → [ K ] H_1 : [K]^r \times[K]^q \to[K] H 1 : [ K ] r × [ K ] q → [ K ] and H i : [ K ] × [ K ] q → [ K ] H_i : [K] \times[K]^q \to[K] H i : [ K ] × [ K ] q → [ K ] for 2 ≤ i ≤ s 2 \le i \le s 2 ≤ i ≤ s such that every H i ( ⋅ , x ) H_i(\cdot,x) H i ( ⋅ , x ) , i ≥ 2 i \ge2 i ≥ 2 , is a permutation of [ K ] [K] [ K ] , and the following hold simultaneously for every F ⊆ [ K ] r F \subseteq[K]^r F ⊆ [ K ] r with L 0 ≤ ∣ F ∣ ≤ K L_0 \le|F| \le K L 0 ≤ ∣ F ∣ ≤ K .
Let z 0 z_0 z 0 be uniform on F F F , and let x 1 , … , x s x_1,\ldots,x_s x 1 , … , x s be independent and uniform on [ K ] q [K]^q [ K ] q . Define z 1 : = H 1 ( z 0 , x 1 ) z_1 := H_1(z_0,x_1) z 1 := H 1 ( z 0 , x 1 ) and z i : = H i ( z i − 1 , x i ) z_i := H_i(z_{i-1},x_i) z i := H i ( z i − 1 , x i ) for 2 ≤ i ≤ s 2 \le i \le s 2 ≤ i ≤ s . Then:
(i) for all but an m − 100 d m^{-100d} m − 100 d fraction of x 1 ∈ [ K ] q \mathbf{x}_1 \in[K]^q x 1 ∈ [ K ] q , every fiber of z ↦ H 1 ( z , x 1 ) z \mapsto H_1(z,\mathbf{x}_1) z ↦ H 1 ( z , x 1 ) on F F F has cardinality at most m 2 m^2 m 2 ;
(ii) every physical s s s -stage replay in Definition 7 with K = F \mathcal{K}=F K = F , ζ = z 0 \zeta=z_0 ζ = z 0 , and full incoming first query n = q n=q n = q satisfies Pr [ z ^ = z s ] ≤ m − c D + o ( 1 ) \Pr[\widehat{z}=z_s] \le m^{-c_D}+o(1) Pr [ z = z s ] ≤ m − c D + o ( 1 ) .
The same table realization works uniformly over all eligible source sets F F F , fixed old contexts, and post-table physical replay maps.
Proof of Lemma 15 . Let C D C_D C D , λ D \lambda_D λ D , κ D \kappa_D κ D and H = ( H 1 , … , H s ) \mathcal{H}=(H_1,\ldots,H_s) H = ( H 1 , … , H s ) be as in Lemma 16 . We take C = C D C=C_D C = C D and λ = λ D \lambda=\lambda_D λ = λ D . Recall that q = m − r q=m-r q = m − r and K = 2 a m K=2^a m K = 2 a m . We construct F m F_m F m as the equal mixture of two tagged tasks.
The chain task. Draw z 0 ∼ Unif ( [ K ] r ) \mathbf{z}_0 \sim\operatorname{Unif}([K]^r) z 0 ∼ Unif ([ K ] r ) and x 1 , … , x s ∼ i i d Unif ( [ K ] q ) \mathbf{x}_1,\ldots,\mathbf{x}_s \mathrel{\stackrel{\mathrm{iid}}{\sim}} \operatorname{Unif}([K]^q) x 1 , … , x s ∼ iid Unif ([ K ] q ) . Define z 1 : = H 1 ( z 0 , x 1 ) \mathbf{z}_1:=H_1(\mathbf{z}_0,\mathbf{x}_1) z 1 := H 1 ( z 0 , x 1 ) and z i : = H i ( z i − 1 , x i ) \mathbf{z}_i:=H_i(\mathbf{z}_{i-1},\mathbf{x}_i) z i := H i ( z i − 1 , x i ) for 2 ≤ i ≤ s 2\le i\le s 2 ≤ i ≤ s . The input is I = ( z 0 , 0 4 D ( m + 1 ) , 0 r , x 1 , … , x s ) I=(\mathbf{z}_0,\mathbf{0}^{4D(m+1)},\mathbf{0}^r,\mathbf{x}_1,\ldots,\mathbf{x}_s) I = ( z 0 , 0 4 D ( m + 1 ) , 0 r , x 1 , … , x s ) . We call the first zero block the guard and the second zero block the scratch block. The desired output is z s \mathbf{z}_s z s .
The reach task. Let k 0 : = ⌊ m / 2 ⌋ k_0:=\lfloor m/2\rfloor k 0 := ⌊ m /2 ⌋ . Draw u 1 , … , u k 0 \mathbf{u}_1,\ldots,\mathbf{u}_{k_0} u 1 , … , u k 0 independently and uniformly from [ K ] [K] [ K ] , and independently draw J ∼ Unif ( [ k 0 ] ) J\sim\operatorname{Unif}([k_0]) J ∼ Unif ([ k 0 ]) . Place u 1 , … , u k 0 \mathbf{u}_1,\ldots,\mathbf{u}_{k_0} u 1 , … , u k 0 at the beginning of the sequence and J J J at position s m + 1 sm+1 s m + 1 , and ask the model to output u J \mathbf{u}_J u J . We use fixed left padding so that the two branches have the same length and include the branch tag in every token. Let ν m \nu_m ν m denote the resulting equal mixture.
Completeness. We first show that S r T s S^{r}T^{s} S r T s solves both branches exactly. On the chain branch, write z 0 = ( z 0 , 1 , … , z 0 , r ) \mathbf{z}_0=(z_{0,1},\ldots,z_{0,r}) z 0 = ( z 0 , 1 , … , z 0 , r ) and number the S S S -layers from bottom to top. The i i i th S S S -layer copies its input until it reads z 0 , r − i + 1 z_{0,r-i+1} z 0 , r − i + 1 , stores this coordinate across the guard, releases it at scratch position r − i + 1 r-i+1 r − i + 1 , and then resumes copying. At each release position, every higher S S S -layer has already released its own coordinate and acts as a copying layer. Hence, after the r r r S S S -layers, the scratch block contains z 0 \mathbf{z}_0 z 0 in its original order, while the query blocks remain unchanged.
Since r + q = m r+q=m r + q = m , the first T T T -layer sees ( z 0 , x 1 ) (\mathbf{z}_0,\mathbf{x}_1) ( z 0 , x 1 ) inside one window of size m + 1 m+1 m + 1 and computes z 1 \mathbf{z}_1 z 1 . Each later T T T -layer similarly sees ( z i − 1 , x i ) (\mathbf{z}_{i-1},\mathbf{x}_i) ( z i − 1 , x i ) and computes z i \mathbf{z}_i z i . Thus the final output is z s \mathbf{z}_s z s .
On the reach branch, all S S S -layers act as identities. The first s − 1 s-1 s − 1 T T T -layers shift the database to the right by m m m positions per layer, and the final T T T -layer sees the requested entry together with J J J and outputs u J \mathbf{u}_J u J . The counters, position/type tags, release modes, and branch tag require only O D ( log m ) O_D(\log m) O D ( log m ) bits, which are absorbed into b m b_m b m .
Guard reduction. Consider any prefix of a competing architecture containing h h h S S S -layers. Place a cut immediately after the source vector z 0 \mathbf{z}_0 z 0 . When crossing an S S S -layer, record its state at the current cut. When crossing an T T T -layer, move the cut to the right by at most w w w positions. Since the architecture has depth at most D D D and D w < 4 D ( m + 1 ) Dw<4D(m+1) D w < 4 D ( m + 1 ) , every such cut remains inside the guard.
Consequently, all recorded S S S -states depend only on z 0 \mathbf{z}_0 z 0 . Their tuple defines a map Γ : [ K ] r → G \Gamma:[K]^r\to\mathcal{G} Γ : [ K ] r → G with ∣ G ∣ ≤ S ∗ h |\mathcal{G}|\le S_*^h ∣ G ∣ ≤ S ∗ h . For γ ∈ G \gamma\in\mathcal{G} γ ∈ G , let F γ : = Γ − 1 ( γ ) F_\gamma:=\Gamma^{-1}(\gamma) F γ := Γ − 1 ( γ ) . After fixing Γ ( z 0 ) = γ \Gamma(\mathbf{z}_0)=\gamma Γ ( z 0 ) = γ , replaying the prefix from the recorded states shows that every prefix-output token on the original scratch and query positions is a common causal function of the raw query symbols that have arrived by that position, independent of the particular z 0 ∈ F γ \mathbf{z}_0\in F_\gamma z 0 ∈ F γ . Fix A ∈ Σ ≤ D A\in\Sigma^{\le D} A ∈ Σ ≤ D with S r T s ⊭ A S^{r}T^{s}\not\models A S r T s ⊨ A and M ∈ M A ( B ∗ , P ∗ , W ∗ ) M\in\mathcal{M}_A(B_*,P_*,W_*) M ∈ M A ( B ∗ , P ∗ , W ∗ ) . We distinguish three cases. Case 1: A A A contains fewer than s s s T-layers. We use the reach task. Starting from the final query position and tracing the dependence cone backward, every T-layer moves the cut to the left by at most w w w , while every S-layer contributes only its state across the cut. Since there are at most s − 1 s-1 s − 1 T-layers,
s m − ( s − 1 ) w = ( s − ( s − 1 ) λ D + o ( 1 ) ) m > m 2 . sm-(s-1)w=\bigl(s-(s-1)\lambda_D+o(1)\bigr)m>\frac{m}{2}. s m − ( s − 1 ) w = ( s − ( s − 1 ) λ D + o ( 1 ) ) m > 2 m .
Hence the backward dependence cone does not reach the database positions.
The final prediction is therefore a function of J J J and a message Γ ( u 1 , … , u k 0 ) \Gamma(u_1,\ldots,u_{k_0}) Γ ( u 1 , … , u k 0 ) containing at most D B ∗ DB_* D B ∗ bits. By independence and entropy subadditivity, I ( u J ; Γ , J ) ≤ D B ∗ / k 0 I(u_J;\Gamma,J)\le DB_*/k_0 I ( u J ; Γ , J ) ≤ D B ∗ / k 0 . The standard error-indicator/Fano estimate gives p ≤ ( D B ∗ / k 0 + 1 ) / log 2 K = o ( 1 ) p\le(DB_*/k_0+1)/\log_2 K=o(1) p ≤ ( D B ∗ / k 0 + 1 ) / log 2 K = o ( 1 ) . Thus the reach-task success is o ( 1 ) o(1) o ( 1 ) .
Case 2: A A A contains at least s s s T-layers but fewer than r r r S-layers. Apply the guard reduction to the entire model. There are at most S ∗ r − 1 S_*^{r-1} S ∗ r − 1 source fibers. By the definition of L 0 L_0 L 0 , the total source mass in fibers of size less than L 0 L_0 L 0 is at most m − 10 d m^{-10d} m − 10 d . Partition every remaining fiber into chunks F F F satisfying L 0 ≤ ∣ F ∣ < 2 L 0 ≤ K L_0\le|F|<2L_0\le K L 0 ≤ ∣ F ∣ < 2 L 0 ≤ K .
Fix one such chunk. Conditional on z 0 ∈ F z_0\in F z 0 ∈ F and on the query blocks, the output of the competing model is independent of the particular choice of z 0 ∈ F z_0\in F z 0 ∈ F . By Lemma 16 (i), outside an m − 100 d m^{-100d} m − 100 d fraction of first-query blocks, every fiber of z 0 ↦ H 1 ( z 0 , x 1 ) z_0\mapsto H_1(z_0,x_1) z 0 ↦ H 1 ( z 0 , x 1 ) on F F F has size at most m 2 m^2 m 2 . Since every later H i ( ⋅ , x i ) H_i(\cdot,x_i) H i ( ⋅ , x i ) is a permutation, the same bound holds for z 0 ↦ z s z_0\mapsto z_s z 0 ↦ z s . Therefore,
Pr [ s u c c e s s ∣ F ] ≤ m − 100 d + m 2 ∣ F ∣ ≤ m − 100 d + m 2 L 0 = o ( 1 ) . \Pr[\mathrm{success}\mid F]\le m^{-100d}+\frac{m^2}{|F|}\le m^{-100d}+\frac{m^2}{L_0}=o(1). Pr [ success ∣ F ] ≤ m − 100 d + ∣ F ∣ m 2 ≤ m − 100 d + L 0 m 2 = o ( 1 ) .
Adding the discarded source mass gives chain-task success o ( 1 ) o(1) o ( 1 ) .
Case 3: A A A contains at least r r r S-layers and at least s s s T-layers. Cut A A A immediately before its r r r th S-layer. The strict prefix contains exactly r − 1 r-1 r − 1 S-layers. By the guard reduction, after discarding the same negligible small-fiber mass and fixing a retained source chunk F F F , the prefix outputs on the original scratch and query positions are common causal functions of the arrived raw query symbols and are independent of the particular source z 0 ∈ F z_0\in F z 0 ∈ F .
Write the residual profile as S b 0 T S b 1 T ⋯ T S b j S^{b_0}TS^{b_1}T\cdots TS^{b_j} S b 0 T S b 1 T ⋯ T S b j , where b 0 ≥ 1 b_0\ge1 b 0 ≥ 1 and b i ≥ 0 b_i\ge0 b i ≥ 0 . Since A A A avoids S r T s S^rT^s S r T s , we have j ≤ s − 1 j\le s-1 j ≤ s − 1 . Moreover, since A A A contains at least s s s T-layers and has depth at most D D D , the number B r e s : = ∑ i b i B_{\mathrm{res}}:=\sum_i b_i B res := ∑ i b i satisfies B r e s ≤ D − r − s + 1 B_{\mathrm{res}}\le D-r-s+1 B res ≤ D − r − s + 1 .
Merge every nonempty recurrent run into one product-state S-layer. Insert identity T-layers until there are exactly s − 1 s-1 s − 1 T-layers, and insert a copying S-layer into every empty recurrent slot. A copying S-layer uses at most Q ∗ = S ∗ Q_*=S_* Q ∗ = S ∗ states. Since at most s − 1 s-1 s − 1 such layers are inserted,
S ∗ B r e s + s − 1 ≤ S ∗ D − r ≤ S ∗ d . S_*^{B_{\mathrm{res}}+s-1}\le S_*^{D-r}\le S_*^d. S ∗ B res + s − 1 ≤ S ∗ D − r ≤ S ∗ d .
The padded displayed profile need not itself have depth at most D D D . The original depth bound has already been used in the guard reduction, while Definition 7 only requires the recurrent-state product bound together with the original token and window bounds.
It remains to verify that the padded residual is a physical s s s -stage replay. Put the actual state of the first residual recurrent run immediately before the first query position into ϕ ( z 0 ) \phi(z_0) ϕ ( z 0 ) . Its input tokens on the original query positions are the source-independent causal tokens provided by the guard reduction. If s = 1 s=1 s = 1 , this already gives the one-stage replay.
Suppose s ≥ 2 s \ge2 s ≥ 2 . Let t 1 : = 2 q − n s − 1 t_1 := 2q - n_{s-1} t 1 := 2 q − n s − 1 and t : = t 1 − w t := t_1 - w t := t 1 − w . The parameter choices give 0 < t < q 0 < t < q 0 < t < q . Thus, for every payload-relative position p ≥ t 1 + 1 p \ge t_1 + 1 p ≥ t 1 + 1 , the local window immediately before the second recurrent run starts at p − w ≥ t + 1 > 0 p-w \ge t+1 > 0 p − w ≥ t + 1 > 0 . Hence this window uses only outputs produced on query positions and cannot reach the guard or scratch block. All earlier source-dependent effects are therefore contained in the actual state of the second recurrent run at t 1 t_1 t 1 , which is a legal granted state in Definition 7.
Every later prescribed cut is separated from the previous one by at least w w w . The same argument therefore iterates. Each relevant local window lies entirely after the preceding cut, and every earlier source-dependent effect is contained in the actual state of the next recurrent run. Each such state depends only on z 0 \mathbf{z}_0 z 0 , the common latent old-source information, and the raw query prefix already available at its cut. Thus the padded residual is a physical s s s -stage replay with full incoming first query n = q n=q n = q .
Lemma 16 (ii) gives chain-task success o ( 1 ) o(1) o ( 1 ) on every retained source chunk.
Conclusion. Every profile avoiding S r T s S^{r}T^{s} S r T s falls into one of the three cases above. In Case 1 its reach-task success is o ( 1 ) o(1) o ( 1 ) , while in Cases 2–3 its chain-task success is o ( 1 ) o(1) o ( 1 ) . We make no claim on the other branch and upper bound its success by one. Hence the total success is at most 1 / 2 + o ( 1 ) 1/2 + o(1) 1/2 + o ( 1 ) , and the error is at least 1 / 2 − o ( 1 ) > 1 / 3 1/2 - o(1) > 1/3 1/2 − o ( 1 ) > 1/3 for sufficiently large m m m . For an input-independently randomized model, fix its random seed, apply the deterministic bound, and average over the seed.
Proof of Lemma 16 . We use the probabilistic method. Sample H 1 H_1 H 1 by choosing all of its entries independently and uniformly from [ K ] [K] [ K ] . Independently, for every i ≥ 2 i \ge2 i ≥ 2 and every x ∈ [ K ] q \mathbf{x} \in[K]^q x ∈ [ K ] q , sample H i ( ⋅ , x ) H_i(\cdot,\mathbf{x}) H i ( ⋅ , x ) uniformly from the permutations of [ K ] [K] [ K ] . We show that with positive probability the sampled tables satisfy all required properties simultaneously.
First-table occupancy and balance. Fix an eligible source set F F F with L 0 ≤ ∣ F ∣ ≤ K L_0 \le|F| \le K L 0 ≤ ∣ F ∣ ≤ K and a first-query column x ∈ [ K ] q \mathbf{x} \in[K]^q x ∈ [ K ] q . Independence of the entries of H 1 H_1 H 1 gives
Pr [ max y ∈ [ K ] ∣ { z ∈ F : H 1 ( z , x ) = y } ∣ ≥ m 2 ] ≤ K ( ∣ F ∣ m 2 ) K − m 2 ≤ K ( e m 2 ) m 2 . \Pr\left[\max_{y \in[K]} \left|\{z \in F : H_1(z,\mathbf{x})=y\}\right| \ge m^2\right]
\le K \binom{|F|}{m^2} K^{-m^2}
\le K\left(\frac{\mathrm{e}}{m^2}\right)^{m^2}. Pr [ y ∈ [ K ] max ∣ { z ∈ F : H 1 ( z , x ) = y } ∣ ≥ m 2 ] ≤ K ( m 2 ∣ F ∣ ) K − m 2 ≤ K ( m 2 e ) m 2 .
Concentration over the K q K^q K q independent columns and a union bound over all eligible source sets show that, simultaneously for every F F F , at most an m − 100 d m^{-100d} m − 100 d fraction of first-query columns violate the occupancy bound. This proves part (i).
We also use the following simultaneous balance event. Suppose a cut at position t < q t<q t < q leaves a positive linear suffix of the first query unseen. Let Γ = γ ( z 0 , x 1 t ) \Gamma=\gamma(\mathbf{z}_0,\mathbf{x}_1^{t}) Γ = γ ( z 0 , x 1 t ) have range at most S j ∗ S_j^* S j ∗ , and let ϵ : [ K ] q → [ J ] \epsilon:[K]^q \to[J] ϵ : [ K ] q → [ J ] be a source-independent label with J ≤ m x m J \le m^{x_m} J ≤ m x m for some fixed χ < κ D \chi< \kappa_D χ < κ D . Under the original independent uniform law of z 0 ∈ F \mathbf{z}_0 \in F z 0 ∈ F and x 1 ∈ [ K ] q \mathbf{x}_1 \in[K]^q x 1 ∈ [ K ] q , the average conditional law of H 1 ( z 0 , x 1 ) H_1(\mathbf{z}_0,\mathbf{x}_1) H 1 ( z 0 , x 1 ) given ( Γ , ϵ ( x 1 ) ) (\Gamma,\epsilon(\mathbf{x}_1)) ( Γ , ϵ ( x 1 )) has total variation distance at most m − κ D / 3 m^{-\kappa_D/3} m − κ D /3 from Unif ( [ K ] ) \operatorname{Unif}([K]) Unif ([ K ]) .
For fixed Γ \Gamma Γ and ϵ \epsilon ϵ , the expected total variation distance over H 1 H_1 H 1 is at most 1 2 K S j ∗ J / ( ∣ F ∣ K q ) \frac{1}{2}\sqrt{K S_j^* J/(|F|K^q)} 2 1 K S j ∗ J / ( ∣ F ∣ K q ) . A bounded-differences estimate is strong enough to union bound over all eligible source sets, early-state maps, and source-independent labels used below. The same argument applies when the first table is a random permutation table. For an incoming first-query length n ∈ [ n j , q ] n \in[n_j,q] n ∈ [ n j , q ] , the complete label at level j j j will have rate strictly below N j N_j N j , whereas the shortest incoming query has entropy n j log 2 K = ( N j m + o ( m ) ) log 2 m n_j \log_2 K = (N_jm+o(m))\log_2 m n j log 2 K = ( N j m + o ( m )) log 2 m . All balance estimates are taken under the original input law, before conditioning on a successful group or selecting a representative. The mutual induction. Fix a sufficiently large constant ρ D \rho_D ρ D depending only on D D D . For every 1 ≤ j ≤ d 1 \le j \le d 1 ≤ j ≤ d , we prove simultaneously a program-hardness statement G j G_j G j and a prefix-capture statement C j C_j C j .
The statement G j G_j G j is as follows. The initial live key k k k is uniform on [ K ] [K] [ K ] and independent of the raw queries. The computation is a physical j j j -stage replay whose first query has length n j n_j n j , followed by j − 1 j-1 j − 1 fresh q q q -symbol query blocks, and whose target is the corresponding j j j -fold random-permutation composition. Its success probability is at most ϵ j : = m − c j κ D \epsilon_j := m^{-c_j\kappa_D} ϵ j := m − c j κ D for some constant c j > 0 c_j > 0 c j > 0 . The same bound holds for every incoming first-query length n ∈ [ n j , q ] n \in[n_j,q] n ∈ [ n j , q ] , after shifting all later absolute cuts by n − n j n-n_j n − n j .
The companion statement C j C_j C j makes the capture property precise. Consider any legal continuation arising in the induction for which the source is uniform on a set of size at least K / m ρ D K/m^{\rho_D} K / m ρ D and the current live-key map has occupancy at most m ρ D m^{\rho_D} m ρ D . Fix any source-independent old context, but leave the bounded source-dependent ancestor-state row unconditioned under the source law. At the prescribed cut, let ξ \xi ξ be the arrived prefix of the first unresolved raw query and let V V V denote the corresponding source-independent old physical word. Then there exists a source-independent list map P \mathcal{P} P such that ∣ P ( v ) ∣ ≤ m A j m + o ( m ) |\mathcal{P}(v)| \le m^{A_jm+o(m)} ∣ P ( v ) ∣ ≤ m A j m + o ( m ) for every realized v v v , and
Pr [ Succ ∧ ξ ∉ P ( V ) ] ≤ ϵ j . \Pr[\operatorname{Succ} \land\xi\notin\mathcal{P}(V)] \le\epsilon_j. Pr [ Succ ∧ ξ ∈ / P ( V )] ≤ ϵ j .
Here Succ \operatorname{Succ} Succ is the branch-masked success event of the continuation. The source, context, and ancestor-history families that arise in the induction have cardinality at most K O D ( m ) K^{O_D(m)} K O D ( m ) , so all events above can be required simultaneously.
The constants are chosen in the noncircular order ( G 1 , N 1 ) , ( C 1 , A 1 ) , ( G 2 , N 2 ) , ( C 2 , A 2 ) , … (G_1,N_1),(C_1,A_1),(G_2,N_2),(C_2,A_2),\ldots ( G 1 , N 1 ) , ( C 1 , A 1 ) , ( G 2 , N 2 ) , ( C 2 , A 2 ) , … . At level j j j , the finite training-tree size and error thresholds are first chosen from lower-stage rates. We then choose N j N_j N j larger than the total rate of the complete source-independent label needed to prove G j G_j G j , and afterward choose A j A_j A j larger than the new capture-certificate rate. Since D D D is fixed, κ D \kappa_D κ D is chosen last so that every cut, entropy, occupancy, and moment inequality has positive slack.
Base case. The base case G 1 G_1 G 1 is the single-run random-permutation bound. Fix the initial-state map, transition and emission rules, and output map of one recurrent run. For a fixed query column, every source-independent physical encoding produces one of at most Q ∗ n Q_*^n Q ∗ n physical words.
Let θ : = 1 2 m − κ D / 16 \theta:= \frac{1}{2}m^{-\kappa_D/16} θ := 2 1 m − κ D /16 and h : = ⌈ θ K ⌉ h := \lceil\theta K\rceil h := ⌈ θ K ⌉ . For a fixed physical word, correctness on h h h distinct keys forces h h h prescribed distinct constraints on a uniform random permutation. Hence
Pr [ agreement on at least h keys ] ≤ ( K h ) 1 ( K ) h = 1 h ! . \Pr[\text{agreement on at least } h \text{ keys}] \le\binom{K}{h}\frac{1}{(K)_h}=\frac{1}{h!}. Pr [ agreement on at least h keys ] ≤ ( h K ) ( K ) h 1 = h ! 1 .
Thus one query column is bad for a fixed machine template with probability at most Q ∗ n / h ! Q_*^n/h! Q ∗ n / h ! .
The query columns are independent. For a sufficiently large fixed polynomial J b a d J_{\mathrm{bad}} J bad in m m m ,
Pr [ at least J b a d bad columns ] ≤ ( K n J b a d ) ( Q ∗ n h ! ) J b a d . \Pr[\text{at least } J_{\mathrm{bad}} \text{ bad columns}] \le\binom{K^n}{J_{\mathrm{bad}}}\left(\frac{Q_*^n}{h!}\right)^{J_{\mathrm{bad}}}. Pr [ at least J bad bad columns ] ≤ ( J bad K n ) ( h ! Q ∗ n ) J bad .
Choosing the degree of J b a d J_{\mathrm{bad}} J bad sufficiently large makes the union bound over all machine templates valid, while J b a d / K n = o ( 1 ) J_{\mathrm{bad}}/K^n=o(1) J bad / K n = o ( 1 ) . This proves G 1 G_1 G 1 , uniformly over the permitted incoming lengths and fixed-prefix slices. The same independent-column argument after separating heavy and diffuse prefix atoms proves C 1 C_1 C 1 .
The capture step. Assume that all lower statements have been proved. We use the following certificate estimate, which is the only property of the analytical training tree needed below.
After applying the lower capture statements from the leaves upward, normalize every later unresolved raw prefix by its capture-list rank, inverse rank, and the finite branch information needed to identify the corresponding fixed-prefix slice. Suppose the remaining unresolved prefix distribution has every atom of mass at most 1 / N 1/N 1/ N . If the current continuation has success mass p p p , then for some R j = O D ( 1 ) R_j=O_D(1) R j = O D ( 1 ) ,
p R j ≤ θ j + η b a d , j + η c o l l , j + M j N , M j ≤ m A ~ j m + o ( m ) . p^{R_j}\leq\theta_j+\eta_{\mathrm{bad},j}+\eta_{\mathrm{coll},j}+\frac{M_j}{N},\qquad M_j\leq m^{\widetilde{A}_jm+o(m)}. p R j ≤ θ j + η bad , j + η coll , j + N M j , M j ≤ m A j m + o ( m ) .
Here θ j \theta_j θ j , η b a d , j \eta_{\mathrm{bad},j} η bad , j , and η c o l l , j \eta_{\mathrm{coll},j} η coll , j are m − Ω D ( κ D ) m^{-\Omega_D(\kappa_D)} m − Ω D ( κ D ) . The quantity M j M_j M j counts the normalized certificates consisting of the lower capture-list ranks, inverse-context ranks, branch indices, and the finite training fingerprint.
To see the estimate, sample R j R_j R j independent analytical training branches. Outside the bad and collision events, every joint success determines one of the M j M_j M j normalized certificates. The representative attached to a certificate is tested only on its own arrived raw prefixes and on legal causal frontier states. In particular, the validity test is performed before representatives are grouped. After a certificate is fixed, a diffuse unresolved prefix contributes mass at most 1 / N 1/N 1/ N . Summing over the M j M_j M j certificates gives the displayed bound. This is also why replacing a representative inside a normalized group never tests it against a foreign raw-prefix assignment.
We now prove C j C_j C j . At each source-independent old context, place every arrived-prefix value whose posterior mass exceeds m − A j m m^{-A_jm} m − A j m into the capture list. There are fewer than m A j m m^{A_jm} m A j m such values. Restrict the remaining source measure to the other values without renormalizing. Every remaining atom then has mass at most 1 / N 1/N 1/ N for N = m A j m N=m^{A_jm} N = m A j m . Choose A j > A ~ j A_j>\widetilde{A}_j A j > A j . The certificate term satisfies
M j N ≤ m − ( A j − A ~ j ) m + o ( m ) = o ( 1 ) . \frac{M_j}{N}\leq m^{-(A_j-\widetilde{A}_j)m+o(m)}=o(1). N M j ≤ m − ( A j − A j ) m + o ( m ) = o ( 1 ) .
The certificate estimate shows that the successful mass remaining outside the capture list is at most ϵ j \epsilon_j ϵ j after decreasing c j c_j c j if necessary. This proves C j C_j C j .
Closing the program bound. We next prove G j G_j G j . Fix an incoming first-query length n ∈ [ n j , q ] n\in[n_j,q] n ∈ [ n j , q ] . Write the second query as x 2 = ( ξ , y 2 ) x_2=(\xi,y_2) x 2 = ( ξ , y 2 ) , where ξ ∈ [ K ] q − n j − 1 \xi\in[K]^{q-n_j-1} ξ ∈ [ K ] q − n j − 1 and y 2 ∈ [ K ] n j − 1 y_2\in[K]^{n_j-1} y 2 ∈ [ K ] n j − 1 . Let c : = n + q − n j − 1 c:=n+q-n_{j-1} c := n + q − n j − 1 be the first replay cut and put t : = c − w t:=c-w t := c − w . The parameter choices give 0 < t < n 0<t<n 0 < t < n , so a positive linear suffix of x 1 x_1 x 1 remains unseen at the balance cut.
Let v ( x 1 , ξ ) : = X t + 1 : c ( 0 ) ( x 1 , ξ ) ∈ [ Q ∗ ] w \mathbf{v}(x_1,\xi):=X^{(0)}_{t+1:c}(x_1,\xi)\in[Q_*]^w v ( x 1 , ξ ) := X t + 1 : c ( 0 ) ( x 1 , ξ ) ∈ [ Q ∗ ] w . This old physical word may depend on the complete first query and on the arrived second-query prefix ξ \xi ξ , but not on the source or on the remaining raw future.
Apply C j − 1 C_{j-1} C j − 1 at this cut, leaving the bounded ancestor-state row unconditioned under the source law. For each v ∈ [ Q ∗ ] w \mathbf{v}\in[Q_*]^w v ∈ [ Q ∗ ] w , let P ( v ) P(\mathbf{v}) P ( v ) be its captured-prefix list. Put A < j : = max i < j A i A^{<j}:=\max_{i<j}A_i A < j := max i < j A i and A ∗ : = m A < j m + o ( m ) A^*:=m^{A^{<j}m+o(m)} A ∗ := m A < j m + o ( m ) . For each ξ \xi ξ , define B ξ : = { v : ξ ∈ P ( v ) } B_\xi:=\{\mathbf{v}:\xi\in P(\mathbf{v})\} B ξ := { v : ξ ∈ P ( v )} . Double counting gives ∑ ξ ∣ B ξ ∣ ≤ A ∗ Q ∗ w \sum_\xi|B_\xi|\leq A^*Q_*^w ∑ ξ ∣ B ξ ∣ ≤ A ∗ Q ∗ w . Hence, for every cutoff L c t x ≥ 1 L_{\mathrm{ctx}}\geq1 L ctx ≥ 1 ,
Pr [ ∣ B ξ ∣ > L c t x ] ≤ A ∗ Q ∗ w ( K q − n j − 1 L c t x ) . \Pr[|B_\xi|>L_{\mathrm{ctx}}]\leq\frac{A^*Q_*^w}{(K^{q-n_{j-1}}L_{\mathrm{ctx}})}. Pr [ ∣ B ξ ∣ > L ctx ] ≤ ( K q − n j − 1 L ctx ) A ∗ Q ∗ w .
All label fields other than the inverse-context rank have rates already fixed by lower stages. We choose L c t x L_{\mathrm{ctx}} L ctx and then N j N_j N j so that the exceptional prefix mass is m − Ω D ( κ D ) m^{-\Omega_D(\kappa_D)} m − Ω D ( κ D ) and the rank of v ( x 1 , ξ ) \mathbf{v}(x_1,\xi) v ( x 1 , ξ ) inside B ξ B_\xi B ξ , together with the normalized training fingerprint and all previously fixed alignment ranks, gives a complete source-independent label ε = ε ( x 1 ) \varepsilon=\varepsilon(x_1) ε = ε ( x 1 ) satisfying ∣ Im ( x 1 ) ∣ ≤ m X j m + o ( m ) |\operatorname{Im}(x_1)|\leq m^{X_jm+o(m)} ∣ Im ( x 1 ) ∣ ≤ m X j m + o ( m ) for some χ ≤ N j \chi\leq N_j χ ≤ N j . A sentinel is used on excluded inputs. The branch and training indices are fixed on the current slice and suppressed from the notation.
For each label, choose one full first-query representative from its group. The representative is analytical lookup data indexed by the label; its raw coordinates are not another field of the label. Let Γ = γ ( z 0 , x 1 1 : t ) \Gamma=\gamma(z_0,x_1^{1:t}) Γ = γ ( z 0 , x 1 1 : t ) be the state of the preceding recurrent run at the balance cut. For a fixed label value a a a , early row g g g , and live key k ∈ [ K ] k\in[K] k ∈ [ K ] , let q a , g ( k ) q_{a,g}(k) q a , g ( k ) be the maximum fresh branch-masked continuation success of the selected representative over all legal causal choices of the current frontier state and all later frontier policies. The normalization procedure retains a successful training sample only when its own representative has fresh continuation value greater than a fixed δ 0 > 0 \delta_0 > 0 δ 0 > 0 . Samples failing this test are included in η b a d , j \eta_{\mathrm{bad},j} η bad , j . Thus every retained successful sample with label a a a , row g g g , and live key k k k satisfies q a , g ( k ) > δ 0 q_{a,g}(k) > \delta_0 q a , g ( k ) > δ 0 .
For each fixed ( a , g ) (a,g) ( a , g ) and every k k k , choose one deterministic maximizing legal causal policy. Each chosen frontier state depends only on the raw history available at its own cut. Therefore these keywise choices paste into one legal lower-stage physical continuation on the same positions; no choice depends on an unseen raw suffix.
For a fixed analytical training tree, let Cross o p t : = E [ q e , Γ ( K l i v e ) ] \operatorname{Cross}^{\mathrm{opt}} := \mathbb{E}[q_{e,\Gamma}(\mathbf{K}_{\mathrm{live}})] Cross opt := E [ q e , Γ ( K live )] under the original source and query law, and let H H H be the retained training-success mass. The pointwise own-source test, the simultaneous balance event, and G j − 1 G_{j-1} G j − 1 give
δ 0 H ≤ Cross o p t ≤ ϵ j − 1 + δ T V . \delta_0 H \leq\operatorname{Cross}^{\mathrm{opt}} \leq\epsilon_{j-1}+\delta_{\mathrm{TV}}. δ 0 H ≤ Cross opt ≤ ϵ j − 1 + δ TV .
Indeed, the first inequality follows pointwise. For the second, apply the balance estimate once to the complete label e e e and early row Γ \Gamma Γ . After replacing the conditional live-key law by uniform, the pasted optimizing policy is one admissible lower-stage physical replay, so G j − 1 G_{j-1} G j − 1 applies.
Averaging over the analytical training tree and combining this estimate with the certificate bound gives
p R j ≤ ϵ j − 1 + δ T V δ 0 + θ j + η b a d , j + η c o l l , j . p^{R_j} \leq\frac{\epsilon_{j-1}+\delta_{\mathrm{TV}}}{\delta_0}+\theta_j+\eta_{\mathrm{bad},j}+\eta_{\mathrm{coll},j}. p R j ≤ δ 0 ϵ j − 1 + δ TV + θ j + η bad , j + η coll , j .
All expectations over the old source and first query retain their original weights. Excluded inputs are represented by the sentinel or by validity indicators, and the balance estimate is applied before averaging over fixed-prefix slices.
The recursive parameter choice leaves a positive exponent after taking the R j R_j R j th root, and hence proves G j G_j G j . Notice that the argument uses the optimizing causal frontier policy only as an analytical upper bound; we do not assert that the competing model’s actual future frontier states have the same fresh continuation success.
Returning to the iid first stage. Fix an eligible source chunk F F F with L 0 ≤ ∣ F ∣ ≤ K L_0 \leq|F| \leq K L 0 ≤ ∣ F ∣ ≤ K . By part (i), outside an m − 100 d m^{-100d} m − 100 d fraction of first-query columns, the map z 0 ↦ H 1 ( z 0 , x 1 ) \mathbf{z}_0 \mapsto H_1(\mathbf{z}_0,\mathbf{x}_1) z 0 ↦ H 1 ( z 0 , x 1 ) on F F F has occupancy at most m 2 m^2 m 2 . Every later permutation preserves this occupancy, and the bad-column mass is charged under the original first-query law.
Repeat the G s G_s G s certificate construction with full incoming first-query length q q q . Fix the arrived second-query prefix ξ \xi ξ , the inverse-branch indices, and the analytical training tree. On this slice, the complete source-independent label has the form e ξ ( x 1 ) e_\xi(\mathbf{x}_1) e ξ ( x 1 ) and depends only on the first query.
Write x 2 = ( ξ , y 2 ) \mathbf{x}_2=(\xi,y_2) x 2 = ( ξ , y 2 ) and let Y : = ( y 2 , x 3 , … , x s ) Y:=(y_2,x_3,\ldots,x_s) Y := ( y 2 , x 3 , … , x s ) be the remaining fresh raw future. The only change from the permutation-first-stage argument is the first balance step, where we use the simultaneous iid first-table balance event proved above.
Conditional on the first live key z 1 z_1 z 1 , the complete label, and the early row, all old variables have a joint conditional law independent of Y Y Y . This conditional law can be represented using the common auxiliary seed allowed in Definition 7. For fixed label and early row, the representative’s physical token sequence and replay rules are fixed. Any remaining old-variable dependence can therefore affect only the permitted frontier states, and each such state depends only on the raw prefix available at its own cut. Thus the continuation remains in the physical replay class.
Applying the optimized crossed-certificate argument on every fixed-prefix slice and then averaging under the original prefix distribution gives Pr [ z ^ = z s ] ≤ m − c D + o ( 1 ) \Pr[\widehat{\mathbf{z}}=\mathbf{z}_s] \leq m^{-c_D}+o(1) Pr [ z = z s ] ≤ m − c D + o ( 1 ) . For s = 1 s=1 s = 1 , the iid-column single-run factorial argument applies directly.
All occupancy, balance, capture, and program events above are simultaneous before the source chunk and the post-table continuation are selected. Their intersection therefore has positive probability. Fixing one lookup-table realization in this intersection proves the lemma.
Now we are able to give the proof of Theorem 4. Theorem 4 follows immediately from Lemma 10, Lemma 9 and Lemma 11 .
Proof of Theorem 4. Let C 2 ( τ ) C_2(\tau) C 2 ( τ ) be size-2 cover of the target profile τ \tau τ . By Lemma 11 , for every profile σ ∈ C 2 ( τ ) \sigma\in C_2(\tau) σ ∈ C 2 ( τ ) , there exists a family of task { H σ , m } \{H_{\sigma,m}\} { H σ , m } , such that there exists a model M ′ ∈ M σ ( b m , b m , m + 1 ) M' \in\mathcal{M}_{\sigma}(b_m,b_m,m+1) M ′ ∈ M σ ( b m , b m , m + 1 ) that can solve H σ , m H_{\sigma,m} H σ , m exactly, where b m = C log m b_m=C\log m b m = C log m , while every hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , H σ , m ) ≤ 1 / 3 \operatorname{err}(M,H_{\sigma,m}) \le1/3 err ( M , H σ , m ) ≤ 1/3 , for some input distribution ν σ , m \nu_{\sigma,m} ν σ , m must satisfy W ≥ λ ( m + 1 ) W \ge\lambda(m+1) W ≥ λ ( m + 1 ) or max { B , P } ≥ λ b m \max\{B,P\} \ge\lambda b_m max { B , P } ≥ λ b m , if A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D , σ ⪯̸ A \sigma\not\preceq A σ ⪯ A . By Lemma 10, by combining the mixture of these tasks, we obtain a single family of tasks { G τ , m } \{G_{\tau,m}\} { G τ , m } such that for every hybrid model M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) that satisfies err ( M , G τ , m ) ≤ 1 / ( 4 D ) \operatorname{err}(M,G_{\tau,m}) \le1/(4D) err ( M , G τ , m ) ≤ 1/ ( 4 D ) , must satisfy W ≥ λ ( m + 1 ) W \ge\lambda(m+1) W ≥ λ ( m + 1 ) or max { B , P } ≥ λ C log m \max\{B,P\} \ge\lambda C\log m max { B , P } ≥ λ C log m , if A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D and ∃ σ ∈ C 2 ( τ ) , σ ⪯̸ A \exists\sigma\in C_2(\tau), \sigma\not\preceq A ∃ σ ∈ C 2 ( τ ) , σ ⪯ A . On the other hand, there exists a model M ′ ∈ M τ ( C log m , C log m , m + 1 ) M' \in\mathcal{M}_{\tau}(C\log m,C\log m,m+1) M ′ ∈ M τ ( C log m , C log m , m + 1 ) that can solve G τ , m G_{\tau,m} G τ , m exactly. Finally, by Lemma 9, if τ ⪯̸ A \tau\not\preceq A τ ⪯ A , then there must be some σ ∈ C 2 ( τ ) \sigma\in C_2(\tau) σ ∈ C 2 ( τ ) such that σ ⪯̸ A \sigma\not\preceq A σ ⪯ A , which completes the proof of Theorem 4.
Proof of Theorem 1
Given Theorem 3 and Theorem 4, the proof of Theorem 1 is almost immediate.
Proof of Theorem 1. Let α : = comp ( τ ) \alpha:= \operatorname{comp}(\tau) α := comp ( τ ) . Let { F τ , ϵ , m o r d } m ≥ 1 \{F^{\mathrm{ord}}_{\tau,\epsilon,m}\}_{m\ge1} { F τ , ϵ , m ord } m ≥ 1 be the task family constructed in Theorem 3 for the wrong-order case, with input distribution μ m o r d \mu^{\mathrm{ord}}_m μ m ord , and let { F τ , m i n s } m ≥ 1 \{F^{\mathrm{ins}}_{\tau,m}\}_{m\ge1} { F τ , m ins } m ≥ 1 be the task family constructed in Theorem 4 for the insufficient-profile case, with input distribution μ m i n s \mu^{\mathrm{ins}}_m μ m ins . That common constant factor can be selected so that Theorem 3 and Theorem 4 still hold.
We combine the two task families into a single task family { F τ , ϵ , m } m ≥ 1 \{F_{\tau,\epsilon,m}\}_{m\ge1} { F τ , ϵ , m } m ≥ 1 . Sample J J J uniformly from { 0 , 1 } \{0,1\} { 0 , 1 } . Conditioned on J = 0 J=0 J = 0 , sample an input from μ m o r d \mu^{\mathrm{ord}}_m μ m ord and ask the model to compute F τ , ϵ , m o r d F^{\mathrm{ord}}_{\tau,\epsilon,m} F τ , ϵ , m ord ; conditioned on J = 1 J=1 J = 1 , sample an input from μ m i n s \mu^{\mathrm{ins}}_m μ m ins and ask the model to compute F τ , m i n s F^{\mathrm{ins}}_{\tau,m} F τ , m ins . We include J J J as an additional tag in every input token and pad the two types of inputs to the same sequence length. Denote the resulting input distribution by μ m \mu_m μ m .
By the completeness constructions of Theorems 3 and 4, both component tasks can be solved exactly by models with profile τ \tau τ . Using the tag J J J to select between the corresponding layer maps, as in the selector construction in Lemma 10, we obtain a single model M τ , m ∈ M τ ( B τ , m , P τ , m , W τ , m ) M_{\tau,m} \in\mathcal{M}_{\tau}(B_{\tau,m},P_{\tau,m},W_{\tau,m}) M τ , m ∈ M τ ( B τ , m , P τ , m , W τ , m ) that solves F τ , ϵ , m F_{\tau,\epsilon,m} F τ , ϵ , m exactly. After increasing the constant C τ , ϵ C_{\tau,\epsilon} C τ , ϵ if needed, B τ , m , P τ , m ≤ C τ , ϵ log m B_{\tau,m},P_{\tau,m} \le C_{\tau,\epsilon}\log m B τ , m , P τ , m ≤ C τ , ϵ log m , W τ , m ≤ m + 1 W_{\tau,m} \le m+1 W τ , m ≤ m + 1 . Moreover, taking the union of the two vocabularies and padding the inputs preserves ∣ V ϵ , m ∣ ≤ poly ϵ ( m ) , L ϵ , m ≤ poly ϵ ( m ) |\mathcal{V}_{\epsilon,m}| \le\operatorname{poly}_{\epsilon}(m),L_{\epsilon,m} \le\operatorname{poly}_{\epsilon}(m) ∣ V ϵ , m ∣ ≤ poly ϵ ( m ) , L ϵ , m ≤ poly ϵ ( m ) .
It remains to prove soundness. Fix an architecture profile A ∈ Σ ≤ D A \in\Sigma^{\le D} A ∈ Σ ≤ D such that τ ⪯̸ A \tau\not\preceq A τ ⪯ A , and let M ∈ M A ( B , P , W ) M \in\mathcal{M}_{A}(B,P,W) M ∈ M A ( B , P , W ) satisfy err μ m ( M , F τ , ϵ , m ) ≤ 1 8 D \operatorname{err}_{\mu_m}(M,F_{\tau,\epsilon,m}) \le\frac{1}{8D} err μ m ( M , F τ , ϵ , m ) ≤ 8 D 1 . Let ϵ o r d \epsilon_{\mathrm{ord}} ϵ ord and ϵ i n s \epsilon_{\mathrm{ins}} ϵ ins denote the conditional errors of M M M conditioned on J = 0 J=0 J = 0 and J = 1 J=1 J = 1 , respectively. Since J J J is uniform,
err μ m ( M , F τ , ϵ , m ) = 1 2 ( ϵ o r d + ϵ i n s ) . \operatorname{err}_{\mu_m}(M,F_{\tau,\epsilon,m})=\frac{1}{2}\left(\epsilon_{\mathrm{ord}}+\epsilon_{\mathrm{ins}}\right). err μ m ( M , F τ , ϵ , m ) = 2 1 ( ϵ ord + ϵ ins ) .
Therefore, ϵ o r d , ϵ i n s ≤ 2 err μ m ( M , F τ , ϵ , m ) ≤ 1 4 D \epsilon_{\mathrm{ord}},\epsilon_{\mathrm{ins}} \le2\operatorname{err}_{\mu_m}(M,F_{\tau,\epsilon,m}) \le\frac{1}{4D} ϵ ord , ϵ ins ≤ 2 err μ m ( M , F τ , ϵ , m ) ≤ 4 D 1 . We now distinguish two cases. Case 1: α ⪯̸ A \alpha\not\preceq A α ⪯ A . Since e o r d ≤ 1 4 D ≤ 1 3 e_{\mathrm{ord}} \le\frac{1}{4D} \le\frac{1}{3} e ord ≤ 4 D 1 ≤ 3 1 , Theorem 3 applies to the wrong-order component and gives
W ≥ c τ m 1 / ϵ or max { B , P } ≥ c τ m . W \ge c_{\tau}m^{1/\epsilon}\qquad\text{or}\qquad\max\{B,P\} \ge c_{\tau}m. W ≥ c τ m 1/ ϵ or max { B , P } ≥ c τ m .
Case 2: α ⪯ A \alpha\preceq A α ⪯ A . Since τ ⪯̸ A \tau\not\preceq A τ ⪯ A by assumption, we have α ⪯ A \alpha\preceq A α ⪯ A and τ ⪯̸ A \tau\not\preceq A τ ⪯ A . Thus A A A is in the insufficient-profile case. Since e i n s ≤ 1 4 D e_{\mathrm{ins}} \le\frac{1}{4D} e ins ≤ 4 D 1 , Theorem 4 applies to the insufficient-profile component and gives
W ≥ λ τ ( m + 1 ) or max { B , P } ≥ λ τ C τ log m . W \ge\lambda_{\tau}(m+1)\qquad\text{or}\qquad\max\{B,P\} \ge\lambda_{\tau}C_{\tau}\log m. W ≥ λ τ ( m + 1 ) or max { B , P } ≥ λ τ C τ log m .
The two cases are exhaustive, since either α ⪯̸ A \alpha\not\preceq A α ⪯ A or α ⪯ A \alpha\preceq A α ⪯ A . This proves both soundness statements and completes the proof.
Omitted Details in Section 2.2
We provide proofs to various theorems in the main body. We first prove the core hardness result for tasks with a dominant TS architecture. We then look specifically at the two tasks, segmented retrieval and exact copy, showing that these tasks are indeed in this family of tasks. Lastly, we provide constructions for these two tasks that use less window and state-size than what is provably required for ST architectures.
Hardness Results
We begin with the core assumption for all tasks with a TS dominant architecture before quickly following with the statement and proof of the SSM → \to → TF theorem. After establishing this result, we show the specific bounds for exact copy and segmented retrieval, where the majority of the proofs come from defining the hard data distribution and cut position τ \tau τ .
Assumption 1. Let F F F be a sequence map from V L \mathcal{V}^{L} V L to Y \mathcal{Y} Y . We assume F F F satisfies the following property: there exists an index τ \tau τ , a set of prefixes U ⊆ V τ × { 0 , 1 } τ \mathcal{U} \subseteq\mathcal{V}^{\tau} \times\{0,1\}^{\tau} U ⊆ V τ × { 0 , 1 } τ , and a set of suffixes Q ⊆ V L − τ × { 0 , 1 } L − τ \mathcal{Q} \subseteq\mathcal{V}^{L-\tau} \times\{0,1\}^{L-\tau} Q ⊆ V L − τ × { 0 , 1 } L − τ such that the map Γ : U → Y ∣ Q ∣ \Gamma:\mathcal{U} \to\mathcal{Y}^{|\mathcal{Q}|} Γ : U → Y ∣ Q ∣ defined as
Γ ( u ) : = ( F ( u , q ) ) q ∈ Q ∈ Y ∣ Q ∣ , \Gamma(u) := (F(u,q))_{q\in\mathcal{Q}} \in\mathcal{Y}^{|\mathcal{Q}|}, Γ ( u ) := ( F ( u , q ) ) q ∈ Q ∈ Y ∣ Q ∣ , is an injection. We call τ \tau τ the cut.
Theorem 5 (SSM → \to → TF Cut, Restated). Consider any function F F F that satisfies Assumption 1. Let M M M be a model of architecture ST modeling F F F with state S S S and window W W W . Suppose that the cut position is bounded as τ ≤ L − W \tau\le L-W τ ≤ L − W . If M M M computes f : V L → Y f:\mathcal{V}^{L} \to\mathcal{Y} f : V L → Y correctly on all the inputs, then ∣ S ∣ ≥ ∣ U ∣ |S| \ge|\mathcal{U}| ∣ S ∣ ≥ ∣ U ∣ .
Proof. Let S t S_t S t denote the state at position t t t . Let u , u ′ ∈ U u,u' \in\mathcal{U} u , u ′ ∈ U be prefixes such that S τ ( u ) = S τ ( u ′ ) S_{\tau}(u)=S_{\tau}(u') S τ ( u ) = S τ ( u ′ ) . Since the SSM is deterministic, at time t ≥ τ t \ge\tau t ≥ τ , the SSM states remain identical, i.e.
S t ( u , q ) = S t ( u ′ , q ) , ∀ t > τ , S_t(u,q)=S_t(u',q),\ \forall t>\tau, S t ( u , q ) = S t ( u ′ , q ) , ∀ t > τ ,
and the SSM layer outputs are the same. Since the TF layer can only access the tokens from position L − W L-W L − W to L L L , and τ ≤ L − W \tau\le L-W τ ≤ L − W , we have that the model outputs are also the same, i.e.
M ( u , q ) = M ( u ′ , q ) . M(u,q)=M(u',q). M ( u , q ) = M ( u ′ , q ) .
Now assume M M M computes f f f correctly on all inputs and the map Γ \Gamma Γ of a set of prefixes U \mathcal{U} U is injective (Assumption 1). If two prefixes u ≠ u ′ u \ne u' u = u ′ outputs the same state at the cut position τ \tau τ , then by the theorem we have
M ( u , q ) = f ( u , q ) = f ( u ′ , q ) = M ( u ′ , q ) , ∀ q ∈ Q , M(u,q)=f(u,q)=f(u',q)=M(u',q),\qquad\forall q\in\mathcal{Q}, M ( u , q ) = f ( u , q ) = f ( u ′ , q ) = M ( u ′ , q ) , ∀ q ∈ Q ,
which immediately shows that Γ ( u ) = Γ ( u ′ ) \Gamma(u)=\Gamma(u') Γ ( u ) = Γ ( u ′ ) . Since the map Γ \Gamma Γ is injective, we have u = u ′ u=u' u = u ′ , which contradicts the assumption that u ≠ u ′ u\ne u' u = u ′ . Therefore, the map
u ↦ S t ( u ) , ∀ u ∈ U , u\mapsto S_t(u),\qquad\forall u\in\mathcal{U}, u ↦ S t ( u ) , ∀ u ∈ U ,
must be injective, which implies that ∣ S ∣ ≥ ∣ U ∣ |S|\ge|\mathcal{U}| ∣ S ∣ ≥ ∣ U ∣ .
Theorem 6 (Exact Copy Lower Bound). Set ∣ V ∣ ≥ 5 |\mathcal{V}|\ge5 ∣ V ∣ ≥ 5 , L ≥ c l L\ge cl L ≥ c l , and define h : = min ( l , ( L − W ) + ) h:=\min(l,(L-W)+) h := min ( l , ( L − W ) + ) . If a deterministic hybrid model ST performs the Exact Copy task correctly on all inputs, then log ∣ S ∣ ≥ Ω ( h log ∣ V ∣ ) \log|S|\ge\Omega(h\log|\mathcal{V}|) log ∣ S ∣ ≥ Ω ( h log ∣ V ∣ ) .
Proof. We use the notation of juxtaposition to mean sequence concatenation. For example, for any two finite sequences
u = ( u 1 , … , u m ) ∈ V m and v = ( v 1 , … , v n ) ∈ V n , u=(u_1,\ldots,u_m)\in\mathcal{V}^m
\qquad\text{and}\qquad
v=(v_1,\ldots,v_n)\in\mathcal{V}^n, u = ( u 1 , … , u m ) ∈ V m and v = ( v 1 , … , v n ) ∈ V n ,
we write
u v : = ( u 1 , … , u m , v 1 , … , v n ) . uv:=(u_1,\ldots,u_m,v_1,\ldots,v_n). uv := ( u 1 , … , u m , v 1 , … , v n ) .
The result follows immediately if h = 0 h=0 h = 0 . Thus, we will assume h ≥ 1 h\ge1 h ≥ 1 .
We first pick two distinct elements g 1 , g 2 ∈ V g_1,g_2\in\mathcal{V} g 1 , g 2 ∈ V , and set A : = V ∖ { g 1 , g 2 } \mathcal{A}:=\mathcal{V}\setminus\{g_1,g_2\} A := V ∖ { g 1 , g 2 } . Since ∣ V ∣ ≥ 5 |\mathcal{V}|\ge5 ∣ V ∣ ≥ 5 , we have ∣ A ∣ ≥ 3 |\mathcal{A}|\ge3 ∣ A ∣ ≥ 3 , thus we may pick another element α ∈ A \alpha\in\mathcal{A} α ∈ A . For each a 1 : h = ( a 1 , ⋯ , a h ) ∈ A h a_{1:h}=(a_1,\cdots,a_h)\in\mathcal{A}^h a 1 : h = ( a 1 , ⋯ , a h ) ∈ A h , we define the prefix map u : A h → A l u:\mathcal{A}^h\to\mathcal{A}^l u : A h → A l by
u ( a 1 : h ) = a 1 : h α l − h = ( a 1 , ⋯ , a h , α , ⋯ , α ) ∈ A l . u(a_{1:h})=a_{1:h}\alpha^{l-h}=(a_1,\cdots,a_h,\alpha,\cdots,\alpha)\in\mathcal{A}^l. u ( a 1 : h ) = a 1 : h α l − h = ( a 1 , ⋯ , a h , α , ⋯ , α ) ∈ A l .
We also define
g 1 : L − c l : = g 1 l g 2 l g 1 l g 2 l ⋯ , g_{1:L-cl}:=g_1^l g_2^l g_1^l g_2^l\cdots, g 1 : L − c l := g 1 l g 2 l g 1 l g 2 l ⋯ ,
where the alternating concatenation is truncated after its first L − c l L-cl L − c l entries. We refer to g 1 : L − c l g_{1:L-cl} g 1 : L − c l as the failure segment . By construction, every symbol in g 1 : L − c l g_{1:L-cl} g 1 : L − c l differs from the symbol l l l positions later whenever both are defined.
For each a 1 : h ∈ A h a_{1:h}\in\mathcal{A}^h a 1 : h ∈ A h , we define the suffix map q : A h → V L − h q:\mathcal{A}^h\to\mathcal{V}^{L-h} q : A h → V L − h by
q ( a 1 : h ) : = α l − h u ( a 1 : h ) c − 1 g 1 : L − c l = α l − h ( a 1 ⋯ a h α l − h ) c − 1 g 1 l g 2 l g 1 l g 2 l ⋯ . q(a_{1:h}):=\alpha^{l-h}u(a_{1:h})^{c-1}g_{1:L-cl}
=\alpha^{l-h}(a_1\cdots a_h\alpha^{l-h})^{c-1}g_1^l g_2^l g_1^l g_2^l\cdots. q ( a 1 : h ) := α l − h u ( a 1 : h ) c − 1 g 1 : L − c l = α l − h ( a 1 ⋯ a h α l − h ) c − 1 g 1 l g 2 l g 1 l g 2 l ⋯ .
We define f E C : V L → { 0 , 1 } f_{\mathrm{EC}}:\mathcal{V}^L\to\{0,1\} f EC : V L → { 0 , 1 } to be the function
f E C ( x 1 : L ) : = 1 { x 1 : L has an exact copy of repetition c and string length l } . f_{\mathrm{EC}}(x_{1:L}):=\mathbf{1}_{\{x_{1:L}\text{ has an exact copy of repetition }c\text{ and string length }l\}}. f EC ( x 1 : L ) := 1 { x 1 : L has an exact copy of repetition c and string length l } .
For some fixed a 1 : h ∈ A h a_{1:h} \in\mathcal{A}^{h} a 1 : h ∈ A h , then it is clear that the sequence
a 1 : h q ( a 1 : h ) = a 1 ⋯ a h α l − h ( a 1 ⋯ a h α l − h ) c − 1 g 1 l g 2 l g 1 l g 2 l ⋯ = ( a 1 ⋯ a h α l − h ) c g 1 l g 2 l g 1 l g 2 l ⋯ \begin{aligned}
a_{1:h}q(a_{1:h}) = a_1 \cdots a_h\alpha^{l-h}(a_1 \cdots a_h\alpha^{l-h})^{c-1}g_1^l g_2^l g_1^l g_2^l \cdots\\
&= (a_1 \cdots a_h\alpha^{l-h})^c g_1^l g_2^l g_1^l g_2^l \cdots
\end{aligned} a 1 : h q ( a 1 : h ) = a 1 ⋯ a h α l − h ( a 1 ⋯ a h α l − h ) c − 1 g 1 l g 2 l g 1 l g 2 l ⋯ = ( a 1 ⋯ a h α l − h ) c g 1 l g 2 l g 1 l g 2 l ⋯
contains an exact copy, i.e. f E C ( a 1 : h q ( a 1 : h ) ) = 1 f_{\mathrm{EC}}(a_{1:h}q(a_{1:h})) = 1 f EC ( a 1 : h q ( a 1 : h )) = 1 .
For any a 1 : h ′ ∈ A h a'_{1:h} \in\mathcal{A}^{h} a 1 : h ′ ∈ A h such that a 1 : h ′ ≠ a 1 : h a'_{1:h} \ne a_{1:h} a 1 : h ′ = a 1 : h , then
a 1 : h ′ q ( a 1 : h ) = a 1 ′ ⋯ a h ′ α l − h ( a 1 ⋯ a h α l − h ) c − 1 g 1 l g 2 l g 1 l g 2 l ⋯ a'_{1:h}q(a_{1:h}) = a'_1 \cdots a'_h\alpha^{l-h}(a_1 \cdots a_h\alpha^{l-h})^{c-1}g_1^l g_2^l g_1^l g_2^l \cdots a 1 : h ′ q ( a 1 : h ) = a 1 ′ ⋯ a h ′ α l − h ( a 1 ⋯ a h α l − h ) c − 1 g 1 l g 2 l g 1 l g 2 l ⋯
For x ∈ V L \mathbf{x} \in\mathcal{V}^{L} x ∈ V L , define
E ( x ) : = { m ∈ [ 1 , L − l ] : x m = x m + l } . E(\mathbf{x}) := \{m \in[1,L-l] : x_m = x_{m+l}\}. E ( x ) := { m ∈ [ 1 , L − l ] : x m = x m + l } .
By the definition of Exact Copy,
f E C ( x ) = 1 ⟺ E ( x ) contains ( c − 1 ) l consecutive integers . (1) f_{\mathrm{EC}}(\mathbf{x}) = 1 \quad\Longleftrightarrow\quad E(\mathbf{x})\text{ contains }(c-1)l\text{ consecutive integers}. \tag*{(1)} f EC ( x ) = 1 ⟺ E ( x ) contains ( c − 1 ) l consecutive integers . (1)
We now show that ∣ E ( a 1 : h ′ q ( a 1 : h ) ) ∣ < ( c − 1 ) l |E(a'_{1:h}q(a_{1:h}))| < (c-1)l ∣ E ( a 1 : h ′ q ( a 1 : h )) ∣ < ( c − 1 ) l , which implies this sequence contains no exact copy. Define x ′ : = a 1 : h ′ q ( a 1 : h ) \mathbf{x}' := a'_{1:h}q(a_{1:h}) x ′ := a 1 : h ′ q ( a 1 : h ) , we now determine E ( x ′ ) E(\mathbf{x}') E ( x ′ ) . For 1 ≤ m ≤ h 1 \le m \le h 1 ≤ m ≤ h , we have x m ′ = a m ′ , x m + l ′ = a m x'_m = a'_m, x'_{m+l} = a_m x m ′ = a m ′ , x m + l ′ = a m , and hence m ∈ E ( x ′ ) ⟺ a m ′ = a m m \in E(\mathbf{x}') \Longleftrightarrow a'_m = a_m m ∈ E ( x ′ ) ⟺ a m ′ = a m . For h < m ≤ l h < m \le l h < m ≤ l , both x m ′ x'_m x m ′ and x m + l ′ x'_{m+l} x m + l ′ are equal to α \alpha α . Moreover, for l < m ≤ ( c − 1 ) l l < m \le(c-1)l l < m ≤ ( c − 1 ) l , the positions m m m and m + l m+l m + l correspond to the same position in two consecutive copies of a 1 ⋯ a h α l − h a_1 \cdots a_h\alpha^{l-h} a 1 ⋯ a h α l − h , and therefore x m ′ = x m + l ′ x'_m = x'_{m+l} x m ′ = x m + l ′ .
On the other hand, for every remaining m ∈ [ 1 , L − l ] m \in[1,L-l] m ∈ [ 1 , L − l ] with m > ( c − 1 ) l m > (c-1)l m > ( c − 1 ) l , we have x m ′ ≠ x m + l ′ x'_m \ne x'_{m+l} x m ′ = x m + l ′ . Indeed, if m m m lies in the last copy of a 1 ⋯ a h α l − h a_1 \cdots a_h\alpha^{l-h} a 1 ⋯ a h α l − h , then x m ′ ∈ A x'_m \in\mathcal{A} x m ′ ∈ A while x m + l ′ ∈ { g 1 , g 2 } x'_{m+l} \in\{g_1,g_2\} x m + l ′ ∈ { g 1 , g 2 } ; if m m m lies in the failure segment g 1 : L − c l g_{1:L-cl} g 1 : L − c l , then x m ′ ≠ x m + l ′ x'_m \ne x'_{m+l} x m ′ = x m + l ′ by the construction of g 1 : L − c l g_{1:L-cl} g 1 : L − c l . Therefore,
E ( x ′ ) = { m ∈ [ 1 , h ] : a m ′ = a m } ∪ [ h + 1 , ( c − 1 ) l ] . E(\mathbf{x}') = \{m \in[1,h] : a'_m = a_m\} \cup[h+1,(c-1)l]. E ( x ′ ) = { m ∈ [ 1 , h ] : a m ′ = a m } ∪ [ h + 1 , ( c − 1 ) l ] .
In particular, E ( x ′ ) ⊆ [ 1 , ( c − 1 ) l ] E(\mathbf{x}') \subseteq[1,(c-1)l] E ( x ′ ) ⊆ [ 1 , ( c − 1 ) l ] .
Since a 1 : h ′ ≠ a 1 : h a'_{1:h} \ne a_{1:h} a 1 : h ′ = a 1 : h , there exists some j ∈ [ 1 , h ] j \in[1,h] j ∈ [ 1 , h ] such that a j ′ ≠ a j a'_j \ne a_j a j ′ = a j . Hence j ∉ E ( x ′ ) j \notin E(\mathbf{x}') j ∈ / E ( x ′ ) . Thus E ( x ′ ) E(\mathbf{x}') E ( x ′ ) does not contain all ( c − 1 ) l (c-1)l ( c − 1 ) l integers in [ 1 , ( c − 1 ) l ] [1,(c-1)l] [ 1 , ( c − 1 ) l ] . Since E ( x ′ ) ⊆ [ 1 , ( c − 1 ) l ] E(\mathbf{x}') \subseteq[1,(c-1)l] E ( x ′ ) ⊆ [ 1 , ( c − 1 ) l ] , it cannot contain ( c − 1 ) l (c-1)l ( c − 1 ) l consecutive integers, i.e. ∣ E ( a 1 : h ′ q ( a 1 : h ) ) ∣ < ( c − 1 ) l |E(a'_{1:h}q(a_{1:h}))| < (c-1)l ∣ E ( a 1 : h ′ q ( a 1 : h )) ∣ < ( c − 1 ) l . By equation (1) , f E C ( a 1 : h ′ q ( a 1 : h ) ) = 0 f_{\mathrm{EC}}(a'_{1:h}q(a_{1:h})) = 0 f EC ( a 1 : h ′ q ( a 1 : h )) = 0 .
Therefore, we have that
f E C ( a 1 : h ′ q ( a 1 : h ) ) = { 1 , a 1 : h ′ = a 1 : h , 0 , a 1 : h ′ ≠ a 1 : h . f_{\mathrm{EC}}(a'_{1:h}q(a_{1:h})) =
\begin{cases}
1, & a'_{1:h} = a_{1:h},\\
0, & a'_{1:h} \ne a_{1:h}.
\end{cases} f EC ( a 1 : h ′ q ( a 1 : h )) = { 1 , 0 , a 1 : h ′ = a 1 : h , a 1 : h ′ = a 1 : h .
Define f : = f E C f := f_{\mathrm{EC}} f := f EC , U : = A h \mathcal{U} := \mathcal{A}^{h} U := A h , Q : = { q ( a 1 : h ) : a 1 : h ∈ A h } \mathcal{Q} := \{q(a_{1:h}) : a_{1:h} \in\mathcal{A}^{h}\} Q := { q ( a 1 : h ) : a 1 : h ∈ A h } , τ : = h \tau:= h τ := h following the setting of Theorem 2. Notice that the map a 1 : h ↦ q ( a 1 : h ) a_{1:h} \mapsto q(a_{1:h}) a 1 : h ↦ q ( a 1 : h ) is injective, since q ( a 1 : h ) q(a_{1:h}) q ( a 1 : h ) contains u ( a 1 : h ) u(a_{1:h}) u ( a 1 : h ) ; and Γ \Gamma Γ is also injective on U \mathcal{U} U because Γ \Gamma Γ is a one-hot vector at the position in the sequence for each input:
a 1 : h ′ ↦ Γ ( a 1 : h ′ ) = ( f ( a 1 : h ′ q ( a 1 : h ) ) ) a 1 : h ∈ A h = ( 0 , ⋯ , 0 , 1 , 0 , ⋯ , 0 ) , a'_{1:h} \mapsto\Gamma(a'_{1:h}) = (f(a'_{1:h}q(a_{1:h})))_{a_{1:h}\in\mathcal{A}^{h}} = (0,\cdots,0,1,0,\cdots,0), a 1 : h ′ ↦ Γ ( a 1 : h ′ ) = ( f ( a 1 : h ′ q ( a 1 : h )) ) a 1 : h ∈ A h = ( 0 , ⋯ , 0 , 1 , 0 , ⋯ , 0 ) ,
where the slot with value 1 corresponds to the position a 1 : h = a 1 : h ′ a_{1:h} = a'_{1:h} a 1 : h = a 1 : h ′ .
By Theorem 2, if M M M computes f f f correctly on all inputs, then
∣ S ∣ ≥ ∣ U ∣ = ∣ A ∣ h , |S| \ge|\mathcal{U}| = |\mathcal{A}|^{h}, ∣ S ∣ ≥ ∣ U ∣ = ∣ A ∣ h ,
Therefore,
log ∣ S ∣ ≥ Ω ( h log ∣ V ∣ ) . \log|S| \ge\Omega(h\log|\mathcal{V}|). log ∣ S ∣ ≥ Ω ( h log ∣ V ∣ ) .
For the corollary, if L ≥ c l L \ge cl L ≥ c l and W ≤ L − l W \le L-l W ≤ L − l , then L − W ≥ l L-W \ge l L − W ≥ l , Thus h = min ( l , ( L − W ) + ) = l h=\min(l,(L-W)_{+})=l h = min ( l , ( L − W ) + ) = l and
log ∣ S ∣ ≥ Ω ( l log ∣ V ∣ ) . \log|\mathcal{S}| \ge\Omega(l\log|\mathcal{V}|). log ∣ S ∣ ≥ Ω ( l log ∣ V ∣ ) .
Theorem 7 (Segmented Retrieval Lower Bound). Set ∣ N ∣ ≥ 2 |\mathcal{N}| \ge2 ∣ N ∣ ≥ 2 and L ≥ 3 λ + 1 L \ge3\lambda+1 L ≥ 3 λ + 1 , and h : = min ( λ , ( L − W ) + ) h := \min(\lambda,(L-W)_{+}) h := min ( λ , ( L − W ) + ) . Then any deterministic hybrid model M M M of architecture S T \mathrm{ST} ST that performs the Segmented Retrieval task correctly on all inputs must satisfy log ∣ S ∣ ≥ Ω ( h log ∣ N ∣ ) \log|\mathcal{S}| \ge\Omega(h\log|\mathcal{N}|) log ∣ S ∣ ≥ Ω ( h log ∣ N ∣ ) .
Proof. For h = 0 h=0 h = 0 the bound is vacuous, so we assume h ≥ 1 h \ge1 h ≥ 1 . Define the prefix map u : N h → ( N × { 0 , 1 } ) h u:\mathcal{N}^{h}\to(\mathcal{N}\times\{0,1\})^{h} u : N h → ( N × { 0 , 1 } ) h by
u ( n 1 : h ) = ( ( n 1 , 0 ) , ( n 2 , 0 ) , ⋯ , ( n h , 0 ) ) , ∀ n 1 : h ∈ N h . u(n_{1:h})=((n_1,0),(n_2,0),\cdots,(n_h,0)),\qquad\forall n_{1:h}\in\mathcal{N}^{h}. u ( n 1 : h ) = (( n 1 , 0 ) , ( n 2 , 0 ) , ⋯ , ( n h , 0 )) , ∀ n 1 : h ∈ N h .
Since h ≤ L − W h\le L-W h ≤ L − W , h h h can be a candidate for the cut position τ \tau τ . Therefore, adversarially, we set τ = h \tau=h τ = h . We fix a position j ∈ [ h ] j\in[h] j ∈ [ h ] that serves as the query position for the segmented retrieval; that is to say, for each v 1 : L − h ∈ V L − h v_{1:L-h}\in\mathcal{V}^{L-h} v 1 : L − h ∈ V L − h , we set the suffix map q j : V L − h → ( V × { 0 , 1 } ) L − h q_j:\mathcal{V}^{L-h}\to(\mathcal{V}\times\{0,1\})^{L-h} q j : V L − h → ( V × { 0 , 1 } ) L − h as
q j ( v 1 : L − h ) = ( ( v 1 , 0 ) , ( v 2 , 0 ) , ⋯ , ( v j + λ − h , 1 ) , ⋯ , ( v L − h , 0 ) ) . q_j(v_{1:L-h})=((v_1,0),(v_2,0),\cdots,(v_{j+\lambda-h},1),\cdots,(v_{L-h},0)). q j ( v 1 : L − h ) = (( v 1 , 0 ) , ( v 2 , 0 ) , ⋯ , ( v j + λ − h , 1 ) , ⋯ , ( v L − h , 0 )) .
Therefore, the Online Segmented Retrieval task for x 1 : L : = u ( n 1 : h ) q j ( v 1 : L − h ) x_{1:L}:=u(n_{1:h})q_j(v_{1:L-h}) x 1 : L := u ( n 1 : h ) q j ( v 1 : L − h ) is to output n j n_j n j . Pick n 1 : h ′ , n 1 : h ∈ N h n'_{1:h},n_{1:h}\in\mathcal{N}^{h} n 1 : h ′ , n 1 : h ∈ N h such that n 1 : h ′ ≠ n 1 : h n'_{1:h}\ne n_{1:h} n 1 : h ′ = n 1 : h , and let j ′ ∈ [ h ] j'\in[h] j ′ ∈ [ h ] be the index such that n j ′ ′ ≠ n j n'_{j'}\ne n_{j} n j ′ ′ = n j . Fix v 1 : L − h ∈ V L − h v_{1:L-h}\in\mathcal{V}^{L-h} v 1 : L − h ∈ V L − h . We construct two input sequences x 1 : L ′ : = u ( n 1 : h ′ ) q j ′ ( v 1 : L − h ) x'_{1:L}:=u(n'_{1:h})q_{j'}(v_{1:L-h}) x 1 : L ′ := u ( n 1 : h ′ ) q j ′ ( v 1 : L − h ) and x 1 : L : = u ( n 1 : h ) q j ′ ( v 1 : L − h ) x_{1:L}:=u(n_{1:h})q_{j'}(v_{1:L-h}) x 1 : L := u ( n 1 : h ) q j ′ ( v 1 : L − h ) . Assign an arbitrary deterministic hybrid model M M M of architecture S T \mathrm{ST} ST to the task of Segmented Retrieval. Then
M ( x 1 : L ′ ) = n j ′ ′ , M ( x 1 : L ) = n j ′ . M(x'_{1:L})=n'_{j'},\qquad M(x_{1:L})=n_{j'}. M ( x 1 : L ′ ) = n j ′ ′ , M ( x 1 : L ) = n j ′ .
Therefore, we must have S h ( u ( n 1 : h ′ ) ) ≠ S h ( u ( n 1 : h ) ) S_h(u(n'_{1:h}))\ne S_h(u(n_{1:h})) S h ( u ( n 1 : h ′ )) = S h ( u ( n 1 : h )) . Otherwise, by Theorem 2, we have M ( x 1 : L ′ ) = n j ′ ′ = M ( x 1 : L ) = n j ′ M(x'_{1:L})=n'_{j'}=M(x_{1:L})=n_{j'} M ( x 1 : L ′ ) = n j ′ ′ = M ( x 1 : L ) = n j ′ , which contradicts n j ′ ′ ≠ n j ′ n'_{j'}\ne n_{j'} n j ′ ′ = n j ′ . Hence, we conclude the map
n 1 : h ↦ S h ( u ( n 1 : h ) ) , ∀ n 1 : h ∈ N h , n_{1:h}\mapsto S_h(u(n_{1:h})),\qquad\forall n_{1:h}\in\mathcal{N}^{h}, n 1 : h ↦ S h ( u ( n 1 : h )) , ∀ n 1 : h ∈ N h ,
is injective, and thus implies
∣ S ∣ ≥ ∣ N ∣ h . |\mathcal{S}|\ge|\mathcal{N}|^{h}. ∣ S ∣ ≥ ∣ N ∣ h .
For the corollary, if L ≥ 3 λ + 1 L\ge3\lambda+1 L ≥ 3 λ + 1 and W ≤ λ + 1 W\le\lambda+1 W ≤ λ + 1 , then L − W ≥ 2 λ L-W\ge2\lambda L − W ≥ 2 λ , hence h : = min ( λ , ( L − W ) + ) = λ h:=\min(\lambda,(L-W)_{+})=\lambda h := min ( λ , ( L − W ) + ) = λ . Thus,
log ∣ S ∣ ≥ Ω ( λ log ∣ N ∣ ) . \log|\mathcal{S}|\ge\Omega(\lambda\log|\mathcal{N}|). log ∣ S ∣ ≥ Ω ( λ log ∣ N ∣ ) .
Constructions
Construction for Exact Copy
We first outline the high-level idea behind the construction. At each position t t t , we want to examine whether this position can be an ending position of the desired exact copy. This task comes down to finding the number of equalities up to each position t t t . Let the number of consecutive equalities up to each position t t t be denoted by H t H_t H t . The SSM layer is set to calculate H t = 1 { t ≥ l + 1 , x t = x t − l } ( H t − 1 + 1 ) H_t = \mathbf{1}_{\{t\ge l+1,\mathbf{x}_t=\mathbf{x}_{t-l}\}}(H_{t-1}+1) H t = 1 { t ≥ l + 1 , x t = x t − l } ( H t − 1 + 1 ) . In other words, if the current position satisfies x t = x t − l \mathbf{x}_t = \mathbf{x}_{t-l} x t = x t − l , then we add 1 to the counter so H t = H t − 1 + 1 H_t = H_{t-1} + 1 H t = H t − 1 + 1 ; otherwise, we reset the counter. The Transformer layer first extracts x t − l \mathbf{x}_{t-l} x t − l at each position t t t . Lastly, we need another SSM layer to check if H t = ( c − 1 ) l H_t = (c-1)l H t = ( c − 1 ) l , that is, we need SSM to output y t = 1 { H t = ( c − 1 ) l } ∨ 1 { y t − 1 = 1 } y_t = \mathbf{1}_{\{H_t=(c-1)l\}} \lor\mathbf{1}_{\{y_{t-1}=1\}} y t = 1 { H t = ( c − 1 ) l } ∨ 1 { y t − 1 = 1 } . Since for any two variables x , y ∈ { 0 , 1 } x,y \in\{0,1\} x , y ∈ { 0 , 1 } we have that x ∨ y = ( 1 − y ) x + y x \lor y = (1-y)x+y x ∨ y = ( 1 − y ) x + y , it follows that
Figure 14. Structure of Exact Copy. At each position t > l t > l t > l , the TF layer retrieves x t − l \mathbf{x}_{t-l} x t − l . The first SSM layer counts consecutive matches x t = x t − l \mathbf{x}_t = \mathbf{x}_{t-l} x t = x t − l in H t H_t H t , while the second sets y t = 1 y_t = 1 y t = 1 once H t = ( c − 1 ) l H_t = (c - 1)l H t = ( c − 1 ) l and retains this value thereafter. Here, a b c abc ab c repeats three times consecutively, giving H 10 = 6 H_{10} = 6 H 10 = 6 and y L = 1 y_L = 1 y L = 1 despite subsequent mismatches.
y t = ( 1 − y t − 1 ) 1 { H t = ( c − 1 ) l } + y t − 1 = ( 1 − 1 { H t = ( c − 1 ) l } ) y t − 1 + 1 { H t = ( c − 1 ) l } . y_t = (1-y_{t-1})\mathbf{1}_{\{H_t=(c-1)l\}} + y_{t-1} = (1-\mathbf{1}_{\{H_t=(c-1)l\}})y_{t-1} + \mathbf{1}_{\{H_t=(c-1)l\}}. y t = ( 1 − y t − 1 ) 1 { H t = ( c − 1 ) l } + y t − 1 = ( 1 − 1 { H t = ( c − 1 ) l } ) y t − 1 + 1 { H t = ( c − 1 ) l } .
We now present the detailed hybrid model construction.
Theorem 8 (Exact Copy Construction). There exists a model M M M of architecture TSS with window W ≤ O ( l ) W \le O(l) W ≤ O ( l ) and state log ∣ S ∣ ≤ O ( log ∣ V ∣ + log ( c l ) ) \log|S| \le O(\log|\mathcal{V}| + \log(cl)) log ∣ S ∣ ≤ O ( log ∣ V ∣ + log ( c l )) that performs Exact Copy (Definition 3).
Proof. We provide the various components of the TS architecture in distinct sections.
Token Embeddings. We define ψ ′ : M → { ± 1 } log ∣ M ∣ \psi' : \mathcal{M} \to\{\pm1\}^{\log|\mathcal{M}|} ψ ′ : M → { ± 1 } l o g ∣ M ∣ to be the binary encoding of the vocabulary in M \mathcal{M} M .
Positional Encoding. We define ϕ ′ : [ L ] → { ± 1 } log ∣ L ∣ \phi' : [L] \to\{\pm1\}^{\log|L|} ϕ ′ : [ L ] → { ± 1 } l o g ∣ L ∣ as the binary encoding of numbers in [ L ] [L] [ L ] . After adding the positional encoding, the input context has the following form:
TF-input ( x ⃗ ) : = ( ψ ′ ( x 1 ) ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L ) 0 ⋯ 0 0 ϕ ′ ( 1 ) ⋯ ϕ ′ ( L − 1 ) ϕ ′ ( L ) 0 ⋯ 0 0 1 ⋯ 1 1 ) \operatorname{TF\text{-}input}(\vec{x}) := \begin{pmatrix}
\psi'(x_1) & \cdots& \psi'(x_{L-1}) & \psi'(x_L) \\
\mathbf{0} & \cdots& \mathbf{0} & \mathbf{0} \\
\phi'(1) & \cdots& \phi'(L-1) & \phi'(L) \\
\mathbf{0} & \cdots& \mathbf{0} & \mathbf{0} \\
1 & \cdots& 1 & 1
\end{pmatrix} TF - input ( x ) := ψ ′ ( x 1 ) 0 ϕ ′ ( 1 ) 0 1 ⋯ ⋯ ⋯ ⋯ ⋯ ψ ′ ( x L − 1 ) 0 ϕ ′ ( L − 1 ) 0 1 ψ ′ ( x L ) 0 ϕ ′ ( L ) 0 1
Transformer Layer. As outlined in the high-level idea above, we need to extract the token x t − l \mathbf{x}_{t-l} x t − l at each position t t t . The required sliding window size is l + 1 l+1 l + 1 . We add a positional bias B t − l \mathbf{B}_{t-l} B t − l into the attention:
Attn j ( TF-input ( x ⃗ ) ) : = ∑ i = max ( 1 , j − l ) j exp ( ( B j − l ) i ) ∑ i = max ( 1 , j − l ) j exp ( ( B j − l ) i ) ψ ′ ( x i ) = ψ ′ ( x j − l ) , \operatorname{Attn}_j(\operatorname{TF\text{-}input}(\vec{x})) := \sum_{i=\max(1,j-l)}^{j} \frac{\exp((\mathbf{B}_{j-l})_i)}{\sum_{i=\max(1,j-l)}^{j}\exp((\mathbf{B}_{j-l})_i)}\psi'(x_i)=\psi'(x_{j-l}), Attn j ( TF - input ( x )) := i = m a x ( 1 , j − l ) ∑ j ∑ i = m a x ( 1 , j − l ) j exp (( B j − l ) i ) exp (( B j − l ) i ) ψ ′ ( x i ) = ψ ′ ( x j − l ) ,
where ( B j − l ) i = 0 , i = j − l , ( B j − l ) i = − ∞ , ∀ i ≠ j − l (\mathbf{B}_{j-l})_i=0, i=j-l, (\mathbf{B}_{j-l})_i=-\infty,\forall i\ne j-l ( B j − l ) i = 0 , i = j − l , ( B j − l ) i = − ∞ , ∀ i = j − l . That is, we set W q = W k = 0 \mathbf{W}_q=\mathbf{W}_k=0 W q = W k = 0 and W v ( TF-input ( x ⃗ ) ) = ( ψ ′ ( x 1 ) , ⋯ , ψ ′ ( x L ) ) T \mathbf{W}_v(\operatorname{TF\text{-}input}(\vec{x}))=(\psi'(x_1),\cdots,\psi'(x_L))^\mathsf{T} W v ( TF - input ( x )) = ( ψ ′ ( x 1 ) , ⋯ , ψ ′ ( x L ) ) T . Therefore, the output of the transformer layer is as follows:
( ψ ′ ( x 1 ) ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L ) 0 ⋯ ψ ′ ( x L − l − 1 ) ψ ′ ( x L − l ) ϕ ′ ( 1 ) ⋯ ϕ ′ ( L − 1 ) ϕ ′ ( L ) 0 ⋯ 0 0 1 ⋯ 1 1 ) \begin{pmatrix}
\psi'(x_1) & \cdots& \psi'(x_{L-1}) & \psi'(x_L) \\
\mathbf{0} & \cdots& \psi'(x_{L-l-1}) & \psi'(x_{L-l}) \\
\phi'(1) & \cdots& \phi'(L-1) & \phi'(L) \\
\mathbf{0} & \cdots& \mathbf{0} & \mathbf{0} \\
1 & \cdots& 1 & 1
\end{pmatrix} ψ ′ ( x 1 ) 0 ϕ ′ ( 1 ) 0 1 ⋯ ⋯ ⋯ ⋯ ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L − l − 1 ) ϕ ′ ( L − 1 ) 0 1 ψ ′ ( x L ) ψ ′ ( x L − l ) ϕ ′ ( L ) 0 1
Here we set that ∀ j ≤ l , Attn j ( TF-input ( x ⃗ ) ) = 0 \forall j\leq l,\operatorname{Attn}_j(\operatorname{TF\text{-}input}(\vec{x}))=\mathbf{0} ∀ j ≤ l , Attn j ( TF - input ( x )) = 0 .
SSM Layers. As outlined in the high-level idea of the SSM layer construction, we need two SSM layers to solve the task. Moreover, the first SSM layer is a two-gated SSM layer. The update rule becomes:
H t = ( I − Δ A ( x t ) W A ) H t − 1 + Δ B ( x t ) W B x t , H_t=(I-\Delta_A(\mathbf{x}_t)W_A)H_{t-1}+\Delta_B(\mathbf{x}_t)W_B\mathbf{x}_t, H t = ( I − Δ A ( x t ) W A ) H t − 1 + Δ B ( x t ) W B x t ,
where Δ B ( x t ) \Delta_B(\mathbf{x}_t) Δ B ( x t ) is a scalar depending on x t x_t x t but different from Δ A ( x t ) \Delta_A(\mathbf{x}_t) Δ A ( x t ) . We denote the number of consecutive equalities up to position t t t as H t H_t H t . Rigorously, H t = max ( { 0 } ∪ { h ∈ [ t ] : e t − h + 1 = ⋯ = e t } ) H_t=\max(\{0\}\cup\{h\in[t]:e_{t-h+1}=\cdots=e_t\}) H t = max ({ 0 } ∪ { h ∈ [ t ] : e t − h + 1 = ⋯ = e t }) where e t : = 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l ) } e_t:=\mathbf{1}_{\{t\geq l+1,\psi'(x_t)=\psi'(x_{t-l})\}} e t := 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l )} . For the first SSM layer, our goal is H t = 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l ) } ( H t − 1 + 1 ) H_t=\mathbf{1}_{\{t\geq l+1,\psi'(x_t)=\psi'(x_{t-l})\}}(H_{t-1}+1) H t = 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l )} ( H t − 1 + 1 ) , whence we assign
Δ A ( ( ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) 0 1 ) ) = 1 − 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l ) } , Δ B ( ( ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) 0 1 ) ) = 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l ) } , \Delta_A\left(\begin{pmatrix}
\psi'(x_t)\\
\psi'(x_{t-l})\\
\phi'(t)\\
\mathbf{0}\\
1
\end{pmatrix}\right)=1-\mathbf{1}_{\{t\geq l+1,\psi'(x_t)=\psi'(x_{t-l})\}},
\qquad
\Delta_B\left(\begin{pmatrix}
\psi'(x_t)\\
\psi'(x_{t-l})\\
\phi'(t)\\
\mathbf{0}\\
1
\end{pmatrix}\right)=\mathbf{1}_{\{t\geq l+1,\psi'(x_t)=\psi'(x_{t-l})\}}, Δ A ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) 0 1 = 1 − 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l )} , Δ B ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) 0 1 = 1 { t ≥ l + 1 , ψ ′ ( x t ) = ψ ′ ( x t − l )} ,
W A = W C = I , W B ( ( ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) 0 1 ) ) = 1. \mathbf{W}_A=\mathbf{W}_C=I,\qquad
\mathbf{W}_B\left(\begin{pmatrix}
\psi'(x_t)\\
\psi'(x_{t-l})\\
\phi'(t)\\
\mathbf{0}\\
1
\end{pmatrix}\right)=1. W A = W C = I , W B ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) 0 1 = 1.
Therefore, the output of the first SSM layer is as follows.
( ψ ′ ( x 1 ) ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L ) 0 ⋯ ψ ′ ( x L − l − 1 ) ψ ′ ( x L − l ) ϕ ′ ( 1 ) ⋯ ϕ ′ ( L − 1 ) ϕ ′ ( L ) H 1 ⋯ H L − 1 H L 1 ⋯ 1 1 ) \begin{pmatrix}
\psi'(x_1) & \cdots& \psi'(x_{L-1}) & \psi'(x_L) \\
0 & \cdots& \psi'(x_{L-l-1}) & \psi'(x_{L-l}) \\
\phi'(1) & \cdots& \phi'(L-1) & \phi'(L) \\
H_1 & \cdots& H_{L-1} & H_L \\
1 & \cdots& 1 & 1
\end{pmatrix} ψ ′ ( x 1 ) 0 ϕ ′ ( 1 ) H 1 1 ⋯ ⋯ ⋯ ⋯ ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L − l − 1 ) ϕ ′ ( L − 1 ) H L − 1 1 ψ ′ ( x L ) ψ ′ ( x L − l ) ϕ ′ ( L ) H L 1
The second SSM layer uses the standard update rule, i.e. y t = ( I − Δ ( x t ) W A ) y t − 1 + Δ ( x t ) W B x t y_t = (I - \Delta(x_t)W_A)y_{t-1} + \Delta(x_t)W_Bx_t y t = ( I − Δ ( x t ) W A ) y t − 1 + Δ ( x t ) W B x t . As outlined in the high-level idea, the second layer is designed to compute
y t = ( 1 − 1 { H t = ( c − 1 ) } ) y t − 1 + 1 { H t = ( c − 1 ) } . y_t = (1-\mathbf{1}_{\{H_t=(c-1)\}})y_{t-1}+\mathbf{1}_{\{H_t=(c-1)\}}. y t = ( 1 − 1 { H t = ( c − 1 )} ) y t − 1 + 1 { H t = ( c − 1 )} .
This final expression is attained with the following weights for the second SSM:
Δ ( ( ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) H t 1 ) ) = 1 { H t = ( c − 1 ) } , \Delta\left(
\begin{pmatrix}
\psi'(x_t) \\
\psi'(x_{t-l}) \\
\phi'(t) \\
H_t \\
1
\end{pmatrix}
\right)=\mathbf{1}_{\{H_t=(c-1)\}}, Δ ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) H t 1 = 1 { H t = ( c − 1 )} ,
W A = W C = I , W B ( ( ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) H t 1 ) ) = 1. W_A=W_C=I,\qquad W_B\left(
\begin{pmatrix}
\psi'(x_t) \\
\psi'(x_{t-l}) \\
\phi'(t) \\
H_t \\
1
\end{pmatrix}
\right)=1. W A = W C = I , W B ψ ′ ( x t ) ψ ′ ( x t − l ) ϕ ′ ( t ) H t 1 = 1.
Construction for Segmented Retrieval
We first outline the high-level idea behind the construction. To solve the Segmented Retrieval task, we can first use a Transformer layer to extract the token x t − λ x_{t-\lambda} x t − λ at each position t t t by adding a positional bias B t − λ B_{t-\lambda} B t − λ . Then, at each position t t t , we need to check if t ∈ T : = { t 1 , … , t k − 1 } t \in T := \{t_1,\ldots,t_{k-1}\} t ∈ T := { t 1 , … , t k − 1 } and x t − λ ∈ N x_{t-\lambda} \in\mathcal{N} x t − λ ∈ N are both true. If both conditions are satisfied, then we set the SSM state as H t = x t − λ H_t=x_{t-\lambda} H t = x t − λ ; otherwise, H t = H t − 1 H_t=H_{t-1} H t = H t − 1 , maintaining the previous state. This can be achieved through a standard SSM layer, as we set
H t = ( I − 1 { ( t ∈ T ) ∧ ( x t − λ ∈ N ) } ) H t − 1 + 1 { ( t ∈ T ) ∧ ( x t − λ ∈ N ) } x t − λ . H_t=(I-\mathbf{1}_{\{(t\in T)\wedge(x_{t-\lambda}\in\mathcal{N})\}})H_{t-1}+\mathbf{1}_{\{(t\in T)\wedge(x_{t-\lambda}\in\mathcal{N})\}}x_{t-\lambda}. H t = ( I − 1 {( t ∈ T ) ∧ ( x t − λ ∈ N )} ) H t − 1 + 1 {( t ∈ T ) ∧ ( x t − λ ∈ N )} x t − λ .
Theorem 9 (Segmented Retrieval Construction). There exists a model M M M of architecture TS with window W ≤ O ( λ ) W\le O(\lambda) W ≤ O ( λ ) and state log ∣ S ∣ ≤ O ( log ∣ V ∣ ) |\mathcal{S}|\le O(\log|\mathcal{V}|) ∣ S ∣ ≤ O ( log ∣ V ∣ ) that performs Segmented Retrieval (Definition 4).
Proof. We provide the various components of the TS architecture in distinct sections.
Token Embeddings. We define ψ ′ : M → { ± 1 } log ∣ M ∣ \psi':\mathcal{M}\to\{\pm1\}^{\log|\mathcal{M}|} ψ ′ : M → { ± 1 } l o g ∣ M ∣ to be the binary encoding of the vocabulary in M \mathcal{M} M .
Figure 15. Structure of Segmented Retrieval. At each internal boundary t j t_j t j , the TF layer retrieves v j = x t j − λ v_j = x_{t_j-\lambda} v j = x t j − λ . The SSM layer retains the most recent retrieved token belonging to N \mathcal{N} N and outputs it at position L L L . Here, the retrieved tokens are A A A , u u u , B B B , v v v , so the output is B B B .
Positional Encoding. We define ϕ ′ : [ L ] → { ± 1 } log ∣ L ∣ \phi' : [L] \to\{\pm1\}^{\log|L|} ϕ ′ : [ L ] → { ± 1 } l o g ∣ L ∣ as the binary encoding of numbers in [ L ] [L] [ L ] . After adding the positional encoding, the input context has the following form:
TF-input ( x ⃗ ) : = ( ψ ′ ( x 1 ) ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L ) 0 ⋯ 0 0 ϕ ′ ( 1 ) ⋯ ϕ ′ ( L − 1 ) ϕ ′ ( L ) 0 ⋯ 0 0 1 ⋯ 1 1 ) \operatorname{TF\text{-}input}(\vec{x}) := \left(
\begin{array}{cccc}
\psi'(\mathbf{x}_1) & \cdots& \psi'(\mathbf{x}_{L-1}) & \psi'(\mathbf{x}_L) \\
0 & \cdots& 0 & 0 \\
\phi'(1) & \cdots& \phi'(L-1) & \phi'(L) \\
0 & \cdots& 0 & 0 \\
1 & \cdots& 1 & 1
\end{array}
\right) TF - input ( x ) := ψ ′ ( x 1 ) 0 ϕ ′ ( 1 ) 0 1 ⋯ ⋯ ⋯ ⋯ ⋯ ψ ′ ( x L − 1 ) 0 ϕ ′ ( L − 1 ) 0 1 ψ ′ ( x L ) 0 ϕ ′ ( L ) 0 1
Transformer Layer. As outlined in the high-level idea above, we need to extract the token x t − λ x_{t-\lambda} x t − λ at each position t t t , from which the sliding window size is λ + 1 \lambda+ 1 λ + 1 , and we add the positional bias B t − λ \mathbf{B}_{t-\lambda} B t − λ into the attention:
Attn j ( TF-input ( x ⃗ ) ) : = ∑ i = max ( 1 , j − λ ) j exp ( ( B j − λ ) i ) ∑ i = max ( 1 , j − λ ) j exp ( ( B j − λ ) i ) ψ ′ ( x i ) = ψ ′ ( x j − λ ) , \operatorname{Attn}_j(\operatorname{TF\text{-}input}(\vec{x})) := \sum_{i=\max(1,j-\lambda)}^{j} \frac{\exp((\mathbf{B}_{j-\lambda})_i)}{\sum_{i=\max(1,j-\lambda)}^{j} \exp((\mathbf{B}_{j-\lambda})_i)} \psi'(\mathbf{x}_i) = \psi'(\mathbf{x}_{j-\lambda}), Attn j ( TF - input ( x )) := i = m a x ( 1 , j − λ ) ∑ j ∑ i = m a x ( 1 , j − λ ) j exp (( B j − λ ) i ) exp (( B j − λ ) i ) ψ ′ ( x i ) = ψ ′ ( x j − λ ) ,
where ( B j − λ ) i = 0 , i = j − λ , ( B j − λ ) = − ∞ , ∀ i ≠ j − λ (\mathbf{B}_{j-\lambda})_i = 0, i = j-\lambda, (\mathbf{B}_{j-\lambda}) = -\infty, \forall i \ne j-\lambda ( B j − λ ) i = 0 , i = j − λ , ( B j − λ ) = − ∞ , ∀ i = j − λ . That is to say we set W q = W k = 0 \mathbf{W}_q = \mathbf{W}_k = 0 W q = W k = 0 and W v ( TF-input ( x ⃗ ) ) = ( ψ ′ ( x 1 ) , ⋯ , ψ ′ ( x L ) ) ⊤ \mathbf{W}_v(\operatorname{TF\text{-}input}(\vec{x})) = (\psi'(\mathbf{x}_1), \cdots, \psi'(\mathbf{x}_L))^\top W v ( TF - input ( x )) = ( ψ ′ ( x 1 ) , ⋯ , ψ ′ ( x L ) ) ⊤ . Therefore, the output of the transformer layer is as follows.
( ψ ′ ( x 1 ) ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L ) 0 ⋯ ψ ′ ( x L − 1 − λ ) ψ ′ ( x L − λ ) ϕ ′ ( 1 ) ⋯ ϕ ′ ( L − 1 ) ϕ ′ ( L ) 0 ⋯ 0 0 1 ⋯ 1 1 ) \left(
\begin{array}{cccc}
\psi'(\mathbf{x}_1) & \cdots& \psi'(\mathbf{x}_{L-1}) & \psi'(\mathbf{x}_L) \\
0 & \cdots& \psi'(\mathbf{x}_{L-1-\lambda}) & \psi'(\mathbf{x}_{L-\lambda}) \\
\phi'(1) & \cdots& \phi'(L-1) & \phi'(L) \\
0 & \cdots& 0 & 0 \\
1 & \cdots& 1 & 1
\end{array}
\right) ψ ′ ( x 1 ) 0 ϕ ′ ( 1 ) 0 1 ⋯ ⋯ ⋯ ⋯ ⋯ ψ ′ ( x L − 1 ) ψ ′ ( x L − 1 − λ ) ϕ ′ ( L − 1 ) 0 1 ψ ′ ( x L ) ψ ′ ( x L − λ ) ϕ ′ ( L ) 0 1
Here we set that ∀ j ≤ λ \forall j \le\lambda ∀ j ≤ λ , Attn j ( TF-input ( x ⃗ ) ) = 0 \operatorname{Attn}_j(\operatorname{TF\text{-}input}(\vec{x})) = 0 Attn j ( TF - input ( x )) = 0 .
SSM Layer. As outlined in the high-level idea of the SSM layer construction, we only need one SSM layer to solve the task. At each position t t t , we denote the largest index of the set { t j − λ : j ∈ [ k − 1 ] , x t j − λ ∈ N , 1 ≤ t j − λ ≤ t } \{t_j-\lambda: j \in[k-1], \mathbf{x}_{t_j-\lambda} \in\mathcal{N}, 1 \le t_j-\lambda\le t\} { t j − λ : j ∈ [ k − 1 ] , x t j − λ ∈ N , 1 ≤ t j − λ ≤ t } as t ⋆ t^\star t ⋆ , and define H t : = x t ⋆ H_t := \mathbf{x}_{t^\star} H t := x t ⋆ . Then, as stated in the high-level idea, the update rule for H t H_t H t is
H t = ( I − 1 { ( t ∈ T ) ∧ ( x t − λ ∈ N ) } ) H t − 1 + 1 { ( t ∈ T ) ∧ ( x t − λ ∈ N ) } x t − λ , H_t = \left(I - \mathbf{1}_{\{(t\in T)\wedge(\mathbf{x}_{t-\lambda}\in\mathcal{N})\}}\right)H_{t-1} + \mathbf{1}_{\{(t\in T)\wedge(\mathbf{x}_{t-\lambda}\in\mathcal{N})\}}\mathbf{x}_{t-\lambda}, H t = ( I − 1 {( t ∈ T ) ∧ ( x t − λ ∈ N )} ) H t − 1 + 1 {( t ∈ T ) ∧ ( x t − λ ∈ N )} x t − λ ,
This is achieved by setting
W A = W C = I , W B ( ( ψ ′ ( x t ) ψ ′ ( x t − λ ) ϕ ′ ( t ) 0 1 ) ) = x t − λ , Δ ( ( ψ ′ ( x t ) ψ ′ ( x t − λ ) ϕ ′ ( t ) 0 1 ) ) = 1 { ( t ∈ T ) ∧ ( x t − λ ∈ N ) } . W_A = W_C = I,\qquad W_B\left(\begin{pmatrix}\psi'(\mathbf{x}_t)\\ \psi'(\mathbf{x}_{t-\lambda})\\ \phi'(t)\\ 0\\ 1\end{pmatrix}\right)=\mathbf{x}_{t-\lambda},\qquad\Delta\left(\begin{pmatrix}\psi'(\mathbf{x}_t)\\ \psi'(\mathbf{x}_{t-\lambda})\\ \phi'(t)\\ 0\\ 1\end{pmatrix}\right)=\mathbf{1}_{\{(t\in T)\wedge(\mathbf{x}_{t-\lambda}\in\mathcal{N})\}}. W A = W C = I , W B ψ ′ ( x t ) ψ ′ ( x t − λ ) ϕ ′ ( t ) 0 1 = x t − λ , Δ ψ ′ ( x t ) ψ ′ ( x t − λ ) ϕ ′ ( t ) 0 1 = 1 {( t ∈ T ) ∧ ( x t − λ ∈ N )} .
SSMs with a Convolutional Front-End
A Mamba block applies a causal depthwise convolution before its selective SSM. Each such layer can therefore read a few recent inputs directly, in addition to its recurrent state. This subsection makes the local access explicit, relates it to the S-layers of Section 2, and quantifies its effect on the lower bounds of Section 2.2.
Definition 8 (S κ S_\kappa S κ -layer). Let κ ≥ 0 \kappa\ge0 κ ≥ 0 . A layer F : ( { 0 , 1 } P ) L → ( { 0 , 1 } P ) L F : (\{0,1\}^{P})^L \to(\{0,1\}^{P})^L F : ({ 0 , 1 } P ) L → ({ 0 , 1 } P ) L is an S κ S_\kappa S κ -layer with recurrent state space S S S if there exist an initial state S 0 ∈ S S_0 \in S S 0 ∈ S and maps μ : S × ( { 0 , 1 } P ) κ + 1 → S \mu: S \times(\{0,1\}^{P})^{\kappa+1} \to S μ : S × ({ 0 , 1 } P ) κ + 1 → S and ψ : S × ( { 0 , 1 } P ) κ + 1 → { 0 , 1 } P \psi: S \times(\{0,1\}^{P})^{\kappa+1} \to\{0,1\}^{P} ψ : S × ({ 0 , 1 } P ) κ + 1 → { 0 , 1 } P such that
S t = μ ( S t − 1 , x t − κ : t ) , F ( x ⃗ ) t = ψ ( S t , x t − κ : t ) S_t = \mu(S_{t-1},\mathbf{x}_{t-\kappa:t}),\qquad F(\vec{x})_t = \psi(S_t,\mathbf{x}_{t-\kappa:t}) S t = μ ( S t − 1 , x t − κ : t ) , F ( x ) t = ψ ( S t , x t − κ : t ) where x i x_i x i for i ≤ 0 i \le0 i ≤ 0 is a fixed padding symbol ⋄ \diamond ⋄ whose encoding differs from that of every token. We call x t − κ : t \mathbf{x}_{t-\kappa:t} x t − κ : t the local window and log 2 ∣ S ∣ \log_2 |S| log 2 ∣ S ∣ the recurrent-state complexity ; the local window is not charged to S S S .
Mamba. With finite-precision arithmetic, a Mamba block (input projection, causal depthwise convolution of width κ + 1 \kappa+1 κ + 1 , selective SSM, gating, output projection, and residual connection) is an S κ S_\kappa S κ -layer with κ = d c o n v − 1 \kappa=d_{\mathrm{conv}}-1 κ = d conv − 1 , whose recurrent state is the SSM state: both the state update and the output at position t t t depend only on the previous state and on x t − κ : t \mathbf{x}_{t-\kappa:t} x t − κ : t . Lower bounds for S κ S_\kappa S κ -layers therefore apply to Mamba. The converse does not hold. Since μ \mu μ and ψ \psi ψ are arbitrary, a construction in the S κ S_\kappa S κ class does not by itself yield parameters of a Mamba block.
Relation to the S-layers of Section 2. An S-layer of Section 2 is an S 0 S_0 S 0 -layer with the same state space (take ψ ( S , x t ) = r ( S ) \psi(S,x_t)=r(S) ψ ( S , x t ) = r ( S ) ), and every S 0 S_0 S 0 -layer is an S κ S_\kappa S κ -layer with the same state space. The converse fails at equal budget, because ψ \psi ψ may read the current input. For instance, with ∣ S ∣ = 1 |S|=1 ∣ S ∣ = 1 and ψ ( S , x t ) = x t \psi(S,x_t)=x_t ψ ( S , x t ) = x t , an S 0 S_0 S 0 -layer computes the identity with zero recurrent bits, whereas an S-layer of Section 2 needs P P P bits of state to do so. Two facts relate the classes.
(i) Simulation. An S κ S_\kappa S κ -layer with recurrent state space S S S is an S-layer of Section 2 with state space S × ( { 0 , 1 } P ) κ + 1 S \times(\{0,1\}^{P})^{\kappa+1} S × ({ 0 , 1 } P ) κ + 1 : store S ~ t = ( S t , x t − κ : t ) \widetilde{S}_t=(S_t,\mathbf{x}_{t-\kappa:t}) S t = ( S t , x t − κ : t ) , update the window as a shift register, and set r ~ ( S ~ t ) = ψ ( S t , x t − κ : t ) \widetilde{r}(\widetilde{S}_t)=\psi(S_t,\mathbf{x}_{t-\kappa:t}) r ( S t ) = ψ ( S t , x t − κ : t ) . Its bit complexity is at most log 2 ∣ S ∣ + ( κ + 1 ) P \log_2 |S|+(\kappa+1)P log 2 ∣ S ∣ + ( κ + 1 ) P .
(ii) Configuration at a cut. For every τ \tau τ , the pair ( S τ , x τ − κ + 1 : τ ) (S_\tau, x_{\tau-\kappa+1:\tau}) ( S τ , x τ − κ + 1 : τ ) , of at most log 2 ∣ S ∣ + κ P \log_2 |\mathcal{S}|+\kappa P log 2 ∣ S ∣ + κ P bits, determines F ( x ⃗ ) t F(\vec{x})_t F ( x ) t for all t > τ t>\tau t > τ given x τ + 1 : t x_{\tau+1:t} x τ + 1 : t . This is the case D S = 1 D_S=1 D S = 1 of Lemma 17 below.
By (ii), the proof of Theorem 2 applies to S κ S_\kappa S κ T models with ∣ S ∣ 2 κ P |\mathcal{S}|\,2^{\kappa P} ∣ S ∣ 2 κ P in place of ∣ S ∣ |\mathcal{S}| ∣ S ∣ . Thus, Theorems 6 and 7 continue to hold with log 2 ∣ S ∣ + κ P \log_2|\mathcal{S}|+\kappa P log 2 ∣ S ∣ + κ P in place of log 2 ∣ S ∣ \log_2|\mathcal{S}| log 2 ∣ S ∣ . By (i) applied layerwise, a hybrid model with profile A A A whose recurrent layers are S κ S_\kappa S κ -layers with at most B B B recurrent bits is a model in M A ( B + ( κ + 1 ) P , P , W ) \mathcal{M}_A(B+(\kappa+1)P,P,W) M A ( B + ( κ + 1 ) P , P , W ) in the sense of § 2 . Since
B + ( κ + 1 ) P ≤ ( κ + 2 ) max { B , P } , B+(\kappa+1)P\le(\kappa+2)\max\{B,P\}, B + ( κ + 1 ) P ≤ ( κ + 2 ) max { B , P } ,
the conclusion of part 2 of Theorem 1 continues to hold for such models, with c τ m / ( κ + 2 ) c_{\tau m}/(\kappa+2) c τ m / ( κ + 2 ) in place of c τ m c_{\tau m} c τ m . The constructions need no change, because every S S S -layer is an S κ S_\kappa S κ -layer. The constant-factor separation in part 3 of Theorem 1 does not follow from this conversion.
For the natural tasks of § 2.2 , charging the window to the state is unnecessary. The following lemma and proposition show that each S κ S_\kappa S κ -layer reduces the lower bounds by at most κ \kappa κ tokens, and that the resulting threshold on the task distance is tight within the S κ S_\kappa S κ abstraction.
Lemma 17 (Cut through a convolutional stack). Let M = T ∘ F D S ∘ ⋯ ∘ F 1 M=T\circ F_{D_S}\circ\cdots\circ F_1 M = T ∘ F D S ∘ ⋯ ∘ F 1 , where each F i F_i F i is an S κ S_\kappa S κ -layer with recurrent state space S ( i ) \mathcal{S}^{(i)} S ( i ) and states S t ( i ) S_t^{(i)} S t ( i ) , and T T T is a T T T -layer with window W W W ; write M ( x ⃗ ) M(\vec{x}) M ( x ) for the output at position L L L . Let D S κ < τ ≤ L − W D_S\kappa<\tau\le L-W D S κ < τ ≤ L − W and τ i : = τ − ( D S − i ) κ \tau_i:=\tau-(D_S-i)\kappa τ i := τ − ( D S − i ) κ for i ∈ [ D S ] i\in[D_S] i ∈ [ D S ] . Let u , u ′ u,u' u , u ′ be prefixes of length τ \tau τ that agree on positions τ − D S κ + 1 , … , τ \tau-D_S\kappa+1,\ldots,\tau τ − D S κ + 1 , … , τ and satisfy S τ i ( i ) ( u ) = S τ i ( i ) ( u ′ ) S_{\tau_i}^{(i)}(u)=S_{\tau_i}^{(i)}(u') S τ i ( i ) ( u ) = S τ i ( i ) ( u ′ ) for all i ∈ [ D S ] i\in[D_S] i ∈ [ D S ] . Then M ( u q ) = M ( u ′ q ) M(uq)=M(u'q) M ( u q ) = M ( u ′ q ) for every suffix q q q of length L − τ L-\tau L − τ .
Proof. Write o ( 0 ) = x ⃗ o^{(0)}=\vec{x} o ( 0 ) = x and o ( i ) = F i ( o ( i − 1 ) ) o^{(i)}=F_i(o^{(i-1)} ) o ( i ) = F i ( o ( i − 1 ) ) , and compare the inputs u q uq u q and u ′ q u'q u ′ q . We show by induction on i i i that S t ( i ) S_t^{(i)} S t ( i ) and o t ( i ) o_t^{(i)} o t ( i ) coincide on the two inputs for all t > τ i t>\tau_i t > τ i . For i = 1 i=1 i = 1 and t > τ 1 t>\tau_1 t > τ 1 , the window x t − κ : t x_{t-\kappa:t} x t − κ : t starts at position t − κ ≥ τ 1 − κ + 1 = τ − D S κ + 1 t-\kappa\ge\tau_1-\kappa+1=\tau-D_S\kappa+1 t − κ ≥ τ 1 − κ + 1 = τ − D S κ + 1 , so it lies in the common part of the prefixes or in the common suffix. Together with S τ 1 ( 1 ) ( u ) = S τ 1 ( 1 ) ( u ′ ) S_{\tau_1}^{(1)}(u)=S_{\tau_1}^{(1)}(u') S τ 1 ( 1 ) ( u ) = S τ 1 ( 1 ) ( u ′ ) , induction on t t t gives the claim. For i ≥ 2 i\ge2 i ≥ 2 and t > τ i t>\tau_i t > τ i , the window o t − κ : t ( i − 1 ) o_{t-\kappa:t}^{(i-1)} o t − κ : t ( i − 1 ) starts at position t − κ > τ i − κ = τ i − 1 t-\kappa>\tau_i-\kappa=\tau_{i-1} t − κ > τ i − κ = τ i − 1 , where the two inputs agree by the induction hypothesis. Together with S τ i ( i ) ( u ) = S τ i ( i ) ( u ′ ) S_{\tau_i}^{(i)}(u)=S_{\tau_i}^{(i)}(u') S τ i ( i ) ( u ) = S τ i ( i ) ( u ′ ) , the claim follows as before. Finally, τ D S = τ \tau_{D_S}=\tau τ D S = τ , and T T T reads only positions L − W + 1 , … , L L-W+1,\ldots,L L − W + 1 , … , L , all larger than τ \tau τ . Hence the outputs coincide. □ \square □
Theorem 10 (Natural tasks with convolutional recurrent layers). Let D S ≥ 1 D_S\ge1 D S ≥ 1 , let h h h be as in Theorem 6 (resp. Theorem 7), and set
h D S : = ( h − D S κ ) + . h_{D_S}:=(h-D_S\kappa)_+. h D S := ( h − D S κ ) + . (a) Under the assumptions of Theorem 6 (resp. Theorem 7), every deterministic model M M M as in Lemma 17 that performs Exact Copy (resp. Segmented Retrieval) correctly on all inputs satisfies
∑ i = 1 D S log 2 ∣ S ( i ) ∣ ≥ h D S log 2 ( ∣ V ∣ − 2 ) \sum_{i=1}^{D_S}\log_2|\mathcal{S}^{(i)}|\ge h_{D_S}\log_2(|\mathcal{V}|-2) i = 1 ∑ D S log 2 ∣ S ( i ) ∣ ≥ h D S log 2 ( ∣ V ∣ − 2 ) (resp. the same with log 2 ∣ M ∣ \log_2|\mathcal{M}| log 2 ∣ M ∣ in place of log 2 ( ∣ V ∣ − 2 ) \log_2(|\mathcal{V}|-2) log 2 ( ∣ V ∣ − 2 ) ).
(b) Conversely, suppose ℓ ≤ D S κ \ell\le D_S\kappa ℓ ≤ D S κ (resp. λ ≤ D S κ \lambda\le D_S\kappa λ ≤ D S κ ) and P ≥ 2 ⌈ log 2 ( ∣ V ∣ + 1 ) ⌉ + 2 P\ge2\lceil\log_2(|\mathcal{V}|+1)\rceil+2 P ≥ 2 ⌈ log 2 ( ∣ V ∣ + 1 )⌉ + 2 . Then there is a model M M M as in Lemma 17, with T T T the identity (W = 1 W=1 W = 1 ), in which F 1 , … , F D S − 1 F_1,\ldots,F_{D_S-1} F 1 , … , F D S − 1 have a single recurrent state and F D S F_{D_S} F D S has O ( log ( ℓ ) ) O(\log(\ell)) O ( log ( ℓ )) (resp. O ( log ∣ N ∣ ) O(\log|\mathcal{N}|) O ( log ∣ N ∣ ) ) recurrent bits, that performs Exact Copy (resp. Segmented Retrieval) correctly on all inputs.
In particular, with W = 1 W = 1 W = 1 (so that h = l h = l h = l , resp. h = λ h = \lambda h = λ ), the bound in (a) is nonzero exactly when the task distance exceeds D S κ D_{S\kappa} D S κ , and otherwise (b) gives a solution with small recurrent state.
Proof. (a). If h D S = 0 h_{D_S} = 0 h D S = 0 there is nothing to prove, so assume h D S ≥ 1 h_{D_S} \ge1 h D S ≥ 1 . Then h = h D S + D S κ h = h_{D_S} + D_{S\kappa} h = h D S + D S κ , and we use the cut τ = h \tau= h τ = h , which satisfies D S κ < τ ≤ L − W D_{S\kappa} < \tau\le L - W D S κ < τ ≤ L − W by the definition of h h h . By Lemma 17, if a family of prefixes of length h h h shares its last D S κ D_{S\kappa} D S κ positions and any two of its members are mapped to different outputs by some common suffix, then the map u ↦ ( S τ i ( i ) ( u ) ) i ∈ [ D S ] \mathbf{u} \mapsto\left(S_{\tau_i}^{(i)}(\mathbf{u})\right)_{i \in[D_S]} u ↦ ( S τ i ( i ) ( u ) ) i ∈ [ D S ] is injective on the family. Its image has at most ∏ i ∣ S ( i ) ∣ \prod_i \lvert\mathcal{S}^{(i)}\rvert ∏ i ∣ S ( i ) ∣ elements, so it suffices to exhibit such a family of size ( ∣ V ∣ − 2 ) h D S (\lvert\mathcal{V}\rvert- 2)^{h_{D_S}} (∣ V ∣ − 2 ) h D S (resp. ∣ N ∣ h D S \lvert\mathcal{N}\rvert^{h_{D_S}} ∣ N ∣ h D S ).
For Exact Copy, let A A A , α \alpha α , g 1 g_1 g 1 , g 2 g_2 g 2 and g 1 : L − c l g_{1:L-cl} g 1 : L − c l be as in the proof of Theorem 6, and write h ′ = h D S h' = h_{D_S} h ′ = h D S . For a ∈ A h ′ a \in A^{h'} a ∈ A h ′ , use the prefix a α D S κ a\alpha^{D_{S\kappa}} a α D S κ and the suffix α l − h ′ ( a α l − h ′ ) c − 1 g 1 : L − c l \alpha^{l-h'}(a\alpha^{l-h'})^{c-1}g_{1:L-cl} α l − h ′ ( a α l − h ′ ) c − 1 g 1 : L − c l . For a ′ ∈ A h ′ a' \in A^{h'} a ′ ∈ A h ′ , the resulting input is
a ′ α D S κ ⋅ (suffix of a ) = a ′ α l − h ′ ( a α l − h ′ ) c − 1 g 1 : L − c l , a'\alpha^{D_{S\kappa}} \cdot\text{(suffix of }a\text{)} = a'\alpha^{l-h'}(a\alpha^{l-h'})^{c-1}g_{1:L-cl}, a ′ α D S κ ⋅ (suffix of a ) = a ′ α l − h ′ ( a α l − h ′ ) c − 1 g 1 : L − c l ,
which is the input analysed in the proof of Theorem 6 with h h h replaced by h ′ ∈ [ 1 , l ] h' \in[1,l] h ′ ∈ [ 1 , l ] . It therefore contains an exact copy if and only if a ′ = a a' = a a ′ = a .
For Segmented Retrieval, fix α ∈ V \alpha\in\mathcal{V} α ∈ V and use, for n ∈ N h ′ n \in\mathcal{N}^{h'} n ∈ N h ′ , the prefix
( ( n 1 , 0 ) , … , ( n h ′ , 0 ) , ( α , 0 ) , … , ( α , 0 ) ) . ((n_1,0),\ldots,(n_{h'},0),(\alpha,0),\ldots,(\alpha,0)). (( n 1 , 0 ) , … , ( n h ′ , 0 ) , ( α , 0 ) , … , ( α , 0 )) .
For j ∈ [ h ′ ] j \in[h'] j ∈ [ h ′ ] , append the suffix q j q_j q j from the proof of Theorem 7. Its only internal boundary is at position j + λ > h j+\lambda> h j + λ > h , the segment-length conditions of Definition 4 hold because L ≥ 3 λ + 1 L \ge3\lambda+ 1 L ≥ 3 λ + 1 and j ≤ λ j \le\lambda j ≤ λ , and the required output is x j = n j x_j = n_j x j = n j . Two distinct prefixes differ at some j ∈ [ h ′ ] j \in[h'] j ∈ [ h ′ ] , and q j q_j q j separates them.
(b). Encode each position by its token (or ⋄ \diamond ⋄ ) and, for Segmented Retrieval, its boundary bit; two such encodings fit in P P P bits. Let j 0 = 0 j_0 = 0 j 0 = 0 and j i = min ( δ , i κ ) j_i = \min(\delta, i\kappa) j i = min ( δ , iκ ) , where δ = l \delta= l δ = l (resp. δ = λ \delta= \lambda δ = λ ) is the task distance. For i < D S i < D_S i < D S , let F i F_i F i have a single recurrent state and output o t ( i ) = ( x t , x t − j i ) o_t^{(i)} = (x_t,x_{t-j_i}) o t ( i ) = ( x t , x t − j i ) , with ⋄ \diamond ⋄ for nonpositive indices. This is possible because F 1 F_1 F 1 reads x t − j 1 x_{t-j_1} x t − j 1 directly (j 1 ≤ κ j_1 \le\kappa j 1 ≤ κ ), and for i ≥ 2 i \ge2 i ≥ 2 the window of F i F_i F i contains o t ( i − 1 ) o_t^{(i-1)} o t ( i − 1 ) , whose first entry is x t x_t x t , and o t − ( j i − j i − 1 ) ( i − 1 ) o_{t-(j_i-j_{i-1})}^{(i-1)} o t − ( j i − j i − 1 ) ( i − 1 ) , whose second entry is x t − j i x_{t-j_i} x t − j i , since 0 ≤ j i − j i − 1 ≤ κ 0 \le j_i-j_{i-1} \le\kappa 0 ≤ j i − j i − 1 ≤ κ . Because δ ≤ D S κ \delta\le D_{S\kappa} δ ≤ D S κ , we have δ − j D S − 1 ≤ κ \delta-j_{D_S-1} \le\kappa δ − j D S − 1 ≤ κ , so the window of F D S F_{D_S} F D S contains both x t x_t x t and x t − δ x_{t-\delta} x t − δ (for D S = 1 D_S = 1 D S = 1 , directly from x t − κ : t x_{t-\kappa:t} x t − κ : t ).
For Exact Copy, F D S F_{D_S} F D S keeps H t = min { ( c − 1 ) l , 1 { x t = x t − l } ( H t − 1 + 1 ) } H_t = \min\{(c-1)l, \mathbb{1}\{x_t = x_{t-l}\}(H_{t-1}+1)\} H t = min {( c − 1 ) l , 1 { x t = x t − l } ( H t − 1 + 1 )} and y t = y t − 1 ∨ 1 { H t = ( c − 1 ) l } y_t = y_{t-1} \lor\mathbb{1}\{H_t = (c-1)l\} y t = y t − 1 ∨ 1 { H t = ( c − 1 ) l } , and outputs y t y_t y t . Since ⋄ \diamond ⋄ differs from every token, x t = x t − l x_t = x_{t-l} x t = x t − l can hold only for t ≥ l + 1 t \ge l+1 t ≥ l + 1 . By Definition 3, an exact copy exists if and only if x t = x t − l x_t = x_{t-l} x t = x t − l for ( c − 1 ) l (c-1)l ( c − 1 ) l consecutive positions t t t . So y L y_L y L is correct, and 2 ( ( c − 1 ) l + 1 ) 2((c-1)l+1) 2 (( c − 1 ) l + 1 ) states suffice. For Segmented Retrieval, F D S F_{D_S} F D S stores the last value x t − λ ∈ N x_{t-\lambda} \in\mathcal{N} x t − λ ∈ N read at a boundary position t t t , or ⊥ \perp ⊥ before the first such value, and outputs it. This uses ∣ N ∣ + 1 \lvert\mathcal{N}\rvert+1 ∣ N ∣ + 1 states, and the value stored at position L L L is x t ⋆ − λ x_{t_{\star}-\lambda} x t ⋆ − λ . ∎