---
title: 'DICE: Discrete Inverse Continuity Equation'
url: https://www.emergentmind.com/topics/discrete-inverse-continuity-equation-dice
type: topic
---

# DICE: Discrete Inverse Continuity Equation

Searching arXiv for the specified DICE paper and any directly relevant related work to support the encyclopedia entry.
Discrete Inverse Continuity Equation (DICE) is a generative modeling method for learning the evolution of a stochastic process from sample populations observed at a finite set of time points. Rather than fitting the dynamics of individual sample trajectories, which may be complex or chaotic, DICE learns population-level, Eulerian dynamics by inverting the continuity equation and selecting the minimum-kinetic-energy velocity field compatible with the observed marginals. The method parameterizes a scalar potential $s:[0,T]\times\mathcal X\to\mathbb R$, uses the gradient field $u=\nabla s$ as the advecting velocity, and is designed so that its discrete-time loss remains invariant to spatially constant but time-varying additive functions. This invariance is central to its training stability, well-posedness, and robustness, and the resulting models generate trajectories of sample populations by direct evolution over physical time rather than by repeated time-conditioned inference [2507.05107].

## 1. Problem setting and modeling objective

DICE considers a stochastic process $X(t)\in\mathcal X$ with law $\rho(t)\in\mathcal P(\mathcal X)$, where $\mathcal X$ is either a bounded, connected, open subset of $\mathbb R^d$ or the flat torus $\mathbb T^d$. When $\rho(t)$ is viewed as a density, it is written as $\rho(t,\cdot):\mathcal X\to\mathbb R$ with value $\rho(t,x)$. The boundary conditions are either tangential velocity at $\partial\mathcal X$ in the bounded-domain case, corresponding to a no-flux condition, or periodic boundary conditions when $\mathcal X=\mathbb T^d$ [2507.05107].

The method is formulated for the regime in which one observes unpaired samples from the time marginals $\rho(t_j)$ at finitely many times $t_0<\cdots<t_K$. Its objective is not to identify Lagrangian trajectories of particular particles or agents. Instead, it reconstructs a population transport consistent with the observed marginals and constrained by a minimum-energy principle. This distinction is essential: the paper emphasizes that population dynamics can be smooth and well-behaved even when individual trajectories exhibit high-dimensional chaos or other complicated behavior.

A standing assumption is a Poincaré inequality for each time $t\in[0,T]$: for any Lipschitz $g$,
\[
\bigl\| g - \mathbb{E}_{x \sim \rho(t)}[g] \bigr\|^2_{L^2(\rho(t))}
\;\le\; \frac{1}{\lambda(t)} \bigl\| \nabla g \bigr\|^2_{L^2(\rho(t))},
\]
where $\lambda(t)>0$ is the Poincaré constant. This assumption underpins the existence, uniqueness, and lower-boundedness results developed for the discrete variational problem.

The learned transport is defined through a potential $s$ whose gradient yields the velocity field,
\[
u=\nabla s,
\]
and the admissible transport is selected by minimizing the kinetic energy
\[
J(u) \;=\; \frac{1}{2}\int_0^T \mathbb{E}_{x \sim \rho(t)} \left[ |u(t,x)|^2 \right] \,\mathrm dt.
\]
The minimum-energy compatible field is a gradient field. DICE therefore identifies the tangent component of the transport and excludes divergence-free components. A plausible implication is that the method is intrinsically aligned with Eulerian marginal evolution rather than with any specific microscopic realization.

## 2. Continuity-equation inversion and the discrete weak formulation

The starting point is the continuity equation in weak form:
\[
\frac{\mathrm d}{\mathrm dt} \,\mathbb{E}_{x \sim \rho(t)}[\varphi(x)]
\;=\;
\mathbb{E}_{x \sim \rho(t)}\bigl[u(t,x)\cdot \nabla \varphi(x)\bigr],
\]
for all smooth, compactly supported test functions $\varphi$. When regularity is sufficient, this corresponds to the strong form
\[
\partial_t \rho(t,x) + \nabla \cdot \bigl( \rho(t,x) u(t,x)\bigr) \;=\; 0.
\]

