Globally Optimal Training of Neural Networks with Threshold Activation Functions

Tolga Ergen, Halil Ibrahim Gulluk, Jonathan Lacotte, Mert Pilanci · DOI

Abstract

Threshold activation functions are highly desirable for hardware-efficient artificial intelligence due to their ability to replace complex multiplications with simple bitwise logic. However, their non-differentiability—specifically, the fact that their gradients are zero almost everywhere—makes them notoriously difficult to train using standard backpropagation. This paper presents a breakthrough by reformulating the training of threshold networks as a convex optimization problem. By leveraging the geometry of hyperplane arrangements, the authors provide a polynomial-time path to global optimality, bypassing the need for unstable heuristics like the Straight-Through Estimator (STE).

Introduction

Modern deep learning is largely built on the ReLU activation function, primarily because it is amenable to gradient-based optimization. Yet, from a hardware perspective, ReLU is suboptimal, requiring high-precision floating-point operations that consume significant power and memory. Threshold activations (step functions) mimic biological neurons more closely and are far more efficient for edge computing and specialized hardware.

The primary obstacle to adopting threshold networks has been the "zero-gradient" problem. Since the derivative of a step function is zero everywhere except at the origin (where it is undefined), standard gradient descent fails. Researchers have traditionally relied on the Straight-Through Estimator (STE), which "fakes" a gradient during the backward pass. While sometimes effective, STE is sensitive to initialization, prone to local minima, and lacks theoretical guarantees. This research replaces these heuristics with a mathematically rigorous, globally optimal framework.

Methods: The Convex Shift

The authors' approach centers on the realization that the non-convexity of threshold networks can be managed by looking at the geometry of the data rather than the calculus of the weights.

Hyperplane Arrangements and Lasso

When data passes through a threshold neuron, the neuron’s weights define a hyperplane that partitions the input space. The researchers prove that the training objective for a threshold network with weight-decay regularization can be mapped exactly to a standard Lasso problem. Instead of optimizing weights directly, the problem is transformed into finding a sparse combination of "data patterns" (arrangements) that best fit the target labels. Because Lasso is a convex problem, it can be solved to global optimality using efficient, off-the-shelf solvers.

Depth and Complexity

A key theoretical contribution of the paper is the analysis of network depth. The authors show that deeper networks are significantly more efficient at "shattering" data—assigning arbitrary binary labels to a set of points. As the network grows deeper, the width required to reach a "complete arrangement" regime (where optimization becomes a simple linear-time calculation) decreases. Specifically, for a network of depth $L$ and $n$ samples, a width of $O(\sqrt{n}/L)$ allows the problem to be solved in $O(n)$ time.

Weight Reconstruction

Once the optimal data patterns are identified via the convex program, the actual weights of the neural network must be reconstructed. The authors utilize methods such as Support Vector Machines (SVMs) or pseudo-inverses to find the weight vectors that produce the optimal partitions identified in the convex step.

Experimental Results

The proposed Convex-Lasso method was evaluated against several variants of STE (including ReLU-STE and Leaky-ReLU-STE) across 13 datasets, including MNIST, CIFAR-10, and 11 tabular datasets from the UCI Machine Learning Repository.

  • Performance: The Convex-Lasso approach achieved the highest test accuracy on 9 out of the 13 datasets.
  • Global Optimality: In every test case, the convex formulation reached a lower objective value (the sum of training loss and regularization) than the non-convex heuristics, regardless of the number of random restarts used for the heuristics.
  • Efficiency: For wide networks, the linear-time $O(n)$ formulation proved to be faster than standard backpropagation, demonstrating that global optimality does not necessarily come at the cost of computational speed.

Discussion and Limitations

While this framework provides a powerful alternative to gradient descent, some challenges remain:

  1. Reconstruction Ambiguity: The convex problem identifies the optimal output for each layer, but multiple weight configurations can produce that output. The choice of reconstruction method (e.g., SVM) may influence the model's final generalization and robustness.
  2. High-Rank Data: The complexity of enumerating all possible hyperplane arrangements depends on the rank of the data matrix. For very high-dimensional data, the number of arrangements can become large, necessitating the use of the authors' "Convex-Lasso" approximation or other sampling techniques.
  3. Architectural Constraints: The current work focuses on fully connected architectures. Extending these guarantees to Convolutional Neural Networks (CNNs) or Transformers is a significant area for future research.

Conclusion

By proving that threshold networks can be trained via convex optimization, this paper bridges the gap between biological inspiration and mathematical rigor. It provides a robust alternative to the "hacks" currently used in hardware-efficient AI, offering a path toward models that are both globally optimal and extremely efficient to deploy on low-power devices.

Summary updated

BibTeX
@inproceedings{ergen2023globally,
  author = {Tolga Ergen and Halil Ibrahim Gulluk and Jonathan Lacotte and Mert Pilanci},
  title = {{Globally Optimal Training of Neural Networks with Threshold Activation Functions}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=_9k5kTgyHT},
}
Figure