arXiv is now an independent nonprofit! Learn more
License: CC BY 4.0
arXiv:2505.23735v1 [cs.CL] 29 May 2025

Atlas: Learning to Optimally Memorize the Context at Test Time

Vahab Mirrokni Note: {alibehrouz, zemanli, pkacham, dengyuan, peilinz, razaviyayn, mirrokni}@google.com, and majiddl.2099@gmail.com Affiliation: [Uncaptioned image]
Abstract

Transformers have been established as the most popular backbones in sequence modeling, mainly due to their effectiveness in in-context retrieval tasks and the ability to learn at scale. Their quadratic memory and time complexity, however, bound their applicability in longer sequences and so has motivated researchers to explore effective alternative architectures such as modern recurrent neural networks (a.k.a long-term recurrent memory module). Despite their recent success in diverse downstream tasks, they struggle in tasks that requires long context understanding and extrapolation to longer sequences. We observe that these shortcomings come from three disjoint aspects in their design: (1) limited memory capacity that is bounded by the architecture of memory and feature mapping of the input; (2) online nature of update, i.e., optimizing the memory only with respect to the last input; and (3) less expressive management of their fixed-size memory. To enhance all these three aspects, we present Atlas, a long-term memory module with high capacity that learns to memorize the context by optimizing the memory based on the current and past tokens, overcoming the online nature of long-term memory models. Building on this insight, we present a new family of Transformer-like architectures, called DeepTransformers, that are strict generalizations of the original Transformer architecture. Our experimental results on language modeling, common-sense reasoning, recall-intensive, and long-context understanding tasks show that Atlas surpasses the performance of Transformers and recent linear recurrent models. Atlas further improves the long context performance of Titans, achieving +80% accuracy in 10M context length of BABILong benchmark.

1 Introduction

The attention module (Bahdanau et al., 2014) is a critical building block in modern deep learning architectures (Vaswani et al., 2017; Achiam et al., 2023; Behrouz et al., 2024; Kamath et al., 2025), excelling due to its scalability and performance in in-context retrieval tasks. In principle, attention functions as an associative memory, computing direct pairwise token dependencies to store key-value mappings and retrieve them via query-key similarities. Computing this pairwise dependencies, however, while accurate, causes quadratic space and time complexity, limiting their applicability in long context understanding, memorization, or modeling (Liu et al., 2024a; Li et al., 2024; Dalal et al., 2025).

Recent research efforts aim to overcome the limitations of Transformers—i.e., pure attention-based architectures—in long-context modeling by designing more efficient yet effective recurrent neural networks (Schlag et al., 2021; Behrouz et al., 2024; Peng et al., 2025). These modern recurrent architectures can be unified as associative memory modules optimizing an internal objective termed ’attentional bias’ (Behrouz et al., 2025). Unlike Transformers’ growing KV cache, these models use fixed-size memory, necessitating improved memory management. Consequently, there’s growing interest in enhancing RNN memory management through more effective: (i) Learning rules, from additive learning (Katharopoulos et al., 2020) to DeltaNet’s Delta rule (Schlag et al., 2021); (ii) Forget (Retention) Gates, from RetNet’s input-independent gating (Sun et al., 2023) to adaptive gating in Titans (Behrouz et al., 2024) and RWKV-7 (Peng et al., 2025); and (iii) Memory Architectures, from vector-valued memory (Sun et al., 2023; Peng et al., 2023) to neural deep memory modules (Behrouz et al., 2024; Sun et al., 2024).

Despite the success of these improved models in a diverse set of downstream benchmarks, they often struggle with long context understanding, in-context retrieval, and extrapolation to longer sequences (Wen et al., 2024; Behrouz et al., 2024; Arora et al., 2024; Yang et al., 2024). We observe these shortcomings arise from three design aspects: (1) The online nature of their memory update, where memory is optimized based on the current token while retaining past memory state, leading to memorization of individual tokens without considering broader context; (2) The limited capacity of memory, where architecture and key-value feature mappings restrict the number of perfectly mappable key-value pairs; and (3) The expressiveness of memory management (i.e., the internal objective’s optimizer), as most recent models use gradient descent that relies on the first-order information about the dynamics of tokens, causing the memory to converge to spurious local minima and learn less effective key-value mappings.

Table 1: A summary of the recent modern recurrent neural networks. We compare these architectures based on five characteristics: (1) Dynamic decay; (2) Deep neural memory; (3) non-linear memory capacity; (4) Locally optimal: managing memory by (approximating) the second-order information about tokens; (5) Flexible context: the ability to flexibly memorize the context. ϕ()\phi(\cdot) and ϕ()\phi^{*}(\cdot) represent polynomial and infinite-dimensional feature mappings (see Equation 22).
Model Attentional Bias (,)\ell(\cdot;\cdot) Optimizer Dynamic Deep Non-linear Locally Flexible Memory Write Operation
Decay Memory Capacity Optimal Context
Attention t=1Lat𝐤t𝐯t22\sum_{t=1}^{L}a_{t}\|\mathcal{M}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} NP t=t1{(𝐤t,𝐯t)}\mathcal{M}_{t}=\mathcal{M}_{t-1}\cup\{(\mathbf{k}_{t},\mathbf{v}_{t})\}
SWA t=cLat𝐤t𝐯t22\sum_{t=c}^{L}a_{t}\|\mathcal{M}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} NP t=(t1{(𝐤c,𝐯c)}){(𝐤t,𝐯t)}\mathcal{M}_{t}=(\mathcal{M}_{t-1}\setminus\{(\mathbf{k}_{c},\mathbf{v}_{c})\})\cup\{(\mathbf{k}_{t},\mathbf{v}_{t})\}
Linear Attention t𝐤t,𝐯t\langle\mathcal{M}_{t}\mathbf{k}_{t},\mathbf{v}_{t}\rangle GD t=t1+𝐯t𝐤t\mathcal{M}_{t}=\mathcal{M}_{t-1}+{\mathbf{v}_{t}\mathbf{k}_{t}^{\top}}
RetNet t𝐤t,𝐯t\langle\mathcal{M}_{t}\mathbf{k}_{t},\mathbf{v}_{t}\rangle GD t=αt1+𝐯t𝐤t\mathcal{M}_{t}=\alpha\mathcal{M}_{t-1}+{\mathbf{v}_{t}\mathbf{k}_{t}^{\top}}
GLA t𝐤t,𝐯t\langle\mathcal{M}_{t}\mathbf{k}_{t},\mathbf{v}_{t}\rangle GD t=Diag(αt)t1+𝐯t𝐤t\mathcal{M}_{t}=\text{Diag}(\alpha_{t})\mathcal{M}_{t-1}+\mathbf{v}_{t}\mathbf{k}_{t}^{\top}
PolySketchFor. t𝐤tp,𝐯t\langle\mathcal{M}_{t}\mathbf{k}^{p}_{t},\mathbf{v}_{t}\rangle GD t=t1+𝐯t(𝐤t)p\mathcal{M}_{t}=\mathcal{M}_{t-1}+\mathbf{v}_{t}(\mathbf{k}_{t}^{\top})^{p}
TTT t(𝐤t)𝐯t22\|\mathcal{M}_{t}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2} GD t=t1η(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\mathcal{M}_{t-1}-\eta\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
DeltaNet t𝐤t𝐯t22\|\mathcal{M}_{t}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} GD t=(𝐈βt𝐤t𝐤t)t1+βt𝐯t𝐤t\mathcal{M}_{t}=(\mathbf{I}-\beta_{t}\mathbf{k}_{t}\mathbf{k}_{t}^{\top})\mathcal{M}_{t-1}+\beta_{t}\mathbf{v}_{t}\mathbf{k}_{t}^{\top}
Longhorn t𝐤t𝐯t22\|\mathcal{M}_{t}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} Implicit GD t=(𝐈δt𝐤t𝐤)t1+(δt𝐯t)𝐤t\mathcal{M}_{t}=\left(\mathbf{I}-\delta_{t}\mathbf{k}_{t}\mathbf{k}^{\top}\right)\mathcal{M}_{t-1}+\left(\delta_{t}\odot\mathbf{v}_{t}\right)\mathbf{k}_{t} §
Gated DeltaNet t𝐤t𝐯t22\|\mathcal{M}_{t}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} GD t=αt(𝐈βt𝐤t𝐤t)t1+βt𝐯t𝐤t\mathcal{M}_{t}=\alpha_{t}(\mathbf{I}-\beta_{t}\mathbf{k}_{t}\mathbf{k}_{t}^{\top})\mathcal{M}_{t-1}+\beta_{t}\mathbf{v}_{t}\mathbf{k}_{t}^{\top}
RWKV-7 t𝐤t𝐯t22\|\mathcal{M}_{t}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} GD t=(diag(αt)βt𝐤t𝐤t)t1+βt𝐯t𝐤t\mathcal{M}_{t}=(\text{diag}(\alpha_{t})-\beta_{t}\mathbf{k}_{t}\mathbf{k}_{t}^{\top})\mathcal{M}_{t-1}\!+\beta_{t}\mathbf{v}_{t}\mathbf{k}_{t}^{\top}
Titans t(𝐤t)𝐯t22\|\mathcal{M}_{t}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2} GD w/ M. t=αtt1+𝒮t\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}+\mathcal{S}_{t}
𝒮t=ηt𝒮t1θt(t1;𝐤t,𝐯t)\mathcal{S}_{t}=\eta_{t}\mathcal{S}_{t-1}-\theta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
Titans– t(𝐤t)𝐯t22\|\mathcal{M}_{t}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2} GD t=αtt1ηt(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
Moneta t(𝐤t)𝐯tpp\|\mathcal{M}_{t}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{p}_{p} GD t=αtt1ηt(i1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{i-1};\mathbf{k}_{t},\mathbf{v}_{t})
Memora t(𝐤t)𝐯t22\|\mathcal{M}_{t}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2} GD t=σ(αtlog(t1)ηt(t1;𝐤t,𝐯t))\mathcal{M}_{t}=\sigma\left(\alpha_{t}\log(\mathcal{M}_{t-1})-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})\right)
Our Models
DLA t(ϕ(𝐤t)),𝐯t\langle\mathcal{M}_{t}(\phi(\mathbf{k}_{t})),\mathbf{v}_{t}\rangle GD t=αtt1ηt(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
DeepTransformer t(ϕ(𝐤t)),𝐯t\langle\mathcal{M}_{t}(\phi^{*}(\mathbf{k}_{t})),\mathbf{v}_{t}\rangle GD t=αtt1ηt(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
SWDT i=cLt(ϕ(𝐤i)),𝐯i\sum_{i=c}^{L}\langle\mathcal{M}_{t}(\phi^{*}(\mathbf{k}_{i})),\mathbf{v}_{i}\rangle GD t=αtt1ηt(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
OmegaNet i=cLγit(ϕ(𝐤i))𝐯i22\sum_{i=c}^{L}\gamma_{i}\left\|\mathcal{M}_{t}(\phi(\mathbf{k}_{i}))-\mathbf{v}_{i}\right\|^{2}_{2} GD t=αtt1ηt(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
Dot i=cLγit(ϕ(𝐤i))𝐯i22\sum_{i=c}^{L}\gamma_{i}\left\|\mathcal{M}_{t}(\phi^{*}(\mathbf{k}_{i}))-\mathbf{v}_{i}\right\|^{2}_{2} GD t=αtt1ηt(t1;𝐤t,𝐯t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
Atlas i=cLγit(ϕ(𝐤i))𝐯i22\sum_{i=c}^{L}\gamma_{i}\left\|\mathcal{M}_{t}(\phi(\mathbf{k}_{i}))-\mathbf{v}_{i}\right\|^{2}_{2} Muon t=αtt1ηtNS-5(𝒮t)\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\>\>\texttt{NS-5}(\mathcal{S}_{t})
𝒮t=θt𝒮t1(t1,𝐤t,𝐯t)\mathcal{S}_{t}=\theta_{t}\mathcal{S}_{t-1}-\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})
The matrix-valued memory version is considered.    NP: Nonparametric   § δt=βt𝟏+βt𝐤t𝐤t\delta_{t}=\frac{\beta_{t}}{\mathbf{1}+\beta_{t}\mathbf{k}_{t}^{\top}\mathbf{k}_{t}} .    Gradient Descent with Momentum.    Without Normalization.

Memory Perspective

Associative memory—the ability to map different entities or events—is an inseparable component of learning in humans (Terry, 2017) and so has motivated several recent studies to understand the state-of-the-art deep learning architectures through its lens (Ramsauer et al., 2021; Behrouz et al., 2024; Behrouz et al., 2025; Wang et al., 2025). In this perspective, memory is defined as a neural update caused by an input; the more surprising the input is, the more it affects the memory and so is memorable. Therefore, finding an effective “surprise metric” is a critical step towards designing such memory modules. As earlier discussed by Behrouz et al. (2025); Behrouz et al. (2024), almost all existing architectures use a surprise metric that updates the memory based on the current input. An event (as a sequence of tokens), however, might not consistently be surprising through a long-period of time although it is memorable. To overcome this issue, Behrouz et al. (2024) suggest breaking the surprise metric into two parts of “momentary” and “past” surprise, incorporating the cumulative surprise of past inputs when updating the memory with respect to the current input. This design, however, can miss the context by memorizing individual tokens. To this end, in this work, we present a long-term neural memory module that measures the surprise of a local (or global) context window, meaning that it learns how to memorize the (token) context at test time.

Through the paper, we use the terminology “Test Time Memorization” because the process involves storing and retrieving information strictly within the global context, without updating the model’s core learned parameters (i.e., outer-loop) or initial states from pre-training. Typically, no persistent learning or skill acquisition carries over to new, independent global context once the memory is cleared. Thus, we prefer the use of "test time memorization" over using "test time training".

Contributions

In this paper, we aim to overcome the abovementioned limitations—i.e., (1) online nature, (2) limited memory capacity, and (3) less expressive memory management—by designing a long-term neural memory module with high capacity and the ability to memorize the context, instead of tokens. We further build upon these insights and present a family of strictly more powerful Transformers. More specifically:

Better Understanding of Memory Capacity and its Bottleneck. To improve the limited memory capacity, we suggest using higher-order feature mappings (e.g., polynomial feature kernels) on input tokens. We provide theoretical justifications on why deeper memory modules and/or higher-order feature mapping can enhance memory capacity—i.e., the maximum number of linearly independent key-value associations the memory can perfectly map.

New Expressive Learning Rule. To overcome the online nature of recent recurrent models, this work presents a sliding window update rule, called Omega rule, that optimizes and updates memory based on all past tokens in a given context window, not just the last. This allows the model to better manage its fixed-size memory and memorize a local context instead of individual tokens.

Strict Generalization of Transformers. Next, we show how our Omega rule formulation connects to global and local softmax attentions (i.e., Sliding Window Attention - SWA) and present a new family of Transformer-like architectures, called DeepTransformers and its sliding window variants SWDT, that strictly generalize Transformers (Vaswani et al., 2017). We further present a novel baseline of Deep Linear Attention (DLA) to demonstrate the role of deep memory.

New Memory Modules with Better Memory Management. Building upon the above improvements, we present OmegaNet, a new architecture using polynomial features on its keys and queries, while updating its memory based on Omega and gradient descent. To further enhance memory management, we introduce Atlas, which leverages the popular Muon optimizer (Jordan et al., 2024) for updating the internal memory. We show that both OmegaNet and Atlas can take advantage of parallelizable training algorithms, resulting in fast training without substantial overhead compared to the online version (i.e., context window = 1). To the best of our knowledge, Atlas is the first parallelizable recurrent architecture that optimizes the memory using the (approximation) of second-order information (i.e., has locally optimal memory module).

Improvement on Diverse Downstream Tasks. Extensive experiments validate our model designs and proposed techniques, including ablations of modern architectures. We evaluated DeepTransformers, OmegaNet, and Atlas on diverse benchmarks—language modeling, common-sense reasoning, recall-intensive, and needle-in-haystack tasks—where they outperformed modern linear RNNs, local attention (SWA), and Transformers. Furthermore, we studied the effects of memory architecture, feature mapping, memory management algorithm (internal optimizer), and Omega rule on memory module capacity and performance in long-context understanding tasks.

Proofs, additional experimental results, discussions on related work, and the details of experiments are in Appendix.

2 Preliminaries

In this section, we first discuss the notation that we use through the paper and then review the background concepts and related work. Additional discussion on related studies are in Appendix A.

Notations. We let xN×dinx\in\mathbb{R}^{N\times d_{\text{in}}} be the input, t\mathcal{M}_{t} be the state of memory \mathcal{M} at time tt, 𝐊\mathbf{K} be the keys, 𝐕\mathbf{V} be the values, and 𝐐\mathbf{Q} be the query matrices. We use bold lowercase letters with subscript tt to refer to vectors correspond to time tt (i.e., 𝐤t,𝐯t\mathbf{k}_{t},\mathbf{v}_{t}, and 𝐪t\mathbf{q}_{t}). Following Behrouz et al. (2025), we use (t,𝐤t,𝐯t)\ell(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t}) to refer to the attentional bias (i.e., the internal memory objective). Through the paper, we use simple MLPs with 1\mathcal{L}_{\mathcal{M}}\geq 1 layers and residual connection as the architecture of the memory module ()\mathcal{M}(\cdot). Notably, despite this choice, all of our model formulations are simply adaptable to other memory architecture choices; e.g., linear matrix-valued memory (=1\mathcal{L}_{\mathcal{M}}=1). When it is needed, we parameterized the memory module with 𝜽:={W1,,W,}\bm{\theta}_{\mathcal{M}}:=\{W_{1},\dots,W_{\mathcal{L}_{\mathcal{M}}},\dots\}, which at least includes the parameters of linear layers in the MLP.

2.1 Backgrounds

Attention. Attention is a critical component of Transformers that acts as their associative memory (Bietti et al., 2023; Sun et al., 2024; Behrouz et al., 2025). Given input xN×dinx\in\mathbb{R}^{N\times d_{\text{in}}}, causal attention computes output 𝐲N×din\mathbf{y}\in\mathbb{R}^{N\times d_{\text{in}}} over input dependent key, value, and query matrices 𝐐=x𝐖𝐐,𝐊=x𝐖𝐊,and𝐕=x𝐖𝐕\mathbf{Q}=x\mathbf{W}_{\mathbf{Q}},\mathbf{K}=x\mathbf{W}_{\mathbf{K}},\>\text{and}\>\>\mathbf{V}=x\mathbf{W}_{\mathbf{V}} as:

𝐲i=j=1iexp(𝐪i𝐤j/din)𝐯j=1iexp(𝐪i𝐤/din)=1Zij=1iexp(𝐪i𝐤j/din)𝐯j,\displaystyle\mathbf{y}_{i}=\sum_{j=1}^{i}\frac{\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{j}/\sqrt{d_{\text{in}}}\right)\mathbf{v}_{j}}{\sum_{\ell=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{\ell}/\sqrt{d_{\text{in}}}\right)}=\frac{1}{Z_{i}}\sum_{j=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{j}/\sqrt{d_{\text{in}}}\right)\mathbf{v}_{j}, (1)

where 𝐖𝐐,𝐖𝐊,\mathbf{W}_{\mathbf{Q}},\mathbf{W}_{\mathbf{K}}, and 𝐖𝐕din×din\mathbf{W}_{\mathbf{V}}\in\mathbb{R}^{d_{\text{in}}\times d_{\text{in}}} are learnable parameters, and Zi==1iexp(𝐪i𝐤/din)Z_{i}={\sum_{\ell=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{\ell}/\sqrt{d_{\text{in}}}\right)} is the normalization term. Despite Transformers’ simple parallelizable training and effectiveness in recall-intensive tasks (Arora et al., 2024), their generation process and long-context scaling are significant drawbacks, as attention requires at least N×dN\times d operations per token to calculate the output (see Equation 1). Therefore, in recent years, there have been an extensive research effort to design alternative architectures. We divide and review these studies into two groups: (1) Linear shallow memory recurrent models, (2) Deep memory modules:

(Linear) Recurrent Models. Linear RNNs have recently gained attention as efficient Transformer alternatives due to their parallelizable, linear-time training and comparable performance (Sun et al., 2023; Peng et al., 2023). Early modern RNN variants, often based on Hebbian (Hebb, 2005) or Delta (Widrow & Hoff, 1988) learning rules, compress data into vector-valued or matrix-valued memory (Katharopoulos et al., 2020; Sun et al., 2023; Kacham et al., 2024a; Liu et al., 2024; Schlag et al., 2021; Lim et al., 2024). Let td×n\mathcal{M}_{t}\in\mathbb{R}^{d\times n} be the memory (where n=1n=1 yields vector-valued memory), and 𝐤,𝐯d\mathbf{k},\mathbf{v}\in\mathbb{R}^{d} be the keys and values (projections of input xtdx_{t}\in\mathbb{R}^{d})). A simple general formulation for such linear RNNs is:

