Manuscript Offprint
arXiv:2611.07845Masked diffusion as random sequential adsorption: an exactly solvable model for parallel decoding
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 tokens takes 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 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 , 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 -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- 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 , sequence length and schedule. For large , 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 , we can test the large- theory directly and identify when it applies: the uniform schedule requires , where is the correlation length, while the cosine schedule of [29] only requires . 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 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 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 of tokens from a vocabulary of symbols are drawn from a distribution . The forward (masking) process is defined by a schedule of revealed fractions. In the step from to , each site that is still revealed is masked independently with probability , where . The step in which site is masked is then independent across sites, with . Generation traverses the schedule in reverse: in step the revealed fraction rises from to , and each site that is still masked is revealed with probability , so that the sites revealed in step are again those with . Once revealed, a token never changes. A complete history of tokens (“path”) is then specified by containing the token and the associated step at which it is masked/revealed. The associated path probability is with .
We assume knowledge of the exact conditional distribution of each masked site conditional on the set of revealed sites [5], where . 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 . At step , this would require unmasking sites with the conditional probability , where denotes the sites revealed at step and the sites revealed before step . Thus we can also write
- The parallel sampler approximates the exact conditional of the jointly revealed sites by a product
Thus the path probability is
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)
We will generally use for expectations with respect to the exact process, and for the parallel sampled process. Since is likewise the path probability of the forward process, Eq. (4) is just the entropy production of stochastic thermodynamics [25, 26]. vanishes when generation exactly reverses masking, and it is positive otherwise. With Eqs. (1),(3) Eq. (4) becomes a sum over steps
Each term compares, for the tokens revealed in step , 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 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 and the variational bound that MDMs are trained to minimize [3, 4] is discussed: the variational bound measures the quality of the denoiser, whereas 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 , 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
The parallel sampler uses 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
The -th term is the average gain in log-probability of token 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 and tokens . For two single sites we write , which is given by
which follows from the term of Eq. (7) with . 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.
A. Markov data
Equation (5) holds for any data, but evaluating it requires the joint statistics of all tokens revealed together, given everything revealed before. This becomes tractable for data generated by a stationary Markov chain, in which each token depends only on its predecessor. The chain is specified by a transition matrix T, where V is the number of token types and
and by its stationary distribution , the normalised solution of . A sequence then has probability
The probability of going from token to token in steps is the matrix element of the -th matrix power, and for large , when the memory of the starting token is lost. The transition matrix also satisfies
In language modelling this model is the bigram model [20]: for characters of English text , for words .
The simplest example has token types, written as spins , which switch with probability at each step:
\begin{align*}T=\begin{pmatrix}1-f&f\\ f&1-f\end{pmatrix},\qquad\pi=\left(\tfrac{1}{2},\tfrac{1}{2}\right),\ $ T^{k})_{uv}=\tfrac{1}{2}(1+\lambda^{k}s_{u}s_{v}),\end{align*}(12)
with . This is the zero-field Ising chain, with . Its correlations decay as with correlation length , and switches are domain walls, which occur independently with density . We use this chain as the main example in Sec. VI.
Correlation length. For a general chain, the approach of to is controlled by the eigenvalues of . For a diagonalisable , is a sum of terms proportional to (), with correlation lengths . The largest of them, , sets the range of the correlations: a token at distance from a known token is distributed as if that token were unknown. For the spin chain of Eq. (12) the only non-trivial eigenvalue is , so as above. Large means predictable data: switches are rare, with density , and the chain consists of domains of mean length . As , and neighbouring spins become independent.
We will see below that both the range of the correlations (the correlation length) and their strength (measured by the mutual information) matter: the strength sets the size of the error, and the range sets how the error is distributed over the course of generation.
B. Shielding
The key property of Markov data is that revealed tokens shield. We call a maximal sequence of masked sites a gap, and label it by the revealed tokens and on its left and right at the ends of the sequence). Sites inside a gap are numbered from the left, so site is a distance from the left boundary and from the right one. Because the probability of a sequence is a product of nearest-neighbour factors, fixing the revealed tokens cuts it into independent pieces: the contents of different gaps are independent, and the content of a gap depends only on its two boundary tokens. In particular, the probability that site of the gap carries token is the probability of going from to in steps and from to in the remaining steps, normalised by the probability of going from to in steps:
(13) where the normalisation is fixed by Eq. (11)
At the ends of the sequence the missing boundary simply drops out, which we implement by setting , and . The ideal denoiser is then precisely : the probability that site assumes token inside the gap , where the conditional on is reduced to the dependence on due to shielding. Because for , a boundary token influences only the sites of a gap within a few correlation lengths of it; deeper inside a long gap, .
We can also express which the exact process uses to reveal two co-revealed sites. Denoting the joint probability that that site assumes token and site assumes token inside gap we have
with .
Path error for Markov data. For Markov data, shielding simplifies Eq. (7) further. Order the co-revealed sites from left to right, so that is the nearest co-revealed site to the left of . By the chain rule for the mutual information,
(16)
and the first term vanishes, since given and the token is independent of everything further to the left. Every term in Eq. (7) thus reduces to a pair mutual information, ; it vanishes if a site of lies between the two, i.e., if they belong to different gaps. Three co-revealed tokens at sites in the same gap therefore cost , irrespective of their spacing. The outer pair is correlated, , but its correlation is captured by the middle token and is already counted. Drawing from right to left gives the same two pairs, since the mutual information is symmetric. Using Eqs. (7),(16), Eq. (5) therefore becomes
where the inner sum runs over pairs of consecutive co-revealed sites with no co-revealed site between them. If sites lie in a gap of , at positions within it, shielding implies that their mutual information given depends only on the gap. We write
(a)

