Perfect SMLD is TC$^0$

October 16, 2025

This paper, Perfect diffusion is TC^$0$ -- Bad diffusion is Turing-complete, has been stuck in my head. Here's an exposition of $1/2$ of the result.

(I claim no novelty in either exposition or content for what is below)

what is SMLD?

Given a distribution $\rho_{data}$ over $\mathbb{R}^d,$ SMLD aims to learn a score-matching function $f_\theta$ which samples from $\nabla \log \rho_{data}$ well. In particular, for $x \sim \rho_0,$ which we define as $\rho_0 = \rho_{data},$ we aim for $f_\theta(x,t)$ to approximate $\nabla_x \log \rho_t.$ Why are we introducing time as a parameter? The point of diffusion models is to learn a function which can learn to denoise a process and thus learn to sample the underlying distribution well. SMLD does this by training a model to learn the score function in the reverse Langevin process for a given noise schedule. In more detail:

TC$^0$ circuit families are (essentially) neural networks

Circuit complexity classes describe "families of boolean circuits." A "family of boolean circuits" is just the set of all possible boolean circuits satisfying some properties; a boolean circuit is (abstractly) some DAG of "gates" (boolean functions) that takes a series of Boolean inputs to a Boolean output. TC$^0$ in particular satisfies:

You can use MAJ gates to simulate threshold gates.. As such, this last bullet point is equivalent to:

This is a feed-forward neural network, where each gate is an activation function acting on Boolean inputs. TC$^0$ is the class of neural networks with width $< p(n)$ and depth $\leq D.$ Circuit complexity classes in general are somewhat pathological, and can solve sets of problems that one might not expect to be easily grouped together. But this is quite interestingly natural for ML purposes.

proof of the result

Theorem. Take a TC$^0$ family of score-networks $f_{\theta, 0}, f_{\theta,1}, \ldots$ such that for each $n$ and each $x_1, \ldots, x_n$ the function $f_{\theta, n}(x,t|x_1,\ldots,x_n)$ exactly computes the score function of some initial distribution $\rho_{0,n}$ with bounded first moment. If this family solves a prefix language modeling problem in the SMLD infinite time limit with a constant probability bound, then the problem is in TC$^0.$

What is a "prefix language modeling problem"? Next-token prediction: given $n$ previous tokens in an alphabet, predict token $n+1.$ This is solved by a circuit complexity class if a family of circuits $C_i$ for every input size satisfying the complexity class solves the problem.

The proof relies on a result from the literature given in O(d/T) Convergence Theory for Diffusion Probabilistic Models under Minimal Assumptions which states that there exists some universal constant $c>0$ such that $$TV(p_X, p_Y) \leq c \frac{d \log^3T}{T} + c \epsilon_{score} \sqrt{\log T}.$$ Here $TV$ is the total variation distance, $X$ is the data distribution, and $Y$ is a distribution generated by DDPM denoising (essentially just a discretization of SMLD). One can use this to upper bound the total variation distance between the DDPM sampler and our denoising process by some constant $\epsilon',$ and setting our constant probability bound of finding a solution to $\epsilon$ we find that $\epsilon' = \epsilon/2$ is enough for our denoising process to solve the problem. This is then derandomized by a construction given in Threshold circuits of bounded depth, which reconstructs a TC$^0$ class.

One may wonder where we require "perfect" score matching! Well, the $c \epsilon_{score} \sqrt{\log T}$ term increases with $T,$ so for this proof to work completely cleanly one requires $\epsilon_{score}$ to be set to $0.$ Practical diffusion networks are not like this --- there will always be some error.