Manuscript Offprint
arXiv:2609.11376Deep operator learning for efficient sampling from invariant measures of stochastic differential equations
Abstract
We introduce an amortized neural sampler that combines operator learning with flow methods for sampling. It maps SDE coefficient functions to pushforwards from a reference measure to the invariant measures, enabling efficient sampling across families of stochastic differential equations. Our framework shifts traditional sampling cost to an initial training phase, after which new SDE instances require only one encoder pass and a few ODE solver steps, independent of mixing time. To handle problems in high dimensions, we use Lagrangian trajectory sensors for the coefficient functions and cross attention in the architecture. We also theoretically establish the expressivity and resolution invariance of our framework. Experiments on 1D and 2D SDE families show competitive accuracy with substantial speedups over MCMC in regimes with slow mixing, transfer across sensor counts, and demonstration results on a 64D interacting particle SDE where traditional grid approaches are infeasible.
Keywords. operator learning, invariant measures, stochastic differential equations, amortized sampling, flow matching, uncertainty quantification
MSC 2020. 60H10, 65C05, 68T07
1 Introduction
Sampling from the invariant measures of Stochastic Differential Equations (SDEs) is a fundamental task in applied mathematics, statistical physics, statistics and computer science, which enables the computation of stationary expectations, free energies and rare event probabilities for uncertainty quantification and stochastic control in related applications [23, 26, 17]. Traditional methods, such as Markov Chain Monte Carlo (MCMC) [24, 11, 32], rely on sequential simulations of the dynamics. These methods are intrinsically sequential and generally produce correlated samples. They require an initial equilibration period and a sufficiently long simulation to approach equilibrium, while time discretization may introduce an additional bias. More importantly, for multimodal or metastable systems, transitions between separated regions can result in a prohibitively large mixing time and a small effective sample size. When the drift or diffusion coefficients vary across many problem instances, a new long simulation is usually required for every instance [32], and this repeated mixing cost can become the dominant computational bottleneck.
*Email: lguo@shnu.edu.cn
Email: leili2010@sjtu.edu.cn
Email: sffred@sjtu.edu.cn
Operator learning [22, 18, 15], which directly learns the map between functions, is gaining interest in scientific machine learning, and provides a natural framework for amortizing this cost over a family of stochastic systems. Consider the coefficient-indexed Stochastic Differential Equation (SDE) taking values in
with , drift , diffusion coefficient , and standard Brownian motion in . Both dimensions are fixed within each coefficient family. Write for the pair of SDE coefficients throughout this paper, and denote its invariant measure by . Rather than constructing a separate sampler for each , one may seek a generative sampler operator satisfying , where is a simple reference distribution and denotes the pushforward of measures. Thus, takes the drift and diffusion functions, together with a latent random variable, as inputs and returns a sample from the corresponding invariant law. This provides a natural operator learning problem because the inputs are functions. After an offline training stage over a suitable family of coefficients, such an operator could be evaluated on previously unseen SDEs and generate samples in parallel without repeating a long mixing simulation for every new query.
The generative sampler has been extensively studied in recent years, including normalizing flows and the continuous versions [31, 7]; Boltzmann generators [25]; score-based diffusion models [35]. The flow matching approach [19, 20] provides a regression framework for training continuous normalizing flows by learning a target velocity field, while avoiding adversarial objectives. FlowKac uses temporal normalizing flows and the Feynman–Kac formula for Fokker–Planck equations [8]; the weak adversarial networks enforce the weak equation through a minimax problem involving trial and test networks [39], whereas the weak generative sampler uses randomized test functions to train a transport map directly and avoids the adversarial minimax optimization [5]. Although these methods can substantially reduce the cost of sampling a prescribed target, they are typically trained for a fixed distribution or a single stochastic system. The objective here is instead to combine generative sampling with operator learning. Let us have also brief review of the neural operators. Representative neural operators include DeepONet [22], which encodes input functions through branch networks and evaluates outputs through a trunk network; the Fourier Neural Operator [18, 15], which parameterizes integral operator layers in the Fourier domain; multi-input operators (MIONet) [14], which accommodates several functional inputs through multiple branch networks; and Variable-Input Deep Operator Networks (VIDON) [29], which allows the number and locations of input sensors to vary between samples. Recently, generative neural operators have also been extended to learning probability laws on function spaces, first through adversarial neural operators [30] and more recently through operator flow matching for stochastic process priors [34, 12]. Huang and Lai use an empirical measure limit for sample-based attention [12]. Continuum attention also interprets discrete attention as an approximation of a population operator [6].
We propose an amortized neural sampler that uses neural operators and the flow matching [19] to construct a reusable map from previously unseen drift and diffusion functions of the SDE (1.1) to samples from their corresponding invariant measures. Let A denote the space of admissible coefficient pairs. We assume a is drawn from a distribution over A, and we have access to existing samples generated via MCMC or other experimental methods. We want to learn a neural operator that functions as a conditional velocity field:
and apply it to unseen to generate samples from the steady state distribution of the SDE defined by a. Since the inference procedure requires evaluating multiple times to solve the ODE (1.2), we adopt an encoder-decoder design: for a given pair , the input functions are encoded once into a latent representation, which is then reused across all ODE integration steps, thereby reducing the computational cost at inference time. We use the Perceiver architecture [13] to aggregate the embeddings of random Lagrangian trajectory sensors into a context vector of fixed dimension.
The main contributions of this work are as follows:
-
We formulate an operator-conditioned amortized sampler for parametric families of SDEs, which combines neural operator encoders with continuous normalizing flows. The high cost of training is incurred once, and the trained model then generates approximate invariant measure samples for unseen coefficient instances at an inference cost decoupled from the mixing time of the system.
-
An architecture with attention uses random Lagrangian trajectory sensors for problems in high dimensions. The architecture accepts variable sensor counts during training and inference. The random trajectory sensors do not require a mesh and support flexible domains.
-
We prove theoretically the expressivity of the operator samplers for compact sets of admissible coefficient functions, and also the resolution invariance properties for the proposed random Lagrangian attention sampler. We first establish that the continuity of the map from the coefficient functions to the flow that transforms a reference measure to the target measure. The resolution invariance of random Lagrangian sensors with attention aggregation is established by uniform law of large numbers for compact attention classes.
The remainder of this paper is organized as follows. Section 2 introduces the mathematical setting and section 3 presents the general framework. Section 4 describes the Lagrangian attention sampler in detail. Section 5 provides the theoretical analysis for the expressivity and section 6 establishes the resolution invariance. Lastly, Section 7 reports the experimental evaluation.
An invariant measure of the SDE is a stationary solution of the Fokker–Planck equation (2.1). So the problem can be formulated as learning the map from the parameter to the stationary solution of the Fokker-Planck equation (2.1). Under standard dissipativity and regularity conditions on — made precise in Section 5 — the SDE admits a unique invariant probability measure , and the map is continuous [3].
Since the object to be approximated is a probability distribution, we need a metric on distributions, and we use the quadratic Wasserstein distance throughout. On the space of probability measures with finite second moment, it is defined by
where is the set of couplings of and , i.e. joint distributions on with marginals and . The pair is a complete metric space, and convergence in is equivalent to weak convergence together with convergence of second moments [36]. The metric plays a double role in what follows: the approximation guarantees of Section 5 and Section 6 are stated in , and the experiments of Section 7 use it as the quantitative quality criterion for the trained sampler.
It remains to state precisely what “learning a sampler” means for a family of SDEs. Fix a probability distribution on A representing the family of interest, e.g. a class of drift fields drawn from a prescribed prior. In its classical, one instance form, the sampling problem takes one fixed coefficient pair and asks for i.i.d. samples whose empirical law approximates . MCMC and sequential Monte Carlo solve the problem in this form, one at a time, so each new coefficient pair triggers an independent — and, in slow mixing regimes, long — simulation of the dynamics. We consider instead the amortized form of the problem: construct a single map
where is a latent variable drawn from a fixed reference distribution on (typically ), such that the pushforward approximates for every in the support of . The quality of is measured by the population error
The amortized formulation pays an upfront construction cost in exchange for cheap evaluation: once S is built, sampling from for a previously unseen a requires only forward evaluations of S, with no per-instance simulation of the underlying SDE.
3 The general framework for neural operator sampler
We now explain our parametric sampler framework promised by Section 2. We formalize the neural operator sampler as follows.
Definition 3.1 (Neural Operator Sampler). Let be a state space, and be a Banach space of input functions. A Neural Operator Sampler is a parameterized mapping
where denotes the learnable parameters (weights). For a given input , the map pushes forward the reference measure (e.g., standard Gaussian) to a target distribution .
To construct the map , we adopt the Continuous Normalizing Flow (CNF) paradigm and learn the transport dynamics from reference samples to target samples. We introduce a Neural Operator that approximates the velocity field governing the transport from the reference measure to ,
For a specific input a, the operator predicts a velocity field
The sampler is then defined as the solution of the ODE
We use the alternative notation to indicate the functional dependence on and .
A natural question is whether such a CNF exists for each coefficient pair a, and whether some generating velocity field can serve as a regression target during training. We recall two classical existence mechanisms for such flows: the Benamou-Brenier optimal transport flow, which is exact but depends on the optimal coupling, unavailable from data; and the marginal flow matching construction, which builds a valid transport flow from any coupling of source and target samples and underlies our training objective.
(1) Benamou-Brenier optimal transport flow.
The dynamic (Benamou-Brenier) formulation of optimal transport [2] looks for a density-velocity pair that depends on time and solves the constrained optimization problem
The optimal velocity field transports to along the -geodesic with minimal kinetic energy. By Brenier's theorem [4], when is absolutely continuous there exists a unique -optimal transport map (with convex) satisfying . The Benamou-Brenier geodesic is then realized by the linear interpolation
with marginal velocity field
The optimal transport construction thus provides an exact, geometrically natural flow from to . Its drawback is practical: it requires access to the optimal map or coupling for each target instance, which is generally not available during training — our data consist of unpaired samples from and .
(2) Marginal flow matching construction.
A second existence mechanism is the one underlying flow matching, and it removes this requirement: it builds a valid transport flow from any coupling of source and target samples — in particular the independent coupling , which requires only unpaired samples. The idea is to prescribe simple dynamics conditionally on a pair of endpoints and then average. For each pair , choose a conditional interpolation path and a conditional velocity satisfying the conditional continuity equation
with endpoints concentrated at and . Averaging over the coupling gives a marginal path and a marginal velocity:
where is defined arbitrarily on the set where . Integrating the conditional continuity equations yields
Equivalently, for ,
which is the pointwise projection of the conditional velocity onto functions of the current state. This field has a dynamical role: it generates the marginal path and defines a valid transport flow from to . The conditional expectation form is also what makes the construction trainable: it characterizes as the minimizer of a regression problem whose samples require only draws from the coupling and the conditional path, which turns into the training objective (see the details below).
Flow matching trains the velocity field by pointwise regression and avoids ODE solves inside each gradient step, giving it a lower online training cost than maximum likelihood CNF training. The price is that it requires training samples from the target invariant measures; in this work we focus on this supervised setting. Stochastic interpolants provide a closely related formulation, and the expressivity theory of Section 5 uses a smoothed variant of the flow matching construction.
For a fixed coefficient pair a, the ideal marginal flow matching loss is
The marginal path and velocity are generally intractable. Conditional flow matching [20] replaces (3.6) with a tractable conditional regression problem. The common -conditioned Gaussian path corresponds to the independent source–target coupling: for each target sample , one defines a conditional probability path and a conditional velocity field satisfying
The resulting conditional flow matching objective
has the same gradients as the corresponding marginal loss for this independent coupling path (3.6) [20] and requires only samples from the simple conditional path.
For the independent coupling, this paper uses the standard Gaussian linear conditional path
Drawing independently of and setting gives the equivalent velocity target .
More generally, if a dependent source–target coupling is used to form training pairs, the conditional path should be viewed as conditioned on the pair :
The corresponding supervised training loss is
The default independent pairing corresponds to ; one may use an empirical or minibatch optimal transport coupling when one wants a closer approximation to the Benamou–Brenier geometry. With an optimal source–target coupling, the linear construction conditioned on pairs realizes the Benamou–Brenier geodesic (3.5); with independent source and target samples, it is a tractable flow matching interpolant. In either case, different couplings and interpolation paths lead to different valid training targets.
In order to mitigate the cost of inference the trained model multiple times to solve the flow ODE (3.4), we propose an encoder-decoder architecture to construct the neural operator . The encoder maps the input functions to a latent representation, and the decoder takes the latent code along with spatiotemporal coordinates to produce the velocity field. Different encoders and decoders can be used to fit different problems. Specifically, the calculation of may be decomposed into two steps:
where are the learnable parameters of encoder and decoder respectively. In the subsequent sections, we will discuss several possible representations of the input functions and the corresponding encoder and decoders.
Training uses the conditional flow matching loss in (3.9). At inference, we evaluate the model multiple times to solve the ODE (1.2). The latent representation (3.10) is computed once per coefficient pair , which reduces time and memory cost. The complete training and inference procedures are summarized in Algorithm 1.
Algorithm 1 Amortized Neural Sampler using flow matching loss: Training and Inference
1: Input: Training set with ; reference measure ; ODE solver with steps.
2: Output: Trained parameters .
3: % Training
4: for each minibatch do
5: Sample coefficients , target , noise , time .
6: Compute interpolant .
7: Encode: .
8: Predict velocity: .
9: Update by .
10: end for
11: % Inference (for a new, unseen )
12: Encode once: .
13: Draw .
14: for do
15: ODE integration (e.g. Euler, RK45): Decoder().
16: end for
17: Return as a sample from the learned invariant measure .
4 A Lagrangian attention operator sampler
The classical grid approach implements the encoder–decoder framework with a Multi-input DeepONet [14]. At grid sensors, we record and . We retain rows of , omitting only rows that vanish for every coefficient instance and position. Stacking each retained row across sensors gives the input tensors:
The velocity field is assembled via the tensor product structure of the Multi-input DeepONet [14]:
where denotes the elementwise (Hadamard) product, and are embedded via a fixed sinusoidal map. In the notation of Section 3, the Branch nets collectively form the encoder
and the Trunk net together with the product-sum formula form the decoder.
For problems in high dimensions a grid of sensors is infeasible: the number of grid points grows exponentially in the dimension , so the dense Eulerian sampling of used by classical neural operators [15, 18] exceeds a realistic budget. Motivated by VIDON for random point sensors [29], we aggregate information from random Lagrangian sensors—mobile probe trajectories that follow a cheap proxy of the dynamics—and encode them with attention. See also [9] for related ideas. Because the encoder reads the sensors through their empirical measure, it ingests a variable number of sensors and runs at a sensor count without retraining. As grows, the output law of the model with fixed weights converges—in expectation over the random probes—to its own population-probe limit (Section 6); increasing reduces the Monte Carlo error from the finite probe set relative to that limit.
The full architecture is shown in Figure 4.1. The model embeds sensor trajectories into the token list ; then interacts repeatedly with a learnable latent token list of fixed size to obtain the latent context . , together with after passing through a Gaussian Fourier Projection, goes through an AdaLN Decoder and produces the final velocity field . The following subsections describe the exact operations.

