Mamba在长序列任务中表现不如Transformer,尤其在复制和推理任务上存在瓶颈。
Exploring the Limitations of Mamba in COPY and CoT Reasoning
- 通过分析Mamba与线性注意力的联系,揭示其在复制操作上的局限性
- 当Mamba规模线性增长时可完成复制,但失去计算优势
- 在链式思维任务中,仅对具有局部特性的问题能节省开销
Transformers虽为现代大语言模型的核心,但其推理开销随序列长度线性增长,限制了长序列建模。为此,Mamba因保持恒定推理尺寸而受到关注,实证显示其在序列建模中可媲美Transformer并大幅降低计算成本。然而,一个关键问题仍未解决:Mamba是否始终能在保持性能的同时带来效率提升?本文聚焦于Mamba执行定义的复制(COPY)操作和链式思维(CoT)推理的能力。受Mamba与线性注意力关联启发,我们发现固定尺寸的Mamba难以完成复制操作,而Transformer则更易实现。当Mamba规模随输入序列长度线性增长时,可准确完成复制,但此时不再具备计算优势。进一步分析发现,要解决任意动态规划(DP)问题,Mamba总开销仍与标准Transformer相当;但类似高效Transformer,面对具有局部性等有利性质的DP问题时,Mamba仍可提供开销节省。实验结果进一步验证了Mamba在学习复制与链式思维任务方面相较于Transformer的局限性。
原文摘要 · Abstract (English)
Transformers have become the backbone of modern Large Language Models (LLMs); however, their inference overhead grows linearly with the sequence length, posing challenges for modeling long sequences. In light of this, Mamba has attracted attention for maintaining a constant inference size, with empirical evidence demonstrating that it can match Transformer performance in sequence modeling while significantly reducing computational costs. However, an open question remains: can Mamba always bring savings while achieving performance comparable to Transformers? In this paper, we focus on analyzing the expressive ability of Mamba to perform our defined COPY operation and Chain of Thought (CoT) reasoning. First, inspired by the connection between Mamba and linear attention, we show that constant-sized Mamba may struggle to perform COPY operations while Transformers can handle them more easily. However, when the size of Mamba grows linearly with the input sequence length, it can accurately perform COPY, but in this case, Mamba no longer provides overhead savings. Based on this observation, we further analyze Mamba's ability to tackle CoT tasks, which can be described by the Dynamic Programming (DP) problems. Our findings suggest that to solve arbitrary DP problems, the total cost of Mamba is still comparable to standard Transformers. However, similar to efficient Transformers, when facing DP problems with favorable properties such as locality, Mamba can provide savings in overhead. Our experiments on the copy and CoT tasks further demonstrate Mamba's limitations compared to Transformers in learning these tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。