← All posts

SDF diffusion models run curvature flow backwards

10 min read diffusionflow matchinggeometry

Most work on 3D generative models is about the final shape. I wanted to do an observation on the process and what happens in between: when a diffusion or flow model that works directly on signed distance fields (SDFs) is the middle of the way through generating a shape, what does it currently think the shape is? Can we turn that into a meaningful interpolation of an initial shape and the target shape?

In the models I trained, the answer has a clean geometric description and is quite interesting. The model’s running guess of its final output looks like that output after curvature flow - the process that smooths a curve by moving every point inward in proportion to how curved it is. As generation proceeds, the amount of flow shrinks to zero. So generation looks like curvature flow played backwards: starting from a blob, it becomes a rounded sketch, and then the final shape.

Rows of shapes that start as a disk and sharpen into a cross, a capsule, ellipses with holes and a flower
A Gaussian flow-matching model's guess of its final shape at nine times from the start of generation (t = 0, left) to the end (t = 1, right), for six samples. Each row starts as a disk and sharpens into its final shape.

In this post I try to explain why that should happen, with a short argument, and then check it on a trained model. My argument is first-order only, and the experiments are in 2D (to be cheap to run locally), however these can be generalized.

Background

Signed distance fields. A signed distance field (SDF) stores, at every point of a grid, the distance to a shape’s surface, negative inside and positive outside. The surface is the zero level set \(\Gamma = \{\phi = 0\}\). Near the surface an SDF has unit gradient, \(\lvert\nabla\phi\rvert = 1\), which is important for our argument.

The model’s running guess. Take a flow-matching model on the straight path \(x_t = (1-t)\,\epsilon + t\,x_1\), with noise at \(t = 0\) and data at \(t = 1\). At any time it has an estimate of where it is heading:

\[\hat x_1(t) = x_t + (1-t)\, v_\theta(x_t, t),\]

which approximates the posterior mean \(\mathbb{E}[x_1 \mid x_t]\). For diffusion models the equivalent is the Tweedie estimate. Throughout this post, “the preview” means \(\hat x_1(t)\), drawn as its zero set.

Curvature flow. Mean curvature flow moves each point of a surface inward, at a speed equal to how curved the surface is there (its mean curvature \(H\)). In 2D the surface is just a closed curve, \(H\) is simply the curve’s curvature \(\kappa\), and the flow is usually called curve-shortening flow. Sharp corners and small bumps are the most curved, so they disappear first, and every closed curve eventually becomes round.

Four shapes smoothing into disks under curvature flow
Curvature flow (here the area-preserving version) smooths four shapes into disks. Holes close as they shrink.

The heat equation. The heat equation, \(\partial_\tau \phi = \Delta\phi\), describes how heat spreads through a material. Here \(\Delta\phi = \nabla\cdot\nabla\phi\) is the Laplacian, the sum of second derivatives. It compares each point with the average of its neighbours. So every value drifts toward that average: peaks sink, dips fill in, and fine wiggles vanish long before broad features do. Running it for time \(\tau\) is exactly a Gaussian blur of width \(\sqrt{2\tau}\). In frequency terms it multiplies each frequency \(\omega\) by \(e^{-\omega^2\tau}\), so it is essentially a low-pass filter!

Animation: a bumpy curve smoothing, its frequency bars shrinking from high to low, and a cross-shaped SDF blurring as its outline rounds off
The heat equation on a bumpy curve (left), on that curve's frequencies (middle), and on the SDF of a cross (right). High frequencies fade first. On the SDF, the outline (orange) rounds off and shrinks much like curvature flow; Steps 1 and 2 explain why.

Step 1: on an SDF, the Laplacian is the curvature

The unit normal of a level set is \(n = \frac{\nabla\phi}{\lvert\nabla\phi\rvert}\), and the mean curvature is its divergence, \(H = \nabla \cdot n\). For an SDF the denominator is 1 (as we know on the surface the magnitude of normal is 1), so

\[H = \nabla \cdot \nabla\phi = \Delta\phi \quad \text{on } \Gamma.\]

That is exact, and easy to check numerically. On a flower-shaped SDF, the grid Laplacian read off at the outline matches the curvature computed from the outline’s own geometry with correlation 0.996.

