Add RestoreKV checkpoints (Llama-3.1-8B, Qwen3-8B; base + plus)
Browse files- README.md +50 -0
- llama3.1-8b_restorekv.pt +3 -0
- llama3.1-8b_restorekv_plus.pt +3 -0
- qwen3-8b_restorekv.pt +3 -0
- qwen3-8b_restorekv_plus.pt +3 -0
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- kv-cache-compression
|
| 5 |
+
- long-context
|
| 6 |
+
- lora
|
| 7 |
+
library_name: kvpress
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# RestoreKV Checkpoints
|
| 11 |
+
|
| 12 |
+
Trained restore-token embeddings + LoRA adapters for
|
| 13 |
+
**RestoreKV** ([paper](https://arxiv.org/abs/2608.01247)), a budget-matched,
|
| 14 |
+
single-pass plug-in that recovers full-cache behavior under aggressive
|
| 15 |
+
query-agnostic KV cache eviction (built on
|
| 16 |
+
[KVzip](https://github.com/snu-mllab/KVzip)).
|
| 17 |
+
|
| 18 |
+
Each checkpoint stores only the 8 restore-token embeddings and the rank-8 LoRA
|
| 19 |
+
adapters (~0.4% of the backbone; ~41 MB). The base model weights are **not**
|
| 20 |
+
included — load them from their original repositories.
|
| 21 |
+
|
| 22 |
+
| File | Backbone | Base scorer |
|
| 23 |
+
|---|---|---|
|
| 24 |
+
| `llama3.1-8b_restorekv.pt` | meta-llama/Llama-3.1-8B-Instruct | KVzip |
|
| 25 |
+
| `llama3.1-8b_restorekv_plus.pt` | meta-llama/Llama-3.1-8B-Instruct | KVzip+ |
|
| 26 |
+
| `qwen3-8b_restorekv.pt` | Qwen/Qwen3-8B | KVzip |
|
| 27 |
+
| `qwen3-8b_restorekv_plus.pt` | Qwen/Qwen3-8B | KVzip+ |
|
| 28 |
+
|
| 29 |
+
## Usage (KVPress)
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
from kvpress import RestoreKVPress
|
| 33 |
+
press = RestoreKVPress(
|
| 34 |
+
compression_ratio=0.9375, # 16x
|
| 35 |
+
checkpoint_path="llama3.1-8b_restorekv.pt", # downloaded from this repo
|
| 36 |
+
budget_matched=True,
|
| 37 |
+
)
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
Evaluate with the official KVPress protocol (RULER-4096, Llama-3.1-8B):
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
python evaluate.py --dataset ruler --data_dir 4096 \
|
| 44 |
+
--model meta-llama/Llama-3.1-8B-Instruct \
|
| 45 |
+
--press_name RestoreKV --compression_ratio 0.875 \
|
| 46 |
+
--restore_checkpoint llama3.1-8b_restorekv.pt
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
For the `*_plus.pt` checkpoints, use the KVzip+ variant
|
| 50 |
+
(`--press_name RestoreKV_plus`).
|
llama3.1-8b_restorekv.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9511ff553f637eae96a8e6284e6a1db11af12a977c7146d242f08c75b8081705
|
| 3 |
+
size 42158929
|
llama3.1-8b_restorekv_plus.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36134fea178e3a6d7e5d99ae30fbb69ef28491fac7ee44f822654e1ed190d90f
|
| 3 |
+
size 42158929
|
qwen3-8b_restorekv.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89a1ec90dea5f826aa831bff71d63a8ea43dc6cb55f8030bfe80302f468379f4
|
| 3 |
+
size 43881281
|
qwen3-8b_restorekv_plus.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb634cff1aab0f0dc44ef7eae24833565fdb792b4e69cd8bba7fdbb69dda2c0f
|
| 3 |
+
size 43881281
|