[Paper Review] A flexible, extensible software framework for model compression based on the LC algorithm
This paper presents a flexible, extensible software framework built on the Learning-Compression (LC) algorithm that enables end-to-end model compression through iterative alternation between learning (L) and compression (C) steps. It supports mixed compression techniques—pruning, quantization, low-rank decomposition, and their combinations—across different layers of a neural network, achieving competitive accuracy and compression ratios with minimal user effort and runtime comparable to training the original model.
We propose a software framework based on the ideas of the Learning-Compression (LC) algorithm, that allows a user to compress a neural network or other machine learning model using different compression schemes with minimal effort. Currently, the supported compressions include pruning, quantization, low-rank methods (including automatically learning the layer ranks), and combinations of those, and the user can choose different compression types for different parts of a neural network. The LC algorithm alternates two types of steps until convergence: a learning (L) step, which trains a model on a dataset (using an algorithm such as SGD); and a compression (C) step, which compresses the model parameters (using a compression scheme such as low-rank or quantization). This decoupling of the "machine learning" aspect from the "signal compression" aspect means that changing the model or the compression type amounts to calling the corresponding subroutine in the L or C step, respectively. The library fully supports this by design, which makes it flexible and extensible. This does not come at the expense of performance: the runtime needed to compress a model is comparable to that of training the model in the first place; and the compressed model is competitive in terms of prediction accuracy and compression ratio with other algorithms (which are often specialized for specific models or compression schemes). The library is written in Python and PyTorch and available in Github.
Motivation & Objective
- To address the lack of a unified, modular framework for applying diverse model compression techniques to deep neural networks.
- To enable non-expert users to easily apply and compare multiple compression schemes—such as pruning, quantization, and low-rank decomposition—on different parts of a model.
- To decouple the learning and compression processes, allowing plug-and-play integration of existing training and compression algorithms.
- To provide a single, extensible software library that supports both individual and combined compression strategies with convergence guarantees.
- To reduce the complexity of experimenting with mixed compression strategies by offering a unified, configurable interface.
Proposed method
- The framework implements the LC algorithm, which alternates between a learning (L) step—training the model using SGD or similar optimization—and a compression (C) step—applying a compression scheme to the model parameters.
- The L step minimizes a composite loss: $ L(\mathbf{w}) + \frac{\mu}{2} \|\mathbf{w} - \boldsymbol{\Delta}(\boldsymbol{\Theta})\|^{2} $, where $ \mu $ controls the trade-off between fitting the data and adhering to the compressed representation.
- The C step applies a compression scheme (e.g., k-means for quantization, SVD for low-rank, or magnitude-based pruning) to project the current weights $ \mathbf{w} $ onto a lower-dimensional or discrete space $ \boldsymbol{\Delta}(\boldsymbol{\Theta}) $.
- The framework allows different compression types to be applied independently to different layers, enabling fine-grained, heterogeneous compression strategies.
- It uses an exponentially increasing $ \mu $ schedule $ \mu_k = \mu_0 \times a^k $ to gradually enforce compression over iterations, with $ a \in [1.1, 1.4] $.
- The library is implemented in Python and PyTorch, with full modularity: changing the model or compression method requires only plugging in new subroutines for the L or C step.
Experimental results
Research questions
- RQ1Can a single, unified framework efficiently support multiple, heterogeneous model compression techniques—such as pruning, quantization, and low-rank decomposition—within one algorithmic pipeline?
- RQ2How can the decoupling of learning and compression steps enable flexible, modular, and extensible compression without sacrificing performance?
- RQ3To what extent can the LC algorithm achieve competitive compression ratios and prediction accuracy when combining multiple compression schemes across different layers of a neural network?
- RQ4What are the key hyperparameter configurations (e.g., $ \mu $ schedule, learning rate decay) that ensure convergence and performance in mixed compression scenarios?
- RQ5How does the framework’s runtime and accuracy compare to specialized, monolithic compression tools for the same models and compression types?
Key findings
- The framework achieves compression ratios and prediction accuracy competitive with specialized algorithms, despite being general-purpose and extensible.
- The runtime for compressing a model using the LC framework is comparable to the time required to train the original model from scratch.
- The framework successfully supports mixed compression strategies, such as applying quantization to some layers, pruning to others, and low-rank decomposition to others, as demonstrated in Table 6.
- For the LeNet300 architecture, applying different compression types to different layers (e.g., quantization, pruning, and low-rank) achieved a test error of 2.18%, demonstrating effectiveness of heterogeneous compression.
- The use of an exponential $ \mu $-schedule $ \mu_k = 9 \times 10^{-5} \times 1.1^k $ (or $ 1.4^k $ for low-rank) ensures convergence and effective compression across iterations.
- The framework’s modular design allows users to plug in new compression schemes with minimal code changes, as long as the compression routine correctly minimizes the quadratic distortion loss in the C step.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.