Figure 4.1: Architecture of the amortized neural sampler with an attention encoder.
4.1 Lagrangian trajectory sensors and the per-sensor embedding
We draw random initial positions i.i.d. from a fixed probability distribution on (the probe initial law); the count may differ across data samples. From each we simulate a short probe trajectory and record at every step the local feature
which pairs each visited state with the drift and diffusion sampled there. The i-th probe observation is the ordered collection
Known structure in reduces the feature width. For and isotropic diffusion , we use .
Sensing with trajectories enriches pointwise evaluation by recording local changes of the drift and diffusion along a short path; even short trajectories provide finite difference information about the local vector field, and their ordered structure can be used by a convolutional encoder.
The probe dynamics need not coincide with the target dynamics: any process that visits the domain and permits pointwise evaluation of and can drive the probes. In practice we drive them either by a cheap exploratory process—Brownian motion with a fixed step size, or a constant diffusion proxy —or by the original SDE (1.1) itself, a natural choice when the drift steers probes toward dynamically relevant regions. In either case the sensing cost is decoupled from the difficulty of the target SDE, and the probes can be extremely short. In several of our experiments (Section 7) trajectories of only steps—and in some settings as few as (two points)—already suffice for accurate reconstruction of the invariant measure. Because each probe involves only evaluations of and , the total sensing cost is negligible compared to the steps required by MCMC.
After the Lagrangian probes obtained, we further make use of a small 1D convolutional neural network acting along the step axis to map each observation into a vector of fixed width. Writing , the network applies convolutional blocks
followed by global average pooling over the steps,
Here GELU donates the Gaussian Error Linear Unit activation
The convolutions with kernel size 3 use “same” padding, which preserves the step length through all N blocks and keeps the embedding defined down to L = 1; they capture local temporal patterns such as the curvature and magnitude of the drift, and the pooling produces an output of fixed size for any trajectory length L, so the embedding dimension is independent of L and m. (A small MLP on a pooled trajectory is an alternative; the 1D CNN consistently outperformed it in our experiments by exploiting the sequential structure.)
The encoder downstream sees the sensors only through their empirical measure
This is the object the resolution invariance theory acts on: increasing sharpens toward an underlying sensor law , and the encoder applies the same map to and to .
4.2 Attention Perceiver encoder
The encoder aggregates the sensor embeddings into a context vector of fixed dimension. This aggregation accepts variable sensor counts and is invariant to sensor permutations.
To perform this aggregation, the encoder carries a fixed set of latent tokens (typically ), stacked as of latent width . Attention updates these tokens with sensor information, and the final readout converts them into the context vector. The encoder represents the sensors by projecting each embedding to width with a shared linear map , stacking the rows into .
Two attention operations act on these arrays: cross attention, in which the latents read the sensors, and self attention, in which the latents exchange information among themselves. Each operation uses H heads of width .
Both operations are built from the same attention primitive. A single head maps a query array Q, key array K, and value array V (rows of width ) to
where are the rows of and the sum runs over the rows of . The softmax normalizes each row, so row of Atten( ) is the convex combination of the rows of weighted by query , and the factor holds the scores at a stable scale as grows.
Each of the heads carries learnable projections , and the head outputs are concatenated and mixed by . Cross attention draws queries from the latents, the keys and values from the sensors; self attention draws all three from the latents:
both in , where concatenates the head outputs along the feature axis and cross-and self attention carry separate projections. Cross attention carries the information of the sensors into the latents; self attention lets the latents share information.
Starting from the learned initial latents , each of the blocks reads the sensors into the latents through cross attention, lets the latents exchange information through self attention, and refines them tokenwise through an MLP with two layers of width and GELU activation, each step carried by a residual connection and a post-LayerNorm:
Every block reuses the same sensor array E as keys and values and updates the latent tokens. Each cross attention head returns a ratio of two sums over the sensors—the value average in the numerator and the softmax normalization in the denominator—so its value is a function of the empirical measure alone. Section 6 and Appendix A.4 build on this empirical measure structure, replacing by a general sensor law to establish resolution invariance as m grows.
After the blocks, the encoder reads out the k latent tokens by flattening them and projecting linearly to the context vector
(for this is just the single token). The whole construction is permutation invariant in the ordering of the sensor embeddings [38]. In our experiments we use latent tokens, heads of width (so ), and blocks, yielding .
4.3 AdaLN-conditioned flow decoder
The decoder receives the context , a state , and the flow time , and outputs the velocity .
The flow time enters through a fixed sinusoidal embedding , whose -th entry is
with geometrically spaced frequencies to and . The context that modulates every block fuses the operator latent with this time embedding through a learned linear projection,
and the state and time embedding are concatenated and lifted to the hidden width D,
We condition the decoder through adaptive layer normalization (AdaLN) [27], letting the context c set the scale and shift of every block's normalization so that the conditioning signal reaches all depths. Each of the blocks modulates its two normalization layers with scale and shift predicted from c,
and applies two such modulations with a residual connection,
where are linear functions of c and act is Mish.
Finally, after blocks the hidden state is normalized and projected to the velocity,
The output weight is initialized to zero so that the velocity field starts near zero at the beginning of training. For interacting particle systems with state , we use the particle variant described in Section 7.3: the decoder reshapes into particle tokens, embeds each token with shared weights, applies AdaLN-conditioned self attention and feedforward blocks across the particle tokens, and projects each token to its velocity . Because the token maps are shared and self attention is permutation equivariant, relabeling the particles relabels the output velocities in the same way.
5 Expressivity of the Lagrangian attention sampler
This section is devoted to the expressivity result. The sampler is intended to learn a map from SDE coefficients to invariant measures. The theoretical question is whether our architecture has sufficient expressive power to approximate this map uniformly over a compact family of coefficient functions. The reduction theorem establishes this result under the stated assumptions via neural operator approximation of a deterministic coefficient-dependent velocity field on compact domains. Appendix A contains the proofs and construction details. The main text records the assumptions, the key lemmas and propositions, the theorem statements, and the proof ideas needed to interpret them.
For with , write
for the diffusion matrix. The generator of the SDE acts on smooth test functions by
The generator depends on only through . As a result, the invariant measure also depends on only through . We keep the pair as the variable because the sampler receives and as its input.
The coefficient space is
We equip this space with the compact-open topology, that is, uniform convergence on compact subsets. A sequence converges to if, on every compact set ,
Choose any compact exhaustion of , and define
The metric
metrizes the compact-open topology on . If in this topology, then uniformly on every compact set, because is uniformly bounded on that set.
In this topology, compactness of a set means that every sequence in has a subsequence converging uniformly on every compact subset of . The Arzela–Ascoli criterion gives the following standard compactness condition.
Proposition 5.1 (Compactness criterion). A closed set is compact if, for each ball , the restrictions of its elements to are uniformly bounded and equicontinuous.
5.1 Invariant measure and the properties
We will focus on the following set of coefficients with parameters . Let be the class of coefficients such that:
- Uniform ellipticity (which requires ).
- Khasminskii condition for polynomial Lyapunov functions. There exists such that
In particular, for , , this condition yields
up to lower order constants absorbed into M.
The following is a standard result of the preceding conditions.
Proposition 5.2 (Stationary measure and moments). If , then the stationary Fokker–Planck equation has a unique probability solution . Moreover, for every , there is a constant , depending only on , such that
Classical sufficient conditions for existence and uniqueness of stationary solutions to the Fokker–Planck equation are given in [3, Theorems 2.4.1 and 4.1.6]. The moment estimate follows from the standard Lyapunov cutoff argument; the details are given in Appendix A.
Remark 5.1. Local Lipschitz conditions on are often imposed for strong well-posedness of the SDE. The present theory is stated at the level of laws and stationary Fokker–Planck equations, so one may instead work with weak solutions and the associated martingale problem. In this setting, it does not require the conditions on the derivatives of a. See also the Stroock-Varadhan uniqueness theorem [33, Theorem 24.1, Chapter V].
Lemma 5.1 (Closedness and stability of admissible coefficients). The set is closed under the compact-open topology. That is, if and locally uniformly, then . Moreover,
The proof of Lemma 5.1 will also be presented in Appendix A.
5.2 An explicit construction of approximating velocity field
We will basically use the smoothed flow matching velocity field to construct an approximating velocity field. First let be the radial projection and define
The polynomial moment bound gives the projection error
Moreover, is continuous.
Next, take and the narrower Gaussian
Fix the target measure with . Draw
independently. Define
Clearly, letting , then
Coupling Y with gives
Let
Then, the smoothed density is
The current is
The velocity is
Lemma 5.2 (Smoothed flow matching velocity). For fixed and , the velocity has uniform path moment bounds: for every ,
It also has the uniform linear growth bound
Moreover, satisfies the continuity equation with this velocity field,
Finally, we take a smooth cutoff such that
For a fixed , define
Lemma 5.3 (Lipschitz continuity of the target velocity). For every fixed , , and , is continuous as a map from to . Moreover,
Let be the terminal law generated by
Lemma 5.4 (Truncation consistency). For every fixed and ,
The proofs of Lemmas 5.2–5.4 are given in Appendix A.1.
5.3 Expressivity of the neural operator approximation
Now, we will consider a compact subset of for some parameters . By Proposition 5.1, a closed set is compact if the following hold: (i) for each ball , the restrictions of on are uniformly bounded; (ii) for each , the restrictions of on are equicontinuous. Lemma 5.1 shows that is closed in . Hence the closure in of any family in that satisfies (i) and (ii) is such a set .
Below, we put the following assumption on the neural operator architecture. We will then discuss how the assumption is satisfied for the architecture we use in the next section.
Assumption 5.1 (Compact domain neural operator approximation). For every compact set K, every fixed envelope constant , every , every continuous operator
with , and every , the following hold.
(a) The model class contains a parameter such that
(b) The selected realizations are locally Lipschitz in the spatial variable (i.e., Lipschitz on compact sets) and satisfy the global linear growth envelope for constant C depending on the chosen parameters such that
Assumption 5.1 is the ordinary compact domain universal approximation property (UAP) for the neural operator. The reduction theorem uses the Lipschitz constant of the target velocity , not the Lipschitz constant of the approximating network. The global linear growth clause is only used to make the exact learned ODE globally well posed and to control the probability that the learned trajectory leaves the compact approximation domain.
Next, one needs the following auxiliary results, whose proofs are given in Appendix A.3.
Proposition 5.3 (ODE stability for a Lipschitz target). Let and generate flows and from the same initial law . Assume is globally Lipschitz in , uniformly in , with constant , and
Then
Proposition 5.4 (Reduction from compact operator approximation to sampling error). Let be a compact set of coefficients for some positive parameters . Fix , , , and . The implemented velocity field is the plain neural operator
Assume is locally Lipschitz in x, and satisfies
and define
If and is the terminal law generated by from , then
The five terms have distinct meanings. The first is the compact domain neural operator approximation error. The second is the escape tail error introduced by using the exact, unprojected learned ODE while only controlling the approximation on . The third is the ODE error caused by truncating the target velocity outside . The fourth is the Gaussian mollification bias, and the fifth is the error from projecting the invariant measure to .
The following then gives the main claim about expressivity of the model, and the proof is provided in Appendix A.3.
Theorem 5.1 (Ordinary UAP implies sampler expressivity). Let be a compact set for some positive parameters . Suppose Assumption 5.1 holds. Then for every there exist , , , and a parameter such that
5.4 Universal approximation property of the Lagrangian attention neural operator
In this subsection, we establish sufficient conditions for the Lagrangian attention neural operator to satisfy the approximation assumption used in the preceding expressivity theorem. The key is that the finite probes must resolve the coefficient family. We show that this holds with high probability under the stated assumptions on the probe distribution.
For the Lagrangian sensors, we do not need the cutoff J as for the grid samplers. We recall that a Lagrangian input is the finite unordered set of probe observations of Section 4,
with the initial probe locations, probe noise, step size, and trajectory length fixed before evaluation. The realized operator is the trajectory CNN encoder, the finite depth Perceiver aggregator Encoder with readout , and the AdaLN-conditioned residual decoder Decoder.
Proposition 5.5 (Finite sensor Lagrangian Perceiver–AdaLN approximation). Let , and fix an envelope constant . Assume:
(a) (Finite Sensor Resolution, FS) Finite probes resolve K: for every there are m, L, fixed probe seeds, and r > 0 such that
where is any distance on finite sensor sets.
(b) (Encoder-decoder Universality, EU) On the compact image , the encoder-decoder architecture class uniformly approximates any continuous map invariant under sensor permutations whose realizations are locally Lipschitz in .
Then the finite sensor encoder-decoder class satisfies Assumption 5.1 (a). If the activation function is globally Lipschitz, then Assumption 5.1 (b) is also satisfied.
The proof is given in Appendix A.3.
We remark that a natural choice is
Any distance that makes compact and metrizes the topology of the sensor set suffices.
Next, we discuss the validity of the conditions used. We first verify that the condition (FS) holds with large probability as summarized in Theorem 5.2. The proof is given in Appendix A.3.
Theorem 5.2. Suppose that the initial points are sampled from some distribution with a continuous density that is positive everywhere. For any , there is such that when , the Lagrangian attention neural operator satisfies the condition (FS) with probability . Consequently, provided the architecture satisfies the ordinary finite dimensional UAP on the compact set with permutation invariance (i.e., the (EU) property), the Lagrangian attention neural operator has the expressivity with probability at least .
Remark 5.2. We remark that the estimate of m in the proof of Theorem 5.2 in Appendix A.3 has curse of dimensionality. The proof in Appendix A.3 is based on the h-net and does not take advantage of the Monte Carlo feature of the method, so it should have overestimated m. The improvement needs a better topology for the coefficient functions that could make use of the Monte Carlo rate. This is left for future study.
Next, let us discuss about universality condition and provide some evidence. Since and are fixed, the sensor set lives in the compact finite dimensional space , so (EU) is an ordinary UAP for continuous functions on a compact set—the only nonstandard requirement is permutation invariance in the sensor index. Three existing results together make (EU) reasonable for the present architecture:
-
Cross attention is a universal approximator. Liu et al. [21] prove that a single-head cross attention layer, preceded by a linear projection, universally approximates any continuous function on a compact domain in . The cross attention block of our encoder fits this setting directly: the learned initial latent plays the role of the query and the sensor array E provides the keys and values.
-
Self attention + FFN is a universal approximator of equivariant maps. Yun et al. [37] prove that a transformer (multihead self attention followed by a positionwise FFN) universally approximates any continuous permutation-equivariant sequence-to-sequence function on a compact domain. The latent self attention and FFN blocks in each encoder layer are exactly this subarchitecture, applied to the fixed length latent array of k tokens.
-
Permutation invariance is preserved by construction. Cross attention is invariant to permutation of the keys and values (the sensor embeddings) because each attention weight is computed by an inner product between a fixed query and each key independently before softmax normalization; permuting the sensors permutes the weights but leaves the weighted sum unchanged. The subsequent self attention operates on the latent array, which has no sensor index, and the linear readout is fixed dimension and sensor-order-independent. Our encoder is structurally identical to the Set Transformer of [16], which was introduced precisely for set aggregation that is invariant under permutations.
A formal proof combining all three stages in a single theorem statement does not yet exist in the literature; we treat (EU) as an assumption, supported by the above components. The decoder, given a fixed z and compact Y, satisfies the standard MLP UAP.
6 Resolution Invariance
This section is about the resolution of the input function. It explains when changing the sensor resolution leaves the realized sampler stable, in expectation over the probe trajectories, for the fixed trained attention architecture. A finite sensor Lagrangian Perceiver–AdaLN approximation statement records sufficient conditions for the compact domain approximation assumption once the probes resolve the coefficient family. The resolution invariance thus allows the model to be trained on data samples with variable resolution, and be applied for different resolution for new unseen cases. For random probes, the probes are sampled in the whole state space according to a prescribed probe law, so the resolution parameter is the number m of probes.
In this subsection, denotes a compact coefficient family. Throughout this subsection the weights are fixed and suppressed from the notation.
For a fixed full space probe recipe, one probe produces a random observation as introduced in Section 4—the visited states together with the drift and diffusion recorded along a short probe path—with CNN embedding and law of the sensor embedding
With independent probes , , the empirical law of the sensor embeddings is
Because the sensor order is irrelevant, we identify the encoded sensor set with its empirical measure.
The encoder reads the sensors only through cross attention, and only through the projected sensor , with the shared projection of Section 4.2. Replacing the sensor rows of Atten by a measure on the embeddings, a head with query is
which at reduces to the Atten head over the sensors.
We now use this measure formulation to write the full encoder recursion. We use to denote the cross attention message and the self attention–MLP update. With token queries , the per-head outputs assembled by give , with rows
Here, represents the transform made by the self attention and the MLP
where is a residual sublayer followed by LayerNorm. The latents are then transformed by the self attention and the MLP through the depth- recursion:
from the learned .
Hence, the encoder is then a functional of the measure
Denote
the encodings for the empirical embedded sensor law, and the population embedded sensor law respectively.
The finite and infinite sensor velocity fields are the decoder pushforwards
The corresponding terminal laws are the random measure (it depends on the specific random realized probes e) and the limit measure corresponding to the continuum probe measure:
and
For each probe realization, these definitions give the following finite sensor map.
Definition 6.1 (Random sensor resolution invariance). The Lagrangian Perceiver sampler is random sensor resolution invariant on K if the population-probe terminal law is defined for each and
where the expectation is over the random probe trajectories.
Remark 6.1. The law is the continuum limit only in the sense that the empirical probe measure has been replaced by the underlying probe law in the same finite depth Perceiver architecture; the probe recipe itself is fixed.
We now state the two structural assumptions. Both are mild and realized by the architecture; the quantitative bounds the proof uses—boundedness and Lipschitz continuity of the attention weights, a strictly positive denominator, compact reachable latents, and a Lipschitz decoder—are then consequences (Lemma 6.1), not separate hypotheses.
Assumption 6.1 (Compact sensor embeddings and a regular decoder). The following hold uniformly over :
(A1) Compact embedding support. There is a fixed compact set with for every .
(A2) Decoder state regularity. There is , and for every an , such that for all , every reachable latent , all and ,
Let us make some discussions on the assumptions above. Regarding (A1), the per-sensor embedding of Section 4 pools the final convolutional block, with . The LayerNorm normalizes each row to Euclidean norm and applies its fixed affine map, so its output rows are bounded by some ; since , every , and averaging gives . Hence , a fixed compact set independent of the probe.
Regarding (A2), in the decoder of Section 4, enters only through ; the AdaLN blocks and the output map compose the affine maps , the activation Mish , and -LayerNorms , with the scales applied multiplicatively. Each block is thus Lipschitz in its input with constant
so has Lipschitz constant at most the product of , these block constants, and \|W_v\|_L_{\text{LN}}. As are linear and ranges over the compact image of , the scales are bounded there, so that product is a finite uniform over , giving (A2) with and .
Lemma 6.1 (Consequences of compactness). Under (A1) and the fixed smooth encoder of Section 4.2, whose blocks end in -regularized LayerNorm. Then, the following hold.
(i) there are constants and such that
and ; consequently for every probability measure on , in particular for both and ;
(ii) there is such that
(iii) There are two compact sets , such that every reachable latent array lies in and every query in ; consequently, the self attention–MLP update is Lipschitz on the reachable compact set, with constants ;
(iv) for every the decoder is Lipschitz in on : there is with
These bounds yield the following uniform law of large numbers (ULLN). Both proofs are in Appendix A.4.
Lemma 6.2 (ULLN for the attention class). Over the finitely many layers, heads, and value coordinates, set
a uniformly bounded family of functions on , and
Under Assumption 6.1, with i.i.d. from and , .
Remark 6.2. The limit needs only total boundedness of . A rate is available but is not used below: by Lemma 6.1(ii) the map is Lipschitz from the compact into , so has finite metric entropy , and the standard Dudley/symmetrization bound then gives with independent of (the class and its envelope are distribution independent).
Finally, we obtain the following resolution invariance result for the random sensor attention sampler. The proof is given in Appendix A.4.
Theorem 6.1. Under Assumption 6.1, the population-probe terminal law is defined for each , and
so the Lagrangian Perceiver sampler is random sensor resolution invariant on K in expectation over the probes.
We would like to point out that the limit is the population-probe law of the same Perceiver with fixed weights, not the target invariant measure .
7 Numerical Experiments
We perform numerical tests to validate our framework. The necessary setup and results needed to support our conclusions are given here while leave other details (data generation, architecture, training, software etc) are in Appendix B.
To compare generated and reference samples, we use the Sinkhorn divergence, a bias-corrected, entropy-regularized approximation to quadratic optimal transport [10]. For their empirical probability measures and , define
(7.1)
Here KL denotes relative entropy, and controls the amount of smoothing. is the Sinkhorn divergence. The self-comparison terms remove the entropic bias and give . converges to as . We set in the experiments, and report without a square root, so the Sinkhorn and columns have different scales. Lower values indicate closer agreement. Sinkhorn divergence is easier to compute and more stable than in high-dimensional spaces.
7.1 1D Variable Noise and 1D Rare Event
We first test the amortized neural sampler in 1D Variable Noise and 1D Rare Event, using the simple grid Multi-input DeepONet described at the beginning of Section 4. These experiments show that operator learning of invariant measures is feasible, and locate the regime—slow mixing—where it gains an advantage over MCMC. Both experiments are trained on 65,536 function instances and evaluated on 1,024 test functions, reporting the Sinkhorn divergence and the 2-Wasserstein distance against ground truth; the evaluation protocol and the shared architecture and training configuration are given in Appendix B.1 (Table B.1).
7.1.1 1D Variable Noise
This 1D Variable Noise example serves as a sanity check in a benign, fast mixing regime. MCMC performs well here. The experiment verifies that the amortized operator sampler produces reasonable samples across a large family of SDEs and establishes a baseline for comparison with the harder rare event setting that follows. We set and , where is a fixed confining well and the lower bound on ensures uniform ellipticity. The perturbations (functions of ) are independent draws from a Gaussian random field with squared exponential kernel (length scale 1, variance 1).
Table 7.1: 1D Variable Noise. Distribution metrics on 1,024 test functions (mean / median).
| Sinkhorn | Time (s) | ||
|---|---|---|---|
| Ours | 0.018 / 0.002 | 0.204 / 0.125 | 19.0 |
| MCMC | 0.001 / 0.0002 | 0.083 / 0.040 | 8.6 |
Table 7.1 reports the results, together with an MCMC baseline run on the same test functions under the same per-function sample budget. In this easy mixing regime, MCMC produces accurate samples efficiently, and our model is less accurate though comparable in speed. The representative samples in Figure 7.1 show that it nevertheless reproduces the target laws across the family, although it systematically underestimates the variance of the invariant measure and the Kolmogorov–Smirnov test rejects for most test functions. This gap is expected: an amortized model that generalizes across the entire function family in a single forward pass trades per-distribution accuracy for breadth.
7.1.2 1D Rare Event
1D Rare Event targets the regime where amortized operator sampling provides its primary advantage: SDEs with small diffusion coefficients whose invariant measures are multimodal. MCMC methods must traverse high free energy barriers between modes, leading to mixing times that scale exponentially in . Our neural sampler bypasses this bottleneck entirely. Its inference cost is independent of the mixing time.
We consider 1D SDEs whose invariant measure is a prescribed mixture of three Gaussians:
where , , , and . The diffusion coefficient is a small random perturbation of the constant 0.1, and the drift is constructed from the zero flux condition of the stationary Fokker–Planck equation, so that is by design the invariant density of the resulting SDE; the explicit construction is given in Appendix B.1. Because the target density is known, training samples are drawn directly from the GMM, making the experiment a controlled test of the model's representational capacity and generalization in a rare event regime. The model reuses the architecture and hyperparameters of 1D Variable Noise.

