Mayank Deshpande / All posts

Understanding How Neural Networks Learn: A Peek into Physics and Frequencies

By Mayank Deshpande ·

Wave interference pattern illustrating spectral bias in neural networks

What's This All About? (Abstract)

Artificial Neural Networks (ANNs) have a fascinating learning trait called 'spectral bias'. This means they tend to grasp simple, low-frequency patterns (like the main melody of a song) much faster than complex, high-frequency details (like intricate musical runs) during training. This is commonly observed when using standard learning methods like Mean Square Error (MSE) loss.

Enter Physics Informed Neural Networks (PINNs). These are specialized AIs designed to understand and solve problems governed by physical laws, often expressed as differential equations (DEs). Think of them learning fluid dynamics or how electromagnetic fields behave. Instead of just matching data, PINNs are guided by how well they satisfy these fundamental physical equations.

The core questions this research tackles are: Do PINNs also exhibit this 'spectral bias'? And if so, how does this bias change depending on the complexity of the physical equations, specifically the order of the DEs involved?

Through a series of careful numerical experiments using various sinusoidal functions and equations of different complexities, the study firmly establishes that PINNs do indeed show a strong spectral bias. What's more, this bias appears to become even more pronounced as the order (a measure of complexity) of the differential equations increases.

Introduction: When AI Meets the Laws of Physics

Many phenomena in our universe, from the grand scale of weather systems to the microscopic behavior of particles, are described by sets of mathematical rules known as Partial Differential Equations (PDEs). These equations are fundamental to understanding how various systems evolve and interact.

Solving these PDEs for complex, real-world scenarios has traditionally relied on intensive numerical simulations. However, a new approach leveraging the power of Artificial Intelligence, specifically PINNs, has gained significant traction. PINNs have shown particular promise for applications requiring rapid solutions, especially when designs or conditions undergo minor changes.

Given that PINNs are a type of neural network, it's logical to investigate whether they inherit common characteristics of ANNs, such as spectral bias. This bias, where networks preferentially learn simpler (low-frequency) patterns first, is a known aspect of standard ANNs, often explained by Neural Tangent Kernel (NTK) theory. But PINNs are unique: their learning process is driven by minimizing the residuals of the physical equations themselves, rather than solely relying on supervised data matching. This difference makes the presence and nature of spectral bias in PINNs an intriguing area of research.

Decoding Key Concepts

What are Physics Informed Neural Networks (PINNs)?

Imagine teaching a student physics. Instead of just having them memorize answers to problems (like a traditional AI might learn by matching data points), a PINN attempts to understand the underlying physical principles – the differential equations that govern the system.

A PINN is a neural network that typically takes inputs like spatial coordinates (x, y, z) and time (t). Its job is to predict the values of physical quantities at those input points, such as velocity, pressure, or temperature. The "physics-informed" part comes from how it learns:

  • It uses a technique called 'automatic differentiation' to calculate derivatives from the network's output. These derivatives are then plugged into the governing physical equations.
  • The network's error (or 'loss') is calculated based on how well its predictions satisfy these equations (the "residuals" of the equations).
  • It also incorporates boundary conditions (e.g., the temperature at a specific edge) and initial conditions into its loss function.

By trying to minimize this physics-based loss, the network learns a solution that is consistent with the known physical laws.

Conceptual Diagram of PINN Training Process
A simplified view of how a PINN learns by minimizing equation residuals and satisfying boundary/initial conditions. (Assumes image similar to Fig. 1 in the paper)
What is Spectral Bias?

Spectral bias describes a common characteristic of neural networks: they tend to learn simple, smooth, low-frequency functions or components of a function much faster and more effectively than complex, rapidly changing, high-frequency components.

Think of it like painting a picture. An artist might first block out the large shapes and general colors (low-frequency information) before adding fine details and textures (high-frequency information). Neural networks often exhibit a similar learning progression.