t=Att1+𝐯t𝐤t,\displaystyle\mathcal{M}_{t}=A_{t}\ast\mathcal{M}_{t-1}+\mathbf{v}_{t}\mathbf{k}_{t}^{\top}, (2)

where \ast is an arbitrary associative operator and AtA_{t} is a data-(in)dependent diagonal or low-rank plus identity matrix (Yang et al., 2024b). Despite the efficient linear recurrent nature of these models, their memory can overflow, particularly with increasing context length. Although forget gates have recently significantly improved memory management in these architectures (Sun et al., 2023; Peng et al., 2025), their memory’s expressivity remains bounded by its linear structure.

Deep Memory Module. To overcome the limited expressivity of memory and to enhance the effective context length recurrent models, recent studies focus on a new line of architectures with deep memory modules (Irie et al., 2021; Sun et al., 2024; Behrouz et al., 2024; Behrouz et al., 2025). These architectures are built on the meta-learning perspective, where the memory is a deep MLP architecture updated by gradient descent (with momentum). Recently, Behrouz et al. (2025) present a framework to accurately unifies popular sequence models as the instances of test time memorization. That is, sequence models are associative memory modules that aim to learn the underlying mapping between given keys and values by optimizing an internal memory objective, called attentional bias. This optimization is based on an iterative optimization algorithms such as gradient descent. More formally, associative memory is defined as:

Definition 1 (Behrouz et al. (2025)).

Given a set of keys 𝒦dk\mathcal{K}\subseteq\mathbb{R}^{d_{k}} and values 𝒱dv\mathcal{V}\subseteq\mathbb{R}^{d_{v}}, associative memory is an mapping :𝒦𝒱\mathcal{M}:\mathcal{K}\rightarrow\mathcal{V}. Learning the associative memory is based on an objective \mathcal{L}, called Attentional Bias, that determines the type of memory and its priorities:

=argmin((𝒦),𝒱).\displaystyle\mathcal{M}^{*}=\arg\min_{\mathcal{M}}\quad\mathcal{L}(\mathcal{M}(\mathcal{K});\mathcal{V}). (3)

Optimizing this objective using an iterative algorithm (e.g., gradient descent) results in the memory update rule. Thus, the sequence model is a meta in-context learner with two optimization levels:

  1. 1.

    Inner Loop: Where parameters of the memory module are optimized (i.e., 𝜽={W1,W2,,W,}\bm{\theta}_{\mathcal{M}}=\{W_{1},W_{2},\dots,W_{\mathcal{L}_{\mathcal{M}},\dots}\}). In the inner optimization loop, all other parameters from the model are considered hyperparameters and are fixed and not optimized.

  2. 2.

    Outer Loop: Where all other parameters of the model are optimized, such as linear projections, MLP layers, convolutions, etc.

Our terminology builds on this framework. Therefore, instead of full recurrent formulations, we describe models by their: (1) memory architecture, (2) internal objective (i.e., attentional bias), and (3) memory learning algorithm (optimizer). In most cases, models use matrix-valued memory with online gradient descent; for brevity in such instances, we refer to an architecture solely by its internal memory objective. For additional discussions and examples, see Appendix B.

Refer to caption
Figure 1: Comparison of learning to memorize (Left) individual tokens, and (Right) the context.

3 Learning to Memorize the Context at Test Time

Long-term associative memory, crucial for human learning (Terry, 2017), has inspired many artificial neural architectures (He et al., 2024; Krotov & Hopfield, 2016; Schmidhuber & Hochreiter, 1997; Ramsauer et al., 2021; Hopfield, 1982; Behrouz et al., 2024; Behrouz et al., 2025). While many such models use matrix- or vector-valued memory to compress past data (Von et al., 2023; Yang et al., 2024; Schlag et al., 2021), recent studies advocate for deep non-linear neural memory that encodes past abstractions into its parameters (Sun et al., 2024; Behrouz et al., 2024; Behrouz et al., 2025; Dalal et al., 2025). For long-context reasoning/understanding, however, these long-term neural memory modules still require: (1) High capacity—the maximum (key, value) pairs storable in parameters (see §3.1); (2) A powerful internal memory objective (i.e., attentional bias) to learn complex mapping between keys and values (see §3.2); (3) Powerful memory management for better fixed-size memory management (see §3.2); and (4) An efficient parallel training process for large-scale training on modern accelerators (see §3.3).

This section further discusses these challenges and presents Omega rule: an expressive memory update rule with direct access to tokens in a local context window, which memorizes context rather than individual tokens.

3.1 Associative Memory with Super Linear Capacity

As previously discussed, an effective long-term memory module should store past data abstractions in its parameters. However, with a fixed number of memory parameters, a key unanswered question remains: “what is the maximum number of uncorrelated (key, value) pairs that a model can store?” To answer this, we start with the simplest case: matrix memory, an 2\ell_{2} regression loss as the attentional bias (i.e., (t,𝐤t,𝐯t)=t(𝐤t)𝐯t22\ell(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t})=\|\mathcal{M}_{t}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2}), optimized by gradient descent:

Proposition 1 (Capacity of 2\ell_{2} Attentional Bias).

Let \mathcal{M} be a matrix-valued memory with dv×dkd_{v}\times d_{k} parameters that optimizes the internal objective of (t,𝐤t,𝐯t)=t𝐤t𝐯t22\ell(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t})=\|\mathcal{M}_{t}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2} with gradient descent. \mathcal{M} can store the mapping of at most 𝒪(dk)\mathcal{O}\left(d_{k}\right) pairs of (𝐤i,𝐯i)(\mathbf{k}_{i},\mathbf{v}_{i}) with linearly independent keys.

The above proposition indicates that matrix-valued memory with delta update rule has sub-linear capacity with respect to its number of parameters. This means that the number of independent patterns that can be stored in a fixed-size memory with size MM is strictly less than c×Mc\times M, for some c+c\in\mathbb{R}^{+}. Recent recurrent models suggest using deep memory modules to store the abstraction of the past into the parameters of a deep neural network (Irie et al., 2021; Sun et al., 2024; Behrouz et al., 2024; Behrouz et al., 2025). While these deep memory architectures can intuitively enhance the expressive power in modeling complex underlying mapping patterns between keys and values, it is still unclear that if they enhance the memory capacity.

Theorem 1 (Effect of Deep Memory).

Let ()\mathcal{M}(\cdot) be an MLP with 2\mathcal{L}_{\mathcal{M}}\geq 2 layers, dkd_{k} input dimension, and dhd_{h} hidden dimension. Then, ()\mathcal{M}(\cdot) can store the mapping of at least 𝒪(dkdv)\mathcal{O}\left(d_{k}d_{v}\right) and at most 𝒪(dkdvi=1min{dh(j)}jidh(j+1))\mathcal{O}\left(d_{k}d_{v}\sum_{i=1}^{\mathcal{L}_{\mathcal{M}}}\min\{d_{h}^{(j)}\}_{j\geq i}d_{h}^{(j+1)}\right) pairs of (𝐤i,𝐯i)(\mathbf{k}_{i},\mathbf{v}_{i}) with linearly independent keys.

This theorem indicates that deep memory not only improves representational power but also further boosts network capacity, with advantages growing with depth. However, the upper bound remains subquadratic in key and value dimensions, raising the question if a long-term memory module can achieve super-linear capacity.

As stated earlier, the dimension of 𝐤t\mathbf{k}_{t}s is crucial for increasing memory capacity. Simply increasing all key and value dimensions, however, significantly increase the number of parameters (𝒪(din)\mathcal{O}(d_{\text{in}}) per each extra dimension) and memory usage, particularly with long contexts. To address this, building on methods from Kacham et al. (2024); Krotov & Hopfield (2016), we suggest using separable kernels σ(x,y)=ϕ(x)ϕ(y)\sigma(x,y)=\phi(x)^{\top}\phi(y) for keys and queries. As an example of such kernels, we focus on polynomial kernels of degree at most pp to increase input dimensionality and thus network capacity. Given pp\in\mathbb{N}, let ϕp(x)=[xβ]|β|p\phi_{p}(x)=[x^{\beta}]_{|\beta|\leq p} be a polynomial mapping of xx with degree at most pp. We redefine the associative memory module in Definition 1 by replacing the inner objective of ((𝒦),𝒱)\mathcal{L}(\mathcal{M}(\mathcal{K});\mathcal{V}) with ((ϕ(𝒦)),𝒱)\mathcal{L}(\mathcal{M}\left(\phi\left(\mathcal{K}\right)\right);\mathcal{V}). This polynomial mapping enhances representational power by increasing the effective dimensionality of keys without additional parameter overhead for the input projections. Next, we discuss their effect on memory capacity, even with a single matrix-valued memory:

Proposition 2 (Memory Capacity with Polynomial Mapping).

Let ϕp()\phi_{p}(\cdot) be a polynomial mapping with degree at most pp, and \mathcal{M} be a matrix-valued memory that optimizes the internal objective of (t,ϕp(𝐤t),𝐯t)=tϕp(𝐤t)𝐯t22\ell(\mathcal{M}_{t};\phi_{p}(\mathbf{k}_{t}),\mathbf{v}_{t})=\|\mathcal{M}_{t}\phi_{p}(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2} with gradient descent. \mathcal{M} can store the mapping of at most 𝒪(dkp)\mathcal{O}\left({d_{k}}^{p}\right) pairs of (𝐤i,𝐯i)(\mathbf{k}_{i},\mathbf{v}_{i}) with linearly independent keys, where dkd_{k} is the dimension of keys 𝐤i\mathbf{k}_{i}.

Beyond the above intuition, polynomial kernels are further motivated by two perspectives: (1) Approximating Softmax using Taylor series; and (2) Input feature gating. For the sake of clarity, we continue with linear memory and two popular attentional biases i.e., (1)(t,𝐤t,𝐯t)=t𝐤t,𝐯t\ell^{(1)}(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t})=\langle\mathcal{M}_{t}\mathbf{k}_{t},\mathbf{v}_{t}\rangle and (2)(t,𝐤t,𝐯t)=tϕ(𝐤t)𝐯t22\ell^{(2)}(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t})=\|\mathcal{M}_{t}\phi(\mathbf{k}_{t})-\mathbf{v}_{t}\|^{2}_{2}. The same process can be applied on other attentional objectives and deep memory modules. Optimizing these objectives using gradient descent in the inner loop results in the following recurrent formulas:

(1)(t,𝐤t,𝐯t):t=t1+ηt𝐯tϕ(𝐤t),\displaystyle\ell^{(1)}(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t})\>\>:\>\>\mathcal{M}_{t}=\mathcal{M}_{t-1}+\eta_{t}\mathbf{v}_{t}\phi(\mathbf{k}_{t})^{\top}, (Hebbian Rule)
(2)(t,𝐤t,𝐯t):t=(𝐈ηtϕ(𝐤t)ϕ(𝐤t))t1+ηt𝐯tϕ(𝐤t).\displaystyle\ell^{(2)}(\mathcal{M}_{t};\mathbf{k}_{t},\mathbf{v}_{t})\>\>:\>\>\mathcal{M}_{t}=\left(\mathbf{I}-\eta_{t}\phi(\mathbf{k}_{t})\phi(\mathbf{k}_{t})^{\top}\right)\mathcal{M}_{t-1}+\eta_{t}\mathbf{v}_{t}\phi(\mathbf{k}_{t})^{\top}. (Delta Rule)

Kernel Attention Perspective for the Special Case of Hebbian Rule. The formulation for (Hebbian Rule) is equivalent to kernel linear attentions (Kacham et al., 2024a; Wang et al., 2025; Hua et al., 2022; Kasai et al., 2021; Katharopoulos et al., 2020; Arora et al., 2024). In this viewpoint, the role of ϕ(.)\phi(.) is to approximate Softmax or more accurately the exponential kernel. Since exponential kernel with normalization (i.e., Softmax) is not separable, it results in Transformers’ quadratic time and memory complexity. However, Transformers’ exponential feature map kernel (exp(𝐪i𝐤j)\exp(\mathbf{q}_{i}^{\top}\mathbf{k}_{j})) can be approximated using its Taylor series as:

exp(𝐪i𝐤j)1+𝐪i𝐤j+(𝐪i𝐤j)22!+(𝐪i𝐤j)33!+\displaystyle\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{j}\right)\approx 1+\mathbf{q}_{i}^{\top}\mathbf{k}_{j}+\frac{(\mathbf{q}_{i}^{\top}\mathbf{k}_{j})^{2}}{2!}+\frac{(\mathbf{q}_{i}^{\top}\mathbf{k}_{j})^{3}}{3!}+\dots (4)

Our polynomial feature map extends this approximation to a more general case of:

exp(𝐪i𝐤j)ϕp(𝐪)ϕ(𝐤)=a0+a1𝐪i𝐤j+a2(𝐪i𝐤j)2+a3(𝐪i𝐤j)3++ap(𝐪i𝐤j)p,\displaystyle\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{j}\right)\approx\phi_{p}(\mathbf{q})\phi(\mathbf{k})^{\top}\!=a_{0}+a_{1}\mathbf{q}_{i}\mathbf{k}_{j}^{\top}+a_{2}(\mathbf{q}_{i}^{\top}\mathbf{k}_{j})^{2}+a_{3}(\mathbf{q}_{i}^{\top}\mathbf{k}_{j})^{3}+\dots+a_{p}(\mathbf{q}_{i}^{\top}\mathbf{k}_{j})^{p}, (5)

with learnable parameters aia_{i}\in\mathbb{R} initialized at ai=1i!a_{i}=\frac{1}{i!}, the polynomial kernel can be viewed as an expressive approximator of Softmax attention. This provides theoretical motivation for using polynomial kernels, especially when memory capacity is limited; i.e., with (i) linear memory and (ii) Hebbian learning rule. This intuition, however, further generalizes to more expressive cases using deep memory modules and more complex attentional biases (i.e., Eq. Delta Rule). That is, exp()\exp(\cdot) feature mapping has infinite dimension and provides a more powerful similarity measure of keys and queries (i.e., 𝐪i𝐤j\mathbf{q}_{i}^{\top}\mathbf{k}_{j}); however, its computation with normalization can cause additional memory and time complexity to the model. Using polynomial kernels in architectures with deep memory and complex attentional bias can further enhance performance by approximating more powerful representations for keys-queries similarities (i.e., 𝐪i𝐤j\mathbf{q}_{i}^{\top}\mathbf{k}_{j}). See Section 4 for additional discussions on exponential kernels and Transformers.

Input Gating Interpretation. Another perspective that motivates the use of polynomial features is their more expressive representational power in modeling complex functions compared to the simple case of ϕ(x)=x\phi(x)=x. That is, the coefficients of aia_{i}s can be seen as input feature gating, in which ai0a_{i}\rightarrow 0 means excluding the feature map of [xj]|j|=i[x^{j}]_{|j|=i}, and ai1a_{i}\rightarrow 1 means retaining the corresponding feature. This is similar to the gating mechanisms of RNNs but on the input rather than the memory. This gating mechanism clearly provides a more representational power as the model can learn to set ai0a_{i}\rightarrow 0 for all i1i\neq 1 and a11a_{1}\rightarrow 1, resulting in the simple case of ϕ(x)=x\phi(x)=x.

3.2 Long-term Memory with Context Memorization

