Year: 2026
Type: preprint
Abstract: The key–value (KV) cache is the dominant GPU-memory consumer in long-context LLM inference. At 32K tokens, a Qwen3-8B model holds roughly 4.5 GiB of fp16 KV cache against about 5 GiB of int4 weights, and the cache grows linearly with context. Existing remedies either quantize every cache entry, which is safe but bounded, or evict/merge tokens permanently, which can destroy information that becomes relevant only after the future query is known. We present Tamarin (HSQ), a three-tier reversible compression scheme: a small learned reader routes tokens into a non-summarized 4-bit focal tier (L1), a 3-bit tier of learned group-summary vectors (L2), and a CPU-RAM archive of all compressed originals stored at 4-bit precision (L3). L2 vectors are routing keys, not content replacements: at decode time a per-head router scores L2 groups, fetches selected originals from L3, and attends to the restored tokens before the softmax. Compression is therefore an index, not a deletion. On the Qwen3 family (0.6B–14B, fp16/int8/int4 weights, 2K–32K contexts), Tamarin reduces the GPU-resident KV cache by 12–28× at a perplexity overhead of 0.1–0.4% on 4B–14B models, token-level agreement of 96–97% with the uncompressed baseline, and binary needle retrieval statistically equivalent to baseline under TOST at n = 500 per depth cell. At 32K, Qwen3-8B-int4 attains 500/500 retrieval parity with zero discordant pairs. Unlike eviction-family methods, the measured quality cost decreases with model size, and 4-bit weight quantization composes with Tamarin at no measurable cost on models of at least 4B parameters. We report a paired, per-cell statistical methodology with TOST equivalence for binary retrieval and one-sided non-inferiority margins for perplexity, plus replication runs, the measured applicability boundary, and failure modes including one quantization-fragile checkpoint and one model-family effect.
Source: Research Square
Authors: Alikhan Bazakov, Kirill Kiselev
Language: English
Topic: Topic Modeling
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7167931604
