arXiv:2609.07681cs.LGcs.CL2026-09

揭示Mamba实现记忆召回的内在机制,提出可预测性能的理论框架。

On the Recall Scaling Laws in Mamba: A Theoretical and Mechanistic Study via Hashing

论文配图:On the Recall Scaling Laws in Mamba: A Theoretical and Mechanistic Study via Hashing
图 1 · 摘自论文原文
  • 发现Mamba通过隐式学习线性哈希函数实现记忆召回
  • 给出预测完美召回所需维度与成功率的数学公式
  • 适用于研究模型容量、架构设计及注意力机制的开发者

关联回忆(Associative Recall, AR)是认知中学习并检索记忆中项目间关联的能力。在自然语言处理中,AR被用作评估Mamba等架构上下文记忆能力的基准,且与语言建模性能高度相关。本文从机制可解释性视角出发,旨在逆向解析Mamba执行回忆所依赖的内部算法。核心发现是:Mamba通过隐式学习线性哈希函数实现回忆,并识别出支撑该行为的底层电路。基于相似性保持哈希的理论工具(如Johnson-Lindenstrauss引理),我们构建了分析AR的理论框架,称为回忆缩放定律(Recall Scaling Laws)。该框架可基于词汇表大小和上下文中的事实数量,(1) 预测实现完美回忆所需的嵌入与状态维度,(2) 给出给定模型维度下的回忆成功概率,(3) 分析多层模型与多头SSM模式。实验结果表明,理论预测准确且具有前瞻性,揭示了回忆能力随词汇量、状态维数、嵌入维数及架构的变化规律。

原文摘要 · Abstract (English)

Associative Recall (AR) is the cognitive ability to learn and retrieve links between items in memory. In NLP, AR is used as a benchmark for evaluating the in-context memory capacity of architectures such as Mamba, and has been found to strongly correlate with language modeling performance. This paper explores AR from the perspective of mechanistic interpretability, aiming to reverse-engineer the exact internal algorithm used by Mamba to perform recall. Our key insight is that Mamba performs recall by implicitly learning linear hash functions, and we identify the low-level circuit that enables this behavior. Building on these findings and inspired by theoretical tools in similarity-preserving hashing, such as the Johnson-Lindenstrauss lemma, we develop a theoretical framework for analyzing AR, which we term Recall Scaling Laws. Given the vocabulary size and the number of facts in context, this framework allows us to (1) predict the embedding and state dimensions required for Mamba to achieve perfect recall, (2) predict recall success probability given the model dimensions, and (3) analyze multi-layer models and multi-head SSM patterns. Empirical results show that our theoretical findings are accurate and predictive, offering insights into how AR capacity scales with vocabulary, state, embedding size, and architecture.

Mamba记忆机制哈希缩放定律

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。