alphaFeedback

WorksComputer Science

Weighted State Souping for Efficient Long-Context Retrieval

AI contributions
  • LLMs
View details

Abstract

State space models (SSMs) combine fast inference and fixed state size with competitive language-modeling performance. Recently, state souping has been proposed as a procedure whereby an SSM independently encodes chunks of tokens like documents, tool definitions, or memory records. The resulting state encodings may be cached and recombined to cheaply construct a context for downstream queries. However, both state souping and vanilla SSMs deteriorate on long, crowded contexts, limiting their utility for long-horizon domains. To address this issue, we propose weighted state souping, a simple method that learns query-dependent weights for composing cached states. The resulting models improve long-context performance substantially across both single- and multi-hop document question answering, needle-in-a-haystack retrieval, variable tracking, and tool use. Our method can be further adapted into an efficient sparse variant, yielding near-constant encoding cost with respect to context length while preserving (and sometimes improving) performance. We also present simple theoretical arguments that illustrate why souping works and when it may fail, and discuss informally the advantages of weighted souping. Weighted state souping thus combines reusable context representations with selective retrieval, offering an efficient approach to language modeling over large collections of documents, tools, and other forms of structured context that increasingly dominate modern agentic workloads.

Introduction

Many applications of large language models (LLMs) require long-lived context organized into discrete chunks of tokens: tool definitions for an agent ([36, 30]), documents for question answering or retrieval-augmented generation ([32, 52, 45, 20, 11]), and memory records or chat histories that persist across interactions ([28, 34] (Wu et al. 2024)). A useful memory architecture must retrieve relevant chunks from an increasingly crowded store without repeatedly processing the entire history.

In these settings, common practice concatenates the chunks of tokens and processes them as a single flat sequence. With the rising popularity of state space models (SSMs) and related fixed-state architectures ([10, 5, 18, 37, 42]), an alternative approach becomes possible. Rather than perform a single autoregressive pass on a concatenated sequence, each chunk can be independently encoded into a state. The resulting collection of states are then point-wise summed to initialize the model before it processes a query (Figure 1). By analogy to model souping ([49]), this procedure is called state souping ([31, 15, 21]): the quantities combined are input-dependent recurrent states, rather than model parameters.

Sequential encoding versus state souping

Figure 1. Sequential encoding versus state souping. (a) A typical SSM operates by concatenating input chunks together with the user query, and performs a single, long autoregressive pass to produce the answer. (b) A state souping SSM encodes each input chunk independently, then soups the resulting state encodings into a single encoding used to initialize the model as it processes the user query. (c) In our weighted state souping method, we augment the SSM with an additional linear readout that produces key vectors from the input chunks and a query vector from the user query. The soup is constructed as a weighted sum with weighting function σ\sigma.

State souping has an obvious efficiency advantage. State encodings can be computed in parallel and, for slowly changing chunks like memory records or tool definitions, cached and reused. This ability to cache representations makes souping naturally suited for handling the structured context that increasingly dominates modern agentic workloads: inference can depend on selected state encodings without repopulating the context with large memory artifacts, tool definitions, and documents. However, finite-state SSMs struggle to copy or retrieve from long contexts [16, 48, 2], and state souping performance similarly decays as more documents are added [15]. This loss of selectivity limits souping precisely where persistent memory is most useful.

In this work, we introduce weighted state souping, which learns attention-like weights over state encodings. Across document QA, needle-in-a-haystack retrieval, variable tracking, and tool use, weighting substantially improves robustness as contexts grow beyond training lengths. Our method can be further adapted into a sparse variant that permits near-constant encoding cost while preserving — and sometimes improving — performance. Our main contributions are:

  • a novel weighted state souping procedure that permits robust selectivity, strong generalization on long contexts, and substantial efficiency gains over both Transformers and traditional SSMs,

  • a comprehensive evaluation over diverse benchmarks including multi-document question answering, needle-in-a-haystack retrieval, variable tracking, and agentic tool use,

  • a simple theoretical account of how souping successfully retrieves and composes across chunks, and its potential weaknesses compared against sequential models. We also discuss informally the advantages of weighted state souping.

Related work

State souping is a relatively recent method. Pióro et al. [31] introduced the term, and explored linear combinations of recurrent states for in-context skill transfer. Jafari et al. [15] study independently encoded document states, showing that finetuning enables simple pooling operators to support downstream QA and retrieval. PICASO [21] derives state-composition rules similar to souping for permutation-invariant inputs. We build on these works by showing how query-dependent weighting permits both significantly stronger length generalization and substantial efficiency wins.

State souping can be seen as an approximate form of state caching, a procedure whereby states generated from common prefixes can be cached and reused exactly for downstream requests. In Transformers, the procedure is more often called KV caching [38, 19]. In SSMs, state caching has been explored particularly in the context of hybrid models, where common KV caching methods for attention blocks may not transfer directly to SSM layers. In particular, Pan et al. [29] explore SSM-specific cache eviction policies to maintain an efficient prefix cache for SBMs. Shirokikh & Nikolenko [39] explore a complementary idea in which cache checkpoints are saved along the sequence; future generation resumes from the deepest checkpoint that matches the current prefix. Gopal et al. [9] investigate state caching in pure SSMs for retrieval augmented generation, and highlights its efficiency for edge-computing applications.

Souping is also related to state tuning, the process of learning an initial state for a recurrent model. This process has been studied in the context of parameter-efficient fine tuning (PEFT) for state space models [17, 53] (Galin et al. 2024). Kang et al. [17] in particular find that state offset tuning, in which a learned offset is added to every recurrent state, outperforms initial state tuning and other PEFT methods like LoRA. State tuning has also been studied in the RWKV community [51], and historically in early RNNs [7].

Our weighted approach to state souping is similar to methods that attempt to introduce attention-like features to state space models, interpolating between Transformers and SSMs. In particular, Akhauri et al. [1] introduce a method in which SSMs produce compressed key-value representations before applying attention. Similarly, Infini-attention [25] combines local attention with a compressive recurrent memory. Memory Caching [3] explores storing and combining recurrent memory checkpoints through attention-like weights. Our approach focuses on structured contexts that permit state souping, and our weighting does not retain token-by-token attention to cached states during generation, ultimately yielding both substantial efficiency benefits and performance gains.

Methods analogous to state souping have also been investigated in Transformers. Notably, Eyuboglu et al. [6] introduce a method for directly training KV caches to encode documents. The resulting “cartridges” can be provided in-context to approximate the behavior of the model had it been prompted with the original documents, similar to how SSM state encodings are used in souping. However, cartridges require offline tuning specific to each document, and multiple cartridges do not compose in-context without significant additional training [12]. Our weighted state souping approach is also similar in motivation to block attention architectures that use block representations to select relevant blocks for token-level attention [24, 22] or use query-dependent scores to load KV cache blocks during decoding [43].

Weighted State Souping

State souping operates in the following way. Let an input contain kk token chunks c1,…,ck\mathbf{c}_1,\ldots,\mathbf{c}_k and query q\mathbf{q}. The SSM independently encodes each chunk into its final state si\mathbf{s}_i, where the state encompasses the collection of recurrent states across all layers. We then perform a point-wise average over the kk encodings to make the “soup” s0=1k∑i=1ksi\mathbf{s}_0 = \frac{1}{k}\sum_{i=1}^{k}\mathbf{s}_i. s0\mathbf{s}_0 becomes the initialization for the SSM as it processes the user query Figure 1. We use the same SSM for encoding and generation, but these models can be different. Souping is not an inference-time only intervention, and requires either learning from scratch or additional finetuning on a pretrained SSM to teach the model to used this composed initialization [15].

Crucially, the only channel through which the input chunks influence the query is the souped initialization. Since SSMs perform simple linear state updates, a soup constructed through an average of states can be viewed as a naive approximation of the state construct from a concatenated, sequential input. Such a mean soup is the approach used in prior work [31, 15], and performs comparably with a sequential SSM. However, both mean souping and sequential SSMs struggle when operating over long contexts containing many input chunks [15, 4, 2]. As the number of chunks increases, a mean soup or finite SSM state becomes increasingly noisy, degrading performance.

Query-dependent weighting may instead concentrate the souped state on relevant chunks, the inspiration for weighted state souping. Our method is related to other schemes that weight input tokens in sequential SSMs [3] (Akhouri et al. 2024), though our focus is on a souping architecture for chunked inputs. To compute these weightings, we add a learnable linear readout that maps the final activation to a key and query vector. Each chunk produces key ki\mathbf{k}_i. Starting from a zero-initialized state, a pass over the user query produces u\mathbf{u}. We then compute the souped initialization as s0=∑i=1kσ(ki⋅u)si\mathbf{s}_0 = \sum_{i=1}^{k}\sigma(\mathbf{k}_i\cdot\mathbf{u})\mathbf{s}_i, with weighting function σ(⋅)\sigma(\cdot). The linear readout and base model are jointly finetuned. See Figure 1c for an illustration of this1. Unlike a Transformer’s token-level attention, this procedure assigns one scalar weight per chunk, shared across all layers and heads and computed once from the original user query. The weights remain fixed during query processing and generation.

For σ\sigma, we use the softmax function with cosine-normalized scores (see Appendix § 11 for details). We also explore sparse souping, an efficient variant in which we mask at inference time all but the top-NtopN_{\mathrm{top}} logits before softmax, retaining normalized weights while avoiding retrieving zero-weight states. Masked states do not need to be retrieved, providing significant efficiency advantages for sparse souping (§ 4.2). Other reasonable choices of weighting functions include sigmoidal and linear weights, though we find that softmax performs best in our experiments.

