potentialpaper

On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models

William Lingxiao Tong, Aryo Lotfi, Emmanuel Abbe, Konstantinos Vaggelakos, Vishnu Banna, Etai Littwin, Joshua M. Susskind, Eran Malach

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. State Space Models (SSMs) have emerged as a compelling alternative to Transformers, enabling sequence modeling with constant memory and linear compute. While SSMs excel in certain settings like length generalization, they continue to lag behind Transformers on tasks that require in-context learning and precise retrieval, slowing their adoption for large-scale language modeling. In this work, we demonstrate that both the success and failure of SSMs in these domains can be explained by studying the role of the gating mechanism, a prevalent component in modern recurrent networks. Specifically, we show through theory and experiments that this gating mechanism causes SSMs to first learn an in-weights ``memorization'' solution, while delaying, or even preventing, convergence to a correct in-context learning solution. Importantly, this happens even in cases where there are no fundamental limitations due to the architecture or its memory capacity. On the other hand, we find that gating is often beneficial for improving generalization to long sequence lengths. Our results illuminate the crucial role of the gating mechanism in shaping both the training dynamics and generalization of SSMs, and provide a basis for understanding and improving linear-time models.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
5 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]—[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:46 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

This paper studies how gating in state-space models governs the tradeoff between in-weights memorization, in-context retrieval, and length generalization, combining theoretical analysis of a simplified model with experiments ranging from synthetic retrieval to tool calling. The paper is currently borderline and leaning toward acceptance, but the reviewers identify several issues that should be addressed in the rebuttal. Most importantly, the authors should clarify how conclusions derived under a single-layer, single-head model with a global scalar gate and orthogonal representations transfer to full selective SSMs (see Reviewer 3x1A Weakness 1 and Reviewer vBWv Weakness 1). They should also connect the short-context optimization analysis to the long-context experiments by reporting whether the imposed ordering of gating strengths persists after training and explaining how the fixed-gate theory accounts for post-training behavior (see Reviewer 3x1A Weakness 2 and Question 3). Finally, the response should clarify the BFCL gate intervention and Transformer baseline, justify the use of different optimizers, and address the underspecified theoretical and experimental details (see Reviewer 3x1A Questions 1, 2, and 4; Reviewer vBWv Questions 1 and 2). Improvements to exposition—including bringing essential details and related-work discussion into the main text—would also strengthen the paper (see Reviewer vBWv Weaknesses 2–3 and Reviewer JC2H Weakness 2). A convincing response to the central questions about theoretical transfer and learned gate behavior would increase confidence in acceptance.

Final justification

Taking into account the reviews, author response, and reviewer discussion, I recommend Accept (Spotlight). The rebuttal adequately addressed the principal concerns identified in the initial meta-review. In particular, the authors provided direct measurements showing that the imposed weak-to-strong ordering of gate values is preserved after training, thereby strengthening the connection between the fixed-gate theory and the long-context experiments. They also clarified how the simplified analysis captures the relevant mechanism and supported its transfer through consistent causal interventions across increasingly realistic settings, including deep multi-head Mamba models and pretrained models for tool use. The remaining questions regarding the BFCL intervention, Transformer baseline, optimizer choices, experimental setup, and exposition were also satisfactorily addressed, with appropriate revisions committed for the final manuscript. Two reviewers consequently increased their scores to Accept, while the remaining reviewer found the responses satisfactory but retained a borderline-positive score primarily because they desired a broader investigation of gating in language modeling, which is beyond the paper’s stated scope. Overall, the paper offers a timely and insightful theoretical-mechanistic account of the dual role of gating—hindering retrieval learning while controlling long-context interference—supported by unusually broad and coherent empirical validation. The clarity of this central insight and its relevance to understanding modern SSMs justify Spotlight consideration.

Area Chair GTHr · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

This paper studies how gating in state-space models governs the tradeoff between in-weights memorization, in-context retrieval, and length generalization, combining theoretical analysis of a simplified model with experiments ranging from synthetic retrieval to tool calling. The paper is currently borderline and leaning toward acceptance, but the reviewers identify several issues that should be addressed in the rebuttal. Most importantly, the authors should clarify how conclusions derived under a single-layer, single-head model with a global scalar gate and orthogonal representations transfer to full selective SSMs (see Reviewer 3x1A Weakness 1 and Reviewer vBWv Weakness 1). They should also connect the short-context optimization analysis to the long-context experiments by reporting whether the imposed ordering of gating strengths persists after training and explaining how the fixed-gate theory accounts for post-training behavior (see Reviewer 3x1A Weakness 2 and Question 3). Finally, the response should clarify the BFCL gate intervention and Transformer baseline, justify the use of different optimizers, and address the underspecified theoretical and experimental details (see Reviewer 3x1A Questions 1, 2, and 4; Reviewer vBWv Questions 1 and 2). Improvements to exposition—including bringing essential details and related-work discussion into the main text—would also strengthen the paper (see Reviewer vBWv Weaknesses 2–3 and Reviewer JC2H Weakness 2). A convincing response to the central questions about theoretical transfer and learned gate behavior would increase confidence in acceptance.

Final justification

Taking into account the reviews, author response, and reviewer discussion, I recommend Accept (Spotlight). The rebuttal adequately addressed the principal concerns identified in the initial meta-review. In particular, the authors provided direct measurements showing that the imposed weak-to-strong ordering of gate values is preserved after training, thereby strengthening the connection between the fixed-gate theory and the long-context experiments. They also clarified how the simplified analysis captures the relevant mechanism and supported its transfer through consistent causal interventions across increasingly realistic settings, including deep multi-head Mamba models and pretrained models for tool use. The remaining questions regarding the BFCL intervention, Transformer baseline, optimizer choices, experimental setup, and exposition were also satisfactorily addressed, with appropriate revisions committed for the final manuscript. Two reviewers consequently increased their scores to Accept, while the remaining reviewer found the responses satisfactory but retained a borderline-positive score primarily because they desired a broader investigation of gating in language modeling, which is beyond the paper’s stated scope. Overall, the paper offers a timely and insightful theoretical-mechanistic account of the dual role of gating—hindering retrieval learning while controlling long-context interference—supported by unusually broad and coherent empirical validation. The clarity of this central insight and its relevance to understanding modern SSMs justify Spotlight consideration.

1 comment
Authors · CommentOpenReview ↗

Thanks for considering our rebuttal. We believe our responses directly address the principal concerns in the meta-review:

  • Theoretical transfer: our theoretical setting is intentionally minimal so that the effects of gating on memorization, retrieval, and long-context interference can be precisely studied. Crucially, its predictions are reproduced across progressively more realistic settings, including deep multi-head Mamba models, logical-rule retrieval, and pretrained models on tool use, and are validated through causal interventions on gating strength, rather than correlation alone. This consistency provides strong evidence that the identified mechanism transfers beyond the theory’s simplifying assumptions.

  • Learned-gate behavior: we directly measured gate values after 200K training steps in our long-context experiments (see response to reviewer 3x1A). The median gates move little relative to the separation between configurations, and the imposed weak-to-strong ordering is perfectly preserved. Thus, initialization remains a reliable proxy for post-training gating strength, making the fixed-gate analysis informative for trained-model behavior.

  • Remaining issues: our responses clarify the BFCL intervention and notation, the parameter-matched RoPE Transformer baseline, optimizer choices and cross-optimizer consistency, theoretical/task details, and limitations. We will add these details to our final manuscript, and will also reorganize the exposition and bring essential details and related work into the main text.

Taken together, we respectfully believe the central technical concerns have been resolved, and look forward to your final evaluation.

Reviewer JC2HOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
2/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper analyzes SSMs from a theoretical / mechanistic perspective. In particular, the authors examine the gating mechanism in SSMs within in-context learning and retrieval. In particular, they show that under certain conditions, the model will converge to a "memorization solution", but on the other hand, it will do better with long context lengths. Their results are backed up both theoretically and empirically.

Strengths and weaknesses

Strengths

  • The paper formulates a set of sensible hypotheses and is able to show their validity both theoretically and empirically, although the model studied is simplified.
  • The authors test a variety of different experimental setups to validate their idea of how gating affects in-context learning and retrieval.
  • The authors do not only consider "toy" problems, but also other important tasks such as naturalistic tool-calling.

Weaknesses

  • I think that the thing I missed the most about this paper is the local exploration around just in-context learning and retrieval. When I first read the title "On the Importance of Gating", I thought that the authors would share experimental evidence around why some of the early SSM designs, such as S4 did not properly work in the case of language. In particular, plots I have seen from pretraining runs suggest that LSTMs and Transformers were pretty much matched in terms of performance (although Transformers won later on because of scalability), but the more simplistic S4 lagged severely behind, and this was not able to be solved until Mamba re-introduced the gating mechanism. The original authors of S4 and Mamba (Albert Gu) has suggested in talks that this is because language is a more "compressible" modality, compared to continuous signals like audio, but I have never seen any convincing arguments made in this direction. I appreciate that the authors did a good job by taking a look at retrieval and in-context learning, but I wish that this analysis was extended to more generally understand the importance of gating in language modelling.
  • I also feel like the paper reads in a way in which the main points are repeated over and over, without each section introducing some new concept or idea.
Questions
  • "While SSMs excel in certain settings like length generalization" - I thought that SSMs did not generalize well to longer sequence lengths than trained on?
  • I think that gating might be quite related to the ideas of sequence mixing and sharp heads presented in (Barbero et. al 2025). Could the authors perhaps discuss that? Maybe this can be related to the representational collapse result of (Barbero et. al. 2024).
  • Do the authors have any thoughts on why it might be that gating is essential in the context of language modelling for, and can they produce some preliminary analyses of this during the review period, given the time constraints?

Barbero, Federico, et al. "Transformers need glasses! information over-squashing in language tasks." Advances in Neural Information Processing Systems 37 (2024): 98111-98142.

Barbero, Federico, et al. "Why do LLMs attend to the first token?." COLM (2025).

Limitations

Yes

Final justification

The authors did a good job answering my questions, but I still feel like the paper is somewhat borderline and could explore other areas in more detail. I maintain my score.

Formatting concerns

None

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thanks for the support and suggestions! Responding to your specific points and questions below:

I think that the thing I missed the most about this paper is the local exploration around just in-context learning and retrieval. When I first read the title "On the Importance of Gating", I thought that the authors would share experimental evidence around why some of the early SSM designs, such as S4 did not properly work in the case of language. In particular, plots I have seen from pretraining runs suggest that LSTMs and Transformers were pretty much matched in terms of performance (although Transformers won later on because of scalability), but the more simplistic S4 lagged severely behind, and this was not able to be solved until Mamba re-introduced the gating mechanism. The original authors of S4 and Mamba (Albert Gu) has suggested in talks that this is because language is a more "compressible" modality, compared to continuous signals like audio, but I have never seen any convincing arguments made in this direction. I appreciate that the authors did a good job by taking a look at retrieval and in-context learning, but I wish that this analysis was extended to more generally understand the importance of gating in language modelling.

Thanks for raising this comparison. Our paper studies one concrete role of gating: how decay controls the competition between in-weights memorization and in-context retrieval, and how the same decay trades distant retrieval against long-context interference. We do not provide a comprehensive explanation of the language-modeling gap between S4 and Mamba, though our results may gesture towards one plausible component of the broader answer. Language is highly nonstationary and predominantly local: information that was useful many tokens ago often becomes irrelevant, while recent tokens are typically more predictive of the next token. A gate gives a recurrent model a mechanism to discard stale information, prevent unbounded accumulation of unrelated features in a fixed-size state, and focus its effective capacity on a more local window. This is precisely the benefit visible in our long-context analysis when the relevant item remains near the query.

There are, however, likely many other aspects of Mamba's language-modeling success. Mamba also introduces input-dependent selectivity, learned projections, multiplicative interactions, and a full nonlinear architecture, and these may be crucial for deciding what to retain rather than merely how quickly to forget. These are very interesting questions to consider for future iterations of this work, and we thank you for raising them.

I also feel like the paper reads in a way in which the main points are repeated over and over, without each section introducing some new concept or idea.

Thanks for the candid feedback. We intended each section to be readable in isolation and easy to skim, but doing so required us to repeat many details about the framing and key ideas between sections. We will consider streamlining the exposition to concentrate the framing and key ideas in the introduction and discussion, and reorganize the theory and experiments into a more progressive narrative.

"While SSMs excel in certain settings like length generalization" - I thought that SSMs did not generalize well to longer sequence lengths than trained on?

Thanks for the opportunity to sharpen this statement. Both observations are true, depending on the task. SSMs can exhibit excellent sequence-length extrapolation when the desired computation is implementable by a stable recurrent rule and the relevant information remains within the model's effective memory (see for instance the original Mamba paper or more recently Malach et al. 2026). They can nevertheless fail on arbitrary long-range copying or retrieval, because a fixed-size state and decaying dynamics cannot preserve every item indefinitely.

Our results are intended to reconcile these cases rather than assert universal length generalization. Stronger gating can make the recurrent computation stable as the total sequence grows by preventing irrelevant history from accumulating, but it simultaneously imposes locality and makes distant retrieval harder. We will replace the broad sentence with a more qualified statement: SSMs show strong length extrapolation in several recurrent or locality-compatible settings, while long-range retrieval remains a central limitation.

I think that gating might be quite related to the ideas of sequence mixing and sharp heads presented in (Barbero et. al 2025). Could the authors perhaps discuss that? Maybe this can be related to the representational collapse result of (Barbero et. al. 2024).

Thanks for the interesting connections. At a high level, both lines of work concern how information from many positions is compressed and mixed into a limited representation. In our weak-gating regime, contributions from many context tokens persist in the same fixed-size recurrent state. This improves access to distant positions, but also increases superposition and distractor variance, which seems to be spiritually related to information over-squashing. Stronger gating makes the temporal weighting sharper and reduces this mixing, but does so by preferentially retaining recent information.

There are also important differences. The "first-token" or primacy behavior studied for Transformers arises from the structure of attention and special-token sinks, whereas the scalar decay in our SSM analysis produces a monotonic recency bias. Moreover, our short-context result is about optimization competition between a memorized solution and a retrieval solution, rather than representational collapse alone.

Do the authors have any thoughts on why it might be that gating is essential in the context of language modelling for, and can they produce some preliminary analyses of this during the review period, given the time constraints?

As we noted above, our intuition is that gating is valuable for language modeling because it provides adaptive forgetting: it limits interference from stale context, prevents the recurrent state from becoming an indiscriminate mixture of the entire prefix, and allocates finite state capacity toward information useful at the current position. Natural language may often be compatible with this system, favoring strong local dependencies with the occasionally long-range dependency. These intuitions resonate with our findings about in-context retrieval and long-context generalization, and we look forward to more deeply exploring a connection to natural language in future iterations of this work.

Reviewer JC2H · CommentOpenReview ↗

Reply to the Authors

I thank the authors for taking the time to answer my questions.

Reviewer 3x1AOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
4/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies how gating mechanisms in State Space Models shape the tradeoff between in-context learning and in-weights memorization, as well as their downstream effect on length generalization. The authors develop a simplified theoretical model showing that strong gating can bias training toward memorization shortcuts and delay convergence to the correct retrieval-based in-context learning solution, while also helping control in-context noise accumulation and improve generalization to longer sequences. They validate these insights across synthetic retrieval tasks, multi-token key-value retrieval, logical rule retrieval, and a BFCL-style tool-calling benchmark, finding that weaker gating tends to improve in-context retrieval and reduce tool hallucination, whereas stronger gating can improve long-context extrapolation in settings where relevant information remains local. Overall, the paper contributes a theoretical and empirical explanation of why gated SSMs may struggle with retrieval-heavy in-context learning despite having sufficient capacity, while also clarifying why gating remains useful for length generalization.

Strengths and weaknesses

Strengths

  • The paper studies an important and timely question: why gated SSMs such as Mamba can show strong length generalization while still struggling with retrieval-heavy in-context learning, especially on how learnable gating parameter's initialization is effecting training dynamics. The framing of gating as a mechanism that can both help and hurt is interesting and useful.

  • The sythetic retrieval task with label perturbation is smart and well-designed with controlled in-context noise distractor. This provides a clean framework for analyzing gradient flow and for decomposing the prediction margin into memorization and retrieval components. The resulting theory that shows how strong initial gating can suppress the retrieval signal and create a long memorization plateau even when an ICL solution is reachable, is useful and insightful.

  • The empirical validation is coherent and progressively scaled. The paper tests the proposed mechanism on synthetic retrieval, logical rule retrieval, and a more realistic BFCL-style tool-calling setting with large-scale pretrained models. Across these settings the results generally support the paper's central tradeoff, and the authors sensibly adapt both the model and the means of controlling gating strength accordingly.

Weaknesses

  • The theoretical analysis is still quite simplified. It uses a single-layer, single-head setup with a global scalar gate and identity-like projections. This makes the analysis clean, but leaves uncertainty about how directly the conclusions transfer to full Mamba architectures with input-dependent gates, multiple heads and nonlinear blocks. The exact-orthonormality assumption on the token representations is also quite strong.

  • The connection between the short-context training-dynamics theory and the long-context generalization claim is not fully established. The short-context theory analyzes how the initial gating value affects optimization process during training, and the long-context theory analyzes a fixed gating strength at inference time. However, the length-generalization experiments intervene on the gate values before training or SFT. Since the gates remain trainable, it is unclear whether the initialized or scaled ordering of gating strengths is preserved after optimization, and therefore how directly the fixed-gating long-context analysis explains the observed post-training extrapolation behavior.

Questions
  1. Why does the Transformer baseline show much worse pool-size generalization than the Mamba-based models in the BFCL experiment? Is this primarily due to the architectural difference between Transformers and SSMs, or could it also reflect differences in the base model ability? It would be helpful if the authors provide more details about the Transformer baseline including its parameter count, positional encoding scheme, and how closely its training setup matches the Nemotron models.

  2. In the BFCL experiments, what exactly is the gating scaling factor applied to? Is the scaling applied to the same log-space gating parameter as in the Section 3.1 offset intervention?

  3. Since the gating parameters are trainable, do the models preserve the initialized or pre-SFT ordering of gating strengths after training/SFT? More generally, to what extent do the final learned gate distributions reflect the intended weak-to-strong gating scale imposed at initialization or before SFT?

  4. Is there a specific reason for using different optimizers (SGD/Adam/Muon) across different tasks? Could optimizer choice affect the memorization-to-retrieval transition or the observed sensitivity to gating initialization?

  5. How does gating strength affect "lost-in-the-middle" behavior? For example, does stronger gating turn the U-shaped long-context retrieval performance curve into a more monotonic recency-biased curve, or is there an intermediate gating regime that improves retrieval from middle positions?

Limitations

The main analysis uses a highly simplified single-layer, single-head Mamba-like model with a global scalar gate and identity projections, rather than a full Mamba architecture with input-dependent selective gating, multiple heads, and nonlinear blocks.

The short-context theory also relies on an orthogonal-token approximation, which makes the memorization/retrieval margin decomposition clean but may not reflect the correlated token representations encountered in realistic pretrained models.

A clearer discussion of how these assumptions may affect the transfer of the theory to full-scale SSMs would strengthen the paper.

Final justification

The authors’ rebuttal has addressed most of my concerns, and I have decided to raise my score accordingly.

Formatting concerns

I did not notice obvious violations.

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thanks for the kind words and many suggestions! We’re glad you liked the paper. Responding to your specific points and questions below:

The theoretical analysis is still quite simplified.... The exact-orthonormality assumption on the token representations is also quite strong.

The short-context theory also relies on an orthogonal-token approximation, which makes the memorization/retrieval margin decomposition clean but may not reflect the correlated token representations encountered in realistic pretrained models.

Thanks for raising these critiques. Our theoretical SSM model is indeed a simplification of a full Mamba implementation, but retains the critical features under study (gating, memorization, in-context retrieval). Importantly, our theory reflects the same interactions between gating, memorization, and in-context retrieval observed across our several experimental settings which do employ full-scale Mamba models, suggesting that our simple model remains informative for understanding real outcomes. The simplifications are necessary to permit theoretical study, and carefully chosen to retain the particular phenomenology we study in this work. Introducing additional complexity like multiple heads, multiple layers, and nonlinear blocks seemed unnecessary to answer the specific questions we posed in this study, but we look forward to pursuing future iterations that relax some of our assumptions and target other questions.

Regarding our assumption on independent or orthogonal token embeddings, individual tokens in our theoretical setting represent the entities over which a model must retrieve. In our experiments, the analogous entities aren’t individual tokens, but entire tool definitions, Horn clauses, or key-value pairs. One tool definition in the context might be about checking the weather, whereas another tool definition might be about scheduling an Uber ride, and so the blocks of tokens over which the model retrieves may not necessarily be related. Hence, assuming independence among the entities over which we’re retrieving was a convenient simplification that permitted a crisp analysis without being wholly unrealistic. Of course, as you note, tool definitions and other retrieved entities often still exhibit significant correlations. Incorporating more significant correlations between inputs is certainly an interesting avenue for future study, and one we look forward to developing further in future work.

The connection between the short-context training-dynamics theory and the long-context generalization claim is not fully established. The short-context theory analyzes how the initial gating value affects optimization process during training, and the long-context theory analyzes a fixed gating strength at inference time. However, the length-generalization experiments intervene on the gate values before training or SFT. Since the gates remain trainable, it is unclear whether the initialized or scaled ordering of gating strengths is preserved after optimization, and therefore how directly the fixed-gating long-context analysis explains the observed post-training extrapolation behavior.

Great question. While gating certainly evolves over training, initialization plays a crucial role. From our expression for the gating prefactor α\alpha (Appendix B, equation 3), we observe that the gradient on α\alpha is vanishingly small both when gating is very strong (α≈0\alpha \approx 0) and when gating is very weak (α≈1\alpha \approx 1), so gating tends to remain close to its initialization in these limits. We would therefore expect a strong gating model to continue performing well at length generalization, and a weak gating model to continue performing poorly.

In practice, we observe that gating changes minimally throughout the course of training in our long-context experiments. Below, we’ve instrumented a run in the setting of the length generalization illustrated in Figure 3d, measuring the gating parameter value before and after training (taking the median across heads), and summarize changes to α\alpha and the corresponding effective length scale τ=−1/log⁡α\tau = -1/\log\alpha. We observe that, indeed, τ\tau and α\alpha change little throughout the course of training compared to their relative scales. Furthermore, we see that the ordering between models by gating strength is perfectly preserved. Hence, initialization appears to remain a good proxy for gating strength after training, and our theoretical observations on long contexts may remain relevant for a trained model.

Initial gate (median τ\tau, tokens) Median τ\tau after 200k steps Prefactor drift ∣Δα∣\lvert\Delta\alpha\rvert
2.1×1042.1\times10^{4} (weakest) 1.2×1041.2\times10^{4} 4×10−54\times10^{-5}
297297 315315 1×10−31\times10^{-3}
1717 1414 0.0240.024
2.82.8 3.03.0 0.0830.083
1.41.4 1.41.4 0.0670.067
0.80.8 0.70.7 0.0530.053
0.20.2 (strongest) 0.20.2 7×10−37\times10^{-3}

We will clarify these intuitions further in the manuscript and add a more comprehensive set of direct measurements of the gating distributions before and after training.

Why does the Transformer baseline show much worse pool-size generalization than the Mamba-based models in the BFCL experiment?

Standard Transformers with commonly used explicit positional encodings, including RoPE, often degrade when evaluated beyond their training lengths (see for instance Kazemnejad et al. 2023). Our experiments are consistent with these observations, and also show a rapid deterioration in performance when the Transformer is exposed to out-of-distribution lengths. The Transformer has been parameter-matched to the Mamba model across experiments, and specific details on model configurations are in Appendix C. The Transformer uses rotational positional encodings (RoPE), and its training pipeline is identical to that of the Mamba models across all settings. We’ll ensure the appendix is comprehensive with details regarding the Transformer’s configuration and training.

In the BFCL experiments, what exactly is the gating scaling factor applied to? Is the scaling applied to the same log-space gating parameter as in the Section 3.1 offset intervention?

The scaling for the BFCL experiment is applied directly to the parameter, not in log space (the two configurations are equivalent: additively shifting the gating parameter in log-space is equivalent to scaling the parameter directly by a factor). We’ll adjust our notation to uniformly describe changes to the gating parameter.

Is there a specific reason for using different optimizers (SGD/Adam/Muon) across different tasks? Could optimizer choice affect the memorization-to-retrieval transition or the observed sensitivity to gating initialization?

Great questions. The small theoretical-validation model uses SGD because it most directly matches the gradient-flow analysis. The deep multi-token Mamba-2 experiments and the large-scale pretraining/BFCL experiments use AdamW, which is the standard and stable optimizer in those settings. For the logical-rules task, we found that Muon was substantially more reliable at learning the task in-distribution for both the Mamba and Transformer architectures, and for unclear reasons our models failed to train consistently using AdamW even after extensive hyperparameter sweeps.

The choice of optimizer may change the quantitative timing of the transition, though the same qualitative relationship between stronger gating, slower retrieval learning, and improved length extrapolation appears across tasks trained with SGD, AdamW, and Muon. This cross-optimizer consistency suggests that the phenomenon is not an artifact of one particular optimizer, although a controlled study of how preconditioning alters the plateau and escape time would be a valuable direction for future work. We will add this rationale and limitation to the experimental details.

How does gating strength affect "lost-in-the-middle" behavior? For example, does stronger gating turn the U-shaped long-context retrieval performance curve into a more monotonic recency-biased curve, or is there an intermediate gating regime that improves retrieval from middle positions?

Thanks for raising an interesting question. In the scalar-decay model analyzed in our theory, positional weighting is monotonic: earlier states are exponentially attenuated, so the model has an intrinsic recency bias rather than the U-shaped primacy-and-recency profile often observed in Transformers. Strengthening the gate steepens this recency bias; weakening it flattens the positional weighting and improves access to middle or early tokens, but eventually permits too much distractor variance to accumulate. Thus, an intermediate gate can provide the best accuracy at a particular middle distance by balancing attenuation against interference, but it does not produce a Transformer-like U-shape in our analysis. Our Proposition 8 makes this tradeoff explicit through an effective retrieval radius of order τlog⁡(d/τ)\tau\log(d/\tau). A full position-by-position analysis in pretrained Mamba models would be very interesting, but is beyond what our current experiments establish.

Reviewer 3x1A · CommentOpenReview ↗

I thank the authors for addressing my questions and for providing empirical insights. My concern has been mostly resolved.

Reviewer vBWvOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

In this paper, the authors study the importance of gating in linear recurrent networks. They derive results for short and long context cases and show that for short context, strong gating can delay in-context retrieval in favour of memorisation, while for long context weak gating accumulates excessive variance. They test out their theoretical predictions on various tasks.

Strengths and weaknesses

Strengths

  1. Gives a comprehensive view of the role of gating in memorisation vs in-context retrieval
  2. the theoretical predictions are supported by empirical results
  3. Cases to real world are studied.

Weaknesses

  1. The SSM model considered is very simplistic.
  2. Main text does not contain a discussion of related work
  3. Clarity of the main text is poor because so many of the key details are in the appendix. The authors could find a better balance of distributing the details across the main text and appendix. E.g. move some of the experimental details to appendix instead?

Minor

  • l.111: η\eta is not defined in the main text.
Questions
  1. For the task in 2.1, is it the same points all the time, and is ϵ\epsilon resampled for every instance?
  2. What is the assumed training dynamics in proposition 4?
Limitations

yes

Final justification

The authors response addressed most of my concerns. I am now convinced that this is worth accepting and have upgraded by score accordingly.

Formatting concerns

none

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thanks for the notes and suggestions! Responding to your specific points below:

The SSM model considered is very simplistic.

In our theoretical analysis, our SSM model is indeed a simplification of a full Mamba implementation, but retains the critical features under study (gating, memorization, in-context retrieval). Importantly, our theory reflects the same interactions between gating, memorization, and in-context retrieval observed in our series of experimental settings of increasing realism, suggesting that our simple model remains informative for understanding real outcomes. The simplifications are necessary to permit theoretical study, and carefully chosen to retain the particular phenomenology we study in this work. We look forward to pursuing future iterations that relax our assumptions and target other questions.

Main text does not contain a discussion of related work

Clarity of the main text is poor because so many of the key details are in the appendix. The authors could find a better balance of distributing the details across the main text and appendix. E.g. move some of the experimental details to appendix instead?

Thanks for this critique. Our Related Works is currently in Appendix A due to space constraints, but we will certainly move it back to the main text and make space for it by reorganizing the experimental sections to relegate more of the noncritical details to the appendix.

For the task in 2.1, is it the same points all the time, and is resampled for every instance?

The global set of P points is fixed through the duration of the task, but each example contains a fresh subset of these points. We clarify our exposition to make this setup more clear.

What is the assumed training dynamics in proposition 4?

The reduced dynamics are described in Appendix B (Lemma 3 and equations 2,3), in our detailed exposition of the theoretical analysis. We will link this reference in our informal statement of proposition 4 to make the statement clearer. The reduced dynamics are a leading-order simplification of our dynamics, and permit us to characterize the time to escape the memorization plateau to leading order in the gating factor α\alpha.

Reviewer vBWv · CommentOpenReview ↗

Thank you for the response, and for clarifying things. As a follow-up question, how did you decide which features were critical for study? For example, could there be other parts in the model contributing to in-context retrieval?

Authors · CommentOpenReview ↗

Great question. Our primary goal with our theoretical analysis was to identify a tractable setting in which we could study memorization, in-context retrieval, and length generalization dynamics. The theoretical in-context learning literature has several examples of interesting, tractable tasks that we used as starting points for designing our setting (in particular, Zhang et al 2023 and Reddy 2023). For our model, we prioritized identifying the simplest version of Mamba that nonetheless still captures our empirical observations on memorization, in-context retrieval, and length generalization. Our resulting SSM captures the full spectrum of phenomenology we wanted to study, and the intuitions we derived from our theoretical setting suggested causal interventions that we validated in our empirical experiments, confirming that our theoretical choices were reasonable. As with any theory, simplification is necessary, and there are certainly many complex features in a full Mamba model that we do not describe. These complex features do not appear to be necessary to capture the essential phenomenology in our setting, but we certainly look forward to answering future questions that do more deeply interrogate other aspects of SSM architecture.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…