Sentence-Anchored Gist Compression for Long-Context LLMs
Dmitrii Tarasov, Elizaveta Goncharova, Kuznetsov Andrey
TL;DR
The paper tackles the bottleneck of long-context processing in LLMs by learning a set of sentence-anchored gist tokens that compress history into a compact conditioning context. It extends the LM with $N_g$ gist tokens, inserts them at sentence boundaries, and uses a modified attention mask to let the gist tokens aggregate information across segments while regular tokens attend locally. Training follows a three-stage, end-to-end LM objective without reconstruction losses, achieving $2\times$ to $8\times$ KV-cache compression with minimal degradation on short- and long-context benchmarks, including a 3B LLaMA model. This scalable approach offers a practical path to efficient long-context inference with modest architectural changes and competitive performance relative to existing compression methods.
Abstract
This work investigates context compression for Large Language Models (LLMs) using learned compression tokens to reduce the memory and computational demands of processing long sequences. We demonstrate that pre-trained LLMs can be fine-tuned to compress their context by factors of 2x to 8x without significant performance degradation, as evaluated on both short-context and long-context benchmarks. Furthermore, in experiments on a 3-billion-parameter LLaMA model, our method achieves results on par with alternative compression techniques while attaining higher compression ratios.
