Background: Neural Operator Learning and Its Limitations

Traditional neural operator learning methods aim to learn the solution operator of a given family of differential equations, mapping input functions (e.g. coefficients or initial conditions) to output solution functions. Pioneering works like PDE-Net, DeepONet, and the Fourier Neural Operator (FNO) demonstrated that neural networks can approximate such solution operators ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). For example, DeepONet introduced a branch–trunk network architecture to map input functions (parameters or initial conditions) to solutions, and FNO learned an integral kernel in Fourier space to model the operator ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). These approaches, however, train a separate network per operator. Even a slight change in the governing equation (e.g. a new source term or a different equation form) defines a new operator, requiring the network to be retrained from scratch ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This “one network, one operator” limitation means standard operator-learning models cannot seamlessly adapt to new equations or conditions without expensive retraining or fine-tuning ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The field thus faced a need for a more flexible, meta-learning approach that leverages commonalities across operators to enable rapid adaptation to new tasks.

Emergence of In-Context Operator Learning (ICON)

In-Context Operator Learning was proposed to overcome these limitations by training a single neural network to solve many operator-learning tasks and to generalize to new operators without any weight update ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). Introduced by Yang et al. (2023) as In-Context Operator Networks (ICON), this paradigm treats each differential equation’s solution operator as a task and adopts the meta-learning idea of “learning to learn” ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) . The key insight is that disparate operators often share latent structure or “commonalities,” so a unified model can internalize a rich prior over operators ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). During inference, such a model should be able to learn a new operator from data on the fly and apply it to new inputs, simply by being prompted with a few input-output examples (analogous to few-shot learning) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This is directly inspired by in-context learning in NLP, where large language models (e.g. GPT-3) exhibit the ability to perform new tasks given only a few demonstrations in the prompt, without gradient updates ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). ICON extends this idea to scientific computing: by observing a small dataset of a new physical system’s behavior, the network “infers” the operator and answers new queries about that system ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). Notably, all of this happens with fixed network weights at inference – a sharp departure from previous fine-tuning approaches ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems).

Yang et al. (2023) formalized this setup in their seminal paper “In-Context Operator Learning with Data Prompts for Differential Equation Problems”. They define a prompt consisting of a handful of demonstration pairs (demos) of input functions and their output solutions (conditions → QoI), along with a query input (a new condition) for which the solution is desired ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The neural network (ICON) takes in the entire prompt – the demos and the query – and must output the correct solution for the query, effectively accomplishing two tasks simultaneously: (1) deducing the operator from the demo data, and (2) applying it to the query ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). Crucially, no further training occurs at this stage ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This approach leverages the network’s prior training on many operators to require only a few examples (few-shot) for a new operator, rather than a full dataset. By eliminating per-task retraining, ICON aims to “get rid of retraining (even fine-tuning)” and use the shared knowledge to need far less data for new problems ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). In essence, ICON is a transformer-based meta-learner that treats operator learning as an inference-time learning problem – a significant shift in how one approaches solving families of differential equations.

ICON Architecture and Theoretical Underpinnings

The ICON model introduced by Yang et al. uses a tailored encoder–decoder Transformer architecture to realize in-context operator learning ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The prompt (demo data and query) is formatted as a matrix of “key–value” pairs, where each column represents a sampled input location (key) and the corresponding function value (value). To distinguish multiple functions in the prompt (e.g. different input conditions vs. outputs), the authors concatenate an index vector to each pair as a label ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This allows the Transformer to treat the prompt as an unordered set of pairs, since attention is permutation-invariant to column order ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The encoder (a self-attention stack) processes all demo pairs and the query input together, producing a joint representation that encodes the inferred operator dynamics ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The decoder (cross-attention) then takes this operator embedding and the query’s coordinates to produce the query’s output values ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). Notably, the decoder is designed without self-attention among query points, ensuring each query output is computed independently given the operator embedding ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This means ICON can evaluate the learned operator at an arbitrary number of new points without interference, much like evaluating a true analytic operator ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems).

On the theoretical side, the ICON framework connects closely to meta-learning algorithms and even classical regression. The authors draw an analogy to few-shot learning in language models, suggesting that ICON’s training procedure encourages the network to internally perform a form of regression or interpolation on the prompt data. This was later made explicit by Liu et al. (2023), who investigated why Transformers can solve ODEs in-context. In their analysis, they considered a simple family of 1D linear ODEs and showed that in-context operator learning in this case reduces to an in-context linear regression problem (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). They leveraged recent results on Transformers’ ability to simulate least-squares solutions with appropriate prompts (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). In fact, by casting the ODE solution operator as the solution of a linear system, one can see the Transformer learning to compute the least-squares fit to the demo data – essentially performing linear regression internally (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). This insight provides a mathematical footing for ICON: it suggests that, at least for linear problems, a sufficiently trained Transformer can implement the optimal solver (fitting the operator parameters from data). The connection to in-context linear regression offers a rigorous explanation for the few-shot prowess of ICON on linear differential equations (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). It also aligns with broader theory in in-context learning, which has shown that Transformers can learn to emulate gradient descent or closed-form solvers when appropriately trained. These findings begin to demystify the meta-learning capability of ICON, showing that it is not just interpolating in a black-box fashion, but in some cases is performing the equivalent of well-known numerical schemes (like least-squares fitting) under the hood (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?).

