Recommended resources
The freely available resources this lesson will direct you to.
- NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis (ML Research Paper Explained)www.youtube.com
- Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domainswww.youtube.com
- Fourier Feature Positional Encoding - Emergent Mindwww.emergentmind.com
- Fourier Feature Encoding - Synerise AI/BigData Researchsair.synerise.com
In our last lesson, we uncovered a fundamental limitation of standard MLPs: spectral bias. This inherent preference for learning low-frequency functions makes them ill-suited for representing the sharp, detailed signals required for photorealistic rendering, resulting in blurry and unsatisfying images.
This lesson is about the solution. We will explore positional encoding, a simple yet powerful technique that uses Fourier features to overcome spectral bias. You will learn the mathematical formulation of this method and, more importantly, the theoretical reason why it enables a simple MLP to learn the high-frequency details that were previously out of reach. This concept is the key architectural innovation that makes NeRF possible.
The Solution: Mapping Coordinates to a Higher Dimension
The core idea behind positional encoding is to transform the input coordinates before they ever reach the neural network. Instead of feeding a low-dimensional coordinate vector like directly into the MLP, we first pass it through a mapping function, , to create a higher-dimensional feature vector, .
The problem, as you may recall, is that for two very close input points, a standard MLP will produce two very similar output points, making it hard to create sharp changes in color or density. The goal of the mapping is to "spread out" these nearby points in a new feature space, making it easier for the network to assign them different values.
The following video segment provides a great high-level motivation for this input transformation.
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis (ML Research Paper Explained)
In this clip from his explanation of the NeRF paper, Yannic Kilcher discusses why the raw, low-dimensional coordinate input is insufficient for representing fine-grained structures.
Watch the segment from the need for encoding. The key insight is that a continuous function like an MLP struggles to handle both coarse and fine differences when given only a single floating-point number per dimension. This necessitates mapping the input to a higher-dimensional representation.
This raises the crucial question: what should this mapping function look like?
The "How": A Bank of Sinusoidal Features
The innovation proposed in the context of NeRF and related works is to use a specific type of mapping based on Fourier analysis. This mapping, called Fourier feature positional encoding, transforms a coordinate vector by applying a bank of sine and cosine functions at different frequencies.
The general mathematical form of this mapping is as follows:
Here, is the input coordinate (e.g., an position), and the vectors are frequency vectors. In the original NeRF paper, these are not learned but are a fixed set of frequencies that increase exponentially (e.g., ).
Let's dissect this mapping with a brief reading.
Fourier Feature Positional Encoding - Emergent Mind
This section from Emergent Mind provides a concise mathematical definition of Fourier feature positional encoding and its common variants.
Please read section 1, titled "Mathematical Foundations". Pay close attention to the main formula and the description of how the frequency vectors \{\mathbf{b}_j\} are chosen.
Now, let's build some intuition for why this works.
Socratic Question: Imagine two 1D input points, and .
- What is the difference in their output values if they are passed through a low-frequency function, ?
- What is the difference if they are passed through a high-frequency function, ?
How does providing the network with both of these outputs simultaneously help it distinguish between and ?
...
For the low-frequency function, the outputs will be very close: and . For the high-frequency function, the outputs will be dramatically different: and .
By providing the network with a whole vector of features from sinusoids at different frequencies, we give it the ability to react to input changes at multiple scales. It can use the low-frequency features to learn coarse structures and the high-frequency features to learn fine details.
The following video segment explains this intuition beautifully.
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis (ML Research Paper Explained)
Returning to Yannic Kilcher's explanation, this part details how the hierarchy of sine and cosine waves enables the network to capture both coarse and fine details.
Watch from the hierarchy of sine waves. Focus on the idea that this mapping gives the network the "choice" of which frequency scale to pay attention to for any given input.
This approach of creating a richer, higher-dimensional representation from a simple numerical feature is a powerful technique.
Fourier Feature Encoding - Synerise AI/BigData Research
This article from Synerise AI Research provides another clear, text-based explanation of how combining different frequencies helps a model represent varying levels of sensitivity to input changes.
Read the section "Fourier encoding of numerical features". This reinforces the intuition that we are mapping a low-dimensional input into a higher-dimensional space with more complex geometry, which helps with optimization.
The practical impact of this simple trick is staggering. It is the difference between a blurry, useless rendering and a photorealistic one.