(b)
FIG. 1. (a) A labelled gap of masked sites M. Revealing the selected sites with tokens splits it into three conditionally independent labelled gaps, as a deposition does in RSA. (b) The late-stage error mechanism for data with a single correlation length (binary tokens ). A gap whose boundaries disagree contains one switch (domain wall). Two sites revealed in the same step can be drawn in the impossible order , which creates two spurious switches that would not occur under exact sampling.
and Eq. (8) leads to the expression
while if they lie in different gaps. It remains to average Eq. (17) over the sets and for which we need the gap statistics.
III. THE ANALOGY WITH RSA
Shielding is also what makes one-dimensional RSA exactly solvable [21, 22]. In Rényi’s “car parking” problem, rods are deposited one by one at random positions on a line, and each deposited rod splits a gap into two gaps that evolve independently afterwards. The density of gaps of each length therefore obeys a closed linear equation, even though the full configuration is a complicated many-body state. In masked generation, revealed tokens are the deposited particles and masked sequences are the gaps, see Fig. 1(a). The value of a revealed token is a species that labels the gaps on either side, just as particle orientations label gaps in the “Paris car parking” problem of anisotropic particles [23]. The species of a newly deposited particle is drawn from Eq. (13). Apart from the factor , its numerator is a product of two factors, and , each describing the influence of one neighbouring revealed token, and each decays to 1 (no influence) beyond the correlation lengths of the chain. This is the factorised form of the deposition rate in interacting RSA, which was solved exactly in [24]. Here, however, the interaction selects the species of the deposited particle rather than whether it is accepted. The new ingredient is the parallel update: particles deposited in the same step do not see each other, so their species are chosen as if the others were absent.
Master equation. Let be the expected number of gaps of type in the sampler after steps; initially there is a single gap, . In step , every masked site is selected independently with probability , and each selected site draws its token from . A parent gap therefore produces a child gap in one of three ways:
• Survival: none of its sites is selected. This happens with probability and the child is the parent itself.
-
End child: one site is selected. The child occupies sites of a parent with the same left boundary . Its sites must remain unselected, with probability , and site must be selected, with probability , and receive the token c, with probability . The mirror-image process creates a child at the right end of a parent with .
-
Interior child: two sites are selected. The child occupies sites of the parent. Its two bounding sites k and must both be selected, with probability , its own interior sites must remain unselected, with probability , and the bounding sites receive tokens a and c. The latter are selected with probability for the exact sampler, while the parallel sampler approximates
Since gaps evolve independently, with statistics that depend only on their labels, the expected number of children follows by summing these probabilities over all parents. This gives the closed linear master equation
\begin{aligned}\mathcal{N}_{n+1}(a,\ell,c)&=(1-q_{n})^{\ell}\Big[\mathcal{N}_{n}(a,\ell,c)\\&+q_{n}\sum_{\ell^{\prime}>\ell}\sum_{c^{\prime}}\mathcal{N}_{n}(a,\ell^{\prime},c^{\prime})m_{\ell+1}^{(a,\ell^{\prime},c^{\prime})}(c)\\&+q_{n}\sum_{\ell^{\prime}>\ell}\sum_{a^{\prime}}\mathcal{N}_{n}(a^{\prime},\ell^{\prime},c)m_{\ell^{\prime}-\ell}^{(a^{\prime},\ell^{\prime},c)}(a)\\&+q_{n}^{2}\sum_{\ell^{\prime}\geq\ell+2}a^{\prime},c^{\prime}}\mathcal{N}_{n}(a^{\prime},\ell^{\prime},c^{\prime})\\&\quad\times\sum_{k=1}^{\ell^{\prime}-\ell-1}m_{k,k+\ell+1}^{(a^{\prime},\ell^{\prime},c^{\prime})}(a,c)\Big],\end{aligned} \tag{20}where the parallel sampler uses Eq. (19) for the last term and , since a revealed token is never . The four terms are survival, the left and right end children, and the interior children. Eq. (20) is exact for any step size, including a single step in which all sites are revealed. Any number of sites of a parent can be selected in one
step, but every child is bounded by at most two of them, so higher powers of cannot occur: a gap has only two ends. The equation is exact for the expected counts even though the configuration generated by the parallel sampler is not distributed like the data, because only linearity of expectation is used.
Remarkably, the exact sampler described by Eq. (20) has a simple solution. Consider a gap . In the data, two tokens and at distance occur with probability . Before step both sites have been revealed with probability , and the sites between them are still masked with probability . Since a gap of length can be placed in positions, this suggests the ansatz
The two edge gaps follow in the same way, and , and the fully masked sequence has probability . Eq. (21) is indeed the solution of Eq. (20) for any , as can be shown by direct substitution. This simple result highlights that the exact sampler preserves the data distribution at any step. The parallel sampler on the other hand deviates from it and has no simple solution. The resulting error is measured by , Eq. (5). In the physics context, the exact sampler preserves the equilibrium distribution, while the parallel sampler is a non-equilibrium process giving rise to the dissipation .
IV. PATH ERROR AND OUTPUT QUALITY
A. Path error
For Markov data we can now evaluate exactly: (i) the path error of Eq. (5); and (ii) the generative perplexity of the output, which measures the output quality of MDMs [5]. The average over in Eq. (17) is taken over the exact process and can be calculated as follows. Given , each masked site belongs to independently with probability , so two sites of a gap form a consecutive co-revealed pair with probability : both are selected and none of the sites between them is. Averaging over then replaces the sum over the gaps of by the gap densities. Hence
(22)
with given by Eq. (18).
B. Generative perplexity
This quantity measures the quality of the final output of the sampler, i.e., after every gap has been filled. After the last step every gap has length zero, and is the expected number of adjacent pairs in the output; in RSA terms, the final distribution of nearest-neighbour species. This is enough to quantify how “typical” the generated sequences are under the true distribution. In machine learning the average
is called the cross-entropy of the text under the parallel sampler . Its exponential per token, , is the generative perplexity, an effective number of equally likely choices per token, which is the standard quality measure for MDMs [2, 3, 5]. In practice it is evaluated with a large reference model in place of the unknown , and it can be lowered artificially by reducing the diversity of the output [27]; for Markov data neither issue arises, since is known. For Markov data can be evaluated exactly in the RSA approach. We have from Eq. (10)
and thus
Averaging over the output of the sampler, each pair contributes times its expected number , and the first token contributes with probability . These counts depend on the number of steps and on the schedule, which are provided by the master equation. For the exact sampler, , since there are bonds and each bond has configuration with probability . We also have . For the parallel sampler, and are given from the gap statistics of the master equation. The difference in cross entropy between exact and parallel sampler is therefore
It counts the excess of improbable adjacent pairs in the output, each weighted by . For the spin chain this is literally the excess energy of spurious domain walls (Sec. VI). thus requires the statistics of obtained from the master equation of the parallel process, while the path error Eq. (22) requires only the gap density of the exact sampler, Eq. (21).
C. Numerical validation
The master equation (20) and Eq. (22) are exact, and we checked them against two computations that do not use the gap representation (see Appendix B for more details): (i) Exact enumeration. For short sequences all generation histories can be listed: each site has one of reveal steps, and the sequence one of values. For every history, follows from Eq. (3), with the ideal denoiser obtained by conditioning directly. Summing over histories with a prescribed schedule gives the expected pair counts and the path relative entropy (4). For binary chains with () and a random three-state chain (), the master equation agrees with enumeration to , and Eq. (22) with the enumerated to a relative , i.e., to machine precision. (ii) Direct simulation. For we simulate the parallel sampler: in each step the selected sites draw their tokens from conditionals computed from the state before the step. With samples per case, the simulated and all pair counts agree with the master equation within two standard errors, and a simulation of the exact sampler gives consistent with zero.
V. OPTIMAL SCHEDULES AS GEODESICS
We now make an additional approximation in Eq. (22) by setting . This neglects screening: a pair at distance is counted in Eq. (22) only if none of the sites between them is revealed in the same step, which fails with probability . The pairs that carry information have , since beyond a correlation length two sites are nearly independent, and , since they must lie in the same gap. The approximation therefore requires that few correlated partners of a site are revealed in the same step, . It is most restrictive in the first step, where and it requires . For the information is carried by adjacent pairs, for which the screening factor is exactly one. Eq. (22) then becomes
Substituting Eq. (21), we can use (terms with large are suppressed by the factor ) and neglect the edge gaps and the fully masked sequence, whose contributions are of relative order . With
we then obtain
(29)
Eq. (28) highlights that is proportional to and a term that depends on the data.
As shown in Appendix C, can be evaluated further by performing the sum over the tokens . Writing the pair in a gap as , , , Eq. (29) becomes
where
and is the mutual information of two data tokens at distance m
A. Geodesic and minimum error
For a smooth schedule the steps are , with a reduced time. The error per token with Eq. (28) thus becomes for large
where and . Eq. (33) has the form of the dissipation of a slowly driven system [14, 28]. When a control parameter is changed over a time , the excess work is , with a friction coefficient. Here plays the role of the friction, the revealed fraction that of the control parameter, and the number of steps that of the protocol duration. Analogous speed-accuracy relations have been derived for continuous diffusion models [19]. An equation in the form of Eq. (33) has been derived for general data in [9], where is related to the conditional entropy of a masked token when every other site is revealed independently with probability . Eq. (30) is the explicit result for this metric in the case of Markov data.
Minimising Eq. (33) at fixed N is a geodesic problem [9]. Defining the Lagrangian
the optimal schedule minimizes subject to and , and therefore satisfies the Euler–Lagrange equation
Since does not depend explicitly on , Eq. (35) has a first integral (the Beltrami identity),
The integrand of Eq. (33), i.e., the error per unit of reduced time, is thus conserved along the optimum:
In discrete form every step contributes the same amount, , to Eq. (28). We assume that is continuous and strictly positive on , and that is continuously differentiable. The constant in Eq. (36) is then positive: would imply , contradicting and . Hence never vanishes, and being continuous it cannot change sign, so that and
i.e., the optimal schedule takes small steps where G is large. To integrate Eq. (37), we define the cumulative length
which is continuously differentiable with and . With Eq. (37),
Integrating over using gives
The boundary condition fixes the constant to , where
is the thermodynamic length [14, 15]. Since is strictly increasing, it is invertible, and the optimal schedule is , equivalently
Inserting Eq. (36) with into Eq. (33) yields the error of the optimal schedule [9]
which is the global minimum. Indeed, for any mono-tone schedule with and , the Cauchy–Schwarz inequality gives , with equality if and only if is constant, i.e., for the schedule (42).
Note that the geodesic is optimal only to leading order in ; at very small other schedules can do marginally better. The passage from Eq. (28) to Eq. (33) also requires the steps to be small compared with the scale over which varies, . This scale is again set by the correlation length. The typical gap length is compared with : early in generation, , gaps are longer than a correlation length and masked sites share information with many others; later, revealed sites lie within a correlation length of every masked site and screen most of it. For long correlations therefore changes on the scale , and both conditions fail if the first steps are wider than . For the uniform schedule they amount to . Since is known exactly for Markov data, Eq. (22), these conditions can be tested directly (Sec. VI).
VI. EXAMPLES
We evaluate the expressions of the preceding sections for two data sets: the binary chain of Eq. (12), whose correlation length can be tuned, and a bigram model of English text, whose correlations are short-ranged. All quantities are computed exactly from the transition matrix ; no sampling is involved except in the validation against direct simulations described above.
Three masking/unmasking schedules are investigated:
(i) The uniform schedule, where
Eq. (33) gives , where the constant U can be calculated in closed form (see Appendix D):
(45)
Remarkably, although involves mutual information at all lags , its integral over retains only the two shortest lags; all contributions from cancel exactly. The error of the uniform schedule is therefore determined solely by nearest- and next-nearest-neighbour correlations in the data.
(a)

