arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.08907cs.CL
收藏

无需自动编码的上下文压缩用于LLM:通过上下文语义锚点

Autoencoding-Free Context Compression for LLMs via Contextual Semantic Anchors

School of Computer Science and Engineering, Northeastern University, Shenyang, China(东北大学计算机科学与工程学院,中国沈阳);NiuTrans Research, Shenyang, China(沈阳NiuTrans研究院,中国);Kunming University of Science and Technology, Kunming, China(昆明理工大学,中国昆明)

Xin Liu, Runsong Zhao, Pengcheng Huang, Xinyu Liu, Junyi Xiao, Chunyang Xiao, Tong Xiao, Shengxiang Gao, Zhengtao Yu, Jingbo Zhu

AI总结:

SAC通过引入锚点嵌入和双向注意力修改,无需自动编码即可实现更高效的上下文压缩,提升问答和长上下文摘要任务性能。

摘要:

上下文压缩是一种高级技术,通过将长输入转换为紧凑的表示来加速大型语言模型(LLM)的推理过程。现有方法主要依赖于自动编码任务来训练特殊的压缩标记以表示上下文语义。虽然自动编码任务使压缩标记能够获得压缩能力,但我们指出这种能力可能与实际下游任务需求相冲突,阻碍模型学习更适用于实际应用的特征。基于这一观察,我们提出了语义锚点压缩(SAC),一种新的方法,从基于自动编码任务的压缩转向一种具备这种压缩能力的架构。而不是通过自动编码任务训练模型压缩上下文,SAC直接从原始上下文中选择所谓的锚点标记,并将上下文信息聚合到它们的键值(KV)表示中。为了确保锚点能够有效收集信息,SAC引入了两个关键设计:(1)锚点嵌入,一个附加到所选锚点标记上的可学习嵌入向量以标记压缩载体;(2)双向注意力修改,使锚点标记能够整合来自整个上下文的信息。实验结果表明,SAC在不同压缩比和模型大小的问答和长上下文摘要任务中始终优于现有上下文压缩方法。我们的数据、模型和代码已发布在https://github.com/lx-Meteors/SAC。

英文摘要:

Context compression is an advanced technique that accelerates large language model (LLM) inference by converting long inputs into compact representations. Existing methods primarily rely on autoencoding tasks to train special compression tokens to represent contextual semantics. While autoencoding tasks enable compression tokens to acquire compression capabilities, we remark that such capabilities potentially conflict with actual downstream task requirements, prevent the models from learning the features more beneficial for real-world usage. Based on this observation, we propose Semantic-Anchor Compression (SAC), a novel method that shifts from autoencoding task based compression to an architecture that is equipped with this compression capability \textit{a priori}. Instead of training models to compress contexts through autoencoding tasks, SAC directly selects so-called anchor tokens from the original context and aggregates contextual information into their key-value (KV) representations. To ensure that anchors can effectively collect information, SAC introduces two key designs: (1) anchor embedding, a learnable embedding vector attached to the selected anchor tokens to mark compression carriers and (2) bidirectional attention modification, which enables anchor tokens to integrate information from the entire context. Experimental results show that SAC consistently outperforms existing context compression methods across different compression ratios and model sizes on question-answering and long-context summarization tasks. Our data, model and code have been released at \href{https://github.com/lx-Meteors/SAC}{https://github.com/lx-Meteors/SAC}.

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

↑