The Theory: How Fourier Features Conquer Spectral Bias
We now have the intuition: positional encoding injects high-frequency information into the network's input. But to truly understand why this overcomes spectral bias, we must return to the Neural Tangent Kernel (NTK) theory from our previous lesson.
Recall that the problem with a standard MLP is that the eigenvalues of its implicit kernel decay rapidly for high-frequency functions, leading to extremely slow convergence for those components.
The crucial insight is that applying a fixed mapping to the input coordinates transforms the network's effective NTK. The new kernel becomes a function of the mapped inputs. When is the Fourier feature mapping, this new kernel has a much "flatter" spectrum. By explicitly including high-frequency sinusoids in the input, we are effectively boosting the eigenvalues associated with high-frequency functions. This makes the convergence rates for low and high frequencies more comparable, allowing the network to learn fine details efficiently.
Let's start with a high-level overview of this phenomenon.
Fourier Feature Encoding - Synerise AI/BigData Research
This section directly defines spectral bias and explains how enriching the input data with high-frequency components helps overcome it.
Please read the section titled "Spectral bias of multilayer perceptron".
Now, for a more formal dive into the NTK interpretation. The following reading explains precisely how the Fourier feature mapping reshapes the kernel.
Fourier Feature Positional Encoding - Emergent Mind
This resource connects the dots between Fourier features, spectral bias, and the NTK.
Read Section 2, "Spectral Bias and NTK Interpretation," and the "Spectral Bias Mitigation" bullet point in Section 7 (here). The key takeaway is that the mapping changes the NTK to a stationary kernel whose frequency spectrum can be directly controlled, enabling fast convergence of high-frequency modes.
Finally, let's hear this from one of the original authors of the Fourier Features paper.
Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains
In this clip, Matthew Tancik explains the theoretical basis for why Fourier features work, referencing the NTK theory.
Please watch from the NTK explanation. He contrasts the "over smooth" function from a standard MLP's kernel with the more detailed function enabled by the Fourier feature-mapped kernel.
This is the central mechanism. By pre-processing the input, we change the learning problem into one that is much more suitable for gradient-based optimization of an MLP. The image below, from the Fourier Features paper, shows this in action. The plots in row (c) show that as the frequency of the mapping increases (from "Low" to "High"), the network's training loss on high-frequency components of the signal decreases much faster.

Conclusion
In this lesson, we have dissected the simple yet profound solution to the spectral bias problem that plagued early attempts at implicit neural representations. By mapping low-dimensional input coordinates into a higher-dimensional feature space using a bank of sinusoids, we fundamentally change the network's learning dynamics.
Key Takeaways:
- Positional Encoding as Feature Engineering: Positional encoding is a pre-processing step that creates a rich set of features by applying sine and cosine functions of varying frequencies to the input coordinates.
- Multi-Scale Input: This provides the network with features that are sensitive to changes in the input at many different scales, allowing it to learn both coarse, low-frequency structures and fine, high-frequency details.
- Overcoming Spectral Bias via NTK: From a theoretical standpoint, this input mapping transforms the MLP's effective Neural Tangent Kernel. It "flattens" the kernel's spectrum, increasing the eigenvalues associated with high-frequency functions and thus dramatically speeding up their convergence during training.
- The Key to NeRF: This technique is the critical architectural innovation that allows the NeRF MLP to represent the complex, high-frequency color and density fields necessary for photorealistic view synthesis.
Preview of the Next Lesson:
We now understand the two core components of the NeRF representation: an MLP that acts as a universal function approximator, and positional encoding that enables it to learn high-frequency detail. But a representation is useless if you can't generate an image from it. In the next lesson, we will shift our focus from representation to rendering. We will derive the classical volumetric rendering equation, the mathematical formula used to synthesize the color of a single pixel by accumulating color and density samples along a camera ray.