Towards Compact Neural Networks via End-to-End Training: A Bayesian Tensor Approach with Automatic Rank Determination

Cole Hawkins, Xing Liu, Zheng Zhang

TL;DR

This paper introduces a novel end-to-end training framework for creating ultra-compact neural networks directly from scratch. By employing a Bayesian tensor approach with automatic rank determination, it significantly reduces model parameters and computational costs without sacrificing accuracy, making efficient deep learning training feasible on resource-constrained edge devices.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are incredibly powerful but notoriously resource-intensive, both for training and inference. This "over-parameterization" leads to massive hardware requirements, high energy consumption, and significant costs. While post-training compression techniques like pruning and quantization can reduce model size for deployment, they don't address the fundamental problem of expensive, energy-hungry training. The authors aim to enable low-energy, compact neural network training from scratch, specifically targeting resource-constrained edge devices where traditional training is infeasible. A key challenge in this area is determining the optimal "rank" for tensorized neural networks, which controls model complexity and accuracy. Existing methods either fix ranks manually (requiring extensive search) or compress models after training, both of which have drawbacks.

Methods

The core contribution is a Bayesian tensorized training framework that automatically determines tensor ranks during training. This is achieved through:

  • Bayesian Tensor Model: A general framework supporting various low-rank tensor formats (CP, Tucker, Tensor Train, Tensor Train Matrix). It uses a Bayesian approach to model the unknown tensor factors and their ranks.
  • Automatic Rank Determination: Instead of manual tuning, the model uses a novel Bayesian approach to infer the optimal tensor ranks. This is crucial because tensor ranks are unknown a priori and directly impact model complexity and accuracy.
  • Scalable Stochastic Variational Inference (SVI) Solver: A customized SVI solver is developed to handle the challenges of training large-scale tensorized neural networks. This solver addresses issues like high gradient variance during rank shrinkage by employing an analytical/numerical hybrid parameter update.
  • Rank Shrinking Priors: The Bayesian model incorporates specific priors designed to encourage low-rank solutions, effectively shrinking unnecessary tensor dimensions.

Datasets

The paper evaluates its method on several standard benchmarks:

  • Synthetic MNIST Dataset: Used to test the ability to infer tensor ranks.
  • MNIST Dataset: A common benchmark for image classification, used to evaluate the performance of two-layer fully connected networks.
  • IMDB Dataset: A sentiment classification task used for evaluating embedding tables in Natural Language Processing (NLP).
  • Deep Learning Recommendation Model (DLRM): A large-scale benchmark used to demonstrate the method's effectiveness on models with billions of parameters.
  • CIFAR Convolutional Model: A convolutional neural network benchmark from existing literature.

Key Insights and Ideas

  • End-to-End Training is Key: The paper strongly advocates for training compact models from scratch rather than compressing larger models post-training. This avoids the massive upfront cost of training uncompressed models.
  • Bayesian Approach for Rank Uncertainty: Using a Bayesian framework naturally handles the uncertainty in tensor ranks, allowing for automatic inference rather than manual search.
  • Rank Shrinkage is Achievable: The proposed priors and SVI solver effectively encourage tensor ranks to shrink, leading to significant parameter reduction.
  • Edge Device Feasibility: The method's ability to train compact models directly opens up possibilities for running complex AI tasks on resource-constrained edge devices.
  • Uncertainty Quantification: The Bayesian nature of the model provides uncertainty estimates for predictions, which is valuable for safety-critical applications.

Key Results

The proposed method demonstrates significant improvements across various benchmarks:

  • Massive Parameter Reduction: On a large DLRM model with over 4.2 billion parameters, the method reduced the parameter count by 2.6 x 10^4 times (from 4.2 billion to 164K) during training, achieving almost the same accuracy.
  • High Compression Ratios: Achieved up to 27,664x parameter reduction on the DLRM model (in TT format) with minimal accuracy loss.
  • Competitive Accuracy: The proposed methods (ARD-LU and ARD-HC) achieved the best compression ratios with little to no accuracy cost on NLP embedding tables, and competitive accuracy on MNIST and CNN models.
  • Outperforms Existing Methods: The end-to-end training approach outperformed train-then-compress methods and fixed-rank tensorized training in terms of compression and often accuracy.
  • FPGA Acceleration: Preliminary results on an FPGA prototype showed significant gains in energy efficiency and speedup for on-device training.

Limitations and Future Work

  • Computational Cost of Bayesian Inference: While more efficient than some Bayesian methods, the SVI approach still involves computational overhead compared to non-Bayesian methods.
  • Hyperparameter Tuning (for Hyperprior): While automatic rank determination is achieved, the choice of hyperprior (e.g., Half-Cauchy scale parameter η) can still influence performance and may require some tuning.
  • Future Work: The authors suggest further investigation into theoretical aspects, algorithm/hardware co-design, and extending the method to even larger-scale neural networks and resource-constrained platforms. They also mention the potential for applying the method to other tensor problems beyond neural networks.

Summary updated

BibTeX
@article{hawkins2022towards,
  author = {Cole Hawkins and Xing Liu and Zheng Zhang},
  title = {{Towards Compact Neural Networks via End-to-End Training: A Bayesian Tensor Approach with Automatic Rank Determination}},
  journal = {SIAM J. Math. Data Sci.},
  year = {2022},
  doi = {10.1137/21m1391444},
}
Figure