Manuscript Offprint
arXiv:2610.21964Why Shallow Neural Networks Learn Sinusoidal Components First: An Orthogonal Polynomial Dynamics Framework
Abstract
Neural networks often learn low-frequency components before high-frequency ones --- a phenomenon called spectral bias or termed F-principle. Many numerical studies have demonstrated this phenomenon, and theoretical studies have sought to explain it. However, several goals remain insufficiently addressed: (1) explaining spectral bias asymptotically, including its origin and why the preferred components are generally sinusoidal; (2) extending the explanation to general activation functions, such as sigmoid and ReLU; (3) making weak assumptions about the data distribution; (4) avoiding aliasing effects, such as those arising in finite-domain Fourier analysis; and (5) developing a theoretical framework applicable to arbitrary networks. We address these goals theoretically by analyzing the eigenvalue decay and eigenvector shapes of the dynamics matrix H, which arises when we expand the network output as a general Fourier series (GFS) in an orthogonal polynomial basis and express the gradient-descent dynamics of the GFS coefficients as ordinary differential equations. The graded structure of H enables an intuitive explanation of spectral bias, while orthogonal polynomial theory helps us analyze how learning bias depends on the activation function and, potentially, the network architecture.
Keywords: artificial neural network, spectral bias, orthogonal polynomials, singular value decomposition, asymptotic eigenvector
*Corresponding author
Email address: xyy82148@gmail.com (Yanyang Xiao)
1. Introduction
In light of the Universal Approximation Theorem for neural networks, there is a shadow over how networks can learn useful things. Along this path, subjects such as learning bias, implicit regularization, and information bottlenecks arise. In particular, a phenomenon called spectral bias, or the F-principle, was discovered and was thought to be connected to implicit regularization, to have explanatory power for early stopping and generalization, and to expose weaknesses on high-frequency tasks [1, 2, 3]. However, the observations in [1], although clear in deriving the main conclusion, relied on finite-domain Fourier analysis, in which lower-amplitude frequency components are largely contaminated by aliasing effects. To fix this flaw and provide a quantitative theory to explain it was the motivation of this work. Specifically, we would like to (1) find an aliasing-free representation to describe the frequency components; (2) provide the dynamics (time-dependent evolution) of the frequency components in that representation; (3) explain the spectral bias phenomenon through these dynamics; (4) allow the explanation to be only asymptotic, leaving room for easier computation, easier interpretation, and intuitive understanding; and (5) ensure that the framework (constituted by 1–4) has the potential to extend to networks beyond toy models.
Over the years, various theoretical works have emerged. The Neural Tangent Kernel (NTK) theory was the first fundamental theory closely connected to our work, in which, in principle, the training dynamics of any network can be written as evolution through the kernel [4], yet the computation of the kernel involves complex integration. Some recent papers accomplish impressive rigorous computations; for example, [5] connect the decay speed of Hermite coefficients to NTK coefficients and network depth, and [6] obtain the NTK analytically through integration for ReLU, so that various properties can be derived. However, [5] do not discuss eigenvector shape, and [6] discuss the shape of eigenvectors but only for the ReLU activation function. In contrast, our theory applies to any sensible activation function and, when explaining the shape of eigenvectors, requires no closed-form integral.
A wide range of natural signals, such as natural images, natural sounds, and EEG recordings, exhibit low-frequency domination. Traditional ways of dealing with them often rely on or connect to Fourier analysis. The sinusoidal shape of the "frequency components" in the frequency bias happens to coincide with the "principal components" of those natural signals. It may be because of this coincidence that neural networks happen to be good at processing natural signals. We would like to provide a mathematical perspective on this as a by-product of this work.
The paper is organized as follows: First, we re-represent the output of the network using an Orthogonal-Polynomial-based General Fourier Series (GFS). Then, we derive the dynamics of the GFS coefficients, which constitute the main governing equation. To analyze the dynamics of the governing equation, we then explore the key properties of the dynamics matrix —namely, its eigenvalues and eigenvectors—using a shallow neural network as an example. Finally, we discuss the relation of the matrix to the loss landscape problem and effective dimension.
We have the 2-norm loss for the error of the fitting:
Assume the samples are draw from a distribution , and the labels are come from an underlying function . Now let , we should have a theoretical loss :
The Eq. (2) naturally induced a norm and an inner product (assume all real functions)
Under the inner product in Eq. (4), there exist a set of orthonomal polynomial basis where is a polynomial of order :
In 1-D case, each has exactly zeros. Therefore the subscript has similar meaning as the in Fourier mode , i.e. the frequency.
If almost everywhere, then is a complete basis with the same convergence trends as Chebyshev approximation.
The fitting function , assumed piecewise continuous, can be expanded in Generalized Fourier Series (GFS):
(a.e.)
(6)
where (a.e.) here means (equal) almost everywhere. If is continuous, then it is point-wise equal. In later context we will denote both cases by simply equal “=”.
3. Evolution of Generalized Fourier Series in Gradient Descent
3.1. Gradient of Loss in View of Generalized Fourier Series
The expansion of gradient of loss function provides insight for gradient descent algorithm:
(8)
For example, if is 1-layer ANN ( ), with
Then
The last term in Eq. (8) is
If we further assume that is smooth in the sense of Lemma 1 or Lemma 3, then will have similar but possibly slightly degraded smoothness. See Lemma 8 for general . The following analysis are based on the Chebyshev expansion . For , it is the Legendre polynomials expansion, it has the same asymptotics as Chebyshev expansion (Ref. [7]).
Case 1, is analytical (in the sense of Lemma 3), so and are also analytical.
Let’s assume that there is no singularity in a neighborhood of real axis in the domain of , the nearest singularity is away from the real axis. In this setup, the Bernstein ellipse parameter (the in Lemma 3, not to be confused with the weighting ) is at least.
So the Bernstein ellipse parameter for is (" when ), we get
Case 2, is continuous up to -th derivative (in the sense of Lemma 1), so and are also smooth in the same sense, with for , for . Due to Lemma 1, we have
Depending on the curve , the total variation of in can have different asymptotic behavior with respect to parameter . For Relu , , , assume the turning point ,
3.2. Gradient Descent
The trajectory of in gradient descent (GD) algorithm can be rewritten in ODE as a limit of small step size (with or without , depending on how you discretize the ODE):
If there is singularity on the real axis, then it will be non-smooth with certain translation parameter , i.e. probably not a very interesting activation function.
where is the learning rate, means transpose of the Jacobian matrix inside, and
The dynamics of the GFS coefficients can be derived with help of Eq. (8) and Eq. (12):
(13)
Note that, formally, a system of linear equation
with constant symmetric matrix H and spectral decomposition has solution:
where is an arbitrary constant vector.
It is clear that the eigenvalues of H govern the dynamics of Eq.(14).
With substitution
where means vertically stack the terms indexed by to form a matrix. e.g.
We see the study of eigenvalues could greatly help the understanding of Eq.(13), despite is now time dependent. Now we turn to the analysis of matrix .
4. Structure of the matrix H
H is an matrix, for simplicity, assume it is finitely truncated. The truncation is reasonable due to the fast decaying property of . Analysis of the infinite dimension problem directly is under consideration.
Now we need to know some details of for the investigation of matrix H.
4.1. 1-Hidden Layer DNN
The 1-Hidden Layer DNN with parameter and input range is:
Due to (11), matrix H of Eq.(17) is computed from derivatives of :
The smoothness of determines the smoothness of and hence the decaying speed of along . Notably there are two common cases:
Case 1 is analytical in a neighborhood of in complex plane (in the sense of Lemma 3), so and are analytical also. Let's further assume that there is no singularity in a neighborhood of the real axis for the domain of in complex plane. i.e. the nearest singularity is ( ) away from the real axis. For example, , has singularity , thus .
In this setup, the Bernstein ellipse parameter is .
If there is singularity on the real axis, then it will be non-smooth with certain translation parameter . The estimation of will be more complicated and problem dependent.
The is the in lemma 3, not to be confused with the weighting .
So the Bernstein ellipse parameter for is , we get
Case 2 is continuous up to -th derivative (in the sense of Lemma 1), so also. And are continuous up to -th derivative, with for and , or for . By lemma 1, we have upper bound
4.2. Graded Matrix
Both Eq.(20) and Eq.(22) show the decay of with respect to . Thus the matrix Eq.(17) will also have certain decaying property. Specifically, there exist symmetric matrix of bounded spectral norm and diagonal matrix such that
where matrix can be defined as or , depending on the smoothness of . Or, a more straightforward way is to define . And where pseudo-inverse of is used if necessary. In the later definition of , it is easy to show that or . The matrix with structure Eq.(23) is called graded matrix.
For matrix that has structure Eq.(23), due to Min-max theorem of eigenvalues, we have
where is the -th eigenvalue of sorting in descending order. Due to , Eq. (24) can also written as (assume )
Another way to derive it is by the Schur–Horn theorem. The sorted array of diagonal satisfies
and
Eq. (27) minus Eq. (26), with the fact that , , we get
For example, if
5. Related Problems That Encounter Similar Matrix H
5.1. Hessian of Loss Function
The hessian of loss function is
Define
When the reaches the global optimal solution such that , the hessian become
When writing in terms of GFS,
we have
The matrix and (Eq.(17)) are differed only by the multiplication order of the transposed matrix, therefore they have exactly the same eigenvalues. For simplicity, define when exceed corresponding matrix dimension.
Thus from Sec. 4.2 we know that the landscape of loss is extremely flat due to the vast near zero eigenvalues as shown in Eq.(24).
5.2. Effective Dimension of Base Function
The following equation are arised in Extreme learning machine [8], or fixing weights , fitting only in Eq. .
Define
and
It is clear that has the same eigenvalue decaying property as or . And .... Ideally, the parameters can be solved through
by its normal equation
However, due to the analysis above is numerically not full rank.
Acknowledgment
It was a great pleasure to work with the authors of [1]. In Oct. 2018, the fruitful gathering discussion, generate core idea and initial development of this theory, and we see light that might comming through the mistory of internal workings of ANN.
Code availability
The code to help reproduce the main conslutions of this article is here https://github.com/bewantbe/ANN_GFS mostly structures to help build orthogonal polynomial representations and simulting a shallow ANN. An early version of this article can be found here: https://github.com/bewantbe/dynamics_dnn, note the file named dynamics_1dnn.lyx.
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process
AI and AI-assisted technologies is not used in the construction of the Theory at all. In fact, the theory is constructed before the AI-era (2023), around 2018, . The AI was used to correct gamma and spellings of this script. Some AI coding was used to generate Figure xxxx. The author take full responsibility to all content of the article.
References
[1] Z.-Q. J. Xu, Y. Zhang, T. Luo, Y. Xiao, Z. Ma, Frequency Principle: Fourier Analysis Sheds Light on Deep Neural Networks, Communications in Computational Physics 28 (5) (2020) 1746–1767, arXiv:1901.06523. doi:10.4208/cicp.0A-2020-0085. URL http://arxiv.org/abs/1901.06523 1, 5.2
[2] R. Basri, M. Galun, A. Geifman, D. Jacobs, Y. Kasten, S. Kritchman, Frequency Bias in Neural Networks for Input of Non-Uniform Density, in: Proceedings of the 37th International Conference on Machine Learning, PMLR, 2020, pp. 685–694.
URL https://proceedings.mlr.press/v119/basri20a.html 1
[3] N. Rahaman, A. Baratin, D. Arpit, F. Draxler, M. Lin, F. Hamprecht, Y. Bengio, A. Courville, On the Spectral Bias of Neural Networks, in: Proceedings of the 36th International Conference on Machine Learning,
PMLR, 2019, pp. 5301–5310.
URL https://proceedings.mlr.press/v97/rahaman19a.html 1
[4] A. Jacot, F. Gabriel, C. Hongler, Neural Tangent Kernel: Convergence and Generalization in Neural Networks, arXiv:1806.07572 [cs, math, stat]ArXiv: 1806.07572 (Jun. 2018). URL http://arxiv.org/abs/1806.07572 1
[5] M. Murray, H. Jin, B. Bowman, G. Montufar, Characterizing the Spectrum of the NTK via a Power Series Expansion, arXiv:2211.07844 [cs.LG] (Feb. 2023). doi:10.48550/arXiv.2211.07844. URL http://arxiv.org/abs/2211.07844 1
[6] S. Zhang, H. Zhao, Y. Zhong, H. Zhou, Why shallow networks struggle to approximate and learn high frequencies, Information and Inference: A Journal of the IMA 14 (3) (2025) iaaf022. doi:10.1093/imaiai/iaaf022.
URL https://doi.org/10.1093/imaiai/iaaf022 1
[7] H. Wang, S. Xiang, On the convergence rates of Legendre approximation, Mathematics of Computation 81 (278) (2012) 861–877. 3.1
[8] G.-B. Huang, Q.-Y. Zhu, C.-K. Siew, Extreme learning machine: Theory and applications, Neurocomputing 70 (1) (2006) 489–501. doi:10.1016/j.neucom.2005.12.126.
URL http://www.sciencedirect.com/science/article/pii/S0925231206000385 5.2
[9] D. Gottlieb, S. A. Orszag, Numerical analysis of spectral methods: theory and applications, Vol. 26, Siam, 1977. Appendix A
[10] L. N. Trefethen, Approximation Theory and Approximation Practice, SIAM, 2013. Appendix A, 1, 2, 3, 4, 5, 6, 7
[11] G. Szegö, Orthogonal Polynomials, American Mathematical Society, Providence, RI, 1975. 8
Appendix A. Lemmas
See Ref. [9, 10]. Orthogonal polynomial is an active field in 1910s see Bernstein et al.
Appendix A.1. Chebyshev Approximations
Appendix A.1.1. Theorems for absolutely continuous functions.
Lemma 1 (Theorem 7.1 in [10]). Assume be absolutely continuous on and is of bounded variation . Then for , the Chebyshev coefficients of satisfy
Lemma 2 (Theorem 7.2 in [10]). The same condition as Lemma 1, then for , its Chebyshev projections satisfy
and its Chebyshev interpolants satisfy
Theorems for analytical functions.
Lemma 3 (Theorem 8.1 in [10]). Assume analytic in be analytically continuous to the open Bernstein ellipse (note), where it satisfies for some . Then its Chebyshev coefficients satisfy and
Lemma 4 (Theorem 8.2 in [10]). The same condition as Lemma 3, then for its Chebyshev projections satisfy
and its Chebyshev interpolants satisfy
Bernstein ellipse : foci 1 and -1 with semimajor and semiminor axis lengths summing to in complex plane.
Appendix A.2. General Theorems
General theorems about polynomial approximations.
Lemma 5 (Theorem 16.1 in [10]). Let have degree Chebyshev projection , Chebyshev interpolant , and best approximant , . Then
Appendix A.2.1. Two theorems about near-best approximation.
Lemma 6 (Theorem 12.1 in [10]). Given , let ( ) be the parameter of the largest Bernstein ellipse to which can be analytically continued, and let be the interpolants to in any sequence of grids in such that
then the errors satisfy
Lemma 7 (Theorem 15.1 in [10]). Let be the Lebesgue constant for a linear projection of onto . Let be a function in , the corresponding polynomial approximant to , and the best approximation. Then
where the Lebesgue constant is defined as
Lemma 6 and Lemma 7 imply that concludes near best convergent for .
Lemma 8. GFS approximation
For a general weight function , Szegő's Theorem 12.7.3 [11] gives the corresponding convergence result for expansions in orthonormal polynomials. Assume that satisfies the standard Szegő-class conditions; a standard sufficient condition is
Let denote the parameter of the largest Bernstein ellipse in whose interior g is analytic. Then the GFS coefficients satisfy
Consequently, the GFS converges to g inside , uniformly on every compact subset of the ellipse, and diverges outside it. Thus, for admissible weight functions, the asymptotic geometric decay of the GFS coefficients is governed by the same Bernstein ellipse as in the Chebyshev case. The weight function changes the polynomial basis and the prefactors, whereas the ellipse of convergence is determined by the analyticity of g.