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

MateICL:缓解大规模上下文学习中的注意力分散

MateICL: Mitigating Attention Dispersion in Large-Scale In-Context Learning

Zhuiyi AI Lab(智颐人工智能实验室)

Murtadha Ahmed, Wenbo, Liu yunfeng

AI总结:

本文提出MateICL方法,通过窗口划分与额外注意力校准层,缓解大规模上下文学习中的注意力分散,无需外部检索模型即可有效提升LLM性能。

摘要:

大型语言模型(LLMs)在上下文学习(ICL)中展现了卓越的能力。然而,预训练模型中固定的位置长度限制制约了示例的数量。近期扩展上下文的努力随着示例数量的增加而面临注意力分散的问题。本文提出了缓解大规模ICL中注意力分散的方法(MateICL),使LLMs在上下文规模增长时仍能维持有效的自注意力。我们首先将上下文划分为多个窗口,每个窗口填满至模型的上下文容量,并分别进行处理。接着,我们引入一个额外层来重新校准注意力权重,随着示例增加优先处理查询token。实验结果表明,MateICL能有效利用更大上下文来提升ICL性能。与基于检索的基线相比,MateICL无需外部训练检索模型即可持续取得更优表现。尽管近期推理策略有所进展(如32k token上下文),结果表明MateICL在计算资源受限环境中依然有益。代码公开于https://github.com/amurtadha/MateICL。

英文摘要:

Large Language Models (LLMs) have demonstrated remarkable capabilities in In-Context Learning (ICL). However, the fixed position length constraints in pre-trained models limit the number of demonstration examples. Recent efforts to extend context suffer from attention dispersion as the number of demonstrations increases. In this paper, we introduce Mitigating Attention Dispersion in large-scale ICL (MateICL) that enables LLMs to maintain effective self-attention as the context size grows. We first split the context into multiple windows, each filled to the model's context capacity, which are processed separately. Then, we introduce an additional layer to recalibrate the attention weights, prioritizing the query tokens as the number of demonstrations increases. Our empirical results show that MateICL can effectively leverage larger contexts to improve ICL performance. Compared to retrieval-based baselines, MateICL consistently achieves better performance without requiring an externally trained retrieval model. Despite recent advances in inference strategies (e.g., 32k token contexts), our results demonstrate that MateICL remains beneficial in computationally resource-constrained settings. The code is publicly available at https://github.com/amurtadha/MateICL.

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

↑