Paper commentary
Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains
Fourier feature mappings let MLPs learn high-frequency detail in low dimensions
- Problem Plain coordinate MLPs learn low frequencies much faster than high frequencies, so fine detail comes out blurred. This spectral bias follows from the network's NTK, which decays quickly across frequencies.
- Method Fourier features map each input through sines and cosines at sampled frequencies before the MLP. This turns the NTK into a stationary kernel whose bandwidth the frequency scale controls.
- Results On 3D shape regression, intersection-over-union rose from 0.864 with no mapping to 0.973 with the Gaussian Fourier feature mapping.
Why plain coordinate MLPs miss fine detail
They are attractive because they can be optimized by gradient descent and are far more compact than grid-sampled representations. When the target contains fine detail, however, a plain coordinate MLP produces blurry output, as the image regression example illustrates.
The authors trace this to what they call spectral bias, the tendency of MLPs to learn high-frequency content far more slowly than low-frequency content. Their view is that a plain coordinate MLP corresponds to a kernel whose frequency content falls off quickly, which keeps high-frequency content out of reach of the network.
Reading training as kernel regression
Kernel regression estimates a function at a query point as a weighted sum of training labels, where the weights come from the inverse kernel Gram matrix applied to the labels and the kernel similarity between training and query points.
The neural tangent kernel is defined as the expected inner product of the gradients of the network output with respect to its parameters, taken over a Gaussian initialization. In the limit of infinite layer width and vanishing SGD learning rate, training converges to the kernel regression solution with this kernel, which is written \( k_{NTK}(x_i,x_j)=\mathbb{E}_{\theta\sim N}\langle \partial f(x_i;\theta)/\partial\theta,\ \partial f(x_j;\theta)/\partial\theta\rangle \).
This approximation holds under the asymptotic conditions stated by Lee et al. Writing \( K=Q\Lambda Q^{T} \), the error along the i-th eigenvector decays roughly as \( e^{-\eta\lambda_i t} \), so components tied to larger eigenvalues are learned first. For a conventional MLP the NTK eigenvalues decay quickly, so the high-frequency components of a target are learned very slowly.
How the mapping makes the kernel stationary
The setting studied here has dense coordinates in a low-dimensional subset of Euclidean space, so the composed kernel should not depend on absolute position but only on displacement between points. A plain NTK on normalized inputs behaves like a dot-product kernel, which does not give that shift-invariance in Euclidean space.
The mapping sends each input \( v\in[0,1)^d \) to a vector of sines and cosines of its projections onto frequency vectors \( b_j \), with amplitudes \( a_j \): \( \gamma(v)=[a_1\cos(2\pi b_1^{T}v),\,a_1\sin(2\pi b_1^{T}v),\dots,a_m\cos(2\pi b_m^{T}v),\,a_m\sin(2\pi b_m^{T}v)]^{T} \). Because the cosine of a difference expands into products of sines and cosines, the inner product of two mapped points depends only on their difference: \( k_\gamma(v_1,v_2)=h_\gamma(v_1-v_2) \), with \( h_\gamma(v_\Delta)=\sum_{j=1}^{m}a_j^{2}\cos(2\pi b_j^{T}v_\Delta) \).
The mapping therefore makes the composed kernel stationary, and the sampled frequencies \( b_j \) control which frequencies the kernel contains.
Seen this way, the composed NTK acts as a reconstruction filter, and its frequency decay determines the reconstructed signal. A kernel with a wider spectrum speeds up convergence on high-frequency components, but a spectrum that is too wide produces high-frequency aliasing, so the bandwidth has to be tuned between underfitting and overfitting.
Tuning the mapping on one-dimensional signals
The 1D experiments train on every c-th of c·n linearly spaced points on [0, 1) and test on the rest. Because the kernel is stationary and the points lie on a periodic domain, the kernel matrix is circulant, so its eigenvalues follow from the Fourier transform of a single row. The frequencies are set to \( b_j=j \) and the amplitudes to \( a_j=1/j^{p} \) for \( j=1,\dots,n/2 \), and \( p=\infty \) denotes the basic wrap-around mapping.
Lower values of p give a slower spectral falloff and a narrower kernel in space.
Targets are 1/fα noise: a Gaussian vector whose i-th entry is scaled by \( 1/i^{\alpha} \), with the real part of its inverse Fourier transform taken as the signal. Networks with 4 layers, 1024 channels and ReLU activations are fit to a bandlimited 1/f1 signal with c = 8 and n = 32. Training loss improves monotonically as the kernel becomes higher-frequency, while test loss is lowest at p = 1 and rises once the network begins to overfit.
The NTK linear dynamics model predicts these effects of changing the mapping parameters on the training and test curves.
Splitting the training error by frequency band shows that narrow spectra converge quickly on low frequencies and essentially never converge on high frequencies. Wider spectra converge on all bands, and p = 1 has enough power across the frequencies in the target while keeping high-frequency power limited. Mapping coefficients can also be chosen by minimizing the predicted validation loss with gradient descent, and in this small 1D setting the optimized mapping gave the best trained networks.
Choosing random frequencies by their scale
A dense Fourier basis grows with the number of training points, which grows exponentially with dimension, so random features sampled from a parametric distribution are used in practice. The sweep uses 1D signals with c = 2 and n = 1024 drawn from fixed 1/fα distributions, and sparse sets of length 16 are sampled from Gaussian, uniform, uniform-in-log and Laplacian families.
The sweep covers 1/f^0.5, 1/f^1.0 and 1/f^1.5 targets, with sparse sets of 16 out of 1024 features.
Every family traces out the same curve, with underfitting when the spread is too small and overfitting when it is too large. The authors conclude that the shape of the sampling distribution has no significant effect on performance, so they use a Gaussian distribution in the higher-dimensional experiments and treat its scale as a hyperparameter tuned on validation data.
The sparse-versus-dense comparison is done in one dimension, and the sampling conclusion is applied to higher-dimensional tasks only through the Gaussian choice used in Section 6.
Results across coordinate-based tasks
Four input mappings are compared: no mapping, the basic mapping \( \gamma(v)=[\cos(2\pi v),\sin(2\pi v)]^{T} \), a positional encoding and a Gaussian Fourier feature mapping. The positional encoding is deterministic, uses log-linearly spaced axis-aligned frequencies and is a generalization of the encoding used in prior work. The Gaussian mapping draws the entries of B from \( N(0,\sigma^{2}) \), with σ chosen per task and dataset by a hyperparameter sweep.
Direct tasks supervise the output coordinates with ground-truth labels, and indirect tasks pass the output through a forward model before the loss. The direct tasks are 2D image regression and 3D shape regression, and the indirect tasks are 2D computed tomography, 3D magnetic resonance imaging and 3D inverse rendering for view synthesis. All runs use 256 frequencies, with L2 loss and a 4-layer ReLU MLP with 256 channels, except 3D shape regression, which uses cross-entropy and 8 layers.
On 3D shape regression, intersection-over-union rose from 0.864 without a mapping to 0.973 with the Gaussian mapping. Each of the three Fourier mappings scores above the no-mapping baseline in every column, and the Gaussian mapping scores highest in every column. These are single comparisons in one shared setup per task, so they show the ranking of mappings within each task rather than their behavior on other data or models.
Limitations
The kernel predictions rely on infinite width and an infinitesimal learning rate, so for finite networks they are approximations. The approximation is stated under the asymptotic conditions of Lee et al.
Gradient-based selection of mapping coefficients was checked only in a small one-dimensional setting with a small training set, a small learning rate and very wide networks. The positional encoding is deterministic and contains only axis-aligned frequencies, which the authors note may favor data with more frequency content along the axes.
The main comparison fixes 256 frequencies, and the effects of network depth and feature mapping sparsity are examined in an appendix that this excerpt does not contain.
Paper info
- Authors
- Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, Ren Ng
- Venue
- arXiv · Preprint
- First published
- 2020-6-18
- Added
- 2026-11-12
- Updated
- 2020-6-18
- Version
- v1
- arXiv
- 2006.10739
- Category
- cs.CV · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, Ren Ng (2020). Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains. arXiv:2006.10739v1. https://arxiv.org/abs/2006.10739v1
BibTeX
@misc{tancik2020fourier,
title = {{Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains}},
author = {Matthew Tancik and Pratul P. Srinivasan and Ben Mildenhall and Sara Fridovich-Keil and Nithin Raghavan and Utkarsh Singhal and Ravi Ramamoorthi and Jonathan T. Barron and Ren Ng},
year = {2020},
eprint = {2006.10739},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2006.10739v1}
}