Manuscript Offprint
arXiv:2610.25250Improving the Expressive Power of Hybrid Sequence Models via Multi-Hop Retrieval
Abstract
Hybrid architectures offer a promising approach to efficient language modeling by combining a small number of full-attention layers with a larger number of efficient sequence layers, such as sparse attention and recurrent layers. While full-attention layers maintain a KV cache that grows linearly with sequence length, efficient layers typically rely on separate, fixed-size states rather than accessing this richer existing memory. Recent work has begun exploring ways to allow efficient layers access to the KV cache, but the theoretical benefits of such access, and the extent to which existing approaches can realize them remain poorly understood. We investigate these questions by analyzing the expressive power of individual hybrid blocks on function composition, a well-studied task in sequence-model expressivity associated with multi-hop reasoning. We first establish that both conventional hybrid blocks and those with top- KV-cache access require capacity to compute even two-function composition over a domain of size . To overcome this limitation, we introduce the Multi-hop Retrieval Attention (MURA) hybrid block, a simple architecture that enables multi-hop retrieval from a shared KV cache while preserving asymptotic computational and memory efficiency. We prove that a single fixed size -hop MURA block can compute -function composition, whereas computing -function composition with the same retrieval depth requires polynomial model size, establishing a strict expressivity hierarchy in retrieval depth. Synthetic experiments support this hierarchy, showing that increasing retrieval depth enables learning progressively deeper compositions, substantially outperforming existing hybrid architectures. Together, our results identify multi-hop retrieval as a promising mechanism for improving the expressive power of efficient hybrid architectures.
1 Introduction
Transformers have become the dominant architecture for language modeling, but their computational and memory costs pose increasing challenges as models and context lengths grow. Full attention requires quadratic computation in sequence length and, during autoregressive inference, stores previously computed keys and values to avoid recomputation. Specifically, each attention layer maintains a key-value (KV) cache and , consisting of a key and value vector for each preceding token. The memory required by this cache grows linearly with the context length, becoming a major bottleneck for long-context inference [50; 23; 44; 15]. These costs have motivated the development of efficient sequence layers, including sparse and local attention mechanisms [7; 2; 49] and, more recently, efficient recurrent layers [19; 18; 46]. Recurrent layers process sequences in linear time and, during autoregressive inference, maintain only a fixed-size hidden state that summarizes the preceding context. Despite these efficiency gains, models relying exclusively on efficient sequence layers often underperform full-attention transformers on long context tasks [42; 35].
Preprint.
Nevertheless, recurrent layers have found considerable success in hybrid architectures. These architectures are typically organized into repeating hybrid blocks, each combining a single full-attention layer with several recurrent layers, reducing the frequency of expensive attention operations. This design has been adopted by prominent models such as Kimi K3 [40], Gemma 3 [16], Nemotron 3 Ultra [3], and OLMo Hybrid [30], demonstrating its effectiveness at scale. However, recurrent layers were originally designed to operate independently of full attention. Consequently, even within a hybrid block, they typically maintain their own fixed-size hidden states , without direct access to the richer KV cache already maintained by the full-attention layer. This raises a natural question: can recurrent layers benefit from direct access to this existing memory without sacrificing their computational efficiency? Recent work has begun exploring this possibility. Some approaches [5; 34] share KV caches across layers or apply attention to a subset of past recurrent states, reducing memory requirements but retaining quadratic attention computation. In contrast, other methods [13; 43] reuse a full-attention layer's KV cache for sparse top- retrieval based on its attention scores, allowing subsequent layers to access shared memory without increasing the asymptotic time or memory complexity of hybrid blocks. While these methods have shown promising empirical results, their designs remain largely empirically motivated, with limited theoretical understanding of how different memory-access mechanisms affect model capabilities.
We aim to provide a principled foundation for designing such layers by investigating whether shared-memory access can improve the expressive power of hybrid blocks, and whether existing retrieval mechanisms fully realize this potential. Expressivity is particularly relevant in this setting: computations that can be realized within a single block of one architecture may require several blocks of another, introducing additional expensive full-attention operations and KV caches. More expressive blocks could therefore enable more efficient hybrid architectures.
Our analysis focuses on function composition, a well-studied task in sequence-model expressivity [33; 22; 47] that requires successive dependent retrievals, as often arise in multi-hop reasoning. We establish a fundamental expressive limitation shared by both conventional hybrid blocks with independent recurrent states and those whose recurrent layers access a shared KV cache through top- retrieval. Specifically, we prove that both require size , measured by the product of width, depth, and precision, to compute even two-function composition over a domain of size .
Motivated by this limitation, we introduce Multi-Hop Retrieval Attention (MURA), which extends top- retrieval to provide efficient sequence layers with richer access to the full-attention layer's KV cache. As in top- hybrid blocks, MURA first identifies each token's highest-scoring causal predecessors using the full-attention scores. However, rather than retrieving only the immediate predecessors of a query token, -MURA recursively expands the candidate set: at each hop , it retrieves the top- predecessors of the tokens reached at the previous hop, allowing access to tokens up to hops away. Each subsequent sparse layer computes new queries from the current token representations and attends to these candidates using the original full-attention keys and values. The candidate sets are computed once and remain fixed throughout the block, allowing the sparse layers to refine their queries without recomputing retrieval routes. By enabling retrieved tokens to guide further retrievals, MURA supports complex chains of dependent retrievals while preserving the efficiency of existing hybrid designs: for fixed retrieval parameters, sparse retrieval layers require linear computation in sequence length and maintain constant-size states, introducing no additional KV caches.
Theoretically, we prove that for any fixed m, a single m-hop MURA block can compute compositions of m functions with constant width and depth and only logarithmic precision. To our knowledge, this provides the first architecture with a single full-attention layer that is provably capable of such multi-step function composition. We further establish the importance of retrieval depth, showing that computing compositions of functions with at most m retrieval hops requires size . Together, these results establish a strict hierarchy in expressive power as retrieval depth increases. This separation holds even when the total number of retrieved KV entries is matched, demonstrating that the structure of retrieval, rather than merely the number of retrieved tokens, is critical to expressivity.
Empirically, we evaluate MURA on synthetic function-composition tasks to investigate whether its theoretical advantages can also be realized through training. For , we find that models with a single m-hop MURA block achieve near-perfect test accuracy on compositions of up to m functions, while struggling with deeper compositions. In contrast, the existing hybrid architectures we evaluate struggle with compositions involving more than one function. These results demonstrate that the expressive advantages of MURA can be learned in practice on controlled tasks, supporting multi-hop retrieval as a promising design principle for more expressive hybrid architectures.
In summary, our main contributions are:
• Expressivity limitations of existing hybrid architectures. We establish an size lower bound for single-block hybrid architectures on function composition tasks, covering both conventional blocks, and those whose layers access a shared KV cache through top- retrieval.
• Multi-Hop Retrieval Attention. We introduce MURA, which enables recurrent layers to perform multi-hop retrieval from a shared KV cache while preserving the computational and memory efficiency of existing hybrid architectures.
• Expressivity improvements. We prove that a single m-hop MURA block can compute compositions of m functions with constant width and depth and logarithmic precision, and establish a strict expressivity hierarchy in retrieval depth, even under matched retrieval budgets.
• Empirical validation. We demonstrate that this hierarchy emerges through training on synthetic function-composition tasks with up to four retrieval hops, substantially outperforming existing hybrid baselines.
2.1 Hybrid Block Components and Structure
We first formalize the three classes of layers used to construct hybrid blocks. Throughout, bold lowercase and uppercase letters denote vectors and matrices, respectively (e.g., v and X), and .
Definition 2.1. A multi-head attention layer A of width consists of attention heads, each of dimension . Given an input sequence , each head computes queries , keys , and values , using learned projections . The layer computes
Here, is a learned output projection, the softmax is applied row-wise, and the causal mask satisfies for and otherwise. For each head , we define the attention score from token to token as the entry of the softmax matrix above.
For a fixed layer width, full attention processes a sequence of length in time, computing pairwise query-key similarities and aggregating the corresponding values. During autoregressive inference, the keys and values of preceding tokens remain unchanged and are therefore stored in a KV cache, avoiding their recomputation when processing new tokens. This requires memory per layer, and reduces the computational complexity for each new token to . These costs motivate using full-attention layers sparingly and interleaving them with more efficient recurrent layers, which we define next.
Definition 2.2. A recurrent layer R of width is specified by a fixed initial state and two functions , representing the state transition and output maps, respectively. Given an input sequence , the layer computes
and outputs .
We leave the parameterization of f and g unrestricted to encompass a range of widely used recurrent architectures [19; 18; 46]. Our framework also captures efficient attention variants, including sliding-window attention [2] and kernel-based linear attention [21]. See appendix A for further details.
For fixed layer width, recurrent layers process a sequence of length N in time. Additionally, during autoregressive inference, each new token at position t is processed using only the preceding state , requiring constant memory and computation per token. While this makes recurrent layers significantly more efficient than full attention, their bounded memory can limit long-context performance [42; 35], motivating hybrid architectures that combine recurrent and full-attention layers.
Since full attention maintains a richer memory in the form of a growing KV cache, recent approaches [13; 43] seek to exploit this resource by allowing recurrent layers to access a fixed number of the highest-scoring KV entries per token, aiming to improve performance while preserving efficiency. This motivates the following definition.
Definition 2.3. Fix and a full-attention layer A of width with heads. For each head , let and , both in , denote its cached keys and values. For each position and head , let consist of position and the preceding positions with the highest attention scores , breaking ties in favor of more recent positions. The corresponding retrieved KV entries are
A top- access recurrent layer of width is defined by a fixed initial state and two functions and , specifying the state transition and output, respectively. Given an input sequence , the layer computes
and outputs .
Compared with standard recurrent layers, top- access recurrent layers incur additional computation only for computing the neighborhoods and retrieving the corresponding KV entries . As demonstrated by Gao et al. [13], attention-based neighborhood selection can be performed without increasing the asymptotic complexity of full attention, and can be implemented efficiently in practice using algorithms such as FlashAttention[8]. For fixed and layer width, retrieving requires constant time per token. Furthermore, both operations need only be performed once per full-attention layer, and their results can be shared across multiple subsequent recurrent layers. Having defined these three classes of layers, we now formalize the hybrid blocks considered in this work.
Definition 2.4. For nonnegative integers , and , a top- access hybrid block of width consists of standard recurrent layers , a causal full-attention layer , and top- access recurrent layers . All post-attention layers have access to layer KV cache. For an input sequence , the block computes
Definition 2.4 captures several prominent hybrid block designs. In particular, top-0 access blocks represent conventional hybrid architectures, such as those used by Kimi K3 [40], Gemma 3 [16], Nemotron 3 Ultra [3], and OLMo Hybrid [30], while top- access blocks capture the more recent shared-KV mechanisms introduced by HySparse [13] and HySparse2 [43].
In practice, hybrid models usually use attention layers as part of transformer blocks, typically including layer normalization and position-wise feed-forward networks. We omit these token-wise operations from our theoretical analysis, as they can be incorporated into adjacent recurrent layers without affecting our results, but retain them in our experiments; see Appendix A.
Top- access offers one approach to reusing the existing KV cache within efficient layers. We next investigate whether such shared-memory access can enhance the expressivity of hybrid blocks, and whether top- retrieval is sufficient to realize these benefits. Studying expressivity at the block level is particularly relevant for designing efficient hybrid models: increasing the capabilities of individual blocks through relatively inexpensive sequence layers could reduce the number of full-attention layers required, thereby saving computation and KV-cache memory.
2.2 Expressivity Limitations of Hybrid Blocks on Function Composition
Below, we establish expressivity limitations for individual top- access hybrid blocks. We treat each block as a sequence model, embedding input tokens into vectors of width d and applying an unembedding layer to the final token representation to produce the output (see Appendix A for details). Throughout, we assume p bits of precision per scalar, where p may scale with the sequence length N. Our analysis focuses on function composition, a standard task in sequence-model expressivity analysis [33; 22; 6; 47].
Definition 2.5. Given integers , functions and a query , we construct a sequence of length over the alphabet by concatenating the function tables and appending the query:
The m-function composition task requires a sequence model to output, at the final position,
Function composition captures a fundamental aspect of multi-hop reasoning, in which solving a problem requires multiple dependent retrievals. For example, answering a question about the birthplace of a person’s father requires first identifying the father and then retrieving his birthplace. To analyze the ability of hybrid blocks to perform such computations, we establish a connection between their expressive power and one-way multiparty number-on-the-forehead (NOF) communication protocols [41], defined below.
Definition 2.6. For , a one-way -player number-on-the-forehead (NOF) communication protocol consists of players with a fixed communication procedure. Given input functions and a query , each player , for , has access to and all functions except , while player has access to all functions but not .
Communication proceeds in the fixed order . Each player except sends a single message, determined by its available inputs and all preceding messages according to the fixed protocol. Finally, produces an output based on its available information and the received messages. The communication cost is the maximum, over all possible inputs, of the sum of the bit lengths of all transmitted messages.
A classical result in communication complexity [41] establishes that any one-way -player NOF protocol computing -function composition for all possible inputs requires bits of communication. We use this lower bound throughout our analysis, beginning with its three-player case to establish a capacity lower bound for top- access hybrid blocks.
Theorem 2.7. Let be a top- access hybrid block with pre-attention layers and post-attention layers, width d, and precision p. Define its capacity as
If for some integer , computes -function composition for all sequences encoding functions and queries , then
We outline the main argument below, with the full proof provided in Appendix B.1.
Proof sketch. We show that any top- access hybrid block computing m-function composition induces a three-player NOF protocol for two-function composition with communication cost .
(a) MURA: follow the retrieval chain

