TL;DR
Running LLMs on battery-powered devices requires dynamically trading off model accuracy for speed and energy, ideally without storing multiple copies of the model. Any-Rate packs precisions from 2 to 8 bits into a single checkpoint—offering smooth half-bit steps (2, 2.5, 3, 3.5, 4 bits) where accuracy matters most. By borrowing a classic trick from error-correcting codes and rethinking how quantization errors are tracked, it keeps 2-bit models surprisingly coherent while estimating up to 27% energy savings on edge hardware.
What Problem Does This Paper Address?
During LLM inference, the main bottleneck isn't math—it's hauling billions of weights out of memory for every generated token. Quantizing weights to fewer bits speeds things up and saves battery, and ideally, a device could shift gears on the fly (e.g., dropping to 2.5 bits when battery is low, jumping to 4 bits for tricky reasoning).
Nested multi-precision quantization solves the storage problem by arranging each weight's bits into layers called bit-planes. Want 2-bit precision? Read the first two bit-planes. Want 4-bit? Read two more. One checkpoint serves all modes.
However, existing nested methods hit two walls:
- Coarse integer steps: Because each standard bit-plane costs 1 bit per weight, you can only jump in integer steps (2, 3, 4 bits). Between 2 and 4 bits—the exact zone where LLM intelligence goes from "broken" to "near-lossless"—you have very few gears to choose from.
- The "nesting cost": Modern quantizers use error feedback (like GPTQ): when you round weight #1, you slightly adjust weight #2 to compensate. But in a nested setup, the 2-bit mode and the 4-bit mode make different rounding errors, meaning they want weight #2 to move toward different targets—yet they are forced to share the same leading bits! Existing methods either collapse completely at 2 bits or average the targets together, dragging down 4-bit accuracy.
Methods
Any-Rate introduces three main ideas to build a smooth, multi-precision "ladder":
- Hamming-Coded Bit-Planes (Half-Bit Steps): Instead of storing every bit independently (an unconstrained
Uplane costing 1 bit/weight), Any-Rate groups 8 adjacent weights into a block and restricts their bits in a plane to valid codewords of the classic extended Hamming [8, 4, 4] code. Because there are only 16 valid codewords ($2^4$), storing this coded (H) plane takes just 4 bits per 8-weight block—0.5 bits per weight—yet still supplies a full index bit to every weight during lookup! Stacking oneUplane and sixHplanes (UHHHHHH) yields 2, 2.5, 3, 3.5, and 4-bit modes as prefixes. - Shared Lookup Table & Residuals: Rather than storing separate lookup tables (LUTs) for every precision mode, Any-Rate stores a single row-wise LUT for the 4-bit mode and derives lower-bit LUTs on the fly by averaging prefix-matching entries. To extend from 5 to 8 bits without exploding the LUT size, it tacks on four standard
Uresidual planes. - Joint Encoding with Per-Mode Targets: Unlike prior work (MatGPTQ) that tracks a single averaged error target across modes, Any-Rate maintains separate error-feedback targets for every mode simultaneously, using a beam search (
B=64) to jointly pick the best Hamming codewords across planes for each 8-weight block.
Datasets
No new benchmarks are introduced. Models are calibrated using C4 and evaluated on:
- Language Modeling: WikiText-2 (perplexity).
- Zero/Few-Shot Benchmarks (8 tasks): ARC-Challenge, ARC-Easy, HellaSwag, PIQA, WinoGrande, GSM8K, TriviaQA, and NQ-open.
- (Appendices also note evaluations on speech recognition with Earnings-22 and vision/diffusion models).
Key Insights and Ideas
- Less freedom globally means more freedom where it counts: Restricting 8 bits to 16 Hamming codewords sounds like a harsh handicap. Yet at 2 bits (
UHHvs. standardUU),UUgives every weight 2 free bits (4 levels), whereasUHHlets the algorithm give 3 free bits (8 levels) to the 4 most important weights in the block, while the 4 least important weights coast on 1 free bit. Even when all weights are equally important, the authors prove mathematically that uniform importance is actually the worst case for Hamming planes—and they still beat scalar quantization!
- Taming the nesting cost: Averaging targets across precisions (mean propagation) provably inflates reconstruction error proportional to the squared gap between per-mode targets. Tracking per-mode targets eliminates this penalty, and coded bit-planes shrink those target gaps even further.
Key Results
Tested across Qwen2.5-3B, Gemma-3-4B, Llama-3.1-8B, and Phi-4 (14B) against Any-Precision LLM (AP), AnyBCQ (AB), and MatGPTQ (MG):
- Low-bit survival & smooth scaling: At 2 bits, Any-Rate retains 68.9% of FP16 benchmark accuracy (1.8$\times$ FP16 perplexity), beating all multi-precision baselines across all four models. Its 3.5-bit mode hits 95.0% of FP16 accuracy—outperforming AB and MG (2/3/4) running at a full 4 bits.
- Compact storage: Serving all modes from 2 to 8 bits takes 8.30 bits/weight on Llama-3.1-8B (4.21 bits/weight if you only deploy the 2–4 bit ladder).
- Speed & Energy: Because Hamming bits unpack via cheap XOR operations, GPU batch-1 decoding on an RTX 5070 Ti hits 142.4 tokens/s at 2 bits and stays within 3% of AP at 3 and 4 bits. Under an LPDDR memory-access model, being able to pick fine-grained half-bit modes saves 3–27% energy at matched accuracy (between 55% and 90% of FP16).
Limitations and Future Work
- 4-bit ceiling: At 4 bits, Any-Rate trails the official 3/4/8-bit recipe of MatGPTQ by 0.7 accuracy points (97.5% vs. 98.2% of FP16), as MatGPTQ (3/4/8) drops 2-bit support entirely to avoid paying the 2-bit nesting cost.
- Scope of comparisons and analysis: Main evaluations focus on multi-precision baselines rather than standalone single-precision quantizers (aside from GPTQ in the appendix), and the theoretical layer-loss analysis is empirically validated on a single model (Qwen2.5-3B).
- Simulated energy: Energy savings are analytical estimates based on LPDDR memory traffic and accelerator TOPS/W; measuring real-world power draw on dedicated edge silicon is left for future work.
Summary updated