Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational Limit

Boaz Barak, Benjamin L. Edelman, Surbhi Goel, Sham M. Kakade, Eran Malach, Cyril Zhang

Introduction

Deep learning models often exhibit "emergent" capabilities—sudden jumps in performance after long periods of apparent stagnation. This paper demonstrates that for the computationally hard problem of learning sparse parities, Stochastic Gradient Descent (SGD) is not simply "getting lucky" through random search. Instead, it makes "hidden progress" by gradually amplifying feature signals in the gradient long before any improvement is visible in loss or accuracy metrics.

The Sparse Parity Problem

In large-scale AI, we frequently see "phase transitions" where a model suddenly masters a task (like reasoning or arithmetic) only after a certain amount of training or scaling. This raises a fundamental question: Is the optimizer just "stumbling in the dark" until it hits a lucky configuration, or is it making steady, invisible progress?

The authors tackle this using the sparse parity problem as a mathematical sandbox. In this task, a model must learn to output the XOR of $k$ specific bits hidden within a longer string of $n$ bits. This is a classic "hard" problem because the gradient for any single bit is nearly zero unless the model has already identified the other $k-1$ bits. It is statistically simple but computationally difficult, making it the perfect test case for understanding the limits of gradient-based optimization.

Methodology

The researchers combined extensive empirical simulations with new theoretical frameworks, testing on synthetic parity datasets consisting of random $n$-bit binary strings and labels representing the XOR of a hidden subset of $k$ bits.

  • Diverse Architectures: They tested standard models like Multi-Layer Perceptrons (MLPs) and Transformers, alongside specialized ones like "PolyNets" (which output products of linear functions) and single-neuron networks with oscillating activations.
  • Fourier Analysis: The authors used the harmonic analysis of Boolean functions to study the "Fourier gap"—the difference between the gradient signal of relevant features versus irrelevant noise.
  • PolyNet & Trajectory Analysis: They introduced "PolyNet," a simplified architecture that allowed them to mathematically prove that SGD can solve the parity problem in $n^{O(k)}$ iterations, matching known theoretical lower bounds.

Key Insights

  • Hidden Progress is Real: Even when the loss curve is perfectly flat (the "plateau"), the weights are moving in a purposeful direction. The population gradient gradually amplifies the "signal" of the $k$ relevant bits.
  • Not Random Search: If SGD were just performing a random search (like a Langevin process), we would expect some trials to "get lucky" and converge almost immediately. Instead, the data shows a clear "waiting period" followed by a sharp transition, suggesting a deterministic accumulation of signal.
  • Initialization Matters More than Noise: Convergence time depends heavily on the specific random initialization of the weights. However, once training starts, the path to success is remarkably consistent across different batches of data.
Training curves for various architectures show a long plateau followed by a sudden drop in error.

Key Results

  • Universal Success: A wide variety of neural networks successfully learn sparse parities without any explicit "sparse prior" or specialized tuning.
  • Hitting the SQ Limit: The time it takes for SGD to succeed scales as $n^{O(k)}$. This nearly matches the Statistical Query (SQ) lower bound, which is the theoretical speed limit for any algorithm that learns by looking at correlations.
  • Phase Transitions: The paper quantifies the "abruptness" of learning. In their idealized "disjoint-PolyNet" model, they prove that the model spends over 99% of its training time with an error rate of ~50% (no better than guessing) before dropping to near-zero error in the final moments.
  • Grokking: They replicate the "grokking" phenomenon—where a model overfits the training data early on but suddenly achieves perfect generalization much later—showing it occurs naturally in the parity setting when data is limited.
Median convergence times scale polynomially with the dimension n, following the n^{O(k)} power law.

Limitations and Future Work

  • Coupled Resources: The current study mostly looks at the "online" setting where the model sees fresh data at every step. In the real world, training time and dataset size are separate constraints.
  • Mathematical Gaps: While the authors prove results for specific architectures (like PolyNets and certain MLPs), a general theory that covers all standard architectures (like deep Transformers) remains an open challenge.
  • Real-World Complexity: Sparse parity is a "pure" combinatorial problem. Future work is needed to see how these "hidden progress" measures translate to messy, real-world tasks like natural language understanding or image recognition.

Summary updated

BibTeX
@inproceedings{barak2022hidden,
  author = {Boaz Barak and Benjamin L. Edelman and Surbhi Goel and Sham M. Kakade and Eran Malach and Cyril Zhang},
  title = {{Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational Limit}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=dq4doFPKJnB},
}
Figure