arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.13680cs.AIcs.CL
收藏

AllMem: 一种面向高效长上下文建模的记忆导向方法

AllMem: A Memory-centric Recipe for Efficient Long-context Modeling

ACS Lab, Huawei Technologies(华为技术有限公司先进计算实验室);Huawei Switzerland(华为瑞士)

Ziming Wang, Xiang Wang, Kailong Peng, Lang Qin, Juan Gabriel Kostelec, Christos Sourmpis, Axel Laborieux, Qinghai Guo

AI总结:

AllMem通过结合滑动窗口注意力与非线性测试时训练内存网络,实现了高效长上下文建模,显著降低计算和内存开销,同时提升长程建模的鲁棒性。

摘要:

大型语言模型(LLMs)在处理长序列任务时,由于自注意力机制固有的计算复杂性和内存开销,面临显著的性能瓶颈。为解决这些挑战,我们引入了AllMem,一种新颖且高效的混合架构,将滑动窗口注意力(SWA)与非线性测试时训练(TTT)内存网络相结合。AllMem使模型能够有效扩展到超长上下文,同时缓解灾难性遗忘问题。该方法不仅克服了线性内存模型典型的表示限制,还显著减少了长序列推理过程中的计算和内存开销。此外,我们实现了一种内存高效微调策略,用内存增强的滑动窗口层替代预训练模型中的标准注意力层。该框架使任何现成的预训练LLM都能高效地转换为AllMem架构。实证评估表明,我们的4k窗口模型在37k LongBench上实现了接近无损的性能,仅比全注意力略低0.83个百分点。此外,在128k上下文的InfiniteBench上,我们的8k窗口变体优于全注意力,这验证了我们参数化内存在缓解噪声和保持鲁棒长程建模方面的有效性,而无需全球注意力的高昂成本。

英文摘要:

Large Language Models (LLMs) encounter significant performance bottlenecks in long-sequence tasks due to the computational complexity and memory overhead inherent in the self-attention mechanism. To address these challenges, we introduce \textsc{AllMem}, a novel and efficient hybrid architecture that integrates Sliding Window Attention (SWA) with non-linear Test-Time Training (TTT) memory networks. \textsc{AllMem} enables models to effectively scale to ultra-long contexts while mitigating catastrophic forgetting. This approach not only overcomes the representation constraints typical of linear memory models but also significantly reduces the computational and memory footprint during long-sequence inference. Furthermore, we implement a Memory-Efficient Fine-Tuning strategy to replace standard attention layers in pre-trained models with memory-augmented sliding window layers. This framework facilitates the efficient transformation of any off-the-shelf pre-trained LLM into an \textsc{AllMem}-based architecture. Empirical evaluations confirm that our 4k window model achieves near-lossless performance on 37k LongBench with a marginal 0.83 drop compared to full attention. Furthermore, on InfiniteBench at a 128k context, our 8k window variant outperforms full attention, which validates the effectiveness of our parameterized memory in mitigating noise and maintaining robust long-range modeling without the prohibitive costs of global attention.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