Under the minimum-energy criterion, the compatible field takes the gradient form
\[
u=\nabla s \in \overline{\{\nabla \phi:\phi\in C^\infty(\mathcal X)\}^{L^2(\rho(t))}},
\]
and the potential satisfies the formal elliptic equation
\[
-\nabla \cdot \bigl(\rho(t,x)\,\nabla s(t,x)\bigr) \;=\; \partial_t \rho(t,x).
\]
This leads to the continuous-time variational problem
\[
\min_{s}\int_0^T \int_{\mathcal X}\left(
\frac{1}{2}|\nabla s(t,x)|^2 \rho(t,x) - s(t,x)\,\partial_t \rho(t,x)
\right)\,\mathrm dx\,\mathrm dt.
\]

For sample-based estimation, the source term is rewritten as
\[
\int_{\mathcal X} s(t,x)\,\partial_t \rho(t,x)\,\mathrm dx
\;=\;
\frac{\mathrm d}{\mathrm d\tau}\,\mathbb E_{x\sim \rho(\tau)}[s(t,x)]\biggr|_{\tau=t},
\]
yielding an objective expressed purely through expectations:
\[
L(s)
\;=\;
\int_0^T
\left(
\mathbb E_{x\sim \rho(t)}\Bigl[\tfrac12|\nabla s(t,x)|^2\Bigr]
-
\frac{\mathrm d}{\mathrm d\tau} \mathbb E_{x\sim \rho(\tau)}\bigl[s(t,x)\bigr]\biggr|_{\tau=t}
\right)\mathrm dt.
\]

DICE discretizes this inverse problem directly at the weak level. With time grid $t_0<\cdots<t_K$ and the convention $t_{-1}=t_0$, $t_{K+1}=t_K$, the discrete inverse continuity equation requires
\[
\frac{\mathbb E_{x\sim \rho(t_{j+1})}[\varphi(x)] - \mathbb E_{x\sim \rho(t_{j-1})}[\varphi(x)]}{t_{j+1}-t_{j-1}}
\;=\;
\mathbb E_{x\sim \rho(t_j)}\bigl[\nabla \hat s(t_j,x)\cdot \nabla \varphi(x)\bigr],
\]
for $j=0,\dots,K$. This is the core discrete weak constraint enforced by the method. The paper characterizes this construction as an inverse continuity equation because the unknown is not the density evolution but the potential generating a velocity field consistent with the observed marginals.

## 3. DICE loss, function spaces, and invariance

For each time index $j$, DICE uses the weighted space $L^2(\rho(t_j))$ and defines
\[
\mathcal S_j \;=\; \{ s\in L^2(\rho(t_j)):\,\nabla s \in L^2(\rho(t_j))\},\qquad
\mathcal S_j^0 \;=\; \{ s\in \mathcal S_j:\,\mathbb E_{x\sim \rho(t_j)}[s]=0\},
\]
together with
\[
\mathcal S \;=\; \{ s:[0,T]\times \mathcal X\to \mathbb R:\, s(t_j,\cdot)\in \mathcal S_j \;\; \forall j\}.
\]
On these spaces the discrete objective is
\[
\begin{aligned}
L_{\mathrm{DICE}}(s)
&=
\sum_{j=1}^{K}
\bigg(
\frac{t_j - t_{j-1}}{2}
\Big(
\mathbb E_{x\sim \rho(t_j)}\bigl[\tfrac12 |\nabla s(t_j,x)|^2\bigr]
+
\mathbb E_{x\sim \rho(t_{j-1})}\bigl[\tfrac12 |\nabla s(t_{j-1},x)|^2\bigr]
\Big) \\
&\hspace{2.2cm}
-\frac{1}{2}
\Big(
\mathbb E_{x\sim \rho(t_j)}[s(t_j,x)+s(t_{j-1},x)]
-
\mathbb E_{x\sim \rho(t_{j-1})}[s(t_j,x)+s(t_{j-1},x)]
\Big)
\bigg).
\end{aligned}
\]
Its Euler–Lagrange equations coincide with the discrete inverse weak continuity equations, so minimizers of the loss solve the target discrete transport system [2507.05107].

