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

> Masked diffusion generation for Markov data is exactly solvable as random sequential adsorption, with path error equal to entropy production and optimal schedules given by geodesics of a thermodynamic metric.

- **Source:** [arXiv](https://arxiv.org/abs/2611.07845)
- **Published:** 2026-11-14
- **Permalink:** https://picx.dev/p/Yk09wD
- **Whiteboard:** https://picx.dev/p/Yk09wD/image

## Summary

# Masked Diffusion as Random Sequential Adsorption: An Exactly Solvable Model for Parallel Decoding

## Summary (Overview)

- **Maps masked diffusion models (MDMs) to statistical physics**: The paper establishes a rigorous connection between parallel decoding in masked diffusion models and the theory of random sequential adsorption (RSA) with labelled gaps, enabling exact solutions.

- **Identifies path error as entropy production**: For any data distribution, the error of parallel generation equals the entropy production of the generation process relative to the reversed masking process, expressed as a sum of mutual information terms.

- **Provides exact solution for Markov data**: For Markov chain data (bigram language models), generation becomes an exactly solvable RSA process governed by a closed linear master equation, yielding exact results for any number of steps, sequence length, and schedule.

- **Derives thermodynamic metric and optimal schedules**: For many steps, the error reduces to a thermodynamic metric where the unmasking schedule plays the role of a driving protocol; optimal schedules are geodesics of this metric, with error given by $\Lambda^2/N$.

- **Reveals correlation-dependent behaviour**: Longer correlations concentrate error at the start of generation; schedules that start slowly gain in both path error and perplexity, while short-range correlations (like English text) make uniform schedules nearly optimal.

## Introduction and Theoretical Foundation

### Background and Motivation

Masked diffusion models (MDMs) generate text by reversing a stochastic masking process. Unlike autoregressive language models that generate one token at a time, MDMs can reveal many tokens in parallel with a single network evaluation. The central trade-off: tokens revealed together are drawn independently (a mean-field approximation), introducing an error that depends on:
- The number of steps $N$
- The schedule (how many tokens are revealed at each step)
- The statistics of the data

### Key Theoretical Concepts

**Forward masking process**: A schedule $1 = p_N > p_{N-1} > \cdots > p_0 = 0$ defines revealed fractions. Each site $i$ is masked at step $\sigma_i$ with $\mathbb{P}(\sigma_i = n) = \Delta p_n$, where $\Delta p_n = p_{n+1} - p_n$.

**Path probability**: A complete generation history $(\mathbf{x}, \boldsymbol{\sigma})$ has path probability:
$$P(\mathbf{x}, \boldsymbol{\sigma}) = p_{\text{data}}(\mathbf{x})w(\boldsymbol{\sigma}) = w(\boldsymbol{\sigma})\prod_{n=0}^{N-1} p_{\text{data}}(\mathbf{x}_{U_n}|\mathbf{x}_{S_n}) \tag{1}$$

**Parallel sampler approximation**: The exact conditional of jointly revealed sites is replaced by a product of marginals:
$$p_{\text{data}}(\mathbf{x}_{U_n}|\mathbf{x}_{S_n}) \approx \prod_{i \in U_n} p_{\text{data}}(x_i|\mathbf{x}_{S_n}) \tag{2}$$

**Path error as entropy production**: The relative entropy between exact and parallel samplers is:
$$B = \sum_{\mathbf{x},\boldsymbol{\sigma}} P(\mathbf{x},\boldsymbol{\sigma})\ln\frac{P(\mathbf{x},\boldsymbol{\sigma})}{Q(\mathbf{x},\boldsymbol{\sigma})} = \sum_{n=0}^{N-1}\left\langle\ln\frac{p_{\text{data}}(\mathbf{X}_{U_n}|\mathbf{X}_{S_n})}{\prod_{i\in U_n}p_{\text{data}}(X_i|\mathbf{X}_{S_n})}\right\rangle \tag{5}$$

**Factorisation of single steps**: Using the chain rule, each term decomposes into sums of mutual informations:
$$\left\langle\ln\frac{p_{\text{data}}(\mathbf{X}_{U_n}|\mathbf{X}_{S_n})}{\prod_{j=1}^{m}p_{\text{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}\}) \tag{7}$$

The pair mutual information (central quantity):
$$I_S(i;j) = \left\langle\ln\frac{p_{\text{data}}(X_i,X_j|\mathbf{X}_S)}{p_{\text{data}}(X_i|\mathbf{X}_S)p_{\text{data}}(X_j|\mathbf{X}_S)}\right\rangle \tag{8}$$

## Methodology

### Markov Data Model

Data generated by a stationary Markov chain with transition matrix $T$ ($V \times V$) and stationary distribution $\pi$:
$$T_{bd} = \mathbb{P}(x_{i+1}=d|x_i=b), \quad \sum_d T_{bd}=1 \tag{9}$$
$$p_{\text{data}}(\mathbf{x}) = \pi_{x_1}T_{x_1x_2}T_{x_2x_3}\cdots T_{x_{L-1}x_L} \tag{10}$$

**Key example** (binary spin chain): $V=2$ token types $s=\pm1$ switching with probability $f$:
$$T = \begin{pmatrix} 1-f & f \\ f & 1-f \end{pmatrix}, \quad (T^k)_{uv} = \frac{1}{2}(1+\lambda^k s_u s_v) \tag{12}$$
with $\lambda = 1-2f$, correlation length $\xi = -1/\ln\lambda$.

### Shielding and Gap Representation

The crucial property of Markov data: **revealed tokens shield**. A maximal sequence of $\ell$ masked sites forms a gap $(a,\ell,c)$ bounded by revealed tokens $a$ and $c$. The probability that site $k$ of the gap carries token $v$:
$$m_k^{(a,\ell,c)}(v) = \frac{(T^k)_{av}(T^{\ell+1-k})_{vc}}{(T^{\ell+1})_{ac}} \tag{13}$$

### RSA Master Equation

The expected number of gaps $\mathcal{N}_n(a,\ell,c)$ after $n$ steps obeys a closed linear master equation:
$$\begin{aligned} \mathcal{N}_{n+1}(a,\ell,c) &= (1-q_n)^{\ell}\Big[\mathcal{N}_n(a,\ell,c) \\ &\quad + q_n\sum_{\ell'>\ell}\sum_{c'}\mathcal{N}_n(a,\ell',c')m_{\ell+1}^{(a,\ell',c')}(c) \\ &\quad + q_n\sum_{\ell'>\ell}\sum_{a'}\mathcal{N}_n(a',\ell',c)m_{\ell'-\ell}^{(a',\ell',c)}(a) \\ &\quad + q_n^2\sum_{\ell'\geq\ell+2}\sum_{a',c'}\mathcal{N}_n(a',\ell',c')\sum_{k=1}^{\ell'-\ell-1}m_{k,k+\ell+1}^{(a',\ell',c')}(a,c)\Big]\end{aligned} \tag{20}$$

**Exact sampler solution**: The exact sampler preserves the data distribution:
$$\mathcal{N}_n(a,\ell,c) = (L-\ell-1)p_n^2(1-p_n)^{\ell}\pi_a(T^{\ell+1})_{ac} \tag{21}$$

### Path Error and Perplexity

**Path error** for Markov data:
$$B = \sum_{n=0}^{N-1}\sum_{(a,\ell,c)}\mathcal{N}_n(a,\ell,c)\sum_{1\leq k<k'\leq\ell}q_n^2(1-q_n)^{k'-k-1}I_{kk'}^{(a,\ell,c)} \tag{22}$$

**Generative perplexity**: The cross-entropy difference between exact and parallel samplers:
$$\Delta\text{CE} = \sum_{b,d}\left[(L-1)\pi_bT_{bd}-\mathcal{P}_{bd}\right]\ln T_{bd} + \sum_d(\pi_d-\phi_d)\ln\pi_d \tag{26}$$

### Thermodynamic Metric and Geodesic Schedules

For large $N$, the error per token becomes:
$$\frac{B}{L} \simeq \frac{1}{N}\int_0^1 \dot{p}(\tau)^2 G(p(\tau))d\tau \tag{33}$$

where the metric $G(p)$ is:
$$G(p_n) = \frac{p_n^2}{(1-p_n)^2}\sum_{(a,\ell,c)}(1-p_n)^{\ell}\pi_a(T^{\ell+1})_{ac}\sum_{1\leq k<k'\leq\ell}I_{kk'}^{(a,\ell,c)} \tag{29}$$

or equivalently in gap variables:
$$G(p_n) = \sum_{l,d,r\geq1}p_n^2(1-p_n)^{l+d+r-3}\bar{I}(l,d,r) \tag{30}$$

with:
$$\bar{I}(l,d,r) = I(d) - I(d+l) - I(d+r) + I(d+l+r) \tag{31}$$

and the distance-$m$ mutual information:
$$I(m) = \sum_{u,v}\pi_u(T^m)_{uv}\ln\left[(T^m)_{uv}/\pi_v\right] \tag{32}$$

**Optimal schedule** (geodesic): The Euler-Lagrange equation gives $\dot{p}^2G(p) = \text{const}$, yielding:
$$p^*(\tau) = F^{-1}(\Lambda\tau), \quad \tau(p^*) = \frac{1}{\Lambda}\int_0^{p^*}\sqrt{G(p')}dp' \tag{42}$$

with thermodynamic length:
$$\Lambda = \int_0^1\sqrt{G(p)}dp \tag{41}$$

and minimum error:
$$\frac{B}{L} \simeq \frac{\Lambda^2}{N} \tag{43}$$

## Empirical Validation / Results

### Numerical Validation

**Exact enumeration** (short sequences): For binary chains ($\xi = 2, 5, 20$, $L=8$, $N\leq4$) and a random three-state chain ($L=6$, $N\leq3$), the master equation agrees with enumeration to $2\times10^{-14}$, and Eq. (22) with enumerated $B$ to relative $2\times10^{-15}$ (machine precision).

**Table I: Exact enumeration validation**

| chain | L | schedule | N | $\delta\mathcal{P}$ | $\delta B$ | B |
|-------|---|----------|---|--------------------|-----------|-----|
| binary, $\xi=2$ | 8 | uniform | 4 | $4\times10^{-15}$ | $5\times10^{-16}$ | 0.3068 |
| binary, $\xi=2$ | 8 | cosine | 4 | $2\times10^{-15}$ | $6\times10^{-16}$ | 0.3442 |
| binary, $\xi=5$ | 8 | uniform | 4 | $8\times10^{-15}$ | $1\times10^{-15}$ | 0.5501 |
| binary, $\xi=5$ | 8 | cosine | 4 | $1\times10^{-14}$ | $2\times10^{-15}$ | 0.5405 |
| binary, $\xi=20$ | 8 | uniform | 4 | $2\times10^{-14}$ | $<10^{-16}$ | 0.7634 |
| binary, $\xi=20$ | 8 | cosine | 4 | $2\times10^{-14}$ | $2\times10^{-16}$ | 0.6063 |
| three-state | 6 | uniform | 3 | $1\times10^{-15}$ | $5\times10^{-16}$ | 0.1028 |
| three-state | 6 | cosine | 3 | $4\times10^{-16}$ | $1\times10^{-16}$ | 0.1227 |

**Direct simulation** ($L=1024$, $10^4$ samples): All deviations of ∆CE and pair counts are below two standard errors.

**Table II: Direct simulation validation**

| chain | schedule | N | master equation | simulation |
|-------|----------|---|-----------------|------------|
| binary, $\xi=2$ | uniform | 8 | 0.05137 | 0.05147 ± 0.00019 |
| binary, $\xi=10$ | uniform | 4 | 0.34969 | 0.35036 ± 0.00040 |
| binary, $\xi=10$ | uniform | 16 | 0.07754 | 0.07735 ± 0.00026 |
| binary, $\xi=10$ | cosine | 64 | 0.01261 | 0.01280 ± 0.00022 |
| binary, $\xi=50$ | uniform | 16 | 0.14928 | 0.14978 ± 0.00034 |
| three-state | cosine | 8 | 0.02022 | 0.02024 ± 0.00019 |
| exact sampler, $\xi=10$ | - | - | 0 | -0.00027 ± 0.00020 |

### Key Results for Binary Chain

**Uniform schedule constant**: The large-$N$ coefficient for the uniform schedule has a closed form:
$$U = \int_0^1 G(p)dp = I(1) - \frac{1}{2}I(2) \tag{45}$$

Remarkably, although $G(p)$ involves mutual information at all lags, its integral retains only the two shortest lags; contributions from $m\geq3$ cancel exactly.

**Convergence behaviour** ($\xi=50$):
- Uniform schedule: requires $N \gg \xi$ (hundreds of steps)
- Cosine schedule: requires only $N \gg \sqrt{\xi}$ (10–20 steps)
- Optimal schedule: first step $\Delta p_0 \simeq \Lambda/(N\sqrt{G(0)})$, bound grows slowly (2.2 at $\xi=5$ to 5.7 at $\xi=200$)

**Saturation of uniform schedule**: As $\xi\to\infty$, $NB/L \to \frac{1}{2}\ln 2$ (from $U \to \ln 2 - \frac{1}{2}\ln 2$).

**Perplexity for binary chain**: Per-token excess cross-entropy:
$$\frac{\Delta\text{CE}}{L} = \frac{L-1}{L}\delta\rho\ln\frac{1-f}{f} \tag{47}$$
where $\delta\rho = r/(L-1) - f$ is the excess density of switches. For the uniform schedule, $N\delta\rho \to 0.39$ for large $\xi$, so perplexity grows as $N\Delta\text{CE}/L \simeq 0.39\ln(2\xi)$ even as $NB/L$ saturates.

### English Text Example

A character-level bigram model fitted to Tiny Shakespeare ($V=27$, $1.06\times10^6$ characters, add-$\alpha$ smoothing with $\alpha=0.01$):
- Correlation length: $\xi_1 = 0.76$ characters (short-ranged)
- Adjacent character mutual information: $I(1) = 0.53$ nats
- Metric nearly flat: $G(0) = 0.60$ to $G(1) = 0.41$
- Optimal schedule nearly uniform: $U = 0.499$, $\Lambda^2 = 0.498$ (only 0.3% gain)
- Cosine schedule: coefficient 0.598 (20% worse)
- All schedules reach large-$N$ coefficients for $N\approx10$

## Theoretical and Practical Implications

1. **Thermodynamic interpretation**: The path error $B$ is exactly the entropy production of stochastic thermodynamics. The unmasking schedule plays the role of a driving protocol, the number of steps that of protocol duration, and $G(p)$ that of a friction coefficient.

2. **Exact solution for bigram models**: The RSA mapping provides the first exactly solvable model for parallel decoding where both path error and output quality can be computed at any number of steps, enabling direct testing of large-$N$ theory.

3. **Schedule optimisation**: The geodesic schedules minimize path error and, remarkably, also improve output perplexity (up to 9× reduction at $\xi=200$), even though they were not constructed for this purpose.

4. **Correlation structure determines error distribution**: The correlation length $\xi$ sets where errors concentrate:
   - Long correlations ($\xi \gg 1$): error concentrates at the start; schedules must start with small steps
   - Short correlations (English text): uniform schedule is nearly optimal

5. **Practical guidance for MDMs**: The conditions for large-$N$ behaviour are schedule-dependent: uniform requires $N \gg \xi$, cosine requires $N \gg \sqrt{\xi}$, and the optimal schedule requires $N \gg \xi\Lambda/\sqrt{G(0)}$.

## Conclusion

The paper establishes that masked diffusion generation for Markov data is an exactly solvable random sequential adsorption process. The key findings:

- **Path error = entropy production**: The parallel decoding error is the entropy production of the generation process relative to the reversed masking process.
- **Exact RSA solution**: Gap statistics obey a closed linear master equation, providing exact path error and output statistics for any $N$, $L$, and schedule.
- **Thermodynamic metric**: For many steps, error reduces to $\frac{1}{N}\int_0^1\dot{p}^2G(p)d\tau$; optimal schedules are geodesics with error $\Lambda^2/N$.
- **Correlation-driven behaviour**: Long correlations concentrate error at the start; slow-starting schedules gain in both error and perplexity. For short-range data (English), uniform schedules are near-optimal.

**Future directions**: The RSA picture extends to position-dependent selection rules (beyond schedules), corresponding to interacting RSA acceptance functions. Natural language exhibits power-law correlations and hierarchical structure beyond Markov data, where revealed tokens no longer shield—extending the approach beyond Markov data remains open.

---

_Markdown view of https://picx.dev/p/Yk09wD, served by PicX — AI-generated visual whiteboard summaries of research papers._