(b) Top- access: select directly from x

Figure 1: MURA versus top- retrieval. Both panels illustrate the same input for 3-function composition. (a) The construction of Theorem 3.3 performs three successive lookups to compute . (b) An illustrative attention-score-based top- selection retrieves several tokens directly from x, but fails to reach the target token through the required retrieval chain.
For , we fix to be the identity. Given inputs , the players jointly simulate the block's forward pass on the corresponding sequence of length .
Player (knows ): Since all tokens preceding the final query are known to , it can compute their representations and recurrent states throughout the block. It transmits the states of the last pre-attention recurrent layer at positions and , together with the states of all post-attention layers at position . Player (knows ): Using the received pre attention state at position , can reconstruct the last token's attention query, as well as all keys and values corresponding to the first function table. For each attention head, it computes the contribution of these tokens to the attention output, represented by an unnormalized weighted sum and its softmax normalization factor. It also computes the top- highest-scoring KV entries within the first tokens along with their attention scores. These quantities are transmitted to . Player (knows ): Using the recurrent states received from , player reconstructs the representations of tokens , and computes their contribution to the final attention output. Combining this with the quantities received from , it recovers the full-attention output and the globally selected top- KV entries. Finally, using the post-attention recurrent states provided by , it completes the forward pass and outputs .
The total communication cost of the protocol above is . The classical three-player NOF lower bound therefore implies .
Remark. Ye et al. [47] also establish polynomial lower bounds for hybrid architectures, including those with multiple full-attention layers. However, specializing their result to hybrid blocks using a single full-attention layer yields an lower bound on model capacity and assumes a bound on the number of efficient sequence layers. In contrast, we establish an capacity lower bound that allows arbitrary recurrent depth and also extends to top- memory access.
3 Multi-Hop Retrieval from Shared Attention Memory
Theorem 2.7 reveals a fundamental limitation of top- access hybrid blocks in performing multi-hop reasoning. To address this limitation, we introduce Multi-hop Retrieval Attention (MURA), a new hybrid block architecture that allows sparse-attention layers to access the existing KV cache through multiple retrieval hops. We first formally define -MURA blocks and then establish their expressive advantage over existing hybrid architectures on function composition. In particular, we show that retrieval depth induces a strict expressivity hierarchy: an m-hop block can compute m-function composition with constant width and logarithmic capacity, whereas computing -function composition requires polynomial capacity. Importantly, these expressive gains come without increasing the asymptotic computational or memory complexity of existing hybrid blocks.
3.1 MURA Hybrid Blocks
To overcome the multi-hop expressivity limitations of top- access hybrid blocks, we propose a simple extension to the set of KV entries available to subsequent layers. Rather than retrieving only the tokens with the highest attention scores relative to the current position, we also retrieve tokens that are highly attended to by those already selected, recursively expanding the retrieved set over multiple hops.
For a fixed full-attention layer A, recall that denotes the top- neighborhood of position for attention head (Definition 2.3). Given retrieval widths , we recursively define multi-hop neighborhood by
The resulting neighborhoods contain chains of tokens connected by high-scoring attention links, potentially exposing information that cannot be accessed by top- retrieval. We now define MURA sparse-attention layers, which attend only to retrieved multi-hop positions.
Definition 3.1. Fix and full-attention layer A of width with heads. For each head , denote its cached keys and values by and , both in . A -MURA multi-head attention layer S is specified by query projection heads and integer tuples with and . Given an input sequence , each head computes queries and reuses the full attention keys and values, to compute
(11)
Here, is a learned output projection, the softmax is applied row-wise, and the mask satisfies for and otherwise. We refer to as the retrieval depth of S.
Importantly, MURA preserves the asymptotic efficiency of top- access layers. For fixed retrieval depths and widths , each neighborhood contains a constant number of positions independent of the sequence length . Consequently, each sparse-attention layer attends to only a fixed number of KV entries per token, retaining the same asymptotic computational and memory complexity as top- access. Although the neighborhood size can grow exponentially with retrieval depth , we show later that even the minimal choice is sufficient to improve expressive power, and that higher retrieval depth increases expressivity even for a matched number of retrieved tokens.
Beyond these theoretical guarantees, MURA also admits a practical implementation strategy. HySparse [13] demonstrates that attention-based routing information can be extracted alongside full attention using a modified FlashAttention kernel, without materializing the full attention matrix, and employs this approach to train 7B language models. Building on this design, multi-hop retrieval requires only an additional traversal of the selected token indices to construct the expanded neighborhoods, which can then be shared across all subsequent sparse-attention layers. The underlying KV cache and full-attention computation remain unchanged, making MURA a natural extension of existing efficient implementations. We now formally define MURA hybrid blocks.
Definition 3.2. For nonnegative integers and , and a -MURA hybrid block of width consists of standard recurrent layers , a causal full-attention layer A,
Since the one-hop neighborhoods include position itself, -hop neighborhoods contains all positions reachable within at most hops. In practice, we also consider a variant that restricts retrieval to positions reachable in exactly hops. We find this variant is sometimes preferable empirically, while retaining the original convention for our theoretical analysis.
and -MURA attention layers . All post-attention layers have access to the KV cache of layer A. For an input sequence , the block computes
3.2 The Expressive Power of MURA Hybrid Blocks
We study the effects of retrieval depth on the expressive power of MURA hybrid blocks. Our first result shows that even the minimal choice of retrieving a single predecessor per hop is sufficient to efficiently compute function composition, with the number of hops matching the number of composed functions. The full proof appears in Appendix B.2, and illustrated in Figure 1.
Theorem 3.3. For every fixed , a single -MURA block can compute m-function composition for every using a single attention head, a single MURA sparse attention layer, no recurrent layers, width independent of the sequence length , and precision .
Proof sketch. Consider an input sequence as in Definition 2.5. We embed each token corresponding to via a function of its table index , input argument , and value . We can then construct a full-attention layer A such that, for every , the unique top-1 predecessor of the token representing is the token representing . Similarly, the top-1 predecessor of the final query token is the token representing . Consequently, the m-hop neighborhood contains precisely the tokens along the composition chain
We set the full-attention output projection to zero, preserving the input representations through the residual connection. A single sparse-attention layer then attends to the retrieved composition chain. Since only the final token in the retrieved chain belongs to the first function table, we choose the full-attention value projection so that the last coordinate of each cached value contains the function value for tokens from the first table and zero otherwise. Setting the sparse-attention query to zero induces uniform attention over the retrieved tokens, yielding in the last output coordinate. Rescaling by recovers the desired composition, completing the construction.
We next establish a strict expressivity hierarchy in retrieval depth: each additional hop enables higher-order function composition with logarithmic capacity, while blocks with fewer hops require polynomial capacity, regardless of the number of (fixed) retrieved KV entries. This highlights the importance of retrieval depth over retrieval size. The full proof appears in Appendix B.3.
Theorem 3.4. For , with , let be a -MURA model with , pre-attention layers and post-attention layers, width , and precision . Define its capacity as
If computes -function composition on every instance of size , then
Proof sketch. We extend the reduction of Theorem 2.7 to an -player NOF protocol for -function composition. Given a -MURA block, the players simulate its forward pass on sequences of length . Player knows all function tables but not the query , while each , for , knows and all function tables except .
Full attention computation: Since knows all tokens preceding x, it can compute their representations and transmit the recurrent states needed at the boundaries between function tables. As in the previous proof, computes the contribution of the first m function tables to the final token's attention output, represented by an unnormalized weighted sum and its softmax normalization.
While this encoding differs from standard positional embeddings, it can be recovered from them using a single pre-attention recurrent layer. See Appendix A for details.
factor. Player then adds the contribution of the remaining tokens corresponding to function , recovering the full-attention output.
Retrieval: The players simulate the retrieval hops sequentially, starting with . At each stage, player computes attention scores with respect to the previously retrieved tokens and selects the top- candidates among all tokens, except those corresponding to , the only function table it cannot access. It transmits these candidates and their attention scores to , which knows and can therefore complete the global top- selection. Using the transmitted recurrent states, continues the computation and prepares the candidates for the next hop. In this way, each successive player completes one additional retrieval hop. Since the block performs only hops, player can recover the final retrieved KV entries, complete the forward pass, and output .
The resulting protocol has communication cost . Applying the -player NOF pointer-jumping lower bound yields , as claimed.
4 Empirical Evaluation
We empirically validate our theoretical findings on a synthetic function-composition benchmark. Our results show that existing hybrid architectures struggle to learn compositions, whereas MURA successfully learns increasingly complex compositions as retrieval depth grows, demonstrating the benefits of multi-hop access to the shared KV cache. We provide the main experimental details and results below, with a more comprehensive description in Appendix C.
Synthetic benchmark. We construct a synthetic dataset of 250,000 sequences, each encoding five functions , where and all function values are sampled independently and uniformly from . The function tables are serialized as in Definition 2.5, omitting the final query token. We train hybrid blocks on a causal token-prediction task that jointly evaluates function composition at depths . Specifically, each token representing is assigned multiple composition targets by treating its value as the query and applying the preceding functions:
These targets are predicted from each token’s final representation. We evaluate accuracy at each composition depth over all tokens for which the corresponding composition is defined. Models are trained for 500 epochs using cross-entropy loss over all composition targets. The dataset is split into 200,000 training, 25,000 validation, and 25,000 test examples, and we report test accuracy at the checkpoint selected by the best validation score.
Baselines and architecture details. All experiments use a single hybrid block comprising of one full-attention layer followed by four efficient sequence layers, each with four heads and hidden dimension . All models use the same positional encoding, supervision, and optimizer. We evaluate -MURA with , corresponding to retrieval depths of one through four hops. These configurations are chosen to have approximately the same retrieval budget of 32 tokens (33 for (11, 1, 1)). The single-hop configuration (32) corresponds to a simplified version of HySparse [13]. To facilitate learning at different composition depths, each head of a MURA sparse-attention layer uses a retrieval tuple , allowing earlier heads to access only shallower retrieval neighborhoods. We compare MURA against Gated DeltaNet [46], linear attention [21], and sliding-window attention [2]. For sliding-window attention, we evaluate window sizes of both 32 and 16 tokens. While a window of 32 matches the retrieval budget of MURA, each sliding-window layer maintains its own KV cache, resulting in a combined cache size comparable to an additional full-attention layer in our setting. We therefore also consider a window size of 16 to provide a more memory-efficient baseline.
Discussion. Table 1 demonstrates a clear relationship between retrieval depth and the ability to learn function composition. MURA blocks achieve near-perfect accuracy on m-function composition when their retrieval depth is at least m, while shallower configurations fail to fully learn the task. Interestingly, shallower configurations sometimes achieve accuracy substantially above random guessing, but remain far from perfect and exhibit considerably higher variance across seeds. Consistent with our
Table 1: Function-composition accuracy (%), reported as mean ± standard deviation over three seeds. Blue, green, and purple indicate the first, second, and third highest mean accuracies in each column, respectively.
| Model | m = 1 | m = 2 | m = 3 | m = 4 |
|---|---|---|---|---|
| MURA (32, ) | 83.05 ± 29.35 | 44.47 ± 23.64 | 5.81 ± 3.49 | 3.68 ± 0.11 |
| MURA (16, 1) | 100.00 ± 0.01 | 99.30 ± 1.22 | 30.31 ± 23.22 | 3.73 ± 0.10 |
| MURA (11, 1, 1) | 100.00 ± 0.00 | 100.00 ± 0.00 | 99.99 ± 0.01 | 27.81 ± 24.98 |
| MURA (8, 1, 1, 1) | 100.00 ± 0.00 | 100.00 ± 0.00 | 100.00 ± 0.00 | 100.00 ± 0.00 |
| Linear attention | 99.97 ± 0.01 | 57.83 ± 10.75 | 14.97 ± 5.66 | 8.78 ± 0.62 |
| Sliding window (16) | 100.00 ± 0.00 | 46.83 ± 8.49 | 3.76 ± 0.23 | 3.72 ± 0.08 |
| Sliding window (32) | 99.99 ± 0.01 | 85.18 ± 4.30 | 59.86 ± 4.18 | 3.65 ± 0.02 |
| Gated DeltaNet | 82.07 ± 31.03 | 25.55 ± 16.14 | 13.89 ± 10.93 | 7.97 ± 2.48 |
theoretical findings, the baseline hybrid blocks generally perform well on single-function composition but fail on deeper compositions. Even sliding-window attention with a window size of 32, which requires additional KV caches comparable in total size to another full-attention layer, struggles on more complex function composition. Together, these results demonstrate the expressive advantage of MURA in learning complex multi-hop computations that remain challenging for existing hybrid architectures.
5 Related Work
Efficient sequence models and shared attention memory. Reducing the computational cost of full attention has motivated extensive research into efficient sequence architectures. Early work explored sparse attention [7; 2; 49], while subsequent approaches developed efficient recurrent layers [19; 18; 46]. These architectures were later incorporated into hybrid architectures that combine them with full attention, including Kimi K3 [40], Gemma 3 [16], Jamba [24], and OLMo Hybrid [30]. These architectures typically maintain separate memory for their efficient layers, however recent work explores the idea of memory sharing: Cross-Layer Attention [5] shares KV activations across layers, while DART [34] attends to compressed recurrent chunk states. Both reduce memory requirements but still attend over a growing number of entries. HySparse and HySparse2 [13; 43] instead reuse full-attention KV caches for bounded sparse retrieval. Closely related to our work, Graph Machine [20] also employs multi-hop sparse retrieval, but maintains learned weighted edges and updates KV representations across sparse layers, limiting its memory savings. In contrast, MURA performs retrieval over a fixed attention graph, reusing the original KV cache across all sparse layers.
Expressivity of sequence models. The expressive power of sequence models has been extensively studied, with circuit-complexity analyses establishing limitations of log-precision Transformers [27] and showing how recurrent depth, padding, and chain of though improve these limitations [10; 26; 28]. Other work investigates the architectural resources required for tasks such as sparse averaging, Match3, and function composition [36; 37; 33; 6; 22]. Related analyses study limitations of linear RNNs [29; 38], with architectural modifications such as negative transition eigenvalues improving their state-tracking capabilities [17]. More recently, Merrill et al. [30] established expressive advantages of combining attention and recurrence, connecting these theoretical findings to the design of a large-scale hybrid model. Closely related to our work, Ye et al. [47] established lower bounds for hybrid architectures on sequential function composition, including architectures with multiple full-attention layers. While our analysis focuses on a single full-attention block, we establish a stronger capacity lower bound that allows arbitrary recurrent depth and extends to fixed top- shared-memory access.
6 Conclusion
We studied how sharing attention memory can enhance the expressive power of hybrid blocks without increasing their asymptotic computational or memory complexity. Using function composition as a model of multi-hop reasoning, we first established capacity lower bounds for existing hybrid blocks with either no KV-cache access or fixed top- retrieval, revealing fundamental limitations of these architectures. To overcome these limitations, we introduced MURA, a simple yet powerful extension that enables multi-hop retrieval from a shared KV cache. Our theoretical results establish a strict expressivity hierarchy in retrieval depth: m hops suffice to compute m-function composition with constant width and logarithmic capacity, whereas computing -function composition with only m hops requires polynomial capacity. Synthetic experiments with comparable retrieval budgets support this hierarchy and demonstrate the expressive advantages of MURA over existing hybrid architectures. Together, our findings highlight retrieval depth as a fundamental architectural principle for designing more expressive hybrid language models.
7 Acknowledgements
HM is supported by the Israel Science Foundation through a personal grant (ISF 264/23) and an equipment grant (ISF 532/23).
References
[1] Guy Bar-Shalom, Yam Eitan, Fabrizio Frasca, and Haggai Maron. A flexible, equivariant framework for subgraph GNNs via graph products and graph coarsening. In Advances in Neural Information Processing Systems, volume 37, 2024. URL https://papers.nips.cc/paper_files/paper/2024/file/b739d7ae14c0dd4c7619476f3f80ec98-Paper-Conference.pdf.
[2] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
[3] Aaron Blakeman, Aaron Thomas, Aastha Jhunjhunwala, Abhibha Gupta, Abhinav Khattar, Adam Rajfer, Adi Renduchintala, Adil Asif, Aditya Vavre, Adriana Flores Miranda, et al. Nemotron 3 ultra: Open, efficient mixture-of-experts hybrid mamba-transformer model for agentic reasoning. arXiv preprint arXiv:2606.15007, 2026.
[4] Cristian Bodnar, Fabrizio Frasca, Yuguang Wang, Nina Otter, Guido F Montufar, Pietro Lio, and Michael Bronstein. Weisfeiler and lehman go topological: Message passing simplicial networks. In International conference on machine learning, pages 1026–1037. PMLR, 2021.
[5] William Brandon, Mayank Mishra, Aniruddha Nrusimha, Rameswar Panda, and Jonathan Ragan-Kelly. Reducing transformer key-value cache size with cross-layer attention. arXiv preprint arXiv:2405.12981, 2024. URL https://arxiv.org/abs/2405.12981.
[6] Lijie Chen, Binghui Peng, and Hongxun Wu. Theoretical limitations of multi-layer transformer. arXiv preprint arXiv:2412.02975, 2024. URL https://arxiv.org/abs/2412.02975.
[7] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
[8] Tri Dao, Dan Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. Flashattention: Fast and memory-efficient exact attention with io-awareness. Advances in neural information processing systems, 35:16344–16359, 2022.
[9] Adir Dayan, Yam Eitan, and Haggai Maron. On the expressive power of permutation-equivariant weight-space networks. arXiv preprint arXiv:2602.01083, 2026. URL https://arxiv.org/abs/2602.01083.
[10] Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser. Universal transformers. arXiv preprint arXiv:1807.03819, 2018.
[11] Yam Eitan, Moshe Eliasof, Yoav Gelberg, Fabrizio Frasca, Guy Bar-Shalom, and Haggai Maron. On the expressive power of GNN derivatives. arXiv preprint arXiv:2510.02565, 2025. URL https://arxiv.org/abs/2510.02565.
[12] Yam Eitan, Yoav Gelberg, Guy Bar-Shalom, Fabrizio Frasca, Michael Bronstein, and Haggai Maron. Topological blindspots: Understanding and extending topological deep learning through the lens of expressivity. In International Conference on Learning Representations, 2025. URL https://arxiv.org/abs/2408.05486.
[13] Yizhao Gao, Jianyu Wei, Qihao Zhang, Yu Cheng, Shimao Chen, Zhengju Tang, Zihan Jiang, Yifan Song, Hailin Zhang, Liang Zhao, Bo Yang, Gang Wang, Shijie Cao, and Fuli Luo. HySparse: A hybrid sparse attention architecture with oracle token selection and KV cache sharing. arXiv preprint arXiv:2602.03560, 2026. URL https://arxiv.org/abs/2602.03560.
[14] Yoav Gelberg, Yam Eitan, Aviv Navon, Aviv Shamsian, Theo Putterman, Michael M. Bronstein, and Haggai Maron. GradMetaNet: An equivariant architecture for learning on gradients. In Advances in Neural Information Processing Systems, volume 38, 2025. URL https://arxiv.org/abs/2507.01649.
[15] Yoav Gelberg, Yam Eitan, Michael Bronstein, Yarin Gal, and Haggai Maron. Training transformers for KV cache compressibility. arXiv preprint arXiv:2605.05971, 2026. URL https://arxiv.org/abs/2605.05971.
[16] Gemma Team et al. Gemma 3 technical report. arXiv preprint arXiv:2503.19786, 2025. URL https://arxiv.org/abs/2503.19786.
[17] Riccardo Grazzi, Julien Siems, Arber Zela, Jörg Franke, Frank Hutter, et al. Unlocking state-tracking in linear rnns through negative eigenvalues. In International Conference on Learning Representations, volume 2025, pages 36565–36597, 2025.
[18] Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752, 2023.
[19] Albert Gu, Karan Goel, and Christopher Ré. Efficiently modeling long sequences with structured state spaces. arXiv preprint arXiv:2111.00396, 2021.
[20] Lintai Hou. Graph Machine: Towards better pretraining via edges. arXiv preprint arXiv:2609.02881, 2026. URL https://arxiv.org/abs/2609.02881.
[21] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In International conference on machine learning, pages 5156–5165. PMLR, 2020.
[22] Alexander Kozachinskiy, Felipe Urrutia, Hector Jimenez, Tomasz Steifer, Germán Pizarro, Matías Fuentes, Francisco Meza, Cristian B. Calderon, and Cristóbal Rojas. Strassen Attention: Unlocking compositional abilities in transformers based on a new lower bound method. arXiv preprint arXiv:2501.19215, 2025. URL https://arxiv.org/abs/2501.19215.
[23] Yuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh, Acyr Locatelli, Hanchen Ye, Tianle Cai, Patrick Lewis, and Deming Chen. SnapKV: Llm knows what you are looking for before generation, 2024.
[24] Opher Lieber, Barak Lenz, Hofit Bata, Gal Cohen, Jhonathan Osin, et al. Jamba: A hybrid transformer–mamba language model. arXiv preprint arXiv:2403.19887, 2024. URL https://arxiv.org/abs/2403.19887.
[25] Haggai Maron, Or Litany, Gal Chechik, and Ethan Fetaya. On learning sets of symmetric elements. In International conference on machine learning, pages 6734–6744. PMLR, 2020.
[26] Will Merrill and Ashish Sabharwal. Exact expressive power of transformers with padding. Advances in Neural Information Processing Systems, 38:112497–112524, 2026.
[27] William Merrill and Ashish Sabharwal. The parallelism tradeoff: Limitations of log-precision transformers. arXiv preprint arXiv:2207.00729, 2023. URL https://arxiv.org/abs/2207.00729.
[28] William Merrill and Ashish Sabharwal. The expressive power of transformers with chain of thought. In International Conference on Learning Representations, volume 2024, pages 7690–7706, 2024.
[29] William Merrill, Jackson Petty, and Ashish Sabharwal. The illusion of state in state-space models. arXiv preprint arXiv:2404.08819, 2024. URL https://arxiv.org/abs/2404.08819.
[30] William Merrill, Yanhong Li, Tyler Romero, et al. Olmo Hybrid: From theory to practice and back. arXiv preprint arXiv:2604.03444, 2026. URL https://arxiv.org/abs/2604.03444.
[31] Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 4602–4609, 2019.
[32] Aviv Navon, Aviv Shamsian, Idan Achituve, Ethan Fetaya, Gal Chechik, and Haggai Maron. Equivariant architectures for learning in deep weight spaces. In International Conference on Machine Learning, pages 25790–25816. PMLR, 2023.
[33] Binghui Peng, Srini Narayanan, and Christos Papadimitriou. On limitations of the transformer architecture. arXiv preprint arXiv:2402.08164, 2024. URL https://arxiv.org/abs/2402.08164.
[34] Yixiao Qian, Song Chen, Pengkai Wang, Jiaxu Liu, Shengze Cai, and Chao Xu. DART: Decoded attention over recurrent states for efficient long-context sequence modeling. arXiv preprint arXiv:2608.02032, 2026. URL https://arxiv.org/abs/2608.02032.
[35] Ruifeng Ren, Zhicong Li, and Yong Liu. Exploring the limitations of mamba in copy and cot reasoning. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 12550–12574, 2025.
[36] Clayton Sanford, Daniel J Hsu, and Matus Telgarsky. Representational strengths and limitations of transformers. Advances in Neural Information Processing Systems, 36:36677–36707, 2023.
[37] Clayton Sanford, Daniel Hsu, and Matus Telgarsky. Transformers, parallel computation, and logarithmic depth. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pages 43276–43327, 2024. URL https://proceedings.mlr.press/v235/sanford24a.html.
[38] Yash Sarrof, Yana Veitsman, and Michael Hahn. The expressive capacity of state space models: A formal language perspective. Advances in Neural Information Processing Systems, 37: 41202–41241, 2024.
[39] Joshua Southern, Yam Eitan, Guy Bar-Shalom, Michael Bronstein, Haggai Maron, and Fabrizio Frasca. Balancing efficiency and expressiveness: Subgraph GNNs with walk-based centrality. arXiv preprint arXiv:2501.03113, 2025. URL https://arxiv.org/abs/2501.03113.
[40] Kimi Team, Tongtong Bai, Yifan Bai, Yiping Bao, Jianfeng Cai, Xinyuan Cai, Peizhou Cao, Yuxuan Cao, Ziwei Chai, Y Charles, et al. Kimi k3: Open frontier intelligence. arXiv preprint arXiv:2607.24653, 2026.
[41] Emanuele Viola and Avi Wigderson. One-way multiparty communication lower bound for pointer jumping with applications. Combinatorica, 29(6):719–743, 2009.
[42] Roger Waleffe, Wonmin Byeon, Duncan Riach, Brandon Norick, Vijay Korthikanti, Tri Dao, Albert Gu, Ali Hatamizadeh, Sudhakar Singh, Deepak Narayanan, et al. An empirical study of mamba-based language models. arXiv preprint arXiv:2406.07887, 2024.
[43] Jianyu Wei, Yizhao Gao, Qihao Zhang, et al. HySparse2: Hybrid sparse attention with two-level KV sharing. arXiv preprint arXiv:2609.26368, 2026. URL https://arxiv.org/abs/2609.26368.
[44] Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. In International Conference on Learning Representations, 2024. URL https://arxiv.org/abs/2309.17453.
[45] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
[46] Songlin Yang, Jan Kautz, and Ali Hatamizadeh. Gated delta networks: Improving mamba2 with delta rule. arXiv preprint arXiv:2412.06464, 2024.
[47] Xiaowei Ye, Xiaoyu He, Chao Liao, Chen Wu, and Pinyan Lu. A provable expressiveness hierarchy in hybrid linear-full attention. arXiv preprint arXiv:2602.01763, 2026. URL https://arxiv.org/abs/2602.01763.
[48] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. Advances in neural information processing systems, 30, 2017.
[49] Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. Advances in neural information processing systems, 33:17283–17297, 2020.
[50] Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, Ruisi Cai, Zhao Song, Yuandong Tian, Christopher Ré, Clark Barrett, Zhangyang Wang, and Beidi Chen. : Heavy-hitter oracle for efficient generative inference of large language models, 2023.
A Additional Preliminaries
Notation. We retain the notation of the main text and introduce new conventions, which will be helpful for the proofs below. The vectors represent the standard basis, with dimension specified where it is used, and is the zero vector in . The indicator of a set is . We write for the dimension of an attention head. In the communication proofs, denotes the representation at position immediately before full attention, and are its original query, key, and value in head . These original vectors, and the neighborhoods determined by the full-attention scores , remain fixed throughout subsequent shared-cache computations. The notation denotes the highest scoring positions in , ranked by decreasing score and then decreasing position with respect to query .
Sequence modeling: embedding and decoding. Throughout this paper, we consider hybrid blocks which take as input sequences where each sequence element takes value in a finite alphabet . The hybrid block then predicts an output token . This is done through two additional components to the hybrid block, the embedding and unembedding layers. An embedding layer produces
At position , this embedding depends only on , and . Applying a block B gives . An unembedding layer then produces output logits. The predicted symbol is
In practice, the embedding layer typically combines learned token embeddings with positional encodings:
where is the learned embedding of token and is a positional encoding, such as a sinusoidal encoding. Similarly, the unembedding layer is typically a linear projection. In this manuscript, we leave both maps unrestricted, as our lower bounds hold in this more general setting. For our upper-bound construction (Theorem 3.3), the required embedding maps can be implemented using standard embeddings followed by a single additional pre-attention recurrent layer, while retaining a linear unembedding.
Normalization and feed-forward networks. In practice, sequence layers are typically augmented with layer normalization and position-wise feed-forward networks (FFNs), which we omit from our theoretical formulations for simplicity. Specifically, given an input sequence
and a sequence layer L, we apply the following pre-normalization updates:
We use this structure throughout our experiments. In our theoretical analysis, we omit these components, as they operate independently at each token and can be incorporated into the unrestricted computations of the recurrent layers used by all hybrid models, without affecting the communication-based lower bounds.
Finite precision and attention arithmetic. Throughout our analysis, hybrid blocks operate at finite precision , specifying the number of bits available to represent each scalar. Two common choices are constant precision, reflecting the fixed numerical precision used in practice, and logarithmic precision , which is sufficient to distinguish token positions while limiting the information encoded in each scalar.
Since the order of arithmetic operations can affect finite-precision computations, we explicitly specify how attention is evaluated. For each query position u and head j, we first compute the query-key dot products by summing coordinate-wise products in a fixed order, obtaining the quantized pre-softmax logits . We then apply a fixed positive, quantized exponential to obtain the unnormalized attention weights
For any set of positions , we define the partial unnormalized attention sum and normalization factor as
(21)
Here, denotes quantization to the prescribed precision, applied to each product before accumulation. The attention output is then computed by normalizing the accumulated sum:
In particular, for disjoint sets , exact accumulation ensures
(23)
Thus, independently computed partial statistics can be combined to reproduce the attention output exactly, as required by our communication protocols. This convention applies to both full and sparse attention throughout our proofs..
Common hidden width and recurrent memory. For simplicity, the main text uses a common width for token representations and recurrent states. An implementation may instead have token width and a larger persistent state. For example, sliding-window attention with a fixed window of predecessors can retain their keys and values in a state with coordinates, together with a constant amount of indexing information. Kernel-based linear attention with feature dimension retains a feature-value accumulator and a feature sum, with coordinates for a single head [21]. For fixed , or fixed , these sizes are constant multiples of , independent of sequence length. For the usual choice in a single head, however, linear attention has a state quadratic in ; this cost must also be counted.
To realize these implementations within the main-text definitions, choose d large enough for every token representation and every layer's complete persistent state, and divisible by the head count. Pad smaller representations and states with zeros, and extend each map by restricting its input to the original coordinates and padding its output.
B Theorem proofs
Communication lower bound used in the proofs. We use the deterministic consequence of Viola and Wigderson [41, Theorem 3.2]: for fixed , the one-way -player protocol in the main text needs bits to compute -function composition. To match its table formulation to tree pointer jumping, take and a -ary tree with pointer choices and Boolean leaf labels. Index the nodes at each depth injectively in , since there are at most of them. Encode the root choice by , the remaining pointer maps by , and the leaf labels by , using output symbols 1, 2. Assign fixed public values to unused table entries. This preserves each player's hidden input and the speaking order. A composition protocol therefore solves the tree problem. Announcing its decoded Boolean output adds one bit, reconciling the source's charged-output convention. The tree lower bound is , giving the required bound.
B.1 Proof of Theorem 2.7
Proof. Set to the identity when . On the resulting input of length , the required output is . We construct the three-player protocol of Definition 2.6: knows , but not ; knows , but not ; and knows , but not . The model, embedding, decoder, All identity-table tokens, and task parameters are public. Messages are broadcast in the order .
Player : communicating boundary states. Write and for the recurrent states after position in layer of the respective stacks. is able to evaluate the entire block on positions , without knowing . It broadcasts
These messages require bits. The transmitted pre-attention states allow subsequent players who know to compute its pre-attention representation , and players who know , but not to reconstruct the pre-attention representations . Moreover, once the attention output at position has been recovered, the post-attention states at position allow the final player to complete the forward pass.
Player : partial attention and candidate records. Using its knowledge of , player first computes the pre attention representations , as well as all key and value vectors for . From the boundary states at and its knowledge of , it also computes and the final queries for every head. For each head , it broadcasts
defined in equation 21, costing bits in total. It additionally selects
and transmits, for each , the record costing a total of bits.
Player : reconstructing full attention and top- access. Starting from the pre-attention boundary states , player evaluates the pre-attention representations for . This suffix consists of , the public identity tables, and . It also obtains every suffix key and value together with the final queries in the same way they were computed by . For each head, it computes and , adds the received prefix statistics, and normalizes with the model's rounding rule. Equation 23 guarantees that this is the exact full-attention head output, including the final token's self contribution. Writing for the reconstructed head-output column vector, it obtains
Thus computing the representation of the final token x after the attention layer.
For retrieval, it selects its own top- candidates among and merges them with . We use the following elementary identity, with all rankings following the same total order:
for disjoint predecessor sets A, C. Indeed, an element excluded from its own set's top k has at least k elements of that set ranked ahead of it, and cannot be in the global top k. This proves that the merge recovers every selected predecessor, including when scores tie or one side has fewer than k elements. Adding the known self position N recovers and all its keys and values.
Player now advances the final token through the post-attention stack. Starting with , it knows at each layer the current token representation, that layer's state at , and every entry of the fixed retrieved cache . It therefore applies the specified transition and output maps exactly. Induction over these layers recovers the block's final representation, after which the public decoder outputs . No player needs the hidden table to execute its assigned computation.
Communication and the lower bound. Since The total cost is at most
(29)
The three-player NOF lower bound stated in the main text requires bits for two-function composition. Applying it to this exact simulation completes the proof.
Remark: comparison with prior bounds and tightness. Theorem 1.1 of Ye et al. [47] studies a similar setting, considering multiple full-attention layers and a bounded number of recurrent layers between them. In their notation, taking leaves one full-attention layer, permits up to efficient layers after it, and gives a width–precision lower bound of . Our bound significantly improves this lower bound for the single hybrid block setting, applies to arbitrary post-attention recurrent depth with its state cost charged, and allows top- cache access.
We also highlight the role the of recurrent layers in the above bound. For a single attention layer without recurrence, the communication argument of Peng et al. [33, Theorem 1] shows a stronger lower bound of for two-function composition. The weaker hybrid lower bound is consistent with RNNs providing an additional expressive advantage around a single attention layer. The tightness of our lower bound remains an open question.
B.2 Proof of Theorem 3.3
Proof. We construct an m-hop block with , , , , and which solves m- function composition.
Fix . Let denote the position containing , and let . In this proof, are the standard basis of , and we suppress the sole head index in queries, keys, values, and neighborhoods.
Embedding the function tables and query. We use the following token embedding:
Both vectors have coordinates. These features depend only on the visible token and position; in particular, they do not reveal a function value at any other argument. The last coordinates are reserved for sparse-attention output.
Full attention layer A. Let be a linear map such that and for . Choose and so that their query and key vectors have the following coordinates, followed by zero padding to dimension :
The key of the final token is obtained by the same projection; its specific value is irrelevant to predecessor selection.
For and any causal predecessor , the unscaled query-key score is
The predecessor has score 1, whereas every other predecessor has score at most 0. Likewise,
uniquely selects . The common positive scaling preserves these rankings. Thus the top-1 neighborhoods determined by A follow the required dependent lookups. Setting and for , it follows from the above that for every ,
Specifically, the index which contains the value of the full function composition, is contained in the above neighborhood.
Choose so that the full-attention value vectors are
padded to width . For the embedded input matrix , set , giving . The full-attention residual preserves every embedding coordinate, including the zero workspace.
MURA attention layer S. Set , so S attends uniformly to the retrieved positions using the shared values. From the retrieved value vectors, the only one whose first coordinate is not zero is , whose first coordinate value is exactly . Additionally, this is the only value vector whose entry is non zero, with value 1. after performing sparse attention, the value of the corresponding output vector at these two coordinates are then
Choose the output projection matrix of S such that its only nonzero entries are
Thus the sparse layer writes into workspace coordinates . Their input coordinates are zero, so the sparse layer's residual adds no other contribution there.
For output symbol , let row of have coefficients on those two workspace coordinates and zero elsewhere. Its ideal logit is
The unique maximizer is , with gap at least . The linear decoder therefore extracts the composition value from an ordinary softmax-weighted average.
Finite precision. We show that the construction remains correct with bits of precision per scalar. Choose a fixed-point format with dyadic grid spacing satisfying
taking the largest dyadic spacing satisfying this inequality. All unscaled query-key dot products are integers and can be computed exactly. We approximate the attention scaling factor by a positive grid value with . Since each correct retrieval position has unscaled score 1, while all competing positions have scores at most 0, rounding the scaled logits preserves a gap of at least .
We choose to be the exponential rounded to the fixed-point grid, with saturation to and . The correct position consequently receives an unnormalized weight exceeding every competitor by at least . Since the normalization factor is at most , the corresponding normalized attention scores differ by at least . The final constraint on ensures that this ordering is preserved even after quantization of the normalized scores. Thus, all top-1 retrievals remain unchanged.
In the sparse-attention layer, all queries are zero, so every attention logit is exactly zero. Choosing assigns equal weights to all retrieved positions. Since their value coordinates are integers, the unnormalized attention sums and normalization factor are computed exactly. Quantization of the normalized output introduces an error of at most in each workspace coordinate of equation 36. Consequently, exact accumulation of the decoder's weighted sums, followed by final rounding, introduces an error of at most
in each output logit. Since the ideal logit gap is at least , the correct symbol remains the unique maximizer, ensuring exact decoding.
Finally, we verify that all intermediate computations fit within the claimed precision. Since takes values in and value coordinates have magnitude at most , each quantized weighted-value coordinate has magnitude at most . Accumulating up to terms therefore requires representing values of magnitude . All other intermediate quantities, including embeddings, routing products, and decoder products, have magnitude . Moreover, the choice of in equation 39 requires only fractional bits. Thus, including integer bits and accumulation guard bits, bits per scalar suffice. Since , , and , the construction has capacity , which reduces to for fixed .
B.3 Proof of Theorem 3.4
Proof. Let , and assume is a -MURA block that is able to solve -function composition, where . We generalize the proof of Theorem 2.7, and show that there exists a -player NOF protocol (Definition 2.6) that is able to simulate the forward pass of , with communication complexity . The proof then follows from the classic -player NOF protocol communication bound [41].
Player : communicating boundary states. Write for the recurrent states after position in layer of the pre attention recurrent layers. Similarly to the proof of Theorem 2.7, is able to evaluate the entire block on positions , without knowing . It broadcasts
These messages require bits. The transmitted pre-attention states allow subsequent players who know , , but not , to compute pre-attention representations , for , .
The following communication steps are used to construct two main quantities needed for the last player to complete the forward pass, the full attention computation, and the retrieval set. For clarity, we present these two computations separately, but note that they happen in parallel, each player filling its role in each of the computations simultaneously.
Full attention computation: Using its knowledge of , player first computes the pre attention representations , as well as all key and value vectors for . From the boundary states at and its knowledge of , it also computes and the final queries for every head. For each head , it broadcasts
Starting from the pre-attention boundary states , player evaluates the pre-attention representations for . This suffix consists of and . It then computes every key and value vector from this suffix, together with the final queries . For each head, it computes and , adds the received prefix statistics, and normalizes with the model's rounding rule. Equation 23 guarantees that this is the exact full-attention head output, including the final token's self contribution. Writing for the reconstructed head-output column vector, it transmits
Thus computing the representation of the final token x after the attention layer. The total communication cost of this process is .
Retrieved KV cache computation:
For a selected position t in head j, the record is defined by
The cost of communicating a single record is
Additionally, define recursively for ,
(46)
Here, denotes the set of positions reached from the final token after exactly successive retrieval hops with widths . The auxiliary set contains the candidates obtained at the -th hop when positions corresponding to the function table are excluded from retrieval.
We prove inductively that each player , for , can recover the sets and , together with the corresponding token records, for every attention head (with considered only for ). This ensures that the final player can reconstruct the retrieved KV entries corresponding to all sets , for and . Since can also reconstruct the full-attention output, as shown above, and knows the query , it can complete the remaining forward pass and produce the correct output, completing the proof.
The base case is simple. As shown above, player can compute the final pre-attention representation and hence the record for every head . Moreover, it can compute the representations for all eligible for selection into , allowing it to compute the top tokens and transmit their corresponding records.
For the inductive step, suppose player receives from the sets and , together with their corresponding token records. Write , and let denote the positions of the function table excluded in the definition of . To recover , player computes, for each , the top- candidates within . Since knows the corresponding function table and has access to the necessary recurrent boundary states, it can reconstruct these tokens' representations and attention scores. Combining these candidates with those in yields the full set , by the identity
which holds for disjoint sets A, B under consistent tie-breaking.
Having recovered and its corresponding records, player computes by selecting the top- candidates for each , excluding the function table unavailable to . Since all remaining tokens are known to this player, their representations and attention scores can be computed using the transmitted boundary states. It then sends and , together with their records, to . This completes the inductive step.
At each retrieval hop , the transmitted records require at most bits. Since for all , including the initial messages gives a total communication cost of at most
where the last equality holds, using . The classical communication lower bound for one-way -player NOF protocols computing -function composition therefore implies , completing the proof.
C Experimental details
We provide the implementation and training details of our synthetic experiments below. All experiments were conducted on NVIDIA L40 GPUs using Python 3.11.16, PyTorch 2.12.1+cu126, CUDA 12.6, and NumPy 2.4.6.
C.1 Dataset and Causal Supervision
Sampling and serialization. Each example consists of five functions , where is sampled from . Conditional on , all function values are sampled independently and uniformly from . The functions are serialized as
Unlike Definition 2.5, the sequence begins with a beginning-of-sequence (BOS) token and contains no explicit final query . Function tables appear in increasing order, without separator tokens, yielding a sequence length of .
The dataset contains 250,000 independently generated examples, divided into 200,000 training, 25,000 validation, and 25,000 test examples. Each split is stratified by n, with the number of examples for any two domain sizes differing by at most one. During batching, each example occupies a separate row, and shorter sequences are right-padded. Padding positions are excluded from attention, retrieval, loss computation, and accuracy evaluation.
Targets and loss. We evaluate the ability of hybrid blocks to compute function compositions of depths using causal supervision at multiple positions. Specifically, each token containing , for , is assigned targets, corresponding to compositions of depths :
Thus, tokens from the second function table predict , while tokens from later tables are supervised at progressively greater depths. The BOS token and the first function table receive no direct supervision.
Each depth has a separate linear readout applied to the corresponding token representations, producing 30 output logits. For examples with , logits corresponding to symbols outside are masked, and each token is evaluated only at depths for which a target is defined. Consequently, each example contributes targets at depth , for a total of supervised predictions.
All valid predictions contribute equally to the training objective. Denoting by the set of supervised example-position-target triples in a logical batch B, we minimize
where is the masked softmax distribution produced by readout r, and t is its target at the corresponding example, position and composition depth r.
C.2 Hybrid Block Architecture
Token embedding map. All models use a token embedding scheme inspired by Kozachinskiy et al. [22], consisting of nine deterministic features followed by a learned affine projection to width . With the BOS token at position 1, each subsequent token at position is characterized by its function argument , function-table index , and token value .
Define the circular encoding
The nine input features are given by
(53)
The two function-table encodings use offsets and , respectively. The BOS token is assigned the feature vector , while padding tokens receive zero features. All feature vectors are mapped to by a learned affine transformation, with padding positions masked again afterward to eliminate the effect of the bias.
This encoding provides the function-table index, argument, and value of each token without revealing composition paths or targets. We use no additional learned token or function embeddings, absolute positional embeddings, or rotary positional transformations.
Layers. Each hybrid block consists of one full-attention layer followed by four efficient sequence layers, implemented as recurrent or sparse-attention layers depending on the architecture. All layers have width , and use four heads. As described in Appendix A, each layer uses the pre-normalization and position-wise feed-forward structure of Equation 19. We use affine LayerNorm with and apply an additional affine LayerNorm before the output readouts. Similarly to [22], each of the five feed-forward networks has two hidden layers of width 64, with SwiGLU activations, giving dimensions . Both hidden layers use separate gate and value projections. All model parameters use standard initialization.
MURA retrieval. To evaluate the effect of retrieval depth, we consider four MURA configurations with retrieval widths , , , and , corresponding to depths one through four. These configurations have matched retrieval budgets of 32 tokens across all hops, except for , which retrieves up to 33 tokens.
Each MURA layer has four attention heads, with retrieval depths assigned to encourage learning compositions of different orders. Specifically, for a configuration , head uses retrieval widths and attends only to positions reached after exactly hops. Thus, successive heads perform increasingly deep retrievals, up to the maximum depth . This assignment is repeated across all four MURA layers. Routing decisions are detached from the computational graph, while gradients continue to flow through the selected keys and values.
Hybrid block baselines. We compare MURA against four hybrid block baselines: kernel-based linear attention [21], sliding-window attention [2], Gated DeltaNet [46], and a simplified HySparse variant [13], equivalent to one-hop MURA with . For a fair comparison, all architectures use the same width , one full-attention layer, and four subsequent efficient sequence layers, with four attention heads where applicable.
For sliding-window attention, we evaluate two window sizes, 32 and 16. The former matches the retrieval budget of MURA but incurs greater memory and computational overhead, since each of the four sliding-window layers maintains its own KV cache. In our short-sequence setting, these caches collectively store approximately as many KV entries as an additional full-attention layer. We therefore also evaluate a smaller window of size 16, providing a more computationally efficient baseline.
C.3 Optimization and Training Schedules
All models are trained for 500 epochs using AdamW with a batch size of 2,048, weight decay of 0.01, and optimizer parameters , , and . The learning rate is linearly warmed up over the first 40 epochs to a peak of , followed by cosine decay to one-tenth of the peak rate. After gradient accumulation, the global gradient norm is clipped to 1.0 before each optimization step.
D Extended related work
Efficient sequence models and shared attention memory. Reducing the cost of full attention has motivated a range of efficient sequence architectures. Early approaches introduced sparse attention mechanisms [7; 2; 49]; subsequent work developed recurrent and state-space architectures, including S4 [19], Mamba [18], and Gated DeltaNet [46]. These recurrent architectures support parallel training algorithms and maintain fixed-size states during autoregressive inference. Hybrid architectures combine efficient layers with periodic full attention, as in Kimi 3 [40], Gemma 3 [16], Jamba [24], and OLMo Hybrid [30]. Their efficient layers typically maintain memory independently of the full-attention KV cache. Recent work has explored sharing this memory. Cross-Layer Attention [5] shares KV activations across attention layers, while DART [34] attends to compressed recurrent chunk states. These approaches reduce memory requirements, although each attention operation still accesses a number of entries that grows with sequence length. HySparse and HySparse2 [13; 43] instead reuse a full-attention KV cache through bounded sparse retrieval in subsequent layers. Graph Machine [20], which is closely related to our work, also uses multi-hop sparse retrieval in hybrid architectures. It constructs and updates learned weighted edges across layers and operates on layer-specific representations. In MURA, retrieval traverses a fixed attention graph; the subsequent sparse layers reuse the resulting neighborhoods and the original full-attention KV cache.
Expressivity as a guide to architecture design. Prior work has examined sequence-model expressivity from several perspectives. Circuit-complexity analyses establish limitations of log-precision Transformers [27] and study how padding tokens[26], recurrent application of layers [10] and chain of thought tokens [28] expand their capabilities. Other studies analyze the resources required for tasks such as sparse averaging, 3-token Matching, and function composition [36; 37; 33; 6; 22]. Limitations identified for shallow Transformers have also motivated mechanisms such as Strassen attention [22]. Complementarily, Gelberg et al. [15] study the relationship between Transformer representations and KV-cache compressibility, relating expressive capacity and memory requirements to the learned representations.
Beyond Transformers, analyses of linear RNNs identify limitations in state tracking [29; 38], while Grazzi et al. [17] show that allowing negative transition eigenvalues can improve these capabilities. Merrill et al. [30] establish expressive advantages of combining attention and recurrence, and connect these results to the design of a large-scale hybrid model. Closely related to our analysis, Ye et al. [47] prove lower bounds for hybrid architectures on sequential function composition. We study a simpler composition task and obtain a stronger capacity lower bound for a single full-attention block, allowing arbitrary recurrent depth with its state budget accounted for as in Appendix B, as well as top- shared-memory access. Their framework also covers architectures with multiple full-attention layers. The comparison and the open question of tightness are discussed after the proof in Appendix B.1.
Expressivity analysis also guides architecture design for other structured data. Examples include graph neural networks [45; 31; 1; 11; 39], topological neural networks [4; 12], weight- and gradient-space architectures [32; 9; 14], and permutation-invariant models for sets and sets of structured elements [48; 25]. These studies use formal expressivity results to inform architectural choices that respect the structure and symmetries of their inputs.