
UNSW Sydney | STREAM

Working assumption: running the unconditional model forward is easy, conditioning is hard.

We are targeting the quantity \(p(f \mid \mathcal{D})\).
\[ p(f \mid \mathcal{D}) \;\propto\; \underbrace{p(\mathcal{D} \mid f)}_{e^{-\text{loss}(f;\,\mathcal{D})}} \; \times \; \underbrace{p(f)}_{\text{a way to sample } f} \]

\[ p(f \mid \mathcal{D}) \;\propto\; p(\mathcal{D} \mid f) \; \cdot \; p(f) \]


Diffusion modelling simply asks “how do I sample from an inconvenient distribution?”

Anderson (1982), Reverse-time diffusion equation models, Stochastic Processes and their Applications 12(3):313–326.


Price, Ilan, et al. (2025), Probabilistic weather forecasting with machine learning, Nature 637(8044): 84-90.

Abramson, Josh, et al. (2024), Accurate structure prediction of biomolecular interactions with AlphaFold 3, Nature 630(8016): 493-500.



The marginal \(p_t\) stays Gaussian, and we know \[ p_t = \mathcal{N}\big(\boldsymbol{b}(t),\, \mathbf{A}(t)\big), \qquad \boldsymbol{b}(t) = \alpha(t)\,\underbrace{\mathbf{m}_*}_{\text{or } \mathbf{m}_{*|\boldsymbol{y}}}, \qquad \mathbf{A}(t) = \alpha^2(t)\underbrace{\mathbf{K}_{**}}_{\text{or } \mathbf{K}_{**|\boldsymbol{y}}} + (1-\alpha^2(t))\mathbf{I}. \]
So the score is closed form, and no network is required:
\[ \nabla_{\boldsymbol{f}}\log p_t(\boldsymbol{f}_t) = -\mathbf{A}(t)^{-1}\big(\boldsymbol{f}_t - \boldsymbol{b}(t)\big). \]
Drop it into the reverse-time SDE and integrate from \(t=1\) to \(t=0\):
\[ \mathrm{d}\boldsymbol{f}_t = \beta(t)\left[\tfrac{1}{2}\boldsymbol{f}_t - \nabla_{\boldsymbol{f}}\log p_t(\boldsymbol{f}_t)\right]\mathrm{d}t + \sqrt{\beta(t)}\,\mathrm{d}\bar{\boldsymbol{W}}_t. \]
⟵
Prior score \[ \begin{aligned} \nabla\log p_t(\boldsymbol{\varphi}_t) &= -\mathbf{A}_t^{-1}\big(\boldsymbol{\varphi}_t - \alpha_t\mathbf{m}_*\big) \\ \mathbf{A}_t &= \alpha_t^2\mathbf{K}_{**} + (1-\alpha_t^2)\mathbf{I} \end{aligned} \]
⟵
Posterior score \[ \begin{aligned} \nabla\log p_t(\boldsymbol{\varphi}_t \mid \boldsymbol{y}) &= -\mathbf{A}_{t|\boldsymbol{y}}^{-1}\big(\boldsymbol{\varphi}_t - \alpha_t\mathbf{m}_{*|\boldsymbol{y}}\big) \\ \mathbf{A}_{t|\boldsymbol{y}} &= \alpha_t^2\mathbf{K}_{**|\boldsymbol{y}} + (1-\alpha_t^2)\mathbf{I} \end{aligned} \]
Rosenblatt (1952), Remarks on a multivariate transformation, The Annals of Mathematical Statistics 23(3):470–472.
Every one is \(\boldsymbol{f}_0 = T_\vartheta(\boldsymbol{\xi}_0)\) for a tractable generator \(T_\vartheta\) and iid-normal latent \(\boldsymbol{\xi}_0\)
\[ \nabla \log p_t(\boldsymbol{f}_t \mid \mathcal{D}) = \nabla \log p_t(\boldsymbol{f}_t) + \nabla \log p_t(\mathcal{D} \mid \boldsymbol{f}_t). \]
Optimal interpolation, conditioned on the observations alone

Conditioned on the observations and on the non-linear damped pendulum equation

We work in latent space. Target the pulled-back posterior: \[ \pi(\boldsymbol{\xi}_0 \mid \mathcal{D}) \propto p\big(\mathcal{D} \mid T_\vartheta(\boldsymbol{\xi}_0)\big) \rho(\boldsymbol{\xi}_0). \]
Along the latent flow, the score decomposes: \[ \nabla_{\boldsymbol{\xi}} \log p_t(\boldsymbol{\xi}_t \mid \mathcal{D}) = \underbrace{\nabla_{\boldsymbol{\xi}} \log p_t(\boldsymbol{\xi}_t)}_{=\,-\boldsymbol{\xi}_t\ \text{(exact)}} + \underbrace{\nabla_{\boldsymbol{\xi}} \log p_t(\mathcal{D} \mid \boldsymbol{\xi}_t)}_{\text{guidance}}. \]
Run the same SDE in \(\boldsymbol{\xi}\)-space, add the guidance term, then push through \(T_\vartheta\).
The latent prior is exact at every \(t\). Guidance is the only thing to approximate.
We can evaluate \(\pi_{0|t}\) up to a constant and sample its Gaussian part, so standard tools apply.
A trained score network does not give \(\pi_{0|t}\). It only recovers its mean, so ML guidance only uses the mean in the likelihood.
| Error source | Image diffusion | Simulator-based | |
|---|---|---|---|
| 1 | Marginal score \(\nabla\log p_t\) | uncontrolled | exact |
| 2 | Guidance approximation | uncontrolled | explicit |
| 3 | Discretisation | controllable | solver order \(h^q\), same bound |
The conditioning mechanism does not care where the score comes from. Closed form from your solver, or learned from data.
\[ \mathrm{d}T = -\kappa(S)\,\bigl(T - T^{*}(S)\bigr)\,\mathrm{d}t + \sigma_T\,\mathrm{d}W_T, \qquad \mathrm{d}S = 1/C_S \bigl(P(t) - E(T,S)\bigr)\,\mathrm{d}t \]
\(\kappa(S)\) relaxation rate · \(T^{*}(S)\) equilibrium temperature · \(C_S\) soil water storage capacity · \(P(t)\) precipitation · \(E(T,S)\) evaporative water loss
An insultingly simplified version of Brubaker & Entekhabi (1996).

\[ \frac{\partial T}{\partial t} + \underbrace{u\,\frac{\partial T}{\partial x} + v\,\frac{\partial T}{\partial y}}_{\text{unknown current } (u,\,v)} = \kappa\,\nabla^{2} T + S \]
NN + Diffusion based inversion of methane flux

Computational scaling vs true-model inversion




We’ve done a lot of theory this year:
Now, what can we actually DO?!

Slides and code: astfalckl.github.io/presentations
STREAM: unsw.edu.au/science/our-schools/maths/our-research/stream
l.astfalck@unsw.edu.au
Lachlan Astfalck | UNSW Spatio-Temporal Research for Environmental Analysis and Modelling