Figure 7.1: 1D Variable Noise. Representative samples on test functions at the 25th, 50th, and 75th percentile Sinkhorn divergence. Each row shows one test function: reference histogram, MCMC histogram, model histogram, and CDF overlay.
Table 7.2 compares the model with MCMC baselines at varying time budgets, including a converged baseline and three baselines that limit the per-function MCMC budget. The model attains a lower mean Sinkhorn divergence than even the converged MCMC baseline while using less elapsed time, and its median is comparable to the converged MCMC median with far fewer large failures: the error distributions are heavily skewed to the right (Figure B.2 in Appendix B.1). The gap in means is driven by MCMC's tendency to become trapped in a single mode when noise is small, occasionally producing accurate samples (when all modes happen to be found) but often yielding very poor ones; representative failure cases are shown in Figure 7.2. Figure 7.3 shows the Sinkhorn divergence as a function of elapsed time; our method (star) dominates the MCMC Pareto frontier.
Table 7.2: 1D Rare Event. Sinkhorn divergence and on 1,024 test functions (mean / median).
| Method | Sinkhorn | Time (s) | |
|---|---|---|---|
| Ours | |||
| MCMC (6 s) | |||
| MCMC (12 s) | |||
| MCMC (25 s) | |||
| MCMC (conv.) |