This isn't just an arbitrary behavior. For standard ANNs trained with Mean Square Error (MSE) loss and using gradient descent with small learning rates, Neural Tangent Kernel (NTK) theory provides a mathematical framework to understand this. It suggests that the network learns components corresponding to larger eigenvalues of the NTK (often associated with lower frequencies) more rapidly.

Conceptual Graph of Spectral Bias
Illustrative: Networks tend to fit low-frequency components (smooth curves) before high-frequency details (wiggles). image credit: Springer [21]

Watch It Happen: Spectral Bias, Live

You just read that networks learn low frequencies first. Instead of taking NTK theory's word for it, train a network right here. The dashed curve is the target — a smooth wave plus fast wiggles. Watch which one the network fits first.

Live demo · Spectral bias, livea real MLP training in-browser

The Investigation: How PINNs Were Tested

Experimental Setup

To explore spectral bias in PINNs, the researchers designed a series of numerical experiments. They focused on simple sinusoidal functions (functions that create wave-like patterns) and their corresponding differential equations of varying orders. For example, they looked at a base function $f(x)$, its first derivative $df/dx$ (rate of change), its second derivative $d^2f/dx^2$ (rate of change of the rate of change), and so on.

PINNs were then trained to find solutions to these differential equations. The researchers meticulously observed several aspects during this training process:

  • Convergence Speed: How quickly did the PINN arrive at an accurate solution for the entire function?
  • Learning of Frequencies: Did the PINN learn the smooth, low-frequency parts of the sinusoidal waves faster than the more detailed, high-frequency parts? This is the direct test for spectral bias.
  • Impact of Equation Order: Did the complexity of the differential equation (i.e., its order) influence the spectral bias or overall learning?
  • Activation Functions: They also experimented with different activation functions (key components within neurons) like 'tanh' and 'swish' to see if they affected the outcomes.

To analyze the learning of different frequency components, the researchers often used Fourier transforms on the PINN's developing solutions. This mathematical tool helps decompose a signal (like the PINN's output) into its constituent frequencies, allowing for a clear comparison of how well each frequency is being learned over time.

Example of Fourier Transform Signal Analysis
Conceptual representation of how Fourier analysis shows different frequency components. (Assumes image similar to Figs 8-11 in the paper)

Key Findings & What They Mean

The Main Discoveries

The comprehensive experiments yielded several important conclusions about the learning behavior of PINNs:

  • PINNs Do Exhibit Spectral Bias: Confirming expectations, PINNs, much like standard ANNs, learn low-frequency (simpler) components of a solution more readily and rapidly than high-frequency (more complex) ones.
  • Higher-Order Equations Pose a Greater Challenge: As the complexity of the differential equation increases (i.e., higher derivative orders), PINNs generally require more computational effort and training time to achieve a converged, accurate solution.
  • Spectral Bias Amplifies with Equation Order: This is a critical insight from the study. The disparity in learning speeds between low and high frequencies—the very essence of spectral bias—becomes more pronounced as the order of the differential equation rises. This implies that for highly complex physical systems described by high-order DEs, PINNs might particularly struggle to capture the fine-grained, high-frequency details of the solution.

Visualizing the Findings (Conceptual Summary based on Table 4):

This table illustrates how the number of training iterations (in thousands, 'K') needed for convergence is affected by signal frequency and the order of the differential equation, assuming normalized conditions. Lower 'K' means faster learning.

Signal FrequencyBase Function $f(x)$2nd Derivative $f_{xx}(x)$3rd Derivative $f_{xxx}(x)$
Low (e.g., k=2)Fast (2K)Fast (2K)Slower (11K)
Medium (e.g., k=6)Slower (13K)Slower (18K)Much Slower (81K)
High (e.g., k=10)Slowest (18K)Very Slow (50K)No Convergence

(Note: "K" denotes thousands of training iterations. "No convergence" indicates that for very high frequencies and the most complex derivative orders, the PINN failed to learn the solution accurately within the experimental limits.)

These findings are valuable for advancing our understanding of PINN behavior, guiding the development of more robust and efficient neural network architectures for tackling complex problems in science and engineering.