# Shard: getting to 10x KV cache compression

- **ID:** 621
- **Kind:** other
- **URL:** https://krishgarg.com/shard
- **Authors:** Krish Garg
- **Venue:** krishgarg.com
- **Source:** web
- **Language:** en
- **Access:** free
- **License:** MIT
- **License family:** Permissive (auto-classified)
- **Tags:** shard, kv-cache, turboquant, pca, vector-quantization, llama, inference, blog, x
- **Topics:** KV cache compression, LLM inference
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Research status:** done
- **Needs deep evaluation:** no
- **Page:** https://papers.projxon.ai/entries/621

## Summary

Engineering writeup of Shard, a drop-in HuggingFace Cache. Reimplementing TurboQuant stalled around 4-6x; authors split K and V: undo RoPE then PCA+int4 on K (rank 192/1024, DP bit allocation with a 4x drop penalty) and Hadamard + 4-d vector quantization on V. Attention scores run on int4 PCA coeffs via a relative-Delta RoPE identity; V Hadamard is applied after the weighted sum. 4 FP16 sink tokens + 64-token recency window. Decode stream uses data-oblivious Hadamard+Lloyd-Max (8-bit path 750/750 FP16 match at 150 tokens). Llama-3.1-8B: 10x at 8K / 11.2x at 32K, NIAH recall 1.000 across 4K-32K, LongBench-E avg 16.19 vs FP16 16.24, WikiText-2 PPL +0.26%. Decode throughput 0.39-0.49x FP16, so a memory win not a latency win. Code krish1905/shard.

## Attributes

- **Purpose:** Compress Llama-3.1-8B KV about 10x with no NIAH or LongBench hit via asymmetric K/V methods
- **Scale:** Llama-3.1-8B-Instruct on one NVIDIA B200. 10.0x at 8K (102 MB stored) / 11.2x at 32K (366 MB). GitHub 97 stars / 10 forks at check.
- **Time period:** Tweet 2026-05-25. Discord posted 2026-05-26. Repo created 2026-04-18, pushed 2026-08-11.
- **Author type:** human

## Research notes

- Primary: technical blog. Discord/X https://x.com/krishgarg/status/2059041521576648980 via fxtwitter (also http://krishgarg.com/shard). Code https://github.com/krish1905/shard (MIT). Tweet credits @kirrithan; second author name not given so left off. Compares to TurboQuant arXiv 2504.19874 (ICLR 2026); papers_local id 606 is a different TurboQuant-related GitHub (RyanCodrai/turbovec). Inference method, not a new hosted corpus, so no datasets_local row.

## Similar entries

- [VBR: Variable Bit-Rate KV Cache for llama.cpp](https://papers.projxon.ai/entries/631) (code, #631)
- [Scaling KV Cache Compression to Frontier Models (X thread by @RampLabs)](https://papers.projxon.ai/entries/740) (thread, #740)
- [Cross-Model KV Cache Transfer in LLM Families: A Closed-Form Linear Mapping for Prefill Reuse](https://papers.projxon.ai/entries/450) (paper, #450)
- [WeDLM: Reconciling Diffusion Language Models with Standard Causal Attention for Fast Inference](https://papers.projxon.ai/entries/1118) (paper, #1118)
- [n8loom](https://papers.projxon.ai/entries/595) (code, #595)
- [KV cache as GPU-memory bottleneck in Transformer serving (GQA/MQA, quantization, sliding window)](https://papers.projxon.ai/entries/1066) (idea, #1066)