Figure 7.2: 1D Rare Event. Representative samples on test functions chosen to illustrate MCMC failures caused by mode trapping. Each row shows one test function: reference histogram, MCMC histogram, model histogram, and CDF overlay.
Accuracy vs. Compute

Figure 7.3: 1D Rare Event. Mean Sinkhorn divergence vs. elapsed time. Star: operator model. Circles: MCMC at increasing time budgets.
7.2 2D Constant Noise
This experiment compares grid DeepONet and Lagrangian sensor models for sampling invariant measures in 2D.
We consider amortized sampling from the invariant measures of the 2D SDE
with constant isotropic diffusion. The drift is generated as , where is a Gaussian random field sampled on a grid over (RBF kernel with length scale sampled from Unif(0.3, 2.0)), and is a radial confining well that pushes particles back toward the origin outside radius 2 with strength 10.
Table 7.3 compares three parts of the sampler. The representation determines which drift observations the encoder receives. Grid DeepONet [14] reads the full drift grid. Point probes retain the first observation of each trajectory. Endpoint probes retain the first and last observations and their difference. These two encoders use MLPs, while the trajectory encoder applies a CNN to all observations.
The aggregator combines sensor embeddings into the context z. MeanPool averages the embeddings before an MLP. DeepSets [38] applies a shared MLP to each embedding, sums the outputs, and applies another MLP. Perceiver [13] uses cross attention between learned latent tokens and sensor embeddings, as described in Section 4.2.
Conditioning determines how the decoder uses the context. FiLM (feature-wise linear modulation) [28] uses the context to predict a scale and shift for each hidden feature. Our FiLM and AdaLN (adaptive layer normalization) [27] variants both apply these changes after layer normalization. Our AdaLN variant also uses the context to scale each residual update. Additional variants and training details are in Appendix B.2.
It turns out that the trajectory + Perceiver + AdaLN architecture is a practical choice with competitive accuracy. In the meanwhile, this architecture supports fixed or mixed counts in training and different counts at inference without retraining.
7.3 64D Interacting Particle
64D Interacting Particle is a proof of concept for sampling that depends on input in an SDE in high dimensions that does not use a grid. The central question is whether the learned sampler uses observations of an unknown pair interaction law to generate physically structured samples in a 64-dimensional particle system, beyond matching the one body scale imposed by the confining potential.
Table 7.3: 2D Constant Noise. Mean Sinkhorn divergence on 100 test drift fields, using 4,096 samples per distribution per field, after training on 65,536 fields. Probe models use 256 sensors, with trajectory + Perceiver + AdaLN as the shared baseline. Time: total training time under shared optimization settings.
| Component | Variant | Mean Sinkhorn | Train (s) |
|---|---|---|---|
| Representation | Grid DeepONet | 0.0209 | 40.3 |
| Point + Perceiver + AdaLN | 0.0415 | 87.8 | |
| Endpoint + Perceiver + AdaLN | 0.0324 | 82.8 | |
| Trajectory + Perceiver + AdaLN | 0.0180 | 252.0 | |
| Aggregator | Trajectory + MeanPool + AdaLN | 0.0370 | 226.2 |
| Trajectory + DeepSets + AdaLN | 0.0246 | 238.4 | |
| Conditioning | Trajectory + Perceiver + FiLM | 0.0169 | 258.9 |
Table 7.4: 2D Constant Noise. Sensor resolution transfer for the trajectory + Perceiver + AdaLN backbone after training on 65,536 functions. Rows denote the training sensor regime and columns denote the evaluation sensor count. The mixed row alternates homogeneous batches from the 512-, 1024-, and 2048-sensor trajectory views. Each probe executes a 20-step random walk with step size 0.05. Lower Sinkhorn is better.
| Train regime | Eval 512 | Eval 1024 | Eval 2048 |
|---|---|---|---|
| Fixed 512 | 0.0284 | 0.0172 | 0.0131 |
| Fixed 1024 | 0.0287 | 0.0175 | 0.0125 |
| Fixed 2048 | 0.0312 | 0.0184 | 0.0131 |
| Mixed 512/1024/2048 | 0.0271 | 0.0177 | 0.0125 |
We evaluate the framework on amortized sampling for interacting particles in 2D () under overdamped Langevin dynamics
targeting the Boltzmann distribution . The potential is
with a fixed harmonic trap () and inverse temperature (). Across problem instances, the interaction kernel varies; the one body term remains fixed.
We draw from four qualitatively distinct kernel families—Morse (bondlike attraction with a repulsive core), Gaussian (soft repulsion or attraction), double Gaussian (short range repulsion with long range attraction, creating a preferred interparticle spacing), and WCA (hard sphere exclusion). All kernels are nonsingular; their functional forms and the energy capping convention are given in Table B.3 in Appendix B.3.
Because acts on pairwise distances, full system probes mix many interactions at once. The sensor design therefore uses pair probe sensors: isolated trajectories of particle pairs that record the relative displacement and interaction force along short rollouts. The resulting observation tensor is a fingerprint of the interaction kernel that does not require an Eulerian grid in . The model combines a 1D CNN sensor encoder, a Perceiver aggregator with four latent tokens, and an equivariant particle flow network conditioned by AdaLN; it has 1.78M parameters and is trained by conditional flow matching on 2,048 kernels, with metrics reported on 100 test kernels (sensor, data generation, and training details in Appendix B.3).
The state is invariant under permutations of the indistinguishable particles. We therefore evaluate the generated distributions using physical summaries invariant under particle permutations: pair correlation functions, energy distributions, center of mass and radius of gyration statistics, pair distance summaries, and nearest neighbor summaries. Raw coordinate space Sinkhorn divergence is reported only as a secondary diagnostic. In 64 dimensions it can be misleading because the fixed harmonic trap makes a pooled Gaussian baseline competitive in coordinate cost even though it contains no interaction structure.
Table 7.5 presents the quantitative evidence that our model has real prediction power over null. When the input is the correct sensors, the generated samples' distribution is far more closer to the ground truth then shuffled sensors input. And the generated sample also outperforms the pooled Gaussian (fitted to the target coordinate mean and variance), and standard Gaussian samples.
Table 7.5: 64D Interacting Particle. Conditioning diagnostic on 100 test interaction kernels. The score is sliced 2-Wasserstein on standardized physical features invariant under permutations. Lower is better.
| Method | Mean | Median | Comparison |
|---|---|---|---|
| Correct sensors | 1.7860 | 1.0159 | Model conditioned on the true kernel |
| Shuffled sensors | 30.1422 | 15.9140 | Correct wins 99/100 |
| Pooled Gaussian | 23.1144 | 13.9604 | Correct wins 99/100 |
| Random normal | 20.0154 | 12.3747 | Correct wins 98/100 |
We can also observe that the generated samples reproduce the pair distance patterns within each family. The energy distribution, pooled across all test kernels, also has a similar shape to the target distribution. More quantitative results are collected in Table B.4 in Appendix B.3. Figure 7.4 plots the empirical pair correlation function broken down by kernel family, and Figure 7.5 compares energy histograms.

