SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.06262 · 2024

On the Efficacy of Eviction Policy for Key-Value Constrained Generative Language Model Inference

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 7 functions out of this paper's own repositories and ran 7 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
drsy/easykv canonical 7 of 7
FunctionStatusWhere it lives
repeat_kv Ran drsy/easykv/easykv/llama_patch.py
pointer only (licence: NONE) · get_code("30d7eec482ebf6b1")
apply_grouped_rotary_pos_emb Ran drsy/easykv/easykv/llama_patch.py
pointer only (licence: NONE) · get_code("79567d2173f30f8d")
apply_rotary_pos_emb_sep Ran drsy/easykv/easykv/mistral_patch.py
pointer only (licence: NONE) · get_code("8869f3ae73d37f2c")
cache_size Ran drsy/easykv/easykv/easykv.py
pointer only (licence: NONE) · get_code("afa07c0f7e539ce7")
entropy Ran drsy/easykv/easykv/easykv.py
pointer only (licence: NONE) · get_code("5f9c91cf82e9ea48")
relu_normalize Ran drsy/easykv/easykv/easykv.py
pointer only (licence: NONE) · get_code("6264652451270da5")
rotate_half Ran drsy/easykv/easykv/llama_patch.py
pointer only (licence: NONE) · get_code("b99eea6376d1e212")

Repositories linked to this paper

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

Abstract

Despite the recent success associated with Large Language Models (LLMs), they are notably cost-prohibitive to deploy in resource-constrained environments due to their excessive memory and computational demands. In addition to model parameters, the key-value cache is also stored in GPU memory, growing linearly with batch size and sequence length. As a remedy, recent works have proposed various eviction policies for maintaining the overhead of key-value cache under a given budget. This paper embarks on the efficacy of existing eviction policies in terms of importance score calculation and eviction scope construction. We identify the deficiency of prior policies in these two aspects and introduce RoCo, a robust cache omission policy based on temporal attention scores and robustness measures. Extensive experimentation spanning prefilling and auto-regressive decoding stages validates the superiority of RoCo. Finally, we release EasyKV, a versatile software package dedicated to user-friendly key-value constrained generative inference. Code available at https://github.com/DRSY/EasyKV.

For agents

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

get_harvested_code_for_paper("2402.06262")
get_code_for_paper("2402.06262")
have("2402.06262")

Connect an agent — have() is free.