Abstract: Despite the success of deep neural networks (DNNs), state-of-the-art models are too large to deploy on low-resource devices or common server configurations in which multiple models are held in memory. Model compression methods address this limitation by reducing the memory footprint, latency, or energy consumption of a model with minimal impact on accuracy. We focus on the task of reducing the number of learnable variables in the model. In this work we combine ideas from weight hashing and dimensionality reductions resulting in a simple and powerful structured multi-hashing method based on matrix products that allows direct control of model size of any deep network and is trained end-to-end. We demonstrate the strength of our approach by compressing models from the ResNet, EfficientNet, and MobileNet architecture families. Our method allows us to drastically decrease the number of variables while maintaining high accuracy. For instance, by applying our approach to EfficentNet-B4 (16M parameters) we reduce it to to the size of B0 (5M parameters), while gaining over 3% in accuracy over B0 baseline. On the commonly used benchmark CIFAR10 we reduce the ResNet32 model by 75% with no loss in quality, and are able to do a 10x compression while still achieving above 90% accuracy.
Introduction
As deep neural networks (DNNs) grow in accuracy, they also grow in size, often requiring hundreds of megabytes of storage and massive amounts of RAM. This makes deployment difficult on "edge" devices like smartphones and wearables. It also complicates "multi-tenancy" on servers, where multiple models must share the same hardware accelerator. Existing compression methods like pruning, quantization, and simple hashing often face trade-offs between memory access regularity, parameter count, and performance degradation due to "hard collisions" where different weights are forced to be identical.
Methodology: Structured Multi-Hashing
The core innovation of this work is Structured Multi-Hashing (SMH). Instead of a simple 1-to-1 or many-to-1 mapping of weights to variables, SMH uses a many-to-many approach based on matrix-product factorization.
As illustrated in Figure 3, the process involves several key steps:
- Weight Tiling: All weights in the model (convolutions, fully connected layers, etc.) are conceptually tiled into one giant square matrix.
- Matrix-Product Factorization: This giant matrix is represented as the product of two much smaller, "thin" matrices, creating a low-rank approximation of the entire model's parameter space.
- Sum-Product Reducer: Each individual weight is calculated as a sum of products of variables from these thin matrices. This eliminates "hard collisions"—two weights might share some underlying variables, but they aren't forced to be identical.
- Per-Layer Learnable Scale: To account for varying weight magnitudes across layers, a single learnable scaling factor is added for each layer, providing the flexibility needed to share a global pool of variables.
Crucially, because this is formulated as a matrix product, it maintains memory locality, allowing modern hardware (GPUs/TPUs) to remain efficient during inference.
Experimental Evaluation
The authors evaluated SMH on standard computer vision benchmarks including ImageNet (for ResNet, EfficientNet, and MobileNet families) and CIFAR10 (for extreme compression tests on ResNet32).
Key Results
- EfficientNet Performance: Compressing an EfficientNet-B4 (16M parameters) to the size of a B0 (5M parameters) resulted in a 3% accuracy gain over the baseline B0. This supports the insight that a large architecture compressed down often outperforms a smaller architecture designed for that same size.
- ResNet on CIFAR10: The authors reduced the ResNet32 model by 75% with no loss in quality and achieved over 90% accuracy even with a 10x compression ratio.
- Superior Trade-offs: On ResNet50 and ResNet101, SMH provided a significantly better accuracy-vs-size trade-off than the standard "width multiplier" approach.
As shown in Figure 5, for a target accuracy of 70%, SMH models were approximately half the size of models reduced via width-multipliers.
Discussion and Future Work
While SMH effectively reduces the number of learnable variables (storage/memory footprint), it does not inherently reduce the number of floating-point operations (FLOPs) required for inference. Thus, it is most beneficial where memory bandwidth or storage is the primary bottleneck. Future work may explore the sensitivity of hyperparameters in very large models and the potential for combining SMH with orthogonal techniques like quantization and pruning to achieve even higher compression ratios.
Summary updated