Figure 7.4: 64D Interacting Particle. Pair correlation function by kernel family: target (blue) vs. generated (dashed orange). Each subplot pools test kernels of one family. The curves are empirical histograms without additional smoothing.

Figure 7.5: 64D Interacting Particle. Energy histogram comparison: target (blue) vs. generated (orange).
Taken together, the random Lagrangian sensor architecture shows the potential to func-tion as an amortized sampler of parametric families of high-dimensional SDEs.
8 Conclusion
We present an amortized neural sampler that combines operator learning with continuous normalizing flows to sample from the invariant measures of parametric families of SDEs. The framework encodes SDE coefficients into a latent representation, then conditions a continuous normalizing flow that transports a Gaussian distribution to a target distribution. In practice, we adopt flow matching to train the model. Unlike the established DeepONet, our architecture ingests random Lagrangian trajectory sensors and uses an attention mechanism, which avoids grid discretization in spaces of high dimension. On the theory side, we establish a reduction theorem showing that the UAP of a neural operator implies the expressivity of a neural operator sampler. Thus, given a sufficiently powerful neural operator, our framework can fit the map from SDE coefficients to velocity fields that generate the invariant measures. We also prove that our framework is resolution invariant: the sampler remains consistent as the sensor count tends to infinity.
The 1D Variable Noise and 1D Rare Event experiments show the expected regime dependence: MCMC remains stronger in settings with easy, fast mixing; the amortized sampler becomes useful once slow mixing dominates the compute budget. In 2D Constant Noise, the model with random Lagrangian sensors materially outperforms DeepONet. In 64D Interacting Particle, the sampler demonstrates its capability in high dimensions.
Several directions remain open. First, the supervised results rely on access to training samples from target invariant measures, which may require substantial offline simulation effort, and the amortized approach is most useful when many related SDE instances must be solved and mixing is slow. Data preparation, unsupervised training, and training without samples need further investigation. Second, the current framework targets the invariant measure, and a natural extension is to learn the full law that depends on time, or the weak solution of the SDE. Lastly, our experiments in higher dimensions are only a proof of concept. The network structure and training procedure have not been extensively optimized. Scaling to larger particle counts and configuration spaces of higher dimension remains an important challenge.
A Proofs of Main Results
A.1 Stationary Fokker-Planck measures and stability
Proof of Proposition 5.2. Fix , write , and let be the corresponding stationary measure. Existence and uniqueness follow by the standard result as commented in the text below the statement. Here, we only show how the moment bound follows by the Lyapunov condition.
For the moment bound, let , . For , the standard calculation gives
where are independent of . The nonsmooth point at is handled either by smoothing near the origin or by applying the following cutoff argument to and then letting .
Let be increasing, concave, and bounded, with
and with , on compact intervals. Then
Integrating against , using stationarity, and then applying monotone convergence gives
uniformly over , which proves the claim.
Proof of Lemma 5.1. Let and locally uniformly. Write and . On every compact set, and uniformly, as noted in Section 5. The two conditions that define are closed conditions on the values at each fixed . Hence they pass to the limit, and . This proves closedness.
Write and . By the Lyapunov condition, is uniformly bounded. This gives tightness. Take an arbitrary subsequence of . By Prokhorov's theorem it has a further subsequence, not relabeled, such that weakly for some probability measure .
Let . Since is invariant,
On the compact support of , and uniformly. Therefore
uniformly. Taking the limit , one then has
By the density argument, this can be extended to test functions. Hence, is a invariant probability measure for the limiting SDE. The invariant measure is unique, so . Since every subsequence has a further subsequence converging weakly to , the full sequence satisfies .
By the uniform p-moments, one has the uniform integrability of second moments, or
Then, this together with the weak convergence implies that . Hence , proving continuity of .
A.2 Proofs for the canonical target velocity
We use the notation , and introduced in Section 5.
Proof of Lemma 5.2. First record the uniform moment input. Since . Let . One has
Hence, one has by the uniform control of . By the conditional expectation formula and Jensen's inequality:
where the last bound follows from the exponential moment bound for D.
It remains to justify the pointwise linear growth estimate. Since is Gaussian with mean
one finds by the boundedness that
Lastly, differentiating the Gaussian kernel in t, one has
Integrating this identity against , justified by dominated convergence using the Gaussian kernel and the moment bounds above, gives the continuity equation.
Proof of Lemma 5.3. We have shown that if , then in . Write and . These measures are all supported in . Note that are obtained by integrating and their z-derivatives with respect to . These kernels are continuous in , while is a Gaussian and is finitely supported. Hence they are dominated by an integrable function of , uniformly over and . Weak convergence of gives pointwise convergence of the corresponding integrals. Uniform continuity of the kernels on
plus the uniformly small Gaussian x-tail outside upgrades this to uniform convergence on .
There is also a uniform positive lower bound for . Indeed, for , , , and ,
Therefore
uniformly in , z, and t. The quotient formula
therefore gives uniform convergence of the velocities and their first z-derivatives on the compact cylinder.
Recall that for . Multiplication by the fixed smooth cutoff preserves continuity in . It also yields a global Lipschitz bound: on the derivative of is uniformly bounded, while outside the field is identically zero. Hence .
Proof of Lemma 5.4. Let solve the untruncated ODE
and let solve the truncated ODE
The untruncated terminal law is , and the truncated terminal law is .
Define
On , . If , then either or
Since has law , the velocity moment bound gives
Markov's inequality and the moments of therefore give
for every p > 2.
Moreover, the linear growth bound and Gronwall's inequality give uniform p-moment bounds for and . Using the coupling with a common initial point,
This gives the claim.
A.3 Reduction and neural approximation
Proof of Proposition 5.3. Couple the two flows by the same initial point :
Let . Then, one has
implying that almost surely. The joint law of is a coupling of the two terminal distributions, so
Proof of Proposition 5.4. Fix . Let solve the target truncated ODE
and let solve the exact learned ODE
Put . By assumption, . Define
On , the learned path remains in , where the compact domain approximation bound applies. The same Grönwall estimate as in Proposition 5.3, stopped at , gives
If , then , and hence . Therefore
The target field satisfies , and the learned field satisfies the assumed global envelope. Grönwall's inequality and Gaussian moments of give the uniform path moment bounds
Hence , and Hölder's inequality gives
On , the stopped estimate gives . Thus
The triangle inequality, the truncation definition, the smoothing coupling, and the projection estimate give
Taking the supremum over proves the theorem.
Proof of Theorem 5.1. Fix and . Choose so large that
Choose so that . For this , choose so large that
For the fixed triple , Lemma 5.3 shows that is continuous on . The operator is continuous from to . It also satisfies . Apply Assumption 5.1 with , and choose such that
Proposition 5.4 gives
Proof of Proposition 5.5. Let be a continuous target operator as in Assumption 5.1, with . Fix .
By compactness of , choose such that implies . Apply (FS) with this and write ; the image is compact. Cover it by finitely many balls , , and take a continuous partition of unity subordinate to the enlarged balls . Define
If , then , so (FS) gives ; hence
The map is continuous on and invariant under permutations of the sensor argument. By (EU), the finite sensor Perceiver–AdaLN network approximates it within , uniformly over and . Combining the two estimates gives
the compact domain approximation part of Assumption 5.1. The final statement follows by adding the global linear growth clause; local Lipschitzness is already part of (EU).
Proof of Theorem 5.2. First we note that for general , one clearly has
where means that we only keep the first point in each trajectory and the corresponding values of a. Then,
where 's are sampled i.i.d from dx. Hence,
Hence, it suffices to show with probability such that
We first take a radius J so large that the tail of the metric is smaller than the prescribed tolerance. On the compact ball , the family K is uniformly equicontinuous. Therefore a sufficiently fine spacing h gives that, if every point in has some sample point with distance at most h, then
Hence, it suffices to show with probability that forms a h-net of .
We take balls with radius that cover . The number of such balls can be chosen as . If each ball contains at least one , then forms a -net of . For each ball , the probability that it is empty is bounded by
where
Taking union bound, the probability that there is one empty ball is controlled by
For , one needs
This shows the first claim.
The remaining claims are straightforward.
A.4 Resolution invariance proofs
We use the notation of Section 6 for the attention maps , , the self attention–MLP update , and the encoder Encoder. The finite and infinite sensor encodings are and .
Proof of Lemma 6.1. Write , compact. Each , is on , so
are finite, with since ; this gives (i) and (ii), and integrating the lower bound gives for every probability on .
For (iii), the -regularized LayerNorm normalizes each row to Euclidean norm before its fixed affine map, so its output rows are bounded, , and it is Lipschitz, Lip(LN) (the variance is ). Each and each message addition step ends in a LayerNorm, so with fixed the recursion (6.2) keeps every latent row at norm ; hence
are compact and contain all reachable latents and queries. The query map is linear, , and composes -LayerNorms, self attention, and the MLP, Lipschitz on with . For (iv), Decoder is , so
Proof of Lemma 6.2. By Lemma 6.1(ii), and are Lipschitz from into ; as is compact and there are finitely many , is a finite union of Lipschitz images of compact sets, hence totally bounded in , with envelope .
Fix and a finite -net . For every ,
Since is the empirical law of independent samples from and , each term satisfies
so the maximum over the finite net is bounded by .
Hence , and as is arbitrary, .
Proof of Theorem 6.1. Note that for the resolution invariance, the parameters and architecture are fixed. We are increasing the number of probes (i.e., m) so that only the measure involved are varying.
Step 1: estimate for the encoder Let
with . We now derive the induction formula for .
For any , we recall that
By Lemma 6.1,
where the bounds are uniform in . Introducing , one then has
Hence, the change of measure will bring in error as follows
Together with Lemma 6.1 (ii), one has the total error brought by the change of q and change of measure:
with and .
Since
one has by (A.1) and the mean uniform law of large numbers in Lemma 6.2 that
Recall (6.2), using the Lipschitz bounds for one has,
The depth is fixed, so one easily derive by induction that
Step 2: estimate for the encoder and the terminal law Fix a localization radius R to be determined. The decoder Lipschitz condition (Lemma 6.1) on compact x-cylinders gives
Since the finite and infinite sensor flows start from the same , one has for fixed a and e that
Let be the first time either path exits . On both paths stay in , so Grönwall and the local -Lipschitz bound in (A2) give the pathwise estimate
The linear growth in (A2) easily gives, for any fixed ,
uniformly in and and for both and . Hence, for any and , , and thus
Combining the results above, one has
Fixing and letting , Lemma 6.2 gives ; letting then proves random sensor resolution invariance in expectation.
B Experimental Details
We compute Sinkhorn divergence with GeomLoss: selects quadratic cost, and sets .
All experiments are run on a single NVIDIA RTX 5090 GPU (32 GB) with an AMD EPYC 9575F CPU (128 cores), using Python 3.14, PyTorch 2.10, and CUDA 12.8. Elapsed times include all overhead (data loading, compilation, I/O). The RTX 5090 and the EPYC 9575F have comparable list prices (2,200 respectively). The runtime comparisons between GPU neural sampling and CPU MCMC use hardware of equivalent cost.
B.1 1D experiments
The two 1D experiments share the Multi-input DeepONet architecture of Section 4: latent dimension , base channels 32 in the branch CNN, a trunk MLP of depth 4 and width 256 with GELU activations, and a sinusoidal time embedding of dimension 32. Training uses conditional flow matching with minibatch optimal transport coupling of the source–target pairs [20]. Table B.1 summarizes the data generation and optimization settings of the two experiments side by side.
Table B.1: Configuration of the two 1D experiments.
| 1D Variable Noise | 1D Rare Event | |
|---|---|---|
| Function instances | 65,536 | 65,536 |
| Train / test split | 64,512 / 1,024 | 64,512 / 1,024 |
| Grid resolution over [-5, 5] | 64 | 256 |
| Reference samples per function | 4,096 | 4,096 |
| Reference generation | Euler-Maruyama | direct GMM draws |
| time step | 0.01 | — |
| equilibration time | 50 | — |
| collection interval | 0.1 | — |
| Epochs (gradient steps) | 1 (32,256) | 1 (32,256) |
| Optimizer (lr, weight decay) | AdamW (, ), OneCycleLR | |
| Batch size / samples per function | 256 / 32 | |
| Gradient clipping / precision | 1.0 / bfloat16 mixed | |
| Training time | 263.1 s | 296.5 s |
In 1D Variable Noise, the GRF perturbations are sampled on the uniform grid via the FFT, and the reference Euler-Maruyama simulation runs on the linearly interpolated drift and diffusion. The MCMC baseline in Table 7.1 runs Euler-Maruyama with the same on the 1,024 test functions, collecting 4,096 samples each. Figure B.1 shows the training loss curve.
In 1D Rare Event, the diffusion coefficient is a small random perturbation of a constant,
and the drift follows from the zero flux condition of the stationary Fokker–Planck equation , which yields
Because the target density is a known Gaussian mixture, training samples are drawn directly from the GMM; this makes the experiment a controlled test of the model's representational capacity and generalization in a rare event regime, and complete sample generation from the SDE is left for the other experiments. The MCMC baselines in Table 7.2 run Euler–Maruyama with on the linearly interpolated drift and diffusion for each of the 1,024 test functions, collecting 4,096 samples: the converged baseline uses steps per function (elapsed time 136.9 s), and three baselines with controlled runtimes limit the MCMC budget per function.
For inference we compared RK4 with 4 and 16 integration steps against the adaptive dopri5 solver. RK4 with only 4 steps yields Sinkhorn = 0.131 in 1.4s (1,024 functions), matching dopri5 (Sinkhorn = 0.130, 7.4s) at lower cost; RK4-4 is therefore the default solver in all 1D experiments. Figure B.2 shows the distribution of Sinkhorn divergence across test functions for 1D Rare Event: the model's error distribution is concentrated near zero, while MCMC exhibits a heavy right tail caused by failures from mode collapse.