Experimental Results and Evolution of the Field

Initial Demonstrations (Yang et al., 2023). The original ICON paper provided an extensive experimental validation across 19 different problem types, ranging from ODEs to PDEs and even an optimal control problem. These included forward and inverse problems for several ODEs (e.g. logistic-type ODEs, harmonic oscillator), elliptic and parabolic PDEs (Poisson equation, linear and nonlinear reaction–diffusion equations), and mean-field control (MFC) problems ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). During training, each problem type contributed many instances (operators) by varying equation parameters, and the model was trained in a meta-learning fashion across all these tasks ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). At inference, ICON was tested on new instances from these classes using only 1–5 demonstration pairs as context ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The results showed remarkably low error (often <1% relative error) with just a few demos, demonstrating successful few-shot learning of new operators ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). Figure 3 of the paper qualitatively illustrated examples where ICON’s predicted solution (given a prompt of a few noisy samples) closely matched the true solution curve of a new differential equation ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). Perhaps more impressively, ICON displayed strong robustness to out-of-distribution operators – the same model trained on certain parameter ranges could extrapolate to entirely new parameter regimes of the equations without retraining. For instance, for a forward ODE problem, the authors trained on a parameter range (say, a forcing amplitude α in [0,1]) and then tested on α well outside that range; ICON maintained high accuracy even as α strayed far beyond the training region ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). They systematically evaluated this by sweeping a broad range of new operator parameters and found errors remained low, indicating a powerful ability to generalize beyond the training distribution of operators ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This is evidence that the model wasn’t merely interpolating between training tasks, but learning underlying solution patterns that extrapolate.

Furthermore, the ICON paper probed an even more challenging form of generalization: adapting to equations of entirely new forms. In their final experiment, the authors combined dynamics from two training ODEs to define a novel ODE (containing a term not seen in any single training equation) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This tests whether the model can “mix and match” learned skills to solve a new kind of equation – a hallmark of general intelligence. With the base training (on individual ODE types), ICON initially struggled on this unseen ODE, showing it could not fully generalize “zero-shot” to a new equation form ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). However, when the training corpus was expanded to include a greater diversity of equation types, performance on the novel ODE improved dramatically ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). The error on the new task kept decreasing as more varied tasks were added in training, suggesting an emergent ability to handle unseen equations given a sufficiently broad meta-training ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems). This finding, albeit preliminary, hints that scaling up the diversity of training operators can turn ICON into a foundation model for PDEs, capable of tackling new physics beyond its direct experience (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). The authors themselves note this as a long-term vision: training one large model for a wide range of scientific problems and achieving cross-task generalization without fine-tuning (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). In summary, the initial ICON experiments established that in-context operator learning is feasible and effective across diverse equations, and they provided early evidence that with sufficient training breadth, a single model can approach multi-task generalization in the scientific domain.

Theoretical and Generalization Studies (Liu et al., 2023). Following the introduction of ICON, researchers began to analyze its generalization limits more rigorously. Liu et al. (2023) outlined a hierarchy of generalization for differential equation learners, ranging from generalizing within a single solution, up to generalizing across entirely different equation classes () (). Standard neural PDE solvers address only the lowest level (e.g. predicting an unseen part of the domain for the same equation), whereas ICON aspires to the highest level (applying knowledge of one equation class to solve another) (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?) (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). In their study “Does In-Context Operator Learning Generalize to Domain-Shifted Settings?”, they focused on a family of 1D linear ODEs and systematically introduced various distribution shifts to test ICON’s robustness. The results were encouraging: a transformer-based ICON model (trained on a distribution of ODEs generated via pseudospectral numerical methods) could handle noisy demonstrations, new boundary conditions, and inputs outside the training distribution with only mild degradation in accuracy (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?) (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). In one test, the model was trained on ODEs with one functional form and then presented at inference with an ODE of a different form (a form of cross-class generalization). Even in this challenging scenario, the ICON approach showed some ability to solve the new ODE without any parameter updates (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?) (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). This complements the original ICON paper’s findings by verifying that the knowledge transfer across equation types is indeed possible. Importantly, Liu et al. provided a theoretical lens by drawing a parallel between ICON’s behavior and least-squares solutions. By showing that identifying a linear ODE’s operator from data is equivalent to solving a linear regression (for the ODE’s Green’s function parameters), they explained that a transformer can learn to perform this regression in context (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). In essence, the transformer meta-learns the algorithm to solve the family of ODEs. This kind of rigorous understanding strengthens confidence in the ICON framework and helps guide its application to more complex scenarios.