As discussed earlier, one of the critical drawback of most existing recurrent models is their online nature, in which they optimize the inner objective (attentional bias) with respect to only the current input while retaining the previous state of the memory (Behrouz et al., 2025; Liu et al., 2024), i.e.,

min(,𝐤t,𝐯t)+Rett(,t1),\displaystyle\min_{\mathcal{M}}\ell(\mathcal{M};\mathbf{k}_{t},\mathbf{v}_{t})+\texttt{Ret}_{t}(\mathcal{M},\mathcal{M}_{t-1}), (6)

where Ret(,)\texttt{Ret}(\cdot,\cdot) is the retention gate. This online nature while making the optimization of the memory simpler and faster, can cause sub-optimal memorization of the context as memory is greedily memorize individual tokens. In a more general case, however, one can optimize the memory at each time stamp with respect to the entire context (input sequence), i.e.,

mini=1t(,𝐤i,𝐯i).\displaystyle\min_{\mathcal{M}}\sum_{i=1}^{t}\ell(\mathcal{M};\mathbf{k}_{i};\mathbf{v}_{i}). (7)

This strict global formulation generally presents two critical limitations: (1) Efficiency: One of the important advantages of recurrent architectures is their efficiency at longer context in both training and inference. Optimizing the memory with respect to all the past tokens (entire context), however, (i) causes additional optimization constraints at each memory update step, resulting in inefficiency at extremely large sequences, and (ii) requires caching the past keys and values at the test time, increasing the memory consumption; (2) Context Pruning: In large context tasks optimizing with all past tokens can cause sub-optimal performance mainly due to the context change (or irrelevant context) in the middle of the input sequence. This observation has resulted to design architectures with retention (forget) gate, enabling models to erase memory when past context is no longer needed (Sun et al., 2023; Peng et al., 2025; Behrouz et al., 2024; Behrouz et al., 2025; Yang et al., 2024a).

To address these limitations, we present a sliding window recurrent model that optimizes its attentional bias w.r.t. a window of past tokens. For a memory module ()\mathcal{M}(\cdot) and window length c1c\geq 1, we optimize the memory internal objective as:

mini=tc+1tγi(t)(,𝐤i,𝐯i),\displaystyle\min_{\mathcal{M}}\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\>\ell(\mathcal{M};\mathbf{k}_{i},\mathbf{v}_{i}), (8)

where (,𝐤i,𝐯i)\ell(\mathcal{M};\mathbf{k}_{i},\mathbf{v}_{i}) measures the predicted mapping for (𝐤i,𝐯i)(\mathbf{k}_{i},\mathbf{v}_{i}) pair and γi(t)\gamma^{(t)}_{i} is the decay term for the effect of ii-th token in the optimization process. Building upon this formulation, we present Omega rule, which is strictly more powerful than the popular Delta learning rule (Widrow & Hoff, 1988; Schlag et al., 2021):

Omega Rule: Let 𝐤idk\mathbf{k}_{i}\in\mathbb{R}^{d_{k}} and 𝐯idv\mathbf{v}_{i}\in\mathbb{R}^{d_{v}} be the input keys and values, and ()\mathcal{M}(\cdot) be a neural architecture that serves as the memory module. Given a local context length of c1c\in\mathbb{N}_{\geq 1}, the updating the memory module \mathcal{M} using Omega learning rule is defined as optimizing the following loss function with gradient descent: mini=tc+1tγi(t)(𝐤i)𝐯i22\displaystyle\min_{\mathcal{M}}\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\left\|\mathcal{M}\left(\mathbf{k}_{i}\right)-\mathbf{v}_{i}\right\|^{2}_{2} (9)

Following Behrouz et al., 2025, this update rule can be extended to qq-Omega rule (or other variants) by replacing 2()\ell_{2}(\cdot) with q()\ell_{q}(\cdot). In the extreme cases of (1) c=1c=1: the update rule becomes online (Delta rule); and (2) c=c=\infty or context length: the update becomes global optimization w.r.t. all past tokens. In this formulation, parameters γi(t)[0,1]\gamma^{(t)}_{i}\in[0,1] act as hard (direct) gates for the past tokens. That is, γi(t)0\gamma^{(t)}_{i}\rightarrow 0 means that the model directly prunes the optimization of ii-th token in the local context, while γi(t)1\gamma^{(t)}_{i}\rightarrow 1 means fully incorporating the optimization of memory for ii-th token in the local context. In our design, we use input-dependent parameters for γi(t)\gamma^{(t)}_{i}, providing in-context pruning ability. Note that, the design of sliding window recurrence allows such flexibility as for each token we need a constant number of gates; i.e., {γi(t)}i=1c\{\gamma^{(t)}_{i}\}_{i=1}^{c}. Using input-dependent gates for the global optimization (Equation 7), however, can result in significant parameter increase and memory usage, diminishing the advantages of recurrent models.

OmegaNet. We now present OmegaNet, a novel sequence model that updates its memory using Omega rule. To enhance the memory capacity of OmegaNet, we use polynomial kernels on 𝐤\mathbf{k}s and 𝐪\mathbf{q}s. Accordingly, optimizing the objective in Equation 9, results in an update rule of OmegaNet as:

t=αtt1i=tc+1tγ(t)i(ϕ(𝐤i))𝐯i22Surprise of the context,\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\underset{{\color[rgb]{0.1641,0.2891,0.4023}\text{Surprise of the context}}}{\underbrace{\nabla\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\left\|\mathcal{M}\left(\phi(\mathbf{k}_{i})\right)-\mathbf{v}_{i}\right\|^{2}_{2}}}, (10)

or in the spacial case of linear memory:

t=(diag(αt)i=tc+1tγi(t)ϕ(𝐤i)ϕ(𝐤i))t1i=tc+1tγi(t)𝐯iϕ(𝐤i).\displaystyle\mathcal{M}_{t}=\left(\texttt{diag}(\alpha_{t})-\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\phi(\mathbf{k}_{i})\phi(\mathbf{k}_{i})^{\top}\right)\mathcal{M}_{t-1}-\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\mathbf{v}_{i}\phi(\mathbf{k}_{i})^{\top}. (11)

From the memory perspective, Omega rule (OmegaNet) does not measure the surprise of a token, but the surprise of a local context based on the context-aware combination of individual tokens within the context.

Refer to caption
Figure 2: The illustration of tokens dependencies in SWA and Atlas or OmegaNet with different context length.

Beyond Gradient Descent. The concept of Omega rule and “test time memorization of context” can simply be extended to optimizing the objective in Equation 9 with any arbitrary optimizer, even beyond simple gradient descent. We use two extreme cases for cc as the illustrations. In the first case, we let c=1c=1, γi(t)=1\gamma^{(t)}_{i}=1, and use gradient descent with momentum as the optimizers, resulting in the following update rule:

t=αtt1+𝒮t\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}+\mathcal{S}_{t} (12)
𝒮t=θt𝒮t1ηt(t1;𝐤t,𝐯t).\displaystyle\mathcal{S}_{t}=\theta_{t}\mathcal{S}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t}). (13)

This update rule is equivalent to the long-term neural memory in Titans (Behrouz et al., 2024). In the second case, using a linear memory \mathcal{M}, letting γi(t)=1\gamma^{(t)}_{i}=1, and cc be equal to the context length, the memory update process is equivalent to optimizing the (regularized) least-squares problem:

t=mini=1t𝐤i𝐯i22.\displaystyle\mathcal{M}_{t}=\min_{\mathcal{M}}\sum_{i=1}^{t}\left\|\mathcal{M}\mathbf{k}_{i}-\mathbf{v}_{i}\right\|^{2}_{2}. (14)

Von et al. (2023) suggest directly optimizing the above objective and use Sherman-Morrison formula (Sherman & Morrison, 1950) to recursively calculate the inverse term in the optimal solution. Despite the optimality of memory, such direct solutions comes with the cost of non-parallelizable training and also are limited to only the linear matrix-valued memory setup. Furthermore, as discussed earlier, the global nature without any direct hard gating terms (i.e., γi(t)\gamma^{(t)}_{i}s) can force the model to not prune the context, damaging the performance in longer sequences.

3.3 Parallelizing Omega Rule

While Omega rule provides a more general and expressive formulation for the design of memory modules than Hebbian or Delta learning rules, its applicability to large-scale models relies on its efficiency in training. To this end, we discuss a fast parallelizable training algorithms that does not add any significant computational overhead with the online counterpart version (i.e., c=1c=1). A naive implementation requires materializing cc gradients din×din\nabla\ell\in\mathbb{R}^{d_{\text{in}}\times d_{\text{in}}}, which can result in a significantly higher memory footprint and I/O cost when dind_{\text{in}} is large. Also, to fully utilize hardware accelerators such as TPUs and GPUs, it is important to tensorize computations and maximize the use of matmul operations. Motivated by recent work (Behrouz et al., 2024; Sun et al., 2024), we propose a simple sliding window masking strategy that supports efficient parallel training while avoiding substantial memory overhead. Specifically, we partition the input sequence with length LL into chunks of size b1b\geq 1, each of which is represented by 𝐒i={𝐱(i1)b+1,,𝐱ib}\mathbf{S}_{i}=\{\mathbf{x}_{(i-1)b+1},\dots,\mathbf{x}_{ib}\}. Then for each chunk, we calculate the gradients with respect to the last state of the previous chunk. For the sake of clarity, we first assume γi(t)=ηt\gamma^{(t)}_{i}=\eta_{t} for all positions in the sequence. When the chunk size is b=1b=1, the update rule is:

t=αtt1ηti=tc+1t(t1,𝐤i,𝐯i),\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\sum_{i=t-c+1}^{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{i},\mathbf{v}_{i}), (15)

where t\mathcal{M}_{t} is the model state at step tt, αt\alpha_{t} and ηt\eta_{t} are the weight decay and learning rate parameters respectively, and (𝐤i,𝐯i)(\mathbf{k}_{i},\mathbf{v}_{i}) denote the input pair at position ii. In practice, we strike a balance between the fully recurrent form and the fully parallel form by dividing the sequence into smaller chunks. Within each chunk (intra-chunk), we apply parallel computation, while across chunks (inter-chunk), we adopt a recurrent computation scheme. We now define t=tmod(t,b)t^{\prime}=t-\operatorname{mod}(t,b). That is, for time steps tt such that tt<t+bt^{\prime}\leq t<t^{\prime}+b, the update rule within each chunk becomes:

t=αtαttn=ttαtαtαnαtηni=nc+1n(t,𝐤i,𝐯i)Gt\displaystyle\mathcal{M}_{t}=\alpha_{t}...\alpha_{t^{\prime}}\mathcal{M}_{t^{\prime}}-\sum^{t}_{n=t^{\prime}}\frac{\alpha_{t}...\alpha_{t^{\prime}}}{\alpha_{n}...\alpha_{t^{\prime}}}\eta_{n}\underset{G_{t}}{\underbrace{\sum^{n}_{i=n-c+1}\nabla\ell(\mathcal{M}_{t^{\prime}};\mathbf{k}_{i},\mathbf{v}_{i})}} (16)

In our implementation, for GtG_{t}, we follow the same gradient computation approach as described in Titans (Behrouz et al., 2024) but additionally apply a sliding window mask MsM_{s} during the broadcasting operation (e.g., using einsum). When c=1c=1, the sliding window mask MsM_{s} reduces to the identity matrix. For c>1c>1, MsM_{s} is an identity matrix except that the c1c-1 positions immediately preceding each diagonal entry are also set to 1. This allows gradient contributions from a window of size cc, enabling efficient computation without materializing all gradients inside the chunk.

4 DeepTransformers: Transformers with Deep Memory

Recent studies have extensively discussed Transformer architectures through the lens of associative memory (Wang et al., 2025; Sun et al., 2024; Behrouz et al., 2025). Accordingly, it is natural to ask how our discussions of memory capacity as well as Omega rule can affect Transformers. In this section, we discuss how our formulation of Omega rule is connected to Transformers and their sliding window counterparts (i.e., SWA). We then further provide two extensions to Transformers, each of which is a strict generalization of Transformers.

4.1 Online and Local Context Optimization of Memory

Connection to Sliding Window Attention. Softmax attention block can also be reformulated as a non-parametric solution to the 2()\ell_{2}(\cdot) regression with Nadaraya-Watson estimators (Zhang et al., 2022; Fan, 2018):

=argmini=1L𝐬(𝐤i,𝐪)𝐯i22=i=1L𝐬(𝐤i,𝐪)j=1L𝐬(𝐤j,𝐪)𝐯i,\displaystyle\mathcal{M}^{*}=\arg\min_{\mathcal{M}}\sum_{i=1}^{L}\mathbf{s}(\mathbf{k}_{i},\mathbf{q})\|\mathbf{v}_{i}-\mathcal{M}\|^{2}_{2}=\sum_{i=1}^{L}\frac{\mathbf{s}(\mathbf{k}_{i},\mathbf{q})}{\sum_{j=1}^{L}\mathbf{s}(\mathbf{k}_{j},\mathbf{q})}\mathbf{v}_{i}, (17)

where LL is the sequence length. While this formulation optimizes the memory \mathcal{M} with respect to the entire sequence length, one can limit the optimization process to the past cc tokens, resulting in:

=argmini=tc+1t𝐬(𝐤i,𝐪i)𝐯i22=i=tc+1t𝐬(𝐤i,𝐪)j=tc+1t𝐬(𝐤j,𝐪)𝐯i,\displaystyle\mathcal{M}^{*}=\arg\min_{\mathcal{M}}\sum_{i=t-c+1}^{t}\mathbf{s}(\mathbf{k}_{i},\mathbf{q}_{i})\|\mathbf{v}_{i}-\mathcal{M}\|^{2}_{2}=\sum_{i=t-c+1}^{t}\frac{\mathbf{s}(\mathbf{k}_{i},\mathbf{q})}{\sum_{j=t-c+1}^{t}\mathbf{s}(\mathbf{k}_{j},\mathbf{q})}\mathbf{v}_{i}, (18)

which is equivalent to the sliding window attention (SWA). This connection provides an important insight on the difference of attention and recurrent models: Not only attention is a non-parametric solution (contrary to the parametric nature of recurrent models), it globally optimizes its internal objective (attentional bias), while most recent modern recurrent models are online learners (Sun et al., 2024; Yang et al., 2024; Behrouz et al., 2025; Peng et al., 2025)00 0 Two of the exceptions are Titans (Behrouz et al., 2024) and Mesa-layer (Von et al., 2023), where Mesa-layer optimizes the memory with respect to all past tokens (comes with the cost of slow training), and Titans optimizes the memory with respect to all past tokens but with an implicit decay term (i.e., the result of the momentum) for each past token, maintaining parallelizability. . Our formulations of sliding window RNN and Omega rule fill this gap by optimizing the memory with respect to a context window of past tokens based on parametric methods, effectively memorizing the context instead of individual tokens.

Deep Linear Attention. As a novel baseline, we present Deep (Gated) Linear Attention (DLA) that replaces a matrix-valued memory in (gated) linear attention (Katharopoulos et al., 2020; Yang et al., 2024a) with a deep neural network (e.g., kk-layer MLP). As discussed earlier in (Hebbian Rule), using dot product similarity as the internal attentional bias results in linear attention. Thus, leveraging recent deep memory modules (Sun et al., 2024; Behrouz et al., 2024; Behrouz et al., 2025), we optimize the memory using gradient descent with dot product attentional bias:

t=αtt1ηt(t1;ϕ(𝐤t),𝐯t),\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\phi(\mathbf{k}_{t}),\mathbf{v}_{t}), (19)

where (t1,ϕ(𝐤t),𝐯t)=t1(ϕ(𝐤t)),𝐯t\ell(\mathcal{M}_{t-1};\phi(\mathbf{k}_{t}),\mathbf{v}_{t})=\langle\mathcal{M}_{t-1}(\phi(\mathbf{k}_{t})),\mathbf{v}_{t}\rangle and ϕ()\phi(\cdot) is a polynomial kernel. The training of DLA can simply be parallelized using the hybrid of linear and non-linear chunk-wise training, the same as Sun et al. (2024); Behrouz et al. (2024) and our discussion in Section 3.3.

Sliding Window Linear Attention. Building upon the above intuition and the connection of our formulation to SWA, we present Sliding Window Linear Attention (SWLA) block. Following the formulation of linear attention in associative memory perspective (Behrouz et al., 2025), we use dot product similarity (i.e., (t,𝐤i,𝐯i)=t(𝐤i),𝐯i\ell(\mathcal{M}_{t};\mathbf{k}_{i},\mathbf{v}_{i})=\langle\mathcal{M}_{t}(\mathbf{k}_{i}),\mathbf{v}_{i}\rangle) as the attentional bias and optimize the loss function using gradient descent. For the sake of clarity, we use a linear memory here to derive the closed form:

t=αtt1ηti=tc+1t(t1;ϕ(𝐤i),𝐯i)=t1+i=tc+1tγi(t)𝐯iϕ(𝐤i)\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\sum_{i=t-c+1}^{t}\ell(\mathcal{M}_{t-1};\phi(\mathbf{k}_{i}),\mathbf{v}_{i})=\mathcal{M}_{t-1}+\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\mathbf{v}_{i}\phi(\mathbf{k}_{i})^{\top} (20)

In the online case (c=1c=1) and ϕ()=()\phi(\cdot)=(\cdot), this recurrence is the same as linear attention (Katharopoulos et al., 2020).

4.2 Memory Capacity and Exponential Kernels

We first recall the formulation of softmax attention in Transformers (i.e., Equation 1):

𝐲i=1=1iexp(𝐪i𝐤/din)j=1iexp(𝐪i𝐤j/din)𝐯j,\displaystyle\mathbf{y}_{i}=\frac{1}{{\sum_{\ell=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{\ell}/\sqrt{d_{\text{in}}}\right)}}\sum_{j=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{j}/\sqrt{d_{\text{in}}}\right)\mathbf{v}_{j}, (21)

which its exp()\exp(\cdot) kernel is not separable and so cannot be written as a recurrence. Following the discussion in Kacham et al. (2024a), one can see exp()\exp(\cdot) kernel (compared to polynomial kernel ϕp()\phi_{p}(\cdot)) as a feature map that maps the input into an infinite dimension. That is, we define:

