Impact of Disentanglement on Pruning Neural Networks

Carl Shneider, Peyman Rostami, Anis Kacem, Nilotpal Sinha, Abd El Rahman Shabayek, Djamila AouadaarXiv 2023 · DOI

Abstract

This study investigates the relationship between disentangled representation learning and neural network pruning. By utilizing a $\beta$-VAE framework with an integrated classification head, we explore whether forcing a model to capture independent factors of variation in its latent space enhances its resilience to weight removal. Preliminary results on MNIST and CIFAR10 suggest that specific levels of disentanglement (controlled by the $\beta$ parameter) can mitigate accuracy loss during pruning, although the effect is dataset-dependent and subject to trade-offs between reconstruction and classification objectives.

Introduction

Deep Neural Networks (DNNs) are notoriously resource-heavy, presenting significant challenges for deployment on edge devices with limited memory and power. Pruning is a widely used compression technique that removes redundant weights to reduce model size and latency. However, identifying which weights are truly redundant remains a complex task.

This paper proposes that disentangled representation learning may facilitate more effective pruning. In a disentangled latent space, independent factors of variation (e.g., the shape of a digit versus its rotation) are captured by separate latent variables. The hypothesis is that such clean, independent feature separation encourages natural sparsity, allowing for the removal of non-essential information without compromising task performance.

Methodology

The researchers integrated two distinct frameworks to test this hypothesis:

  1. $\beta$-VAE (Variational Autoencoder): A generative model where the $\beta$ parameter controls the pressure to learn independent latent features.
  2. Classification Head: A classifier added to the VAE encoder. The total loss function balances reconstruction (image understanding) and classification (label accuracy): $\mathcal{L}_{Total} = \mathcal{L}_{Beta-VAE} + \mathcal{L}_{CE}$.
Architecture of the proposed model combining a probabilistic encoder, decoder, and classifier.

Pruning Strategy: The study employed unstructured, local pruning based on low-magnitude weights, targeting a constant 50% sparsity level. The workflow involved training the full model (Encoder + Decoder + Classifier), removing the decoder, pruning the encoder and classifier, and finally fine-tuning the remaining weights.

Experimental Results

The model was evaluated on the MNIST and CIFAR10 datasets. The results indicate a complex relationship between the disentanglement parameter $\beta$ and pruning resilience.

MNIST Performance

On MNIST, increasing $\beta$ from 1 to 5 significantly improved the stability of the pruned model. At $\beta=1$, pruning resulted in a ~6% drop in accuracy (from 96.32% to 90.02%). However, at $\beta=5$, the accuracy drop was less than 1% (from 96.86% to 96.15%). This suggests that higher disentanglement helps "protect" critical information during weight removal.

CIFAR10 Complexity

CIFAR10 proved more challenging. While a standard CNN reached ~78% accuracy, the best $\beta$-VAE models peaked at ~51%. Notably, at $\beta=10$, the model suffered from "posterior collapse," where it ignored input data and defaulted to random-guess accuracy (10%). Interestingly, for $\beta=5$ on CIFAR10, the pruned model occasionally showed slightly higher mean accuracy than its unpruned counterpart, though with high variance.

Performance metrics (Accuracy and Compression) for MNIST and CIFAR10 across different beta values.

Discussion and Limitations

While the results are promising, they highlight a "multi-objective struggle." The $\beta$-VAE models generally underperformed compared to pure CNNs because the VAE must balance reconstruction and classification, whereas a CNN is a specialized classifier. Furthermore, the compression ratio remained consistent across all $\beta$ values, reducing model sizes from ~260 KB to ~85 KB for MNIST and ~10.8 MB to ~3.4 MB for CIFAR10.

The study's conclusions are currently preliminary due to several limitations:

  • Metric Gap: The study lacked direct metrics (e.g., Mutual Information Gap) to quantify the exact degree of disentanglement achieved.
  • Dataset Constraints: Standard benchmarks like MNIST and CIFAR10 do not have explicitly labeled factors of variation, making it difficult to verify the quality of the learned representations.

Conclusion

Disentanglement appears to offer a pathway toward more robust neural network pruning, particularly on simpler datasets like MNIST. Future work will focus on utilizing datasets specifically designed for disentanglement research, such as dSprites, and applying more rigorous metrics to quantify the relationship between feature separation and pruning efficiency.

Summary updated

BibTeX
@misc{shneider2023impact,
  author = {Carl Shneider and Peyman Rostami and Anis Kacem and Nilotpal Sinha and Abd El Rahman Shabayek and Djamila Aouada},
  title = {{Impact of Disentanglement on Pruning Neural Networks}},
  year = {2023},
  eprint = {2307.09994},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.09994},
}
Figure