TL;DR
OLMo 2 is a family of language models at 7B, 13B and 32B parameters, released with their weights, training data, code and training logs. The paper's main contributions are a more stable transformer, a two-stage training curriculum whose second stage uses a small, high-quality mix, and a recipe whose models the paper describes as competitive with comparable open-weight models at fewer training FLOPs. The 7B model averages 62.9 across the paper's benchmark table, against 50.7 for the group's previous 7B model.
Builds on: Transformer, RMS Normalization, AdamW Optimizer, Subword Tokenization · Leads to: OLMo: Accelerating the Science of Language Models
Why it mattered
Many open-weight models release only the final weights, so researchers cannot study how the model was built. OLMo 2 publishes the full recipe, including the training data and the logs of loss spikes that the team fixed. Its stability changes (reordered normalisation, QK-norm, z-loss, a new initialisation) are described in enough detail to reuse, and several follow earlier work the paper cites. The paper also argues that a benchmark suite should keep some tasks held out from development, and it reports results on such a suite.
History
The OLMo family's earlier model, OLMo-0424, used a non-parametric layer norm and an initialisation scheme from Zhang et al. (2019) and Gururangan et al. (2023). The OLMo 2 changes were made in response to loss and gradient-norm spikes seen in that run, and the paper traces each change to a specific experiment.
The problem
A large language model training run is expensive, and a single divergence can waste most of it. The team's previous model, OLMo-0424, showed two warning signs. Sudden spikes in the loss, and more often in the gradient norm, became more frequent as the model grew. The magnitude of the gradient norm also grew slowly over the run. Together these made training at larger scale impossible without a fix. The problem is therefore not accuracy at a fixed size, but whether the recipe stays stable as the model and the token count increase.
How it works
The paper's pipeline, in the order it runs during training:
- Filter the data. Remove documents that contain 32 or more repeated n-grams, where an n-gram is a span of 1 to 13 tokens. Repeated sequences were often present in batches where spikes occurred, though not always.
- Initialise every weight from a normal distribution with mean 0 and standard deviation 0.02. The earlier scheme shrank later layers, and the new one keeps the scale of activations and gradients roughly the same from layer to layer.
- Run each transformer block with normalisation on the outputs. Attention and the feed-forward (MLP) layer are each followed by RMSNorm before being added to the residual stream. The queries and keys are normalised with RMSNorm before attention.
- Apply the output loss with z-loss. A small extra term keeps the final softmax normaliser from growing large.
- Update with AdamW using a small epsilon, and without weight decay on the embedding matrix.
- Pretrain with a learning rate that warms up over 2000 steps and then follows a cosine decay. This stage is 90 to 95 percent of the training FLOPs.
- Mid-train on a smaller, higher-quality mix (Dolmino Mix 1124) with the learning rate decayed linearly to zero. This is 5 to 10 percent of the FLOPs.
- Average the final models from several runs with different data orders. The paper calls this souping.
A tiny trace of step 3. Take a hidden vector x = (3, 4). Its root mean square is the square root of (9 + 16) / 2, which is the square root of 12.5, about 3.5355. RMSNorm divides each entry by this value, giving about (0.8485, 1.1314). Check: the squares of the new entries average to 1. Normalising the output of a block fixes the size of what the block adds to the residual stream, whatever its raw output was. The paper reports the stability effect empirically rather than deriving it from this property.
The math
The block equations in the paper's final design are
Here x is the input to the block, h is the intermediate state after attention, and h_out is the output. The paper writes the MLP input as x in one place and as h in its comparison table; the table form is used here.
Step 3 in symbols: RMSNorm
RMSNorm of a vector v with d entries is v divided by the root mean square of its entries, with a small constant ε added for safety:
The number of entries d and the constant ε are the only terms beyond the vector itself. The learned scale is omitted here.
Step 2 in symbols: the growth exponent
To test whether activations and gradients grow or shrink with depth, the paper defines a growth exponent. With n layers, a vector v at the first layer and a vector v' at the last layer:
A value of λ near 0 means the scale is preserved across layers. The paper reports that the OLMo 2 initialisation gives values closer to 0 than OLMo-0424 across model widths.
Step 4 in symbols: z-loss
The z-loss adds a term proportional to (log Z) squared to the training loss, where Z is the normaliser of the softmax over the output logits. Because the term grows when Z grows, it discourages large logits. The paper's text and its hyperparameter table give different weights for this term, so this lesson does not quote a value.
Worked examples
Suppose a vector's norm doubles at every layer, and the stack has 4 layers, so the final norm is 16 times the first.
- The norm ratio is 2 times 2 times 2 times 2, which is 16.
- The natural logarithm of 16 is about 2.7726. (The paper's formula does not state a base; this example uses the natural log.)
- Divide by the number of layers: 2.7726 divided by 4 is about 0.693.
- Interpretation: a growth exponent of 0.69 means the scale grows steadily with depth. The paper's initialisation aims for values near 0, where the scale stays roughly constant from layer to layer.
Take a block input x = (1, 0) and an attention output A = (6, 8), which is large.
- Without normalising the output, the block adds A directly: h = (7, 8). The added vector has length 10.
- With RMSNorm on the output, first compute the root mean square of A: the square root of (36 + 64) / 2, which is the square root of 50, about 7.0711.
- Divide A by it: (0.8485, 1.1314).
- Add to the input: h = (1.8485, 1.1314).
- The added vector now has length about 1.414, which is the square root of 2 for two entries. The size of the contribution depends on the width, not on how large the attention output happened to be.
Interpretation: normalising the output caps the size of each block's contribution, so one large output cannot dominate the residual stream at a single step.
Table 6 compares OLMo 2 13B (average 68.3, training FLOPs 4.6 times 10^23) with Qwen 2.5 7B (average 67.4, 8.2 times 10^23).
- The score gap is 68.3 minus 67.4, which is 0.9 points in favour of OLMo 2 13B.
- The compute ratio is 4.6 divided by 8.2, about 0.561.
- So OLMo 2 13B scores slightly higher with about 56 percent of the compute.
- Interpretation: this is a statement about one averaged suite and about estimated FLOPs, not a general ranking.
Try it: OLMo 2 32B scores 73.3 with 13.0 times 10^23 FLOPs, and Qwen 2.5 32B scores 74.9 with 16.0 times 10^23. What is the compute ratio, and how many points does Qwen lead by? Answer: 13.0 divided by 16.0 is 0.8125, about 81 percent of the compute; Qwen leads by 74.9 minus 73.3, which is 1.6 points.
Common mistakes and tradeoffs
It is tempting to think OLMo 2 is the best open model at every size. In fact Qwen 2.5 14B (72.3) and Qwen 2.5 7B (67.4) score above OLMo 2 at their sizes in Table 6, because the claim is competitiveness at lower FLOPs on one averaged suite.
It is tempting to think a single change removes the spikes. In fact the n-gram filter reduced spikes but had no effect on the slow growth of the gradient norm, and the reordered norm and QK-norm only improved growth and spikiness together, not in isolation.
Recap
OLMo 2 keeps the transformer and changes where normalisation sits, adds RMSNorm on queries and keys and z-loss on the output, starts from a smaller initialisation, filters repeated n-grams, and ends with a short mid-training stage on higher-quality data. The paper says that without these fixes, training at larger scale would not have been possible.
Results
Avg is the average column of the paper's benchmark table. Training compute is in units of 10^23 FLOPs, as reported in the paper.
| Model | Average | Training FLOPs (×10^23) |
|---|---|---|
| OLMo-0424 7B (previous, fully open) | 50.7 | 1.0 |
| OLMo 2 7B | 62.9 | 1.8 |
| Llama 3.1 8B (open weights) | 61.8 | 7.2 |
| Qwen 2.5 7B (open weights) | 67.4 | 8.2 |
| OLMo 2 13B | 68.3 | 4.6 |
| OLMo 2 32B | 73.3 | 13.0 |
The 7B model is close to Llama 3.1 8B with about a quarter of the training FLOPs (7.2 divided by 1.8 is 4). It is behind Qwen 2.5 7B, which used more compute. The paper's claim is competitiveness at lower compute, not the best score at every size.
Mid-training. In a learning-rate study, two runs that differ only in peak learning rate (3 × 10^-4 and 6 × 10^-4) reach 73.8 and 73.9 after 2T tokens of pretraining and 100B high-quality tokens. On GSM8K, which was not in the table above, the higher-rate run scored 2.8 points better. The paper calls this promising but not yet a dependable result.
Limits. The evaluation is on English academic benchmarks. The held-out tasks were chosen by the team. The paper also says it cannot guarantee that the tasks it treats as unseen were absent from the development sets of the models it compares with. The FLOP counts are estimates, and for some models they are not reported. The z-loss fork from the efficient attention library behaved differently in the backward pass, and the team retrained from the point of divergence rather than mix implementations.
Reading guide
- Section 2.1 (architecture) and Table 1: needs Transformer and RMS Normalization. The changes from Layer Normalization to RMSNorm, and the placement of normalisation, are the main content.
- Section 2.2 (tokenizer): needs Subword Tokenization and Text Tokenization. Table 2 compares two vocabularies.
- Section 2.3 (training recipe): needs AdamW Optimizer and Learning Rate for the warm-up and cosine schedule. Neural Scaling Laws is the background for the FLOP comparisons.
- Section 3 (pretraining stability): needs He (Kaiming) Initialization for the comparison with earlier initialisations, Gradient Norm Clipping for why gradient spikes matter, L2 Regularization for weight decay, and Cross-Entropy Loss for the z-loss term.
- Section 4 (mid-training): needs Learning Rate for the annealing experiments.
- Section 2.5 (results): needs Perplexity only if you want to read the model-level metrics as losses.
Check yourself
QuestionWhat is the difference between normalising the input of a block and normalising its output, as OLMo 2 does?Show answer
With input normalisation the block sees a normalised vector, but the value it adds to the residual stream is unnormalised, so it can grow with depth. With output normalisation the added value (the attention or MLP output) is itself rescaled by RMSNorm before it joins the stream. This bounds what each block contributes, which the paper found helps stability when combined with QK-norm.
QuestionTake the vector (6, 8). Compute its RMSNorm with ε set to 0. What is the root mean square of the result?Show answer
The mean of the squares is (36 + 64) / 2 = 50, and its square root is about 7.0711. Dividing gives about (0.8485, 1.1314). The root mean square of the result is 1, because the normalised vector has mean square 1 by construction.
QuestionUsing the table, how many times more training FLOPs did Llama 3.1 8B use than OLMo 2 7B, and what was the difference in averages?Show answer
Llama 3.1 8B used 7.2 and OLMo 2 7B used 1.8, so the ratio is 7.2 divided by 1.8, which is 4. The averages are 61.8 and 62.9, so OLMo 2 7B scores 1.1 points higher on the paper's suite with about a quarter of the compute.
QuestionWhy does the paper make the training-data filter remove documents with repeated n-grams, and why does it say the effect is not complete?Show answer
Long repeated sequences were found in batches where spikes occurred, so removing them lowers the frequency of spikes on average. The relationship is not deterministic: the same sequence sometimes spikes for one model or data order and not for another, and the masking safeguard reduced but did not eliminate gradient spikes. Filtering is therefore a partial fix that the team pairs with architecture changes.
QuestionA team sees their gradient norm slowly grow over a long run. Which of the paper's changes addresses this and why?Show answer
The paper reports slow growth in gradient norm as a separate problem from spikes. The paper reports that reordered normalisation and QK-norm, applied together, improve both the growth and the spikiness of the gradient norm, so they are the natural first candidates to test. The team should check this on their own run.
Sources
- Team OLMo et al., 2 OLMo 2 Furious, arXiv 2501.00656: https://arxiv.org/abs/2501.00656
- DOI for arXiv 2501.00656: https://doi.org/10.48550/arXiv.2501.00656