Abstract
Binary Neural Networks (BNNs) represent the frontier of model compression, typically utilizing 1-bit weights to minimize storage and compute. However, standard BNNs often underutilize the potential for further compression. We introduce Sparks (Sparse Kernel Selection), a novel framework that achieves "sub-1-bit" storage (as low as 0.44 bits per weight) by discovering that successful binary models rely on a tiny subset of possible kernel patterns. By employing differentiable permutation learning via Gumbel-Sinkhorn and a Permutation Straight-Through Estimator (PSTE), Sparks selects an optimal sub-codebook of kernels, achieving over 3x inference speedup on hardware with minimal accuracy loss.
Introduction
Binary Neural Networks (BNNs) are highly attractive for edge devices because they replace expensive floating-point multiplications with efficient bitwise XOR and popcount operations. While 1-bit models (±1) are significantly smaller than their 32-bit counterparts, they can still exceed the memory limits of the most resource-constrained embedded systems.
The core insight behind Sparks is the observation of a power-law distribution in well-trained BNNs. In a typical $3 \times 3$ binary convolutional layer, there are $2^9 = 512$ possible kernel patterns. However, empirical analysis shows that a small handful of specific patterns (codewords) appear with high frequency, while the vast majority are rarely used. Sparks exploits this redundancy by forcing the network to choose from a drastically reduced "sub-codebook" (e.g., only 16 or 32 patterns) during training, effectively pushing the storage requirement below 1 bit per weight.
The Sparks Framework
Sparks treats binarization as a kernel grouping task. Rather than allowing every kernel to take any of the 512 possible patterns, the framework constrains the selection to a learned subset. This process is made end-to-end differentiable through several key innovations.
Key Technical Innovations:
- Sub-Codebook Selection via Permutation: The problem of finding the best $n$ kernels out of $N$ possibilities is framed as learning a permutation matrix.
- Gumbel-Sinkhorn Technique: To overcome the non-differentiability of discrete selection, Sparks uses the Gumbel-Sinkhorn operator to create a continuous, differentiable approximation of the selection process.
- Permutation Straight-Through Estimator (PSTE): This optimization trick allows the model to update the selection process end-to-end while ensuring that the final kernels remain strictly binary and non-repetitive during the forward pass.
- Inference via Lookup Tables: Since the number of unique kernels is extremely small, convolutions for every codeword in the sub-codebook can be pre-calculated. During inference, the hardware simply queries these results, drastically reducing bitwise operations (BOPs).
Experimental Evaluation
The researchers evaluated Sparks on standard computer vision benchmarks, including CIFAR-10 and ImageNet (ILSVRC2012), using backbones such as ResNet-18, ResNet-34, and VGG-small. Object detection performance was also verified on PASCAL VOC and MS COCO datasets.
Results and Insights
Sparks demonstrates that spatial integrity and diversity are crucial for compact BNNs. By treating the $3 \times 3$ kernel as a single unit rather than flattening it, Sparks preserves the spatial patterns essential for detecting edges and textures. Furthermore, by selecting from a fixed full codebook, the method prevents "codebook degeneration," where multiple learned codewords become identical.
Key Performance Metrics:
- Extreme Compression: Sparks achieves a 58x reduction in model size compared to full-precision ResNet-18 on ImageNet, utilizing only 0.56 bits per weight.
- Superior Accuracy: On ImageNet, 0.56-bit Sparks achieved 64.3% Top-1 accuracy, outperforming previous state-of-the-art compact BNNs like FleXOR by 4.5% at comparable bit-widths.
- Hardware Efficiency: FPGA simulations indicate that Sparks is 3x faster than standard BNNs and reduces BOPs by up to 214x compared to traditional floating-point models.
- Scalability: The efficiency of Sparks allows for the deployment of deeper models (e.g., ResNet-34) within the same complexity budget as a standard 1-bit ResNet-18, further boosting accuracy.
Conclusion
Sparks introduces a selection-based training paradigm that significantly improves the efficiency of Binary Neural Networks. By identifying and optimizing for the most critical kernel patterns, it enables high-performance deep learning on the most resource-constrained hardware. While the current method requires access to original model parameters for the compression process, future work may explore decentralized or data-free selection methods to expand its applicability.
Summary updated