ϕ(x)=(1x1x22!x33!),ϕp(x)=xp,\displaystyle\phi^{*}(x)=\begin{pmatrix}1\\ \frac{x}{\sqrt{1}}\\ \frac{x^{\otimes 2}}{\sqrt{2!}}\\ \frac{x^{\otimes 3}}{\sqrt{3!}}\\ \vdots\end{pmatrix},\qquad\qquad\phi_{p}(x)=x^{\otimes p}, (22)

where xp=xx(p1)x^{\otimes p}=x\otimes x^{\otimes(p-1)} is a “self-tensoring” operator with Kronecker product (Kacham et al., 2024a) and so:

exp(𝐪t𝐤t)=ϕ(𝐪t)ϕ(𝐤t).\displaystyle\exp(\mathbf{q}_{t}^{\top}\mathbf{k}_{t})=\phi^{*}(\mathbf{q}_{t})^{\top}\phi^{*}(\mathbf{k}_{t}). (23)

Based on the above kernel, we can reformulate the attention (see Equation 21) as: (we remove 1/din1/\sqrt{d_{\text{in}}} term for the sake of simplicity)

𝐲i=1=1iexp(𝐪i𝐤/din)j=1i𝐯jϕ(𝐤j)ϕ(𝐪i)=1=1iexp(𝐪i𝐤/din)(j=1iϕ(𝐯j𝐤j))ϕ(𝐪i)=iϕ(𝐪i),\displaystyle\mathbf{y}_{i}=\frac{1}{{\sum_{\ell=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{\ell}/\sqrt{d_{\text{in}}}\right)}}\sum_{j=1}^{i}\mathbf{v}_{j}\phi^{*}(\mathbf{k}_{j})^{\top}\phi^{*}(\mathbf{q}_{i})=\frac{1}{{\sum_{\ell=1}^{i}\exp\left(\mathbf{q}_{i}^{\top}\mathbf{k}_{\ell}/\sqrt{d_{\text{in}}}\right)}}\left(\sum_{j=1}^{i}\phi^{*}(\mathbf{v}_{j}\mathbf{k}_{j})^{\top}\right)\phi^{*}(\mathbf{q}_{i})=\mathcal{M}_{i}\phi^{*}(\mathbf{q}_{i}), (24)

This formulation, provides another important insight on the differences of attention and (kernel) recurrent models: Softmax attention as an associative memory has an unbounded memory and so can better memorize larger context into its parameters. Building upon this insight, we present DeepTransformers by replacing polynomial kernel with ϕ()\phi^{*}(\cdot) kernel in Deep Linear Attention formulation (Equation 19), resulting in unnormalized formulation of:

t=t1t1(ϕ(𝐤t)),𝐯t.\displaystyle\mathcal{M}_{t}=\mathcal{M}_{t-1}-\nabla\langle\mathcal{M}_{t-1}(\phi^{*}(\mathbf{k}_{t})),\mathbf{v}_{t}\rangle. (25)

In the special case of linear memory, we can derive the closed form for the above formulation as:

t=t1t1ϕ(𝐤t),𝐯t=t1+𝐯tϕ(𝐤t)=i=1t𝐯iϕ(𝐤i)𝐲t=tϕ(𝐪t)=i=1t𝐯iexp(𝐪i𝐤i),\displaystyle\mathcal{M}_{t}=\mathcal{M}_{t-1}-\nabla\langle\mathcal{M}_{t-1}\phi^{*}(\mathbf{k}_{t}),\mathbf{v}_{t}\rangle=\mathcal{M}_{t-1}+\mathbf{v}_{t}\phi^{*}(\mathbf{k}_{t})^{\top}=\sum_{i=1}^{t}\mathbf{v}_{i}\phi^{*}(\mathbf{k}_{i})^{\top}\quad\Rightarrow\quad\mathbf{y}_{t}=\mathcal{M}_{t}\phi^{*}(\mathbf{q}_{t})=\sum_{i=1}^{t}\mathbf{v}_{i}\exp(\mathbf{q}_{i}^{\top}\mathbf{k}_{i}), (26)

which matches the output of the unnormalized Transformers. Therefore, DeepTransformers are strict generalizations of Transformers with softmax attention (Vaswani et al., 2017).

4.3 Deep Omega Transformer (Dot): Transformers with Omega learning rule

Our above formulation of DeepTransformers is based on the (Hebbian Rule), which is also used in original Transformers. However, as discussed earlier, using more powerful memory management and learning rules in associative memory modules can further enhance their performance. To this end, we extend the above formulation by replacing the Hebbian rule with our Omega learning rule, resulting in an unnormalized formulation of Deep Omega Transformers (Dot):

t=t1i=tc+1tγi(t)(ϕ(𝐤i))𝐯i22.\displaystyle\mathcal{M}_{t}=\mathcal{M}_{t-1}-{\nabla\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\left\|\mathcal{M}\left(\phi^{*}(\mathbf{k}_{i})\right)-\mathbf{v}_{i}\right\|^{2}_{2}}. (27)

We now discuss special instances of Dot to provide further intuition on its generalized formulation.

Linear Memory. This setup results in the following unnormalized formulation:

t=(𝐈i=tc+1tγi(t)ϕ(𝐤i)ϕ(𝐤i))t1i=tc+1tγi(t)𝐯iϕ(𝐤i)\displaystyle\mathcal{M}_{t}=\left(\mathbf{I}-\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\phi^{*}(\mathbf{k}_{i})\phi^{*}(\mathbf{k}_{i})^{\top}\right)\mathcal{M}_{t-1}-\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\mathbf{v}_{i}\phi^{*}(\mathbf{k}_{i})^{\top} (28)
\displaystyle\Rightarrow\>\> 𝐲t=tϕ(𝐪t)=(𝐈i=tc+1tγi(t)ϕ(𝐤i)ϕ(𝐤i))t1ϕ(𝐪t)i=tc+1tγi(t)𝐯iexp(𝐪t𝐤i).\displaystyle\mathbf{y}_{t}=\mathcal{M}_{t}\phi^{*}(\mathbf{q}_{t})=\left(\mathbf{I}-\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\phi^{*}(\mathbf{k}_{i})\phi^{*}(\mathbf{k}_{i})^{\top}\right)\mathcal{M}_{t-1}\phi^{*}(\mathbf{q}_{t})\ -\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\mathbf{v}_{i}\exp(\mathbf{q}_{t}^{\top}\mathbf{k}_{i}). (29)

Online Case with c=1c=1. We now let c=1c=1:

t=(𝐈ηtϕ(𝐤t)ϕ(𝐤t))t1ηt𝐯tϕ(𝐤t)\displaystyle\mathcal{M}_{t}=\left(\mathbf{I}-\eta_{t}\phi^{*}(\mathbf{k}_{t})\phi^{*}(\mathbf{k}_{t})^{\top}\right)\mathcal{M}_{t-1}-\eta_{t}\mathbf{v}_{t}\phi^{*}(\mathbf{k}_{t})^{\top} (30)
\displaystyle\Rightarrow\>\> 𝐲t=tϕ(𝐪t)=(𝐈ηtϕ(𝐤t)exp(𝐪t𝐤t))t1ηt𝐯texp(𝐪t𝐤t).\displaystyle\mathbf{y}_{t}=\mathcal{M}_{t}\phi^{*}(\mathbf{q}_{t})=\left(\mathbf{I}-\eta_{t}\phi^{*}(\mathbf{k}_{t})\exp(\mathbf{q}_{t}^{\top}\mathbf{k}_{t})\right)\mathcal{M}_{t-1}\ -\eta_{t}\mathbf{v}_{t}\exp(\mathbf{q}_{t}^{\top}\mathbf{k}_{t}). (31)

The above (unnormalized) formulation can be seen as the generalization of Transformers with Delta Rule. Therefore, due to the unbounded memory, Dot not only appends the new keys and values (similar to original Transformers), but it also replaces the new value with its predicted value from the previous state.

5 Atlas: A Locally Optimal Memory with High Capacity

Although the design of Omega rule allows the model to memorize the context instead of individual tokens and also the use of polynomial (or exponential) feature mapping increases memory capacity, the memory management (i.e., optimization of mappings between keys and values) is still limited to a simple gradient descent. This choice of optimizer can lead the model to a low-quality solution at a local optima, damaging the performance of the model in longer contexts. To overcome this issue, we suggest using Muon optimizer (Jordan et al., 2024) (with weight decay) that not only approximates second-order information, but it also mostly leverages matrix multiplication and can be parallelized across the sequence. Accordingly, the use of Muon for optimizing the internal objective in Equation 9, results in the following update rule:

t=αtt1ηtNewtonShulz-k(𝒮t),\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\>\texttt{NewtonShulz-$k$}(\mathcal{S}_{t}), (32)
𝒮t=θt𝒮t1+i=tc+1tγi(t)(ϕ(𝐤i))𝐯i22,\displaystyle\mathcal{S}_{t}=\theta_{t}\mathcal{S}_{t-1}+\nabla\sum_{i=t-c+1}^{t}\gamma^{(t)}_{i}\left\|\mathcal{M}\left(\phi^{*}(\mathbf{k}_{i})\right)-\mathbf{v}_{i}\right\|^{2}_{2}, (33)

where cc is the local context length and kk is the number steps for NewtonShulz operations. For the additional discussion on the algorithm and this operation we refer the reader to Jordan et al. (2024). Following the literature on Muon optimizer, we know that when kk\rightarrow\infty, then NewtonShulz-k(𝒮t)\texttt{NewtonShulz-$k$}(\mathcal{S}_{t}) converges to the nearest semi-orthogonal matrix to the momentum term 𝒮t\mathcal{S}_{t} and so approximate second-order information with a lower error. Therefore, interestingly, parameter kk can be considered as an internal test-time compute parameter in Atlas, where using more steps can potentially result in better memorization.

5.1 Parallel Training

In this section, we discussed how the training process of Atlas can be parallelized. For the sake of clarity, we assume c=1c=1. Generalizing the process to arbitrary value for cc follows the procedure in Section 3.3. We use the same process as we discussed in Section 3.3 and so chunk the sequence and compute all the gradients with respect to the last state of the previous chunk. Accordingly, using the recurrence of Atlas with momentum but without , we have:

t=αtt1+𝒮t\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}+\mathcal{S}_{t} (34)
𝒮t=θt𝒮t1ηt(t;𝐤t,𝐯t).\displaystyle\mathcal{S}_{t}=\theta_{t}\mathcal{S}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t^{\prime}};\mathbf{k}_{t},\mathbf{v}_{t}). (35)

Since tt^{\prime} is the last state of the previous chunk, we can calculate all the gradients before hand and so we let ut=(t,𝐤t,𝐯t)u_{t}=\nabla\ell(\mathcal{M}_{t^{\prime}};\mathbf{k}_{t},\mathbf{v}_{t}). Therefore, we have:

t=αtt1+𝒮t\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}+\mathcal{S}_{t} (36)
𝒮t=θt𝒮t1ηtut.\displaystyle\mathcal{S}_{t}=\theta_{t}\mathcal{S}_{t-1}-\eta_{t}u_{t}. (37)

Now by expanding the second recurrence, we have:

𝒮t\displaystyle\mathcal{S}_{t} =θt𝒮t1ηt(t,𝐤t,𝐯t)ut,\displaystyle=\theta_{t}\mathcal{S}_{t-1}-\eta_{t}\underset{u_{t}}{\underbrace{\nabla\ell(\mathcal{M}_{t^{\prime}};\mathbf{k}_{t},\mathbf{v}_{t})}}, (38)
𝒮t\displaystyle\Rightarrow\mathcal{S}_{t} =θtθ1βt𝒮0i=1tθtθ1θiθ1ηiui=βt𝒮0ΘEG,\displaystyle=\underset{\beta_{t}}{\underbrace{\theta_{t}...\theta_{1}}}\mathcal{S}_{0}-\sum_{i=1}^{t}\frac{\theta_{t}...\theta_{1}}{\theta_{i}...\theta_{1}}\eta_{i}u_{i}=\beta_{t}\mathcal{S}_{0}-\Theta\odot E\odot G, (39)

where GG is the gradient matrix, EE and Θ\Theta are diagonal matrices with value θ\theta and η\eta, and \odot is broadcasting.

The main advantage of the above formulation (chunk wise recurrence) is that the recurrence of momentum is independent of the state of memory. That is, we can calculate all the momentum terms in the beginning of the chunk using the above formulation. Now in the Muon case, we want to use Newton-Schulz algorithm on the momentum terms, which results in:

𝒮tNewton-Schulz5(𝒮t),\displaystyle\mathcal{S}^{\prime}_{t}\leftarrow\texttt{Newton-Schulz5}(\mathcal{S}_{t}), (40)
t=t1+𝒮t.\displaystyle\mathcal{M}_{t}=\mathcal{M}_{t-1}+\mathcal{S}^{\prime}_{t}. (41)

Since the calculation of all 𝒮t\mathcal{S}_{t}s can be done in parallel, the calculation of Newton-Schulz5()\texttt{Newton-Schulz5}(\cdot) can also be done in parallel.

Architectural Backbone. As for the architectural backbone, we follow the recent modern recurrent models (Behrouz et al., 2024; Arora et al., 2024; Yang et al., 2024b; Allen-Zhu, 2025) and use linear layers to project keys, values, and queries, followed by short convolution layers with size 4. We apply normalization on keys and queries to stabilize the training. We also follow Behrouz et al. (2024) and use two hybrid variants of MAL and MAG for our Atlas model. The architectures are illustrated in Figure 3. For models with deep memory architectures we use 2-layer MLP with residual connections:

()=()+W1σ(W2()).\displaystyle\mathcal{M}(\cdot)=(\cdot)+W_{1}\sigma(W_{2}(\cdot)). (42)

We further extend this memory architecture, which is commonly used in recent studies (Behrouz et al., 2024; Irie et al., 2021; Behrouz et al., 2025), to gated MLP layer as:

()=()+W1(σ(W2())W3()),\displaystyle\mathcal{M}(\cdot)=(\cdot)+W_{1}\left(\sigma\left(W_{2}(\cdot)\right)\otimes W_{3}(\cdot)\right), (43)

where W1,W2,W3W_{1},W_{2},W_{3} are linear learnable matrices. We refer to Atlas with the above memory architecture as Atlas++.

Refer to caption
Figure 3: Visualization of the Atlas’s (and our other variants’) architecture, and its hybrid counterpart with SWA.

6 Experiments

Next, we evaluate the performance of Atlas, OmegaNet, DeepTransformers, and Dot in language modeling, commonsense reasoning, needle in haystack, and in-context recall tasks. Although we also discussed several other variants, such as SWLA, in our experiments we focus on the above models so in addition to comparison with state-of-the-art models, we also answer the following questions:

  1. 1.

    Is deep memory effective for softmax attention? (see Table 2 — comparison of Transformer++ and DeepTransformers)

  2. 2.

    Does the use of Omega improve the performance softmax attention? (see Table 2 — comparison of Transformer++, DeepTransformers, and Dot)

  3. 3.

    Does the Omega rule provide more expressive memory update? (see Table 2 and Section 6.4 — the performance of OmegaNet, and Atlas)

  4. 4.

    Is locally optimal memory update effective? (see Table 2 and Section 6.4 — comparison of OmegaNet, and Atlas)

  5. 5.

    Is non-linear feature mapping effective? (see Section 6.4)

  6. 6.

    Can the proposed improvements close the gap with Transformers in in-context recall tasks? (see Section 6.4)

  7. 7.

    What is the effect of the internal optimizer on the memory? (see Figure 6)

Setup. We train our models with training context window of size 4K using FineWeb dataset (Penedo et al., 2024). We use model size of 340M, 400M, 790M, and 1.3B parameters and train them on 15B, 15B, 30B, and 100B tokens sampled from the dataset. Baseline results are reported by Yang et al. (2024); Behrouz et al. (2024); Behrouz et al. (2025). Perplexity is measured on held-out validation data. As for the downstream tasks, we evaluate trained models on Wikitext (Merity et al., 2017), LMB (Paperno et al., 2016), PIQA (Bisk et al., 2020), HellaSwag (Zellers et al., 2019), WinoGrande (Sakaguchi et al., 2021), ARC-easy (ARC-e) and ARC-challenge (ARC-c) (Clark et al., 2018), SIQA (Sap et al., 2019), and BoolQ (Clark et al., 2019). Additional details about the experimental setups and other used datasets are in Appendix E.