Architectural and Multimodal Advances. As the community gained confidence in in-context operator learning, attention turned to improving the architecture and flexibility of ICON. One notable extension came from the original ICON team: they introduced a multimodal ICON variant that incorporates textual and symbolic information into the prompts. In their follow-up work (Yang et al., 2024, unpublished report), the authors argue that relying solely on raw sensor data in the prompt might ignore valuable human knowledge about the system (). They propose augmenting the prompt with “captions” – descriptions of the differential equation or physical system in natural language or math formulas (). For example, a prompt might include a brief text like “this is a diffusion equation with a high diffusivity” or an equation alongside the usual numeric data. To handle this, they developed a new architecture called ICON-LM (ICON with Language Model features) that can process text and numeric pairs together (). ICON-LM adopts a more language-model–like transformer design and is more efficient, achieving similar accuracy with roughly half the number of parameters of the original ICON (). Experimentally, this multimodal approach was shown to boost accuracy and reduce data requirements – the captions guided the model to better infer the operator with fewer sensor observations (). This result is intuitive: providing high-level context (like equation form or known symmetries) helps restrict the hypothesis space of operators. The introduction of ICON-LM represents a trend of merging scientific machine learning with techniques from NLP. It opens the door to using prior knowledge (from textbooks or domain experts) in conjunction with data prompts, moving closer to a flexible, user-instructable AI for PDEs. The ICON-LM work also demonstrates improved training efficiency, an important practical consideration if one hopes to scale in-context learning to extremely large model sizes or to a vast array of physics tasks ().

Another line of architectural improvement was explored in a study by Liu and Osher (2024) focusing on PDEs with shocks and discontinuities. They applied ICON to 1D nonlinear conservation laws (a class of PDEs where classical solutions develop discontinuities) (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws) (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). Such problems are notoriously difficult for neural networks due to the need to capture shock formation and propagation. The authors employed the improved ICON-LM architecture and introduced clever pre- and post-processing (e.g. changing variables, using adaptive strides in time) to ensure the data fed to ICON is within its “capability scope” (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws) (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). Their experiments showed that ICON can indeed learn families of conservation-law operators (parametrized by flux functions) and even generalize to new flux functions outside the training set (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws) (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). By using high-order numerical schemes (WENO) to generate training data and then evaluating ICON on different equations, they found that the network can generalize well to some PDEs of new forms without retraining (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). This provides further evidence for ICON’s potential as a universal PDE solver. Additionally, they highlighted methods to broaden ICON’s applicability – for example, using coordinate transformations to handle moving shock frames, or varying the resolution (stride) of input functions to cope with different scales (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws) (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). These techniques essentially expand the range of PDE phenomena that ICON can tackle, indicating a maturation of the methodology to handle real-world complexities. The authors dubbed their progress “a significant step towards… a foundation model for PDE-related tasks under the in-context operator learning framework” (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws), reinforcing the vision of a single model handling many types of physics problems.

Applications to New Domains. Beyond traditional physics PDEs, in-context operator learning has also been applied to other domains. Meng et al. (2025) explored ICON in the context of quantitative finance, specifically for modeling transient price impact in optimal trading problems ([2501.15106] In-Context Operator Learning for Linear Propagator Models). In their paper “In-Context Operator Learning for Linear Propagator Models,” they trained ICON on a family of linear propagator models (which describe how trading a stock affects its price over time with temporary impact) ([2501.15106] In-Context Operator Learning for Linear Propagator Models). Here, each “operator” maps a trading rate function to the resulting price impact curve, and different propagator kernels correspond to different impact dynamics ([2501.15106] In-Context Operator Learning for Linear Propagator Models). The ICON model was able to learn from a few example trajectories of price impact and quickly infer the correct propagator kernel for a new scenario ([2501.15106] In-Context Operator Learning for Linear Propagator Models). Remarkably, even if the new propagator kernel was never seen in training, ICON’s few-shot prediction still matched the true dynamics well ([2501.15106] In-Context Operator Learning for Linear Propagator Models). In practical terms, after seeing a small amount of data (e.g. price moves resulting from a few trades), the model could identify the nature of the price impact and predict future impacts. They then integrated this learned operator into a trading strategy: using ICON as a surrogate model inside a reinforcement learning agent for optimal execution ([2501.15106] In-Context Operator Learning for Linear Propagator Models). The resulting policy coincided with known optimal strategies derived analytically for those propagator models ([2501.15106] In-Context Operator Learning for Linear Propagator Models). This is a striking result – it means ICON effectively learned the correct underlying model so well that an optimal control algorithm built on its outputs reproduced the textbook solution ([2501.15106] In-Context Operator Learning for Linear Propagator Models). This application showcases the transfer learning capability of ICON: knowledge acquired in the “offline” meta-training (on many simulated models) can be deployed online in a new scenario to both characterize the system and optimize decisions in just a few shots ([2501.15106] In-Context Operator Learning for Linear Propagator Models) ([2501.15106] In-Context Operator Learning for Linear Propagator Models). The financial example underscores the generality of in-context operator learning: it is not limited to physical PDEs, but can apply to any domain where systems are governed by underlying operators that one might want to quickly learn from data.

Alternative Approaches and Connections

