Learning Quantized Neural Nets by Coarse Gradient Method for Non-linear Classification

Ziang Long, Penghang Yin, Jack XinarXiv 2020

Quantized Neural Networks (QNNs) are a cornerstone of efficient AI deployment, enabling complex models to run on resource-constrained edge devices by using low-bit representations (e.g., 2-bit or 4-bit) instead of standard 32-bit floats. However, training these networks presents a significant mathematical hurdle: their activation functions are piecewise constant, leading to gradients that are zero almost everywhere. This paper establishes a theoretical foundation for the "Straight-Through Estimator" (STE), a popular heuristic used to overcome this vanishing gradient problem.

The Challenge of Quantized Neural Networks

Standard training relies on Gradient Descent, which requires smooth, differentiable functions to calculate weight updates. In QNNs, the activation functions resemble a "staircase" (quantized ReLU), where the output only changes at specific thresholds. Because the derivative of a flat step is zero, the network cannot learn using traditional backpropagation.

Visualizing 1-bit and 2-bit quantized ReLU functions, illustrating the discrete "staircase" nature that causes vanishing gradients.

To bypass this, researchers use a Straight-Through Estimator (STE) or Coarse Gradient Method. This approach uses the quantized function during the forward pass for prediction but substitutes it with a smooth surrogate function during the backward pass for training. While empirically successful, the mathematical guarantees for its convergence in non-linear classification have remained elusive until now.

Bridging the Gap with Coarse Gradients

The authors analyze a two-layer neural network and define a class of surrogate functions ($g$) for the backward pass that ensure convergence. These functions must satisfy two primary criteria: they must zero out negative inputs ($g(x) = 0$ for $x \leq 0$) and maintain a positive lower bound on their derivative for positive inputs ($g'(x) \geq \delta > 0$).

Three proposed surrogate functions for the backward pass: standard ReLU, reverse exponential, and log-tailed ReLU.

By using these proxy functions—specifically standard ReLU, Log-tailed ReLU, or Reverse Exponential STE—the authors prove that the "fake" gradient still serves as a valid descent direction. Even though it is not the true gradient of the loss function, its monotonicity ensures that weight updates consistently move the model toward a global minimum.

Theoretical Insights and Convergence

The paper's core contribution is a mathematical proof showing that for data separable into distinct subspaces, the coarse gradient method drives the population hinge loss to zero. Key insights include:

  • Weight Growth as a Mechanism: The norm of the weights generally increases during training. This growth allows the network to eventually "jump" the discrete thresholds of the quantized activation functions.
  • Subspace Clustering: The theory assumes data classes exist in distinct subspaces. Experimental evidence suggests that deep networks naturally learn to cluster features into nearly linearly independent subspaces, validating the real-world relevance of the two-layer theoretical model.

Empirical Validation

The theoretical framework was tested across synthetic and real-world datasets:

  • Synthetic Data: The method consistently reached global minima, even when data subspaces were not perfectly orthogonal.
  • MNIST: A 4-bit quantized model using a log-tailed ReLU achieved 99.36% accuracy, nearly matching the full-precision (32-bit) baseline of 99.45%.
  • CIFAR-10: Tests on deeper architectures like VGG-11 and ResNet-20 confirmed that the proposed STEs (particularly Log-tailed and Reverse Exponential) remain robust and effective in complex image recognition tasks.

Conclusion

This research provides a long-awaited theoretical justification for the success of coarse gradient methods in training quantized networks. By proving that monotonic surrogate gradients can lead to global convergence in non-linear classification, the authors bridge the gap between heuristic practice and mathematical theory, paving the way for more principled designs of efficient, low-bit neural architectures.

Summary updated

BibTeX
@misc{long2020learning,
  author = {Ziang Long and Penghang Yin and Jack Xin},
  title = {{Learning Quantized Neural Nets by Coarse Gradient Method for Non-linear Classification}},
  year = {2020},
  eprint = {2011.11256},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.11256},
}
Figure