Table 2: Performance of Atlas and baselines on language modeling and common-sense reasoning tasks. Hybrid models are marked with . The best results are highlighted highlighted.
Model Wiki. LMB. LMB. PIQA Hella. Wino. ARC-e ARC-c SIQA BoolQ Avg.
ppl \downarrow ppl \downarrow acc \uparrow acc \uparrow acc_n \uparrow acc \uparrow acc \uparrow acc_n \uparrow acc \uparrow acc \uparrow \uparrow
760M params / 30B tokens
Transformer++ 25.21 27.64 35.8 66.9 42.2 51.9 60.4 32.5 39.5 60.4 48.69
DeepTransformers (ours) 20.32 20.67 36.9 68.4 49.8 52.8 65.7 34.9 40.2 61.8 51.31
Dot (ours) 19.96 20.15 39.0 69.1 50.7 53.1 66.2 37.0 40.3 63.7 52.39
RetNet 26.08 24.45 34.5 67.2 41.6 52.1 63.2 32.8 38.4 57.9 48.46
DeltaNet 24.37 24.60 37.1 66.9 42.0 50.7 64.9 31.4 39.9 59.0 48.97
TTT 24.17 23.51 34.7 67.3 43.9 51.0 64.5 33.8 40.2 59.6 47.32
Gated DeltaNet 21.18 22.09 35.5 68.0 44.9 50.7 66.9 33.1 39.2 59.1 49.69
Samba 20.63 22.71 39.7 69.2 47.4 52.0 66.9 33.2 39.0 61.2 51.08
Gated DeltaNet-H2 19.88 20.83 39.2 69.0 48.2 52.6 67.0 35.5 39.4 61.1 51.49
Titans (LMM) 20.04 21.96 37.4 69.3 48.5 52.3 66.3 35.8 40.1 62.8 51.56
Memora 22.28 22.31 38.2 67.8 49.3 53.3 63.6 36.1 40.9 63.0 51.52
SWDT (ours) 19.89 21.52 36.2 68.3 45.2 53.0 65.4 34.2 39.5 59.5 50.1
DLA (ours) 23.12 22.09 36.1 68.0 47.9 52.7 65.8 34.6 39.1 59.6 50.46
OmegaNet (ours) 19.16 20.14 38.7 69.8 50.0 53.3 67.8 36.8 39.6 64.4 52.56
Atlas (ours) 18.92 21.01 39.1 69.7 50.2 53.5 67.5 37.1 40.7 64.3 52.77
Atlas++ (ours) 19.04 20.03 39.7 69.7 51.1 53.2 68.2 37.4 40.9 64.4 53.09
Atlas (MAG) 18.62 21.18 40.0 70.3 50.5 53.0 68.1 36.5 41.2 65.0 53.08
Atlas (MAL) 19.07 21.46 38.8 69.2 50.5 53.6 67.3 36.1 41.0 64.5 52.63
1.3B params / 100B tokens
Transformer++ 18.53 18.32 42.6 70.0 50.2 53.5 68.8 35.1 40.7 57.1 52.25
DeepTransformers (ours) 15.67 12.63 49.4 72.6 57.0 58.8 71.1 37.5 41.6 61.5 56.19
Dot (ours) 15.28 11.96 50.1 73.3 57.5 60.4 72.2 41.2 42.7 61.4 57.35
RetNet 19.08 17.27 40.5 70.1 49.2 54.1 67.3 33.8 40.8 60.4 52.02
Mamba2 16.56 12.56 45.7 71.9 55.7 55.2 72.5 37.9 40.2 60.1 54.89
DeltaNet 17.71 16.88 42.5 70.7 50.9 53.3 68.5 35.7 40.2 55.3 52.14
Gated DeltaNet 16.42 12.17 46.6 72.2 55.8 57.4 71.2 38.4 40.6 60.2 55.32
Samba 16.13 13.29 44.9 70.9 53.4 55.6 68.8 36.2 40.0 62.1 54.00
Gated DeltaNet-H2 15.91 12.55 48.8 72.2 56.9 57.8 71.4 39.1 41.2 61.6 56.18
Titans (LMM) 15.60 11.41 49.1 73.1 56.3 59.8 72.4 40.8 42.1 61.0 56.82
Memora 15.90 12.04 48.7 73.1 56.0 57.4 71.5 37.9 40.2 61.3 55.87
OmegaNet (ours) 14.91 11.26 49.7 73.4 57.6 59.7 72.6 40.3 42.4 62.1 57.23
Atlas (ours) 14.97 10.98 50.1 73.9 57.3 60.2 72.8 41.0 42.9 62.8 57.62
Atlas++ (ours) 14.40 10.72 50.8 73.5 59.4 61.1 71.3 43.7 42.5 61.9 58.03

6.1 Language Modeling and Common-Sense Reasoning

The results for Atlas, and OmegaNet as well as their corresponding baselines of SWDT, DLA, DeepTransformers, and Dot with the size of 760M and 1.3B are reported in Table 2. (see Appendix F for the results of small scale). Among non-hybrid models, including Transformer++, our Atlas, and OmegaNet achieve the best performance in both perplexity and accuracy measures. We attribute this performance to their ability to memorize the context rather than individual tokens. Comparing OmegaNet with Titans, that also uses the same momentary objective (i.e., 2\ell_{2} loss), but with context window of 1, we can observe the effectiveness of having non-online learning rule. On the other hand, our models, alone without any attention, can outperform hybrid models, while their hybrid variant of MAG further improve their performance. This performance gain is also related to the use of polynomial kernels that enhance the memory capacity of the model. See Section 6.4 for a more controlled study on the effect of different components.

Comparing Transformer++ with our more generalized Transformers (i.e., DeepTransformers, and Dot) we observe a consistent performance improvement. We attribute this performance to their deep memory, which makes them more powerful to model the dependencies of tokens. Comparing Dot with DeepTransformers, we can see the advantage of Omega rule, which helps the model to better manage its memory.

Table 3: Performance of Atlas and baselines on S-NIAH task from RULER benchmark. The best results among simple and hybrid models are highlighted.
Model S-NIAH-PK S-NIAH-N S-NIAH-W
2K 4K 8K 16K 2K 4K 8K 16K 2K 4K 8K
TTT 98.4 98.8 98.0 88.4 60.2 36.6 10.2 4.4 78.8 28.0 4.4
DeltaNet 96.8 98.8 98.6 71.4 47.2 15.4 12.8 5.4 46.2 20.0 1.6
Titans (LMM) 99.8 98.4 98.2 96.2 100.0 99.8 93.4 80.2 90.4 89.4 85.8
Atlas 100 99.2 98.0 97.0 100.0 100.0 93.0 84.0 93.2 90.6 86.2
Samba 98.8 98.0 97.4 97.2 98.8 98.6 96.2 95.6 96.8 90.0 84.0
Gated DeltaNet-H2 99.2 97.8 97.4 98.4 98.0 97.8 96.2 95.8 97.4 96.8 88.4
Atlas (MAG) 100 100 99.4 98.6 100 99.2 97.4 97.0 99.4 98.2 92.4
Atlas (MAL) 99.8 99.6 98.4 96.8 99.8 98.0 97.2 96.8 98.0 98.4 92.6
DeepTransformers 100 100 98.2 97.8 100 98.8 97.8 94.0 95.8 92.2 88.4
Dot 100 100 99.6 98.6 100 100 97.8 96.8 99.0 98.4 93.2
Refer to caption
Figure 4: Performance of Atlas and baselines on BABILong benchmark. Atlas surpasses Titans performance and effectively scale to 10M context length in this task.
Refer to caption
Figure 5: The effect of local context length (i.e. cc) on the performance of OmegaNet with different global context length.

6.2 Long Context: Needle In a Haystack

One of our main motivations to design Atlas is to enhance the performance of long-term neural memory module in long context tasks. Accordingly, to evaluate the effectiveness of our designs for improving the effective context length and memory capacity, we perform an experiment on needle-in-haystack tasks of RULER (Hsieh et al., 2024) benchmark. The performance of Atlas and its hybrid variants, as well as our Transformer-like architectures and baselines are reported in Table 3. Atlas shows very good performance compared to the recurrent baselines, outperforming modern recurrent neural networks such as Titans and DeltaNet. Its hybrid variants further improve its effective context length, effectively extrapolating to sequences with ×4\times 4 of their training context size. We attribute this performance to the proposed enhancements for the capacity of the memory. We further perform ablation studies to validate this claim. Also, our Transformer-like architectures outperforms the baselines, even our hybrid variants of Atlas in longer contexts. This shows the importance of exponential feature mapping in longer sequences.

6.3 Long Context: BABILong Benchmark

To compare the effectiveness of Atlas with Titans (Behrouz et al., 2024) in ultra-large sequences, we further evaluate Atlas’s performance on BABILong benchmark (Kuratov et al., 2024). In this experiment, we follow Behrouz et al. (2024) and use MAC architecture but without persistent memory tokens. We also follow the original setup in the benchmark and fine-tune our model. The results are reported in Section 6.1. While Atlas shows competitive and on par performance with Titans until 1M context length, the performance of Titans drops in 10M. Atlas, however, maintains its performance and achieve +80% accuracy in 10M context length. We attribute this to more powerful memory; in terms of (1) memory management (i.e., the use of Muon), (2) better memory capacity due to polynomial kernels, and (3) its nature to memorize the context, instead of individual tokens.

In previous sections, we show the effectiveness of our Transformer-like architectures (i.e., DeepTransformers and Dot) in both language modeling and long-context needle-in-haystack tasks. From now on, we focus on our recurrent architectures (i.e., Atlas, and OmegaNet) to show the importance of presented improvements.

6.4 Learnability Experiments

We have also performed some small-scale experiments to analyze the function-learning capability of small MLPs in an online fashion. In this setting, we have a sequence of tuples (i1,o1),(it,ot)(i_{1},o_{1}),\ldots(i_{t},o_{t}) with both ij,ojdi_{j},o_{j}\in\mathbb{R}^{d} for all jj. We train an MLP \mathcal{M} in an online fashion to minimize lossj=ijoj22/oj22\text{loss}_{j}=\|{i_{j}-o_{j}}\|_{2}^{2}/\|{o_{j}}\|_{2}^{2} – specifically, we compute the gradient at time step jj as .paramslossj\nabla_{\mathcal{M}\text{.params}}\text{loss}_{j} and use standard optimizers such as Adam, Rmsprop and SGD to update the parameters. Such experiments help us understand the representation power of the models we use to represent memory and the power of optimization algorithms to quickly learn the underlying sequence mapping.

Refer to caption
(a) \mathcal{M} with 2 hidden layers and no expansion.
Refer to caption
(b) \mathcal{M} with 3 hidden layers and no expansion.
Refer to caption
(c) \mathcal{M} with 2 hidden layers and 4x expansion.
Refer to caption
(d) \mathcal{M} with 3 hidden layers and 4x expansion.
Figure 6: Loss curves for different setting with various hyperparameters

We study five different sequence to sequence functions:

  1. 1.

    Low Rank Mappings: We sample a random low rank matrix 𝐖=𝐗𝐘\mathbf{W}=\mathbf{X}\mathbf{Y} with 𝐗d×k\mathbf{X}\in\mathbb{R}^{d\times k} and 𝐘k×d\mathbf{Y}\in\mathbb{R}^{k\times d}. We then sample i1,,iti_{1},\ldots,i_{t} randomly from a Gaussian distribution and set oj=𝐖𝖳ijo_{j}=\mathbf{W}^{\mathsf{T}}\cdot i_{j} for all j[t]j\in[t].

  2. 2.

    MLP Mappings: We sample an MLP \mathcal{M} with 1 input, 1 hidden and 1 output layer which uses GELU non-linearity. We set the hidden dimension to dd so that there is no expansion. We then sample i1,,iti_{1},\ldots,i_{t} randomly from a Gaussian distribution and then set oj=(ij)o_{j}=\mathcal{M}(i_{j}) for all j[t]j\in[t].

  3. 3.

    Attention+MLP Mapping: We sample (i1,,it)(i_{1},\ldots,i_{t}) from a Gaussian distribution and an MLP \mathcal{M} as above. We additionally sample three d×dd\times d matrices 𝐖𝐐\mathbf{W_{Q}}, 𝐖𝐊\mathbf{W_{K}} and 𝐖𝐕\mathbf{W_{V}} and compute qj=𝐖𝐐𝖳ijq_{j}=\mathbf{W_{Q}}^{\mathsf{T}}\cdot i_{j}, kj=𝐖𝐊𝖳ijk_{j}=\mathbf{W_{K}}^{\mathsf{T}}\cdot i_{j} and vj=𝐖𝐊𝖳ijv_{j}=\mathbf{W_{K}}^{\mathsf{T}}\cdot i_{j} for all j[t]j\in[t]. We then compute o1,,oto^{\prime}_{1},\ldots,o^{\prime}_{t} as outputs of the causal masked attention mechanism applied on {qj}j[t],{kj}j[t],{vj}j[t]\{q_{j}\}_{j\in[t]},\{k_{j}\}_{j\in[t]},\{v_{j}\}_{j\in[t]} and finally compute oj=(oj)o_{j}=\mathcal{M}(o_{j}).

  4. 4.

    Attention Outputs as Inputs: We do the same as above except that we output ojo^{\prime}_{j} as the input sequence and ojo_{j} as the output sequence.

  5. 5.

    Sliding Window Attention + MLP Mapping: We do the same as in Attention + MLP Mapping setting except that we use a sliding window attention instead of full attention. We use a sliding window of 512 in our experiments.

Note that the settings 3 and 5 are much harder to learn since they require (partially) memorizing the previous inputs and outputs to be able to learn the function that maps iji_{j} to ojo_{j}, whereas the settings 1, 2 and 4 do not need to memorize the previous input-output pairs and just need to learn the underlying low-rank matrix or the MLP that maps the inputs to outputs.

The setting 4 is slightly different to setting 2 in that the inputs are not-independent at each time step and are correlated by the attention mechanism we use to compute the inputs. Thus a strong learning algorithm maybe able to utilize the underlying correlations to learn the mapping faster in setting 4 versus setting 2.

Table 4: Performance of Atlas, OmegaNet, and baselines on the synthetic benchmark of MAD (Poli et al., 2024). Atlas outperforms all the baselines, including Transformers.
Compression (Noisy) ICR Fuzzy ICR Selective Memorization Average
Copying
Transformers 49.4 100 48.2 95.9 83.8 75.46
Gated DeltaNet 44.8 100 32.5 96.2 81.7 71.04
Titans 49.6 100 49.7 99.4 83.5 76.44
OmegaNet (ours) 50.9 100 54.2 99.6 90.2 78.98
Atlas (ours) 51.6 100 54.9 99.6 91.4 79.50
Table 5: The performance of our models (Atlas, and OmegaNet) compared to baselines. While still Transformers achieve the best results in in-context recall tasks, our design of context memorization and polynomial feature maps can close the gap with Transformers.
SWDE NQ DROP FDA SQUAD TQA Average
Transformers 84.9 23.0 28.4 72.5 48.1 64.4 53.55
Gated DeltaNet 63.2 19.1 26.7 33.4 39.6 59.7 40.28
Titans 65.1 20.7 27.2 37.3 42.6 61.0 42.31
OmegaNet (ours) 67.4 21.1 27.2 39.0 43.2 60.9 43.13
Atlas (ours) 66.8 21.9 27.4 40.7 44.1 61.3 43.70
Table 6: Ablation Study on Atlas. All components of Atlas are positively contributing to its performance.
Model Language Modeling C.S. Reasoning
ppl \downarrow acc \uparrow
Atlas 19.97 52.77
+Gated MLP Memory 19.53 53.09
+Attn (MAG) 19.90 53.08
+Attn (MAL) 20.26 52.63
Linear Memory 21.03 49.74
w/o Muon 19.65 52.56
c=1c=1 21.98 49.26
w/o Polynomial Mapping 22.14 50.57

We set d=256d=256 and show the loss curves vs sequence position for all the five settings with function learning MLP \mathcal{M} being defined and trained with different settings in Figure 6. We can see that in all the settings, the model learns non-trivial mappings from inputs to outputs with the lossj=ijoj22/oj22loss_{j}=\|i_{j}-o_{j}\|_{2}^{2}/\|o_{j}\|_{2}^{2} being smaller than 11 eventually. Most notably, the correlations in inputs in setting 4 induced by the attention mechanism makes the model quickly learn the mapping compared to in setting 2 and the models usually learn the best in setting 1 which is the least complex function.

The models do the worst in settings 3 and 5 which require the models to (partially) memorize the inputs and outputs to learn the attention mechanism outputs. Surprisingly, the models learn to do better in setting 3 vs setting 5, when we would expect that capacity requirement for setting 3 to be higher than setting 5. We hypothesize that the learning algorithm is unable to make the model ‘forget’ old inputs which makes the loss worse in sliding window setting when compared to global attention setting. A caveat of our analysis is that, the attention computation is done on randomly initialized vectors and hence the attention matrix is usually not spiky, unlike in the attention matrix for trained set of query, key and value vectors in LLMs. This leads to attention outputs being close to the mean of value vectors in the context.

6.5 Additional Experiments: In-context Recall, MAD Synthetic Benchmark, and Associative Recall

In this section, we first evaluate the performance of our models on MAD benchmark, a synthetic benchmark that evaluate the performance of models in recall, memorization, compression, and copying tasks (Poli et al., 2024). The results are reported in Table 4. Atlas achieves the best results in all aspects, particularly in memorization, which shows the importance of its components for enhancing the memory capacity.

In-context recall tasks is one of the most challenging benchmarks for recurrent neural networks. In this section, we follow Arora et al. (2024) and perform experiments on SWDE (Lockard et al., 2019), NQ (Kwiatkowski et al., 2019), DROP (Dua et al., 2019), FDA (Arora et al., 2023a), SQUAD (Rajpurkar et al., 2016), and TQA (Kembhavi et al., 2017) to evaluate and compare the performance of Atlas with baselines and Transformers. The results are reported in Section 6.4. While Transformers still achieve the best results in in-context recall tasks, Atlas and OmegaNet shows competitive performance and performs better than state-of-the-art recurrent models. We again attribute this performance to better memory management and capacity.

Refer to caption
Figure 7: The results for associative memory recall.
Refer to caption
Refer to caption
Figure 8: Scaling patterns of Atlas, and OmegaNet with respect to (Left) training context length, and (Right) FLOPs.

Finally, following Yang et al. (2024b) and Arora et al. (2023) we evaluate the performance of Atlas and Dot in Multi-Query Associative Recall (MQAR) task (Arora et al., 2023). The results are reported in Section 6.5. Both models show good performance compared to baselines and Atlas achieve the best performance per memory size compared to state-of-the-art models such as DeltaNet (Yang et al., 2024b).

6.6 Ablation Study and Scaling Patterns

In this section, we perform an ablation study on the differernt components of Atlas, and also evaluate its scaling patterns with respect to the number of parameters and also the context length of the training. The results for ablation study are reported in Section 6.4. The results show that: (1) more powerful memory architectures such as gated MLP can further enhance the performance of Atlas; (2) The hybrid variants further improve the performance, where MAG shows better improvement compared to MAL architecture; (3) Polynomial mappings as well as deep memory are particularly important when we use context memorization (i.e., Omega rule). Section 6.1 also shows the effect of local context length (i.e., cc) on the performance of the model. With the increase of cc we can achieve better performance, mainly due to the gating parameters of γ\gamma that can prune the context, whenever it is needed.

Model Size. Section 6.5 shows the scaling pattern of Atlas, and OmegaNet, with respect to number of parameters and compared to baseline. Both models achieve a good scaling pattern with increasing the model size, achieving lower perplexity in all scales compared to baselines.

