SpecZip: Compressing Hidden State Caches to Enable Single-Machine Speculative Decoding Training

SpecZip compresses hidden state caches for drafter offline training 16x with PCA + reverse water-filling, enabling single-machine training with nearly lossless acceptance length.
SpecZip tackles the storage bottleneck of offline drafter training in speculative decoding. Offline training saves 2-3x GPU time but BF16 hidden state caches reach 34-55 TB, exceeding single-node disk capacity. The authors find hidden state variance is highly concentrated (99% in 32% of principal components) and train-serve mismatch exists, so direct KV cache quantization shortens acceptance length. SpecZip uses PCA-RWF to allocate bits by variance, projects pruned components out of the drafter's first layer, and overlaps decompression with training. After 16x compression, the cache drops to 2.2-3.4 TB, the DFlash drafter retains 99-101% acceptance length on four target models, and offline training throughput improves 1.95-3.25x over online training.
Speculative decoding is becoming a standard technique for accelerating large model inference, and the training efficiency of the drafter model directly determines whether this approach can scale. Mainstream methods like EAGLE-3 and DFlash rely on the target model's hidden states for offline training, but an overlooked engineering bottleneck is emerging: BF16-precision hidden state caches are as large as 34-55 TB, which won't even fit on the local disks of an 8-GPU node.
SpecZip tackles this problem head-on—using PCA plus reverse water-filling to compress the cache by 16x, making offline training feasible on a single machine again.