A defining property of the construction is invariance to spatially constant, time-varying additive terms. For any $f:[0,T]\to\mathbb R$ that is constant in space,
\[
L_{\mathrm{DICE}}(s+f) \;=\; L_{\mathrm{DICE}}(s).
\]
The quadratic terms are unchanged because $\nabla(s+f)=\nabla s$, while the linear terms cancel telescopically since expectations of constants equal the constants themselves. The paper treats this as preservation, in discrete time, of the intrinsic non-identifiability of the potential up to an additive temporal function.

This invariance is not merely algebraic. It is presented as the mechanism that prevents the ill-posedness encountered by other empirical time discretizations, notably empirical Action Matching, where residual terms associated with such constants can destabilize training. The paper further identifies the DICE functional as quadratic and convex, with well-posed discrete optimization under the stated assumptions.

A common misconception is to interpret the additive freedom in $s$ as an ambiguity in the learned velocity. DICE does not leave the velocity field underdetermined in that sense: $u=\nabla s$ is the identified object, while $s$ is unique only modulo time-dependent constants.

## 4. Parameterization, empirical training, and generation

In practice, the potential is parameterized by a neural network $s_\theta(x,t)$, or in parametric settings by $s_\theta(x,t;\mu)$. The reported architectures include MLPs with swish activations and ResNets for high-dimensional states, with time supplied either as an input coordinate or through Fourier or time features. The velocity field is obtained by automatic differentiation,
\[
u_\theta(t,x)=\nabla_x s_\theta(t,x).
\]

Training requires only unpaired samples at discrete times,
\[
\mathcal D \;=\; \{ X_i(t_j)\;|\; i=1,\dots,N_j,\; j=0,\dots,K\},
\]
with no density evaluations and no trajectory supervision. Expectations are replaced by Monte Carlo estimates,
\[
\widehat{\mathbb E}_{x\sim \rho(t_j)}[g(x)] \;=\; \frac{1}{N_j}\sum_{i=1}^{N_j} g(X_i(t_j)),
\]
giving the empirical loss of the same algebraic form as $L_{\mathrm{DICE}}$, but with empirical averages in place of exact expectations [2507.05107].

The training pipeline is minibatch-based. At each iteration, one samples a minibatch of time indices and, for each selected $j$, samples points from the datasets at times $t_j$ and $t_{j-1}$. The network values and spatial gradients are evaluated, the empirical DICE contributions are accumulated, and the parameters are updated by backpropagation. The stabilization strategy is built into the objective itself: because $L_{\mathrm{DICE}}(s+f)=L_{\mathrm{DICE}}(s)$, no additional penalties are required to remove spatial constants. The implementation notes state that standard optimizers such as Adam with a cosine schedule work well, and that a learning rate $2\mathrm e{-3}$ with cosine decay works robustly in the reported experiments.

After training, sample populations are generated by integrating
\[
\frac{\mathrm d}{\mathrm dt}\widehat X(t) \;=\; \nabla s_\theta(t,\widehat X(t)), \qquad \widehat X(t_0)\sim \rho(t_0),
\]
using a standard ODE solver or explicit Euler on the physical time grid. If the network accepts continuous time, it can be queried directly for arbitrary $t$; otherwise, the paper advocates a linear-in-time interpolant between grid points. This produces the full population trajectory in one forward evolution across $[t_0,t_K]$.

The computational profile reflects this design. With minibatches of size $n_t$ in time and $n_x$ in samples in dimension $d$, the forward and automatic-differentiation cost per iteration is $O(n_t n_x d)$, plus network cost. Training does not differentiate through time integrators and does not require optimal-transport solvers. Memory is $O(n_t n_x d)$ for minibatch activations and gradients and is independent of the number of ODE steps because simulated dynamics are not included in the backward pass. At inference, evolving $N$ samples across $K$ physical time steps with a first-order integrator costs $O(KNd)$, whereas time-conditioned diffusion or flow methods incur $O(KMNd)$ with $M\gg 1$ solver or denoising steps per marginal.

