arXiv:2610.22238cs.LGOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.22238

Query-Efficient Rejection Sampling for Parallel Masked Diffusion

Shiyuan Zhang, Xuheng Li, Qiwei Di, Quanquan Gu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Masked diffusion models (MDMs) accelerate generation by unmasking multiple tokens in parallel, but sampling these tokens independently ignores their correlations and biases the output. Anari et al. (2026) corrected this bias with rejection sampling, decomposing the log acceptance probability into a sum of token-level terms, but the evaluation requires one score query per unmasked token. We propose the Single-Increment Rejection Sampler (SIRS), which provides an estimate of the log acceptance probability from a single randomly sampled increment at the cost of one query. SIRS then converts a Poisson number of clipped estimates into accept/reject decisions through a Bernoulli factory adapted from Chen et al. (2026). Since each query returns the conditionals of all remaining tokens in the block, we further Rao-Blackwellize each increment by averaging over these tokens at no extra cost, thereby reducing clipping. We show that the KL-divergence between the data distribution and the SIRS output is bounded by a clipping term plus the model's training error. With exact scores, parallel decoding pays the full within-block dependence, whereas SIRS pays only the part beyond the clipping range.

1 Introduction

Masked diffusion models (MDMs) have emerged as a competitive alternative to autoregressive models for discrete data such as text (Austin et al., 2021; Lou et al., 2023; Sahoo et al., 2024; Shi et al., 2024; Ou et al., 2025), and have recently been trained as large language models with billions of parameters (Nie et al., 2026). An MDM generates a sequence of length L by starting from the all-mask state and repeatedly revealing masked positions. At each step, the trained network, called the score function, is queried once and returns the conditional distribution of every masked token given the revealed ones. If only one token is revealed per query, the sampler reproduces the data distribution when the score function is accurate, but generating a sequence then takes L queries. Since each query already provides the conditional distributions of all masked tokens, practical samplers instead reveal a block of tokens per query and draw them independently from

∗^{*}Equal contribution

†^{\dagger}Department of Computer Science, University of California, Los Angeles, CA 90095, USA; e-mail: zsy25ucla@ucla.edu

‡^{\ddagger}Department of Computer Science, University of California, Los Angeles, CA 90095, USA; email: xuheng.li@cs.ucla.edu

§^{§}Department of Computer Science, University of California, Los Angeles, CA 90095, USA; e-mail: qiwei2000@cs.ucla.edu

1^{1}Department of Computer Science, University of California, Los Angeles, CA 90095, USA; e-mail: qgu@cs.ucla.edu these distributions (Ghazvininejad et al., 2019; Chang et al., 2022), which we refer to as parallel sampling.

However, parallel sampling ignores the dependence among the tokens revealed in the same step. For example, in “he plugged the ⟨\langlekey, plug ⟩\rangle into the ⟨\langlelock, socket ⟩\rangle”, each slot is plausible on its own, yet independent draws produce “key into socket” with the product of the two marginal probabilities. This error persists even when the score function is exact, and it has been identified as a source of quality loss in parallel decoding (Zheng et al., 2025; Liu et al., 2025; Xu et al., 2025). A growing line of work characterizes this error through the generation order and the dependence within a block (Zhang et al., 2026; Chen et al., 2025; Wen et al., 2026; Zhao and Cai, 2026), and reduces it by choosing schedules or blocks whose tokens are nearly conditionally independent (Park et al., 2025; Kim et al., 2025; Lavenant and Zanella, 2025; Azangulov et al., 2026) or by learning a joint correction on top of the marginals (Liu et al., 2025; Xu et al., 2025).

A complementary approach is to correct the sampling of a given block directly, using only the trained score function. Recently, Anari et al. (2026) achieved this exactly by rejection sampling. Their key observation is that the likelihood ratio between the joint distribution of a block and the product of its marginals can be decomposed into token-level conditional probabilities along an ordering of the block, all of which are given by the score function. However, evaluating this decomposition requires one score query per token in the block, which offsets the savings of parallel sampling. This motivates the following question:

Can we correct parallel sampling in MDMs with a number of score queries that does not grow with the block size?

In this paper, we give an affirmative answer by proposing the Single-Increment Rejection Sampler (SIRS). Instead of evaluating the full log-likelihood ratio, SIRS estimates it with a single randomly sampled token-level increment, which costs one score query. However, the acceptance probability is the exponential of the log-likelihood ratio, and exponentiating an unbiased estimate does not give an unbiased estimate of the acceptance probability. We therefore adopt the Poissonized Bernoulli factory of Chen et al. (2026): it draws a Poisson number of increments and combines them into a random acceptance probability whose expectation equals the target one. Since the output of rejection sampling depends only on the expected acceptance probability, the output distribution remains exact, provided that this random probability lies in [0, 1]. We ensure this by clipping the increments, which is the only source of error when the score function is exact. Moreover, since one query returns the conditional distributions of all remaining tokens in the block, we Rao-Blackwellize each increment by averaging over these tokens at no extra cost. We show that, when the score function is exact, the error of SIRS is controlled by the parts of the increments that exceed the clipping range, rather than by the full dependence within a block as for parallel sampling.

We summarize our contributions as follows:

• Query-efficient correction of parallel sampling. We propose SIRS, which corrects parallel sampling by rejection sampling with a Poissonized Bernoulli factory. With clipping threshold B, each unmasking step costs at most (1+2B)e2B(1 + 2B)e^{2B} score queries in expectation, independent of the block size, whereas the exact correction of Anari et al. (2026) requires one query per token. We further propose the Rao-Blackwellized increment, which reuses each query for all remaining tokens in the block.

• Error analysis. We decompose the KL-divergence between the data distribution and the output of SIRS into a clipping-induced error, the error of the proposal, and the error of the acceptance probability, where the latter two vanish when the score function is exact. Parallel sampling, which corresponds to B = 0, incurs the full correlation error, i.e., the KL-divergence between the joint distribution of a block and the product of its marginals. SIRS corrects part of this error: its clipping-induced error is controlled only by the parts of the increments that exceed the clipping range [−B,B][-B, B], and vanishes once B exceeds all increments. We further show that the Rao-Blackwellized increment yields a smaller bound on the clipping-induced error.

• Experiments. On an Ising chain and a Pólya urn, where the score function is exact and the KL-divergence can be computed, SIRS with the Rao-Blackwellized increment achieves a lower KL-divergence than parallel sampling with the same number of score queries when the dependence within a block is weak, while parallel sampling with smaller blocks remains cheaper under strong dependence.

Notations. We use normal-face letters for scalars, boldface lower-case letters for vectors, boldface upper-case letters for matrices, and italic boldface upper-case letters for random vectors. For N∈N+N \in \mathbb{N}_+, [N][N] denotes the set {1,2,…,N}\{1,2,\ldots,N\}. The clipping function is denoted by clipB(x)=min⁡(B,max⁡(−B,x))\text{clip}_B(x) = \min(B, \max(-B, x)). We use (z)+(z)_+ and (z)−(z)_- to denote max⁡(z,0)\max(z,0) and min⁡(z,0)\min(z,0), respectively. We use KL(⋅∥⋅)\text{KL}(\cdot\|\cdot) to denote the KL-divergence, DH(⋅,⋅)D_{\text{H}}(\cdot,\cdot) to denote the Hellinger distance, and χ2(⋅∥⋅)\chi^2(\cdot\|\cdot) to denote the χ2\chi^2-distance.

References (32)