Reproduce “Context Compression for Auto-regressive Transformers with Sentinel Tokens” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Siyu Ren, Qi Jia, Kenny Q. Zhu

Researchers from Shanghai Jiao Tong University and the University of Texas at Arlington developed KV Compression, a plug-and-play method that incrementally compresses key-value cache in auto-regressive Transformers using special sentinel tokens and a modified attention mechanism. This approach reduces memory footprint and computational cost, yielding up to 1.5x throughput improvement and superior language modeling and generation quality compared to sparse attention baselines.

Key insights

  • A plug-and-play compression method can be effectively integrated into existing LLMs without requiring full architectural redesign or pre-training from scratch, by only fine-tuning new token embeddings and LoRA modules.
  • Carefully designed attention masking with sentinel tokens can teach the model to selectively distill and retain essential information from long contexts into compact representations.
  • Training with higher compression ratios during fine-tuning leads to better generalization across various test-time compression ratios, indicating that forcing the model to effectively compress early on improves its overall compression capabilities.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.