The rapid progress in ICON has inspired alternative frameworks that combine in-context learning with physics prior knowledge. One notable approach is the In-Context Neural PDE (IC-NPDE) framework proposed by Yin et al. (2024) (under review for ICLR 2025). While it shares the same goal of meta-learning dynamical systems, IC-NPDE replaces the black-box transformer with a more structured design. In this framework, a hypernetwork first processes the context data (a short trajectory of a dynamical system) to produce the parameters of a smaller neural ODE solver (). That is, rather than embedding the entire prompt in a transformer’s latent space, IC-NPDE explicitly generates a bespoke neural network (a convolution-based PDE solver) tuned to the inferred physics () (). This small network is then integrated forward in time (like a differentiable simulator) to predict the system’s evolution (). By decoupling parameter estimation from state prediction, the method injects strong inductive biases: the solver network uses continuous-time integration (respecting the ODE/PDE structure) and convolutional layers that enforce spatial translation-equivariance (a symmetry that generic transformers lack) () (). These biases make IC-NPDE particularly well-suited for physical systems, which often obey translational invariance and smooth temporal evolution. Indeed, the authors demonstrate substantially improved sample efficiency and stability: their model learns accurate predictions with far fewer training epochs and is more robust on long-term rollouts, compared to a pure transformer-based ICON approach () (). For example, on fluid dynamics benchmarks, the hypernetwork method converges to error within 1 epoch, whereas a transformer required ~50 epochs to reach similar accuracy (). On multi-step forecasts, IC-NPDE achieved lower error accumulation than state-of-the-art in-context models (transformers), highlighting better generalization over time () (). In summary, IC-NPDE marries the strengths of meta-learning with those of classical numerical schemes, pointing to a future where neural operators incorporate more physics structure. While this approach is distinct from ICON’s transformer design, it shares the same spirit of leveraging context to adapt to new systems without retraining. The emergence of IC-NPDE and similar ideas (e.g. meta-learning PDE solvers with inductive biases, symbolic regression hybrids, etc.) indicates that in-context operator learning is branching into a rich research area, where insights from scientific computing, meta-learning, and even language models are cross-pollinating.

It is also worth noting connections to other efforts such as PROSE and related multi-task scientific learners. The PDE generalization paper by Liu and Osher references PROSE as a method that can generate both a symbolic equation and a neural operator for multiple ODEs (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws). Such methods combine program synthesis with operator learning, suggesting a complementary route to generalization: learning the form of the equations explicitly (symbolically) alongside the operator. All these developments – ICON, ICON-LM, IC-NPDE, PROSE – underline a broader trend: researchers are moving toward foundation models in scientific machine learning, capable of adapting to new laws of physics or engineering on the fly. The field is coalescing around the idea that large models can be trained on diverse families of problems and then used as versatile solvers, much like humans leverage prior experience to tackle new tasks. In-context operator learning, in particular, provides a powerful framework for this vision, as it does not require retraining and naturally handles few-shot scenarios. As the citation graph shows, the initial ICON paper ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems) quickly spawned multiple follow-ups that expanded its theory (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?), improved its implementation (), and applied it to new frontiers ([2501.15106] In-Context Operator Learning for Linear Propagator Models). The evolution from single-task neural solvers to multi-task in-context learners marks a significant paradigm shift in scientific computing and machine learning.

Methodology for Literature Analysis

To conduct this in-depth analysis, we followed a systematic approach leveraging citation networks and academic search engines:

  1. Seed Paper Identification: We began with the seminal paper by Yang et al. (2023) on “In-Context Operator Learning with Data Prompts…”, identified via keyword searches (e.g. “in-context operator learning”). This paper served as the starting point for the topic.
  2. Citation Graph Traversal: Using Google Scholar and Semantic Scholar, we retrieved both the references cited by the seed paper and the subsequent works that cite the seed paper. On Google Scholar, the “Cited by” feature was used to find recent papers building on ICON. On Semantic Scholar, we examined the “Connected Papers” and citation feed for co-citations and related work. This process surfaced key follow-up papers, such as the generalization study by Liu et al. (2023) and the multimodal ICON-LM report, as well as domain-specific applications (finance) and alternative frameworks (IC-NPDE).
  3. Thematic Organization: As papers were gathered, we grouped them by theme: (a) foundational concept and methodology (the ICON paper itself), (b) theoretical analyses of ICON (generalization and links to linear regression), (c) improvements and extensions (multimodal prompts, architecture tweaks, broader PDEs), (d) applications to new domains, and (e) related approaches. This thematic grouping guided the structure of our discussion.
  4. Detailed Content Extraction: We read each paper (focusing on abstract, introduction, and conclusion for high-level contributions, as well as technical sections for key math insights). We extracted key mathematical details (e.g. how ICON is formulated, any theoretical theorems or empirical findings) and noted results of experiments. Wherever possible, we used the authors’ own words or quantitative results, supported by direct quotations and citations in the format (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). For instance, we cited lines from Yang et al.’s paper to capture their description of ICON’s training/inference procedure ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems), and lines from Liu et al.’s abstract to summarize the linear regression connection (NeurIPS Does In-Context Operator Learning Generalize to Domain-Shifted Settings?). This ensured accuracy and preserved the rigor of the original sources.
  5. Evolution and Connection Mapping: We explicitly traced how ideas progressed: e.g. ICON’s introduction referencing GPT-3’s in-context learning ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems), then later papers referencing ICON. We noted when the same authors extended their work (Yang et al.’s subsequent ICON-LM and PDE-generalization papers) versus when independent groups offered new perspectives (the Berkeley/Stanford group’s analysis, or the ICLR submission proposing IC-NPDE). Using Semantic Scholar’s citation graph, we identified these connections and verified them by reading the relevant sections (for example, checking that the IC-NPDE paper cited ICON as a state-of-the-art to beat ()).
  6. Compilation of Insights: Finally, we compiled the insights in a cohesive narrative, ordering themes logically (from background and theory to applications). We cross-verified facts between sources – for example, confirming that claims of “no retraining needed” or “few-shot generalization to new equations” in secondary sources matched what the primary ICON paper demonstrated. We also included brief historical context (universal operator approximation, neural PDE solvers) by tracing references in the ICON papers’ introductions (PDE Generalization of In-Context Operator Networks: A Study on 1D Scalar Nonlinear Conservation Laws), to show the lineage of ideas.

