[Paper Review] Compressing Deep Neural Networks via Layer Fusion
This paper proposes layer fusion (LF), a structured model compression technique that merges similar fully-connected, convolutional, and attention layers in deep neural networks by aligning weight matrices using Wasserstein distance and covariance similarity metrics. When iteratively retrained, LF achieves up to 3.33× compression with <2% accuracy drop on CIFAR-10 and reduces Transformer models to 20% size with only 5 perplexity points degradation on WikiText-2, outperforming unstructured pruning and matching knowledge distillation without additional parameters.
This paper proposes extit{layer fusion} - a model compression technique that discovers which weights to combine and then fuses weights of similar fully-connected, convolutional and attention layers. Layer fusion can significantly reduce the number of layers of the original network with little additional computation overhead, while maintaining competitive performance. From experiments on CIFAR-10, we find that various deep convolution neural networks can remain within 2\% accuracy points of the original networks up to a compression ratio of 3.33 when iteratively retrained with layer fusion. For experiments on the WikiText-2 language modelling dataset where pretrained transformer models are used, we achieve compression that leads to a network that is 20\% of its original size while being within 5 perplexity points of the original network. We also find that other well-established compression techniques can achieve competitive performance when compared to their original networks given a sufficient number of retraining steps. Generally, we observe a clear inflection point in performance as the amount of compression increases, suggesting a bound on the amount of compression that can be achieved before an exponential degradation in performance.
Motivation & Objective
- To address the inefficiency and computational overhead of sparse models from unstructured compression techniques like pruning.
- To develop a structured, dense compression method that preserves network efficiency while reducing model size without introducing additional parameters.
- To identify and fuse redundant layers in overparameterized networks—especially in deep CNNs and Transformers—while maintaining competitive performance.
- To investigate the impact of retraining schedule and compression step allocation on performance degradation during compression.
- To determine the existence and location of a performance inflection point beyond which compression leads to exponential accuracy drop.
Proposed method
- Proposes layer fusion (LF) as a structured compression method that fuses entire layers (fully-connected, convolutional, attention) rather than individual weights.
- Uses a Wasserstein distance metric to compute alignment cost between weight matrices of candidate layer pairs for fusion.
- Employs multiple similarity criteria—Euclidean distance, KL divergence, Wasserstein distance, and covariance alignment (CA)—to rank layer pairs.
- Applies three fusion strategies: layer averaging (Mean), layer freezing (Freeze), and random mixing (-Mix) to combine weights during fusion.
- Implements an exponential curriculum schedule to allocate compression steps non-uniformly, allocating more compression early and more retraining steps later.
- Retrains the compressed model iteratively after each fusion step to recover performance, using a curriculum-based compression strategy.
Experimental results
Research questions
- RQ1Can layer fusion effectively compress deep neural networks while preserving model accuracy and maintaining dense computation?
- RQ2How does the choice of similarity metric (e.g., CA, WS, ED, KL) affect the performance of layer fusion during compression?
- RQ3Does iterative retraining with a non-uniform compression schedule improve performance compared to uniform compression allocation?
- RQ4What is the compression ratio at which performance degradation becomes exponential, and does this inflection point vary across models and tasks?
- RQ5How does layer fusion compare to established methods like pruning, tensor decomposition, and knowledge distillation in terms of accuracy and model size?
Key findings
- On CIFAR-10, layer fusion maintains within 2% accuracy points of the original network up to a compression ratio of 3.33 when iteratively retrained.
- For WikiText-2 language modeling, layer fusion reduces GPT-2 and Transformer-XL models to 20% of their original size while increasing perplexity by only 5 points.
- Covariance alignment (CA) consistently outperforms other similarity metrics in layer fusion, achieving the lowest perplexity (11.13 for TransXL-CA) on WikiText-2.
- An exponential inflection point in performance is observed across all models and compression methods, where further compression leads to rapid degradation beyond a certain threshold.
- Retraining with a curriculum-based compression schedule—allocating more compression early and more epochs later—improves performance over uniform compression allocation.
- Layer fusion with averaging or mixing strategies performs comparably to averaging, suggesting robustness to fusion method choice.
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.