Gradient Descent Fails to Learn High-frequency Functions and Modular Arithmetic
Rustem Takhanov, Maxat Tezekbayev, Artur Pak, Arman Bolatov, Zhenisbek Assylbekov
TL;DR
This work investigates why gradient-based learning struggles to learn high-frequency and modular arithmetic functions. By modeling targets as $h_a(x)=\psi(ax)$ with a 1-periodic $\psi$ of bounded variation and its discrete analogue on ${\mathbb Z}_p$, the authors bound the gradient variance as $Var(\mathcal{H}_A, \mathbf{w}) \in \tilde{\mathcal{O}}(1/\sqrt{A})$ and $Var(\mathring{\mathcal{H}}_p, \mathbf{w}) \in \tilde{\mathcal{O}}(1/\sqrt{p})$, showing barren plateaus for large frequency or base. They connect these gradient-variance bounds to SQ-dimension, proving lower bounds that imply hardness for SQ algorithms as well as gradient-based methods. The analysis combines Boas–Bellman inequalities with ergodic-translation techniques on a 2D torus and leverages discrete Fourier transforms to handle $p$-periodic functions. Empirical verifications on real waves and modular multiplication corroborate the theory, illustrating the practical difficulty of learning such tasks with SGD-like optimization and standard neural networks. Overall, the results delineate fundamental limits on gradient-based learnability for high-frequency and modular arithmetic targets and suggest deeper connections to SQ hardness and grokking phenomena.
Abstract
Classes of target functions containing a large number of approximately orthogonal elements are known to be hard to learn by the Statistical Query algorithms. Recently this classical fact re-emerged in a theory of gradient-based optimization of neural networks. In the novel framework, the hardness of a class is usually quantified by the variance of the gradient with respect to a random choice of a target function. A set of functions of the form $x\to ax \bmod p$, where $a$ is taken from ${\mathbb Z}_p$, has attracted some attention from deep learning theorists and cryptographers recently. This class can be understood as a subset of $p$-periodic functions on ${\mathbb Z}$ and is tightly connected with a class of high-frequency periodic functions on the real line. We present a mathematical analysis of limitations and challenges associated with using gradient-based learning techniques to train a high-frequency periodic function or modular multiplication from examples. We highlight that the variance of the gradient is negligibly small in both cases when either a frequency or the prime base $p$ is large. This in turn prevents such a learning algorithm from being successful.
