Training Hybrid Block Diffusion Language Models with Partial Bidirectionality
SourceFull paper
Article overview
Verdict
BDLM Mamba-H is a convincing hybrid method for long-context generation: it preserves quality, improves very-long-sequence efficiency, and makes prefix caching exact for block diffusion. However, its quality advantage is scale-dependent rather than universal: at 350M, BDLM attention has better C4-en perplexity.
Main idea
The method separates clean-prefix computation from active-block denoising. Prefix states are computed independently of the diffusion timestep and reused, while reverse Mamba mixing is confined to the current block.
Mechanism
State variables: the clean-prefix cache contains attention KV, Mamba recurrent states, or other layer-specific summaries; the active block remains timestep-conditioned. Architecture: selected layers use attention and intervening layers use Mamba-2. For each block, the model scans the clean prefix once, stores forward Mamba boundary states and attention KV, then denoises the active block using forward continuation plus a reverse scan restricted to that block. AdaLN shifts, scales, and gates are applied only to the active continuation, so the cache is independent of diffusion timestep. Training: the all-block objective builds an inference-matching prefix cache at every block boundary and backpropagates downstream denoising losses through the scan that produces the cache. Main conditions: 5B DCLM tokens, 8192-token sequences, 256-token blocks, 16 diffusion steps, and diffusion-NELBO validation. Inference uses chunked prefix prefill, read-only recurrent caches, compiled fixed-shape continuations, and graph-captured denoising steps. Reproduction: 1) assemble the hybrid attention/Mamba-2 layers; 2) implement the timestep-free prefix scan; 3) restrict the reverse scan to the active block; 4) train all block boundaries with gradients through cache construction; 5) apply fixed-shape compilation and CUDA graphs; 6) compare quality and throughput at the reported scales. Exact attention-layer placement and the full hyperparameter set are not provided.
What this is useful for
The method is especially useful for block diffusion language models with long prefixes and many sequential denoising steps, where recomputing the prefix becomes a dominant cost. It fits systems supporting Mamba kernels, chunked prefill, fixed-shape compilation, and CUDA graph capture.
Risks / not proven
The all-block objective increases training cost: at 350M, BDLM Mamba-H trains more slowly than full-sequence DiffuMamba-H and does not match full-sequence attention speed. Quality does not dominate across all metrics and scales. Throughput depends on specialized kernel and graph optimizations. Exact attention-layer placement and the full hyperparameter set are not given, so reproduction may be incomplete.
Full abstract
High-throughput long-context generation is one of the central challenges for large language models. Generation is typically memory-bandwidth-bound rather than compute-bound: each decoding step must stream the accumulated key/value (KV) cache from memory, so bandwidth demand grows with context length while only one token is emitted. Two parallel approaches have therefore emerged: reducing memory access with efficient attention variants and linear-time mixers such as Mamba, or increasing parallel computation by generating blocks of tokens at once. However, technical challenges arise when combining these two ideas. Earlier hybrid diffusion models such as DiffuMamba use bidirectional Mamba mixing, including a reverse-direction scan relative to causal generation. This reverse scan needs to scan the entire sequence, so its states are not prefix-only and cannot be precisely reused as a cache even when diffusion is performed block by block. We propose a BDLM Mamba--attention hybrid that addresses this challenge by restricting the reverse Mamba scan to the active denoising block, which enables exact caching across blocks. In an 87M-parameter DCLM sweep, BDLM Mamba-H achieves the best C4-en validation perplexity compared to BDLM attention and full-sequence baselines. At 350M parameters, it remains competitive with BDLM attention. For long-context inference, BDLM Mamba-H reaches 19.7x the throughput of full-sequence DiffuMamba-H at 65K tokens and 3.7x the throughput of BDLM attention at 262K, showing that Mamba hybrids are a potential long-context diffusion architecture.