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

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

TL;DR

This paper demonstrates that Stochastic Gradient Descent (SGD) can solve the computationally hard problem of learning sparse parities near the theoretical limit of $n^{O(k)}$ iterations. The authors reveal that the sudden "phase transitions" in performance—where a model appears to learn nothing for thousands of steps before abruptly succeeding—are actually driven by a "hidden progress" mechanism where SGD gradually amplifies sparse features via subtle signals in the population gradient.

What Problem Does This Paper Address?

Deep learning often exhibits "emergent capabilities": as we scale up models, data, or training time, performance doesn't just improve linearly; it sometimes jumps qualitatively at a specific threshold. A famous example is "grokking," where a model suddenly transitions from zero to perfect generalization long after it has overfit the training set.

The authors investigate the computational roots of these transitions using a canonical "hard" problem: learning $k$-sparse parities. In this task, the goal is to identify which $k$ bits out of an $n$-bit string determine the output (their XOR sum). While statistically easy (requiring few samples), it is computationally difficult for most algorithms, including gradient-based ones, which typically require $n^{O(k)}$ time—a massive jump as $k$ increases. The paper asks: How does SGD manage to solve this, and what is happening "under the hood" during those long plateaus of zero progress?

Methods

The researchers combined extensive empirical experiments with new theoretical analyses:

  • Architectures: They tested a wide range of models, including standard 2-layer ReLU MLPs, Transformers, and a specialized "PolyNet" (which outputs the product of linear functions).
  • Training: They used standard SGD and Adam with various initializations (Gaussian, Uniform, Bernoulli) and batch sizes.
  • Theoretical Lens: They analyzed the Fourier gap in the population gradient. They proved that even at initialization, the gradient contains a tiny but detectable signal that correlates with the "correct" features.
  • Progress Measures: To see what was happening during the plateaus, they tracked "white-box" metrics like weight movement ($\|w_t - w_0\|_\infty$) and the amplification of specific Fourier coefficients.

Datasets

The study uses a synthetic $(n, k)$-sparse parity dataset.

  • Input: Random binary strings of length $n$.
  • Label: The XOR (parity) of a hidden subset of $k$ bits.
  • Setting: Primarily an "online" setting where the model receives a fresh stream of i.i.d. samples, though they also explore finite-sample regimes to study grokking.

Key Insights and Ideas

  • Hidden Progress vs. Random Search: A common hypothesis for sudden success is that SGD "stumbles in the dark" (random search) until it hits the right parameters. The authors disprove this by showing that convergence times are highly concentrated and scale predictably with $n$ and $k$, rather than following the memoryless distribution of random search.
  • The Fourier Gap: The core "aha!" moment is that the gradient at initialization isn't purely noise. For many activations (like ReLU or sinusoids), there is a gap between the gradient coordinates corresponding to relevant features versus irrelevant ones.
  • Feature Amplification: SGD acts as an amplifier. It uses the tiny signal from the Fourier gap to steadily move weights toward the sparse solution. This progress is "hidden" because the loss function is extremely insensitive to these small weight changes until they reach a critical magnitude, at which point the error drops precipitously.
Figure 1: Main empirical findings at a glance. A variety of neural networks, with standard training and initialization, can solve the (n, k)-parity learning problem, with a number of iterations scaling as nO(k). Left: Training curves under various algorithmic choices (architecture, batch size, learning rate) on the (n = 50, k = 3)-parity problem. Right: Median convergence times for small (n, k).

Key Results

  • Near-Optimal Scaling: Across all architectures, SGD solves the parity problem in roughly $n^{O(k)}$ iterations. This nearly matches the lower bounds for Statistical Query (SQ) algorithms, suggesting SGD is performing near the computational limit for this class of learners.
  • Phase Transitions are Universal: The "plateau-then-drop" behavior was observed across MLPs, Transformers, and PolyNets, regardless of the specific activation function or initialization.
  • Quantifying the "Hidden": By plotting the weight movement, the authors showed that progress is linear and continuous throughout the training process, even when the validation error remains stuck at 50% (random chance).
Figure 3: Visualizing hidden progress. While loss and error (top) stay flat, the weights of the relevant features (bottom) are being steadily amplified.

Limitations and Future Work

  • Batch Size Complexity: While the theory handles large batches well, the authors note that analyzing the small-batch regime (where noise is high) remains an open challenge.
  • Beyond Parity: Parity is a "pure" combinatorial problem. Real-world tasks (like language modeling) likely involve a mix of easy-to-learn features and hard parity-like subtasks. Extending these insights to non-synthetic data is a major next step.
  • Depth: The current theoretical analysis focuses on shallow networks. Understanding how depth interacts with feature amplification in deeper polynomial-activation MLPs is flagged for future research.

Summary updated

BibTeX
@inproceedings{barak2022hidden,
  author = {Boaz Barak and Benjamin L. Edelman and Surbhi Goel and Sham 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