TL;DR
CMPS (Constrained Mixed Precision Search) reformulates the "black art" of bit-allocation for model quantization into a formal constrained optimization problem. By using interior-point methods and as few as 128 calibration samples, it enables Large Language Models (LLMs) to strictly adhere to hardware memory budgets while frequently outperforming uniform-precision models that use significantly more memory.
What Problem Does This Paper Address?
Deep Neural Networks, particularly Transformers, are memory-hungry. To deploy them on edge devices or even high-performance accelerators, we use quantization—reducing the number of bits used to represent weights (e.g., from 16-bit floats to 4-bit integers).
However, not all layers are created equal. Some layers are highly sensitive to noise, while others are robust. Mixed-precision search attempts to find the optimal "bit budget" for each layer. Traditionally, this is treated as a multi-objective optimization problem where researchers add a "soft penalty" to the loss function to discourage large models. The problem? Soft penalties are notoriously hard to tune, offer no guarantees that you’ll actually hit your hardware's memory limit, and often require extensive trial and error.
Methods
The authors propose a shift from "soft penalties" to hard constraints. They treat the memory budget as a non-negotiable boundary using a framework inspired by Differentiable Neural Architecture Search (DNAS).
- Constrained Reformulation: Instead of just minimizing loss, they minimize the model loss subject to the average bit-width being less than or equal to a target budget ($B$).
- Interior-Point Method: To solve this, they use a logarithmic barrier function. This acts like a "repulsive force" that gets infinitely large as the search approaches the budget limit, ensuring the optimizer stays within the feasible region.
- Post-Training Efficiency: Unlike training-aware methods, CMPS keeps the model weights frozen. It only optimizes a tiny set of "architectural parameters" (which format to use for which layer). This makes the search incredibly fast—taking as little as 2.5 minutes for smaller models.
- Softplus Surrogate: To prevent numerical instability (like trying to calculate the log of a negative number if the optimizer accidentally overshoots the budget), they introduce a smooth surrogate function that handles boundary crossings gracefully.
- MXFP Formats: The study specifically utilizes the Microscaling (MX) data format family (like MXFP4 and MXFP8), which are gaining industry traction for their ability to amortize exponent costs across blocks of data.
Datasets
The authors evaluated their method using:
- Calibration: Small subsets of the C4 (Colossal Clean Crawled Corpus) dataset (128 to 256 samples).
- Evaluation:
- C4 Validation Set and WikiText-2-raw for measuring perplexity (how well the model predicts text).
- LAMBADA for zero-shot word prediction accuracy.
- ARC-Challenge for reasoning capabilities.
The experiments spanned 10 different transformer architectures, including OPT, LLaMA 3.2, Gemma, and Qwen 2.5, with sizes up to 4 billion parameters.
Key Insights and Ideas
- Strategic Allocation Beats Raw Precision: The most striking finding is that a "smart" 4.5-bit model can outperform a "dumb" 8-bit uniform model. This proves that uniform quantization is inherently inefficient; it wastes bits on robust layers and starves sensitive ones.
- The Power of the Barrier: By using a formal interior-point method, the authors achieved much higher "resolution" over compression rates. Users can dial in a specific bit-target (e.g., exactly 4.5 bits) and the algorithm will find the best configuration for that specific slice of the Pareto front.
- Minimal Data Requirement: The fact that the search converges with only 128 samples is a major win for practicality, especially in scenarios where data privacy or scarcity is an issue.
Key Results
- Accuracy Boosts: On the Qwen2.5-0.5B model, CMPS achieved a +10.7% accuracy improvement on the LAMBADA benchmark compared to a 4.25-bit uniform baseline.
- Perplexity Reductions: For Qwen2.5-1.5B, the method reduced perplexity by 9.06 points on C4 in few-shot settings.
- Surpassing Higher-Bit Baselines: A 4.5-bit mixed-precision Gemma model surpassed the performance of both 6.25-bit and 8.25-bit uniform MXFP allocations on C4 and WikiText perplexity.
- Feasibility: In 8 out of 10 tested models, the final discrete bit-allocation was strictly under the user-defined constraint, with only minor deviations in the other two due to rounding.
Limitations and Future Work
- Supernet Memory Overhead: During the search phase, the system must track gradients for multiple potential formats simultaneously. This "supernet" can temporarily double the memory usage compared to standard inference, though the authors note this is still often less than the memory required for full FP16 training.
- Granularity: The current approach is layer-wise. The authors suggest that moving to column-wise or block-wise granularity could unlock even more efficiency.
- Latency Constraints: While this paper focuses on memory (bit-width), hardware deployment is often limited by latency. Integrating latency-aware constraints into the interior-point framework is a suggested path for future research.
Summary updated