A flower-shaped SDF, its Laplacian, and a plot showing the Laplacian along the outline matching the curvature
Left: an SDF. Middle: its Laplacian, with the bright creases marking the medial axis. Right: along the outline, the Laplacian (dashed) and the curvature (orange) agree.

The bright creases in the middle panel are worth noticing now. They are the medial axis, where the distance to the surface is reached from two directions at once and the SDF has a kink. Every failure later in this post comes from there.

Step 2: blurring an SDF is curvature flow, to first order

Blurring with a Gaussian of width \(\sqrt{2\tau}\) is the heat equation run for time \(\tau\), so

\[\phi_\tau = \phi + \tau\,\Delta\phi + O(\tau^2).\]

At a surface point, where \(\phi = 0\), Step 1 gives \(\phi_\tau = \tau H + O(\tau^2)\). To find the new surface, move along the normal by \(\delta\): since \(\lvert\nabla\phi\rvert = 1\), the value changes by about \(\delta\), so the zero level moves to \(\delta = -\tau H + O(\tau^2)\). The surface moves inward at speed \(H\). That is mean curvature flow.

Animated comparison of a blurred SDF and curvature flow on a cross, a flower and an ellipse with two holes
Grey: the starting shape. Orange: true curvature flow. Blue dashed: the zero set of the blurred SDF. They track each other on smooth shapes and separate on the ellipse with two holes.

Measuring the gap makes the “first order” concrete. On smooth shapes, the gap between the blurred SDF and the flow grows faster than the distance the flow has moved (for the flower, roughly as \(\tau^2\) against \(\tau\)). That is what first-order agreement looks like.

Two plots: on smooth shapes the gap grows like tau squared; on a shape with holes the gap grows quickly
Left: on smooth shapes the gap (solid) stays well below the motion (dotted). Right: on an ellipse with two holes, the gap overtakes the motion almost at once.

It breaks near thin walls and holes. There the medial axis sits close to the surface, so as soon as the blur width \(\sqrt{2\tau}\) is comparable to the distance to it, the blur sees the kink as well as the surface. In practice, blurred holes fill in almost immediately, much earlier than curvature flow would close them.

Step 3: a generator’s preview is a low-pass of its final shape

Now let’s see how we can relate this steps to generative models.

Suppose the data were locally Gaussian, with power spectrum \(S(\omega)\). Then the posterior mean is a Wiener filter. Per frequency,

\[\hat x_1(t)(\omega) \approx W_t(\omega)\,\frac{x_t(\omega)}{t}, \qquad W_t(\omega) = \frac{t^2 S(\omega)}{t^2 S(\omega) + (1-t)^2\sigma^2}.\]

Shape spectra fall off with frequency, so \(W_t\) is a low-pass filter whose cutoff rises over time: coarse structure is resolved first, fine detail last. For images this view is already well known; Dieleman’s “Diffusion is spectral autoregression” (2024) and Falck et al. (2025) explain it.

Putting this together with Step 2, we know that a low-pass of an SDF moves its surface by curvature, so the preview at time \(t\) should look like the final shape after curvature flow for some time \(s(t)\), with \(s(t)\) shrinking to zero as \(t \to 1\).

Three reasons that I think our argument is an approximate explanation of how the SDF models work, however it’s still an interesting insight:

  • The real denoiser is nonlinear, and the data are far from Gaussian.
  • At very high noise the posterior mean is the dataset’s average shape, not a smoothed copy of the final one. That is why every row in the first figure starts as the same disk.
  • A filtered SDF is no longer a true SDF, so Step 2 holds only while the smoothing is small.

So, now the real question: does a trained model actually behave like this?

Step 4: testing it on a trained model

I trained a Gaussian flow-matching model on 3,000 synthetic 2D SDFs from five shape families, drew 64 samples with 64 Euler steps, and recorded the preview at every step. For each sample and each time \(t\), I compared the preview with four transformed versions of the model’s own final sample, choosing the best member of each family:

  • the final shape after curvature flow for time \(s\);
  • the final SDF after a Gaussian blur;
  • the final shape grown or shrunk uniformly, as a null model with no smoothing;
  • the final shape unchanged.
