NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

In-Context Operator Learning for Differential Equation Problems

Liu Yang, Siting Liu, Tingwei Meng, Stanley J. Osher · DOI

Abstract

Researchers at UCLA have introduced In-Context Operator Networks (ICON), a transformer-based framework that learns to solve differential equations by observing a few examples—mimicking the few-shot learning capabilities of Large Language Models (LLMs). Unlike traditional neural solvers that require retraining for every new equation, ICON can solve entirely new forward and inverse problems during inference without any weight updates. By training on a diverse set of mathematical operators, ICON learns universal mathematical features, enabling it to generalize to unseen equation forms.

Introduction

Solving differential equations with neural networks typically follows two paradigms: Physics-Informed Neural Networks (PINNs), which approximate a specific solution for a specific equation, and Neural Operators (e.g., DeepONet or FNO), which learn mappings for a family of equations. However, both approaches are generally limited to "one network per operator." If the underlying physics changes—such as moving from a Poisson equation to a Reaction-Diffusion equation—these models typically fail.

ICON addresses this gap by aiming to create a "foundation model" for physical operators. Just as humans can observe a physical system and quickly infer underlying rules, ICON leverages commonalities across different mathematical structures to solve new problems on the fly through in-context learning.

Methods

The In-Context Learning Paradigm

The core of the ICON framework is the "learning to learn" paradigm. During inference, the model's weights remain frozen. It identifies the underlying operator purely through the context provided in a "prompt."

The In-Context Operator Network (ICON) framework for training and inference across various unknown operators.

As shown in Figure 1, the prompt consists of several demos—pairs of input "conditions" and output "quantities of interest" (QoI)—followed by a question condition. For example, a demo might show a specific forcing function and the resulting displacement in a physical system; the question then provides a new forcing function and asks for the corresponding displacement.

Architecture and Representation

ICON utilizes an Encoder-Decoder Transformer architecture. The self-attention encoder processes the prompt, while a cross-attention decoder generates predictions based on query points.

Detailed architecture of ICON, featuring a Transformer Encoder-Decoder structure with key-value-index embeddings.

To handle varying dimensions (1D, 2D, time, space) and different types of functions, ICON employs a Unified Representation. Data is represented as flexible key-value pairs. An "index vector" is included to help the model distinguish between different terms in the equation (e.g., distinguishing a source term from a boundary condition). Because the decoder uses cross-attention without self-attention among queries, it can evaluate solutions at any number of points, enabling super-resolution during inference.

Datasets and Training

The authors trained ICON on a massive synthetic dataset covering 19 distinct problem types, including:

  • ODEs: Forward and inverse problems for various ordinary differential equations, such as damped oscillators.
  • PDEs: Poisson equations and both linear and nonlinear reaction-diffusion equations.
  • Mean-Field Control (MFC): Complex problems involving the control of large populations in 1D and 2D.

The training set comprised approximately 1.9 million data points, generated from 1,000 sets of parameters (operators) for each of the 19 problem types.

Key Results and Insights

  • Few-Shot Accuracy: ICON demonstrated remarkable efficiency, achieving an average relative error below 6% with just one demo. This error dropped to approximately 2% with five demos, suggesting that only a few examples are sufficient for the model to identify the underlying operator.
  • Generalization and OOD Performance: The model successfully solved problems where coefficients were significantly outside the training range. More importantly, it showed "emergent" abilities to solve equation forms it had never seen before by combining mathematical building blocks learned during training.
  • Super-Resolution: ICON can be trained on low-resolution data (e.g., 40-50 points) but accurately predicts solutions on much finer grids (up to 500 points) during testing.
  • Inverse Problem Versatility: The model is equally capable of solving inverse problems—such as predicting a source term given a solution—using the exact same architecture and prompt structure.

Conclusion and Future Work

ICON represents a significant step toward general-purpose foundation models for the physical sciences. While currently demonstrated on relatively simple operator families, the framework's ability to perform zero-shot inference on new equations is a promising shift away from specialized, single-purpose models. Future research will focus on scaling ICON to handle more complex, chaotic, or turbulent systems and exploring the theoretical limits of operator identification from minimal context.

Summary updated

BibTeX
@inproceedings{yang2023context,
  author = {Liu Yang and Siting Liu and Tingwei Meng and Stanley J. Osher},
  title = {{In-Context Operator Learning for Differential Equation Problems}},
  booktitle = {Proceedings of the National Academy of Sciences},
  year = {2023},
  doi = {10.1073/pnas.2310142120},
}
Figure