用压缩与筛选机制让大模型高效处理大量编辑指令
InComeS: Integrating Compression and Selection Mechanisms into LLMs for Efficient Model Editing
- 引入特制摘要令牌压缩编辑内容,突破上下文长度限制
- 通过交叉注意力动态选择关键信息,提升多条编辑的处理效率
- 适用于需要频繁更新知识的大模型场景,如持续学习
现有模型编辑方法在复现精确事实方面表现良好,但在需要深层语义理解的复杂场景中表现不佳。利用大语言模型(LLMs)强大的上下文推理能力,上下文学习(ICL)通过上下文编码理解编辑信息,成为有前景的编辑方式。然而,该方法受限于LLMs的有限上下文窗口,随着编辑数量增加,性能和效率显著下降。为此,我们提出InComeS框架,通过显式的压缩与选择机制增强LLM对编辑上下文的处理能力。具体而言,InComeS将每个编辑上下文压缩为特殊摘要令牌的键值(KV)缓存,实现无需受模型上下文窗口限制的多编辑高效处理。此外,新增的交叉注意力模块可动态从摘要池中选择最相关的信息,实现编辑信息的自适应高效利用。我们在多种模型编辑基准上进行了实验,涵盖不同编辑格式,结果证明了该方法的有效性与高效性。
原文摘要 · Abstract (English)
Although existing model editing methods perform well in recalling exact edit facts, they often struggle in complex scenarios that require deeper semantic understanding rather than mere knowledge regurgitation. Leveraging the strong contextual reasoning abilities of large language models (LLMs), in-context learning (ICL) becomes a promising editing method by comprehending edit information through context encoding. However, this method is constrained by the limited context window of LLMs, leading to degraded performance and efficiency as the number of edits increases. To overcome this limitation, we propose InComeS, a flexible framework that enhances LLMs' ability to process editing contexts through explicit compression and selection mechanisms. Specifically, InComeS compresses each editing context into the key-value (KV) cache of a special gist token, enabling efficient handling of multiple edits without being restricted by the model's context window. Furthermore, specialized cross-attention modules are added to dynamically select the most relevant information from the gist pools, enabling adaptive and effective utilization of edit information. We conduct experiments on diverse model editing benchmarks with various editing formats, and the results demonstrate the effectiveness and efficiency of our method.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。