TL;DR
This paper introduces LEO, a novel algorithm that achieves lossless compression of deep neural networks by removing redundant units and layers without altering the network's output. By leveraging Mixed-Integer Linear Programming (MILP) and L1 regularization, LEO identifies and prunes units that exhibit linear behavior, enabling the deployment of smaller, more efficient networks on resource-constrained devices.
What Problem Does This Paper Address?
Deep neural networks (DNNs) have achieved remarkable success in various domains, but their large size and computational demands pose a significant challenge for deployment on resource-limited devices like mobile phones. While many compression techniques exist, they often come at the cost of reduced accuracy. This paper tackles the problem of compressing DNNs losslessly, meaning the compressed network must produce the exact same outputs as the original network for all valid inputs. This is crucial for applications where even minor accuracy degradation is unacceptable. The authors frame this as finding an "equivalent" neural network with a different, smaller architecture.
Methods
The core of this work is the LEO (Lossless Expressiveness Optimization) algorithm. LEO operates by iteratively analyzing each layer of a trained DNN. The key idea is to identify units (neurons) that are either:
- Stably inactive: Their output is always zero for the given input domain.
- Stably active with constant output: Their output is always positive and constant, regardless of input variations.
- Linearly behaving: Their output can be represented by a linear function over the input domain.
To identify these units, LEO employs Mixed-Integer Linear Programming (MILP). Specifically, it formulates the problem of determining the output range of each ReLU unit. By analyzing these ranges, LEO can classify units as stable or linearly behaving.
The algorithm then proceeds in two main steps:
- Unit Removal/Merging: Stably inactive units are removed. Stably active units whose weight columns are linearly dependent on others in the layer can be merged.
- Layer Folding/Collapsing: If all remaining units in a layer are stable, the layer can be "folded" by directly connecting the preceding and succeeding layers, adjusting their weights and biases accordingly. If a layer is reduced to a single unit with a constant output, the entire network can be collapsed into a constant function.
Crucially, the paper highlights the benefit of L1 regularization during training. L1 regularization encourages sparsity in weights, which can lead to more units exhibiting linear behavior, making them more amenable to compression by LEO.
Datasets
The experiments were conducted using the MNIST dataset.
Key Insights and Ideas
- Lossless Compression is Achievable: The paper demonstrates that it's possible to remove significant portions of a neural network (units and even entire layers) without sacrificing accuracy, provided the analysis is done with respect to a specific input domain.
- MILP as a Powerful Tool for Network Analysis: MILP proves to be an effective tool for precisely determining the behavior and output ranges of ReLU units, which is essential for identifying redundant components.
- L1 Regularization Facilitates Compression: Training with L1 regularization not only can improve accuracy but also makes the network more compressible by inducing more linear behavior in its units. This is a key insight for designing networks that are both performant and amenable to compression.
- "Stable" Units are Key: The concept of "stable" units (stably inactive or stably active with constant output) is central to the compression strategy. These units represent redundancy that can be safely removed or merged.
Key Results
The paper presents results from experiments on 2-hidden-layer rectifier networks trained on MNIST. Table 1 shows that LEO can achieve significant compression percentages. For instance, a network with layer width 100, trained with a small L1 regularization weight (0.0001), achieved 30.8% network compression with 14.9% compression in the second layer, while maintaining its accuracy. The compression is primarily attributed to the removal of stably inactive units. The runtime for compression is noted to be higher for the second hidden layer, suggesting that further optimization in MILP solving for deeper layers could be beneficial.
Limitations and Future Work
- Domain Specificity: The compression is local-equivalent with respect to a specific input domain D. If the domain of deployment changes, the compressed network might not be equivalent. The authors note that collapsing or folding a network is more likely to be achieved in practice when compressing with respect to a very small domain.
- MILP Runtime: Solving MILPs can be computationally expensive, especially for deeper layers, as observed in the experiments.
- Future Work: The authors suggest exploring the connection between the subnetworks identified by LEO and "lottery tickets" (sparse subnetworks that can be trained from scratch). They also propose investigating bounding techniques for efficiently identifying stable units and exploring other forms of inducing posterior compressibility during training. Further research could also focus on how discrete optimization plays a role in deep learning applications.
Summary updated