An Optimal Control Approach to Deep Learning and Applications to Discrete-Weight Neural Networks

Qianxiao Li, Shuji Hao

TL;DR

This paper reformulates deep learning as a discrete-time optimal control problem, moving away from the standard gradient-descent paradigm. By applying Pontryagin’s Maximum Principle (PMP), the authors develop a non-gradient-based training algorithm called the Method of Successive Approximations (MSA). This approach proves particularly effective for training neural networks with discrete weights (binary and ternary), which are traditionally difficult to optimize using standard backpropagation.

The Problem: Beyond Gradient Descent

The vast majority of deep learning relies on backpropagation and stochastic gradient descent (SGD). This approach fundamentally requires the objective function to be differentiable with respect to the trainable parameters (weights). However, this creates a major hurdle for "unconventional" architectures, such as networks with discrete weights (e.g., weights restricted to $\{-1, 1\}$ or $\{-1, 0, 1\}$).

In these discrete cases, gradients are either zero or undefined, forcing researchers to rely on workarounds like "shadow weights" or straight-through estimators. The authors tackle this limitation by reframing the neural network as a dynamical system where each layer represents a time step, and the weights act as "control" variables. This perspective allows them to tap into the rich mathematical toolbox of optimal control theory to find optimality conditions that do not depend on gradients.

Methods: The Method of Successive Approximations (MSA)

The core contribution of the paper is the introduction of the MSA algorithm to the deep learning context. The training process follows three main steps per iteration:

  1. Forward Pass (State): Propagate the input through the network to compute the "states" (activations) at each layer.
  2. Backward Pass (Co-state): Propagate the error backward to compute "co-states." Unlike standard backpropagation, this step does not calculate weight gradients; instead, it calculates the sensitivity of the loss to the activations.
  3. Hamiltonian Maximization: Update the weights by maximizing a function called the Hamiltonian.

Crucially, the Hamiltonian maximization step is decoupled across layers. For discrete-weight networks, the authors demonstrate that this maximization often has an explicit, closed-form solution (e.g., a simple sign function for binary weights). To ensure the algorithm remains stable and does not diverge, they introduce a stabilization term based on a rigorous error estimate proved for the discrete-time case.

Key Insights

  • Gradients are Optional: The PMP provides a "stronger" condition for optimality than gradients. It seeks a global maximum of the Hamiltonian at each layer rather than just a local stationary point.
  • Decoupled Optimization: Because the Hamiltonian maximization is decoupled, the weight updates for different layers can theoretically be computed in parallel. This offers a promising alternative path for hardware acceleration compared to sequential backpropagation.
  • Different Optimization Dynamics: The authors noted that MSA tends to overfit more than SGD-based methods. This suggests that the optimal control approach explores the loss landscape in a fundamentally different way, potentially finding sharper minima that generalize differently.

Key Results: Performance and Convergence

The authors evaluated their approach on three standard image classification benchmarks: MNIST, CIFAR-10, and SVHN. They compared their MSA-based training against BinaryConnect, a popular existing method for training binary-weight networks.

Training loss and error rate comparison between MSA and BinaryConnect across MNIST, CIFAR-10, and SVHN datasets.

The MSA algorithm achieved competitive accuracy compared to BinaryConnect across all three datasets. Furthermore, the stabilized version of MSA demonstrated rapid convergence in training loss, often reaching near-zero training error much faster than traditional methods.

Extreme Sparsity in Ternary Networks

One of the most striking results emerged when applying the method to ternary networks (weights restricted to $\{-1, 0, 1\}$). When combined with $L_2$ regularization, the MSA algorithm produced extremely sparse models.

Error rate and sparsity comparison showing MSA achieving extreme sparsity compared to BinaryConnect.

As the training progressed, the weights naturally "settled" into zero without the need for complex, post-hoc pruning schedules. The MSA reached remarkably high levels of sparsity:

  • MNIST: < 1.0% non-zero weights.
  • CIFAR-10: 0.9% non-zero weights.
  • SVHN: 2.4% non-zero weights.

Limitations and Future Work

While promising, the optimal control framework introduces new challenges:

  • Overfitting: The tendency to overfit on larger datasets (like CIFAR-10 and SVHN) indicates that standard regularization techniques used in SGD might need to be reimagined for this new paradigm.
  • Convexity Assumptions: The discrete-time PMP requires certain convexity assumptions about the layer transformations. While these generally hold for standard fully connected or convolutional layers, they may not hold for all possible modern architectures.
  • Theoretical Convergence: The authors provided a rigorous error estimate for a single step, but a full proof of global convergence for the iterative MSA algorithm in a general deep learning setting remains an open challenge.
  • Scaling: Future work is necessary to determine how effectively this approach scales to much larger architectures, such as ResNets or Transformers.

Summary updated

BibTeX
@inproceedings{li2018optimal,
  author = {Qianxiao Li and Shuji Hao},
  title = {{An Optimal Control Approach to Deep Learning and Applications to Discrete-Weight Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
}
Figure