Summary (Overview)
- Transformer-FSQ introduces a novel KV-cache compression method that replaces standard key/value projections with a finite scalar quantisation (FSQ) bottleneck, storing bit-packed integer codes per token instead of floating-point vectors.
- The method achieves extreme compression ratios (12× to 97.5×) while maintaining the highest retrieval accuracy (RULER) compared to five baseline families (token eviction, scalar quantisation, vector quantisation, low-rank projection, latent attention) across Qwen3 models from 0.6B to 8B parameters.
- A fused Triton decode kernel reads packed codes directly, matching native SDPA throughput at 32× compression (1.01× on Qwen3-8B) and exceeding it at 97.5× (1.54×), making extreme compression practical for local devices.
- The approach uses closed-form conversion from pretrained transformers followed by finetuning that trains only inserted projections on 0.25 tokens per original parameter, with the backbone frozen.
- Transformer-FSQ stacks with token eviction (PyramidKV), yielding 1.7× greater aggregate projected capacity (3.8M tokens) on a 16 GiB GPU compared to the best baseline.
Introduction and Theoretical Foundation
Background and Motivation
The KV cache grows linearly with context length and quickly dominates memory on local consumer devices. For Qwen3-8B-Base, caching 144 KiB per token in half precision alongside 15.3 GiB of weights on a 16 GiB GPU leaves room for only 5,000 uncompressed tokens. The paper targets the extreme compression regime (>16×) needed to hold millions of tokens alongside model weights.
Theoretical Basis
The paper examines two discrete latent approaches:
Vector Quantisation (VQ): Maps a continuous latent vector to the nearest codeword in a learned codebook:
VQ suffers from commitment losses, codebook updates, nearest-neighbour search, and centroid collapse.
Finite Scalar Quantisation (FSQ): Replaces the learned codebook with fixed scalar levels per coordinate:
The complete representable set is the Cartesian product:
FSQ requires no stored codebook, no commitment losses, and no codebook collapse—the grid is implicit and never materialised.
Methodology
Architecture
Transformer-FSQ compresses the shared residual representation before K/V expansion:
- Encoder maps the residual state to a G-dimensional latent
- FSQ quantiser rounds coordinates to L levels (L=16, i.e., 4 bits per coordinate)
- Shared decoder reconstructs all KV heads
Key Design Innovation
Value decoding after attention pooling: Due to linearity,
Values are decoded once after attention pools the codes, while keys must be reconstructed per position due to RoPE.
Closed-Form Conversion
The encoder is initialised from principal directions of calibration activations:
The decoder is fitted via ridge regression:
Byte Budgeting
All methods are compared at equal realised cache bytes, charging for all metadata, windows, and auxiliary state. Full cache size: bytes/token/layer (4096 B for Qwen3 models).
Empirical Validation / Results
RQ1: Accuracy Across Compression Regimes
- At ≤5× compression, VecInfer retains ≥93% of uncompressed RULER scores
- From 12× to 97.5×, Transformer-FSQ is the most accurate method across all model scales
- At 12× on Qwen3-0.6B, Transformer-FSQ outperforms token eviction by 0.12 RULER points
RQ2: Natural Document Summarisation (LongBench)
- Transformer-FSQ scores highest from 32× to 97.5× on all three models
- On Qwen3-8B: 12.5 ROUGE-L at 32× and 11.4 at 97.5×, vs. Palu's 7.0 at 102.4×
RQ3: Latent Geometry at Fixed Budgets
| Method | Training | Cache | Width | B/tok | RULER |
|---|---|---|---|---|---|
| Transformer-FSQ | Discrete (STE, L=16) | 4-bit implicit grid | 288 | 144 | 0.232 ± 0.022 |
| Continuous latent | Continuous (bf16) | 16-bit float | 72 | 144 | 0.009 ± 0.008 |
| Latent + post-hoc FSQ | Continuous (bf16) | 4-bit post-hoc | 288 | 144 | 0.175 ± 0.030 |
| Palu | Low-rank SVD | 4-bit SVD + scales | 144 | 144 | 0.000 ± 0.000 |
Training through the 4-bit grid (quantisation-aware finetuning) scores highest at both 144 B and 80 B budgets.
RQ4: Decode Throughput
- At 32×: 1.38×, 1.34×, 1.01× native SDPA throughput on Qwen3-0.6B, 1.7B, 8B
- At 409.6×: 1.98×, 2.20×, 1.63× (up to 5.86× at batch ≥100k tokens)
- Native SDPA runs out of memory by 24,555 tokens at batch 16; Transformer-FSQ decodes to 150,000
RQ5: Weight-Quantised Backbone
With 4-bit NF4 weights on Qwen3-8B, Transformer-FSQ finetuned on the frozen NF4 backbone recovers to 0.464 RULER (vs. 0.382 for post-hoc NF4 application), within 0.029 of the 16-bit backbone result.
Baseline Limits on 16 GiB GPU
| Method | Family | Deepest | Max tokens (≥0.30 RULER) |
|---|---|---|---|
| PyramidKV | token eviction | 174× | 552k |
| KIVI | scalar quantisation | 5.2× | 684k |
| VecInfer | vector quantisation | 11.0× | 592k |
| Palu | low-rank projection | 10.2× | 1.42M |
| TransMLA | latent attention | 14.2× | 542k |
| Transformer-FSQ | FSQ | 410× | 2.21M |
Theoretical and Practical Implications
- Extreme compression is practical: Transformer-FSQ demonstrates that KV-cache compression beyond 16× can maintain usable accuracy, enabling million-token contexts on consumer hardware.
- Discrete latents outperform continuous: Training through a low-bit grid (QAFT) outperforms both inference-only quantisation and narrow continuous bottlenecks at matched byte budgets.
- Memory-bandwidth-bound decoding: At extreme compression, saved cache reads dominate arithmetic costs, making compressed decoding faster than uncompressed native attention.
- Composability: Channel-width compression (FSQ) composes with sequence-length compression (eviction), enabling multiplicative capacity gains.
- Zero metadata overhead: FSQ's implicit codebook eliminates per-token/per-channel scales, a key advantage over scalar quantisation methods like KIVI.
Conclusion
Transformer-FSQ demonstrates that attention does not need full-precision keys and values in its cache—a learned discrete state per token maintains accuracy at compression ratios where existing methods fail. Key findings:
- Wide low-bit latents outperform narrow high-precision ones at the same byte budget
- Quantisation-aware finetuning is essential for extreme compression
- Fused decode kernels make compressed attention faster than uncompressed at extreme ratios
Future directions include:
- Allocation: Varying code width/levels per layer, sharing projections across layers
- Training: Block distillation and LoRA adapters on the frozen backbone
- Dynamic compression: Coarsening codes in place as sequences grow (light compression for short sequences, deeper for longer ones)
- Evaluation: Testing on reasoning, code generation, many-shot learning, and longer contexts beyond 8,192 tokens
Related papers
- Agent Self-Improvement with Frozen Weights: The Added Value and Limits of Failure Traces
Trace-based lessons improved decision accuracy by 4.0 points over matched search, but search alone captured 60% of the gain, with no improvement on conversations or held-out tasks.
- Rectified Looped Transformer
Rectified Looped Transformer replaces direct feedback with a remaining-time interpolation schedule, achieving bounded state norms, polynomial perturbation growth, and consistent perplexity gains without extra parameters.
- Agreement rather than normalisation keeps depth reusable in looped language models
Loop-boundary normalization in looped language models is a readout contract, not a stability mechanism; removing it breaks inference while state scale stays intact, and training without it extrapolates better.