Figure B.1: 1D Variable Noise. Training loss.

Figure B.2: 1D Rare Event. Distribution of Sinkhorn divergence across 1,024 test functions: operator model vs. MCMC (converged). Left: histogram clipped at the 95th percentile; right: box plot on log scale.
B.2 2D Constant Noise
We generate 65,536 drift fields for training and 4,096 additional drift fields for evaluation. For each drift field, reference stationary samples are obtained by Euler–Maruyama with dt = 0.01 and an equilibration period of 20 time units (2,000 steps), after which 4,096 samples are collected per function. All reported metrics are Sinkhorn divergences between 4,096 generated and 4,096 reference samples, computed on 100 test drift fields drawn from the evaluation split.
Probe data contain 20 steps with 8 features per step. Point and endpoint models use MLP encoders, and trajectory models use a 1D CNN. All use latent width 128 and a residual flow decoder trained with conditional flow matching and minibatch OT coupling. Each variant is trained for one epoch over the 65,536-function training split (8,192 optimizer steps at batch size 512) using OneCycleLR with peak learning rate , weight decay , gradient clipping 1.0, torch.compile, and bfloat16 mixed precision.
In Table B.2, Concat appends the context to the hidden features at each decoder block. Dot uses context-dependent weights to multiply the hidden features, following the branch-trunk product in DeepONet [22]. The sensor budget variants change the training count and retain 256 evaluation sensors.
Table B.2: 2D Constant Noise. Additional variants trained on 65,536 fields and evaluated on 100 test fields with 4,096 generated and reference samples each. All use trajectory probes, Perceiver, and 256 evaluation sensors.
| Conditioning | Train sensors | Mean Sinkhorn | Train (s) |
|---|---|---|---|
| Dot | 256 | 0.0203 | 248.6 |
| Concat | 256 | 0.0189 | 253.9 |
| AdaLN | 64 | 0.0180 | 180.1 |
| AdaLN | 128 | 0.0187 | 303.4 |
In the sensor resolution transfer study (Table 7.4), each probe executes a 20-step random walk with step size 0.05. For the 2048-sensor and mixed count rows we keep the effective optimizer batch fixed at 512 by using microbatch 256 with gradient accumulation over two steps; the rows with high resolution fit on a single GPU without changing the optimization budget. Figure B.3 shows qualitative comparisons of target and generated samples for representative test drift fields.

