TL;DR
Almost every large language model writes text one token at a time, left to right. LLaDA asks whether that order is essential. It hides random tokens of a training text, trains a Transformer to recover them, and generates by starting from a fully hidden answer and revealing tokens over several steps. The authors scale this masked diffusion approach to 8 billion parameters trained from scratch on 2.3 trillion tokens. The 8B model is reported as competitive with LLaMA3 8B on many benchmarks, and it performs consistently in both directions on a poem-reversal test where Qwen 2.5 and GPT-4o show a clear gap.
Builds on: Masked Diffusion Model, Variational Lower Bound (ELBO), Transformer, Instruction Tuning · Leads to: later work on diffusion language models at scale
Why it mattered
Until this paper, diffusion models had won on images and other continuous data, but no diffusion language model had been shown at the scale of a modern LLM. The authors' main claim is that the core abilities of LLMs, namely scaling, in-context learning and instruction following, come from the training principle (maximum likelihood) and the Transformer, not from the left-to-right order. If that holds, the order is a design choice rather than a requirement.
The paper gives three concrete reasons to care. It trains an 8B model with no autoregressive component, using about 0.13 million H800 GPU hours for pre-training. It reports that the model supports multi-turn dialogue after supervised fine-tuning. And it reports a result on the reversal curse, where a model that learns "A is B" from text often fails on "B is A". The reversal curse is a failure of left-to-right training, in which a model that learns "A is followed by B" often cannot give A from B. The paper's reversal test, on poem lines, is a direct way to check it.
The problem
A standard language model is trained by maximum likelihood on the next-token factorisation. For a sequence of L tokens,
Each token is predicted from the tokens before it. This is the Autoregressive Model form. It is exact and works well, but it means that the model only ever conditions on the left. The paper argues that the question to ask is whether the training principle, maximising the likelihood of the data under the model, needs this factorisation. Earlier diffusion work on text had not reached LLM scale, and it was unclear whether a masked, bidirectional alternative could match an autoregressive model on the same data.
How it works
There are two processes: training, which teaches a mask predictor, and generation, which uses it. Take a tiny sentence of three tokens, "the cat sat", to see both.
Training, one example:
- Take a training sequence. Let be "the cat sat". The model is trained on many such sequences, with a fixed length of 4096 tokens in pre-training.
- Pick a masking level. Draw uniformly from the interval . Suppose .
- Mask each token independently. Each token is replaced by a mask symbol M with probability . Suppose "cat" is masked, giving = "the M sat". Check: on average half the tokens are masked at t = 0.5, here one of three.
- Predict the masked tokens. The mask predictor, a Transformer without a causal mask, reads the whole of and gives a probability for every word at each masked position. Suppose it gives "cat" a probability of 0.25.
- Score only the masked positions. The loss is times the sum, over masked positions, of the negative log-probability of the true token. Here that is . Check: unmasked tokens are never scored, so the model learns to recover missing tokens from context on both sides.
- Update the weights. Take a gradient step with AdamW, as in ordinary training.
Generation, for a three-token answer with two steps:
- Start fully hidden. The response starts as M M M. The prompt, if there is one, is kept visible.
- First step, from to . The predictor fills in all three masks at once. Suppose the confidences are 0.9 for "the", 0.4 for "cat" and 0.6 for "sat". The low-confidence rule keeps floor(3 × (1 − 0.5)) = 1 token, the one with the highest confidence, so the state becomes "the M M".
- Second step, from to 0. The predictor fills the two remaining masks. Every position is now visible, and the output is "the cat sat". Check: the number of hidden tokens fell from 3 to 2 to 0, which matches the schedule.
flowchart LR A["Clean text x0"] --> B["Mask each token with probability t"] B --> C["Mask predictor reads the whole sequence"] C --> D["Cross-entropy on masked tokens, scaled by 1 over t"] D --> E["AdamW update"] F["Fully masked answer"] --> G["Predict all masks"] G --> H["Keep the most confident tokens, re-mask the rest"] H --> G
The math
The forward process. For each token independently, the forward process keeps the original token with probability and replaces it by M with probability . Formally, for each position ,
At nothing is masked, and at everything is masked. The masking probability grows linearly with , which the paper motivates by the assumption that the information in a text is proportional to its number of tokens.
Step 2 in symbols: the mask predictor
A mask predictor takes the partly masked sequence and predicts every masked token at once. Training minimises
The indicator is 1 at masked positions and 0 elsewhere, so only masked tokens contribute. Because each token is masked with probability , the masked positions are a fraction of the sequence in expectation. Dividing by rescales the sum back to the full sequence. The paper shows that this loss is an upper bound on the negative log-likelihood of the model:
This bound is what makes the approach a principled generative model, as opposed to a masked-language-model objective with a fixed masking rate such as BERT's. The paper notes that BERT masks a fixed fraction of tokens, while LLaDA draws the fraction at random from 0 to 1. A related method, MaskGIT, drops the factor and so has no link to maximum likelihood.
Step 6 in symbols: sampling
The reverse process moves from to . In the paper's default, the low-confidence variant, at each step the model predicts every masked token, keeps the predictions it is most sure of, and re-masks the rest. With steps and , the number of tokens left unmasked after the step is
This is the rule used in the walkthrough. The paper also gives a purely random remasking rule, which re-masks a fraction of the predicted tokens, but it is the confidence-based rule that the authors use for their main results.
Conditional likelihood
For supervised fine-tuning, the prompt stays visible and only the response is masked. The loss is the same as above, restricted to response tokens and conditioned on the prompt. To score a candidate response, the paper uses a Monte Carlo estimate in which is drawn uniformly from , exactly tokens are masked, and each masked token is weighted by . This form has lower variance than masking each token with probability . The authors report that the first form needed more than 1000 Monte Carlo estimates for stable results, while this one was stable with 128.
Results
Scale and training. The paper trains LLaDA at 1B and 8B parameters. Pre-training uses 2.3 trillion tokens, a fixed sequence length of 4096, and a learning rate of with a warmup over the first 2000 iterations. The 8B model takes about 0.13 million H800 GPU hours, and the authors say this is similar to autoregressive models of the same size and data. Supervised fine-tuning uses 4.5 million prompt-response pairs for 3 epochs. The authors state that the 8B runs were not tuned.
Scaling. Compared with autoregressive baselines trained on the same data, LLaDA's performance on six tasks grows with compute up to about FLOPs. The authors extend the compute range studied earlier for masked diffusion models, which was to FLOPs, to to FLOPs. They note that earlier work estimated diffusion models need 16 times more compute than autoregressive models for the same likelihood, but they argue the metrics are not directly comparable.
Benchmarks. The authors report that the 8B base model beats LLaMA2 7B on nearly all of 15 zero- and few-shot tasks, and that it is on par with LLaMA3 8B. Its advantages are in math and Chinese tasks. After fine-tuning, the instruct model is reported to be slightly behind LLaMA3 8B Instruct, since no reinforcement learning was used. The paper gives the GSM8K and Math scores for the instruct model as 69.4 and 31.9 with pure diffusion sampling. With block-style sampling they rise to 78.6 and 42.2, and the authors attribute the gain to EOS padding in the fine-tuning data, which causes early termination under low-confidence remasking.
Reversal. On a set of 496 Chinese poem sentence pairs, the models must produce the next line (forward) or the previous line (reversal) with no further training. The authors report that LLaDA performs consistently on both, while Qwen 2.5 and GPT-4o show a clear gap between the two. The reversal scores are in the paper's Table 4 and are not quoted here.
Speed. On GSM8K and Math, LLaDA 8B Base reaches comparable accuracy to LLaMA3 8B Base and achieves 1.5 and 1.8 times the throughput. The authors point out that LLaMA3 uses a key-value cache and LLaDA has no inference optimisation.
Limits. The authors list several. The generation length is a user-chosen number, though they say results are insensitive to it. No specialised attention or positional design was used, and no KV cache. The autoregressive baselines were trained only up to FLOPs, so the comparison is not at the largest scale. No reinforcement learning alignment was done. The paper also reports that MMLU dropped after fine-tuning, which the authors attribute to fine-tuning data quality.
Reading guide
- Abstract and Section 1. Read after Autoregressive Model and Language Model, so the claim that the order is not essential is clear. The three contributions are scaling, benchmarks and reversal.
- Section 2.1, Probabilistic formulation. Needs Masked Diffusion Model and Cross-Entropy Loss. The loss in Equation 3 is the central formula.
- Section 2.2, Pre-training. Needs Transformer and AdamW Optimizer. The learning-rate schedule is a warmup then decay, which needs no further background.
- Section 2.3, Supervised fine-tuning. Needs Instruction Tuning and Masked Language Modeling.
- Section 2.4, Inference. Needs Variational Lower Bound (ELBO) for the upper bound and Classifier-Free Guidance for the guidance remark.
- Section 3, Experiments. Needs In-Context Learning for the few-shot benchmarks and Neural Scaling Laws for the scaling plots.
- Appendix A. The formal derivation, which needs Kullback–Leibler Divergence and Maximum Likelihood Estimation.