Context Length. Section 6.5 shows the scaling pattern of Atlas, and OmegaNet, with respect to the context length and compared to baseline. Both models due to high memory capacity can scale well, when increasing the context length.

7 Conclusion

We introduced Atlas, a new long-term memory module designed to address the core limitations of modern recurrent models in long-context understanding: limited memory capacity, online-only updates, and weak memory management. Our proposed sliding window learning rule, higher-order feature mappings, and advanced memory optimizers offer a principled and scalable approach to overcoming these challenges. Empirically, our models—OmegaNet, Atlas, DeepTransformers, and Dot—achieve consistent improvements over Transformers and recent RNN variants across diverse benchmarks. Theoretically, we provided insight into memory capacity and optimization dynamics, offering explanations for the context length limitations observed in prior works.

References

  • Achiam et al. (2023) Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman and Shyamal Anadkat “Gpt-4 technical report” In arXiv preprint arXiv:2303.08774, 2023
  • Allen-Zhu (2025) Zeyuan Allen-Zhu “Physics of Language Models: Part 4.1, Architecture Design and the Magic of Canon Layers” https://ssrn.com/abstract=5240330 In SSRN Electronic Journal, 2025
  • Arora et al. (2023) Simran Arora, Sabri Eyuboglu, Aman Timalsina, Isys Johnson, Michael Poli, James Zou, Atri Rudra and Christopher Ré “Zoology: Measuring and improving recall in efficient language models” In arXiv preprint arXiv:2312.04927, 2023
  • Arora et al. (2024) Simran Arora, Sabri Eyuboglu, Michael Zhang, Aman Timalsina, Silas Alberti, James Zou, Atri Rudra and Christopher Re “Simple linear attention language models balance the recall-throughput tradeoff” In Forty-first International Conference on Machine Learning, 2024 URL: https://openreview.net/forum?id=e93ffDcpH3
  • Arora et al. (2023a) Simran Arora, Brandon Yang, Sabri Eyuboglu, Avanika Narayan, Andrew Hojel, Immanuel Trummer and Christopher Ré “Language models enable simple systems for generating structured views of heterogeneous data lakes” In arXiv preprint arXiv:2304.09433, 2023
  • Bahdanau et al. (2014) Dzmitry Bahdanau, Kyunghyun Cho and Yoshua Bengio “Neural machine translation by jointly learning to align and translate” In arXiv preprint arXiv:1409.0473, 2014
  • Baum (1988) Eric Baum “On the capabilities of multilayer perceptrons” In Journal of Complexity 4.3, 1988, pp. 193–215 DOI: https://doi.org/10.1016/0885-064X(88)90020-9
  • Behrouz et al. (2025) Ali Behrouz, Meisam Razaviyayn, Peilin Zhong and Vahab Mirrokni “It’s All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimization” In arXiv preprint arXiv:2504.13173, 2025
  • Behrouz et al. (2024) Ali Behrouz, Peilin Zhong and Vahab Mirrokni “Titans: Learning to memorize at test time” In arXiv preprint arXiv:2501.00663, 2024
  • Bhojanapalli et al. (2020) Srinadh Bhojanapalli, Chulhee Yun, Ankit Rawat, Sashank Reddi and Sanjiv Kumar “Low-rank bottleneck in multi-head attention models” In International conference on machine learning, 2020, pp. 864–873 PMLR
  • Bietti et al. (2023) Alberto Bietti, Vivien Cabannes, Diane Bouchacourt, Herve Jegou and Leon Bottou “Birth of a transformer: A memory viewpoint” In Advances in Neural Information Processing Systems 36, 2023, pp. 1560–1588
  • Bisk et al. (2020) Yonatan Bisk, Rowan Zellers, Jianfeng Gao and Yejin Choi “Piqa: Reasoning about physical commonsense in natural language” In Proceedings of the AAAI conference on artificial intelligence 34, 2020, pp. 7432–7439
  • Clark et al. (2019) Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins and Kristina Toutanova “BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questions” In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) Minneapolis, Minnesota: Association for Computational Linguistics, 2019, pp. 2924–2936 DOI: 10.18653/v1/N19-1300
  • Clark et al. (2018) Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick and Oyvind Tafjord “Think you have solved question answering? try arc, the ai2 reasoning challenge” In arXiv preprint arXiv:1803.05457, 2018
  • Cover (1965) Thomas. Cover “Geometrical and Statistical Properties of Systems of Linear Inequalities with Applications in Pattern Recognition” In IEEE Transactions on Electronic Computers EC-14.3, 1965, pp. 326–334 DOI: 10.1109/PGEC.1965.264137
  • Csordás et al. (2024) Róbert Csordás, Christopher Potts, Christopher Manning and Atticus Geiger “Recurrent Neural Networks Learn to Store and Generate Sequences using Non-Linear Representations” In Proceedings of the 7th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, 2024, pp. 248–262
  • Dalal et al. (2025) Karan Dalal, Daniel Koceja, Gashon Hussein, Jiarui Xu, Yue Zhao, Youjin Song, Shihao Han, Ka Cheung, Jan Kautz and Carlos Guestrin “One-Minute Video Generation with Test-Time Training” In arXiv preprint arXiv:2504.05298, 2025
  • Dua et al. (2019) Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh and Matt Gardner “DROP: A reading comprehension benchmark requiring discrete reasoning over paragraphs” In arXiv preprint arXiv:1903.00161, 2019
  • Fan (2018) Jianqing Fan “Local polynomial modelling and its applications: monographs on statistics and applied probability 66” Routledge, 2018
  • Gonzalez et al. (2024) Xavier Gonzalez, Andrew Warrington, Jimmy Smith and Scott Linderman “Towards scalable and stable parallelization of nonlinear rnns” In Advances in Neural Information Processing Systems 37, 2024, pp. 5817–5849
  • Hasani et al. (2023) Ramin Hasani, Mathias Lechner, Tsun-Hsuan Wang, Makram Chahine, Alexander Amini and Daniela Rus “Liquid Structural State-Space Models” In The Eleventh International Conference on Learning Representations, 2023 URL: https://openreview.net/forum?id=g4OTKRKfS7R
  • He et al. (2024) Zexue He, Leonid Karlinsky, Donghyun Kim, Julian McAuley, Dmitry Krotov and Rogerio Feris “CAMELoT: Towards Large Language Models with Training-Free Consolidated Associative Memory” In arXiv preprint arXiv:2402.13449, 2024
  • Hebb (2005) Donald Hebb “The organization of behavior: A neuropsychological theory” Psychology press, 2005
  • Hendrycks & Gimpel (2016) Dan Hendrycks and Kevin Gimpel “Gaussian error linear units (gelus)” In arXiv preprint arXiv:1606.08415, 2016
  • Hopfield (1982) John Hopfield “Neural networks and physical systems with emergent collective computational abilities.” In Proceedings of the national academy of sciences 79.8, 1982, pp. 2554–2558
  • Hsieh et al. (2024) Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia and Boris Ginsburg “RULER: What’s the Real Context Size of Your Long-Context Language Models?” In First Conference on Language Modeling, 2024 URL: https://openreview.net/forum?id=kIoBbc76Sy
  • Hu et al. (2024) Jerry-Chieh Hu, Dennis Wu and Han Liu “Provably optimal memory capacity for modern hopfield models: Transformer-compatible dense associative memories as spherical codes” In arXiv preprint arXiv:2410.23126, 2024
  • Hua et al. (2022) Weizhe Hua, Zihang Dai, Hanxiao Liu and Quoc Le “Transformer quality in linear time” In International conference on machine learning, 2022, pp. 9099–9117 PMLR
  • Huang (2003) Guang-Bin Huang “Learning capability and storage capacity of two-hidden-layer feedforward networks” In IEEE Transactions on Neural Networks 14.2, 2003, pp. 274–281 DOI: 10.1109/TNN.2003.809401
  • Irie et al. (2021) Kazuki Irie, Imanol Schlag, Robert Csordas and Jurgen Schmidhuber “Going beyond linear transformers with recurrent fast weight programmers” In Advances in neural information processing systems 34, 2021, pp. 7703–7717
  • Jordan et al. (2024) Keller Jordan, Yuchen Jin, Vlado Boza, Jiacheng You, Franz Cesista, Laker Newhouse and Jeremy Bernstein “Muon: An optimizer for hidden layers in neural networks”, 2024 URL: https://kellerjordan.github.io/posts/muon/
  • Kacham et al. (2024) Praneeth Kacham, Vahab Mirrokni and Peilin Zhong “PolySketchFormer: Fast Transformers via Sketching Polynomial Kernels” In Forty-first International Conference on Machine Learning, 2024 URL: https://openreview.net/forum?id=ghYrfdJfjK
  • Kacham et al. (2024a) Praneeth Kacham, Vahab Mirrokni and Peilin Zhong “PolySketchFormer: Fast Transformers via Sketching Polynomial Kernels” In Proceedings of the 41st International Conference on Machine Learning 235, Proceedings of Machine Learning Research PMLR, 2024, pp. 22748–22770 URL: https://proceedings.mlr.press/v235/kacham24a.html
  • Kamath et al. (2025) Aishwarya Kamath, Johan Ferret, Shreya Pathak, Nino Vieillard, Ramona Merhej, Sarah Perrin, Tatiana Matejovicova, Alexandre Ramé and Morgane Rivière “Gemma 3 technical report” In arXiv preprint arXiv:2503.19786, 2025
  • Karami & Mirrokni (2025) M. Karami and V. Mirrokni “Lattice: Learning to Efficiently Compress the Memory” In arXiv, 2025
  • Kasai et al. (2021) Jungo Kasai, Hao Peng, Yizhe Zhang, Dani Yogatama, Gabriel Ilharco, Nikolaos Pappas, Yi Mao, Weizhu Chen and Noah. Smith “Finetuning Pretrained Transformers into RNNs” In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing OnlinePunta Cana, Dominican Republic: Association for Computational Linguistics, 2021, pp. 10630–10643 DOI: 10.18653/v1/2021.emnlp-main.830
  • Katharopoulos et al. (2020) 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, 2020, pp. 5156–5165 PMLR
  • Kembhavi et al. (2017) Aniruddha Kembhavi, Minjoon Seo, Dustin Schwenk, Jonghyun Choi, Ali Farhadi and Hannaneh Hajishirzi “Are you smarter than a sixth grader? textbook question answering for multimodal machine comprehension” In Proceedings of the IEEE Conference on Computer Vision and Pattern recognition, 2017, pp. 4999–5007
  • Krotov (2021) Dmitry Krotov “Hierarchical associative memory” In arXiv preprint arXiv:2107.06446, 2021
  • Krotov & Hopfield (2016) Dmitry Krotov and John Hopfield “Dense associative memory for pattern recognition” In Advances in neural information processing systems 29, 2016
  • Kuratov et al. (2024) Yuri Kuratov, Aydar Bulatov, Petr Anokhin, Ivan Rodkin, Dmitry Sorokin, Artyom Sorokin and Mikhail Burtsev “BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystack” In The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024 URL: https://openreview.net/forum?id=u7m2CG84BQ
  • Kwiatkowski et al. (2019) Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin and Kenton Lee “Natural questions: a benchmark for question answering research” In Transactions of the Association for Computational Linguistics 7 MIT Press One Rogers Street, Cambridge, MA 02142-1209, USA journals-info …, 2019, pp. 453–466
  • Li et al. (2024) Chengxuan Li, Di Huang, Zeyu Lu, Yang Xiao, Qingqi Pei and Lei Bai “A survey on long video generation: Challenges, methods, and prospects” In arXiv preprint arXiv:2403.16407, 2024
  • Li et al. (2024a) Xiaoyu Li, Yuanpeng Li, Yingyu Liang, Zhenmei Shi and Zhao Song “On the expressive power of modern hopfield networks” In arXiv preprint arXiv:2412.05562, 2024
  • Lim et al. (2024) Yi Lim, Qi Zhu, Joshua Selfridge and Muhammad Kasim “Parallelizing non-linear sequential models over the sequence length” In The Twelfth International Conference on Learning Representations, 2024 URL: https://openreview.net/forum?id=E34AlVLN0v
  • Liu et al. (2024) Bo Liu, Rui Wang, Lemeng Wu, Yihao Feng, Peter Stone and Qiang Liu “Longhorn: State space models are amortized online learners” In arXiv preprint arXiv:2407.14207, 2024
  • Liu et al. (2024a) Nelson Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni and Percy Liang “Lost in the middle: How language models use long contexts” In Transactions of the Association for Computational Linguistics 12 MIT Press One Broadway, 12th Floor, Cambridge, Massachusetts 02142, USA …, 2024, pp. 157–173
  • Lockard et al. (2019) Colin Lockard, Prashant Shiralkar and Xin Dong “Openceres: When open information extraction meets the semi-structured web” In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), 2019, pp. 3047–3056
  • Lucibello & Mézard (2024) Carlo Lucibello and Marc Mézard “Exponential capacity of dense associative memories” In Physical Review Letters 132.7 APS, 2024, pp. 077301
  • Merity et al. (2017) Stephen Merity, Caiming Xiong, James Bradbury and Richard Socher “Pointer Sentinel Mixture Models” In International Conference on Learning Representations, 2017 URL: https://openreview.net/forum?id=Byj72udxe
  • Merrill et al. (2024) William Merrill, Jackson Petty and Ashish Sabharwal “The Illusion of State in State-Space Models” In Forty-first International Conference on Machine Learning, 2024 URL: https://openreview.net/forum?id=QZgo9JZpLq
  • Montufar et al. (2014) Guido Montufar, Razvan Pascanu, Kyunghyun Cho and Yoshua Bengio “On the number of linear regions of deep neural networks” In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’14 Montreal, Canada: MIT Press, 2014, pp. 2924–2932
  • Munkhdalai et al. (2019) Tsendsuren Munkhdalai, Alessandro Sordoni, Tong Wang and Adam Trischler “Metalearned neural memory” In Advances in Neural Information Processing Systems 32, 2019
  • Munkhdalai & Yu (2017) Tsendsuren Munkhdalai and Hong Yu “Neural semantic encoders” In Proceedings of the conference. Association for Computational Linguistics. Meeting 1, 2017, pp. 397 NIH Public Access
  • Paperno et al. (2016) Denis Paperno, German Kruszewski, Angeliki Lazaridou, Ngoc Pham, Raffaella Bernardi, Sandro Pezzelle, Marco Baroni, Gemma Boleda and Raquel Fernandez “The LAMBADA dataset: Word prediction requiring a broad discourse context” In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) Berlin, Germany: Association for Computational Linguistics, 2016, pp. 1525–1534 DOI: 10.18653/v1/P16-1144
  • Pascanu et al. (2014) Razvan Pascanu, Guido Montufar and Yoshua Bengio “On the number of response regions of deep feed forward networks with piece-wise linear activations”, 2014 arXiv: https://arxiv.org/abs/1312.6098
  • Penedo et al. (2024) Guilherme Penedo, Hynek Kydlicek, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro Von and Thomas Wolf “The fineweb datasets: Decanting the web for the finest text data at scale” In Advances in Neural Information Processing Systems 37, 2024, pp. 30811–30849
  • Peng et al. (2023) Bo Peng, Eric Alcaide, Quentin Anthony, Alon Albalak, Samuel Arcadinho, Stella Biderman, Huanqi Cao, Xin Cheng, Michael Chung, Leon Derczynski, Xingjian Du, Matteo Grella, Kranthi GV, Xuzheng He, Haowen Hou, Przemyslaw Kazienko, Jan Kocon, Jiaming Kong, Bartłomiej Koptyra, Hayden Lau, Jiaju Lin, Krishna Mantri, Ferdinand Mom, Atsushi Saito, Guangyu Song, Xiangru Tang, Johan. Wind, Stanisław Wozniak, Zhenyuan Zhang, Qinghua Zhou, Jian Zhu and Rui-Jie Zhu “RWKV: Reinventing RNNs for the Transformer Era” In The 2023 Conference on Empirical Methods in Natural Language Processing, 2023 URL: https://openreview.net/forum?id=7SaXczaBpG
  • Peng et al. (2024) Bo Peng, Daniel Goldstein, Quentin Anthony, Alon Albalak, Eric Alcaide, Stella Biderman, Eugene Cheah, Xingjian Du, Teddy Ferdinan and Haowen Hou “Eagle and finch: Rwkv with matrix-valued states and dynamic recurrence” In arXiv preprint arXiv:2404.05892, 2024
  • Peng et al. (2025) Bo Peng, Ruichong Zhang, Daniel Goldstein, Eric Alcaide, Haowen Hou, Janna Lu, William Merrill, Guangyu Song, Kaifeng Tan and Saiteja Utpala “Rwkv-7" goose" with expressive dynamic state evolution” In arXiv preprint arXiv:2503.14456, 2025
  • Poli et al. (2024) Michael Poli, Armin Thomas, Eric Nguyen, Pragaash Ponnusamy, Bjorn Deiseroth, Kristian Kersting, Taiji Suzuki, Brian Hie, Stefano Ermon and Christopher Re “Mechanistic design and scaling of hybrid architectures” In arXiv preprint arXiv:2403.17844, 2024
  • Prados & Kak (1989) DL Prados and SC Kak “Neural network capacity using delta rule” In Electronics Letters 25.3 IET, 1989, pp. 197–199
  • Rajpurkar et al. (2016) Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev and Percy Liang “Squad: 100,000+ questions for machine comprehension of text” In arXiv preprint arXiv:1606.05250, 2016
  • Ramsauer et al. (2021) Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl, Michael Widrich, Lukas Gruber, Markus Holzleitner, Thomas Adler, David Kreil, Michael Kopp, Günter Klambauer, Johannes Brandstetter and Sepp Hochreiter “Hopfield Networks is All You Need” In International Conference on Learning Representations, 2021 URL: https://openreview.net/forum?id=tL89RnzIiCd
  • Ren et al. (2024) Liliang Ren, Yang Liu, Yadong Lu, Yelong Shen, Chen Liang and Weizhu Chen “Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling” In arXiv preprint arXiv:2406.07522, 2024
  • Sakaguchi et al. (2021) Keisuke Sakaguchi, Ronan Bras, Chandra Bhagavatula and Yejin Choi “Winogrande: An adversarial winograd schema challenge at scale” In Communications of the ACM 64.9 ACM New York, NY, USA, 2021, pp. 99–106
  • Sap et al. (2019) Maarten Sap, Hannah Rashkin, Derek Chen, Ronan Le and Yejin Choi “Social IQa: Commonsense Reasoning about Social Interactions” In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) Hong Kong, China: Association for Computational Linguistics, 2019, pp. 4463–4473 DOI: 10.18653/v1/D19-1454
  • Satpathi & Srikant (2021) Siddhartha Satpathi and Rayadurgam Srikant “The dynamics of gradient descent for overparametrized neural networks” In Learning for Dynamics and Control, 2021, pp. 373–384 PMLR
  • Schlag et al. (2021) Imanol Schlag, Kazuki Irie and Jürgen Schmidhuber “Linear transformers are secretly fast weight programmers” In International Conference on Machine Learning, 2021, pp. 9355–9366 PMLR
  • Schmidhuber (1992) JH Schmidhuber “Learning to control fast-weight memories: An alternative to recurrent nets. Accepted for publication in” In Neural Computation, 1992
  • Schmidhuber (1993) Jürgen Schmidhuber “Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets” In ICANN’93: Proceedings of the International Conference on Artificial Neural Networks Amsterdam, The Netherlands 13–16 September 1993 3, 1993, pp. 460–463 Springer
  • Schmidhuber & Hochreiter (1997) Jürgen Schmidhuber and Sepp Hochreiter “Long Short-term Memory” In Neural Computation MIT-Press, 1997
  • Schöne et al. (2025) Mark Schöne, Babak Rahmani, Heiner Kremer, Fabian Falck, Hitesh Ballani and Jannes Gladrow “Implicit Language Models are RNNs: Balancing Parallelization and Expressivity” In arXiv preprint arXiv:2502.07827, 2025
  • Sherman & Morrison (1950) Jack Sherman and Winifred Morrison “Adjustment of an inverse matrix corresponding to a change in one element of a given matrix” In The Annals of Mathematical Statistics 21.1 JSTOR, 1950, pp. 124–127
  • Siems et al. (2025) Julien Siems, Timur Carstensen, Arber Zela, Frank Hutter, Massimiliano Pontil and Riccardo Grazzi “DeltaProduct: Increasing the Expressivity of DeltaNet Through Products of Householders” In arXiv preprint arXiv:2502.10297, 2025
  • Smith et al. (2023) Jimmy.H. Smith, Andrew Warrington and Scott Linderman “Simplified State Space Layers for Sequence Modeling” In The Eleventh International Conference on Learning Representations, 2023 URL: https://openreview.net/forum?id=Ai8Hw3AXqks
  • Sun et al. (2024) Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang and Sanmi Koyejo “Learning to (learn at test time): Rnns with expressive hidden states” In arXiv preprint arXiv:2407.04620, 2024
  • Sun et al. (2023) Yutao Sun, Li Dong, Shaohan Huang, Shuming Ma, Yuqing Xia, Jilong Xue, Jianyong Wang and Furu Wei “Retentive network: A successor to transformer for large language models” In arXiv preprint arXiv:2307.08621, 2023
  • Terry (2017) W Terry “Learning and memory: Basic principles, processes, and procedures” Routledge, 2017
  • Tiezzi et al. (2024) Matteo Tiezzi, Michele Casoni, Alessandro Betti, Tommaso Guidi, Marco Gori and Stefano Melacci “On the resurgence of recurrent models for long sequences: Survey and research opportunities in the transformer era” In arXiv preprint arXiv:2402.08132, 2024
  • Vaswani et al. (2017) Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan Gomez, Łukasz Kaiser and Illia Polosukhin “Attention is All you Need” In Advances in Neural Information Processing Systems 30 Curran Associates, Inc., 2017 URL: https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf
  • Von et al. (2023) Johannes Von, Maximilian Schlegel, Alexander Meulemans, Seijin Kobayashi, Eyvind Niklasson, Nicolas Zucchet, Nino Scherrer, Nolan Miller, Mark Sandler and Max Vladymyrov “Uncovering mesa-optimization algorithms in transformers” In arXiv preprint arXiv:2309.05858, 2023
  • Wang et al. (2025) Ke Wang, Jiaxin Shi and Emily Fox “Test-time regression: a unifying framework for designing sequence models with associative memory” In arXiv preprint arXiv:2501.12352, 2025
  • Wen et al. (2024) Kaiyue Wen, Xingyu Dang and Kaifeng Lyu “Rnns are not transformers (yet): The key bottleneck on in-context retrieval” In arXiv preprint arXiv:2402.18510, 2024
  • Widrow & Hoff (1988) Bernard Widrow and Marcian Hoff “Adaptive switching circuits” In Neurocomputing: foundations of research, 1988, pp. 123–134
  • Willshaw et al. (1969) David Willshaw, O Buneman and Hugh Longuet-Higgins “Non-holographic associative memory” In Nature 222.5197 Nature Publishing Group UK London, 1969, pp. 960–962
  • Yang et al. (2024) Songlin Yang, Jan Kautz and Ali Hatamizadeh “Gated Delta Networks: Improving Mamba2 with Delta Rule” In arXiv preprint arXiv:2412.06464, 2024
  • Yang et al. (2024a) Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda and Yoon Kim “Gated Linear Attention Transformers with Hardware-Efficient Training” In Forty-first International Conference on Machine Learning, 2024 URL: https://openreview.net/forum?id=ia5XvxFUJT
  • Yang et al. (2024b) Songlin Yang, Bailin Wang, Yu Zhang, Yikang Shen and Yoon Kim “Parallelizing linear transformers with the delta rule over sequence length” In Advances in Neural Information Processing Systems 37, 2024, pp. 115491–115522
  • Zellers et al. (2019) Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi and Yejin Choi “HellaSwag: Can a Machine Really Finish Your Sentence?” In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics Florence, Italy: Association for Computational Linguistics, 2019, pp. 4791–4800 DOI: 10.18653/v1/P19-1472
  • Zhang et al. (2022) Yufeng Zhang, Boyi Liu, Qi Cai, Lingxiao Wang and Zhaoran Wang “An analysis of attention via the lens of exchangeability and latent variable models” In arXiv preprint arXiv:2212.14852, 2022