Experiments

We use a 1.5B Mamba-2 SSM (Dao & Gu, [5]) and compare softmax-weighted, sparse, and mean souping against sequential Mamba-2 and a matched Transformer with rotary positional encodings (Su et al., [41]).

We evaluate our models across a diverse range of tasks. For document QA, we use SQuAD (Rajpurkar et al., [32]) for single-hop; HotpotQA (Yang et al., [52]) and MuSiQue (Trivedi et al., [45]) for multi-hop. For NIAH and variable tracking, we use RULER (Hsieh et al., [13]). For tool use, we use the Berkeley Function Calling Leaderboard (BFCL) (Patil et al., [30]). To probe long-context performance on document QA and BFCL, we augment the input with additional distractors and plot performance for varying pool size kk. If kk is smaller than the number of gold documents or gold tool definitions (relevant only for the k=1k = 1 datapoints), then the input consists only of gold samples. This suite tests selective retrieval and reasoning as the available context grows, crowding the relevant chunks with increasingly more distractors. Our models are finetuned to each task, using either the task-provided official training split (for document QA), a specialized post-training corpus (for tool use), or a disjoint subset of examples (for RULER). See Appendix § 11 for additional details on training, evaluation, and our benchmarks.

Benchmark results

Figure 2 summarizes the main results; Appendix § 9 reports on additional metrics and task subsets.

Weighted state souping benchmark results

Figure 2. Weighted state souping benchmark results. Vertical gray dashed lines indicate the max pool size or context length observed during training. (a - c) Single-hop (SQuAD) and multi-hop (HotpotQA, MuSiQue) benchmarks. We plot accuracy as an exact match between the gold answer span and the model prediction. Dotted lines represent closed book accuracy, where no documents are prompted in-context. Sparse souping keeps top Ntop=4N_{\mathrm{top}}=4 chunks. (d,e) NIAH subsets of RULER. In the easy version, a single needle consisting of a random number is hidden among a natural language haystack of variable size. In the hard version, the haystack consists entirely of needle-like distractors, requiring precise retrieval. Sparse souping keeps top Ntop=20N_{\mathrm{top}}=20 chunks. (e) Variable tracking subset of RULER. The input consists of random variable assignments embedded in random noise sentences, and the model must infer the correct value of a randomly chosen variable. Sparse souping keeps top Ntop=20N_{\mathrm{top}}=20 chunks. (f) Simple Python subset of BFCL. The model is prompted with a list of Python functions and descriptions, and must execute a correct function call given a user query. Sparse souping keeps top Ntop=4N_{\mathrm{top}}=4 chunks. (g) Parallel subset of BFCL. The setup is the same as in (f), but the model needs to execute the function multiple times.

In general, weighted state souping performs strongly even at large pool size kk. While mean souping and sequential Mamba tend to deteriorate as the number of chunks increases, weighted souping matches their performance at small kk, and persists in near-constant performance as kk increases to several times beyond the max training size. This phenomenon persists across a diversity of tasks and benchmarks, including in multi-hop settings like HotpotQA, MuSiQue, and RULER variable tracking where the model must link information across multiple chunks. Similar to other works ([23, 56]), we observe that Transformers do not extrapolate well to sequences longer than the training data, though their in-distribution performance tends to be strong.

Interestingly, sparse souping matches or improves on full softmax souping, particularly on multi-hop QA (HotpotQA, MuSiQue). Softmax mass may diffuse across many documents as kk increases. Sparse souping instead may beneficially concentrate attention in the most relevant indices. An analogous benefit has been observed in sparse attention for Transformers ([47, 54] (Vaslyenko et al. 2025)). One weakness of sparse souping is the need to specify the number of chunks NtopN_{\mathrm{top}} to keep. If NtopN_{\mathrm{top}} is insufficiently large, critical chunks may be dropped and the model’s performance suffers (Figure 5f). Designing a weighting function with adaptive sparsity represents an interesting avenue for further exploration.

Ruler benchmark, additional results

Figure 5. Ruler benchmark, additional results. In the main text, we present results on needle-in-a-haystack (a,b) and variable tracking (c). We additionally plot a sweep over the number of chunks NtopN_{top} kept by the sparse souping model in (d - f). For the NIAH tasks, where only a single chunk is relevant, the value of NtopN_{top} is irrelevant. However, for the variable tracking task, relevant variable assignments are distributed across many more chunks, so below a certain threshold, the model fails to learn the task well.

While the performance of weighted souping is generally strong, it underperforms at small kk in the parallel multiple subset of BFCL, despite strong performance on python simple and parallel (Figure 6). Whether this reflects an optimization issue or a fundamental limitation remains open.

BFCL benchmark, additional results

Figure 6. BFCL benchmark, additional results. In the main text, we present results on the Python Simple split of BFCL (a), in which the model must produce a single tool call given a list of tool definitions and a user query. Here, we also plot performance on the Parallel split (the model must call a single tool multiple times) and the Parallel Multiple split (the model must call multiple tools multiple times). We measure accuracy by BFCL’s built-in abstract syntax tree (AST)-based checker (a - c) as well as a match based on function name alone (d - f). In general, weighted souping performs well for both Python Simple and Parallel, but a substantial gap opens on small, in-distribution KK for Parallel Multiple. Mean souping performs better than weighted souping at K=1K = 1 (where only gold tool definitions are prompted), indicating that souping may still work well, but the model is struggling to simultaneously learn appropriate weights and use a souped state initialization.

Computational efficiency

The primary computational advantage of souping is in its ability to cheaply retrieve a state encoding from memory, rather than autoregressively re-encoding every input. Since inputs like memory artifacts and tool definitions change slowly, their state encodings may be routinely cached for future retrieval. Hence, a souped model may be considerably faster than non-souped alternatives, particularly as the context length grows.

Theory: retrieval and composition

Figure 3 compares the measured time to encode an input between souping, Mamba, and Transformer models. See Figure 7 for additional timings.

Computational cost of souping

Figure 3. Computational cost of souping. We measure the time it takes to encode a set of input chunks on an AWS H100 node. For the souping models, we include the time it takes to encode a 128 token query and compute the softmax weights. The state encodings are retrieved from either GPU high bandwidth memory (HBM), system RAM, or system disk. We plot a subset of timings here, with the full results in Figure 7. We include two sparse souping variants, one that keeps the top Ntop=4N_{\mathrm{top}} = 4 documents and another that keeps the top Ntop=32N_{\mathrm{top}} = 32. (a) We hold the chunk length fixed at L=512L = 512 tokens and increase the total number of chunks. Encoding time therefore grows linearly with increasing chunks for all models. For the HBM model, at low KK encoding the query dominates the encoding time, resulting in a flat trend. (b) We hold the number of chunks fixed at K=8K = 8 and increase the length of each chunk. Since the number of chunks is constant, souping retrieves the same number of chunks for each query, resulting in a flat trend across all LL where the height is controlled by retrieval speed.

Additional measurements on encoding time across models

Figure 7. Additional measurements on encoding time across models. We plot additional sets of timings beyond those shown in Figure 3. In particular, we show full timings measured for full and sparse souping models retrieving from HBM (a, b), system RAM (c, d), and system disk (e, f). The timings for Transformer and sequential Mamba models in the main text are computed with batch size of 1. To give a sense for what the compute-bound timings look like, we plot the per-example timing for batch size 32 for Transformer and sequential Mamba models (dashed lines).

There are a number of further considerations for souping. 1) Weighted souping must also factor in the time to perform an initial pass over the user query to generate a query vector, and the time it takes to compute the weightings. For a fixed key dimension, scoring and normalizing the weights costs O(k)O(k) per query. Once the soup is constructed, the cost per generated token is constant with respect to kk, since generation does not access the cached chunks again. In general, user queries average under 100 tokens ([55]) and computing softmax weights is extremely fast, so the total added cost of computing the weights is typically negligible and amortized over the number of input chunks. 2) The retrieval time is heavily influenced by the specific memory holding the cached state encodings. GPU HBM is significantly faster than system RAM, which in turn is faster than system disk. Depending on where the encodings live, retrieval may in the worst case be slower than encoding from scratch. 3) Sparse souping improves efficiency further, since chunks assigned zero weight do not need to be retrieved. Hence, if the number of nonzero weights is constant with respect to the context length (which is true in our setting), then the encoding performance of sparse souping is effectively constant as context length grows2^{2}.

Theory: retrieval and composition

The experiments in § 4 provide the main evidence for the effectiveness of weighted state souping. To complement these empirics, we present a simple theoretical analysis that begins to answer the questions of why souping works, and what potential strengths and weaknesses it may have compared with sequential models. Our arguments are primarily expressivity-based: we provide constructions showing that both souping and sequential models can implement an induction-head retrieval task representative of our empirical benchmarks. We also discuss possible weaknesses that independent chunk encoding introduces, namely a sensitivity to chunk boundaries and the inability to encode cross-chunk representations. We conclude with a discussion of the benefits weighted souping has for retrieval over long, crowded contexts. Our analysis is by no means a complete theoretical account of state souping. Instead, we introduce simple intuitions that build towards a principled understanding of the method.

Task

