Hardness of Learning Fixed Parities with Neural Networks

Itamar Shoshani, Ohad ShamirarXiv 2025 · DOI

Abstract

While simple neural networks possess the expressivity to represent parity functions, standard gradient-based optimization methods consistently fail to learn them. This paper provides a theoretical foundation for this failure by analyzing the Fourier coefficients of linear threshold functions. The authors demonstrate that for any fixed parity, the gradients of one-hidden-layer ReLU networks are exponentially small, causing the optimization process to collapse into a random walk. This result closes a significant gap in machine learning theory by proving hardness for specific, fixed parities rather than just worst-case scenarios.

Introduction

In machine learning theory, parity functions—which determine whether the number of -1s in a subset of inputs is even or odd—serve as a fundamental benchmark for "hard" problems. Despite their simplicity in logic and classical computation (e.g., Gaussian elimination), they remain notoriously difficult for neural networks trained via gradient descent.

Historically, this difficulty was characterized through Statistical Query (SQ) lower bounds. However, SQ bounds primarily establish that for any algorithm, there exists some parity function that is hard to learn. They do not necessarily explain why a specific parity, such as the XOR of all input bits, remains intractable in practice. This paper addresses this limitation by proving that any fixed parity of sufficient size is inherently hard for standard neural network training architectures.

Theoretical Framework

Optimization and Architecture

The study focuses on one-hidden-layer ReLU networks trained using Perturbed Gradient Descent (PGD). PGD is a variant of gradient descent where small amounts of Gaussian noise are added to the gradients at each step. This model is frequently used in theoretical analysis to simulate the stochasticity of Stochastic Gradient Descent (SGD) or to model the process of escaping saddle points.

Boolean Fourier Analysis

The core of the proof utilizes Boolean Fourier Analysis. The authors establish a mathematical bridge between the gradient of the neural network's loss function and the Fourier coefficients of linear threshold functions (LTFs), also known as weighted majority functions. By examining how these coefficients behave, the authors can quantify the "signal" available to the optimization algorithm.

The Mechanism of Failure

The paper identifies a three-step process that leads to the failure of learning:

  1. Exponentially Small Gradients: The authors prove that for almost all weight initializations, the gradients are exponentially small relative to the size of the parity $|S|$. This is driven by a new result in Boolean analysis: while specific functions like "Majority" have polynomially decaying Fourier coefficients, general weighted majority functions exhibit exponential decay on average.
  2. The Random Walk Regime: Because the gradients (the signal) are so minute, they are overwhelmed by the noise inherent in initialization and the perturbations of PGD. Consequently, the distribution of the network's weights during training becomes nearly indistinguishable from a Gaussian random walk.
  3. Information-Theoretic Hardness: Since a random walk is essentially oblivious to the target function, the network cannot extract meaningful information from the labels. To reduce the loss by a non-negligible amount, the algorithm would require an exponential number of iterations.

Key Insights

Expressivity vs. Learnability

A critical contribution of this work is the distinction between what a network can do and what it will do. The authors provide a "folklore" proof (Theorem 1) showing that a small ReLU network is expressive enough to perfectly represent any parity function. The hardness of parity learning is therefore not a limitation of the network's capacity, but a failure of the optimization landscape, which remains essentially flat for these functions.

Generalization of Hardness

Previous research often required the parity size to be approximately half the input dimension ($d/2$) to prove hardness. This paper extends the result to the "full parity" case (where $|S|=d$), which is the configuration most frequently encountered in experimental simulations and practical parity-based benchmarks.

Conclusion and Future Work

This research provides a rigorous explanation for why gradient-based methods fail on parity problems: the learning signal is effectively lost in the noise of the optimization process. However, several avenues for future research remain:

  • Architecture Depth: The current proof is tailored to one-hidden-layer ReLU networks. Extending these techniques to deeper architectures is a natural next step.
  • SGD Formalization: While PGD is a robust proxy, a formal extension of these results to standard SGD would further solidify the theory.
  • Activation Functions: The proof relies on the specific properties of ReLU. Investigating whether alternative activation functions, such as periodic or "bump-like" functions, can bypass these lower bounds remains an open question in the field.

Summary updated

BibTeX
@misc{shoshani2025hardness,
  author = {Itamar Shoshani and Ohad Shamir},
  title = {{Hardness of Learning Fixed Parities with Neural Networks}},
  year = {2025},
  eprint = {2501.00817},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.00817},
}
Figure