SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.12335 · EMNLP · 2024

Attention Score is not All You Need for Token Importance Indicator in KV Cache Reduction: Value Also Matters

Taro Watanabe, Hidetaka Kamigaito, Zhiyu Guo

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 4 functions out of this paper's own repositories and ran 3 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
guozhiyu/vatp — 3 of 4
FunctionStatusWhere it lives
LlamaDynamicNTKScalingRotaryEmbedding Ran guozhiyu/vatp/utils_hh/modify_llama.py
pointer only (licence: NONE) · get_code("3613d71443ec2450")
LlamaLinearScalingRotaryEmbedding Ran guozhiyu/vatp/utils_hh/modify_llama.py
pointer only (licence: NONE) · get_code("bc8fe21daaeb0c58")
LlamaRotaryEmbedding Ran guozhiyu/vatp/utils_hh/modify_llama.py
pointer only (licence: NONE) · get_code("5151d2a6b2115e55")
LlamaAttention_heavy_hitter Not yet run guozhiyu/vatp/utils_hh/modify_llama.py
pointer only (licence: NONE) · get_code("3189b3bd863c2fad")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Scaling the context size of large language models (LLMs) enables them to perform various new tasks, e.g., book summarization. However, the memory cost of the Key and Value (KV) cache in attention significantly limits the practical applications of LLMs. Recent works have explored token pruning for KV cache reduction in LLMs, relying solely on attention scores as a token importance indicator. However, our investigation into value vector norms revealed a notably non-uniform pattern questioning their reliance only on attention scores. Inspired by this, we propose a new method: Value-Aware Token Pruning (VATP) which uses both attention scores and the ℓ 1 norm of value vectors to evaluate token importance. Extensive experiments on LLaMA2-7B-chat and Vicuna-v1.5-7B across 16 LongBench tasks demonstrate that VATP outperforms attention-score-only baselines in over 12 tasks, confirming the effectiveness of incorporating value vector norms into token importance evaluation of LLMs. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.12335")
get_code_for_paper("2406.12335")
have("2406.12335")

Connect an agent — have() is free.