arXiv:2510.00399cs.LG2025-10被引 3

首次解析Mamba如何在含异常值的提示中实现准确上下文学习。

How Can Mamba Learn In Context with Outliers and Generalize Provably?

  • 通过线性注意力选关键样本,非线性门控抑制异常值影响。
  • 在异常比例超线性Transformer容忍阈值时仍保持预测准确。
  • 理论与实验结合,揭示Mamba优于传统Transformer的鲁棒性。

Mamba模型因其计算优势受到广泛关注,其性能可与基于Transformer的模型相媲美。与Transformer类似,Mamba具备上下文学习(ICL)能力,即无需微调即可根据包含输入-标签对和查询的提示完成新任务预测。尽管其经验表现优异,但其理论理解仍有限,主要受限于门控机制引入的非线性。本文首次对单层Mamba模型(由线性注意力层后接非线性门控层构成)的训练动态及其在未见二分类任务上的ICL泛化能力进行了理论分析,即使提示中包含加性异常值亦成立。分析表明,Mamba利用线性注意力层筛选信息丰富的上下文样本,并通过非线性门控层抑制异常值的影响。通过与相同设定下线性Transformer的分析进行对比,我们发现虽然Mamba可能需要更多训练迭代才能收敛,但在异常比例超过线性Transformer可容忍阈值时仍能保持准确预测。这些理论发现得到了实证实验的支持。

原文摘要 · Abstract (English)

The Mamba model has gained significant attention for its computational advantages over Transformer-based models, while achieving comparable performance across a wide range of language tasks. Like Transformers, Mamba exhibits in-context learning (ICL) capabilities, i.e., making predictions for new tasks based on a prompt containing input-label pairs and a query, without requiring fine-tuning. Despite its empirical success, the theoretical understanding of Mamba remains limited, largely due to the nonlinearity introduced by its gating mechanism. To the best of our knowledge, this paper presents the first theoretical analysis of the training dynamics of a one-layer Mamba model, which consists of a linear attention component followed by a nonlinear gating layer, and its ICL generalization on unseen binary classification tasks, even when the prompt includes additive outliers. Our analysis shows that Mamba leverages the linear attention layer to select informative context examples and uses the nonlinear gating layer to suppress the influence of outliers. By establishing and comparing to the analysis of linear Transformers under the same setting, we show that although Mamba may require more training iterations to converge, it maintains accurate predictions even when the proportion of outliers exceeds the threshold that a linear Transformer can tolerate. These theoretical findings are supported by empirical experiments.

Mamba上下文学习异常鲁棒理论分析

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