CMD: controllable matrix decomposition with global optimization for deep neural network compression

Haonan Zhang, Longjun Liu, Hengyi Zhou, Hongbin Sun, Nanning ZhengMachine Learning 2022

Abstract

The compression and acceleration of Deep Neural Networks (DNNs) are critical for deploying sophisticated models on resource-constrained hardware. Recognizing that weight matrices often exhibit both low-rank and sparse characteristics, we propose Controllable Matrix Decomposition (CMD). This framework introduces a sparse coefficient to dynamically balance low-rank and sparse components and utilizes an efficient reconstructed network topology to minimize inference time. Furthermore, we address the challenge of hyperparameter selection by establishing a global optimization problem, solved via a decomposition-searching algorithm that synchronizes compression across all layers. Our approach achieves $1.2\times$ to $11.3\times$ speedup and $1.4\times$ to $14.6\times$ size reduction across various architectures including AlexNet, VGG-16, and ResNet-18, with minimal impact on accuracy.

Introduction

Deep Neural Networks (DNNs) have achieved state-of-the-art performance in numerous tasks but are often too computationally intensive for edge devices. Existing compression strategies, such as low-rank decomposition and pruning (sparsity), typically operate in isolation. Low-rank methods can degrade accuracy if the matrix isn't strictly low-rank, while sparsity often fails to translate into hardware speedups without specialized support. This paper introduces CMD, a unified framework that leverages both properties through a controllable decomposition scheme and global optimization.

Methodology

Controllable Low-Rank and Sparse (LSS) Scheme

The core of CMD is the LSS scheme, which decomposes a weight matrix $W$ into a low-rank component $L$ and a sparse component $S$ ($W \approx L + S$). The low-rank matrix captures the primary structural information, while the sparse matrix captures critical "residual" details that would otherwise be lost in a pure low-rank approximation.

The LSS scheme decomposes the weight matrix into low-rank and sparse components.

A key innovation is the introduction of a sparse coefficient ($\lambda$), which allows for precise control over the allocation between these two components. This flexibility ensures that layers with different characteristics can be compressed optimally.

Reconstructed Network Topology

To ensure that the mathematical decomposition leads to actual hardware acceleration, CMD reconstructs the network architecture. The low-rank component $L$ is further decomposed into two smaller, serial layers ($U$ and $V$), while the sparse component $S$ is implemented as a parallel branch.

Reconstructed network topology for efficient inference.

This topology allows the network to benefit from the reduced parameter count of the low-rank branch while maintaining high fidelity through the sparse "safety net."

Global Optimization and Decomposition-Searching

Unlike layer-wise compression methods, CMD optimizes the entire network simultaneously. We formulate an optimization problem to select the best rank and sparsity hyperparameters for every layer. To solve this, we employ a Decomposition-Searching (DS) algorithm based on Bayesian Optimization. This approach intelligently explores the hyperparameter space to find a configuration that balances the trade-off between compression ratio and model accuracy across the entire architecture.

Experimental Evaluation

The CMD framework was evaluated on CIFAR-10 and ImageNet datasets using AlexNet, VGG-16, and ResNet-18.

  • AlexNet (ImageNet): Achieved a significant 14.6× reduction in size and a 5.6× speedup with negligible accuracy loss.
  • VGG-16 (ImageNet): Demonstrated an 11.3× speedup and reduced memory footprint by 8.8×.
  • ResNet-18 (ImageNet): Even on this modern, efficient architecture, CMD provided a 1.2× speedup with 0.0% Top-1 accuracy loss.

These results indicate that the sparse branch effectively preserves vital information, allowing for more aggressive low-rank compression than would be possible with standard SVD-based methods.

Conclusion

CMD provides a robust framework for DNN compression by unifying low-rank and sparse representations. By dynamically controlling the balance between these components and optimizing globally across all layers, CMD achieves substantial speedups and size reductions. Future work will explore the application of this controllable decomposition to Transformer architectures and further optimize the sparse branch for a wider variety of hardware accelerators.

Reference: Zhang, H., Liu, L., Zhou, H. et al. CMD: controllable matrix decomposition with global optimization for deep neural network compression. Machine Learning 111, 831–851 (2022). https://doi.org/10.1007/s10994-021-06077-5

Summary updated

BibTeX
@article{zhang2022cmd,
  author = {Haonan Zhang and Longjun Liu and Hengyi Zhou and Hongbin Sun and Nanning Zheng},
  title = {{CMD: controllable matrix decomposition with global optimization for deep neural network compression}},
  journal = {Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=Sl52IzKAoq},
}
Figure