## 5. Existence, uniqueness, consistency, and error control

Under the Poincaré inequality and a mild square-integrability condition on discrete time derivatives of $\rho$, the discrete loss restricted to the time grid admits a minimizer in the product space $\mathcal S_0\times\cdots\times\mathcal S_K$:
\[
\min_{\bar s\in \mathcal S_0\times\cdots\times \mathcal S_K} L^K(\bar s).
\]
Moreover, the mean-zero representative is unique, $L_{\mathrm{DICE}}$ is lower-bounded on $\mathcal S$, and the mean-free minimizer is unique in the product norm induced by $L^2(\rho(t_j))$ and $\|\nabla\cdot\|_{L^2(\rho(t_j))}$ [2507.05107].

The analysis also provides consistency bounds for the discrete approximation. Under smoothness assumptions, including densities bounded above and below and transported by a smooth diffeomorphic flow, the discrete minimizer $\hat s^*$ satisfies, at the observation times,
\[
\bigl\|\nabla s^*(t_j,\cdot) - \nabla \hat s^*(t_j,\cdot)\bigr\|_{L^2(\rho(t_j))}
\;\le\; \lambda_{\mathcal X}^{-1/2} \,\underline \rho_0^{-1} \, e^{\underline c\, t_j}
\,\bigl\|\bigl(\partial_t - \hat\delta_{t_j}\bigr)\rho(t_j,\cdot)\bigr\|_{L^2(\mathrm dx)}.
\]
For all $t\in[0,T]$, using the linear-in-time interpolant $\hat s$,
\[
\bigl\|\nabla s^*(t,\cdot) - \nabla \hat s(t,\cdot)\bigr\|_{L^2(\rho(t))}
\;\le\; C\,\Delta t_{\max},
\]
where $C$ is explicit and independent of $K$ and the time-step sizes themselves. This is a first-order accuracy statement in $\Delta t_{\max}$. If $\hat s^*$ is Lipschitz in time in $L^2(\rho(t))$, the same type of estimate holds for $\hat s^*$ itself, with a modified constant.

For the induced population dynamics, the paper states a Wasserstein-2 error bound. If the gradient approximation satisfies the time-uniform estimate, then the laws $\rho(t)$ and $\hat\rho(t)$ generated respectively by $\nabla s^*$ and $\nabla \hat s^*$ obey
\[
W_2(\rho(t),\hat \rho(t))
\;\le\;
\bigl( W_2(\rho(0),\hat \rho(0)) + C(L^t_{\hat s^*})\, t\,\Delta t_{\max}\bigr)
\exp\Bigl( \int_0^t L^x_{\hat s^*}(\tau)\,\mathrm d\tau \Bigr),
\]
where $L^x_{\hat s^*}(t)=\sup_{x\in \mathcal X}\|D^2_x \hat s^*(t,x)\|_{\mathrm op}$. Consequently, as $\Delta t_{\max}\to 0$, one has $\nabla\hat s^*\to\nabla s^*$ in $L^2(\rho(t))$ for all $t$, and thus $W_2(\rho(t),\hat \rho(t))\to 0$ when the initial conditions are matched.

These results tie the learning problem to the transport error of the generated populations. A plausible implication is that the method’s dense-in-time observation regime is not merely a practical convenience but part of its approximation theory: the discrete weak linearization is controlled at first order in the maximal time step.

## 6. Relation to adjacent methods, empirical behavior, and extensions

DICE is contrasted with several neighboring approaches. Time-conditioned generative models such as NCSM and CFM learn maps from a fixed reference to each marginal $\rho(t_j)$ and require separate inference for each target time, with many solver or denoising steps per marginal. CNF and Neural ODE methods integrate ODEs during training and differentiate through solvers or adjoints, making them expensive and memory-intensive. Fokker–Planck and JKO-inspired approaches operate through variational problems on $(\mathcal P(\mathcal X),W_2)$ and often require nonlinear optimal-transport solves or bilevel optimization. Action Matching is the most direct methodological foil: it discretizes a continuous-time action objective, but its empirical discrete loss can retain residual terms from spatially constant time-varying functions, breaking invariance and destabilizing training. DICE is presented as avoiding these issues by enforcing discrete weak continuity constraints directly and preserving the relevant invariance in discrete time [2507.05107].