We study a key-value version of the induction-head retrieval task (Olsson et al., [27]) and its multi-hop extension (Sanford et al., [35]).

Let [N]={1,…,N}[N] = \{1, \ldots, N\}, and introduce disjoint key and value vocabularies K={ka:a∈[N]}\mathcal{K} = \{k_a : a \in[N]\} and V={va:a∈[N]}\mathcal{V} = \{v_a : a \in[N]\}. An input context defines a partial function f:[N]→[N]f : [N] \to[N] by listing pairs (ka,vf(a))(k_a, v_{f(a)}), with each key appearing at most once. Given a query kqk_q, the nn-hop induction target is

yn(f,q)=vfn(q),y_n(f,q) = v_{f^n(q)},

whenever f(q),…,fn(q)f(q), \ldots, f^n(q) are defined. Thus one hop retrieves the value paired with kqk_q; each subsequent hop uses the index of the retrieved value as the next key. The input context is presented to the model as concatenation of all pairs followed by the query,

ka,vf(a),kb,vf(b),…,kq.k_a, v_{f(a)}, k_b, v_{f(b)}, \ldots, k_q.

A sequential model reads this sequence in one pass. A souping model encodes each pair independently. A chain of length nn is a sequence of distinct indices a0,…,ana_0,\ldots,a_n with f(ai)=ai+1f(a_i)=a_{i+1}. Multiple chains and irrelevant pairs may appear in the context. Pair order is arbitrary except in the explicitly ordered setting below.

Model

We consider a stripped-down linear attention SSM with Mamba-like history decay and augmented residuals. Let z1,…,zTz_1,\ldots,z_T be the tokens and let e(zt)∈Rde(z_t) \in\mathbb{R}^{d} be orthonormal vocabulary embeddings, with d≥2Nd \ge2N. Initialize the residual stream as rt(0)=[e(zt);0]∈R2dr_t^{(0)}=[e(z_t);0]\in\mathbb{R}^{2d}. At layer ℓ∈[D]\ell\in[D], a causal width-two convolution copies the previous and current residual vectors into separate coordinates:

xt(ℓ)=[I2d0]rt−1(ℓ−1)+[0I2d]rt(ℓ−1)=[rt−1(ℓ−1)rt(ℓ−1)]∈R4d.(1)x_t^{(\ell)} = \begin{bmatrix} I_{2d}\\ 0 \end{bmatrix} r_{t-1}^{(\ell-1)} + \begin{bmatrix} 0\\ I_{2d} \end{bmatrix} r_t^{(\ell-1)} = \begin{bmatrix} r_{t-1}^{(\ell-1)}\\ r_t^{(\ell-1)} \end{bmatrix} \in\mathbb{R}^{4d}. \tag*{(1)}

This is the copying role of the convolution identified by Huang et al. [14]. We then perform the SSM state update as

Ht(ℓ)=αHt−1(ℓ)+(Wk(ℓ)xt(ℓ))(Wv(ℓ)xt(ℓ))⊤,ht(ℓ)=(Ht(ℓ))⊤Wq(ℓ)xt(ℓ).(2)H_t^{(\ell)}=\alpha H_{t-1}^{(\ell)}+\left(W_k^{(\ell)}x_t^{(\ell)}\right)\left(W_v^{(\ell)}x_t^{(\ell)}\right)^\top,\qquad h_t^{(\ell)}=\left(H_t^{(\ell)}\right)^\top W_q^{(\ell)}x_t^{(\ell)}. \tag*{(2)}

where Ht(ℓ)∈Rd×dH_t^{(\ell)}\in\mathbb{R}^{d\times d} is the SSM state; Wk(ℓ),Wv(ℓ),Wq(ℓ)∈Rd×4dW_k^{(\ell)},W_v^{(\ell)},W_q^{(\ell)}\in\mathbb{R}^{d\times4d} are the key, value, and query projections; and α∈(0,1]\alpha\in(0,1] is the history decay. We omit bias terms.

The residuals are updated as

rt(ℓ)=rt(ℓ−1)+Woht(ℓ),Wo=[0Id].r_t^{(\ell)}=r_t^{(\ell-1)}+W_oh_t^{(\ell)},\qquad W_o= \begin{bmatrix} 0\\ I_d \end{bmatrix}.

In this way, rt(ℓ)=[e(zt);ut(ℓ)]r_t^{(\ell)}=[e(z_t);u_t^{(\ell)}] preserves the token embedding in the first block and accumulates updates in the second block.

The final output logits produced by the model are UuT(D)Uu_T^{(D)}, where U∈RN×dU\in\mathbb{R}^{N\times d} is the readout matrix. To extract a concrete next-token prediction, we take the argmax over these logits.

Sequential encoding starts from zero-initialized recurrent states and a zero convolution buffer. For souping, each chunk cic_i is encoded independently from zero at every layer, giving states Hi(ℓ)H_i^{(\ell)}. The query then starts from the weighted, souped initialization Hinit(ℓ)=∑i=1KwiHi(ℓ)H_{\mathrm{init}}^{(\ell)}=\sum_{i=1}^{K}w_iH_i^{(\ell)}, with its convolution buffer reset to zero. The weights wiw_i are shared across layers and fixed during query processing. Unless stated otherwise, chunk encoding and weighting have no access to the chunks’ original positions: permuting the chunks permutes their weights and leaves the soup unchanged. This assumption is accurate of mean and content-based softmax souping. Our discussion below focuses on expressivity rather than strict learnability, and assumes exact arithmetic and suitably chosen positive weights.

Remark 1. Linear states permit souping. For a single layer with matching convolution resets, sequential encoding equals a weighted sum of independently encoded chunk states.

There is a simple algebraic reason that states from this model can be souped. Split a context into chunks c1,…,cKc_1,\ldots,c_K of lengths m1,…,mKm_1,\ldots,m_K, and let H(ci)H(c_i) be the final state obtained by encoding cic_i from zero. Let Hseq(c1∥⋯∥cK)H_{\mathrm{seq}}(c_1\Vert\cdots\Vert c_K) be the final state obtained by encoding the concatenated sequence of chunks. If we reset the convolution at the same boundaries in both schemes, then unrolling (2) gives

Hseq(c1∥⋯∥cK)=∑i=1Kα∑j>imjH(ci).(3)H_{\mathrm{seq}}(c_1\Vert\cdots\Vert c_K)=\sum_{i=1}^{K}\alpha^{\sum_{j>i}m_j}H(c_i). \tag*{(3)}

Thus a sequential linear state is itself a weighted soup of that layer’s chunk states, an identity also observed in prior state-composition work [21]. With α=1\alpha=1 and a one layer model, sequential and souping are functionally equivalent.

However, there are a few important differences to keep in mind. On one hand, learned state souping replaces the fixed recency weights α∑j>imj\alpha^{\sum_{j>i}m_j} in (3) with content-dependent weights, permitting selection based on relevance rather than position. On the other hand, independently encoded chunks cannot incorporate information from other chunks during encoding. Particularly when a model has two or more layers, its sequential upper-layer representations may therefore differ from its independently encoded representations, potentially impacting efficiency when cross-chunk representations would be advantageous (see Remark 5 below).

One-hop induction

We begin by considering the one-hop induction-head task, reflecting the setting in Olsson et al. [27]. We observe that both a sequential and souping model can solve the task, but chunk boundaries that separate the task’s key-value pairs can make souping fail.

Proposition 2. Suppose that every key-value pair is contained in one chunk, each key occurs at most once, and the queried pair’s chunk receives positive soup weight. A single layer model with sufficient width (§ 6.2) solves one-hop induction for both sequential encoding and weighted state souping.

See Section B.1 for the construction proving this statement. Proposition 2 demonstrates that even a single-layer SSM is sufficiently expressive to perform one-hop induction. Together with our earlier discussion in Remark 1, we observe that both souping and sequential models can readily perform in-context retrieval. However, souping is sensitive to chunk boundaries, as we establish in the next proposition.

Proposition 3. Suppose that chunk boundaries split every key-value pair (i.e. every token is encoded as a separate chunk). Then no souping model solves all one-hop induction instances.

Proof. Choose distinct indices aa, bb, uu, vv. Consider the two token sequences

C=(ka,vu,kb,vv),y1(C,a)=vu,C′=(ka,vv,kb,vu),y1(C′,a)=vv.\begin{aligned} C &= (k_a, v_u, k_b, v_v), \qquad y_1(C, a) = v_u,\\ C' &= (k_a, v_v, k_b, v_u), \qquad y_1(C', a) = v_v. \end{aligned}

After splitting into singleton chunks, both inputs have the same multiset {ka,kb,vu,vv}\{k_a, k_b, v_u, v_v\}. For the same query, souping therefore produces the same state for CC and C′C'. Hence, the model must return the same output on both inputs, though their labels differ, failing the task on at least one input. □

The setting in Proposition 3 is extreme, but underlines the sensitivity of souping to correctly formed chunks. However, this does not mean that souping cannot link information between chunks — our multi-hop document QA and variable tracking experiments demonstrate that souping models can robustly link information across multiple chunks. In the next section, we observe that souping can readily link disparate chunks when performing the multi-hop generalization of our task.

Multi-hop induction

We consider the multi-hop generalization of our induction-head task. We discuss how souping can continue linking information between chunks to solve the task, though under certain circumstances, it may be less efficient that a sequential input model.