Appendix A Additional Related Work

Modern Linear Recurrent Neural Networks11 1 Note that here the term “linear” refers to their fast training and inference procedures. This does not refer to their recurrence formula as some models like Titans (Behrouz et al., 2024), Yaad, Moneta, Memora (Behrouz et al., 2025), and TTT (Sun et al., 2024) are based on non-linear recurrence but fast at training and inference.. Recent research endeavors have concentrated on mitigating the quadratic computational complexity and inherent limitations of Transformer models in processing long-context sequences. This has led to the development of efficient recurrent alternatives, primarily motivated by their rapid inference and training capabilities (Tiezzi et al., 2024). Initial advancements in this domain, exemplified by models such as RetNet (Sun et al., 2023), RWKV (Peng et al., 2023), and S5 (Smith et al., 2023), employed data-independent transition matrices coupled with Hebbian-like update mechanisms. Subsequently, a second generation of models emerged, incorporating input-dependent parameters within these linear architectures (e.g., linear RNNs (Hasani et al., 2023; Smith et al., 2023), RWKV6 (Peng et al., 2024)). These models also explored more expressive memory updating rules, notably those based on the delta rule (Peng et al., 2025; Schlag et al., 2021; Yang et al., 2024b; Yang et al., 2024; Liu et al., 2024). Further evolution in this line of research has extended these memory architectures to deeper models, while concurrently utilizing delta-rule-like update mechanisms (Sun et al., 2024) or data-dependent momentum-based update rules with forget gating (Behrouz et al., 2024). More recently, to augment the performance of delta-rule-based sequential models, Siems et al. (2025) have proposed the application of multiple gradient descent updates per token, thereby yielding more expressive sequence models, particularly in state tracking tasks. In addition to the above fast linear recurrent sequence models, several studies have focused on RNNs with non-linear recurrence (Behrouz et al., 2025; Csordás et al., 2024; Merrill et al., 2024; Lim et al., 2024; Schöne et al., 2025; Karami & Mirrokni, 2025; Von et al., 2023; Gonzalez et al., 2024), and how their training can be faster (Gonzalez et al., 2024; Lim et al., 2024; Schöne et al., 2025).

Fast Weight Programs. The conceptualization of linear layers as key-value associative memory systems can be traced back to Hopfield networks (Hopfield, 1982). This concept was subsequently developed in the context of fast weight programmers, wherein dynamic fast programs are integrated into recurrent neural networks to serve as writable memory stores (Schlag et al., 2021; Schmidhuber, 1992; Schmidhuber, 1993). Among the learning paradigms for such systems, Hebbian learning (Hebb, 2005) and the delta rule (Prados & Kak, 1989) have emerged as the most prominent. Both learning rules have been the subject of extensive investigation within the existing literature (Munkhdalai & Yu, 2017; Schmidhuber, 1992; Munkhdalai et al., 2019; Schlag et al., 2021; Irie et al., 2021; Yang et al., 2024b; Yang et al., 2024).

Hopfield Networks. Our formulation is architecturally founded upon the broad concept of associative memory, wherein the primary objective is to learn an underlying mapping between keys and values. Seminal work by Hopfield (1982) on Hopfield Networks introduced one of the earliest neural architectures explicitly based on associative memory, defining it through the minimization of an energy function for storing key-value pairs. Although traditional Hopfield networks have seen diminished applicability in recent years, primarily due to constraints in vector-valued memory capacity and the nature of their energy function, several contemporary studies have focused on enhancing their capacity through various methodologies. These include efforts by Krotov (2021), Li et al. (2024a), and Krotov & Hopfield (2016). Notably, extensions to the energy function of these models, often incorporating exponential kernels, have been explored (Krotov & Hopfield, 2016; Lucibello & Mézard, 2024). Furthermore, the relationship between these modernized Hopfield networks and Transformer architectures has been a subject of recent investigation (Ramsauer et al., 2021; Hu et al., 2024).

Appendix B Miras Framework

As discussed earlier, Behrouz et al. (2025) formalized the concept of associative memory as:

Definition 2 (Behrouz et al. (2025)).

Given a set of keys 𝒦dk\mathcal{K}\subseteq\mathbb{R}^{d_{k}} and values 𝒱dv\mathcal{V}\subseteq\mathbb{R}^{d_{v}}, associative memory is an mapping :𝒦𝒱\mathcal{M}:\mathcal{K}\rightarrow\mathcal{V}. Learning the associative memory is based on an objective \mathcal{L}, called Attentional Bias, that determines the type of memory and its priorities:

=argmin((𝒦),𝒱).\displaystyle\mathcal{M}^{*}=\arg\min_{\mathcal{M}}\quad\mathcal{L}(\mathcal{M}(\mathcal{K});\mathcal{V}). (44)

Optimizing this objective using an iterative algorithm (e.g., gradient descent) results in the memory update rule. Thus, the sequence model is a meta in-context learner with two optimization levels:

  1. 1.

    Inner Loop: Where parameters of the memory module are optimized (i.e., 𝜽={W1,W2,,W,}\bm{\theta}_{\mathcal{M}}=\{W_{1},W_{2},\dots,W_{\mathcal{L}_{\mathcal{M}},\dots}\}). In the inner optimization loop, all other parameters from the model are considered hyperparameters and are fixed and not optimized.

  2. 2.

    Outer Loop: Where all other parameters of the model are optimized, such as linear projections, MLP layers, convolutions, etc.

B.1 Examples

As an example, one can define the linear attention as the optimization of dot-product similarity with gradient descent: i.e., ~t:=t1𝐤t,𝐯t\tilde{\ell}_{t}:=\langle\mathcal{M}_{t-1}\mathbf{k}_{t},\mathbf{v}_{t}\rangle. That is,

t\displaystyle\mathcal{M}_{t} =t1ηt~t(t1;𝐤t,𝐯t)=t1ηtt1𝐤t,𝐯t\displaystyle=\mathcal{M}_{t-1}-\eta_{t}\nabla\tilde{\ell}_{t}(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})=\mathcal{M}_{t-1}-\eta_{t}\nabla\langle\mathcal{M}_{t-1}\mathbf{k}_{t},\mathbf{v}_{t}\rangle (45)
=t1+ηt𝐯t𝐤t.\displaystyle=\mathcal{M}_{t-1}+\eta_{t}\mathbf{v}_{t}\mathbf{k}_{t}^{\top}. (46)

As an another example, if we use regression loss, instead of the dot-product similarity, we can obtain the DeltaNet (Schlag et al., 2021):

t\displaystyle\mathcal{M}_{t} =t1ηtt𝐤t𝐯t22=𝐈ηt𝐤t𝐤tt1+𝐯t𝐤t.\displaystyle=\mathcal{M}_{t-1}-\eta_{t}\nabla\|\mathcal{M}_{t}\mathbf{k}_{t}-\mathbf{v}_{t}\|^{2}_{2}=\mathbf{I}-\eta_{t}\mathbf{k}_{t}\mathbf{k}_{t}^{\top}\mathcal{M}_{t-1}+\mathbf{v}_{t}\mathbf{k}_{t}^{\top}. (47)

Appendix C Supporting Proofs

See 1

Proof.

Let K=[𝐤1𝐤m]dk×mK=[\mathbf{k}_{1}\cdots\mathbf{k}_{m}]\in\mathbb{R}^{d_{k}\times m} and V=[𝐯1𝐯m]dv×mV=[\mathbf{v}_{1}\cdots\mathbf{v}_{m}]\in\mathbb{R}^{d_{v}\times m}. The optimization problem becomes minimizing the Frobenius norm KV22\|\mathcal{M}K-V\|_{2}^{2}. Exact memorization requires solving the linear system K=V\mathcal{M}K=V.

Vectorizing the expression yields the system (KIdv)vec()=vec(V)(K^{\top}\otimes I_{d_{v}})\mathrm{vec}(\mathcal{M})=\mathrm{vec}(V), which has mdvmd_{v} scalar equations in dkdvd_{k}d_{v} unknowns. When the keys are linearly independent, rank(K)=m\operatorname{rank}(K)=m, and hence the system matrix has full row rank mdvmd_{v}. Solvability thus requires mdvdkdvmd_{v}\leq d_{k}d_{v}, or equivalently mdkm\leq d_{k}. This matches classic results on the storage capacity of linear associative memories such as the Willshaw model and Hopfield networks, where capacity is tied to the rank of the input embedding (Willshaw et al., 1969; Hopfield, 1982).

When mdkm\leq d_{k} and KK has full column rank, one can construct an exact interpolating solution via the Moore–Penrose pseudoinverse: =VK\mathcal{M}^{*}=VK^{\top}. Then K=VKK=V\mathcal{M}^{*}K=VK^{\top}K=V, achieving zero training error. Thus the upper bound is tight.

Moreover, full-batch gradient descent on this objective with step size 0<η<2/λmax(KK)0<\eta<2/\lambda_{\max}(KK^{\top}) yields iterates t+1=tη(tKV)K\mathcal{M}_{t+1}=\mathcal{M}_{t}-\eta(\mathcal{M}_{t}K-V)K^{\top}, which converge to the minimum-norm interpolating solution =VK\mathcal{M}^{\dagger}=VK^{\top} when mdkm\leq d_{k}. This is a well-known implicit bias of gradient descent in overparameterized linear models (Satpathi & Srikant, 2021).

Finally, the same rank-based constraint governs the capacity of linear or multi-head attention modules. In such architectures, the output context matrix has rank at most rank(K)dk\operatorname{rank}(K)\leq d_{k}, which directly limits their expressivity. Recent analyses identify this “low-rank bottleneck” as a capacity-limiting effect in Transformers (Bhojanapalli et al., 2020). ∎

See 1 Early theoretical works established that even simple network architectures can memorize a significant number of input-output mappings, with capacity often related to the number of network parameters (e.g., weights and biases) and the input dimensionality Cover (1965); Baum (1988); Huang (2003). For instance,  Baum (1988) demonstrated that Nd\left\lceil\frac{N}{d}\right\rceil neurons are sufficient for a single-hidden-layer network with threshold units to memorize NN input-label pairs from d\mathbb{R}^{d}.

Networks employing Rectified Linear Units (ReLUs), exhibit a piecewise affine behavior. The input space is partitioned into numerous linear regions, and within each region, the network computes a distinct affine transformation Montufar et al. (2014); Pascanu et al. (2014). This structure is pivotal for analyzing their expressive power and storage capacity. The precise relationship between depth, width, the number of linear regions, and the ultimate capacity to store specific key-value associations, especially with constraints like linearly independent keys, remains an active area of research.

Proof.

Let mm denote the number of (𝐤i,𝐯i)(\mathbf{k}_{i},\mathbf{v}_{i}) pairs memorized exactly by \mathcal{M}, and assume the keys {𝐤i}i=1mdk\{\mathbf{k}_{i}\}_{i=1}^{m}\subset\mathbb{R}^{d_{k}} are linearly independent. Let dh(0):=dkd_{h}^{(0)}:=d_{k}, dh():=dvd_{h}^{(\mathcal{L}_{\mathcal{M}})}:=d_{v}, and for each layer 11\leq\ell\leq\mathcal{L}_{\mathcal{M}}, define W()dh()×dh(1)W^{(\ell)}\in\mathbb{R}^{d_{h}^{(\ell)}\times d_{h}^{(\ell-1)}}. Biases are omitted for simplicity.

Since σ(x)=max(0,x)\sigma(x)=\max(0,x) is piecewise linear, the composition of linear maps and ReLU activations yields a piecewise affine function. For any fixed activation pattern (i.e., fixed sign of pre-activations), the MLP acts as:

()=A+B,where A=W()D(1)W(1)D(1)W(1),\displaystyle\mathcal{M}(\cdot)=A\cdot+B,\quad\text{where }A=W^{(\mathcal{L}_{\mathcal{M}})}D^{(\mathcal{L}_{\mathcal{M}}-1)}W^{(\mathcal{L}_{\mathcal{M}}-1)}\cdots D^{(1)}W^{(1)},

