arXiv:2611.09598cs.LGNov 2026

Manuscript Offprint

arXiv:2611.09598

Transformer-FSQ: Discrete Latents for Extreme KV-Cache Compression

Andras Szecsenyi, Thomas L. Lee, Vaisakh Shaj, Elliot J. Crowley, Amos Storkey

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Private, personalised language models must run on local consumer devices, where large, frontier models cannot fit, and retaining long contexts is non-trivial. Sequential memory—the key-value (KV) cache—grows linearly with context length, quickly dwarfing the model itself: for Qwen3-1.7B-Base, 200,000 retained entries require 21 GiB, 6.6 times more than the model weights. Yet the KV-cache compression methods we measured fail beyond moderate compression ratios. We introduce Transformer-FSQ, addressing extreme KV-cache compression by replacing standard key and value projections with a finite scalar quantisation bottleneck. Our cache stores a packed vector of discrete integer codes per token, with no per-token quantisation metadata. Converting a pretrained transformer trains only these projections on 0.25 tokens per original parameter. We evaluate Transformer-FSQ against five baseline families on models from 0.6B to 8B parameters. On long-context retrieval (RULER), from 12× to 97.5× Transformer-FSQ is the most accurate method we evaluate, across scales. A fused Triton kernel decodes directly from the integer codes; with baselines given their authors' kernels where available, it decodes at 1.01× (95% interval 0.98–1.05) the throughput of native SDPA attention on the uncompressed Qwen3-8B-Base at 32× and 1.54× at 97.5×. Extreme KV-cache compression is therefore a practical way to extend how much context a fixed device can hold.

1 INTRODUCTION

A language model's key-value (KV) cache grows with every token it processes, and on local hardware, the cache competes directly with model weights for a fixed memory budget. Unlike the model weights, whose size does not depend on context, the KV cache grows with every retained entry and soon outgrows the model itself. Local deployments matter: prompts stay on device within user control (Nissenbaum, 2010; Stallman, 2015; Zittrain, 2008), and processing spreads beyond centralised intermediaries (Benkler, 2006; Seger et al., 2023); releasing weights alone does not achieve this (Liesenfeld & Dingemanse, 2024; Widder et al., 2024). For Qwen3-8B-Base, caching 144 KiB per token in half precision (36 layers, 8 key-value heads of width 128) (Yang et al., 2025a) alongside 15.3 GiB of weights on a 16 GiB GPU leaves room for only 5 thousand uncompressed tokens before runtime activations, reaching 1.39M retained entries only at 256× compression (Figure 1 highlights the difference in magnitudes). Large capacity is essential: in-context learning, multi-step reasoning, and concurrent rollouts all depend on holding many tokens in memory simultaneously (Li et al., 2025b).

KV-cache compression trades accuracy for context. Existing methods shrink the cache along four axes (§2). Token eviction keeps fewer tokens. Scalar quantisation stores each coordinate in fewer bits. Low-rank projection and latent attention store fewer coordinates per token. Vector quantisation replaces groups of coordinates with indices into a learned

Figure

Figure 1: KV-cache capacity on a 16 GiB GPU. With ≈0.74 GiB left for cache after Qwen3-8B model weights, extreme compression (256×) expands token capacity from 5.4k to 1.39M, enabling million-token contexts on consumer hardware.

Figure

Figure 2: RULER at 8,192 tokens against achieved compression on Qwen3-0.6B, 1.7B and 8B. Solid: finetuned; dashed: training-free; grey horizontal line: uncompressed. Points average up to three seeds (one on 8B), with 95% bootstrap intervals over seeds and then items stratified by task. Beyond about 12×, Transformer-FSQ scores highest on all three models.

codebook. Four of the five baselines we compare report accuracy at compression ratios of at most about 14× (Table 1), whereas holding several million tokens beside a model's weights on a 16 GiB GPU needs ratios of tens for the smaller models studied here, and deeper compression for the 8B model (Figure 1; Appendix D.3), the extreme regime (above 16×) this paper targets.

To reach extreme compression we use finite scalar quantisation (FSQ) (Mentzer et al., 2024). FSQ projects a continuous representation into a low-dimensional space and rounds each coordinate to a fixed number of levels. Unlike learned-codebook vector quantisation (van den Oord et al., 2017; Esser et al., 2021), FSQ requires no stored codebook: the discrete grid is defined implicitly by the bounding levels, eliminating codebook search, commitment losses and learned codebook collapse. Transformer-FSQ replaces the key and value projections of attention with an FSQ encoder and a linear decoder, storing bit-packed integer codes in the KV cache rather than floating-point vectors. Conversion inserts these projections into a pretrained transformer in closed form, and finetuning trains only the new parameters on 0.25 tokens per original parameter, leaving the backbone model frozen. The inserted projections are lightweight at extreme compression: at 97.5× on Qwen3-1.7B-Base they hold under 10M parameters in total, fewer than the key and value projections they replace, though at 2× on Qwen3-0.6B-Base the inserted bottlenecks hold 352M parameters and replace 59M original key and value projection parameters, a net increase of 294M (≈ 49% of the model), as the code approaches the residual dimension. At extreme compression, where the bottleneck is narrow, Transformer-FSQ reduces the KV cache by large factors with a small parameter overhead (§4.2).

Figure 2 evaluates Transformer-FSQ against five baselines, one from each family in Table 1, plus a training-free TurboQuant reference, on RULER (Hsieh et al., 2024) (13 official tasks, 50 items each) at 8,192 tokens across three Qwen3 models. Up to about 5×, training-free vector quantisation and low-rank projection preserve accuracy with less overhead. At these ratios Transformer-FSQ's code approaches or exceeds the model's hidden dimension, and beyond it the closed-form initialisation repeats principal directions, so part of the cache holds duplicate information (§4.2). From 12× to 97.5×, Transformer-FSQ retains substantially higher retrieval accuracy than every baseline, outscoring token eviction by 0.12 and 0.14 at 12× on Qwen3-0.6B and 1.7B, and retaining the highest share of uncompressed accuracy through 97.5×. Because Transformer-FSQ compresses channel width while token eviction reduces sequence length, the two compose: on a 16 GiB GPU, Qwen3-0.6B-Base with both yields an aggregate projected capacity of 3.8M tokens across concurrent sequences at RULER ≥ 0.30, 1.7× the best baseline, our head-shared PyramidKV (95% interval 1.0–2.3). Because the cached codes are small, decoding from them is fast: a fused Triton kernel matches native SDPA decoding of the uncompressed model at 32× and exceeds it from 97.5× (§5.2).

Our contributions are: (1) Transformer-FSQ, a discrete latent compression method that stores packed integer codes in the KV cache (§4.1); (2) a closed-form conversion and finetuning operator requiring only 0.25 tokens per original parameter on ClimbMix with the backbone frozen (§4.2); (3) an empirical evaluation showing that beyond 12×, Transformer-FSQ achieves the highest RULER accuracy at 8,192 tokens of the methods we evaluate, stacking with eviction to expand aggregate projected capacity by 1.7× (95% interval 1.0–2.3) on a 16 GiB GPU (§5); and (4) a fused Triton decode kernel that reads the packed codes directly, timed against native SDPA under strict dispatch, with KIVI, VecInfer and Palu on their authors' released kernels (§4.5).