(b)
(c)
(d)
FIG. 2. Binary chain with and up to 2048. (a) The metric , Eq. (30), for (dark to light): for long correlations it is concentrated at small . (b) Path error against for the uniform, cosine and optimal schedules. Symbols: exact values from Eq. (22) at ; solid lines: the large- results , Eq. (45), and computed from . (c) against at ; dotted lines mark the large- asymptotic results, see (b). (d) Excess cross-entropy per token, , from the master equation (20) at , against .
(a)

(b)
FIG. 3. Character-level English bigram model for and up to 512. (a) The metric , normalised by , compared with the binary chain at the same correlation length, , and at . (b) Path error against for the uniform, cosine and optimal schedules; dotted lines mark the large- coefficients , Eq. (45), and computed from .
(ii) The cosine schedule of MaskGIT [29], where
The large N error follows from Eq. (33).
(iii) The optimal schedule, where . We invert Eq. (42) for and evaluate at . The large N error is given in Eq. (43).
Fig. 2(a) shows for to 50. The metric is calculated from Eq. (30) on a grid of with the mutual information computed from powers of . The sum over gap lengths converges because of the factor , and it is truncated once the remaining terms fall below . By Eq. (29), is the information shared by pairs of masked sites in the same gap, given the revealed tokens. For short correlations varies little with . As grows, becomes large at small and decays quickly once the typical distance between revealed sites falls below : the metric is concentrated at the start of generation. Early on, gaps are long and a masked spin shares information with all spins within a distance . Late in generation, gaps are short compared with and the revealed boundaries already fix most sites inside, so that learning one masked site tells little about another. Only the rare gaps whose boundaries disagree contribute, because they must contain one switch at an uncertain position. Two sites of such a gap that are drawn independently can end up on the wrong sides of the switch, producing spurious switches, see Fig. 1(b).
Fig. 2(b) shows how the path error depends on the correlation length. Symbols denote the finite- results, where the exact path error is computed from Eq. (22) with the gap densities (21). Solid lines show the large- result Eq. (33), which agrees perfectly for used here. For the uniform schedule, increases with and saturates at . This saturation follows directly from Eq. (45): as , the binary chain approaches perfect order and both and approach , so . The uniform schedule spends most of its steps where is small, but its first steps cover the region at small where is large. The optimal schedule instead takes small steps in that region and large steps afterwards. Its error is largest for and then decreases: more predictable data make parallel decoding cheaper, provided the schedule starts with small steps. The gain over the uniform schedule therefore grows with , to a factor of about 7 at . The cosine schedule also starts with small steps and follows the optimal schedule closely for , but its error falls behind for longer correlations.
Fig. 2(c) shows the approach to the large- coefficients at . For all schedules coincide, since all tokens are revealed in one step. The uniform schedule reaches its coefficient only for of a few hundred, i.e., , as required by the conditions of Sec. V: its first step, , must be small compared with . The cosine and optimal schedules converge already for , because their first steps are much smaller. For the cosine schedule, whose first step is , they amount only to . The optimal schedule adapts its first step to the metric: by Eq. (42), for small , so that and the condition becomes . Since grows in proportion to while decreases, this
bound grows only slowly; for the binary chain it increases from 2.2 at to 5.7 at .
For the binary chain, Eq. (26) takes a simple form. Since is uniform, the first-token term vanishes, and takes only two values, for equal neighbours and for a switch, so the expected switch density is exactly . If is the expected number of switches in the actual output, the bracket in Eq. (26) is for switches and for equal neighbours, so that per token
where is the excess density of switches in the output. Each spurious switch costs , the energy of a domain wall.
Fig. 2(d) shows the consequence in the perplexity, which is computed from the master equation (20) of the parallel sampler, which gives , and hence . For the uniform schedule, for large as measured from the output, so that by Eq. (47) the perplexity excess grows as . On the other hand, the error per token saturates in this regime (see Fig. 2(b)). The perplexity grows for large because each spurious switch becomes more costly as the data become more predictable. In other words, as correlations get longer, the parallel sampler makes the same number of mistakes per token, but each mistake looks less plausible to the data model because the data become more predictable. For the optimal schedule, which suppresses switches, instead decreases beyond , and the reduction relative to the uniform schedule grows from a few percent at to a factor of about 9 at . The schedule that minimizes the path error thus also improves the quality of the output, although it was not constructed to do so.
A. English text example
To test the theory on real language statistics, we fitted a character-level bigram model of English to a public-domain corpus (Tiny Shakespeare [30]). The text was lowercased, every character other than a-z was mapped to a space, and runs of spaces were collapsed, leaving characters over V = 27 symbols. The transition matrix was estimated from bigram counts with add- smoothing, with , and is the stationary distribution of the fitted T. Smoothing is needed because the parallel sampler produces pairs that never occur in the corpus; without it would be infinite.
The correlations of this chain are short-ranged, with the largest correlation length only characters, but strong: adjacent characters share nats of information, as in “q” and “u”. The metric is correspondingly nearly flat, see Fig. 3(a), falling only from to . Its shape is similar to that of the binary chain with the same correlation length, but its magnitude is 15 times larger ( for the binary chain), because the binary chain at this has much weaker nearest-neighbour correlations. The range of the correlations sets the shape of , and their strength its magnitude.
Since every step costs roughly the same, the optimal schedule is almost uniform: and , a gain of only 0.3%, while the cosine schedule has coefficient 0.598, 20% worse, see Fig. 3(b). Starting with small steps no longer pays off: since each step costs , unequal steps are penalised unless varies correspondingly, and here it varies by only a factor 1.5, see Fig. 3(a). All three schedules reach their large- coefficients already for . The reason is that the assumptions underlying the small-step expression (33) hold even for large steps. First, Eq. (27) neglects screening, i.e., the factor , the probability that no site between a pair at distance is co-revealed. Here and , so the information is carried almost entirely by adjacent pairs, , for which this factor is exactly one. Second, replacing the sum (28) by the integral (33) requires to change little over a step, which holds for the nearly flat of Fig. 3(a) even for .
VII. CONCLUSION
For Markov data, generation in an MDM is shown to be an exactly solvable RSA process: the gap statistics provide both the path error and the output statistics exactly, for any number of steps. For many steps the error reduces to a thermodynamic metric, and the schedules that min-
imize it are its geodesics. The exact solutions clarifies in particular the interplay between the correlations and output error and quality. The longer the correlations, the more the error concentrates at the start of generation. Schedules that start slowly then gain more, both in path error and in perplexity, and also need fewer steps to reach their asymptotic behaviour. For predictable data with long correlations, the perplexity of the output under the uniform schedule can grow even when the information lost per token saturates, because each spurious switch becomes more costly. The geodesic schedule, although constructed only to minimize the path error, reduces the perplexity as well. On the other hand, for short-range data like English, a uniform schedule is already close to optimal.
The RSA picture also applies to rules for which positions to reveal, beyond the schedule, which fixes only how many. Any rule in which the selection probability of a site depends only on the nearest revealed tokens keeps Eq. (20) closed and corresponds to the acceptance function of interacting RSA [22, 24], so practical samplers of this kind [18, 29, 31, 32] can be analysed within the same framework.
Natural language has power-law correlations [33–35] and hierarchical structure [35–37] that bigram data lack. Measured mutual information decays exponentially at short distances, as for Markov data, and crosses over to a power law at longer distances [37]. For such data revealed tokens no longer shield, and the exact solution does not apply. Extending the approach beyond Markov data is left for future work.
[1] J. Austin, D. D. Johnson, J. Ho, D. Tarlow, R. van den Berg, Structured denoising diffusion models in discrete state-spaces. NeurIPS (2021), arXiv:2107.03006.
[2] A. Lou, C. Meng, S. Ermon, Discrete diffusion modeling by estimating the ratios of the data distribution. ICML (2024), arXiv:2310.16834.
[3] S. S. Sahoo et al., Simple and effective masked diffusion language models. NeurIPS (2024), arXiv:2406.07524.
[4] J. Shi, K. Han, Z. Wang, A. Doucet, M. K. Titsias, Simplified and generalized masked diffusion for discrete data. NeurIPS (2024), arXiv:2406.04329.
[5] J. Ou et al., Your absorbing discrete diffusion secretly models the conditional distributions of clean data. ICLR (2025), arXiv:2406.03736.
[6] S. Nie et al., Large language diffusion models. NeurIPS (2025), arXiv:2502.09992.
[7] Inception labs, Mercury: Ultra-Fast Language Models Based on Diffusion. arXiv:2506.17298 (2025).
[8] W. Kang et al., ParallelBench: Understanding the trade-offs of parallel decoding in diffusion LLMs. ICLR (2026), arXiv:2510.04767.
[9] H. Lavenant, G. Zanella, Error bounds and optimal schedules for masked diffusions with factorized approximations. arXiv:2510.25544 (2025).
[10] S. Chen, K. Cong, J. Li, Optimal inference schedules for masked diffusion models. COLT, PMLR 336, 1279–1311 (2026), arXiv:2511.04647.
[11] M. J. Wainwright, The data geometry of masking diffusion: Certified-optimal schedules via unmasking growth complexity. arXiv:2608.13520 (2026).
[12] S. Zhang et al., Generation order and parallel decoding in masked diffusion models: An information-theoretic perspective. arXiv:2602.00286 (2026).
[13] G. Li, C. Cai, A convergence theory for diffusion language models: An information-theoretic perspective. arXiv:2505.21400 (2025).
[14] P. Salamon, R. S. Berry, Thermodynamic length and dissipated availability. Phys. Rev. Lett. 51, 1127–1130 (1983).
[15] G. E. Crooks, Measuring thermodynamic length. Phys. Rev. Lett. 99, 100602 (2007).
[16] Y.-H. Park, C.-H. Lai, S. Hayakawa, Y. Takida, Y. Mitsufuji, Jump your steps: Optimizing sampling schedule of discrete diffusion models. ICLR (2025), arXiv:2410.07761.
[17] G. Feng et al., Theoretical benefit and limitation of diffusion language model. NeurIPS (2025), arXiv:2502.09622.
[18] V. Bansal, C. Cho, S. Kumar, S. Sanghavi, P. Sarkar,
Walk fast but be careful: Understanding parallel sampling in masked diffusion. arXiv:2606.22976 (2026).
[19] K. Ikeda, T. Uda, D. Okanohara, S. Ito, Speed-accuracy relations for diffusion models: Wisdom from nonequilibrium thermodynamics and optimal transport. Phys. Rev. X 15, 031031 (2025).
[20] C. E. Shannon, A mathematical theory of communication. Bell Syst. Tech. J. 27, 379–423 (1948).
[21] A. Rényi, On a one-dimensional problem concerning random space filling [in Hungarian]. Publ. Math. Inst. Hung. Acad. Sci. 3, 109–127 (1958); English translation in Sel. Transl. Math. Stat. Prob. 4, 203–218 (1963).
[22] J. W. Evans, Random and cooperative sequential adsorption. Rev. Mod. Phys. 65, 1281–1329 (1993).
[23] A. Baule, Shape universality classes in the random sequential adsorption of nonspherical particles. Phys. Rev. Lett. 119, 028003 (2017).
[24] A. Baule, Optimal random deposition of interacting particles. Phys. Rev. Lett. 122, 130602 (2019).
[25] R. Kawai, J. M. R. Parrondo, C. Van den Broeck, Dissipation: The phase-space perspective. Phys. Rev. Lett. 98, 080602 (2007).
[26] U. Seifert, Stochastic thermodynamics, fluctuation theorems and molecular machines. Rep. Prog. Phys. 75, 126001 (2012).
[27] K. Zheng et al., Masked diffusion models are secretly time-agnostic masked models and exploit inaccurate categorical sampling. ICLR (2025), arXiv:2409.02908.
[28] D. A. Sivak, G. E. Crooks, Thermodynamic metrics and optimal paths. Phys. Rev. Lett. 108, 190602 (2012).
[29] H. Chang, H. Zhang, L. Jiang, C. Liu, W. T. Freeman, MaskGIT: Masked generative image transformer. CVPR (2022), arXiv:2202.04200.
[30] A. Karpathy, char-rnn: Multi-layer recurrent neural networks for character-level language models (2015). https://github.com/karpathy/char-rnn (Tiny Shakespeare corpus).
[31] H. Ben-Hamu, I. Gat, D. Severo, N. S. Nolte, B. Karrer, Accelerated sampling from masked diffusion models via entropy bounded unmasking. NeurIPS (2025), arXiv:2505.24857.
[32] B. Kim, D. Jeon, M. Jeon, A. No, DAPD: Dependency-aware parallel decoding via attention for diffusion LLMs. ICML (2026), arXiv:2603.12996.
[33] W. Ebeling, T. Pöschel, Entropy and long-range correlations in literary English. Europhys. Lett. 26, 241–246 (1994).
[34] E. G. Altmann, G. Cristadoro, M. Degli Esposti, On the origin of long-range correlations in texts. PNAS 109, 11582–11587 (2012).
[35] H. W. Lin, M. Tegmark, Critical behavior in physics and probabilistic formal languages. Entropy 19, 299 (2017).
[36] N. Chomsky, Three models for the description of language. IRE Trans. Inf. Theory 2, 113–124 (1956).
[37] T. Sainburg, B. Theilman, M. Thielk, T. Q. Gentner, Parallels in the sequential organization of birdsong and human speech. Nat. Commun. 10, 3636 (2019).
Appendix A: Relation between B and the training loss
MDMs are trained by masking a data sequence at random and minimising the cross-entropy of the network's predictions for the masked tokens [3-5]. The connection with follows from the distribution of sequences generated by the parallel sampler, , where in this paragraph denotes Eq. (3) with replaced by . Since the reveal steps are drawn from independently of the tokens, Jensen's inequality gives the variational bound
(A1)
The training loss is the average of the right-hand side over the data,
a sum of cross-entropies, one for each masked token, each of which is minimized by the true conditional. The minimizer is therefore the ideal denoiser, for any schedule and any . At the minimum, is the parallel sampler of Eq. (3), and since ,
(A3)
where is the entropy of the data. Even a perfectly trained network thus has a loss that exceeds the data entropy by : the path error is the part of the variational bound that cannot be removed by training, only by the choice of and the schedule. In practice MDMs are trained with the continuous-time limit of Eq. (A2), ,
where each site belongs to independently with probability , as follows from Eq. (A2) with . In this limit and the minimal loss equals [5]. The training objective therefore measures the quality of the denoiser, whereas measures the additional error incurred when generation uses finitely many steps.
Appendix B: Numerical validation and details
The master equation (20) and the path error (22) are exact. We checked them against two computations that do not use the gap representation: exact enumeration of all generation histories for short sequences (App. B2), and direct simulation of the parallel sampler for long sequences (App. B3). We use the binary chain of Eq. (12), parametrised by and , and a random asymmetric three-state chain, generated with a fixed seed, to check that nothing relies on the symmetry of the binary chain. The following schedules are used in the numerical validation.
1. Masking schedules
A schedule fixes the revealed fraction after of the steps; in step an expected number of tokens is revealed, i.e., a fraction of the tokens still masked. We compare three schedules, written in terms of the reduced time .
(i) The uniform schedule, , reveals the same expected number of tokens, , in every step. Since fewer tokens remain masked as generation proceeds, it reveals an increasing fraction of them, , ending with .
(ii) The cosine schedule, , is the schedule of MaskGIT [29], where the masked fraction decreases slowly at first and quickly at the end. It reveals few tokens in the first steps, , compared with for the uniform schedule, and more in the last ones, . It therefore takes small steps at the start of generation and large steps at the end.
The continuum forms of these schedules and the optimal schedule are discussed in Sec. VI; the optimal schedule is derived in Sec. V.
2. Exact enumeration
For short sequences every generation history can be listed. A history is specified by the reveal steps , which occur with probability , and by the tokens . For each of the step assignments and sequences we compute the path probability of the parallel sampler, Eq. (3). It requires the conditional of every token revealed in step , given the tokens revealed before. In the enumeration this conditional is obtained by brute force from the definition of a conditional probability,
TABLE I. Exact enumeration of all generation histories, at the largest enumerated. is the largest deviation of the pair counts of the master equation from enumeration, and the relative deviation of Eq. (22) from the enumerated path relative entropy .
| chain | schedule | |||||
|---|---|---|---|---|---|---|
| binary, | 8 | uniform | 4 | 0.3068 | ||
| binary, | 8 | cosine | 4 | 0.3442 | ||
| binary, | 8 | uniform | 4 | 0.5501 | ||
| binary, | 8 | cosine | 4 | 0.5405 | ||
| binary, | 8 | uniform | 4 | 0.7634 | ||
| binary, | 8 | cosine | 4 | 0.6063 | ||
| three-state | 6 | uniform | 3 | 0.1028 | ||
| three-state | 6 | cosine | 3 | 0.1227 |
where the marginals are computed by summing the full sequence probability, Eq. (10), over all values of the tokens that are not fixed. For these sums have at most terms and are evaluated explicitly. This computation uses neither shielding nor the bridge formulas (13),(15) nor the gap densities. Summing the path probabilities over histories gives the expected pair counts in the output, which the master equation predicts, and the path relative entropy (4), which Eq. (22) predicts. Separately, the distributions (13),(15), including the conventions at the ends of the sequence, were checked against the same brute-force conditionals for .
Table I lists the comparison at the largest number of steps enumerated. In all enumerated cases, for the binary chains and for the three-state chain, the master equation and Eq. (22) agree with enumeration to machine precision.
3. Direct simulation
For long sequences we simulate the parallel sampler. In step , every masked site is selected with probability , its nearest revealed sites are determined from the state before the step, and its token is drawn from the conditional (13); all selected sites are then updated simultaneously. From samples of length we estimate , the first-token distribution and , Eq. (26), and compare them with the master equation. As a control we simulate the exact sampler, which must give . Table II lists the comparison. All deviations, of and of every pair count, are below two standard errors.
TABLE II. Direct simulation of the parallel sampler (, samples per row) against the master equation: excess cross-entropy per token, , with the standard error of the simulation. The last row simulates the exact sampler, for which .
| chain | schedule | master equation | simulation | |
|---|---|---|---|---|
| binary, | uniform | 8 | 0.05137 | |
| binary, | uniform | 4 | 0.34969 | |
| binary, | uniform | 16 | 0.07754 | |
| binary, | cosine | 64 | 0.01261 | |
| binary, | uniform | 16 | 0.14928 | |
| three-state | cosine | 8 | 0.02022 | |
| exact sampler, | - | - | 0 |
Appendix C: Derivation of Eq. (30)
Eq. (29) contains the interior gaps , with tokens of the vocabulary; gaps with contain no pair and do not contribute. The dependence on the boundary tokens enters only through the combination
so that
We evaluate in four steps. Throughout, the boundary tokens sit at sites 0 and of the gap, and the pair at sites carries the tokens and .
Step 1: the ratio in Eq. (18). With Eqs. (13) and (15),
In the ratio of the joint distribution to the product of the marginals, the factors and cancel, and one factor remains:
Step 2: the weight is the data distribution. Inserting Eq. (18) into Eq. (C1), the boundary weight multiplies the joint distribution of the pair, and the denominator of Eq. (15) cancels:
By Eqs. (10) and (11), the right-hand side is the probability that four tokens of the data at the positions take the values . Hence is the average of the logarithm of Eq. (C6) over the data:
This step requires the average over the boundary tokens: for fixed , the tokens inside the gap are not distributed as in the data.
Step 3: each logarithm is a mutual information. Each term of Eq. (C8) involves two of the four tokens, a distance apart. By stationarity their joint probability is , so that
where is the entropy of a single token. The second equality follows from the definition of and :
Terms with carry zero weight and do not contribute.
Step 4: the entropies cancel. The four logarithms in Eq. (C8) refer to the distances (the pair), (the two boundaries), (left boundary to the right site of the pair), and (left site of the pair to the right boundary). Two enter with a plus and two with a minus sign, so the single-token entropies cancel, and
Pair variables. We label a pair in a gap by , and : the distances from the left boundary to the first site of the pair, between the two sites, and from the second site to the right boundary. The constraints and are equivalent to
, and each triple corresponds to exactly one gap length and one pair . In these variables the distances in Eq. (C11) are , , and , so that , and the prefactor in Eq. (C2) becomes
Replacing the sums over , and in Eq. (C2) by a sum over gives Eq. (30).
Appendix D: Derivation of U, Eq. (45)
The large-N coefficient of the uniform schedule is , which we evaluate from Eq. (30). We write s = 1 - p and introduce the generating function of the mutual information
which converges for since decays exponentially beyond the correlation length. Its derivatives are
so that and .
Step 1: summing over the outer distances. We insert Eq. (31) into Eq. (30) and treat the four terms separately, using .
(i) In the term the sums over and are geometric, , so that it contributes .
(ii) In the term the sum over r gives . With , each arises from m-1 pairs , so that the term contributes
By the symmetry the term gives the same.
(iii) In the term we set . Each arises from triples , so that the term contributes
Collecting the four terms,
As a check, at Eq. (D6) gives , the total pair information, which sets the metric at the start of generation (see Sec. VI).
Step 2: integrating over p. Changing the integration variable to s = 1 - p,
Using integration by parts yields in the second term
and in the term
(D9)
The boundary terms at vanish because of the factors and . Adding the three contributions to Eq. (D7), the integrals of appear with coefficients and cancel. Only the boundary terms at remain:
which is Eq. (45). Correlations at all distances enter through , but after integration only the boundary values and survive.