Context Compression for Auto-regressive Transformers with Sentinel Tokens

Siyu Ren, Qi Jia, Kenny Q. Zhu
10/12/2023
cs.CL
transformer-attention

No confident code implementation found for this paper.

Abstract

The quadratic complexity of the attention module makes it gradually become the bulk of compute in Transformer-based LLMs during generation. Moreover, the excessive key-value cache that arises when dealing with long inputs also brings severe issues on memory footprint and inference latency.

Show full abstract

In this work, we propose a plug-and-play approach that is able to incrementally compress the intermediate activation of a specified span of tokens into compact ones, thereby reducing both memory and computational cost when processing subsequent context. Experiments on both in-domain language modeling and zero-shot open-ended document generation demonstrate the advantage of our approach over sparse attention baselines in terms of fluency, n-gram matching, and semantic similarity. At last, we comprehensively profile the benefit of context compression on improving the system throughout. Code is available at https://github.com/DRSY/KV_Compression.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ren2023context,
  title  = {Context Compression for Auto-regressive Transformers with Sentinel Tokens},
  author = {Siyu Ren and Qi Jia and Kenny Q. Zhu},
  year   = {2023},
  eprint = {2310.08152},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.08152v2}
}

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/2310.08152.svg)](https://codeofpaper.com/paper/2310.08152)

Discussion