Table of Contents
Fetching ...

Parallel Sampling from Masked Diffusion Models via Conditional Independence Testing

Iskander Azangulov, Teodora Pandeva, Niranjani Prasad, Javier Zazo, Sushrut Karmalkar

TL;DR

This work tackles the inefficiency of autoregressive text generation by enabling parallel sampling in discrete diffusion models through contextual independence testing. It introduces PUNT, a training-free sampler that divides masked tokens into contextually independent groups, pruning dependent, low-confidence tokens, and unmasking high-confidence ones in parallel with $O( obreak ext{ } obreak ext{ } ext{log}|M|)$ forward evaluations per step. Empirically, PUNT delivers superior accuracy–compute trade-offs on long-form text and instruction-following benchmarks (e.g., MTBench and IFEval) and demonstrates robustness across hyperparameters, with emergent hierarchical generation patterns that resemble planning. The approach is grounded in transformer-attention properties (independence-stability) and validated through KL-divergence analyses and attention-based metrics, offering a practical, training-free path to faster and more reliable MDM-based generation. Future work may include adaptive thresholds, distillation to single-pass predictors, and combining PUNT with complementary efficiency techniques like KV-caching.

Abstract

Masked diffusion models (MDMs) offer a compelling alternative to autoregressive models (ARMs) for discrete text generation because they enable parallel token sampling, rather than sequential, left-to-right generation. This means potentially much faster inference. However, effective parallel sampling faces two competing requirements: (i) simultaneously updated tokens must be conditionally independent, and (ii) updates should prioritise high-confidence predictions. These goals conflict because high-confidence predictions often cluster and depend on each other, opportunities for parallel updates. We present PUNT, a model-agnostic sampler that reconciles this trade-off. Our method identifies token dependencies and removes lower-confidence tokens from conflicting groups. This produces sets of indices for unmasking that satisfy both independence and confidence criteria. Our approach ensures improved parallel unmasking through approximate conditional independence testing. Our experiments show that PUNT delivers a superior trade-off between accuracy and compute when compared to other strong training-free baselines, especially for generation of longer sequences. On the IFEval benchmark, it achieves up to 16\% higher accuracy over baseline methods, including sequential generation (one-by-one). These gains hold across different values of hyperparameters, mitigating the need for brittle hyperparameter tuning. Moreover, we observe that PUNT induces an emergent hierarchical generation strategy, where the model first establishes high-level paragraph structure before local refinement, suggesting a planning-like generation process that contributes to strong alignment performance.

Parallel Sampling from Masked Diffusion Models via Conditional Independence Testing

TL;DR

This work tackles the inefficiency of autoregressive text generation by enabling parallel sampling in discrete diffusion models through contextual independence testing. It introduces PUNT, a training-free sampler that divides masked tokens into contextually independent groups, pruning dependent, low-confidence tokens, and unmasking high-confidence ones in parallel with forward evaluations per step. Empirically, PUNT delivers superior accuracy–compute trade-offs on long-form text and instruction-following benchmarks (e.g., MTBench and IFEval) and demonstrates robustness across hyperparameters, with emergent hierarchical generation patterns that resemble planning. The approach is grounded in transformer-attention properties (independence-stability) and validated through KL-divergence analyses and attention-based metrics, offering a practical, training-free path to faster and more reliable MDM-based generation. Future work may include adaptive thresholds, distillation to single-pass predictors, and combining PUNT with complementary efficiency techniques like KV-caching.

Abstract

Masked diffusion models (MDMs) offer a compelling alternative to autoregressive models (ARMs) for discrete text generation because they enable parallel token sampling, rather than sequential, left-to-right generation. This means potentially much faster inference. However, effective parallel sampling faces two competing requirements: (i) simultaneously updated tokens must be conditionally independent, and (ii) updates should prioritise high-confidence predictions. These goals conflict because high-confidence predictions often cluster and depend on each other, opportunities for parallel updates. We present PUNT, a model-agnostic sampler that reconciles this trade-off. Our method identifies token dependencies and removes lower-confidence tokens from conflicting groups. This produces sets of indices for unmasking that satisfy both independence and confidence criteria. Our approach ensures improved parallel unmasking through approximate conditional independence testing. Our experiments show that PUNT delivers a superior trade-off between accuracy and compute when compared to other strong training-free baselines, especially for generation of longer sequences. On the IFEval benchmark, it achieves up to 16\% higher accuracy over baseline methods, including sequential generation (one-by-one). These gains hold across different values of hyperparameters, mitigating the need for brittle hyperparameter tuning. Moreover, we observe that PUNT induces an emergent hierarchical generation strategy, where the model first establishes high-level paragraph structure before local refinement, suggesting a planning-like generation process that contributes to strong alignment performance.
Paper Structure (36 sections, 16 equations, 23 figures, 1 table, 1 algorithm)

This paper contains 36 sections, 16 equations, 23 figures, 1 table, 1 algorithm.

Figures (23)

  • Figure 1: Illustration of one iteration of PUNT on 4 masked tokens, which consists of $\log_2 4 = 2$ tests. Left: A binary tree representing the recursive partitioning. Each level corresponds to a single parallel test in the iterative algorithm. Right: In each round, confidence-ordered tokens (circled numbers) are partitioned into "anchor" (green) and "test" sets. Test tokens that are dependent on the anchor set are rejected (red), while independent ones (blue) are kept.
  • Figure 2: Left: Unmasking efficiency for various prompt types vs number of unmasked tokens. Right: Visualization of the denoising process at steps 9 and 18 for a sample prompt ("What should I do at the end of the internship."). Tokens are color-coded: green tokens are accepted by PUNT for parallel unmasking in the current step, red tokens are rejected, and uncolored tokens were unmasked in previous steps. See \ref{['sec:unmaskings']} for more examples of intermediate denoising steps.
  • Figure 3: Parallel sampling error (equation \ref{['eq: kl_error']}). Left: Average error for different samplers compared to number of forward evaluations (NFEs). Right: Median together with confidence intervals $(Q_{5}, Q_{95})$ of the error for PUNT samplers with different $\varepsilon$ as a function of the number of previously revealed tokens. Note that $Q_5$ remains below $10^{-3}$ across all positions.
  • Figure 4: IFEval and MTBench performance of PUNT compared to baselines on Dream 7B. Benchmark specific scores (higher is better) vs mean number of forward passes.
  • Figure 5: MBPP performance of PUNT compared to baselines on Llada. MBPP pass@1 (higher is better) vs mean number of forward passes.
  • ...and 18 more figures

Theorems & Definitions (2)

  • Definition 3.1: Contextually Independent Random Variables
  • Definition 3.2: Contextually Independent Sequences