and each D()D^{(\ell)} is a diagonal {0,1}\{0,1\} matrix selecting the active units. Therefore, when all keys fall into the same linear region (which occurs generically after a small perturbation), \mathcal{M} is a single affine transformation.

Let 𝐊:=[𝐤1𝐤m]dk×m\mathbf{K}:=[\mathbf{k}_{1}\;\cdots\;\mathbf{k}_{m}]\in\mathbb{R}^{d_{k}\times m} and 𝐕:=[𝐯1𝐯m]dv×m\mathbf{V}:=[\mathbf{v}_{1}\;\cdots\;\mathbf{v}_{m}]\in\mathbb{R}^{d_{v}\times m}. Exact memorization implies A𝐊=𝐕A\mathbf{K}=\mathbf{V}, so:

rank(𝐕)rank(A),m=rank(𝐊)min{rank(A),dk}.\displaystyle\operatorname{rank}(\mathbf{V})\leq\operatorname{rank}(A),\quad m=\operatorname{rank}(\mathbf{K})\leq\min\{\operatorname{rank}(A),d_{k}\}.

Now observe:

A=W()D(1)W(1)R1D(1)W(1)R1,\displaystyle A=W^{(\mathcal{L}_{\mathcal{M}})}\underbrace{D^{(\mathcal{L}_{\mathcal{M}}-1)}W^{(\mathcal{L}_{\mathcal{M}}-1)}}_{R_{\mathcal{L}_{\mathcal{M}}-1}}\cdots\underbrace{D^{(1)}W^{(1)}}_{R_{1}},

and thus the rank of AA is bounded by the minimal width encountered along each path times the immediate input dimension:

rank(A)i=1(minjidh(j))dh(i)=𝒪(dkdvi=1minjidh(j)dh(i+1)).\displaystyle\operatorname{rank}(A)\leq\sum_{i=1}^{\mathcal{L}_{\mathcal{M}}}\left(\min_{j\geq i}d_{h}^{(j)}\right)d_{h}^{(i)}=\mathcal{O}\left(d_{k}d_{v}\sum_{i=1}^{\mathcal{L}_{\mathcal{M}}}\min_{j\geq i}d_{h}^{(j)}d_{h}^{(i+1)}\right).

Hence,

m𝒪(dkdvi=1minjidh(j)dh(i+1))\displaystyle m\leq\mathcal{O}\left(d_{k}d_{v}\sum_{i=1}^{\mathcal{L}_{\mathcal{M}}}\min_{j\geq i}d_{h}^{(j)}d_{h}^{(i+1)}\right)

See 2

Proof.

Let us begin by analyzing the dimension of the lifted feature space induced by ϕp\phi_{p}. A monomial in dkd_{k} variables of total degree exactly \ell has the form 𝐤α=j=1dkkjαj\mathbf{k}^{\alpha}=\prod_{j=1}^{d_{k}}k_{j}^{\alpha_{j}}, where αdk\alpha\in\mathbb{N}^{d_{k}} and |α|:=j=1dkαj=|\alpha|:=\sum_{j=1}^{d_{k}}\alpha_{j}=\ell. The number of such monomials is given by the classical stars-and-bars formula, which counts the number of integer solutions to α1++αdk=\alpha_{1}+\cdots+\alpha_{d_{k}}=\ell, yielding

(dk+1).\displaystyle\binom{d_{k}+\ell-1}{\ell}.

Summing over all degrees =0\ell=0 to pp gives the total number of monomials (i.e., the output dimension of ϕp\phi_{p}),

D==0p(dk+1)=(dk+pp),\displaystyle D=\sum_{\ell=0}^{p}\binom{d_{k}+\ell-1}{\ell}=\binom{d_{k}+p}{p},

where the final identity follows from the hockey-stick identity in combinatorics.

To characterize the memorization capacity, we reformulate the loss in matrix notation. Let Φ:=[ϕp(𝐤1)ϕp(𝐤m)]D×m\Phi:=[\phi_{p}(\mathbf{k}_{1})\;\cdots\;\phi_{p}(\mathbf{k}_{m})]\in\mathbb{R}^{D\times m} and V:=[𝐯1𝐯m]dv×mV:=[\mathbf{v}_{1}\;\cdots\;\mathbf{v}_{m}]\in\mathbb{R}^{d_{v}\times m}. Then the objective becomes

L()=12ΦV22.\displaystyle L(\mathcal{M})=\tfrac{1}{2}\|\mathcal{M}\Phi-V\|_{2}^{2}.

Exact memorization corresponds to the existence of a matrix \mathcal{M} such that Φ=V\mathcal{M}\Phi=V. This is a linear system in which \mathcal{M} acts on the columns of Φ\Phi, so the rank of Φ\Phi necessarily limits the number of independent targets 𝐯i\mathbf{v}_{i} that can be fitted exactly.

By the sub-multiplicativity of rank, for any matrices AA and BB, we have

rank(AB)min{rank(A),rank(B)}.\displaystyle\operatorname{rank}(AB)\leq\min\{\operatorname{rank}(A),\operatorname{rank}(B)\}.

Applying this to Φ\mathcal{M}\Phi yields

rank(Φ)rank(Φ)D.\displaystyle\operatorname{rank}(\mathcal{M}\Phi)\leq\operatorname{rank}(\Phi)\leq D.

Now consider a case where the targets 𝐯1,,𝐯m\mathbf{v}_{1},\dots,\mathbf{v}_{m} are linearly independent; for instance, take V=[e1,,em]V=[e_{1},\dots,e_{m}], the first mm standard basis vectors. Then rank(V)=m\operatorname{rank}(V)=m. If m>Dm>D, we necessarily have rank(Φ)<rank(V)\operatorname{rank}(\mathcal{M}\Phi)<\operatorname{rank}(V) for every choice of \mathcal{M}, implying that the system Φ=V\mathcal{M}\Phi=V is unsolvable. Hence, the loss remains strictly positive, and exact memorization is impossible.

This establishes that no method, regardless of optimization procedure, can memorize more than D=(dk+pp)D=\binom{d_{k}+p}{p} independent input-output pairs under a degree-p\leq p polynomial lifting. Since (dk+pp)=Θ(dkp)\binom{d_{k}+p}{p}=\Theta(d_{k}^{p}) for fixed pp, the result follows: the memorization capacity is bounded above by 𝒪(dkp)\mathcal{O}(d_{k}^{p}). ∎

Appendix D Detailed Formulations of All Architectures

In this section, for the sake of clarity, we discuss the details of all architectures that we discuss through the paper:

D.1 Deep Linear Attention (DLA)

We design Deep Linear Attention (DLA)—linear attention module that uses a deep MLP as the memory (KV cache)—as one of the baselines of this study. Given input 𝐱N×din\mathbf{x}\in\mathbb{R}^{N\times d_{\text{in}}}, we project the input into matrices of keys, values and queries:

𝐐=(𝐪1𝐪N)=𝐱𝐖Q,𝐊=(𝐤1𝐤N)=𝐱𝐖K,𝐕=(𝐯1𝐯N)=𝐱𝐖V,\displaystyle\mathbf{Q}=\begin{pmatrix}\mathbf{q}_{1}\\ \vdots\\ \mathbf{q}_{N}\end{pmatrix}=\mathbf{x}\mathbf{W}_{Q},\qquad\quad\mathbf{K}=\begin{pmatrix}\mathbf{k}_{1}\\ \vdots\\ \mathbf{k}_{N}\end{pmatrix}=\mathbf{x}\mathbf{W}_{K},\qquad\quad\mathbf{V}=\begin{pmatrix}\mathbf{v}_{1}\\ \vdots\\ \mathbf{v}_{N}\end{pmatrix}=\mathbf{x}\mathbf{W}_{V}, (48)

where 𝐖Q,𝐖K,\mathbf{W}_{Q},\mathbf{W}_{K}, and 𝐖V\mathbf{W}_{V} are learnable linear layers. We then define memory as a learning module that optimizes the inner-dot product similarity using gradient descent: i.e.,

min(𝐤t),𝐯t(t1,𝐤t,𝐯t).\displaystyle\min_{\mathcal{M}}\underset{\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})}{\underbrace{\langle\mathcal{M}(\mathbf{k}_{t}),\mathbf{v}_{t}\rangle}}. (49)

The above optimization using gradient descent results in the following recurrence (we also add weight decay with input-dependent parameter αt\alpha_{t}):

t=αtt1ηt(t1;𝐤t,𝐯t)\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\eta_{t}\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t}) (50)

which in the case of linear memory (i.e., t=Wtd×d\mathcal{M}_{t}=W_{t}\in\mathbb{R}^{d\times d}) it becomes:

Wt=αtWt1+𝐯t𝐤t,\displaystyle W_{t}=\alpha_{t}W_{t-1}+\mathbf{v}_{t}\mathbf{k}_{t}^{\top}, (51)

which is the formulation of gated linear attention. We use the same training process as other models (see Section 3.3).

D.2 Sliding Window Linear Attention (SWLA)

The design of SWLA is the same as the design of DLA, but with the use of sliding window objective. That is, given keys, values, and queries:

𝐐=(𝐪1𝐪N)=𝐱𝐖Q,𝐊=(𝐤1𝐤N)=𝐱𝐖K,𝐕=(𝐯1𝐯N)=𝐱𝐖V,\displaystyle\mathbf{Q}=\begin{pmatrix}\mathbf{q}_{1}\\ \vdots\\ \mathbf{q}_{N}\end{pmatrix}=\mathbf{x}\mathbf{W}_{Q},\qquad\quad\mathbf{K}=\begin{pmatrix}\mathbf{k}_{1}\\ \vdots\\ \mathbf{k}_{N}\end{pmatrix}=\mathbf{x}\mathbf{W}_{K},\qquad\quad\mathbf{V}=\begin{pmatrix}\mathbf{v}_{1}\\ \vdots\\ \mathbf{v}_{N}\end{pmatrix}=\mathbf{x}\mathbf{W}_{V}, (52)

we optimize the internal objective of:

mini=tc+1tt1(𝐤i),𝐯i(t1,𝐤t,𝐯t).\displaystyle\min_{\mathcal{M}}\underset{\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})}{\underbrace{\sum_{i=t-c+1}^{t}\langle\mathcal{M}_{t-1}(\mathbf{k}_{i}),\mathbf{v}_{i}\rangle}}. (53)

The above formulation, results in:

t=αtt1(t1;𝐤t,𝐯t)=αtt1i=tc+1tηi(t)t1(𝐤i),𝐯i,\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})=\alpha_{t}\mathcal{M}_{t-1}-\sum_{i=t-c+1}^{t}\eta^{(t)}_{i}\nabla\langle\mathcal{M}_{t-1}(\mathbf{k}_{i}),\mathbf{v}_{i}\rangle, (54)

which in the case of linear memory (i.e., t=Wtd×d\mathcal{M}_{t}=W_{t}\in\mathbb{R}^{d\times d}) it becomes:

t=αtt1i=tc+1tηi(t)𝐯i𝐤i.\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\sum_{i=t-c+1}^{t}\eta^{(t)}_{i}\mathbf{v}_{i}\mathbf{k}_{i}^{\top}. (55)

D.3 OmegaNet

In the design of OmegaNet, we use replace the dot-prodcut similarity objective with (t1,𝐤t,𝐯t)=i=tc+1tt1(ϕ(𝐤i))𝐯i22\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})=\sum_{i=t-c+1}^{t}\|\mathcal{M}_{t-1}(\phi(\mathbf{k}_{i}))-\mathbf{v}_{i}\|^{2}_{2} ,which results in the recurrence of:

t=αtt1(t1;𝐤t,𝐯t)=αtt1i=tc+1tηi(t)t1(ϕ(𝐤i))𝐯i22.\displaystyle\mathcal{M}_{t}=\alpha_{t}\mathcal{M}_{t-1}-\nabla\ell(\mathcal{M}_{t-1};\mathbf{k}_{t},\mathbf{v}_{t})=\alpha_{t}\mathcal{M}_{t-1}-\sum_{i=t-c+1}^{t}\eta^{(t)}_{i}\nabla\|\mathcal{M}_{t-1}(\phi(\mathbf{k}_{i}))-\mathbf{v}_{i}\|^{2}_{2}. (56)

In the above formulation, ϕ(.)\phi(.) is the polynomial feature mapping function.

D.4 Atlas

In the Atlas, we use the same internal objective as OmegaNet but we optimize it using Muon optimizer (Jordan et al., 2024) with weight decay. That is,

t\displaystyle\mathcal{M}_{t} =αtt1+Newton-schulz5(𝒮t)\displaystyle=\alpha_{t}\mathcal{M}_{t-1}+\texttt{Newton-schulz5}(\mathcal{S}_{t}) (57)
𝒮t\displaystyle\mathcal{S}_{t} =θt𝒮t1i=tc+1tηi(t)t1(ϕ(𝐤i))𝐯i22.\displaystyle=\theta_{t}\mathcal{S}_{t-1}-\sum_{i=t-c+1}^{t}\eta^{(t)}_{i}\nabla\|\mathcal{M}_{t-1}(\phi(\mathbf{k}_{i}))-\mathbf{v}_{i}\|^{2}_{2}. (58)

Appendix E Experimental Details

In our experimental setup we follow recent studies on linear recurrent models (Yang et al., 2024; Behrouz et al., 2024; Behrouz et al., 2025), we use Wikitext (Merity et al., 2017), LMB (Paperno et al., 2016), PIQA (Bisk et al., 2020), HellaSwag (Zellers et al., 2019), WinoGrande (Sakaguchi et al., 2021), ARC-easy (ARC-e) and ARC-challenge (ARC-c) (Clark et al., 2018), SIQA (Sap et al., 2019), and BoolQ (Clark et al., 2019). Also, the baselines results are from Behrouz et al. (2025); Behrouz et al. (2024). In the training, we use T5 tokenizer with a vocabulary size of 32K and use training length of 4K tokens (2K for SWA). We employ AdamW optimizer with learning rate of 4e4e-44 with cosine annealing schedule with batch size of 0.5M tokens, and weight decay of 0.10.1. The architectural details are also reported in Table 7. The baseline results for 1.3B are from Yang et al. (2024) and for 760M are from Behrouz et al. (2024); Behrouz et al. (2025).

For the memory architecture, unless state otherwise, we use an MLP with 22 layers with expansion factor of 4 and GELU activation function (Hendrycks & Gimpel, 2016). We also use residual connections and layer norm at the end of each chunk: (x)=x+W1σ(W2x)\mathcal{M}(x)=x+W_{1}\sigma(W_{2}x).

Table 7: Architectural Details.
Model Block Dim Head Peak LR Token
170M 12 768 16 3e-3 15B
340M 24 1024 16 1.5e-3 15B
760M 24 1536 16 1.25e-3 30B
1.3B 18 2048 8 7e-4 100B

Appendix F Additional Experimental Results

In this section, we provide additional experimental results to support the design of our models, understand the effect of different components and also evaluate their performance in long context, in-context recall and MAD tasks.

F.1 Language Modeling and Common-sense Reasoning (Small Scale)

In Section 6 we presented a subset of results on language modeling and common-sense reasoning tasks. In this section, we further report the results for all scales of models. The results are in Table 8.

State-of-the-art Results. Looking at the performance of Atlas and OmegaNet, both architectures perform favorably compared to modern linear recurrent models and Transformers, achieving lower perplexity and better accuracy in downstream tasks. Even the fully recurrent version of these models outperform hybrid models such as Samba (Ren et al., 2024) and Gated DeltaNet-H2 (Yang et al., 2024). Using the hybrid variants of MAG and MAL further improve the performance of Atlas, which shows the complementary role of recurrent long-term memory and attention.

The Effect of Design. Comparing the performance of Atlas, OmegaNet, and baselines SWLA and DLA, we can see the role of 2\ell_{2} regression loss as the attentional bias. Also, the better performance of SWLA compared to GLA and RetNet indicates the importance of memorizing the context, instead of memorizing individual tokens.

Table 8: Performance of Atlas and baselines on language modeling and common-sense reasoning tasks. The best results are highlighted highlighted.
Model Wiki. LMB. LMB. PIQA Hella. Wino. ARC-e ARC-c SIQA BoolQ Avg.
ppl \downarrow ppl \downarrow acc \uparrow acc \uparrow acc_n \uparrow acc \uparrow acc \uparrow acc_n \uparrow acc \uparrow acc \uparrow \uparrow
340M params / 15B tokens
Transformer++ 31.52 41.08 30.76 62.98 34.76 50.53 45.21 24.05 36.81 58.24 42.92
RetNet 32.50 49.73 28.24 62.61 34.15 50.91 44.27 23.62 36.79 59.72 42.54
GLA 28.51 43.02 28.73 64.05 35.96 50.00 54.19 24.29 37.13 58.39 44.09
Mamba 30.83 40.21 29.94 63.79 35.88 49.82 49.24 24.56 35.41 60.07 43.59
DeltaNet 28.65 47.30 28.43 63.52 35.95 49.63 52.68 25.37 37.96 58.79 44.04
TTT 27.44 34.19 30.06 63.97 35.71 50.08 53.01 26.11 37.32 59.83 44.51
Gated DeltaNet 27.01 30.94 34.11 63.08 38.12 51.60 55.28 26.77 34.89 59.54 45.42
Moneta 26.19 29.31 35.70 63.99 39.23 52.04 55.96 27.15 37.29 60.22 46.44
Yaad 26.61 29.11 34.09 64.93 39.86 51.12 54.75 28.64 33.82 60.29 45.93
Memora 27.16 30.44 33.68 65.21 39.17 51.23 53.40 27.99 34.1 59.29 45.51
DLA (ours) 27.93 35.09 30.8 62.9 36.2 50.4 53.5 26.7 37.1 59.7 44.76
SWDT (ours) 26.98 33.95 32.4 63.1 38.2 50.9 54.9 25.9 37.5 59.6 45.31
OmegaNet (ours) 26.03 28.76 35.6 65.3 39.7 52.0 56.1 28.6 37.7 60.4 46.93
Atlas (ours) 25.88 28.54 36.1 64.9 40.1 52.7 56.4 28.8 38.1 61.2 47.28