Abstract
Deep learning is formulated as a discrete-time optimal control problem. This allows one to characterize necessary conditions for optimality and develop training algorithms that do not rely on gradients with respect to the trainable parameters. In particular, we introduce the discrete-time method of successive approximations (MSA), which is based on the Pontryagin's maximum principle, for training neural networks. A rigorous error estimate for the discrete MSA is obtained, which sheds light on its dynamics and the means to stabilize the algorithm. The developed methods are applied to train, in a rather principled way, neural networks with weights that are constrained to take values in a discrete set. We obtain competitive performance and interestingly, very sparse weights in the case of ternary networks, which may be useful in model deployment in low-memory devices.
Introduction
Most deep learning models are trained using Stochastic Gradient Descent (SGD). While effective for continuous weights, SGD struggles with discrete-weight networks (e.g., weights restricted to $\{-1, 1\}$ or $\{-1, 0, 1\}$). Because discrete sets do not support infinitesimal steps, gradients are not naturally defined, often requiring heuristic "hacks" like the Straight-Through Estimator. This paper proposes a principled mathematical framework by treating deep learning as a discrete-time optimal control problem, where each layer represents a time-step in a dynamical system.
Methodology: The MSA Algorithm
The authors bridge the gap between deep learning and Optimal Control Theory by treating layer activations as "states" ($x$) and weights as "controls" ($\theta$). Training is thus viewed as finding a trajectory of controls that minimizes a final loss function.
Pontryagin’s Maximum Principle (PMP)
Instead of seeking points where the gradient is zero, the framework utilizes PMP to define a Hamiltonian function for each layer. An optimal set of weights must globally maximize this Hamiltonian. This leads to the Method of Successive Approximations (MSA), which consists of three steps per iteration:
- Forward Pass: Compute all activations (states).
- Backward Pass: Compute "co-states" (analogous to gradients of the loss with respect to activations).
- Hamiltonian Maximization: Update layer weights by solving a maximization problem. For discrete weights, this maximization often has an explicit analytical solution, such as a simple
signfunction.
To ensure stability, the authors introduce a penalty term to the Hamiltonian, supported by a rigorous error estimate (Theorem 2) that prevents the algorithm from diverging.
Experimental Results
The MSA algorithm was evaluated on three standard image classification benchmarks: MNIST (fully-connected), CIFAR-10 (convolutional), and SVHN (convolutional).
As shown in the training curves, MSA acts as a very aggressive optimizer, finding low-loss solutions significantly faster than standard binary training methods like BinaryConnect. While it achieves competitive test accuracy, its high optimization strength can lead to overfitting on more complex datasets like CIFAR-10, suggesting a need for adapted regularization techniques.
Extreme Sparsity in Ternary Networks
A striking discovery of this research is the natural emergence of extreme sparsity when training ternary networks (weights in $\{-1, 0, 1\}$). The MSA algorithm naturally pushes the vast majority of weights to zero without explicit pruning heuristics.
Quantitatively, the algorithm produced models where 97.5% to 99.5% of the weights were zero:
- MNIST: < 1.0% non-zero weights.
- CIFAR-10: 0.9% non-zero weights.
- SVHN: 2.4% non-zero weights.
This level of sparsity is highly beneficial for deploying models on low-memory and edge devices.
Conclusion and Future Work
The optimal control formulation provides a robust, gradient-free alternative for training discrete-weight networks. While the MSA algorithm shows immense promise in optimization speed and model compression, future work remains to address hyper-parameter sensitivity (specifically the penalty parameter $\rho$) and to develop a full proof of global convergence for deep, non-convex architectures.
Summary updated