The paper reports experiments on a toy stationary Gaussian, a known-potential problem in $d=2$, random waves, Vlasov–Poisson systems, and a $9$D chaotic flow approximating Rayleigh–Bénard convection. In the toy Gaussian setup, with $\rho(t)=\mathcal N(0,10^{-2})$ on $t\in[0,1]$, $K=512$, and $N_j=10^4$, Action Matching develops a sharp kink in $t\mapsto\mathbb E[\partial_t s]$ and exhibits residual blow-up, whereas DICE remains stable. In the known-potential experiment, DICE attains low relative error while Action Matching becomes unstable for long training. For random waves in $d=1024$, generated populations reproduce population-level moments, specifically the mean and second and third moments, and exhibit lower kinetic energy than the original trajectories, consistent with the minimum-energy principle. In Vlasov–Poisson settings, including $6$D strong Landau damping with $T\approx 8.75$ and $\Delta t=0.05$, DICE reproduces particle histograms and electric energy evolution over several orders of magnitude; time-conditioned baselines are reported as similar in accuracy but notably more expensive at inference, while Action Matching fails to train reliably. In the $9$D chaotic system, DICE matches population histograms and achieves lower Sinkhorn divergence than time-conditioned baselines, and Action Matching again fails due to instability.

The principal limitations and assumptions are stated explicitly. Densities should satisfy the Poincaré inequality, the elliptic variational arguments require regularity, the time marginals should be available at sufficiently dense times with known time stamps, and the domain should support either periodic or no-flux boundary handling. Identifiability holds for the velocity field $u=\nabla s$ but not for the potential itself, which is defined only up to time functions $f(t)$. In sparse-time regimes, the linearization error degrades as $O(\Delta t_{\max})$. The base formulation models pure continuity transport and does not include diffusion.

The paper also describes several extensions. An entropic regularization yields
\[
\begin{aligned}
L_{\mathrm{DICE}^{\varepsilon}}(s)
&=
\sum_{j=1}^{K}
\bigg(
\frac{t_j - t_{j-1}}{2}
\Big(
\mathbb E_{\rho(t_j)}\bigl[\tfrac12 |\nabla s(t_j)|^2 + \tfrac{\varepsilon^2}{2}\Delta s(t_j)\bigr]
+
\mathbb E_{\rho(t_{j-1})}\bigl[\tfrac12 |\nabla s(t_{j-1})|^2 + \tfrac{\varepsilon^2}{2}\Delta s(t_{j-1})\bigr]
\Big) \\
&\hspace{2.2cm}
-\tfrac12 \bigl(
\mathbb E_{\rho(t_j)}[s(t_j)+s(t_{j-1})]
-
\mathbb E_{\rho(t_{j-1})}[s(t_j)+s(t_{j-1})]
\bigr)
\bigg),
\end{aligned}
\]
which formally corresponds to a Fokker–Planck model and leads to SDE sampling,
\[
\mathrm d\widehat X(t)=\nabla s^{*,\varepsilon}(t,\widehat X(t))\,\mathrm dt+\varepsilon\,\mathrm dW_t.
\]
A parametric version over $\mu\in\mathcal Q$ is defined by
\[
L^{\mu}(\hat s) \;=\; \sum_{\ell=1}^M L_{\mathrm{DICE}}(\hat s(\cdot,\cdot;\mu_\ell)).
\]
Adaptive time discretization and physics-informed constraints are also identified as compatible with the same weak-form framework.

Taken together, these properties position DICE as a method for dense-in-time marginal learning that is simulation-free during training, fast at inference, and theoretically anchored by discrete weak continuity, minimum-energy selection of gradient transport, and invariance to spatially constant temporal perturbations.

Source: https://www.emergentmind.com/topics/discrete-inverse-continuity-equation-dice