arXiv:2611.07845cond-mat.stat-mechNov 2026

Manuscript Offprint

arXiv:2611.07845

Masked diffusion as random sequential adsorption: an exactly solvable model for parallel decoding

Adrian Baule

Adrian Baule¹

¹School of Mathematical Sciences, Queen Mary University of London, London E1 4NS, UK (Dated: November 6, 2026)

Masked diffusion models generate text by reversing a stochastic masking process. Unlike autoregressive LLMs, which generate text one token at a time, they can reveal many tokens in parallel, at the price of an error, since tokens revealed together are drawn independently. We show that this trade-off maps onto the statistical physics of driven many-particle systems. (i) For any data, the error of parallel generation is the entropy production of the generation process relative to the reversed masking process. (ii) For Markov data, generation is a random sequential adsorption process with labelled gaps, which we solve exactly for any number of steps. (iii) For many steps, the error becomes the dissipation of a slowly driven system: the unmasking schedule plays the role of the driving protocol, the number of steps that of its duration, and the error is set by a thermodynamic metric that we obtain in closed form from the mutual information between tokens. Optimal schedules are geodesics of this metric. The exact solution shows how correlations in the text shape both the error and the quality of the output. The longer the correlations, the more the error concentrates at the start of generation. Schedules that start with small steps then gain more, both in path error and in perplexity, and need fewer steps to reach their asymptotic behaviour.

Generative models for text are usually autoregressive. Text is split into tokens (words, word fragments or characters), and a neural network is trained to predict the probability distribution of the next token given all previous ones. A sentence is then produced one token at a time, from left to right, so producing LL tokens takes LL sequential evaluations of a large network. Masked diffusion models (MDMs) [1–5], which have recently been scaled to large language models [6, 7], take a different route. They are trained on a fill-in task: tokens of a text are replaced at random by a blank “mask” symbol, and the network learns to predict the hidden tokens from the visible ones. Generation runs this process backwards: it starts from a sequence of masks, and a single network evaluation returns, for every masked position at once, the probability distribution of its token given the tokens revealed so far. Many positions can therefore be revealed per evaluation, and a sequence is generated in N≪LN \ll L steps.

The price of parallel generation is an error. Tokens revealed in the same step are drawn independently, each from its own distribution, although in the data they are correlated. Each step thus makes a mean-field approximation: the joint distribution of the tokens revealed together is replaced by the product of their single-site marginals. How the resulting parallel decoding error depends on the number of steps NN, on the schedule that fixes how many tokens are revealed at each step, and on the statistics of the data is the central trade-off of the field [8–11].

Several recent works quantify this trade-off for general data. The error of a single parallel step is the conditional total correlation of the tokens revealed together [8, 12], and the accumulated error is bounded by the mutual information between tokens [13]. The expected relative entropy for an arbitrary schedule has been expressed through an information profile of the data, from which near-optimal schedules follow [9, 10].

In the limit of many steps the optimal error is the squared integral of the square root of a complexity density along the reveal path [11], a structure familiar from thermodynamic length [14, 15]. Schedules have also been optimised numerically by minimising a KL upper bound [16]. Tractable data models used so far include nn-gram and hidden Markov languages [17] and random walks on graphs [18], and speed-accuracy relations from non-equilibrium thermodynamics have been derived for continuous diffusion models [19]. What is still missing is a model in which both the error and the quality of the output can be computed exactly at any number of steps, so that the large-NN theory can be tested directly.

In this paper we provide such a model. For data generated by a Markov chain over an arbitrary vocabulary, the bigram language model [20], generation maps onto a random sequential adsorption (RSA) process [21–24]: revealed tokens behave like deposited particles that shield the gaps between them, and the statistics of the labelled gaps obey a closed linear master equation. It gives the path error and the output statistics of the parallel sampler exactly, for any number of steps NN, sequence length LL and schedule. For large NN, the path error reduces to the thermodynamic metric found for general data in [9], which yields optimal schedules as geodesics. Since the path error is known exactly at any NN, we can test the large-NN theory directly and identify when it applies: the uniform schedule requires N≫ξN \gg \xi, where ξ\xi is the correlation length, while the cosine schedule of [29] only requires N≫ξN \gg \sqrt{\xi}. We compute the quality of the generated text, measured by its generative perplexity, exactly. For data with long correlations it deteriorates even when the path error saturates, and the geodesic schedule improves it substantially, although it was constructed only to minimize the path error. For the short-range correlations of English text, by contrast, the optimal schedule is nearly uniform.

I. PARALLEL SAMPLING ERROR AS ENTROPY PRODUCTION

