NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Beyond Discreteness: Finite-Sample Analysis of Straight-Through Estimator for Quantization

Halyun Jeong, Jack Xin, Penghang YinarXiv 2025 · DOI

Introduction

Quantizing neural networks—reducing the precision of weights and activations—is a critical technique for deploying deep learning models on resource-constrained hardware such as mobile devices and IoT sensors. Despite its practical necessity, training quantized networks presents a significant theoretical challenge: the discrete nature of the parameters results in gradients that are either zero or undefined, rendering standard gradient descent inapplicable.

The industry-standard workaround is the Straight-Through Estimator (STE), a heuristic that substitutes non-differentiable functions with differentiable surrogates during the backward pass. While STE has seen widespread empirical success, its theoretical foundations have remained largely unexplored, particularly in the "finite-sample" regime that characterizes real-world training. This paper provides the first rigorous finite-sample analysis of STE, establishing sample complexity bounds and uncovering the unique dynamical behavior of the algorithm.

Theoretical Framework

The authors focus their analysis on a two-layer neural network architecture utilizing binary weights and activations. They analyze a specific variant known as the STE-gradient method, which employs:

  • ReLU STE to approximate the gradients of discrete activation functions.
  • Identity STE to handle weight quantization.

To bridge the gap between heuristic and theory, the research integrates two distinct mathematical fields. First, it adapts the Restricted Approximate Invertibility Condition (RAIC) from 1-bit compressed sensing to demonstrate that the surrogate gradient remains sufficiently aligned with the true (but hidden) descent direction. Second, the authors employ Dynamical Systems Theory, specifically occupation time analysis, to study weight drift. Rather than attempting to prove that weights remain fixed at a global minimum, they demonstrate that the weights spend the vast majority of their trajectory within the optimal region.

Sample Complexity and Convergence

A central contribution of this work is the derivation of specific sample complexity bounds required for convergence. The success of STE is shown to be heavily dependent on the ratio of training samples ($N$) to the dimensionality of the network ($n$).

Ergodic vs. Last-Iterate Convergence

The analysis reveals a significant performance gap between different iteration strategies:

  • Ergodic (Averaged) Iterates: By averaging the weights over time, the algorithm achieves stable convergence with a sample complexity of $O(n^2)$. Numerical experiments confirm that this $O(n^2)$ bound is "sharp," accurately reflecting the behavior observed in practice.
  • Last-Iterate Convergence: Relying solely on the final iteration is significantly less efficient, requiring a much higher sample complexity of $O(n^4)$ to guarantee success.

The "Recurrence" Phenomenon

In noisy environments, the iterates of the STE do not simply settle at a global minimum. Instead, the paper identifies a "recurrence" behavior: the iterates repeatedly visit and escape the global minimum. This is driven by the interaction between a drift term (which pulls the model toward the ground truth) and a perturbation term (resulting from noise and approximation errors).

As long as the sample size is sufficiently large, the drift term dominates the perturbation. Interestingly, the authors argue that this inherent instability may be a feature rather than a flaw, as the constant movement prevents the model from stagnating in suboptimal local regions.

Key Results and Empirical Validation

The theoretical findings were validated using synthetic datasets consisting of random Gaussian input vectors and labels generated by a "teacher" network. Key results include:

  • Exact Recovery: The paper proves that STE can achieve exact recovery of optimal binary weights given sufficient data and iterations.
  • Noise Robustness: The algorithm remains robust even when labels are corrupted by sub-Gaussian noise, provided the sample complexity requirements are met.
  • Sharpness of Bounds: Empirical recovery rates across varying dimensions and sample sizes closely match the predicted $O(n^2)$ complexity for averaged iterates.

Limitations and Future Work

While this paper establishes a foundational theoretical framework for STE, several avenues for future research remain:

  1. Architecture Depth: The current analysis is restricted to two-layer networks. Extending these proofs to deep, multi-layer architectures is a primary challenge.
  2. Conservative Bounds: The $O(n^4)$ bound for last-iterate convergence appears conservative in empirical tests, suggesting the mathematical proof could be further tightened.
  3. Data Distributions: The reliance on Gaussian input data limits the immediate generalizability to complex real-world data like images or natural language, which follow non-Gaussian distributions.

By providing a rigorous mathematical basis for a previously heuristic method, this work moves the field closer to a complete understanding of how discrete neural networks can be effectively trained.

Summary updated

BibTeX
@misc{jeong2025beyond,
  author = {Halyun Jeong and Jack Xin and Penghang Yin},
  title = {{Beyond Discreteness: Finite-Sample Analysis of Straight-Through Estimator for Quantization}},
  year = {2025},
  eprint = {2505.18113},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.18113},
}
Figure