Figure B.3: 2D Constant Noise. Qualitative comparison of target (ground truth) and generated samples for representative test drift fields.
B.3 64D Interacting Particle
Table B.3 lists the four interaction kernel families. All kernels are nonsingular. For Morse and WCA, we cap the energy at to avoid numerical instabilities during MCMC equilibration; at , the corresponding Boltzmann weight is already .
Table B.3: Interaction kernel families for 64D Interacting Particle.
| Family | Form | Character |
|---|---|---|
| Morse | bondlike attraction with repulsive core | |
| Gaussian | soft repulsion () or attraction () | |
| Double Gaussian | short range repulsion + long range attraction | preferred interparticle spacing |
| WCA | truncated and shifted Lennard-Jones with softening | hard sphere exclusion |
The sensor set for pair probes consists of 512 isolated trajectories of particle pairs per kernel. Each probe starts at a random separation , is evolved for 20 short steps (), and records the relative displacement and interaction force, giving a sensor tensor of shape (512, 20, 4) per kernel. Reference samples are generated by Euler-Maruyama with , 16 chains per system, an equilibration period of steps, and 4,096 retained samples per kernel. The training set contains 2,048 kernels and the evaluation set contains 512 test kernels; we report metrics on 100 test kernels.
The architecture is the ParticleAmortizedSampler of Section 4: a 1D CNN sensor encoder, a Perceiver aggregator with four latent tokens, and an equivariant particle flow network conditioned by AdaLN. The model has 1.78M parameters and is trained for one epoch (2,048 optimizer steps) by conditional flow matching with learning rate , so the product of learning rate and step count is order one. On a local RTX 5090 system, the full data generation, training, evaluation, and plotting pipeline completes in roughly 40 minutes; dataset generation dominates the cost.
As a scale reference for the conditioning diagnostic in Table 7.5, comparing two independent halves of the MCMC target sample under the same sliced 2-Wasserstein score gives a noise floor from the target split of 0.2038 (mean) and 0.1071 (median); the correctly conditioned sampler (1.7860 / 1.0159) thus remains above the finite sample floor of the metric. We attribute this gap primarily to the behavior of sliced 2-Wasserstein on finite samples in 64 dimensions rather than to a correspondingly large sampling error; the pair distance distributions in Figure 7.4 give the more direct evidence that the sampler conditions on the interaction kernel.
Table B.4 reports the observable checks invariant under permutations that are summarized in Section 7.3.
Table B.4: 64D Interacting Particle. Observable checks invariant under permutations, evaluated on 100 test kernels with 4,096 samples per kernel.
| Metric | Value |
|---|---|
| Pair correlation error | 0.6865 |
| Mean marginal KL | |
| Energy KS statistic | 0.1585 |
| Energy mean: model / target (, rel.) | 614.40 / 638.76 (-24.36, -3.8%) |
| Energy std: model / target (, rel.) | 1472.60 / 1504.73 (-32.13, -2.1%) |
References
[1] Michael S. Albergo, Nicholas M. Boffi, and Eric Vanden-Eijnden. Stochastic interpolants: A unifying framework for flows and diffusions. Journal of Machine Learning Research, 26(209):1–80, 2025.
[2] Jean-David Benamou and Yann Brenier. A computational fluid mechanics solution to the monge-kantorovich mass transfer problem. Numerische Mathematik, 84(3):375–393, 2000.
[3] Vladimir I Bogachev, Nicolai V Krylov, Michael Röckner, and Stanislav V Shaposhnikov. Fokker–Planck–Kolmogorov Equations, volume 207. American Mathematical Society, 2022.
[4] Yann Brenier. Polar factorization and monotone rearrangement of vector-valued functions. Communications on Pure and Applied Mathematics, 44(4):375–417, 1991.
[5] Zhiqiang Cai, Yu Cao, Yuanfei Huang, and Xiang Zhou. Weak generative sampler to efficiently sample invariant distribution of stochastic differential equation. SIAM Journal on Scientific Computing, 48(4):C708–C735, 2026. First posted as arXiv:2405.19256 in 2024.
[6] Edoardo Calvello, Nikola B. Kovachki, Matthew E. Levine, and Andrew M. Stuart. Continuum attention for neural operators. arXiv preprint arXiv:2406.06486, 2024.
[7] Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, volume 31, 2018.
[8] Naoufal El Bekri, Lucas Drumetz, and Franck Vermet. Flowkac: An efficient neural fokker-planck solver using temporal normalizing flows and the feynman-kac formula. Transactions on Machine Learning Research, 2025.
[9] Xue Feng, Li Wang, Deanna Needell, and Rongjie Lai. Learn to evolve: Self-supervised neural JKO operator for wasserstein gradient flow. arXiv preprint arXiv:2601.05583, 2026.
[10] Jean Feydy, Thibault Séjourné, François-Xavier Vialard, Shun-ichi Amari, Alain Trouvé, and Gabriel Peyré. Interpolating between optimal transport and MMD using Sinkhorn divergences. In Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, volume 89 of Proceedings of Machine Learning Research, pages 2681–2690. PMLR, 2019.
[11] W. Keith Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97–109, 1970.
[12] Han Huang and Rongjie Lai. Unsupervised solution operator learning for mean-field games. Journal of Computational Physics, 537:114057, 2025.
[13] Andrew Jaegle, Felix Gimeno, Andrew Brock, Andrew Zisserman, Oriol Vinyals, and Joao Carreira. Perceiver: General perception with iterative attention. In Proceedings of the 38th International Conference on Machine Learning, volume 139, pages 4651–4664. PMLR, 2021.
[14] Pengzhan Jin, Shuai Meng, and Lu Lu. MIONet: Learning multiple-input operators via tensor product. SIAM Journal on Scientific Computing, 44(6):A3490–A3514, 2022. Publisher: Society for Industrial and Applied Mathematics.
[15] Nikola Kovachki, Zongyi Li, Burigede Liu, Kamyar Azizzadenesheli, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Neural operator: Learning maps between function spaces with applications to PDEs. Journal of Machine Learning Research, 24(89):1–97, 2023.
[16] Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R. Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In Proceedings of the 36th International Conference on Machine Learning, pages 3744–3753. PMLR, 2019.
[17] Ben Leimkuhler and Charles Matthews. Molecular Dynamics: With Deterministic and Stochastic Numerical Methods, volume 39 of Interdisciplinary Applied Mathematics. Springer, Cham, 2015.
[18] Zongyi Li, Nikola Borislavov Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. In International Conference on Learning Representations, 2021.
[19] Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In International Conference on Learning Representations, 2023.
[20] Yaron Lipman, Marton Havasi, Peter Holderrieth, Neta Shaul, Matt Le, Brian Karrer, Ricky T. Q. Chen, David Lopez-Paz, Heli Ben-Hamu, and Itai Gat. Flow matching guide and code, 2024.
[21] Hude Liu, Jerry Yao-Chieh Hu, Zhao Song, and Han Liu. Attention mechanism, max-affine partition, and universal approximation. arXiv preprint arXiv:2504.19901, 2025.
[22] Lu Lu, Pengzhan Jin, and George Em Karniadakis. DeepONet: Learning nonlinear operators for identifying differential equations based on the universal approximation theorem of operators. Nature Machine Intelligence, 3(3):218–229, 2021.
[23] Jonathan C. Mattingly, Andrew M. Stuart, and Desmond J. Higham. Ergodicity for SDEs and approximations: Locally lipschitz vector fields and degenerate noise. Stochastic Processes and their Applications, 101(2):185–232, 2002.
[24] Nicholas Metropolis, Arianna W. Rosenbluth, Marshall N. Rosenbluth, Augusta H. Teller, and Edward Teller. Equation of state calculations by fast computing machines. The Journal of Chemical Physics, 21(6):1087–1092, 1953.
[25] Frank Noé, Simon Olsson, Jonas Köhler, and Hao Wu. Boltzmann generators: Sampling equilibrium states of many-body systems with deep learning. Science, 365(6457):eaaw1147, 2019.
[26] Grigorios A. Pavliotis. Stochastic Processes and Applications: Diffusion Processes, the Fokker–Planck and Langevin Equations, volume 60 of Texts in Applied Mathematics. Springer, New York, NY, 2014.
[27] William Peebles and Saining Xie. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 4195–4205, 2023.
[28] Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron Courville. FiLM: Visual reasoning with a general conditioning layer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
[29] Michael Prasthofer, Tim De Ryck, and Siddhartha Mishra. Variable-input deep operator networks. arXiv preprint arXiv:2205.11404, 2022.
[30] Md Ashiqur Rahman, Manuel A. Florez, Anima Anandkumar, Zachary E. Ross, and Kamyar Azizzadenesheli. Generative adversarial neural operators. Transactions on Machine Learning Research, 2022.
[31] Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning, pages 1530–1538, 2015.
[32] Christian P. Robert and George Casella. Monte Carlo Statistical Methods. Springer, 2 edition, 2004.
[33] L Chris G Rogers and David Williams. Diffusions, Markov processes, and martingales, volume 2. Cambridge university press, 2000.
[34] Yaozhong Shi, Zachary E. Ross, Domniki Asimaki, and Kamyar Azizzadenesheli. Stochastic process learning via operator flow matching. In Advances in Neural Information Processing Systems, 2025. Spotlight.
[35] Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021.
[36] Cédric Villani et al. Optimal transport: old and new, volume 338. Springer, 2008.
[37] Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi, and Sanjiv Kumar. Are transformers universal approximators of sequence-to-sequence functions? In International Conference on Learning Representations (ICLR), 2020.
[38] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan Salakhutdinov, and Alexander Smola. Deep sets. In Advances in Neural Information Processing Systems, volume 30, 2017.
[39] Yaohua Zang, Gang Bao, Xiaojing Ye, and Haomin Zhou. Weak adversarial networks for high-dimensional partial differential equations. Journal of Computational Physics, 411:109409, 2020.