Throughout this process, tools like the browser interface were used to locate specific excerpts (using keyword search within documents for terms like “generalize” or “transformer”), ensuring that we captured exact quotes and page references. This methodological approach – starting from a key paper, snowballing through citations, and organizing by thematic strands – allowed us to thoroughly map out the landscape of in-context operator learning and present a clear, well-sourced evolution of the field. Each claim in our analysis is backed by references to the literature (in the specified citation format), providing a transparent chain from the original papers to our synthesized understanding.

In-Context Operator Learning vs In-Context Learning (Linear Regression)

Overview and Relationship

In-Context Learning (ICL) refers to a model’s ability to learn from examples provided in its input context (the prompt) and apply that “learned” function to new queries, all during inference (no parameter updates) ([2208.01066] What Can Transformers Learn In-Context? A Case Study of Simple Function Classes). In other words, the model is given a sequence of input-output pairs (demonstrations for a task) plus a new input, and it must generate the correct output for the new input based on the pattern in the examples.

In-Context Operator Learning (ICOL) is a specific paradigm of ICL introduced for scientific and operator learning tasks. An operator is a mapping between functions (e.g. a differential equation solution operator maps an input function or initial condition to an output function) () (). ICOL trains a single neural network to learn new operators from data examples in the prompt and answer new queries without any retraining (). Essentially, the model sees a few condition → quantity-of-interest (QoI) pairs (these are like input-output examples for the operator), and it must infer the underlying operator on the fly and apply it to a new condition to predict the correct QoI () (). This “train-once, apply to many operators” approach contrasts with classical operator-learning methods that train a new network for each new operator ().

Linear regression as an ICL task: In-context learning with linear regression is a prototypical example that helps us understand ICOL in a simple setting. Here the “task” or “operator” is a linear function mapping input vector x to output y (i.e. y = w·x for some unknown parameters w). The model is trained on many linear function instances so that at inference time it can learn a new linear function from context examples and predict new outputs. This is essentially ICOL restricted to the operator class of linear maps. Recent work showed that standard Transformers can indeed be trained from scratch to perform in-context learning of linear functions, achieving performance comparable to the optimal least-squares estimator (ordinary linear regression) ([2208.01066] What Can Transformers Learn In-Context? A Case Study of Simple Function Classes). In other words, for an unseen linear relationship, the trained model’s predictions mimic those of ordinary least squares (OLS) regression on the provided examples (). Linear regression ICL is thus a concrete instance of the broader ICOL idea – the underlying principle is the same: the model absorbs training examples (whether simple numeric pairs or complex function data) and infers the mapping needed to answer new queries without gradient updates.

Formal Mathematical Derivation of the Relationship

Least-squares solution as in-context learning: To formalize the connection, consider a linear regression task in dimensions. Let the prompt consist of example input-output pairs (with and ) and a query input . A model that perfectly performs in-context learning for this task would produce the output equal to the prediction of the least-squares linear model fitted to the examples. The closed-form OLS solution for the weight vector (assuming and the are independent) is:

where is the design matrix with rows , and is the -dimensional vector of outputs. The corresponding prediction for a new input is:

This formula is the target output that an ideal in-context learner should produce for the query, given the prompt data. Notably, it depends only on statistics of the prompt (such as and ) and not on any learned parameters specific to this new task, which aligns with the idea that the model must compute it in context.

Recent theoretical work has proven that a Transformer with self-attention is expressive enough to implement this computation. For example, a single-layer attention-based model can be constructed to compute one step of gradient descent toward the least-squares solution, and with slightly larger capacity it can even implement the exact closed-form update for ridge regression or least-squares in one pass (Structure and Interpretation of Deep Networks). By stacking more layers (or performing iterative updates in context), multiple steps of these algorithms can be simulated, refining the solution (). At a high level, this means there exists a setting of Transformer parameters that realizes the mapping given above (). Empirically, when a Transformer is trained on many linear regression tasks, it does converge to a solution that behaves like this least-squares predictor (). In summary, the in-context learning process for linear regression can be derived as solving the normal equations for the prompt data and producing accordingly – the trained Transformer effectively learns to carry out this algebra on its input sequence.

Extension to general operators: In the more general ICOL setting (e.g. learning a differential equation operator in context), a formal derivation of the “solution” is more complex, since there may not be a simple closed-form formula like OLS. However, the principle is analogous. For an operator mapping a condition (input function) to a result (output function), the in-context learner given examples (where each ) should output . If comes from a parametric family, this essentially means the model is estimating the operator’s parameters from the example pairs (analogous to estimating in linear regression). For instance, a simple operator family might be (scaling a function by ); then given pairs, the model can infer (perhaps via least squares in function space) and apply it. In practice, neural ICOL models are trained to minimize error on during training, so they learn an implicit algorithm to produce a good approximation. While an explicit formula might not be available for arbitrary operators, the meta-learning perspective applies: the model is trained on a distribution of operators, and the optimal meta-learner will in theory implement the Bayes-optimal inference for given example data. Recent theoretical results support that Transformers can implement a broad class of such standard learning algorithms (not just least-squares, but also procedures like ridge regression, Lasso, or even gradient descent on nonlinear models) within their forward pass () (). This ties ICOL and ICL together under a unified view: both involve a learned model internally performing another learning algorithm. Linear regression is just a case where we can fully write out what that inner algorithm does.

