Masked Diffusion Language Model (MDLM / LLaDA)
Diffusion2024 · Cornell / Stanford / Renmin Univ.Continuous-time discrete token masking + iterative bidirectional unmasking
Intuition & Key Idea
ELI5 GuideWhy this model was invented and how it transforms generation
"Starts with a sentence made entirely of [MASK] tokens and unmasks the easiest, most confident words first, refining the whole paragraph in parallel."
Solving a crossword puzzle or game of Hangman: you fill in the obvious clues first across the entire board, and those answers reveal the harder missing words.
Generates hundreds of words in a few parallel refinement passes.
Tokens attend to both earlier and later words simultaneously.
Can fix, rewrite, or complete the middle of existing paragraphs.
Decodes all positions together with full FlashAttention.
1. Initialize Full [MASK] Canvas
Concatenate the user prompt with T_gen absorbing [MASK] tokens representing the entire unknown response canvas at t = 1.0.
Response length T_gen is allocated upfront as a parallel canvas.
The canvas begins fully masked. At each step, all remaining [MASK] positions are predicted in parallel. The highest-confidence tokens are locked into the sequence, progressively anchoring the generation.
GPU Memory Hierarchy & HBM Traffic for this Step
HBM ↔ SRAM on-chipWeights are loaded from High-Bandwidth Memory (HBM) into Streaming Multiprocessor (SM) registers and SRAM cache for computation.
Active Tensor Dimensions & Memory Shapes
Enables arbitrary-order generation, bidirectional infilling, and controllable step-vs-quality trade-offs in language modeling without causal left-to-right constraints.
Training Objective:Time-Weighted Masked Cross-Entropy ELBO: ∫ (α′_t / (1 - α_t)) CE(x_0, p_θ(x_t)) dt
Inference Bottleneck:O(K) full-sequence bidirectional passes
Foundational & Breakthrough Papers for Masked Diffusion Language Model (MDLM / LLaDA)
Simple and Effective Masked Diffusion Language Models (MDLM)
Sahoo et al. (Cornell Tech)
Large Language Diffusion Models (LLaDA)
Nie et al.
Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution (SEDD)
Lou, Meng, Ermon (Stanford)