arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.19318cs.CLcs.AIcs.LG
收藏

两个胜过一个:利用多粒度自注入扩展上下文窗口

Two are better than one: Context window extension with multi-grained self-injection

Singapore University of Technology and Design(新加坡科技设计大学);Skywork AI(天工AI);Singapore Management University(新加坡管理大学)

Wei Han, Pan Zhou, Soujanya Poria, Shuicheng Yan

AI总结:

针对 LLM 上下文窗口有限而长上下文持续预训练成本高昂的问题,本文提出 SharedLLM,用两个短上下文模型协同实现多粒度压缩、查询感知检索与自注入。

摘要:

当代大型语言模型(LLM)有限的上下文窗口仍然是其在各领域更广泛应用的巨大障碍。尽管在长上下文数据上进行持续预训练是一种直接且有效的解决方案,但它会在数据获取和计算资源方面产生高昂成本。为缓解这一问题,我们提出 SharedLLM,这是一种基于多粒度上下文压缩和查询感知信息检索设计理念的新颖方法。SharedLLM 由两个短上下文 LLM(例如 LLaMA-2)组成,分别称为上层模型和下层模型。下层模型充当压缩器,而上层模型充当解码器。上层模型接收来自下层模型的、经过压缩的多粒度上下文信息,并对正在处理的文本执行上下文感知建模。压缩器与解码器之间的信息传递仅发生在最低层,以避免下层模型中的长前向路径,以及上层模型中冗余的交叉注意力模块。基于该架构,我们引入一种专门的树状数据结构,以高效地编码、存储和检索文本块的多粒度上下文信息。该结构与搜索算法相结合,能够根据输入查询从树的不同层级快速编码并检索相关信息。发送方和接收方源自同一 LLM 层的整个过程被称为自注入。

英文摘要:

The limited context window of contemporary large language models (LLMs) remains a huge barrier to their broader application across various domains. While continual pre-training on long-context data is a straightforward and effective solution, it incurs substantial costs in terms of data acquisition and computational resources. To alleviate this issue, we propose SharedLLM, a novel approach grounded in the design philosophy of multi-grained context compression and query-aware information retrieval. SharedLLM is composed of two short-context LLMs such as LLaMA-2, termed upper model and lower model. The lower model functions as a compressor while the upper model acts as a decoder. The upper model receives compressed, multi-grained context information from the lower model and performs context-aware modeling on the running text. Information transfer between the compressor and decoder occurs only at the lowest layers to refrain from long forward paths in the lower model and redundant cross-attention modules in the upper model. Based on this architecture, we introduce a specialized tree-style data structure to efficiently encode, store and retrieve multi-grained contextual information for text chunks. This structure, combined with a search algorithm, enables rapid encoding and retrieval of relevant information from various levels of the tree based on the input query. This entire process, wherein the sender and receiver are derived from the same LLM layer, is referred to as self-injection.

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

↑