EdgeLLM-Nano: Auditing Polar-Guided Key-Cache Compression and Consistency-Anchored Pruning on a 33.6 MB On-Device Language Model
Organizations: Causal Dynamics Lab · Electrical Engineering and Computer Science Department, University of Missouri-Columbia · Computer Science & Engineering, University of Chittagong
Abstract
Deploying language models (LMs) on the edge presents unique memory, latency, and power challenges absent in high-performance computing. KV-cache compression emerges as a promising approach to address these challenges. However, the effectiveness of current KV-cache compression methods has not been thoroughly examined on edge devices. Moreover, we show that existing evaluation methods do not always involve the KV-cache under test. We propose EdgeLLM-Nano, a measurement study of KV-cache compression using a nano-scale decoder-only LM (transformer) testbed that has 8.39M parameters, i.e., 33.6 MB, to enable end-to-end examination of each backend, seed, and power sample. Our results give a negative verdict for a polar-guided key-cache quantizer (round-to-nearest (RTN) control causes an order of magnitude less damage), as well as a consistency-anchored progressive weight pruner (one-shot magnitude-based pruning performs as well as, if not better). We also introduce Long-Context Decode Fidelity (LCDF) evaluation, a token-by-token examination of teacher-forced log-losses using the KV-cache under test. Unlike perplexity that gives the same 5.461 score to all methods, LCDF distinguishes different KV-cache compression backends thanks to its paired statistics across seeds and effect sizes. Our companion Raspberry Pi 5 measurement shows all compression backends we tested to be less energy-efficient per token compared to uncompressed FP16 inference. Except for KIVI that is close to lossless in terms of LCDF, our findings indicate KV-cache compression can be improved. LCDF offers a simple and effective way of shedding light on KV-cache compression methods, whose negative impacts have been overlooked by perplexity.
Figures & tables
| Method | Venue | Lane | Core mechanism | Bits/elt | Cache eval | LCDF verdict |
|---|---|---|---|---|---|---|
| KIVI [ 3 ] | ICML’24 | K V | Per-channel K, per-token V, tuning-free | 2.99 / 3.79 † | Yes | Near-free: ; |
| KVQuant [ 8 ] ‡ | NeurIPS’24 | K V | Calib. per-channel outlier fallback | 3.50 | Yes | Small, significant: |
| QuaRot [ 9 ] | NeurIPS’24 | K V | Global Hadamard RTN | 4.00 | Yes | Small, significant: |
| SnapKV [ 10 ] | NeurIPS’24 | K V | Attention-guided eviction | 16, no eviction | Yes | Jitter below ; wrapper overhead |
| QJL [ 11 ] | AAAI’25 | K | 1-bit JL sign projection | PGKQ component | Yes | Never earns its bits here |
| RotateKV [ 2 ] | IJCAI’25 | K V | Channel reorder FWHT | — | Yes | Not measured; shares PGKQ steps 1–2 |
| Model | Tokenizer | Vocab | Params | Steps | Val ppl |
|---|---|---|---|---|---|
| NanoGPT-256 char | byte | 256 | 6.36 M | 20 000 | 1.846 |
| NanoGPT-256 BPE | SP-BPE | 8 192 | 8.39 M ∗ | 20 000 | 5.117 |
| GPT-2-124M scale | tiktoken-gpt2 | 50 257 | 124 M | 2 000 | 8.225 |
| Backend | TPS mean [range] | p99 ms mean [range] | KV bytes |
|---|---|---|---|
| fw-default, native | 265.94 [265.49, 266.48] | 3.91 [3.87, 3.96] | N/A |
| FP16 | 232.16 [231.97, 232.45] | 4.46 [4.46, 4.47] | 786 432 |
| KIVI | 197.80 [196.87, 198.86] | 5.23 [5.17, 5.26] | 147 456 |
| KVQuant-style | 187.14 [186.89, 187.43] | 5.54 [5.51, 5.56] | 172 032 |
| QuaRot | 94.97 [94.89, 95.01] | 10.81 [10.77, 10.84] | 196 608 |
| SnapKV | 219.33 [218.41, 220.03] | 4.73 [4.70, 4.76] | 786 432 |
| Backend | Mean [range] | Sig. | 124M, sig. | |
|---|---|---|---|---|
| KIVI | 0.0053 [ 0.0032,0.0239] | 3/6 | [ 0.05,0.60] | 0.001; 3/6 |
| KVQuant-style | 0.0254 [0.0084,0.0478] | 6/6 | [0.03,1.00] | 0.006; 5/6 |
| QuaRot | 0.0117 [ 0.0128,0.0333] | 6/6 | [ 0.38,1.00] | 0.009; 5/6 |
| SnapKV | 2/6 | [ 0.03,0.33] | ; 2/6 | |
| PGKQ K | 0.1908 [0.0795,0.2806] | 6/6 | [0.17,1.00] | 0.037; 3/6 |
| PGKQ-KV k3v3 | 0.3190 [0.1982,0.5463] | 6/6 | [0.38,1.00] | 0.112; 6/6 |
| TinyStories ppl | ||||||
|---|---|---|---|---|---|---|
| Target | Recov. | PSPCA | W | M | SG rand / real | Rand. |
| 0.30 | 5.60 0.11 | 5.65 0.06 | 5.39 | 5.49 / 5.36 | 56.5 | |
| 0.50 | 7.08 0.17 | 7.06 0.13 | 7.19 | 7.70 / 5.84 | ||
| 0.70 | 19.77 0.53 | 24.22 1.06 | 16.90 | 26.51 / 10.62 | ||
KV-Cache Compression
Key-value cache compression reduces the memory and bandwidth needed to retain attention states during long-context inference.
See all 265 papers