Proposition 4. Suppose that every key-value pair is contained in one chunk, each key occurs at most once, and every chunk containing an edge of the queried nn-hop path receives positive soup weight. Souping and sequential models can solve the nn-hop induction task by composing the construction in Proposition 2 across nn layers.

See Section B.2 for the construction proving this statement. In this way, we establish the basic competency of souping models to solve these classic in-context retrieval tasks. However, one advantage sequential models retain over souping is their ability to learn cross-chunk representations in deeper layers. Because souping encodes chunks independently, it remains impossible to directly encode information between chunks in deeper layers. This expressivity difference may lead to capability separations between sequential and souping models.

For instance, suppose the inputs to our multi-hop induction task are favorably ordered. Consider CC node-disjoint chains presented consecutively in forward order, with each chain taking the form

(kac,0,vac,1), (kac,1,vac,2), …, (kac,n−1,vac,n).(4)(k_{a_{c,0}}, v_{a_{c,1}}),\ (k_{a_{c,1}}, v_{a_{c,2}}),\ \ldots,\ (k_{a_{c,n-1}}, v_{a_{c,n}}). \tag*{(4)}

Suppose the query always names a chain’s beginning and asks for its nn-hop endpoint. Then we observe the following.

Remark 5. For the ordered, endpoint-only task with n=2Ln = 2^{L} and α=1\alpha= 1, an L+1L + 1-layer sequential model can form a final-layer state containing only the CC start-to-end associations, effectively compressing the sequence. Souping models that independently encode single pairs in isolation cannot implement this same compression.

The construction is given in Section B.3. Each of the first LL layers stores reverse associations whose hop length doubles with depth, allowing later tokens to identify earlier nodes in their chain. The final layer then writes

Hend=∑c=1Ce(kac,0)e(vac,n)T,H_{\mathrm{end}} = \sum_{c=1}^{C} \mathbf{e}(k_{a_c,0})\mathbf{e}(v_{a_c,n})^{\mathsf{T}},

so a query at a chain start directly retrieves its endpoint. Independently encoding a single pair cannot perform this cross-chunk preprocessing, though souping can still compose the original relations at query time as in Proposition 4.

A simple counting argument clarifies why the number of retained associations matters for storage.

Proposition 6. A fixed BB-bit state that must recover mm associations in [N][N] requires B≥⌈mlog⁡2N⌉B \ge\lceil m \log_{2} N \rceil, for N≥2N \ge2.

Proof. There are NmN^{m} possible assignments. Distinct assignments must yield distinct states, since they disagree on at least one query. Thus 2B≥Nm2^{B} \ge N^{m}. Taking the log of both sides results in the desired bound B≥⌈mlog⁡2N⌉B \ge\lceil m \log_{2} N \rceil, for N≥2N \ge2.

For the ordered task, the final summary retains CC endpoint associations instead of all CnCn edges. Hence, Proposition 6 suggests that the SSM state for a sequential model could be smaller than that of a souping model to learn a task with a fixed number of chains CC and hops nn. Indeed, to learn CnCn associations, a souping model would require B=Cnlog⁡2NB = Cn \log_{2} N bits, whereas a sequential model needs a factor of nn fewer with just B=Clog⁡2NB = C \log_{2} N bits.

More generally, sequential encoding may permit useful composed representations in deeper layers. The doubling construction is similar in spirit to the pointer-doubling strategy of Sanford et al. [35], and gives a logarithmic-depth sequential solution in this ordered setting. We conjecture that this may yield a depth separation from souping under suitable width and precision constraints.

Weighted state souping permits selective retrieval

While souping may be sensitive to chunk boundaries and exhibit less efficiency for favorably ordered inputs, weighted souping nonetheless retains a decisive advantage over sequential models for long-context retrieval. Poor long-context performance can be understood as a consequence of gating and noisy contexts. In a sequential model with Mamba-like history decay, a contribution at distance Δ\Delta is exponentially decayed by a factor αΔ\alpha^{\Delta}. Tong et al. [44] have formalized the resulting tradeoff: reducing decay preserves distant signals but permits distractor variance to accumulate, whereas stronger decay controls that variance at the cost of attenuating earlier tokens. Hence, no setting permits a sequential model to retrieve from every token in a long context with even reliability.

Weighted souping bypasses this tradeoff by permitting direct attention on the relevant chunks. In this scheme, distractor variance is determined only by the selected set of chunks rather than the full context size. Earlier chunks are not attenuated compared with later chunks, so weighting is computed evenly across the whole context. Provided that the weights remain concentrated as the number of distractors increases, weighted souping may maintain strong long-context performance when sequential and mean-souped variants fail. In some sense, weighted souping interpolates between recurrent accumulation and attention-like selection. It is not equivalent to full attention (souping weights are scalar, chunk-level, and computed once from the original query). Nonetheless, our experiments support the strong retrieval performance of weighted souping models. Together with their efficiency benefits, weighted state souping presents an attractive paradigm for future models.

Discussion

Weighted state souping augments reusable context encoding with query-dependent selection. A lightweight routing head combines cached chunk states into a fixed-size recurrent initialization, improving long-context performance across document QA, retrieval, variable tracking, and tool use benchmarks. The results show that a fixed state need not imply uniformly compressing the entire available collection: each query determines which information enters the working state. Inference-time sparsification often improves both accuracy and state-transfer cost, particularly beyond the training pool size. The theory complements these results by demonstrating retrieval and cross-chunk composition, while identifying information lost at chunk boundaries and discussing the potential advantages of sequential processing.

There remain many avenues for further exploration. Our focus in these experiments has been on single-turn interactions, but generalizing souping to multi-turn interactions featuring several rounds of back-and-forth between user and assistant remains an unexplored direction. There are also many opportunities for improving weighted state souping, for instance by replacing fixed-NN sparse souping with adaptive sparsity that adjusts to the problem, exploring alternative weighting schemes, or using thinking tokens in conjunction with souping. Our theoretical discussion offers initial intuitions for why state souping works and when it may fail, but there remain many opportunities for investigating potential memory and depth separations between souping and sequential models.

Acknowledgments

This work was performed while WLT was at Apple. WLT is supported by a Kempner Graduate Fellowship. CP is supported by an NSF CAREER Award (IIS-2239780), DARPA grants DIAL-FP-038 and AIQ-HR00112520041, the Simons Collaboration on the Physics of Learning and Neural Computation, and the William F. Milton Fund from Harvard University. This work has been made possible in part by a gift from the Chan Zuckerberg Initiative Foundation to establish the Kempner Institute for the Study of Natural and Artificial Intelligence. LLMs were used in implementing the experiments, assisting with proofs, and polishing the writing.

Additional figures

Four-panel line plots showing SQuAD-n benchmark results for n=3 and n=5

Figure 4. Squad-n benchmark results. As a further test of souping when the task requires attending to multiple documents, we construct a task based on SQuAD called SQuADSQuAD-nn. Each example consists of nn individual SQuAD document-question-answer sets. The model is prompted with all nn documents (mixed among max⁡(k−n,0)\max(k-n, 0) distractors) followed by the questions, and must produce the answer spans corresponding to each question. We plot both per-question exact match accuracy in (a, c) as well as joint accuracy in (b, d) for n=3n = 3 and n=5n = 5. Souping generally performs competitively with vanilla Mamba, and sparse souping in particular maintains long context generalization better than full souping. However, both Mamba and souping underperform Transformers on in-context KK in this setting. This may be in part due to the Transformer’s sharper ability to track its context, and determine which questions have already been answered and which require an answer still.

Constructions

We use the simplified SSM model in § 6 throughout. In the constructions below, each block matrix column has width dd, in the order [e(zt−1);ut−1(ℓ−1);e(zt);ut(ℓ−1)][\mathbf{e}(z_{t-1});\mathbf{u}_{t-1}^{(\ell-1)};\mathbf{e}(z_t);\mathbf{u}_{t}^{(\ell-1)}]. At a reset boundary, the previous residual vector is zero. Recurrent states are read after the current token’s write, as specified in (2).

One-hop retrieval

Proof. Let EK=[e(k1) ⋯ e(kN)]E_K=[\mathbf{e}(k_1)\ \cdots\ \mathbf{e}(k_N)] and EV=[e(v1) ⋯ e(vN)]E_V=[\mathbf{e}(v_1)\ \cdots\ \mathbf{e}(v_N)]. Orthogonality gives EK⊤EK=EV⊤EV=INE_K^\top E_K=E_V^\top E_V=I_N and EK⊤EV=0E_K^\top E_V=0. Define AK=EKEK⊤A_K=E_KE_K^\top and AV=EVEV⊤A_V=E_VE_V^\top, and use depth D=1D=1. The four block columns correspond to [e(zt−1);ut−1;e(zt);ut][\mathbf{e}(z_{t-1});\mathbf{u}_{t-1};\mathbf{e}(z_t);\mathbf{u}_t]. Choose

Wk(1)=[AK 0 0 0],Wv(1)=[0 0 AV 0],W_k^{(1)}=[A_K\ 0\ 0\ 0],\qquad W_v^{(1)}=[0\ 0\ A_V\ 0],
Wq(1)=[0 0 AK 0],U=EV⊤.(5)W_q^{(1)}=[0\ 0\ A_K\ 0],\qquad U=E_V^\top. \tag*{(5)}

Together with the stated embeddings, convolution, residual map WoW_o, zero initial state, zero biases, and any fixed α∈(0,1]\alpha\in(0,1], these choices specify all model parameters. We suppress the layer superscript below.

