Update README.md
Browse files
README.md
CHANGED
|
@@ -15,34 +15,15 @@ tags:
|
|
| 15 |
|
| 16 |
# TrimKV: Token Retention for Memory-Bounded Key-Value Eviction
|
| 17 |
|
| 18 |
-
This repository contains the weights for **TRIM-KV-Qwen3-1.7B-Math**, presented in the paper [
|
| 19 |
|
| 20 |
-
The
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
### Why TRIM-KV?
|
| 29 |
-
|
| 30 |
-
It's fast
|
| 31 |
-
<div align="center">
|
| 32 |
-
<img width="1000" alt="teaser" src="https://github.com/ngocbh/trimkv/blob/main/assets/speed.png?raw=true"/>
|
| 33 |
-
</div>
|
| 34 |
-
|
| 35 |
-
It's smart
|
| 36 |
-
<div align="center">
|
| 37 |
-
<img width="1000" alt="teaser" src="https://github.com/ngocbh/trimkv/blob/main/assets/performance.png?raw=true"/>
|
| 38 |
-
</div>
|
| 39 |
-
|
| 40 |
-
And it's interpretable
|
| 41 |
-
<div align="center">
|
| 42 |
-
<img width="1000" alt="teaser" src="https://github.com/ngocbh/trimkv/blob/main/assets/eviction.png?raw=true"/>
|
| 43 |
-
</div>
|
| 44 |
-
|
| 45 |
-
---
|
| 46 |
|
| 47 |
## Quick Start
|
| 48 |
|
|
@@ -94,6 +75,12 @@ past_key_values = PagedTrimKVCache(
|
|
| 94 |
## Citation
|
| 95 |
|
| 96 |
```bibtex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
@article{bui2025make,
|
| 98 |
title={Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction},
|
| 99 |
author={Bui, Ngoc and Nguyen, Hieu Trung and Cohan, Arman and Ying, Rex},
|
|
|
|
| 15 |
|
| 16 |
# TrimKV: Token Retention for Memory-Bounded Key-Value Eviction
|
| 17 |
|
| 18 |
+
This repository contains the weights for **TRIM-KV-Qwen3-1.7B-Math**, as presented in the paper [Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMs](https://huggingface.co/papers/2512.03324).
|
| 19 |
|
| 20 |
+
The core idea behind TRIM-KV is to learn the intrinsic importance of each key–value pair at creation time, which we call *token retention*, and then decay this importance exponentially over time to mimic standard inference running with eviction.
|
| 21 |
|
| 22 |
+
The retention score is query-agnostic and captures the long-term utility of tokens. This is different from attention scores, which are query-dependent: they capture the short-term utility for predicting the next token and are recomputed at every step.
|
| 23 |
|
| 24 |
+
- **Paper:** [Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMs](https://huggingface.co/papers/2605.09649)
|
| 25 |
+
- **Code:** [GitHub - ngocbh/trimkv](https://github.com/ngocbh/trimkv)
|
| 26 |
+
- **Arxiv:** [2512.03324](https://arxiv.org/abs/2512.03324)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
## Quick Start
|
| 29 |
|
|
|
|
| 75 |
## Citation
|
| 76 |
|
| 77 |
```bibtex
|
| 78 |
+
@article{bui2025cache,
|
| 79 |
+
title={Cache what lasts: Token retention for memory-bounded kv cache in llms},
|
| 80 |
+
author={Bui, Ngoc and Sharma, Shubham and Lamba, Simran and Mishra, Saumitra and Ying, Rex},
|
| 81 |
+
journal={arXiv preprint arXiv:2512.03324},
|
| 82 |
+
year={2025}
|
| 83 |
+
}
|
| 84 |
@article{bui2025make,
|
| 85 |
title={Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction},
|
| 86 |
author={Bui, Ngoc and Nguyen, Hieu Trung and Cohan, Arman and Ying, Rex},
|