Neural Integral Equations

Emanuele Zappala, Antonio Henrique de Oliveira Fonseca, Josue Ortega Caro, David van Dijk · DOI

Abstract

This paper introduces Neural Integral Equations (NIE) and Attentional Neural Integral Equations (ANIE), a novel class of models designed to learn nonlocal spatiotemporal dynamics directly from data. By shifting from the "local" perspective of differential equations to the "global" perspective of integral equations, the authors achieve superior performance in modeling complex systems like fluid dynamics and brain activity. These models offer better scalability, numerical stability, and interpretability than traditional Neural ODEs by leveraging iterative solvers and the mathematical link between self-attention and integral operators.

Introduction: The Local vs. Global Perspective

Most current machine learning models for continuous dynamics rely on Ordinary Differential Equations (ODEs) or Partial Differential Equations (PDEs). While powerful, these frameworks are fundamentally "local": they describe how a system changes based only on its current state and immediate neighbors.

However, many real-world systems—from the firing patterns of the human brain to long-range weather dependencies—exhibit nonlocal behavior, where the state at one point in space or time depends on distant interactions. Modeling these with ODEs/PDEs often requires complex auxiliary tools (like RNNs) or results in numerical instabilities known as stiffness. The authors tackle the challenge of learning these nonlocal operators directly from data in a way that is both mathematically grounded and computationally efficient by utilizing second-kind integral equations.

Methodology

The authors propose two primary architectures based on integral equations, where the unknown function appears both inside and outside an integral:

1. Neural Integral Equations (NIE)

This model uses a neural network to represent the integral kernel. To solve the equation, it employs an iterative procedure known as Picard iterations (or successive approximations). Unlike ODE solvers that step through time sequentially, the NIE solver processes the entire time interval in parallel, updating its "guess" for the whole trajectory until it converges. This global approach avoids the error accumulation often seen in step-based integration.

2. Attentional Neural Integral Equations (ANIE)

To solve the "curse of dimensionality" associated with high-dimensional integrals, the authors replace the explicit integral with a self-attention mechanism. They provide a theoretical bridge showing that self-attention can be viewed as a Nyström approximation of an integral operator. This allows the model to scale to complex spatial datasets like fluid flows while maintaining the mathematical properties of an integral solver.

The NIE/ANIE framework: from initialization through the iterative IE solver to loss optimization and downstream tasks like explainability and latent embedding.

Both models are implemented as fully differentiable solvers in PyTorch, allowing for end-to-end training via backpropagation. The framework naturally supports (spatio)temporal integration, where the model can learn to focus on relevant historical or spatial context via learned kernels.

Key Insights

  • Stability over Step-taking: Integral equation solvers are inherently more stable than ODE solvers, especially for "stiff" equations. The authors found that their solver typically converges in just 4 to 8 iterations, regardless of the time interval's length.
  • Attention is Integration: A core contribution is the formalization of Transformers as integral solvers. By treating the attention matrix as a learned kernel, ANIE provides a rigorous mathematical framework for why Transformers are so effective at capturing long-range dependencies in physical data.
  • Parallelism: Because the solver updates the entire trajectory at once rather than stepping through it, it can leverage GPU parallelism much more effectively than sequential ODE solvers.

Experimental Results

The models were evaluated across a diverse range of benchmarks, including synthetic dynamical systems (Lotka-Volterra, Lorenz), physical PDEs (Burgers’, Navier-Stokes), and biological dynamics (fMRI and calcium imaging).

Performance on Physical Systems

On the Navier-Stokes benchmark, ANIE achieved a Mean Squared Error (MSE) of 0.0117 for long-term predictions ($t=20$), significantly outperforming Fourier Neural Operators (FNO) and Vision Transformers (ViT), which struggled to maintain accuracy over long intervals. Similarly, in Burgers' equation tasks, ANIE maintained consistently low error rates across different spatial resolutions.

Performance comparison across Navier-Stokes and Burgers' equations. ANIE (ours) consistently achieves the lowest error rates compared to state-of-the-art baselines.

Speed and Interpretability

In training speed benchmarks, ANIE was orders of magnitude faster than Latent Neural ODEs. For example, on the Lotka-Volterra system, ANIE took 0.0081s per iteration compared to 2.88s for the Neural ODE.

Beyond performance, the models offer unique interpretability. In calcium imaging experiments, the model’s attention weights highlighted the motor and visual cortices as the primary drivers of the dynamics, providing a "map" of neural influence that matched biological expectations. Furthermore, by adding a "CLS token," the authors could project complex fluid dynamics into a latent space that naturally organized itself by physical properties like velocity.

Conclusion

Neural Integral Equations provide a robust alternative to differential-based modeling for complex, nonlocal systems. By reframing dynamics as global integration problems and linking them to modern attention mechanisms, the authors provide a framework that is faster, more stable, and more interpretable than existing methods. Future work will explore more efficient attention variants to scale these models to even larger 3D simulations.

Summary updated

BibTeX
@article{zappala2024neural,
  author = {Emanuele Zappala and Antonio Henrique de Oliveira Fonseca and Josue Ortega Caro and David van Dijk},
  title = {{Neural Integral Equations}},
  journal = {Nat. Mac. Intell.},
  year = {2024},
  doi = {10.1038/s42256-024-00886-8},
}
Figure