Data Structure and Format in Recent Papers (Training vs. Inference)

A crucial aspect of both ICOL and ICL experiments is how the prompts (datasets) are structured and fed to the model, both during training and at inference time. We break down two representative cases from recent papers:

  • Linear Regression ICL (Garg et al. 2022; Zhang et al. 2024): The training data for these studies consists of synthetic linear regression tasks. For each task, a random linear function is sampled (e.g. sample a weight vector from some distribution). Then a small dataset is generated by drawing random input vectors (often i.i.d. from a multivariate distribution, e.g. Gaussian) and computing outputs (sometimes with added noise) (). This collection of example pairs and one additional query input is formatted as a single sequence to feed the Transformer. In Garg et al.’s setup, they formatted the prompt as a sequence of tokens: , where “?” is a placeholder for the model to fill in the predicted (). Each and can be represented either by a vector embedding or by serializing numeric values into tokens. For instance, one approach is to embed each pair as a single vector (concatenating and ) and feed a sequence of such vectors. In a more explicitly structured approach, Zhang et al. (2024) stack the inputs and outputs into an embedding matrix:
    \begin{pmatrix} x_1 & x_2 & \cdots & x_N & x_{\text{q}} \\ y_1 & y_2 & \cdots & y_N & 0 \end{pmatrix},$$ where $P$ is the prompt, $x_{\text{q}}$ is the query input, and the last column uses 0 as a dummy placeholder for the unknown output ([](https://jmlr.org/papers/volume25/23-1042/23-1042.pdf#:~:text=The%20user%20has%20the%20flexibility,P%29%20%3D%20%12)). This matrix (of size $(d+1)\times(N+1)$ for $d$-dimensional $x$) is given to the model. The Transformer (or specialized attention model) processes this structured prompt and is trained to produce the correct $y_{\text{query}}$ in the position of that placeholder. In Zhang et al.’s formulation, the model’s output is taken as the **bottom-right entry** of the output matrix after one pass through the self-attention layer ([](https://jmlr.org/papers/volume25/23-1042/23-1042.pdf#:~:text=The%20network%E2%80%99s%20prediction%20for%20the,dependence%20on%20%CE%B8%20and%20write)) – effectively filling in the “?” with its prediction. Training is done over many such prompts (tasks), adjusting the Transformer’s weights to minimize the prediction error (usually mean-squared error for regression). At **inference time**, the model is given a prompt constructed in the same way but from a new linear function not seen during training. The prompt may have the same number of example pairs $N$ (or even a different number, since transformers can handle variable-length sequences). The model then generates $y_{\text{query}}$ for this new task. The performance is evaluated by how close this output is to the true $y_{\text{query}}$ (and it has been found to match the OLS solution closely ([[2208.01066] What Can Transformers Learn In-Context? A Case Study of Simple Function Classes](https://arxiv.org/abs/2208.01066#:~:text=,to%20the%20optimal%20least%20squares))). Notably, some works explore distribution shifts at inference – for example, using different input distributions or noise levels than seen in training – to test robustness ([](https://arxiv.org/pdf/2305.16704#:~:text=MLPs%20exhibit%20in,based%20MLPs%20falter)) ([](https://jmlr.org/papers/volume25/23-1042/23-1042.pdf#:~:text=2019,For%20the%20fixed%20covariance)). In those cases, the prompt format remains the same; only the data distribution changes.
  • Differential Equation Operator ICOL (Yang et al. 2023, PNAS): In this setup, each training sample (prompt) corresponds to an instance of a differential equation (DE) operator learning problem. The authors consider various types of operators (ODEs, PDEs, etc.) with varying parameters () (). For a given operator instance, they generate a small set of “sensor” observations: these are pairs of a condition (input function or parameters) and the corresponding output (solution) value (). For example, if the operator is a PDE solving map, one prompt might include a few spatial locations (conditions) and the solution value at those points (QoI). These pairs are analogous to the examples in linear regression, except here might represent a point in space/time or an initial condition, and is the solution value. Along with these examples, a new query input (e.g. a new spatial location or a new initial condition) is provided in the prompt, for which the solution is not given. The model (ICON network) must output the predicted solution at this query input. The format can be a bit more complex due to functional inputs: in the original ICOL work ([2304.07993] In-Context Operator Learning with Data Prompts for Differential Equation Problems), the authors feed the example data in a neural network that can take sets of pairs. In follow-up work (Liu et al., 2023), they even transform it into a multi-modal prompt by including a “caption” (textual or equation description of the operator) alongside the numeric pairs () () – essentially concatenating different modalities as input. For simplicity, the core data structure is still: [(condition, QoI), …, (condition, QoI), (condition, ?)], meaning demonstrated input-output pairs for a particular operator, plus one query input. During training, many such prompts are generated by sampling different operators and different example sets, and the model’s weights are optimized to output the correct QoI for each query. Inference involves giving the trained model a brand new operator (e.g. a new differential equation with different parameters or form) with a few example pairs, and checking if it can produce the correct output for the new query. The ability to succeed at this demonstrates generalization to new operators. Yang et al. showed that their model could solve not only operators within the training distribution but also some outside of it (e.g. training on one family of ODEs and generalizing to a harder ODE) () (). This confirms that the model isn’t just memorizing specific solutions, but truly learning how to learn operators from data prompts.

Summary of data format: Across both examples, we see a common structure: the training data is organized into small “datasets” (prompts) of example pairs plus queries, and each such prompt is treated as a sequence input to the model. The difference between training and inference is mainly which task is used – during training, prompts are drawn from a known distribution of tasks (e.g. random linear functions or random DEs), while at inference we might encounter a new task from the same distribution or even outside it. The model is never explicitly told the underlying parameters or identity of the task; it must infer that from the context data. By structuring the data this way, recent papers ensure that the model learns a general strategy: it must rely on the given examples to make a prediction, rather than any single global function. This is exactly what enables in-context generalization.

Why Use Transformers for In-Context Learning?

Transformers (with self-attention architectures) have emerged as the model of choice for in-context learning tasks (including the examples above) for several reasons:

  • Sequence Processing and Flexibility: Transformers are designed to handle sequence inputs of arbitrary length, and self-attention allows the model to flexibly attend to any part of the input. This is crucial for ICL, where the number of context examples can vary. The transformer can, in principle, use all context points to inform the prediction, irrespective of order or position (the model can learn to be permutation-invariant to the example pairs by attending appropriately). Competing architectures like simple MLPs or CNNs are less naturally suited to variable-sized contexts. In fact, experiments show that while even permutation-invariant MLPs can learn some in-context skills, Transformers achieve closer to optimal (OLS-like) performance and are more robust to distribution shifts in the prompts ().
  • Expressive Computation Through Self-Attention: The self-attention mechanism enables complex computations based on interactions between tokens. Each attention head can perform weighted summations of values based on learned comparisons of queries and keys. This makes it possible for a transformer to compute the necessary statistics or transformations of the input examples that underlie learning algorithms. For example, a transformer layer can effectively compute things like similarity scores, sums, or other functions of the input pairs – building blocks of algorithms like gradient descent or closed-form solutions. Theoretical results have demonstrated that a multi-head attention block with sufficient width can implement one step of gradient descent in weight space, or even direct solutions for linear models (Structure and Interpretation of Deep Networks). Thus, the transformer is a natural algorithm emulator. If properly trained, its weights can encode procedures to, say, solve normal equations or update parameters, just by manipulating the input representations via attention.
  • Evidence of Internal Meta-Algorithm: Studies examining trained transformer-based in-context learners have found that their internal representations correspond to components of learning algorithms. For instance, in a transformer trained to do linear regression in-context, one can decode the equivalent of the linear weight vector from the model’s hidden state, as well as intermediate quantities like moment matrices () (Structure and Interpretation of Deep Networks). This suggests the transformer has in fact learned to internally compute things analogous to “sufficient statistics” of the prompt and then use them to make predictions – much like a manual algorithm would. This ability to discover and implement standard algorithms implicitly is a strong affirmation of why transformers are well-suited: they have the capacity to learn to approximate any computable learning procedure given enough depth and width ().
  • Scalability and Transfer: Transformers are highly scalable and have been the backbone of large language models that exhibit in-context learning at scale. Their success on enormous text corpora (where they learned to perform many tasks with prompting) indicates a real-world validation of the architecture’s suitability for ICL (). By using Transformers for tasks like ICOL, researchers aim to leverage that scalability and the rich inductive biases (attention-based computation, multi-head parallelism, etc.) that have proven effective. Moreover, transformers can transfer the in-context learning ability across tasks. Once a transformer learns how to learn from prompts in one domain, it can potentially be adapted or extended to others, especially as part of larger multi-modal or multi-task systems () (). For example, ICON-LM (Liu et al. 2023) builds on a language-model style transformer architecture to incorporate text descriptions and thus broaden the capabilities of the ICOL model () (). This would be difficult with a less flexible architecture.
  • Comparative Performance: Empirically, transformers have simply shown better performance on ICL tasks compared to alternatives. Garg et al. (2022) noted that a GPT-2 style transformer trained on synthetic function data not only learned the tasks but often outperformed task-specific algorithms for more complex function classes (like two-layer neural network targets and decision trees) ([2208.01066] What Can Transformers Learn In-Context? A Case Study of Simple Function Classes). Another study directly compared transformers to a set-based MLP and found that while both can learn in-context under ideal conditions, the transformer more faithfully reproduces the optimal predictions and degrades more gracefully under shift conditions (). These results highlight that something about the transformer architecture (possibly the attention and the way it can implement computations) makes it especially effective at in-context learning.

In summary, transformers are used for ICL/ICOL because they provide a powerful and flexible “canvas” on which the learning algorithm can be painted via training. They handle sequences of examples naturally, can implement the required mathematical operations through attention, and have demonstrated the capacity to generalize the in-context learning ability widely. This makes them an ideal choice to serve as meta-learners that learn new tasks on the fly.

Methodology: Structured Research Process and Subgoal Tracking

When investigating complex research questions like the relationship between ICOL and ICL (with linear regression), it is important to break the problem into subgoals and approach them systematically. Below is a structured methodology outlining concrete steps, decision criteria, and a pseudo-code style plan for tracking progress:

Research Plan Outline

  1. Identify Key Concepts and Scope: Start by listing the primary concepts involved (e.g., in-context learning, operator learning, linear regression in-context). Clarify definitions and ensure a solid understanding of each. Decision criterion: You have collected precise definitions from reputable sources (textbooks or papers) for all key terms. If not, revisit literature for definitions.
  2. Literature Review and Data Gathering: For each concept and their relationship, gather information from recent papers or articles:
    • Find papers on in-context operator learning (e.g. the PNAS 2023 paper) and note their problem setup, methods, and findings.
    • Find papers on in-context learning with linear regression (e.g. Garg et al. 2022, follow-up works) and extract their experimental setup, theoretical results.
    • Collect details on how data is formatted in these papers (training vs inference).
      Decision criterion: Each sub-topic (ICOL and ICL-linear) has at least a few sources, and key points (definitions, data structure, outcomes) are recorded. If information is missing (e.g. details on data format), search for supplementary material or additional papers until filled.
  3. Formulate the Relationship and Derive Connections: Using the information gathered, articulate how the specific example (linear regression ICL) relates to the general case (ICOL). This might involve writing down the mathematical solution of linear regression and relating it to the concept of an “operator.” Work out a derivation (like the OLS solution) step by step to ensure clarity.
    • Derive the normal equations for least squares and the resulting formula for .
    • Connect this derivation to what a neural network must do in context.
      Decision criterion: You can explain in your own words (and equations) why solving a linear regression from context is an instance of learning an operator (mapping inputs to outputs) from examples. If the connection is unclear, revisit the definitions or seek theoretical papers (e.g., provable ICL papers) for insight.
  4. Analyze Model Choice (Transformers): Investigate why Transformers are the chosen architecture. Enumerate the properties of Transformers (attention mechanism, capacity, etc.) and find evidence or arguments in the literature supporting their effectiveness in ICL. Also, consider alternative architectures’ performance from studies (like the set-based MLP comparison).
    Decision criterion: You have a list of at least 3 distinct reasons (with supporting references or logical arguments) that make Transformers suitable for these tasks. If not, research architectural inductive biases in more sources.
  5. Synthesize Findings for Each Subgoal: Compile the insights from the above steps into a coherent explanation for each part of the question. Ensure you cite sources for factual claims (e.g., “model X mimics OLS” or “definition of ICOL”). Double-check that each subgoal (relationship, data breakdown, transformer reasoning) is addressed with sufficient detail.
    Decision criterion: Each aspect of the original question is answered with evidence:
    • Relationship & derivation: includes a formula or theoretical explanation.
    • Data sets: includes a clear description of training vs inference format from actual experiments.
    • Transformers: includes conceptual reasoning and, if possible, experimental proof points.
  6. Review and Iterate: Finally, review the compiled explanation. Verify that the reasoning is logical and the subparts flow. If any part is weak or lacks clarity, identify it as a new subgoal (e.g., “clarify how prompts are encoded for PDE problems”) and return to step 2 or 3 as needed to strengthen it.
    Decision criterion: A final draft is ready when all sub-questions are answered and the answer is understandable and well-supported. If the draft does not meet the question requirements upon a fresh read-through, iterate on the specific sections that need improvement.

Pseudo-Code for Research Process

The above plan can be summarized in a pseudo-code format to emphasize subgoal tracking:

define subgoals = [
  "Define ICOL and ICL (linear regression) clearly",
  "Gather dataset structures from literature",
  "Derive mathematical connection (OLS solution vs operator learning)",
  "Investigate why Transformer is used (theoretical & empirical reasons)"
]
 
results = {}
for goal in subgoals:
    results[goal] = research(goal)        # Conduct literature search, reading, note-taking
    if not results[goal].satisfies(criteria_for(goal)):
        refine_query(goal)               # If info is insufficient, adjust search terms or scope
        results[goal] = research(goal)   # Try again to gather info
    mark_complete(goal)                  # Subgoal achieved with adequate detail
 
# Synthesize and verify all results
answer_draft = compose(results)
if not answer_draft.answers_all_parts():
    for missing_part in answer_draft.find_gaps():
        # Treat each gap as a new subgoal and repeat the process
        results[missing_part] = research(missing_part)
        answer_draft.update(results[missing_part])
final_answer = answer_draft.review_and_finalize()

In this pseudo-code, criteria_for(goal) represents the decision criteria defined for each step (for example, a goal might require finding at least N references or a precise definition). The loop ensures each subgoal is addressed, and if the content is insufficient, it refines the approach (like searching new keywords or looking at different sources). After collecting results for all subgoals, it composes the final explanation. If any part of the question is still unanswered or unclear in the draft, those gaps are turned into new “subgoals” and researched further. This iterative refinement continues until the final answer meets all requirements.

By following such a structured methodology, one can keep track of complex research questions, ensure all sub-components are resolved, and confidently know when each part is complete. This leads to a thorough and well-supported investigation, as demonstrated in the analysis above.