The Value of Offline Training and Its Cache Dilemma
Online training recomputes the target model's hidden states at every step, whereas offline training only needs to compute and cache them once, reducing GPU time by 2-3x. This trade-off is very attractive in an era of high compute costs, but the price shifts to storage.
The BF16 hidden state cache for a standard training corpus reaches 34-55 TB, far exceeding the local disk capacity of a single 8-GPU node. Developers must either abandon offline training and return to the expensive online mode, or find a way to compress the cache. KV cache quantization seems like an obvious answer, but the authors found that applying it directly causes problems: a quantizer that distributes bits uniformly across dimensions significantly shortens the drafter's acceptance length—the number of tokens speculative decoding can actually skip.
Speculative Decoding and Drafter Models: Speculative decoding is an inference acceleration technique in which a lightweight drafter model quickly generates multiple candidate tokens, which are then verified in parallel by the target large model, allowing multiple tokens to be accepted in a single forward pass and reducing the number of target model calls. The drafter's quality is measured directly by "acceptance length"—the average number of tokens accepted consecutively per verification round. The longer the acceptance length, the higher the speedup. Therefore, the drafter's training objective is to fit the target model's output distribution as closely as possible, and the target model's hidden states are the most direct and information-rich supervision signal.
Online Training vs. Offline Training: Online training calls the target model in real time to compute hidden states at every step of drafter training; offline training computes and caches all training samples' target hidden states once, and subsequent training reads directly from the cache. Offline training decouples the target model's forward computation from the training loop, greatly saving GPU time, but at the cost of storing massive hidden states.
BF16 Hidden State Cache: BF16 (Brain Floating Point 16) is a 16-bit floating-point format widely used in deep learning to balance precision and memory. Each hidden state vector typically has thousands of dimensions; multiplying by the total token count of the training corpus (which can reach billions) and by 2 bytes yields the 34-55 TB cache size. This volume far exceeds the local disk of a single 8-GPU node (typically a NVMe array of tens of TB), making offline training difficult to implement in practice.
Two Special Properties of the Cache
The authors trace the precision loss to two properties of the cache itself, which are key to understanding SpecZip's design.
First, variance is highly concentrated. 99% of the variance in target hidden states is concentrated in 32% of the principal components. This is consistent with KV cache behavior, meaning compression must allocate bits according to variance rather than uniformly.
Second, the cache is the training data. This is the essential difference between hidden state caches and KV caches. The drafter sees no low-variance components during training, but receives the complete hidden states during inference serving—this train-serve mismatch directly harms performance. Compression ratio alone cannot explain the precision loss; this misalignment must also be addressed.
PCA (Principal Component Analysis) and Reverse Water-Filling: PCA is a dimensionality reduction technique that projects data onto the principal components with the largest variance through an orthogonal transformation. For hidden state caches, PCA can identify which dimensions carry the main information. Reverse water-filling is a classic bit allocation strategy from information theory: under a total bit budget constraint, it allocates quantization bits according to each component's variance—components with high variance get more bits, components with low variance get fewer or even zero bits. This contrasts with conventional uniform quantization (same number of bits per dimension), which wastes bits on low-variance dimensions while providing insufficient precision on high-variance dimensions for highly concentrated data. SpecZip combines PCA with reverse water-filling, reducing dimensionality first and then allocating bits by variance, thereby retaining more critical information under the same storage budget.
Train-Serve Mismatch: In offline training, the drafter only sees compressed hidden states (low-variance components are pruned or coarsely quantized); but during inference serving, the target model provides complete BF16 hidden states. This distribution discrepancy causes the mapping learned by the drafter during training to fail at serving time, manifesting as reduced acceptance length. SpecZip eliminates this misalignment by projecting out the pruned components from the drafter's first layer, forcing training and inference to use the same subspace.
SpecZip's Three-Layer Design
SpecZip's approach builds on the above observations, with PCA-RWF (PCA + reverse water-filling) at its core. It allocates bits by variance and does not require per-token scale, thus retaining more principal components under the same storage budget.
The second layer addresses train-serve mismatch: the pruned components can be projected out from the drafter's first layer. This way, training and inference see the same subspace, eliminating the bias caused by misalignment.
The third layer is the engineering implementation. Only the retained components are decoded on the GPU, and this is overlapped with the training process, so decompression adds almost no extra time to each training step. This is not merely compression algorithm optimization, but scheduling decompression into the training pipeline.
Engineering Details of PCA-RWF: PCA-RWF first applies a PCA transformation to the hidden state cache to obtain the variance of each principal component; then, based on the total storage budget, it uses reverse water-filling to determine the number of quantization bits to allocate to each principal component (which can be 0, meaning discard); finally, it performs scalar quantization on the retained components. Since the PCA basis is orthogonal, quantization errors are independent across components, and no per-token scale (per-token scaling factor) is required, which simplifies the storage format and reduces metadata overhead. Compared with uniform quantization directly on the original dimensions, PCA-RWF retains more high-variance components under the same bit budget, thereby better preserving the drafter's acceptance length.
Overlapping Decompression with Training: SpecZip decodes only the retained components on the GPU and overlaps decompression with training computation. Specifically, decompressing the next batch's hidden states can run in parallel with the current batch's forward/backward pass, using the GPU's asynchronous execution capability to hide decompression latency. This pipelined design makes decompression add almost no time to each training step, a key optimization in the engineering implementation.
Results: 16x Compression, Nearly Lossless Acceptance Length
The compressed cache is 2.2-3.4 TB, which at a 16x compression ratio can fit on a single node. The DFlash drafter trained with this cache retains 99-101% of the BF16 baseline's acceptance length on four target models, including a 122B MoE model.
In terms of throughput, SpecZip's offline training achieves a 1.95-3.25x improvement over online training. Combined with the ability to run on a single machine's local disk, the engineering barrier for this approach is significantly lowered.
Implications for Inference Infrastructure
SpecZip's value goes beyond a compression trick. It points out an easily overlooked fact: drafter training for speculative decoding is essentially a data systems problem, not just an algorithm problem. When the volume of hidden state caches exceeds storage boundaries, the training paradigm must be redesigned.
Allocating bits by variance, eliminating train-serve misalignment, and overlapping decompression with training—this combination of ideas also has reference value for other training pipelines that need to cache intermediate activations. For teams deploying speculative decoding on limited hardware, this means offline training is no longer a heavy-asset project requiring dedicated storage clusters; a single node can run it.
The paper does not disclose SpecZip's performance under different corpus distributions or longer context scenarios, nor the robustness of decompression overlap under fluctuating training loads. These are directions worth watching.
One-line Summary
SpecZip uses PCA + reverse water-filling to compress the hidden state cache for offline drafter training by 16x, enabling single-machine training with nearly lossless acceptance length.
Paragraph Summary
SpecZip addresses the storage bottleneck of offline drafter training in speculative decoding with a cache compression method based on PCA and reverse water-filling. While offline training saves 2-3x GPU time, BF16 hidden state caches reach 34-55 TB, exceeding single-node disk capacity. The authors find that hidden state variance is highly concentrated (99% in 32% of principal components) and that train-serve mismatch exists, so directly applying KV cache quantization shortens acceptance length. SpecZip uses PCA-RWF to allocate bits by variance, projects pruned components out of the drafter's first layer to eliminate misalignment, and overlaps decompression with training. Experiments show that after 16x compression the cache drops to 2.2-3.4 TB, the DFlash drafter retains 99-101% acceptance length on four target models, and offline training throughput improves 1.95-3.25x over online training.
Related articles

MapSelect: Mapping and Adapter Selection for Multimodal Continual Instruction Tuning
MapSelect proposes history-guided mapping adaptation and selection-guided adapter reuse to address catastrophic forgetting in multimodal continual instruction tuning, achieving final mean accuracy of 74.52 and 66.28 on UCIT and MLLM-DCL.

Universal Scaling Law: Beyond Endpoint Evaluation to Characterize the Full Dynamics of LLM Training
New RSS research proposes a Universal Scaling Law that unifies endpoint scaling laws, convex optimization, and enhanced collapse transformation to characterize LLM and multimodal model loss, metrics, and parameter norm trajectories at any time and scale, validated across architectures, optimizers, and modalities.

Frontier LLM Agents Communicate Spontaneously: Social Learning Like Humans
Frontier LLM agents communicate spontaneously in sandbox experiments, with patterns consistent with human social learning theory. Query budget and shared information relevance affect communication frequency, with Argon 4 standing out.