Compressing Neural Networks with Two-Layer Decoupling

Joppe De Jonghe, Konstantin Usevich, Philippe Dreesen, Mariya IshtevaCamsap 2023

TL;DR

This paper introduces a novel method for compressing neural networks by extending the concept of "decoupling" to two layers. This approach allows for more accurate approximations of complex networks compared to previous single-layer methods, leading to improved compression ratios and accuracy.

What Problem Does This Paper Address?

Neural networks are growing rapidly in size, leading to significant demands on memory, computational power, and energy consumption. This poses a challenge for deploying these networks on resource-constrained devices like those in the Internet of Things (IoT). While various compression techniques exist, this paper focuses on a promising approach based on "decoupling" neural networks. Previous work on single-layer decoupling allowed for compressing a network into a single flexible layer, but this limited the approximation accuracy for more complex functions. This paper addresses the need for a more powerful compression method that can handle multi-layer structures, specifically by tackling the "two-layer decoupling problem."

Methods

The core of this paper is the formulation and solution of the "two-layer decoupling problem." This problem aims to represent a multivariate function $f(x)$ (which models a neural network layer or subnetwork) in a specific decoupled form: $f(x) = Wg(V^T h(Z^T x))$. Here, $W, V, Z$ are matrices, and $g$ and $h$ are composed of univariate functions ($g_i$ and $h_j$) that can be learned.

The authors leverage the Jacobian matrix of $f(x)$, denoted as $J(x)$, which captures the first-order information of the function. By evaluating $J(x)$ at multiple sampling points and stacking these Jacobians into a third-order tensor $I$, the problem can be framed as a tensor decomposition problem. Specifically, the structure of $I$ admits a PARATUCK2 (PT2) decomposition.

The paper proposes a Coupled Matrix-Tensor Factorization (CMTF) approach, named CMTF-PT2, to solve this decomposition. This algorithm uses an alternating least squares (ALS) strategy to iteratively update the parameters $W, V, Z$, and the coefficients of the internal functions $g_i$ and $h_j$. To address limitations of standard PT2 decomposition, such as scaling ambiguities and the inability to estimate constant terms of the internal functions, the CMTF-PT2 algorithm incorporates constraints derived from both first-order (Jacobian) and zeroth-order (function values) information of $f(x)$.

Datasets

The paper evaluates its method on a simple fully connected neural network pretrained on the MNIST dataset. No new datasets or benchmarks are introduced.

Key Insights and Ideas

  • Two-Layer Decoupling for Better Compression: The key insight is that extending decoupling to multiple layers (specifically two) allows for a more faithful and accurate approximation of complex neural network functions, leading to better compression ratios than single-layer methods.
  • Jacobian as a Tensor for Decomposition: Utilizing the Jacobian matrix of the network's function and forming a tensor from its sampled values provides a structured input that can be decomposed using tensor factorization techniques.
  • Leveraging Both First and Zeroth-Order Information: The proposed CMTF-PT2 algorithm effectively combines first-order (Jacobian) and zeroth-order (function values) information to overcome limitations of standard tensor decomposition methods and accurately estimate all parameters, including constant terms.
  • Addressing PT2 Decomposition Ambiguities: The method explicitly handles slice-wise scaling ambiguities inherent in PT2 decomposition by introducing structural constraints on the factor matrices.

Key Results

The paper demonstrates the effectiveness of their two-layer decoupling method on a compressed MNIST network. When compressing hidden layers of size 60 and 40 into two flexible layers with $r_1=20$ and varying $r_2$, the method achieved accuracy drops below 2.54% for $r_2 \in \{10, 12, 15, 17, 20\}$. The best accuracy drop achieved was 1.69% with $r_1=r_2=20$. For comparison, single-layer decoupling resulted in higher accuracy drops. The best tensor and matrix NMSE values were also reported, indicating good reconstruction quality.

Limitations and Future Work

The authors acknowledge that the CMTF-PT2 algorithm might require optimization for tensors of very large dimensions. They also note that an analysis of the convergence properties of their ALS-based algorithm is needed, as the projection strategy influences convergence. Future work includes generalizing the approach to n-layer decoupling problems and further optimizing the algorithm for larger-scale applications.

Summary updated

BibTeX
@inproceedings{jonghe2023compressing,
  author = {Joppe De Jonghe and Konstantin Usevich and Philippe Dreesen and Mariya Ishteva},
  title = {{Compressing Neural Networks with Two-Layer Decoupling}},
  booktitle = {Camsap},
  year = {2023},
  doi = {10.1109/camsap58249.2023.10403509},
}
Figure