MDMs generate text by reversing a forward masking process that sequentially masks a sequence of LL words (tokens). Training a neural network to learn the masking process on samples of realistic text subsequently allows the generation of new text by reversing the process starting from a sequence of LL fully masked tokens. While for realistic text the data distribution is not known and the reverse process is only approximate due to training, the setting considered here removes both restrictions. Sequences x=(x1,…,xL)\mathbf{x} = (x_1, \ldots, x_L) of tokens from a vocabulary of VV symbols are drawn from a distribution pdatap_{\text{data}}. The forward (masking) process is defined by a schedule 1=pN>pN−1>⋯>p0=01 = p_N > p_{N-1} > \cdots > p_0 = 0 of revealed fractions. In the step from pn+1p_{n+1} to pnp_n, each site that is still revealed is masked independently with probability Δpn/pn+1\Delta p_n / p_{n+1}, where Δpn=pn+1−pn\Delta p_n = p_{n+1} - p_n. The step σi∈{0,1,…,N−1}\sigma_i \in \{0,1,\ldots,N-1\} in which site ii is masked is then independent across sites, with P(σi=n)=Δpn\mathbb{P}(\sigma_i = n) = \Delta p_n. Generation traverses the schedule in reverse: in step nn the revealed fraction rises from pnp_n to pn+1p_{n+1}, and each site that is still masked is revealed with probability qn=Δpn/(1−pn)q_n = \Delta p_n / (1 - p_n), so that the sites revealed in step nn are again those with σi=n\sigma_i = n. Once revealed, a token never changes. A complete history of tokens (“path”) is then specified by (x,σ)(\mathbf{x}, \boldsymbol{\sigma}) containing the token xix_i and the associated step σi\sigma_i at which it is masked/revealed. The associated path probability is pdata(x)w(σ)p_{\text{data}}(\mathbf{x}) w(\boldsymbol{\sigma}) with w(σ)=∏iΔpσiw(\boldsymbol{\sigma}) = \prod_i \Delta p_{\sigma_i}.

We assume knowledge of the exact conditional distribution pdata(xi∣xS)p_{\text{data}}(x_i|\mathbf{x}_S) of each masked site ii conditional on the set SS of revealed sites [5], where xS={xj:j∈S}\mathbf{x}_S = \{x_j : j \in S\}. This distribution is also called the ideal denoiser and corresponds to perfect training, since it isolates the error of parallel decoding from the error of learning. Two generative processes are compared:

  • The exact sampler is precisely the time reversal of masking, characterized by the path probability P(x,σ)=pdata(x)w(σ)P(\mathbf{x}, \boldsymbol{\sigma}) = p_{\text{data}}(\mathbf{x}) w(\boldsymbol{\sigma}). At step nn, this would require unmasking sites with the conditional probability pdata(xUn∣xSn)p_{\text{data}}(\mathbf{x}_{U_n}|\mathbf{x}_{S_n}), where UnU_n denotes the sites revealed at step nn and SnS_n the sites revealed before step nn. Thus we can also write
P(x,σ)=w(σ)∏n=0N−1pdata(xUn∣xSn)(1)P(\mathbf{x},\boldsymbol{\sigma})=w(\boldsymbol{\sigma})\prod_{n=0}^{N-1}p_{\mathrm{d a t a}}(\mathbf{x}_{U_{n}}|\mathbf{x}_{S_{n}}) \tag{1}
  • The parallel sampler approximates the exact conditional of the jointly revealed sites by a product
pdata(xUn∣xSn)≈∏i∈Unpdata(xi∣xSn)(2)p_{\mathrm{d a t a}}(\mathbf{x}_{U_{n}}|\mathbf{x}_{S_{n}})\approx\prod_{i\in U_{n}}p_{\mathrm{d a t a}}(x_{i}|\mathbf{x}_{S_{n}}) \tag{2}

Thus the path probability is

Q(x,σ)=w(σ)∏n=0N−1∏i∈Unpdata(xi∣xSn)(3)Q(\mathbf{x},\boldsymbol{\sigma})=w(\boldsymbol{\sigma})\prod_{n=0}^{N-1}\prod_{i\in U_{n}}p_{\mathrm{d a t a}}(x_{i}|\mathbf{x}_{S_{n}}) \tag{3}

The exact sampler reveals the same groups as the parallel sampler, but sampling it with a denoiser requires drawing each group token by token via the chain rule, at the cost of one network evaluation per token. Thus the two samplers coincide if tokens are revealed one at a time.

The relative error of the parallel sampler compared with the exact sampler is characterised by the relative entropy (Kullback–Leibler divergence)

B=∑x,σP(x,σ)ln⁡P(x,σ)Q(x,σ)=⟨ln⁡P(X,σ)Q(X,σ)⟩(4)B=\sum_{\mathbf{x},\boldsymbol{\sigma}}P(\mathbf{x},\boldsymbol{\sigma})\ln\frac{P(\mathbf{x},\boldsymbol{\sigma})}{Q(\mathbf{x},\boldsymbol{\sigma})}=\left\langle\ln\frac{P(\mathbf{X},\boldsymbol{\sigma})}{Q(\mathbf{X},\boldsymbol{\sigma})}\right\rangle \tag{4}

We will generally use ⟨...⟩\langle...\rangle for expectations with respect to the exact process, and ⟨...⟩Q\langle...\rangle_Q for the parallel sampled process. Since P(x,σ)P(\mathbf{x}, \boldsymbol{\sigma}) is likewise the path probability of the forward process, Eq. (4) is just the entropy production of stochastic thermodynamics [25, 26]. BB vanishes when generation exactly reverses masking, and it is positive otherwise. With Eqs. (1),(3) Eq. (4) becomes a sum over steps

