TL;DR
Large language model weights stored in BFloat16 (BF16) are surprisingly hollow: out of 16 bits, they carry only about 10.5 bits of actual information. NyoomFloat12 (NF12) exploits a hidden structural quirk in these numbers to shrink weights by 25% losslessly—reconstructing every bit identically—while running in lockstep with GPU hardware to boost token generation speeds by up to 1.23× and concurrent serving throughput by up to 2.54×.
What Problem Does This Paper Address?
When generating text one token at a time, modern GPUs aren't waiting on math; they are starving for data, bottlenecked by how fast weights can stream from High-Bandwidth Memory (HBM). At larger batch sizes, those bulky weights eat up memory needed for the KV cache (the model’s working memory for active conversations), capping how many users can run concurrently.
Lossy quantization (like FP8) shrinks weights by sacrificing precision, which can destabilize sensitive tasks like reinforcement learning (RL) post-training. Meanwhile, existing lossless compressors (like Huffman coding in DFloat11) hit a hardware wall. GPUs execute threads in groups of 32 (called warps) in strict lockstep—a paradigm known as SIMT (Single Instruction, Multiple Threads). Variable-length codes force different threads to read different numbers of bits, breaking lockstep execution, stalling the GPU, and erasing any speed gains from moving fewer bytes.
Methods
Instead of treating a BF16 weight’s 8-bit exponent as a single unit, the authors slice it at the physical byte boundary. After applying a lossless per-matrix power-of-two scale ($2^s$, which simply shifts exponents without rounding mantissas), over 99.7% of trained weights have their upper four exponent bits fixed to 0111.
NF12 drops those four predictable bits and keeps the lower byte untouched:
- Position-Preserving Pair Packing: Two weights share a single "meta" byte. The first weight keeps its sign and remaining three exponent bits in their natural positions; the second weight's four bits neatly slot into the gap vacated by
0111. Half the weights require zero bit-shifting to unpack! - 16-Instruction Lockstep Decode: Grouping 8 weights together (16 bytes down to 12), all 32 warp threads unpack values in unison using fast register-level byte permutes and bitwise ORs.
- Zero-Overhead Escape Buffer: What about the 0.13% of groups with an outlier weight? NF12 flags them by setting the meta byte to
0and repurposing the low-byte space to store a 4-byte index pointing to a small per-matrix buffer of original BF16 values. A 3-instruction warp vote catches these rare escapes off the main execution path. - Dual Deployment: In Fused mode (for low-batch generation), weights decode directly inside GPU registers during matrix-vector multiplication. In Buffered mode (for high-batch serving), weights decode to a temporary per-layer HBM buffer, freeing massive room for the KV cache.
Datasets
Because NF12 is a post-training lossless format, no training datasets are required, though RL fine-tuning fidelity is verified over 300 steps. Evaluation spans:
- Model Checkpoints: 14 LLMs across the Llama (1B–70B) and Qwen (0.5B–32B) families, plus Muon-trained, vision, and diffusion models for exponent distribution analysis.
- Benchmarks: WikiText-2 (for perplexity verification), GPQA-Diamond (198 graduate-level reasoning questions), and synthetic shared-prefix RL rollout workloads (2048-token prefix, 128-token question, 1024-token output) matching GRPO schedules. No new dataset benchmarks are introduced.
Key Insights and Ideas
- Matching the consumer beats matching entropy: Variable-length coders like DFloat11 compress closer to the theoretical 10.5-bit Shannon entropy floor (~10.8 bits/weight vs. NF12's 12.02 bits). Yet NF12 decodes 3.2× faster because spending an extra 1.2 bits per weight to preserve fixed-length SIMT alignment saves far more time than squeezing out the last drop of redundancy.
- Byte boundaries matter more than logical fields: Floating-point exponents straddle the boundary between the upper and lower bytes. Realizing that the low-entropy bits live exclusively in the upper byte (
E7–E4) while the lower byte is pure high-entropy noise is the "aha moment" that avoids expensive bit-level repacking. - Decoding faster than copying: Because NF12 reads 25% less data from HBM and uses practically free idle ALU cycles to unpack, standalone decoding to HBM is actually faster than a raw uncompressed BF16 memory copy (548 µs vs. 619 µs).
Key Results
- 100% Bit-Exact: Zero weight reconstruction error across all tested matrices, identical WikiText-2 perplexity to four decimal places (7.5059 on Qwen3-32B), and byte-for-byte identical outputs under deterministic GPQA-Diamond inference and RL training.
- Kernel Efficiency: On Llama-3.3-70B
gate_upprojections, fused NF12 GEMV hits 1.26× speedup over a hand-tuned BF16 kernel (1.35× over cuBLAS), reaching 75% of a theoretical entropy-and-bandwidth oracle. - End-to-End Serving: On Qwen3-32B (80 GB H100), batch-size-1 generation speeds up 1.23× (42.1 to 51.6 tok/s). In buffered mode, shrinking weights from 62.4 GB to 46.9 GB expands KV-cache capacity 4.5×, pushing peak rollout throughput up 2.54× (787 vs. 310 tok/s) and finishing GPQA-Diamond 1.93×–2.39× faster at roughly half the energy per token.
Limitations and Future Work
- Regime-Dependent Gains: If KV-cache memory isn't the bottleneck, buffered mode's extra HBM round-trip makes NF12 slower than BF16 (0.41× when artificially capped to BF16's KV budget); it needs 16–24 concurrent sequences on Qwen3-32B to break even.
- Small Models & Prefill Overhead: Tiny models like Llama-1B run slightly slower (0.94× at batch size 1) because decode instructions aren't amortized over enough memory savings. Prefill also pays a 0.04–0.24s latency tax (unless prefill and decode are disaggregated onto separate GPUs). Finally, if lossy precision is acceptable, native FP8 remains much faster.
- Future Directions: While NF12 focuses on static weights here, the authors observe that KV caches and activations exhibit the same peaked exponent distributions (<1% escape rates under per-tensor scaling), suggesting NF12 could be applied unchanged to compress dynamic tensors next.
Summary updated