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

用于大型语言模型上下文压缩的上下文内自编码器

In-context Autoencoder for Context Compression in a Large Language Model

Microsoft Corporation(微软公司)

Tao Ge, Jing Hu, Lei Wang, Xun Wang, Si-Qing Chen, Furu Wei

AI总结:

本文提出ICAE,将长上下文压缩为LLM可直接使用的紧凑记忆槽,仅增加约1%参数即在Llama上实现4倍压缩并降低推理延迟与显存成本。

摘要:

我们提出了上下文内自编码器(In-context Autoencoder,ICAE),它利用大型语言模型(LLM)的能力,将长上下文压缩为简短紧凑的记忆槽,LLM可直接以这些记忆槽为条件实现多种目的。ICAE首先在海量文本数据上使用自编码和语言建模两类目标进行预训练,使其能够生成准确、全面表示原始上下文的记忆槽。随后,它在指令数据上进行微调,以便针对各类提示生成理想的响应。实验表明,我们轻量级的ICAE仅引入约1%的额外参数,便在Llama基础上有效实现了4倍上下文压缩,在推理期间同时带来更低延迟和GPU显存成本方面的优势,并展现出关于记忆的有趣洞见以及可扩展性潜力。这些有前景的结果意味着,认知科学中的工作记忆与LLM中的表征学习之间的关联具有新的研究视角,揭示了ICAE在解决长上下文问题上的重要意义,并表明可进一步研究LLM上下文管理。我们的数据、代码和模型可在https://github.com/getao/icae获取。

英文摘要:

We propose the In-context Autoencoder (ICAE), leveraging the power of a large language model (LLM) to compress a long context into short compact memory slots that can be directly conditioned on by the LLM for various purposes. ICAE is first pretrained using both autoencoding and language modeling objectives on massive text data, enabling it to generate memory slots that accurately and comprehensively represent the original context. Then, it is fine-tuned on instruction data for producing desirable responses to various prompts. Experiments demonstrate that our lightweight ICAE, introducing about 1% additional parameters, effectively achieves $4\times$ context compression based on Llama, offering advantages in both improved latency and GPU memory cost during inference, and showing an interesting insight in memorization as well as potential for scalability. These promising results imply a novel perspective on the connection between working memory in cognitive science and representation learning in LLMs, revealing ICAE's significant implications in addressing the long context problem and suggesting further research in LLM context management. Our data, code and models are available at https://github.com/getao/icae.

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

↑