Abstract

Break the 1-token-per-forward-pass Roofline wall with Block Masked Diffusion: continuous-time NELBO derivations, migrating Gated DeltaNet hybrids in dQwen3.5 and Clover-35B-A3B, Mix-FT sampler alignment, and PBPO reinforcement learning.

1.Breaking the 1 forward pass = 1 token Roofline wall#

Autoregressive (AR) decoding factorizes log⁡p(x1:L)=∑i=1Llog⁡p(xi∣x<i)\log p(x_{1:L}) = \sum_{i=1}^L \log p(x_i \mid x_{<i}). While trivial to train, decoding at small batch sizes sits on the flat memory-bound slope of the Roofline (roofline-flashattention-pagedattention): streaming gigabytes of weights from HBM yields a single token per forward pass.

Diffusion Language Models (dLLMs) replace serial token-by-token emission with iterative parallel denoising across two converging paradigms:

  1. Block Masked Diffusion (dQwen3.5, Clover-35B-A3B): Partitions output sequences into blocks of size BB (e.g., B=16…64B = 16 \dots 64). Inter-block attention remains strictly causal so clean prefix blocks stay cached in KV memory, while intra-block attention is fully bidirectional—allowing T≪BT \ll B forward passes to unmask an entire block in parallel and raise arithmetic intensity by B/T×B/T\times.
  2. Continuous Latent ODE/SDE Diffusion (Sigma, arXiv:2610.02665[2][2] · Sigma Continuous dLLM · 2026Large Language Continuous Diffusion ModelsOpen arXiv:2610.02665 ↗): Discrete unmasking cannot smoothly revise an early mistaken commit or apply continuous value-gradient guidance. Sigma constructs a smooth low-dimensional latent manifold above token embeddings, warm-starting from pretrained AR weights and supporting high-order ODE solvers plus Classifier-Free Guidance (CFG) for math and code.

2.Continuous-time Masked Diffusion NELBO#

In discrete absorbing-state masked diffusion, each token in a block is independently replaced with [MASK] at noise level t∼U(0,1]t \sim \mathcal{U}(0, 1]. Evaluating the exact variational bound reduces to a remarkably clean time-weighted cross-entropy objective:

Under an absorbing forward kernel q(xt∣x0)=∏i=1L[(1−αt) 1xt,i=[MASK]+αt 1xt,i=x0,i]q(x_t \mid x_0) = \prod_{i=1}^L \big[(1 - \alpha_t)\,\mathbf{1}_{x_{t,i}=\text{[MASK]}} + \alpha_t\,\mathbf{1}_{x_{t,i}=x_{0,i}}\big] with linear schedule αt=1−t\alpha_t = 1 - t (so the mask rate is tt and αt′=−1\alpha_t' = -1), the continuous-time Negative Evidence Lower Bound (NELBO) integrates the instantaneous KL divergence between the true posterior q(xs∣xt,x0)q(x_{s} \mid x_t, x_0) and the learned reverse denoiser pθ(x0∣xt)p_\theta(x_0 \mid x_t):

LNELBO(θ)=∫01−αt′1−αt Eq(xt∣x0) ⁣[∑i:xt,i=[MASK]−log⁡pθ(x0,i∣xt)]dt=Et∼U(0,1], xt∼q(⋅∣x0) ⁣[1t∑i∈Masked(xt)−log⁡pθ(x0,i∣xt)]\mathcal{L}_{\text{NELBO}}(\theta) = \int_0^1 \frac{-\alpha_t'}{1 - \alpha_t} \, \mathbb{E}_{q(x_t \mid x_0)} \!\left[ \sum_{i : x_{t,i} = \text{[MASK]}} -\log p_\theta(x_{0,i} \mid x_t) \right] \mathrm{d}t = \mathbb{E}_{t \sim \mathcal{U}(0,1],\, x_t \sim q(\cdot \mid x_0)} \!\left[ \frac{1}{t} \sum_{i \in \text{Masked}(x_t)} -\log p_\theta(x_{0,i} \mid x_t) \right]
(1)

Notice two critical properties: (1) unmasked positions contribute zero loss because they are already revealed, and (2) the 1/t1/t factor upweights low-noise regimes where only a few [MASK] tokens remain and high-confidence context resolves subtle syntactic dependencies.

python
class BlockMaskedDiffusionLM(nn.Module):
    """
    Block Masked Diffusion Language Model (dQwen3.5, arXiv:2609.20751; Mix-FT, arXiv:2611.02666):
    - Inter-block: strictly causal across blocks so clean prefix blocks are cacheable.
    - Intra-block: fully bidirectional within each block so multiple [MASK] tokens unmask in parallel.
    """

    def __init__(self, vocab_size: int = 128, hidden_size: int = 128, num_layers: int = 3, num_heads: int = 4):
        super().__init__()
        self.vocab_size = vocab_size
        self.mask_token_id = vocab_size - 1
        self.embed = nn.Embedding(vocab_size, hidden_size)
        self.pos_embed = nn.Embedding(512, hidden_size)
        encoder_layer = nn.TransformerEncoderLayer(
            d_model=hidden_size,
            nhead=num_heads,
            dim_feedforward=hidden_size * 2,
            activation="gelu",
            batch_first=True,
            norm_first=True,
        )
        self.backbone = nn.TransformerEncoder(
            encoder_layer, num_layers=num_layers, enable_nested_tensor=False
        )
        self.lm_head = nn.Linear(hidden_size, vocab_size - 1, bias=False)

    @staticmethod
    def build_block_causal_mask(seq_len: int, block_size: int, device: torch.device) -> Tensor:
        """Position i attends to j iff block_idx(j) <= block_idx(i); True masks out future blocks."""
        idx = torch.arange(seq_len, device=device)
        blk_i = idx.unsqueeze(1) // block_size
        blk_j = idx.unsqueeze(0) // block_size
        return blk_j > blk_i

    def forward(self, x_noisy: Tensor, block_size: int = 16) -> Tensor:
        b, s = x_noisy.shape
        pos = torch.arange(s, device=x_noisy.device).unsqueeze(0).expand(b, s)
        h = self.embed(x_noisy) + self.pos_embed(pos)
        attn_mask = self.build_block_causal_mask(s, block_size, x_noisy.device)
        h = self.backbone(h, mask=attn_mask)
        return self.lm_head(h)

    def compute_mdlm_nelbo_loss(self, clean_ids: Tensor, block_size: int = 16) -> Tensor:
        """Continuous-time masked diffusion NELBO: 1/t-weighted cross-entropy over masked positions."""
        b, s = clean_ids.shape
        t = torch.empty(b, 1, device=clean_ids.device).uniform_(0.05, 1.0)
        mask_flags = torch.rand(b, s, device=clean_ids.device) < t
        mask_flags[:, -1] = True

        x_t = torch.where(mask_flags, torch.full_like(clean_ids, self.mask_token_id), clean_ids)
        logits = self.forward(x_t, block_size=block_size)

        token_ce = F.cross_entropy(
            logits.view(-1, self.vocab_size - 1),
            clean_ids.view(-1),
            reduction="none",
        ).view(b, s)
        weighted_loss = (token_ce * mask_flags.float()) / t
        return weighted_loss.sum() / mask_flags.float().sum()
Figure 1: Block-causal attention mask (inter-block causal prefix caching + intra-block bidirectional context) and forward-pass reduction per 32-token block.
Figure 1: Block-causal attention mask (inter-block causal prefix caching + intra-block bidirectional context) and forward-pass reduction per 32-token block.

3.Hybrid linear-RNN migration (dQwen3.5 & Clover-35B-A3B)#

A major 2026 architectural collision emerged when frontier AR backbones (Qwen3.5, Qwen3.8-Next, Kimi K3) replaced 75% of attention layers with strictly unidirectional linear RNNs such as Gated DeltaNet. Standard diffusion adaptation assumed full bidirectional attention everywhere—incompatible with causal recurrent state StS_t.

  • dQwen3.5 (arXiv:2609.20751[1][1] · dQwen3.5 · 2026dQwen3.5: Hybrid-Attention Diffusion Language ModelsOpen arXiv:2609.20751 ↗) resolves this via hybrid block adaptation: clean prefix blocks retain fast O(1)O(1) unidirectional Gated DeltaNet recurrence SprefixS_{\text{prefix}}, while inside the active noisy block, attention layers open to full bidirectional masks and linear RNN layers apply lightweight bidirectional state fusion with causal annealing.
  • Clover-35B-A3B (arXiv:2611.24636[5][5] · Clover-35B-A3B · 2026Clover-35B-A3B-Preview Technical ReportOpen arXiv:2611.24636 ↗) scales this hybrid MoE + Gated DeltaNet block-diffusion recipe to 35B total / 3B active parameters, reaching 73.6 on SWE-bench Verified at 680 tok/s680\text{ tok/s} on a single GB300.
  • dLoop (arXiv:2611.26275[6][6] · dLoop · 2026dLoop: Looped Diffusion Language Models via Recurrent Latent RefinementOpen arXiv:2611.26275 ↗) further embeds Looped Transformer latent refinement (looped-transformers-latent-recurrence) inside each diffusion step so uncommitted tokens exchange global context before hard unmasking.

4.Few-step sampler alignment (Mix-FT) and PBPO RL#

Why does naive confidence-based parallel unmasking degrade when compressed to T=4–8T = 4\text{--}8 steps? Because standard MDLM trains independent per-token marginals pθ(xi∣xt)p_\theta(x_i \mid x_t). Unmasking multiple tokens simultaneously without modeling their joint correlation can emit incompatible pairs (e.g., "New" + "Francisco").

  • Mix-FT (arXiv:2611.02666[3][3] · Mix-FT · 2026Train the Sampler You Run: Few-Step Masked Diffusion Language Models via Mixture-Likelihood Fine-TuningOpen arXiv:2611.02666 ↗)—Train the Sampler You Run—optimizes an importance-weighted mixture-likelihood lower bound directly over the few-step sampler's actual reveal trajectories, closing the quality gap at 2–82\text{--}8 steps.
  • PBPO (Prefix-Block Policy Optimization, arXiv:2611.07783[4][4] · PBPO · 2026PBPO: Prefix-Block Policy Optimization for Diffusion Language ModelsOpen arXiv:2611.07783 ↗) solves the RLVR bottleneck for dLLMs. In autoregressive GRPO, computing πθ(y∣x)\pi_\theta(y \mid x) is a single forward pass. In block diffusion, a BB-token block can be unmasked along B!B! distinct reveal orders, making the marginal block likelihood πθ(yblk∣yprefix)\pi_\theta(y_{\text{blk}} \mid y_{\text{prefix}}) intractable. PBPO models the concrete unmasking transition trajectory conditioned on the clean prefix block as a Markov sub-process, decomposing the policy ratio across actual unmasking steps so PPO/GRPO importance ratios remain exact and low-variance.
python
    @torch.no_grad()
    def sample_block_parallel(
        self, prefix_ids: Tensor, block_size: int = 16, denoise_steps: int = 4
    ) -> tuple[Tensor, list[int]]:
        """
        Confidence-aware parallel unmasking: decodes a block_size chunk in denoise_steps
        forward passes by committing the top-k highest-confidence [MASK] tokens per step.
        """
        if prefix_ids.shape[0] != 1:
            raise ValueError("sample_block_parallel expects batch size 1")
        cur_block = torch.full(
            (1, block_size), self.mask_token_id, dtype=torch.long, device=prefix_ids.device
        )
        tokens_per_step = math.ceil(block_size / denoise_steps)
        revealed_per_iter: list[int] = []

        for step in range(denoise_steps):
            full_seq = torch.cat([prefix_ids, cur_block], dim=1)
            logits = self.forward(full_seq, block_size=block_size)[:, -block_size:, :]
            probs = F.softmax(logits, dim=-1)
            confidences, pred_tokens = probs.max(dim=-1)

            still_masked = cur_block == self.mask_token_id
            num_remaining = int(still_masked.sum().item())
            if num_remaining == 0:
                break
            k = num_remaining if step == denoise_steps - 1 else min(tokens_per_step, num_remaining)

            masked_conf = confidences.masked_fill(~still_masked, -1.0)
            _, topk_pos = torch.topk(masked_conf, k=k, dim=-1)
            cur_block.scatter_(1, topk_pos, pred_tokens.gather(1, topk_pos))
            revealed_per_iter.append(k)

        return torch.cat([prefix_ids, cur_block], dim=1), revealed_per_iter

In our companion CPU lab (labs/llm/block-diffusion), BlockMaskedDiffusionLM verifies the block-causal mask geometry, converges under 1/t1/t-weighted MDLM NELBO training, and decodes a 16-token block in 4 confidence-ranked parallel unmasking passes.

5.References#

References

  1. [1]
  2. [2]
  3. [3]
  4. [4]
  5. [5]
  6. [6]

Share