Introduction
The rapid growth of large-scale neural networks has led to a "memory wall," where the cost of storing and moving model weights dominates hardware performance. Quantization—representing continuous weights with discrete, low-precision values—is a primary strategy to mitigate this. Traditional methods, such as Uniform Quantization (UQ) and Binary Coding Quantization (BCQ), typically rely on "first-order" approximations, where a real-valued matrix is reconstructed as a linear combination of binary bases. However, at ultra-low bit widths (e.g., 2 bits), these linear methods lack the expressive power to accurately reconstruct complex weight distributions, leading to significant accuracy degradation.
Methodology: Binary Quadratic Quantization (BQQ)
To overcome the limitations of first-order methods, we propose Binary Quadratic Quantization (BQQ). Unlike linear approaches, BQQ approximates a target matrix $W$ using quadratic combinations of binary matrices. The formulation is defined as:
$$W \approx \sum_{i=0}^{p-1} (r_i Y_i Z_i + s_i Y_i \mathbf{1} + t_i \mathbf{1} Z_i) + u \mathbf{1}$$
where $Y_i$ and $Z_i$ are binary matrices, and $r, s, t, u$ are scalar scaling factors. This quadratic structure allows a 1-bit format to exhibit the range and expressivity of multi-bit representations by leveraging the non-linear properties of matrix multiplication.
Optimization and Efficiency
Minimizing the reconstruction error for BQQ is an NP-hard problem. We address this by framing the task as a Polynomial Unconstrained Binary Optimization (PUBO) problem. To find an efficient solution, we employ Annealed Mean Field Descent (AMFD), a technique that relaxes binary constraints into continuous probabilities and gradually "freezes" them back into discrete values during optimization. Furthermore, to minimize parameter overhead, we implement group-wise scaling, applying factors to weight clusters rather than individual channels.
Experimental Results
BQQ was evaluated across a diverse set of benchmarks, including random Gaussian matrices, Vision Transformer (ViT) weights (DeiT, Swin), and general data formats like SIFT features and ImageNet channels.
Performance on Vision Transformers
In post-training quantization (PTQ) for ViTs on ImageNet-1K, BQQ demonstrated significant improvements over existing state-of-the-art (SOTA) methods. At a 2-bit equivalent size, BQQ outperformed previous methods by 2.2% in calibration-based settings. Most notably, in data-free scenarios—where no original training data is available—BQQ achieved a staggering 59.1% improvement over first-order methods. It is the first framework to reach ~72% top-1 accuracy on DeiT-base in a completely data-free, 2-bit setting.
General Matrix Compression
Beyond neural networks, BQQ consistently provided a superior trade-off between memory usage and Mean Squared Error (MSE) across all tested matrix types, including TSPLIB distance matrices and SIFT descriptors. This suggests that BQQ is particularly effective at capturing structural correlations in matrices with skewed singular value distributions.
Discussion and Conclusion
BQQ represents a paradigm shift from linear to quadratic binary approximations. By utilizing binary matrix multiplication as a powerful non-linear operator, BQQ captures complex weight structures that first-order methods fail to reconstruct. Despite the increased complexity of the approximation, the inference overhead remains minimal (~0.5% to 2%), as operations can be reduced to simple additions in hardware. Future work includes exploring joint optimization of binary matrix stacks and scaling the framework to massive Large Language Models (LLMs).
Summary updated