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

在线语言模型交互的压缩上下文记忆

Compressed Context Memory For Online Language Model Interaction

Seoul National University(首尔大学);NAVER AI Lab(NAVER人工智能实验室)

Jang-Hyun Kim, Junyoung Yeom, Sangdoo Yun, Hyun Oh Song

AI总结:

本文提出一种压缩上下文记忆系统,通过轻量级条件LoRA在推理时持续压缩注意力键/值对,以5倍更小的记忆大小达到全上下文模型性能,并适用于无限长度的流式场景。

摘要:

本文针对在线场景中上下文持续扩展的Transformer语言模型,提出了一种上下文键/值压缩方法。随着上下文变长,注意力过程需要更多的内存和计算,从而降低了语言模型的吞吐量。为了解决这一挑战,我们提出了一种压缩上下文记忆系统,该系统将不断累积的注意力键/值对持续压缩到一个紧凑的记忆空间中,从而在计算环境的有限内存空间内促进语言模型推理。我们的压缩过程涉及在推理期间将轻量级条件LoRA集成到语言模型的前向传递中,无需微调模型的全部权重。通过将递归压缩过程建模为单个并行化的前向计算,我们实现了高效训练。通过对对话、个性化和多任务学习的评估,我们证明了我们的方法在上下文记忆大小缩小5倍的情况下达到了全上下文模型的性能水平。我们进一步证明了我们的方法在无限上下文长度的流式设置中的适用性,优于滑动窗口方法。代码可在https://github.com/snu-mllab/context-memory获取。

英文摘要:

This paper presents a context key/value compression method for Transformer language models in online scenarios, where the context continually expands. As the context lengthens, the attention process demands increasing memory and computations, which in turn reduces the throughput of the language model. To address this challenge, we propose a compressed context memory system that continually compresses the accumulating attention key/value pairs into a compact memory space, facilitating language model inference in a limited memory space of computing environments. Our compression process involves integrating a lightweight conditional LoRA into the language model's forward pass during inference, without the need for fine-tuning the model's entire set of weights. We achieve efficient training by modeling the recursive compression process as a single parallelized forward computation. Through evaluations on conversation, personalization, and multi-task learning, we demonstrate that our approach achieves the performance level of a full context model with $5\times$ smaller context memory size. We further demonstrate the applicability of our approach in a streaming setting with an unlimited context length, outperforming the sliding window approach. Codes are available at https://github.com/snu-mllab/context-memory.

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

↑