Recurrent Context Compression: Efficiently Expanding the Context Window of LLM

Chensen Huang, Guibo Zhu, Xuepeng Wang, Yifei Luo, Guojing Ge +3 more
6/10/2024
cs.CLcs.AI

Official code: WUHU-G/RCC_Transformer (110 stars, Apache-2.0, last commit 2024-06-13).

Abstract

To extend the context length of Transformer-based large language models (LLMs) and improve comprehension capabilities, we often face limitations due to computational resources and bounded memory storage capacity. This work introduces a method called Recurrent Context Compression (RCC), designed to efficiently expand the context window length of LLMs within constrained storage space. We also investigate the issue of poor model responses when both instructions and context are compressed in downstream tasks, and propose an instruction reconstruction method to mitigate this problem. We validated the effectiveness of our approach on multiple tasks, achieving a compression rate of up to 32x on text reconstruction tasks with a BLEU4 score close to 0.95, and nearly 100\% accuracy on a passkey retrieval task with a sequence length of 1M. Finally, our method demonstrated competitive performance in long-text question-answering tasks compared to non-compressed methods, while significantly saving storage resources in long-text inference tasks. Our code, models, and demo are available at https://github.com/WUHU-G/RCC_Transformer

View on arXivView PDF

Code Implementations(1)

Apache-2.0
1101PythonJun 9, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{huang2024recurrent,
  title  = {Recurrent Context Compression: Efficiently Expanding the Context Window of LLM},
  author = {Chensen Huang and Guibo Zhu and Xuepeng Wang and Yifei Luo and Guojing Ge and Haoran Chen and Dong Yi and Jinqiao Wang},
  year   = {2024},
  eprint = {2406.06110},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.06110v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.06110.svg)](https://codeofpaper.com/paper/2406.06110)

Discussion