Snapkv Llm Knows What You Are Looking For Before Generation 2024 04 22
- Source
- cohere.com
- Publisher
- Cohere
- Author
- Cohere
- Date

Context
SnapKV reduces the memory a needs to hold a long prompt while it writes an answer. The model keeps a key-value (KV) cache, stored attention information about earlier input, and the abstract says this cache grows with input length, straining memory and time. SnapKV finds that each attention head (one of the model's parallel attention components) consistently focuses on particular prompt positions, a pattern visible in an window at the end of the prompt. It then compresses the cache by selecting clustered important positions for each head, without fine-tuning the model. Publisher abstract.
The authors' abstract, hosted by Cohere, reports a 3.6 times increase in generation speed and an 8.2 times improvement in memory efficiency over the baseline at 16,000 input tokens, with comparable performance across 16 long-sequence datasets. These are results under the authors' experimental conditions, supporting selective cache compression as an efficiency technique rather than establishing that every task can discard the same information safely. This explanation rests on the abstract only, not a review of the full paper. Published abstract.
- Large language model — A model trained on large amounts of data to process and generate language.
- Observation — The result the harness returns into the context after executing a tool: contents, a listing, a status or an error.
- KV cache — The memory a model keeps about text it has already read, so generating each new token doesn't require reprocessing the whole conversation.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.