At a value token vf(a)v_{f(a)}, the previous token is kak_a, so the state increment is e(ka)e(vf(a))⊤\mathbf{e}(k_a)\mathbf{e}(v_{f(a)})^\top. At a key token, including the query, Wvxt=0W_v\mathbf{x}_t=0, so there is no write. At the query the state is therefore

Hq=∑a∈dom⁡(f)γae(ka)e(vf(a))⊤.H_q=\sum_{a\in\operatorname{dom}(f)}\gamma_a\mathbf{e}(k_a)\mathbf{e}(v_{f(a)})^\top.

For sequential encoding, γa=αT−ta\gamma_a=\alpha^{T-t_a}, where tat_a is the position of the value token and TT is the query position. For souping, if this pair lies in chunk i(a)i(a) and its value has local position ta,i(a)t_{a,i(a)}, then γa=wi(a)αmi(a)−ta,i(a)+1\gamma_a=w_{i(a)}\alpha^{m_{i(a)}-t_{a,i(a)}+1}. These coefficients include the decay at the query token. Orthogonality now gives hq=γqe(vf(q))\mathbf{h}_q=\gamma_q\mathbf{e}(v_{f(q)}). The residual update gives uq(1)=hq\mathbf{u}_q^{(1)}=\mathbf{h}_q because uq(0)=0\mathbf{u}_q^{(0)}=0, so Uuq(1)U\mathbf{u}_q^{(1)} has its only nonzero entry, γq>0\gamma_q>0, at coordinate f(q)f(q). Argmax returns the correct value. In the sequential model, continuous convolution across pair boundaries gives the same writes, since keys have zero value projection.

Multi-hop retrieval with additive residuals

Proof. Use the embedding matrices and AK,AVA_K,A_V from the one-hop proof, and let F=EKEV⊤F=E_KE_V^\top, so Fe(va)=e(ka)F\mathbf{e}(v_a)=\mathbf{e}(k_a). The four block columns below correspond to [e(zt−1);ut−1(ℓ−1);e(zt);ut(ℓ−1)][\mathbf{e}(z_{t-1});\mathbf{u}_{t-1}^{(\ell-1)};\mathbf{e}(z_t);\mathbf{u}_{t}^{(\ell-1)}]. In the first layer, use

Wk(1)=[AK 0 0 0],Wv(1)=[0 0 AV 0],W_k^{(1)}=[A_K\ 0\ 0\ 0],\qquad W_v^{(1)}=[0\ 0\ A_V\ 0],
Wq(1)=[0 0 AK 0].W_q^{(1)}=[0\ 0\ A_K\ 0].

Since ut(0)=0\mathbf{u}_t^{(0)}=0, this is the one-hop construction. Every context output is zero: a context key has not yet been written, and a value has zero query projection. At the final query, uq(1)=γqe(vf(q))\mathbf{u}_q^{(1)}=\gamma_q\mathbf{e}(v_{f(q)}).

Subsequent layers must add the next retrieval and subtract the previous working vector. This can be implemented by the attention block itself. Choose a fixed unit vector b=e(v1)\mathbf{b}=\mathbf{e}(v_1), orthogonal to all key embeddings, and let c=∑a=1Ne(ka)\mathbf{c}=\sum_{a=1}^{N}\mathbf{e}(k_a) and B=bc⊤B=\mathbf{b}\mathbf{c}^\top. Thus Be(ka)=bB\mathbf{e}(k_a)=\mathbf{b} and Be(va)=0B\mathbf{e}(v_a)=0. For ℓ≥2\ell\ge2, set

Wk(ℓ)=[AK 0 B 0],Wv(ℓ)=[0 0 AV −Id],W_k^{(\ell)}=[A_K\ 0\ B\ 0],\qquad W_v^{(\ell)}=[0\ 0\ A_V\ -I_d],
Wq(ℓ)=[0 0 B F].W_q^{(\ell)}=[0\ 0\ B\ F].

At context positions the working vectors remain zero: a value writes the original association and has zero query projection; a key has zero value projection and queries b\mathbf{b}, orthogonal to all association keys. Consequently, every layer’s context state contains precisely the original associations, for both sequential encoding and independently encoded chunks.

At the final query, write u=uq(ℓ−1)\mathbf{u}=\mathbf{u}_{q}^{(\ell-1)} and let

M=∑a∈dom⁡(f)γae(ka)e(vf(a))⊤M=\sum_{a\in\operatorname{dom}(f)}\gamma_{a}e(k_{a})e(v_{f(a)})^{\top}

be the context contribution after multiplying the initialized context state by α\alpha when processing the query token, with the same coefficients as in the one-hop proof. The query’s key, value, and query projections are respectively b\mathbf{b}, −u-\mathbf{u}, and Fu+bF\mathbf{u}+\mathbf{b}. Since the recurrence reads after the current write,

hq(ℓ)=(M−bu⊤)⊤(Fu+b)=M⊤Fu−u.\mathbf{h}_{q}^{(\ell)}=(M-\mathbf{b}\mathbf{u}^{\top})^{\top}(F\mathbf{u}+\mathbf{b})=M^{\top}F\mathbf{u}-\mathbf{u}.

Here M⊤b=0M^{\top}\mathbf{b}=0, b⊤Fu=0\mathbf{b}^{\top}F\mathbf{u}=0, and ∥b∥=1\lVert\mathbf{b}\rVert=1. The additive residual therefore gives uq(ℓ)=M⊤Fuq(ℓ−1)\mathbf{u}_{q}^{(\ell)}=M^{\top}F\mathbf{u}_{q}^{(\ell-1)}. Inductively,

uq(ℓ)=(∏j=0ℓ−1γfj(q))e(vfℓ(q)).\mathbf{u}_{q}^{(\ell)}=\left(\prod_{j=0}^{\ell-1}\gamma_{f_{j}(q)}\right)e(v_{f_{\ell}(q)}).

Use U=EV⊤U=E_{V}^{\top} and the same α\alpha at every layer. Every factor is positive, so the final readout identifies vfn(q)v_{f_{n}(q)}. □\square

Ordered-chain construction

We give the explicit construction for Remark 5. Let n=2Ln=2^{L}, and let the CC chains in (4) have mutually disjoint node sets, so C(n+1)≤NC(n+1)\le N. Set α=1\alpha=1 and use the orthogonal embeddings, residual path, and convolution from § 6. Convolution continues across pair boundaries in the sequential model. All recurrent states start at zero and all biases are zero. Write AK=EKEK⊤A_{K}=E_{K}E_{K}^{\top}, AV=EVEV⊤A_{V}=E_{V}E_{V}^{\top}, and F′=EKEV⊤F'=E_{K}E_{V}^{\top}, as in the retrieval proofs.

The first LL layers store reverse associations. Using the same block columns as in the proof of Proposition 4, set

Wk(1)=[0  0  F  0],Wv(1)=[AK  0  0  0],W_{k}^{(1)}=[0\ \ 0\ \ F\ \ 0],\qquad W_{v}^{(1)}=[A_{K}\ \ 0\ \ 0\ \ 0],
Wq(1)=[0  0  AK  0].W_{q}^{(1)}=[0\ \ 0\ \ A_{K}\ \ 0].

For 2≤ℓ≤L2\le\ell\le L, let G=F⊤G=F^{\top} and set

Wk(ℓ)=[0  0  F+G  0],Wv(ℓ)=[0  Id  0  −Id],W_{k}^{(\ell)}=[0\ \ 0\ \ F+G\ \ 0],\qquad W_{v}^{(\ell)}=[0\ \ I_{d}\ \ 0\ \ -I_{d}],
Wq(ℓ)=[0  0  G  Id].(6)W_{q}^{(\ell)}=[0\ \ 0\ \ G\ \ I_{d}]. \tag*{(6)}

Working vectors at value tokens remain zero, whereas those at key tokens lie in the key-embedding span. In the first layer, each value token writes its reverse one-hop association using the preceding key’s original embedding. For ℓ≥2\ell\ge2, a value token va,c,jv_{a,c,j} writes the reverse association with key e(ka,c,j)e(k_{a,c,j}) and value equal to the preceding key’s working vector. A key token kak_a instead writes −e(va)(ut(ℓ−1))⊤-e(v_a)(\mathbf{u}_{t}^{(\ell-1)})^{\top} and queries ut(ℓ−1)+e(va)\mathbf{u}_{t}^{(\ell-1)}+e(v_a). The value-embedding direction e(va)e(v_a) is orthogonal to all reverse-association keys and to the cancellation keys at earlier context positions, since each context key is unique. Its current write therefore subtracts exactly ut(ℓ−1)\mathbf{u}_{t}^{(\ell-1)} from the attention output. After residual addition, the working vector contains only the newly retrieved reverse jump. These fixed key and value spans suffice at every layer.

Index edges by j=1,…,nj=1,\ldots,n, so edge jj is (ka,c,j−1,va,c,j)(k_{a,c,j-1},v_{a,c,j}). Let uc,j(ℓ)\mathbf{u}_{c,j}^{(\ell)} denote the working vector at the key token of edge jj in chain cc, for ℓ≥1\ell\ge1. We claim

