| --- |
| library_name: kvpress |
| license: cc-by-nc-4.0 |
| pipeline_tag: text-generation |
| tags: |
| - kv-cache-compression |
| - long-context |
| - lora |
| --- |
| |
| # RestoreKV Checkpoints |
|
|
| Trained restore-token embeddings + LoRA adapters for |
| **RestoreKV** ([paper](https://arxiv.org/abs/2608.01247) | [project page](https://paper.pnu-cvsp.com/RestoreKV/)), a budget-matched, |
| single-pass plug-in that recovers full-cache behavior under aggressive |
| query-agnostic KV cache eviction (built on |
| [KVzip](https://github.com/snu-mllab/KVzip)). |
|
|
| Each checkpoint stores only the 8 restore-token embeddings and the rank-8 LoRA |
| adapters (~0.4% of the backbone; ~41 MB). The base model weights are **not** |
| included — load them from their original repositories. |
|
|
| | File | Backbone | Base scorer | |
| |---|---|---| |
| | `llama3.1-8b_restorekv.pt` | meta-llama/Llama-3.1-8B-Instruct | KVzip | |
| | `llama3.1-8b_restorekv_plus.pt` | meta-llama/Llama-3.1-8B-Instruct | KVzip+ | |
| | `qwen3-8b_restorekv.pt` | Qwen/Qwen3-8B | KVzip | |
| | `qwen3-8b_restorekv_plus.pt` | Qwen/Qwen3-8B | KVzip+ | |
|
|
| ## Usage (KVPress) |
|
|
| ```python |
| from kvpress import RestoreKVPress |
| press = RestoreKVPress( |
| compression_ratio=0.9375, # 16x |
| checkpoint_path="llama3.1-8b_restorekv.pt", # downloaded from this repo |
| budget_matched=True, |
| ) |
| ``` |
|
|
| Evaluate with the official KVPress protocol (RULER-4096, Llama-3.1-8B): |
|
|
| ```bash |
| python evaluate.py --dataset ruler --data_dir 4096 \ |
| --model meta-llama/Llama-3.1-8B-Instruct \ |
| --press_name RestoreKV --compression_ratio 0.875 \ |
| --restore_checkpoint llama3.1-8b_restorekv.pt |
| ``` |
|
|
| For the `*_plus.pt` checkpoints, use the KVzip+ variant |
| (`--press_name RestoreKV_plus`). |
|
|
| ## License |
|
|
| Released under **CC BY-NC 4.0** (research / non-commercial use only). These |
| checkpoints are distilled using a training mixture that contains |
| [LongAlpaca](https://huggingface.co/datasets/Yukang/LongAlpaca-12k)-derived |
| self-study data, so they inherit its most restrictive component license |
| (CC BY-NC 4.0). |