A grid of the model's guesses in blue, each outlined by the matching curvature-flow shape in orange, over the first quarter of generation
Six samples over the first quarter of generation. Blue: the model's guess at time t. Orange: its own final sample after the best-matching amount of curvature flow, for time s*.

Curvature flow is the best description at every time I tested, and the amount of flow needed falls steadily:

\(t\) curvature flow blurred SDF grown or shrunk final itself matched \(s^*\)
0.06 6.0 9.2 11.2 12.2 0.032
0.09 5.0 7.6 10.0 10.5 0.018
0.125 4.1 6.2 8.1 8.2 0.010
0.19 2.5 2.8 3.3 3.4 0.003
0.25 1.5 1.5 1.8 1.8 0.0006

Median Chamfer distance ×100 between the preview and the best member of each family; lower is closer. \(s^*\) is the median matched curvature-flow time.

Two plots: curvature flow is the closest match early in generation, and the matched flow time falls toward zero
Left: distance from the preview to each version of the final shape; the gaps are large only in the first 20% of generation. Right: the matched curvature-flow time, falling toward zero.

Three more findings:

  • The preview has the same topology (number of pieces and holes) as the matched curvature-flow shape in at least 95% of cases at every time.
  • Curvature flow beats the blurred SDF at every early time. So the model’s middle stages are geometric, not just “the SDF, blurred”.
  • A second model trained with a different noise path (linear interpolation with variance-preserving noise) shows the same pattern, but even more compressed in time.
Four samples during generation. Left: the noisy state. Middle: the model's guess of its final shape. Right: that guess (blue) against its own final shape after the best-matching curvature flow (orange), with the matched time s*. The first quarter of generation is slowed down three times.
Left: the model's guesses as it generates. Right: curvature flow of the same final shape, played backwards at the matched times. The two columns look almost the same.

What this does not show

The pattern is real in my measurements, but it is narrow, and there are also some failure cases.

  • It is all in the first ~20% of generation. After that, the preview already equals the final shape, and every comparison ties. With white noise, the whole “curvature scale space” is squeezed into the start.
  • There are failures. In the worst matches, rings open their hole later than curvature flow predicts, and crosses stay larger and rounder than the flowed final shape for a while (look at the figure below).
  • The comparison used area-preserving curvature flow, while the clean argument in Step 2 is for plain curvature flow, which also shrinks the shape. However, I expect it to be approximately the same.
The four worst matches: two rings and two crosses, each shown at three times next to its final shape, with a one-line reason under each
The four samples that match curvature flow worst at t = 0.125, with the reason under each.

Why it is interesting anyway

It explains a negative result. I spent a while thinking about designing a generator whose forward process is curvature flow, on the theory that a geometric noising process should suit shapes. However, I observed in first experiments that a plain Gaussian model learned better. This observation is a likely reason: a plain Gaussian model already runs curvature flow implicitly, so building it in explicitly adds little to no gains.

It gives every step a geometric meaning. Each time \(t\) in generation corresponds to a curvature scale \(s(t)\) of the shape being generated. That turns the vague “coarse to fine” into something measurable.

It raises sharper questions.

  • When is topology decided? If previews follow reversed curvature flow, holes and connected pieces should be decided in time windows that line up with the moments where curvature flow would pinch a neck or close a hole.
  • Can the noise choose the flow? With white noise, everything happens in the first 20%. Coloured noise would spread it out, and a different noise covariance would, in principle, select a different smoothing order.
  • Does it hold in 3D? The argument is the same in 3D, where Step 1 gives mean curvature. I didn’t try trained 3D models to see whether they follow it or not.
  • Merriman, Bence and Osher (1992): threshold dynamics, the original link between diffusion and curvature motion.
  • Esedoğlu, Ruuth and Tsai (2010), Journal of Computational Physics: convolving an SDF and re-distancing gives mean curvature flow.
  • Dieleman (2024), “Diffusion is spectral autoregression”; Falck et al. (2025): the coarse-to-fine, frequency view of diffusion models on images.
  • Rissanen et al. (2023), inverse heat dissipation, and Hoogeboom and Salimans (2023), blurring diffusion: generative models that build blurring into the forward process.