Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

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

About

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.

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

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K
Accuracy37.76
1398
Question AnsweringHotpotQA
EM26.92
173
Question AnsweringSQuAD
F162.53
162
Multi-hop Question Answering2WikiMQA
F1 Score37.78
161
Question AnsweringSQuAD (test)
F164.3
156
Long-context Language UnderstandingLongBench (test)
Average Score21.8
147
Question AnsweringHotpotQA
F166.16
132
Question AnsweringQASPER (test)
F1 Score (Match)17.62
132
Language Model EvaluationBenchPress short-context (test)
Accuracy49.18
131
Context Compression EvaluationBenchPress suite macro-averaged across all datasets
Macro-averaged F142.4
130
Showing 10 of 81 rows
...

Other info

Follow for update