Introduction
As Large Language Models (LLMs) scale to hundreds of billions of parameters, they increasingly collide with the "memory wall." The growth in model size has significantly outpaced the capacity and bandwidth of hardware memory (DRAM). To mitigate this, quantization—the process of representing weights and activations with lower-precision formats—has become a standard practice. However, as researchers push toward ultra-low bitwidths (sub-6-bit), existing standards begin to falter, leading to significant accuracy degradation.
The Limitations of Current Standards
The current state-of-the-art in model compression is the Microscaling (MxFP) standard. MxFP utilizes a shared exponent for a block of numbers to optimize space. While effective at 8-bit or 6-bit precisions, the format breaks down at 4 bits due to three primary structural inefficiencies: poor outlier tracking, vacant quantization levels, and wasted bit patterns.
As illustrated above, the fixed nature of MxFP4 often results in a mismatch with the actual data distribution of modern LLMs like Llama-3 or Mistral. Specifically, it fails to capture significant values in the "tails" of the distribution and leaves "holes" in the number system where no values are represented, leading to high quantization error.
The NxFP Framework
To address these challenges, we propose Nanoscaling Floating-Point (NxFP). NxFP is a modular framework that introduces three novel techniques to enhance the flexibility and precision of block-based quantization without significantly increasing the memory footprint.
1. NanoMantissa (NM)
In standard block-floating-point (BFP) setups, the shared scaling factor is a simple exponent. NxFP introduces a NanoMantissa—a tiny 2-bit mantissa added to this shared factor. This allows the hardware to fine-tune the scaling for an entire block, significantly improving the representation of large outlier values at a negligible amortized cost.
2. Adaptive Microexponent (AM)
Data distributions are not uniform across a model; some blocks are tightly clustered, while others have a high dynamic range. NxFP employs an Adaptive Microexponent strategy, using a 1-bit flag per block to dynamically switch between BFP (optimized for precision) and MxFP (optimized for range). This ensures the format always "fits" the specific characteristics of the data block.
3. Code Recycling (CR)
In 4-bit sign-magnitude formats, the bit pattern 1000 typically represents "negative zero" (-0), which is mathematically redundant. NxFP "recycles" this wasted code, remapping it to represent a value equal to half of the smallest quantization level. In a 4-bit system with only 16 possible states, gaining a 17th unique value provides a meaningful boost to precision for free.
Experimental Results
We evaluated NxFP across a diverse suite of modern LLMs, including Llama-3 (8B), Phi-3 (4B), and Mistral (7B), using benchmarks such as WikiText-2 for perplexity and MMLU for reasoning accuracy.
- Accuracy Gains: NxFP4 (4-bit) consistently outperformed the industry-standard MxFP4, improving MMLU reasoning accuracy by up to 30% and reducing perplexity by as much as 0.64.
- Memory Efficiency: NxFP achieved the same perplexity as the 6-bit MxFP standard while requiring 16% less memory. This demonstrates that NxFP can effectively bridge the gap between 4-bit and 6-bit performance.
- Outlier Handling: The NanoMantissa component alone was found to reduce the Mean Squared Error (MSE) of quantization by approximately 23% by better capturing the distribution tails.
Conclusion
NxFP represents a significant advancement in direct-cast LLM compression. By introducing adaptivity and reclaiming wasted bit patterns, it allows for ultra-low bitwidth quantization that preserves the reasoning capabilities of state-of-the-art models. While full hardware acceleration would benefit from specialized logic, the framework's compatibility with existing dequantization kernels makes it a viable candidate for immediate deployment in memory-constrained environments.
Summary updated