B=∑n=0N−1⟨ln⁡pdata(XUn∣XSn)∏i∈Unpdata(Xi∣XSn)⟩(5)B=\sum_{n=0}^{N-1}\left\langle\ln\frac{p_{data}(\mathbf{X}_{U_{n}}|\mathbf{X}_{S_{n}})}{\prod_{i\in U_{n}}p_{data}(X_{i}|\mathbf{X}_{S_{n}})}\right\rangle \tag{5}

Each term compares, for the tokens revealed in step nn, their exact joint probability given everything revealed before with the product of their individual probabilities. Replacing a joint distribution by the product of its single-site marginals is a mean-field approximation, so BB is the accumulated error of one mean-field approximation per step. By Gibbs' inequality each term is non-negative, and it vanishes when the tokens revealed together are independent given the revealed ones, in particular when at most one token is revealed. In Appendix A, the relationship between BB and the variational bound that MDMs are trained to minimize [3, 4] is discussed: the variational bound measures the quality of the denoiser, whereas BB measures the additional error incurred when generation uses finitely many steps.

Factorising a single step. Each term of Eq. (5) can be taken apart further. Label the sites revealed in step n as i1,…,imi_{1}, \ldots, i_{m}, in any order. The chain rule then factorises their exact joint distribution as if they were drawn one after the other, each token conditioned on the tokens drawn before it

pdata(xUn∣xSn)=∏j=1mpdata(xij∣xi1,…,xij−1;xSn)(6)p_{\mathrm{d a t a}}(\mathbf{x}_{U_{n}}|\mathbf{x}_{S_{n}})=\prod_{j=1}^{m}p_{\mathrm{d a t a}}(x_{i_{j}}|x_{i_{1}},\ldots,x_{i_{j-1}};\mathbf{x}_{S_{n}}) \tag{6}

The parallel sampler uses ∏j=1mpdata(xij∣xSn)\prod_{j=1}^{m} p_{\mathrm{data}}(x_{i_j}|\mathbf{x}_{S_n}) instead, i.e., every token is drawn as if it were the first one. The ratio of the two is a product of single-token ratios, so the logarithm in Eq. (5) becomes a sum

⟨ln⁡pdata(XUn∣XSn)∏j=1mpdata(Xij∣XSn)⟩=∑j=2m⟨ln⁡pdata(Xij∣Xi1,…,Xij−1;XSn)pdata(Xij∣XSn)⟩=∑j=2mISn(ij;{i1,…,ij−1})(7)\begin{aligned}&\left\langle\ln\frac{p_{\mathrm{data}}(\mathbf{X}_{U_{n}}|\mathbf{X}_{S_{n}})}{\prod_{j=1}^{m}p_{\mathrm{data}}(X_{i_{j}}|\mathbf{X}_{S_{n}})}\right\rangle\\&=\sum_{j=2}^{m}\left\langle\ln\frac{p_{\mathrm{data}}(X_{i_{j}}|X_{i_{1}},\ldots,X_{i_{j-1}};\mathbf{X}_{S_{n}})}{p_{\mathrm{data}}(X_{i_{j}}|\mathbf{X}_{S_{n}})}\right\rangle\\&=\sum_{j=2}^{m}I_{S_{n}}(i_{j};\{i_{1},\ldots,i_{j-1}\})\\ \end{aligned} \tag{7}

The jj-th term is the average gain in log-probability of token iji_j from knowing the co-revealed tokens drawn before it, which the parallel sampler discards. The first token gains nothing, since nothing co-revealed precedes it. In the last line we have introduced the mutual information between token iji_j and tokens {i1,…,ij−1}\{i_1, \ldots, i_{j-1}\}. For two single sites we write IS(i;j)I_S(i;j), which is given by

IS(i;j)=⟨ln⁡pdata(Xi,Xj∣XS)pdata(Xi∣XS)pdata(Xj∣XS)⟩(8)I_{S}(i;j)=\left\langle\ln\frac{p_{\mathrm{data}}(X_{i},X_{j}|\mathbf{X}_{S})}{p_{\mathrm{data}}(X_{i}|\mathbf{X}_{S})p_{\mathrm{data}}(X_{j}|\mathbf{X}_{S})}\right\rangle \tag{8}

which follows from the j=2j = 2 term of Eq. (7) with p(xi,xj∣xS)=p(xi∣xj,xS)p(xj∣xS)p(x_i, x_j|\mathbf{x}_S) = p(x_i|x_j, \mathbf{x}_S)p(x_j|\mathbf{x}_S). This mutual information of pairs is the central quantity in the theory that we develop in the following. Note that the individual terms in Eq. (7) depend on the order chosen, but their sum does not, because the left-hand side does not refer to any order. The order is therefore a bookkeeping device that can be chosen for convenience. This freedom is useful whenever the data have a short-range structure, such as for Markov data, which we discuss next.