uc,j(ℓ)={e(ka,c,j−2ℓ),j≥2ℓ,0,j<2ℓ.(7)\mathbf{u}_{c,j}^{(\ell)}= \begin{cases} e(k_{a,c,j-2^{\ell}}), & j\ge2^{\ell},\\ 0, & j<2^{\ell}. \end{cases} \tag*{(7)}

For the base case ℓ=1\ell=1, the key token of edge jj is ka,c,j−1k_{a,c,j-1}. For j≥2j\ge2, the preceding edge has already written the reverse association from ka,c,j−1k_{a,c,j-1} to ka,c,j−2k_{a,c,j-2}; for j=1j=1 no such association exists. This proves the stated base case. For ℓ≥2\ell\ge2, suppose the claim holds for layer ℓ−1\ell- 1. Put s=2ℓ−1s = 2^{\ell-1}. At the value token of edge jj, layer ℓ\ell writes

{e(kac,j)e(kac,j−s)⊤,j≥s,0,j<s.\begin{cases} \mathrm{e}(k_{ac,j})\mathrm{e}(k_{ac,j-s})^{\top}, & j \ge s, \\ 0, & j < s. \end{cases}

The component of the state addressed by key embeddings therefore stores reverse jumps of length ss. At the key token of edge jj, the corresponding query component is e(kac,j−s)\mathrm{e}(k_{ac,j-s}) when j≥sj \ge s. If j≥2sj \ge2s, edge j−sj-s has already been processed, so its reverse association returns e(kac,j−2s)\mathrm{e}(k_{ac,j-2s}). For s≤j<2ss \le j < 2s, no matching association has been written; for j<sj < s, this query component is zero. Both cases give zero retrieval. In layers ℓ≥2\ell\ge2, the additional query component cancels the incoming working vector as described above. Orthogonality and disjoint chain nodes exclude all other matches, proving (7) after residual addition.

For L≥1L \ge1, the final layer writes forward endpoint associations. Set

Wk(L+1)=[0 AK 0 0],Wv(L+1)=[0 0 AV 0],W_k^{(L+1)} = [0\ A_K\ 0\ 0], \qquad W_v^{(L+1)} = [0\ 0\ A_V\ 0],
Wq(L+1)=[0 0 AK 0],U=EV⊤.W_q^{(L+1)} = [0\ 0\ A_K\ 0], \qquad U = E_V^{\top}.

By (7), the preceding key’s working vector is nonzero only for j≥2L=nj \ge2^L = n. Thus only the final edge of each chain writes to this layer, producing

Hend=∑c=1Ce(kac,0)e(vac,n)⊤.H_{\mathrm{end}} = \sum_{c=1}^{C} \mathrm{e}(k_{ac,0})\mathrm{e}(v_{ac,n})^{\top}.

At a chain-start query, every reverse layer returns zero: no reverse association points back from a chain start, and the earlier occurrence of this start wrote no cancellation term. Hence the query enters the final layer with zero working vector, writes zero, and uses its original key embedding to retrieve the appropriate endpoint. The readout UU identifies that value. For example, four-hop retrieval uses two reverse layers, storing jumps of lengths one and two, followed by a final layer associating each chain start with its four-hop endpoint.

Implementation details

Tasks

Across the document-QA and tool-use benchmarks we probe long-context robustness with a shared pooling construction. Each example carries one or more gold items — the documents or tool definitions required to answer the query — which we always retain; we then add sampled distractors until the pool holds kk items in total and shuffle so the gold position is randomized. Thus kk counts the total number of in-context chunks (not the number of distractors), and k=1k = 1 denotes a gold-only pool. Distractors are drawn without replacement from a split-local pool that excludes the example’s own gold items, so training and evaluation distractors never cross split boundaries. During finetuning the pool size is sampled per example as k∼Uniform⁡[1,kmax⁡]k \sim\operatorname{Uniform}[1, k_{\max}]; at evaluation we sweep kk well beyond kmax⁡k_{\max} to test generalization. All tasks share the Nemotron-Nano tokenizer ([26]) (vocabulary size 131,072) and are evaluated on the public validation split (the official test splits are hidden). RULER is handled differently, as described below.

Berkeley Function Calling Leaderboard (BFCL). A standard tool-use benchmark ([30]): the model is prompted with a list of tool definitions and must emit a tool call that solves the user query. Before evaluation we finetune each model for tool calling on a filtered subset of NVIDIA’s Nemotron agentic SFT data ([26]), keeping the ≈228,700\approx228{,}700 examples whose first assistant turn is a tool call. We evaluate on BFCL, reporting the simple python (one function, one call; 400 examples), parallel (one function, multiple calls; 200 examples), and parallel multiple (multiple functions, multiple calls; 200 examples) splits. Tool pools are built with a global BM25 retriever ([33]) over the ≈14,700\approx14{,}700-tool non-live vocabulary: candidate tools are scored by BM25, truncated to the top kk, and the gold tool(s) are then force-included and randomly positioned. Training samples k∼Uniform⁡[1,24]k \sim\operatorname{Uniform}[1, 24]; the headline evaluation sweeps k∈{1,12,24,36,48,64,96,128}k \in\{1, 12, 24, 36, 48, 64, 96, 128\}. Correctness is scored by BFCL’s abstract-syntax-tree checker, which validates the function name and every argument value against the reference-answer set. We additionally report an order-independent function-name-only match.

Stanford Question Answering Dataset (SQuAD). A single-document extractive QA dataset ([32]): given a Wikipedia paragraph, the model quotes a text span answering the query. We use SQuAD v1.1 and draw distractor paragraphs from the same split. Training uses k∼Uniform⁡[1,24]k \sim\operatorname{Uniform}[1, 24]; evaluation sweeps k∈{1,12,24,36,48,64,96,128}k \in\{1, 12, 24, 36, 48, 64, 96, 128\} over a fixed subset of 500 validation questions (shared across all arms via a common seed). We report exact match (EM) accuracy under SQuAD normalization (lowercasing, and removal of punctuation, articles, and extra whitespace). Dotted lines in the figures report closed-book accuracy (k=0k = 0, no documents in context) as a memorization floor.

HotpotQA. A multi-hop QA dataset ([52]). Each context paragraph becomes one document, and the annotated supporting paragraphs are marked gold (a multi-gold example). Pooling, evaluation kk-sweep, example count, and metrics match SQuAD.

MuSiQue. A multi-hop QA dataset engineered to require genuine reasoning over many hops and to resist single-document shortcuts ([45]); it is a harder version of HotpotQA. We use the answerable variant (musique_ans), treating the annotated supporting paragraphs as gold and scoring against the gold answer and its aliases. Pooling, evaluation kk-sweep, example count, and metrics match SQuAD.

SQuAD-nn. To further stress multi-document attention, we construct SQuAD-n: we merge nn SQuAD examples with distinct gold paragraphs into a single example whose prompt contains all nn gold paragraphs (mixed among max⁡(k−n,0)\max(k-n, 0) distractors) followed by the nn questions, labeled (1) … (n); the model must return the nn answer spans in order. We use n∈{3,5}n \in\{3, 5\}. We report micro-averaged EM over all (example, sub-question) pairs, and a strict joint EM that credits an example only when every sub-answer is an exact match.

RULER. A synthetic long-context benchmark ([13]). We use an in-repository reimplementation of its tasks and focus on three subtasks: single-needle-in-a-haystack (a magic-number “needle” line hidden among Paul Graham essays), multi-key NIAH (the needle is hidden among confusable distractor needles), and variable tracking (chains of variable assignments embedded in filler text, where the model resolves the value of a queried variable by following a four-hop chain). Unlike the QA and tool-use tasks, RULER has no natural chunks and no distractor pool; following Jafari et al. [15] we chunk each input into consecutive 256-token blocks, so the “pool size” is ⌈context length/256⌉\lceil\text{context length}/256\rceil and grows with the context. A block is treated as gold if its token span overlaps a needle sentence (NIAH) or an assignment in the queried chain (variable tracking). We cap the training context at 2048 tokens (8 chunks) and evaluate at context lengths {1,2,4,8,16,32,64,128}\{1, 2, 4, 8, 16, 32, 64, 128\}K tokens over 200 examples per (subtask, length).

Models

Architectures. Our SSM is a 1.5B-parameter Mamba-2 model (Dao & Gu [5]): 32 Mamba-2 mixer layers (with no interleaved attention or MLP blocks), hidden size 2048, RMSNorm, and no positional embedding. Each mixer uses a state-expansion factor of 2 (inner dimension 4096) partitioned into 64 heads of head dimension 64, state dimension 128, 8 groups, and a convolution kernel of width 4. The recurrent state is therefore 4096×128=524,2884096 \times128 = 524{,}288 elements per layer, or ≈16.8\approx16.8M elements (33.6 MB in bf16) across all 32 layers—this is the size of a single cached state encoding. Our Transformer is a 1.5B-parameter LLaMA-style model: 20 layers, hidden size 2048, SwiGLU feed-forward width 5504, 16 attention heads with full multi-head attention, rotary position embeddings, and RMSNorm. The two models are matched in parameter count (≈1.5\approx1.5B). Both are pretrained on the Nemotron-CC corpus (Su et al. [40]) (on the order of 300B tokens) with the same optimizer schedule (AdamW, peak learning rate 3×10−43 \times10^{-4}, cosine decay), share the Nemotron-Nano tokenizer, and run in bf16. We deliberately give the Transformer rotary embeddings so that it can process contexts longer than those seen in training, so that the sequential-Transformer baseline is given a fair chance at length generalization.

Weighted-souping read-out. We augment the SSM with a lightweight read-out head that produces the key and query vectors of § 4. Concretely, we read the last-token residual activation at the final decoder block and pass it through two learned linear projections Wk,Wq∈Rd×d′W_k, W_q \in\mathbb{R}^{d \times d'} with d=2048d = 2048 and d′=128d' = 128 (equivalently, a single projection to R2d′\mathbb{R}^{2d'} split into a key half and a query half). The two projections are separate parameters, initialized to identical values (Wk=WqW_k = W_q) so the head begins as the parameter-free cosine ranker over the base model’s activations; they are untied thereafter and trained independently. The head is the only component initialized from scratch; it is trained jointly with the base model but placed in its own optimizer group at learning rate base LR ×\times lr_scale, with lr_scale = 10.

Cosine normalization. The weight assigned to chunk ii is σ(score⁡i)\sigma(\operatorname{score}_i), where the score is a dot-product between the chunk key ki\mathbf{k}_i and the query vector u\mathbf{u}. Rather than the usual 1/d1/\sqrt{d} dot-product scaling, we ℓ2\ell_2-normalize the key and query and scale their cosine similarity by a learnable inverse temperature γ\gamma: score⁡i=γki⋅u∥ki∥∥u∥\operatorname{score}_i = \gamma\frac{\mathbf{k}_i \cdot\mathbf{u}}{\lVert\mathbf{k}_i \rVert\lVert\mathbf{u} \rVert}. We initialize γ=14\gamma= 14 and cap it at 100. Because the pre-nonlinearity logits are bounded to [−γ,γ][-\gamma,\gamma] regardless of pool size, the weighting stays well-conditioned as kk grows, which we found important for generalizing to pool sizes far beyond the training distribution. Our headline weighting function σ\sigma is the softmax.

Sparse souping. Sparse souping keeps only the top-NN weights and zeroes the rest; with softmax we apply the mask before the nonlinearity so the surviving weights still sum to one. It is applied at inference time and reuses the softmax checkpoints unchanged. We use Ntop=4N_{\mathrm{top}} = 4 for the document-QA and BFCL figures and Ntop=20N_{\mathrm{top}} = 20 for RULER; the larger NtopN_{\mathrm{top}} is needed for variable tracking, where gold information is spread across many chunks (we sweep NtopN_{\mathrm{top}} in Figure 5).

Auxiliary routing loss. We optionally supervise the weights toward the known gold chunks with an auxiliary loss, L=LSFT+λLaux\mathcal{L} = \mathcal{L}_{\mathrm{SFT}} + \lambda\mathcal{L}_{\mathrm{aux}}, where Laux\mathcal{L}_{\mathrm{aux}} is a cross-entropy over the kk chunks under softmax weighting, computed from the same scores used to combine the states. We set λ=1\lambda= 1 for RULER and tool use, where the gold chunks are reliably identifiable, and λ=0\lambda= 0 for document QA, where the head learns the weighting purely from the downstream SFT signal.

Souping finetuning. Finetuning is necessary to learn the souping format (Jafari et al., [15]). All souping models are finetuned from the pretrained base with the softmax weighting, residual read-out, and cosine normalization above. For document QA we train for 3 epochs (SQuAD, HotpotQA) or 5 epochs (MuSiQue) at base learning rate 5×10−65 \times10^{-6} with no auxiliary loss, from the train splits included with the benchmarks. For RULER we train for 6000 steps at base learning rate 10−510^{-5} with λ=1\lambda= 1, chunked at 256 tokens. For tool use we warm-start from a tool-calling-SFT checkpoint already finetuned on the Nemotron Agentic SFT split [26], and train for an additional one epoch at base learning rate 10−510^{-5} with λ=1\lambda= 1 to learn the souping format. In every case the read-out head uses the 10× learning-rate multiplier described above. The sequential baselines are finetuned on the concatenated input for matched steps at learning rate 10−510^{-5} (QA/RULER) or 5×10−55 \times10^{-5} (tool use), so that all models see matched data and compute.

Decoding and evaluation. All models decode greedily. For tool use, decoding is constrained by a tokenizer-level logit mask that enforces the tool-call envelope (<TOOLCALL>[ ... ]</TOOLCALL>); the constraint is applied identically to the souping arms and the sequential baselines. The QA and RULER tasks decode without constraints. Evaluation pool sizes, context lengths, and example counts are as given in Appendix § 11.§ 1.

Computational benchmark

The timings in Figure 3 are measured on a single AWS p5.48xlarge node (8×8 \times H100). We compare four inference paths: a sequential Transformer, a sequential Mamba, full weighted souping, and sparse souping. For the souping paths, we time the encoding of a 128-token query and the computation of the softmax weights, while the chunk state encodings themselves are retrieved rather than recomputed, from one of three memory tiers: GPU high-bandwidth memory (HBM), system RAM, or system disk. Each cached Mamba-2 encoding is the 33.6 MB bf16 state described above, so retrieval cost is dominated by the bandwidth of the tier in which the encodings live; retrieval from HBM is far faster than from RAM, which in turn is faster than from disk, and in the worst case (short chunks retrieved from disk) retrieval can be slower than re-encoding.

References

  1. [1]Yash Akhauri, Safeen Huda, and Mohamed S Abdelfattah. Attamba: Attending to multi-token states. arXiv preprint arXiv:2411.17685, 2024.
  2. [2]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 Proceedings of 12th International Conference on Learning Representations (ICLR). ICLR, 2024.arxiv.org/abs/2312.04927
  3. [3]Ali Behrouz, Zeman Li, Yuan Deng, Peilin Zhong, Meisam Razaviyayn, and Vahab Mirrokni. Memory caching: Rnns with growing memory. arXiv preprint arXiv:2602.24281, 2026.arxiv.org/abs/2602.24281
  4. [4]Yingfa Chen, Xinrong Zhang, Shengding Hu, Xu Han, Zhiyuan Liu, and Maosong Sun. Stuffed mamba: Oversized states lead to the inability to forget. arXiv preprint arXiv:2410.07145, 2024.arxiv.org/abs/2410.07145
  5. [5]Tri Dao and Albert Gu. Transformers are SSMs: Generalized models and efficient algorithms through structured state space duality. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pp. 10041–10071. PMLR, 2024. URL https://proceedings.mlr.press/v235/dao24a.html.arxiv.org/abs/2405.21060
  6. [6]Sabri Eyuboglu, Ryan Ehrlich, Simran Arora, Neel Guha, Dylan Zinsley, Emily Liu, Atri Rudra, James Y Zou, Azalia Mirhoseini, and Christopher Re. Cartridges: Lightweight and general-purpose long context representations via self-study. In International Conference on Learning Representations, volume 2026, pp. 42642–42687, 2026.arxiv.org/abs/2506.06266
  7. [7]Mikel L Forcada and Rafael C Carrasco. Learning the initial state of a second-order recurrent neural network during regular-language inference. Neural computation, 7(5):923–930, 1995.DOI
  8. [9]Anusha Madan Gopal, Aras Pirbadian, Kristofor D Carlson, M Anthony Lewis, and Jonathan Tapson. Structured memory for edge language models: Persistent context and corpus retrieval via o (1) ssm state injection. arXiv preprint arXiv:2608.02560, 2026.arxiv.org/abs/2608.02560
  9. [10]Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. In First Conference on Language Modeling, 2024. URL https://openreview.net/forum?id=tEYSkw1V2.arxiv.org/abs/2312.00752
  10. [11]Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Mingwei Chang. Retrieval augmented language model pre-training. In International conference on machine learning, pp. 3929–3938. PMLR, 2020.
  11. [12]Momchil Hardalov, Gonzalo Iglesias, and Adrià de Gispert. Cartridges at scale: Training modular kv caches over large document collections. arXiv preprint arXiv:2606.04557, 2026.arxiv.org/abs/2606.04557
  12. [13]Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia, Yang Zhang, 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=kIObc76Sy.arxiv.org/abs/2404.06654
  13. [14]Ningyuan Huang, Miguel Sarabia, Abhinav Moudgil, Pau Rodriguez, Luca Zappella, and Federico Danieli. Understanding input selectivity in mamba: impact on approximation power, memorization, and associative recall capacity. arXiv preprint arXiv:2506.11891, 2025.arxiv.org/abs/2506.11891
  14. [15]Yasaman Jafari, Zixian Wang, Leon Bergen, and Taylor Berg-Kirkpatrick. The surprising soupability of documents in state space models. arXiv preprint arXiv:2505.24033, 2025.arxiv.org/abs/2505.24033
  15. [16]Samy Jelassi, David Brandfonbrener, Sham M Kakade, and Eran Malach. Repeat after me: Transformers are better than state space models at copying. arXiv preprint arXiv:2402.01032, 2024.arxiv.org/abs/2402.01032
  16. [17]Wonjun Kang, Kevin Galim, Yuchen Zeng, Minjae Lee, Hyung Il Koo, and Nam Ik Cho. State-offset tuning: State-based parameter-efficient fine-tuning for state space models. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 474–487, 2025.arxiv.org/abs/2503.03499
  17. [18]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, pp. 5156–5165. PMLR, 2020.arxiv.org/abs/2006.16236
  18. [19]Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th symposium on operating systems principles, pp. 611–626, 2023.arxiv.org/abs/2309.06180
  19. [20]Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in neural information processing systems, 33:9459–9474, 2020.arxiv.org/abs/2005.11401
  20. [21]Tian Yu Liu, Alessandro Achille, Matthew Trager, Aditya Golatkar, Luca Zancato, and Stefano Soatto. Picaso: Permutation-invariant context composition with state space models. arXiv preprint arXiv:2502.17605, 2025.arxiv.org/abs/2502.17605
  21. [22]Enzhe Lu, Zhejun Jiang, Jingyuan Liu, Yulun Du, Tao Jiang, Chao Hong, Shaowei Liu, Weiran He, Enming Yuan, Yuzhi Wang, et al. Moba: Mixture of block attention for long-context llms. Advances in Neural Information Processing Systems, 38:17790–17815, 2026.arxiv.org/abs/2502.13189
  22. [23]Eran Malach, Omid Saremi, Sinead Williamson, Arwen Bradley, Aryo Lotfi, Emmanuel Abbe, Joshua Susskind, and Etai Littwin. To infinity and beyond: Tool-use unlocks length generalization in state space models. In International Conference on Learning Representations, volume 2026, pp. 44874–44900, 2026.arxiv.org/abs/2510.14826
  23. [24]Amirkeivan Mohtashami and Martin Jaggi. Random-access infinite context length for transformers. Advances in Neural Information Processing Systems, 36:54567–54585, 2023.DOI
  24. [25]Tsenduren Munkhdalai, Manaal Faruqui, and Siddharth Gopal. Leave no context behind: Efficient infinite context transformers with infini-attention. arXiv preprint arXiv:2404.07143, 2024.arxiv.org/abs/2404.07143
  25. [26]NVIDIA. NVIDIA nemotron nano 2: An accurate and efficient hybrid Mamba-Transformer reasoning model. arXiv preprint arXiv:2508.14444, 2025. doi: 10.48550/arXiv.2508.14444. URL https://arxiv.org/abs/2508.14444.
  26. [27]Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, et al. In-context learning and induction heads. arXiv preprint arXiv:2209.11895, 2022.arxiv.org/abs/2209.11895
  27. [28]Charles Packer, Vivian Fang, Shishir G Patil, Kevin Lin, Sarah Wooders, and Joseph E Gonzalez. Memgpt: towards llms as operating systems. 2023.arxiv.org/abs/2310.08560
  28. [29]Rui Pan, Zhuang Wang, Zhen Jia, Can Karakus, Luca Zancato, Tri Dao, Yida Wang, and Ravi Netravali. Marconi: Prefix caching for the era of hybrid llms. Proceedings of Machine Learning and Systems, 7, 2025.arxiv.org/abs/2411.19379
  29. [30]Shishir G. Patil, Huanzhi Mao, Fanjia Yan, Charlie Cheng-Jie Ji, Vishnu Suresh, Ion Stoica, and Joseph E. Gonzalez. The berkeley function calling leaderboard (BFCL): From tool use to agentic evaluation of large language models. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pp. 48371–48392. PMLR, 2025. URL https://proceedings.mlr.press/v267/patil25a.html.
  30. [31]Maciej Pióro, Maciej Wołczyk, Razvan Pascanu, Johannes von Oswald, and João Sacramento. State soup: In-context skill learning, retrieval and mixing. arXiv preprint arXiv:2406.08423, 2024.arxiv.org/abs/2406.08423
  31. [32]Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383–2392, Austin, Texas, 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1264. URL https://aclanthology.org/D16-1264/.DOI
  32. [33]Stephen Robertson and Hugo Zaragoza. The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333–389, 2009. doi: 10.1561/1500000019. URL https://doi.org/10.1561/1500000019.
  33. [34]Alireza Salemi, Sheshera Mysore, Michael Bendersky, and Hamed Zamani. Lamp: When large language models meet personalization. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 7370–7392, 2024.arxiv.org/abs/2304.11406
  34. [35]Clayton Sanford, Daniel Hsu, and Matus Telgarsky. Transformers, parallel computation, and logarithmic depth. arXiv preprint arXiv:2402.09268, 2024.arxiv.org/abs/2402.09268
  35. [36]Timo Schick, Jane Dwivedi-Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to use tools. Advances in neural information processing systems, 36:68539–68551, 2023.arxiv.org/abs/2302.04761
  36. [37]Imanol Schlag, Kazuki Irie, and Jürgen Schmidhuber. Linear transformers are secretly fast weight programmers. In International conference on machine learning, pp. 9355–9366. PMLR, 2021.arxiv.org/abs/2102.11174
  37. [38]Noam Shazeer. Fast transformer decoding: One write-head is all you need. arXiv preprint arXiv:1911.02150, 2019.arxiv.org/abs/1911.02150
  38. [39]Mikhail Shirokikh and Sergey Nikolenko. Sparse prefix caching for hybrid and recurrent llm serving. arXiv preprint arXiv:2605.05219, 2026.arxiv.org/abs/2605.05219
  39. [40]Dan Su, Kezhi Kong, Ying Lin, Joseph Jennings, Brandon Norick, Markus Kliegl, Mostofa Patwary, Mohammad Shoeybi, and Bryan Catanzaro. Nemotron-CC: Transforming Common Crawl into a refined long-horizon pretraining dataset. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2459–2475, Vienna, Austria, 2025. Association for Computational Linguistics. doi: 10.18653/v1/2025.acl-long.123. URL https://aclanthology.org/2025.acl-long.123/.
  40. [41]Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864, 2021.arxiv.org/abs/2104.09864
  41. [42]Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyeo, et al. Learning to (learn at test time): Rnns with expressive hidden states. arXiv preprint arXiv:2407.04620, 2024.arxiv.org/abs/2407.04620
  42. [43]Jiaming Tang, Yilong Zhao, Kan Zhu, Guangxuan Xiao, Baris Kasikci, and Song Han. Quest: Query-aware sparsity for efficient long-context llm inference. arXiv preprint arXiv:2406.10774, 2024.arxiv.org/abs/2406.10774
  43. [44]William L Tong, Aryo Lotfi, Emmanuel Abbe, Kostas Vaggelakos, Vishnu Banna, Etai Littwin, Josh Susskind, Cengiz Pehlevan, and Eran Malach. On the importance of gating: Memorization vs. in-context learning in state space models. arXiv preprint arXiv:2609.16540, 2026.arxiv.org/abs/2609.16540
  44. [45]Harsh Trivedi, Niranjan Balasubramanian, Tushar Khot, and Ashish Sabharwal. MuSiQue: Multihop questions via single-hop question composition. Transactions of the Association for Computational Linguistics, 10:539–554, 2022. doi: 10.1162/tacl_a_00475. URL https://aclanthology.org/2022.tacl-1.31/.DOI
  45. [47]Petar Veličković, Christos Perivolaropoulos, Federico Barbero, and Razvan Pascanu. Softmax is not enough (for sharp size generalisation). arXiv preprint arXiv:2410.01104, 2024.arxiv.org/abs/2410.01104
  46. [48]Roger Waleffe, Wonmin Byeon, Duncan Riach, Brandon Norick, Vijay Korthikanti, Tri Dao, Albert Gu, Ali Hatamizadeh, Sudhakar Singh, Deepak Narayanan, et al. An empirical study of mamba-based language models. arXiv preprint arXiv:2406.07887, 2024.arxiv.org/abs/2406.07887
  47. [49]Mitchell Wortsman, Gabriel Ilharco, Samir Ya Gadre, Rebecca Roelofs, Raphael Gontijo-Lopes, Ari S. Morcos, Hongseok Namkoong, Ali Farhadi, Yair Carmon, Simon Kornblith, and Ludwig Schmidt. Model soups: Averaging weights of multiple fine-tuned models improves accuracy without increasing inference time. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 23965–23998. PMLR, 2022. URL https://proceedings.mlr.press/v162/wortsman22a.html.arxiv.org/abs/2203.05482
  48. [51]Liu Xiao, Li Zhiyuan, and Lin Yueyu. State tuning: State-based test-time scaling on rwkv-7. arXiv preprint arXiv:2504.05097, 2025.arxiv.org/abs/2504.05097
  49. [52]Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W. Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2369–2380, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1259. URL https://aclanthology.org/D18-1259/.DOI
  50. [53]Masakazu Yoshimura, Teruaki Hayashi, and Yota Maeda. MambaPet: Exploring parameter-efficient fine-tuning for mamba. In International Conference on Learning Representations, volume 2025, pp. 94093–94117, 2025.DOI
  51. [54]Xuechen Zhang, Xiangyu Chang, Mingchen Li, Amit Roy-Chowdhury, Jiasi Chen, and Samet Oymak. Selective attention: Enhancing transformer through principled context control. Advances in Neural Information Processing Systems, 37:11061–11086, 2024.arxiv.org/abs/2411.12892
  52. [55]Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Tianle Li, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zhuohan Li, Zi Lin, Eric Xing, et al. Lmsys-chat-1m: A large-scale real-world llm conversation dataset. In International Conference on Learning Representations, volume 2024, pp. 22255–22257, 2024.arxiv.org/abs/2309.11998
  53. [56]Yongchao Zhou, Uri Alon, Xinyun Chen, Xuezhi Wang, Rishabh Agarwal, and Denny Zhou. Transformers can achieve length generalization but not robustly. arXiv preprint arXiv:2402.09371, 2024.arxiv.org/abs/2402.09371

Paper details

vlnc:W_3r3u6gpt
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

LLMs · View statement →

Looking for related papers…
Contents