Mid-training
· 38 min read · Updated Nov 2, 2026
Digests are written primarily by LLMs with only readability edits by me. If this one reads like slop, please shoot me an email at max.zhuang@berkeley.edu.
OLMo 2’s 7B model read 3.9 trillion tokens of ordinary pretraining data. Then it read 50 billion more, a little over one percent, from a different mix: about half filtered web text, the rest math problems, instruction data, academic papers, and encyclopedia entries, while the learning rate fell to zero. On a grade-school math test, GSM8K, its score went from 24.1 to 67.5. Its average across ten evaluations went from 53.0 to 62.9. How much of the math jump reflects math ability is uncertain: the new mix included GSM8K’s own training problems, and a later audit by the OLMo 3 team found matches to GSM8K’s test questions in the same math data. Team OLMo, OLMo 2, OLMo 3
That stage is mid-training. Many published training recipes since 2024 include one, under different names. Meta’s Llama 3 report calls it annealing. NVIDIA’s Nemotron-4 calls it continued training. Qwen3 calls it a reasoning stage. Microsoft’s Phi-4, Ai2’s OLMo, and Hugging Face’s SmolLM3 call it midtraining or mid-training. The term is recent: OLMo 2’s authors say they took it from Microsoft’s Phi-3 report and from OpenAI. Their report defines it explicitly, as a shorter second stage, 5 to 10 percent of the training compute, where the learning rate decays linearly to zero on a curated mix. OLMo 2, Tu, Zhang, et al., survey
In most published recipes, three things change at once in that stage: the learning rate finishes decaying, the data mix changes, and the context window usually grows. Post-training then starts from the model it leaves.
What does each of those changes do, and what does the stage change about the post-training that follows? In the one study at 7B or above that separates them, the decay and the new data did different jobs before post-training; what the stage does to post-training rests so far on small or confounded studies.
- Mid-training is continued next-token training on a smaller, curated mix that keeps much general text, done while the learning rate finishes decaying and usually while the context window grows. Most of the published recipes compared here give it 1 to 3 percent of their tokens.
- In MiniCPM’s runs, the loss fell far faster once the learning rate began to decay than during the stable stretch before it. Wen and colleagues account for the drop as the weights settling once smaller steps stop them bouncing between the sides of a valley in the loss, which reveals progress already made; if so, a decay should help even when the data does not change.
- In single runs on OLMo 2 7B, the one study at 7B or above that separates the decay from the data, finishing the decay on ordinary data lifted multiple-choice scores, while the new data supplied the math gain and most of the generative-task gain. That lift was measured before post-training; two other studies found decayed checkpoints doing worse after fine-tuning, in one by about a point and in the other mostly on one code benchmark.
- In single tests from two OLMo reports, how the new data is written moved math scores as far as what it covers, though one test also doubled the tokens and in the other the fall came mainly from unparseable answers. In two sweeps at 7B and 8B, a late mix longer than a tenth of training raised math and code further: at 7B up to the longest window tested, 30 percent, and at 8B up to 40 percent, with both falling at 50. General scores stayed within 1.5 points of their 10 percent values, slipping at 7B. The authors chose 10 to 20 and 40 percent.
- The context window grows late because attention’s compute grows with the square of the sequence length. Context length trades against other abilities in both directions: long-context training cost OLMo 3 5.4 points of math average, and short-window mid-training cut a Granite 8B model’s score at 128K tokens from 59 to 6.
- In the lab recipes the stage continues the pretraining run, so labs can test a candidate dataset with a short decay branched off a late checkpoint. In one 150M-parameter study, training on target data at the end of the same learning-rate schedule needed a sixth to a tenth as much code or math data as fine-tuning in a separate run.
- Benchmark contamination matters most here if, as studies cited by OLMo 3 suggest, data seen near the end of training is memorized most strongly. In OLMo 3’s one matched test, complete copies of GSM8K did not raise its GSM8K score; DROP did score higher uncleaned, but cleaning also removed DROP’s training examples.
- Before supervised fine-tuning, in models up to 1B parameters scored by loss, code or math data that ran for two thirds or more of training lowered the later fine-tuning loss in that domain. Domains already close to web text barely changed.
- After reinforcement learning, models given a stage added to a finished base model, with extra compute, ended far above the same base models on math in two studies (near 65 against near 10 on MATH500 for a 3B Llama), under RL recipes that favoured the mid-trained models. The one test at equal compute is synthetic, and its answer depends on problem difficulty and on how success is measured.
- Still open: whether a domain left out of the mix recovers in post-training, whether decayed checkpoints fine-tune worse, when the curated data should arrive relative to the decay, and what distilling a larger model during mid-training costs in factual recall. No study compares a late stage against spreading the same data through pretraining at production scale.
What the stage contains
Mid-training is continued next-token training on a much smaller and more curated dataset than pretraining, done while the learning rate finishes its decay, and usually paired with an increase in context length. Three things change; the objective does not. Most of the published recipes compared below give the stage 1 to 3 percent of their tokens. Tu, Zhang, et al., survey
What separates it from continued pretraining, the older practice of training further on a single new domain, is that mid-training keeps a large share of the original pretraining data in the mix. Liu, Neubig, and Xiong put it as a chain of sizes: the pretraining set is larger than the mid-training set, which is larger than the post-training set. Continued pretraining is the special case where the weight on general data drops to zero. The diagram below shows where the stage sits in a run and what changes in it, with three runs drawn to scale. Tu, Zhang, et al., survey, Liu et al.
| What changes | Pretraining | Mid-training | Post-training |
|---|---|---|---|
| Data | Web, code, books, papers. Trillions of tokens. | A curated mix: math, code, question-and-answer pairs, long documents, some instruction data. Usually tens to hundreds of billions of tokens; Qwen3's is about 5 trillion. | Instructions, preference pairs, reward signals. Thousands to millions of examples. |
| Objective | Predict the next token. | Predict the next token, on the new mix. | Imitate, then optimize preferences or rewards. |
| Context length | Short: 4K to 8K tokens. | Often extended here, to between 16K and 128K tokens. | Usually unchanged. |
| Learning rate | High and steady, or a slow decline. | Usually decays to near zero. | Small. |
The published recipes agree on the shape and differ on the details. The table lists what each report states; where a report gives no number, the cell says so.
| Model, report date | Pretraining tokens | Mid-training tokens | What changes in the mix | Context length |
|---|---|---|---|---|
| OLMo 2 7B, Dec 2024 | 3.9T | 50B, run three times and the weights averaged | half filtered web; the rest math, instruction data, papers, encyclopedia | 4K, unchanged |
| OLMo 3 7B, Dec 2025 | 5.9T | 100B, then 50B for long context | web 28%, code 20%, math 19%, question-and-answer pairs 14%, reasoning traces 8%, instruction data 6%, PDFs 5% | 8K to 65K |
| Llama 3 405B, Jul 2024 | 15.6T | about 800B for long context, then a short annealing | upsampled high-quality code and math | 8K to 128K in six steps |
| Phi-4 14B, Dec 2024 | about 10T | 250B | 30% long documents, 70% pretraining data | 4K to 16K |
| Qwen3, May 2025 | over 30T | about 5T, then hundreds of billions for long context | more STEM, code, reasoning, and synthetic data | 4K to 32K |
| DeepSeek-V3, Dec 2024 | 14.8T | final 500B at two reduced learning rates, then two short phases for long context | no change described | 4K to 32K to 128K |
| SmolLM3 3B, Jul 2025 | 11.2T | 100B for long context, then 35B of reasoning traces | math, code, and reasoning upsampled; then reasoning traces in chat format | 4K to 64K |
For most of these the stage is 1 to 3 percent of the tokens. Qwen3’s reasoning stage is the outlier at about 14 percent, and Llama 3’s long-context stage is about 5 percent. These are shares of the tokens in one run. The 5 to 10 percent in OLMo 2’s definition is a share of training compute, and OLMo 2’s own stages come near it only when every run is counted. It ran its 7B stage three times on different data orders and averaged the weights, 150 billion tokens or about 4 percent of that model’s training, and its 13B stage four times, about 11 percent. Qwen2.5 and Kimi K2 have equivalent stages that the table leaves out, because their reports give no data-mix change for them.
The word is also used for something much smaller. Alignment midtraining, in Baines and colleagues’ definition, trains a model on pretraining-style documents with alignment-relevant content, generally before supervised fine-tuning and reinforcement learning. The studies of it cited here used a million to about a billion tokens, a fiftieth or less of even OLMo 2’s 50-billion-token stage. Their safety experiments often start from already post-trained models, so the shared word covers a different procedure. The rest of this digest is about the stage in the table. Li et al., Cho et al., Baines et al.
What alignment midtraining has been found to do
Anthropic researchers trained Llama and Qwen models on 8 to 41 million tokens of synthetic documents describing a model specification before alignment fine-tuning. On Qwen3-32B, that midtraining plus alignment fine-tuning cut a measured misalignment rate from 54 to 7 percent, against 14 percent for a fine-tuning-only baseline (deliberative alignment); with much more fine-tuning data, that baseline caught up. Li et al.
A follow-up at 120 billion parameters found that documents about a constitution lowered a blackmail rate by about 18 points, an effect that survived later fine-tuning, as did its gains on two other tests of default behaviour. Its advantages on tests where the model had to resist pressure or resolve a conflict between values faded. A stress test in September 2026 found the effect fragile: replacing 2 percent of the alignment fine-tuning data with conflicting examples reversed it, and under reinforcement learning without reasoning the midtrained model differed from the control by only 8 points. Cho et al., Baines et al.
Learning-rate decay
In MiniCPM’s runs, the loss fell far faster once the learning rate began to decay than during the stable stretch before it. Wen and colleagues account for the drop as the weights settling, revealing progress already made rather than much new learning. If that is right, a decay should help even when the data does not change.
The learning rate is the step size of each weight update. A pretraining schedule warms it up over a few thousand steps, holds it high or lets it decline slowly for most of the run, and lowers it toward zero at the end. The older cosine schedule declines the whole way. The warmup-stable-decay schedule, popularized by MiniCPM, holds the rate constant and then decays it over the final stretch, which papers also call the cooldown. MiniCPM
In MiniCPM’s runs the loss falls slowly during the stable phase and then drops sharply once the rate begins to fall, to a value at or below the cosine curve. A decay covering about 10 percent of the tokens was enough to reach the lowest loss in their small models, and 2.5 percent was not. MiniCPM
Hägele and colleagues showed that a constant rate followed by a short cooldown, 20 percent of training or less, can match the cosine schedule’s final loss. The chart below shows their runs of a 210-million-parameter model, scored by validation perplexity, the exponential of the loss. The constant-rate run sits above the cosine run of the same length until the last fifth, and cooling the rate to zero there brings it down onto the cosine run. Hägele et al.
Grey: three cosine runs, one per length. Blue: one constant-rate run, with a cooldown started from it at each length; dashed lines mark where each cooldown begins.
MiniCPM’s authors also measured the weights changing less during the decay than before it, while the loss fell faster. Why would it? Wen and colleagues’ answer is that most of the drop comes from the weights settling rather than from new learning. They describe the loss surface as a river valley: steep sides, with a river running along the bottom.
A high learning rate makes the weights bounce between the steep sides while they still move along the river. The decay stops the bouncing, so the weights settle to the valley floor and the loss reveals progress that was already made. Their theory also credits the decay with some further progress along the river. The diagram below draws this picture, beside a run held at a small rate throughout for comparison. Wen et al.
Wen and colleagues tested the picture along straight lines in weight space. Between two checkpoints from the high-rate phase, the loss dips in the middle and rises again, as it would along a line that crosses a valley from one side to the other. Between a checkpoint before the decay and one after it, the loss falls smoothly the whole way, as it would for weights moving down one side to the floor. Hägele and colleagues had found the same smooth fall across their cooldowns and read it as a smooth transition into a basin, a low region of the loss surface. Wen et al., Hägele et al.
Which tokens the decay improves, in a toy language
In a synthetic toy language built to test the river-valley picture, Wen and colleagues found that the decay lowered the loss most on the least predictable tokens, while the stable phase learned the highly predictable ones slightly better. They propose that in real text the predictable tokens are often facts. Wen et al.
Separating the decay from the data
If the decay mostly reveals progress already made, it should help even on ordinary data. OLMo 2 tested this on its 7B model: finishing the decay on ordinary pretraining data lifted multiple-choice scores, while switching to a new mix supplied the math gain and most of the generative-task gain, in single runs.
The team started from the 7B model’s checkpoint at 4 trillion tokens, taken partway down a cosine schedule before any final decay. From there it ran 50-billion-token decays to zero on the ordinary pretraining mix and on six candidate mid-training mixes, and compared each with that checkpoint. The math score in these comparisons is a development set of 200 problems drawn from GSM8K’s 1,319 test problems. The opening’s 24.1 to 67.5 is a different measurement: GSM8K’s test set, scored on the final model, which was trained on the final mix three times with the weights averaged. OLMo 2
The decay on the pretraining mix lifted the multiple-choice average by 4.4 points, but the average on generative tasks (short factual answers and reading comprehension) by only 1.3. It lowered the math score by 1.5. A decay with no new data helped, then, but mostly on the multiple-choice scores. OLMo 2
On the settling account, a decay mostly reveals what the ordinary data had already taught, which would fit a lift on multiple-choice tasks and none in math. One comparison cannot tell revealed progress from new learning, though, so this result is consistent with the theory rather than a test of it.
An early version of the mid-training mix, more than half filtered web text and about a quarter math, did different work. On top of the decay, it added 1.7 points of multiple-choice average and 5.7 on the generative tasks, and it took the math score from the checkpoint’s 28.5 to 46.5. OLMo 2
The math gain came from the math sets or the instruction data, not from better general data. A mix of filtered web, code and reference text, with only a few percent math, left the math score at 28.5. Adding math sets, or instruction data with no math sources, raised it to between 46 and 52. The audit mentioned at the top concerns the math data OLMo 2 finally used; the report does not say whether these candidate sets held GSM8K test questions. OLMo 2
These are single runs, and on 200 problems a score near 46 has a standard error of about 3.5 points, so only the large math differences clearly exceed noise. The chart below splits each gain into the part the decay added and the part the new mix added beyond it.
Change in score from the checkpoint, in points. The outlined bar is the decay on the pretraining mix; the solid bar is what the new mix added beyond it, drawn from where the outlined bar ends, so its far end is the total gain.
Grade-school math, 200 GSM8K questions, after a 50-billion-token decay on five of the seven mixes tested, from the same checkpoint
Score in percent. Whiskers: one standard error for a 200-question score. One run per mix. Reference text here is mainly academic papers and Wikipedia.
All of these gains were measured before any post-training. Two other studies, one at 1B and 8B parameters and one on a 30-billion-parameter mixture-of-experts model, found decayed checkpoints doing worse than undecayed ones after fine-tuning, each from single runs. The section on open questions returns to them.
The data mix
In three published mixes, a third to 70 percent of the data is pretraining data again, and the rest targets math, code, question answering, instructions and reasoning. How that data is written moved scores as far as what it covers in two confounded tests. Running it past a tenth of training raised math and code further, up to the longest window tested at 7B and up to 40 percent at 8B. General scores stayed within 1.5 points of their 10 percent values, slipping at 7B.
The mid-training mix has two parts. The first is pretraining data again, filtered for quality. Filtered web text is about half of OLMo 2’s mix, and data drawn from the pretraining set is 70 percent of Phi-4’s. In OLMo 3’s mix, web and PDF data from its first stage are about a third. OLMo 3 kept them on purpose, because that “prevents excessive shift in training data distribution.” OLMo 2, Phi-4, OLMo 3
Kotha and Liang measured what keeping it does, with 150M-parameter models and small sets of code, math or instruction data. Mixing pretraining data back in during the target stage made the target data go further: without it, matching the same loss took up to about twice as much target data. Kotha and Liang
The second part is what the stage exists for: math problems and solutions, code, question and answer pairs, instruction data, and, since 2025, worked reasoning traces. OLMo 3 describes its instruction and reasoning data as “bootstrapping instruction following and reasoning ability ahead of post-training stages.” OLMo 3
The form of that data can move math scores as far as the choice of data did in OLMo 2’s comparison of candidate mixes. OLMo 2 tested two versions of the same synthetic math set, each in a short test decay. With its answers written as Python programs, the math score stayed near its 28.5 starting point (25.0, within the noise of a 200-problem test). With the same problems rewritten by a language model as a natural-language conversation, the score rose to 65.5, though the rewritten set was also about twice as many tokens. OLMo 2
OLMo 3 tested the form of its instruction data. A chat template marks where each turn of a conversation starts and ends, often with special tokens, reserved symbols that do not occur in ordinary text. Without the template, a short decay on the instruction data scored 49 on GSM8K. With the template and its special tokens, the base model emitted those tokens in its answers and scored 0, mainly because the evaluation could no longer parse the answers. The template written as ordinary text scored 46, and the final mix joined messages with plain newlines instead. The chart below sets the two tests side by side on one scale. OLMo 3
OLMo 2 7B from its pretraining checkpoint. Grade-school math, 200 GSM8K test questions. Each decay mixes the math set about half and half with web text.
Short decays on the Tülu 3 instruction-tuning data. GSM8K.
Score in percent, one run per dot. The dashed line in each test marks the run it compares against. Whiskers on the OLMo 2 scores: one standard error for a score on 200 questions.
How long the new mix should run has been measured by two sweeps at 7B to 8B parameters. Blakeney and colleagues trained a 7B model for one trillion tokens and, for the final stretch, removed the bulk web crawl, leaving smaller filtered web sets as 30 percent of the late mix, and upsampled code and curated domain data. They compared this with a run that kept the original mix from the same checkpoint on the same learning-rate schedule, so the comparison isolates the data change. Done over the last 20 percent of training, the new mix raised MMLU from 35.7 to 42.6, GSM8K from 14.7 to 23.0, and HumanEval from 17.2 to 23.4 relative to that run. Blakeney et al.
Their duration sweep found that MMLU peaked with a 10 percent window and the overall average with 20 percent, and that pushing to 30 percent kept improving math and code while both of those slipped. Blakeney et al.
Feng and colleagues at NVIDIA ran the same kind of sweep on an 8B model trained for one trillion tokens, with a late mix that kept 31 percent web text alongside math, code and other high-quality data. The paper’s reported average kept rising until the new mix covered the final 40 percent of training (52.9, against 51.6 at 20 percent) and fell at 50 percent (52.0). The authors suggest the fall may be overfitting to the high-quality data the late mix repeats. MMLU moved by less than a point across the whole sweep. Feng et al.
The chart below plots both sweeps against the share of training spent on the late mix, as separate math, code and general scores rather than the studies’ averages. Read that way, the two agree that a longer late mix helps math and code more than the general scores, and differ in the window each team chose. The studies used different mixes and schedules, and each ran one model per setting, so the best window is not settled.
Change in score, in points, from a run of the same length that kept its original mix · each point is one run · both models trained on 1 trillion tokens · each panel has its own vertical scale
Math is GSM8K in both sweeps. Code is HumanEval at 7B, and the mean of HumanEval, MBPP and their extended versions at 8B. Language is the language-understanding group of the MosaicML Eval Gauntlet; reasoning is the mean of eight multiple-choice reasoning tests.
Context length
Nearly every recipe extends the context window in this stage, putting long sequences off to the end because attention’s compute grows with the square of the sequence length. Length trades against other abilities both ways: long-context training cost OLMo 3 math, and short-window mid-training cut a Granite 8B model’s long-context score from 59 to 6.
Llama 3’s 405B model stepped the window from 8K to 128K tokens in six stages over about 800 billion tokens. It advanced only when short-context scores had recovered and a needle-in-a-haystack test, which hides one fact in a long input and asks for it, was solved at the new length. DeepSeek-V3 did it in two phases of a thousand steps each, 4K to 32K to 128K. Phi-4 spent its whole 250-billion-token stage going from 4K to 16K. Llama 3, DeepSeek-V3, Phi-4, Qwen3
Long documents are mixed with short ones. Qwen3’s long-context stage is 75 percent documents of 16K to 32K tokens and 25 percent shorter. OLMo 3 uses 34 percent long documents and 66 percent of its mid-training mix, because in a 10-billion-token trial the reverse ratio cost 2.5 points on a subset of its evaluations and the chosen one cost 0.8. Qwen3, OLMo 3
Two labs tested which long documents to use. Phi-4 found that documents that are naturally long beat short documents packed together to fill the window. SmolLM3 found that upsampling long web pages, books, and code repositories beyond what occurred naturally did not improve its long-context scores. Phi-4, SmolLM3
Of the averages OLMo 3 reports, its full long-context stage cost math the most. Its 50 billion tokens lowered the 7B model’s math average from 59.8 to 54.4, while the code, multiple-choice and question-answering averages moved by 1.3 points or less. OLMo 3
In the other direction, short-window training can undo long-context ability a model already has. PRISM mid-trained a Granite 8B model at an 8K window and watched its score on RULER, a long-context benchmark, at 128K tokens fall from the base model’s 59 to 6. Training on long sequences for 1,000 steps brought it back to 38, and averaging in 15 percent of the base model’s weights before that training brought it to 42. The chart below shows the same runs at five input lengths, from 8K to 128K tokens. PRISM
RULER score, out of 100 · Granite-3.3 8B · one run per line · the input length doubles at each step
Long-context training: 1,000 steps of training on long sequences, run on the mid-trained model. Merge: the mid-trained weights averaged with the base model's, 85 to 15, before those steps.
Repair: 1,000 steps of training on long sequences, run on the mid-trained model. Merge: the mid-trained weights averaged with the base model's, 85 to 15, before the repair.
SmolLM3 met the same loss inside its own mid-training. It traced a drop in long-context scores to its reasoning stage, which came after its long-context stage. Averaging weights recovered the base model’s long-context scores up to 128K tokens: nine parts from its final model to one part from a mid-training checkpoint that still scored well on long inputs. So a long window, once trained, can be lost again in a later stage, and in both cases weights from a checkpoint that still had it helped restore it. SmolLM3
Continuity with pretraining
In the lab recipes, mid-training continues the pretraining run from its last checkpoint, with the same loss and much of the same data. Because it is one run, labs can test a candidate dataset with a short decay branched off a late checkpoint, and no sharp line marks where pretraining ends.
The survey’s definition has mid-training carry on the pretraining run’s learning-rate schedule instead of starting a new one. Not every recipe does. OLMo 2 and Llama 3 carry the decay on from where pretraining left it, while OLMo 3 raises the rate about sevenfold at the start of mid-training and then decays it again, this time to zero. Tu, Zhang, et al., survey, OLMo 2, OLMo 3
Carrying the schedule on mattered in one small study. Kotha and Liang, with 150M-parameter models, put a small code or math set at the end of the pretraining run, inside that run’s own learning-rate schedule. To match that, fine-tuning on the same set in a separate run, with its own schedule, would have needed 6 to 10 times as much of it. They suggest the separate run loses by resetting the optimizer state and warming the rate up again. Kotha and Liang
Labs use short decays to test candidate datasets. A short decay from a late checkpoint, with the candidate mixed in, shows the dataset’s effect on benchmark scores more cheaply than separate training runs would. Llama 3 rated small domain-specific datasets by taking a half-trained 8B model and annealing it to zero on 40 billion tokens, with the candidate at 30 percent weight. The report calls this “more efficient than performing scaling law experiments for every small dataset.” Llama 3
OLMo 2 used the same method to choose the math sources for its mid-training mix. It ran 19 short test decays, which it calls microanneals, 130 billion tokens in total, with differences visible after less than 10 billion. The diagram below shows four of those tests, each under two billion tokens, beside a 50-billion-token decay with no math added. Their math collection is not the one in the candidate mixes compared earlier. It is synthetic and curated math developed alongside those mixes, part of it made specifically to improve GSM8K, so its scores are not comparable with those mixes’ 46 to 52. OLMo 2
Each wedge is one decay, narrowing as the learning rate falls linearly to zero; lengths are not to scale. “Math” is one 200-million-token collection (TuluMath, DolminoSynthMath, MetaMath, CodeSearchNet and GSM8K’s training split), included once, twice or four times; web text makes up the rest of each mix. Bars show percent correct on 200 GSM8K test questions, uncertain by about 3.4 points (one standard error) from the choice of questions alone; the notches mark the checkpoint’s 28.5. One run each.
Blakeney and colleagues scored data the other way, by removing their math datasets from the final phase and measuring what was lost. Blakeney et al.
The boundary with pretraining is a matter of degree. Qwen3’s reasoning stage is 5 trillion tokens, more than OLMo 2’s entire 3.9-trillion-token pretraining. Llama 3 also changed its mix during pretraining, raising math and multilingual data partway through. Whether the curated data needs a late stage at all is one of the open questions. Qwen3, Llama 3
Benchmark contamination
Benchmark contamination means test questions, or copies of them, in the training data. Studies cited by OLMo 3 suggest that data seen near the end of training is memorized most strongly, which would make this the stage where contamination does the most damage. OLMo 3’s one matched test gave a mixed answer: copies of GSM8K did not raise its GSM8K score, and a higher DROP score is confounded by lost training examples.
OLMo 3 concentrated its decontamination, the search for benchmark items in training data and their removal, on the mid-training and long-context data in light of those studies. Much of what it found came from existing datasets such as Flan, and it found complete leakage of GSM8K. Among its sources was the math data it reused from OLMo 2, in which this audit found the matches to GSM8K’s test questions mentioned at the top. OLMo 3, Magar and Schwartz, Bordt et al.
Its one matched pair of runs with and without cleaning gave a mixed answer. The copies did not raise the GSM8K score: the cleaned run scored 1.6 points higher, within run-to-run noise. The report notes that the team behind the Marin 32B model saw the same thing and explained it by the leaked copies being formatted differently from the evaluation. That bears on the opening’s question, though for a different model and mix: copies of test questions need not inflate a score. The uncleaned run did score 13.9 points higher on DROP, a reading-comprehension benchmark, but cleaning had also removed over 60,000 of DROP’s training examples, so that gap may reflect lost training data as well as leaked test items. OLMo 3
Training late on a benchmark’s own training data is a related risk. Llama 3’s report shows how far it can move a score: annealing the 8B model on the GSM8K and MATH training sets raised its validation scores by 24.0 and 6.4 percent. The report does not say whether these are points or relative gains. The team ran the experiment to measure annealing’s power and kept benchmark training sets out of the production mix. On the 405B model the same experiment gained almost nothing, which the report reads as the larger model not needing in-domain examples. Llama 3
So a benchmark jump across this stage should be read next to the decontamination that accompanies it. Some reports add benchmark-style data on purpose. Nemotron-4 describes a second data distribution for its continued-training phase containing “a small number of benchmark-style alignment examples.” The two reinforcement-learning studies later on this page, OctoThinker and PRISM, report mostly math benchmark scores, and neither reports checking its mid-training data against them. Nemotron-4
Effects on supervised fine-tuning
In models up to 1B parameters, scored by loss, code or math data that ran for two thirds or more of training lowered the later fine-tuning loss in that domain. Moving fine-tuning data into the stage itself raised MiniCPM’s scores after fine-tuning and OLMo 3’s before it, and neither lab dropped the separate fine-tuning stage.
Post-training changes the objective. Supervised fine-tuning (SFT) trains the model to imitate chosen responses, preference training learns from comparisons between responses, and reinforcement learning (RL) rewards sampled outputs, often with a verifiable check such as a math answer key. All of it uses far less data than mid-training, thousands to a few million examples, and all of it starts from the model mid-training produces. What does mid-training change about that starting point?
Liu, Neubig, and Xiong tested whether it moves the model toward the post-training distribution. They pretrained models from the Pythia family, from 70M to 1B parameters, on 128 billion tokens of web text and switched in one of five mid-training mixes partway through. All runs kept one cosine schedule. The code mix entered about a tenth of the way in, the math mix about a third, the others about two thirds. So the mixes ran for a third to nine tenths of training, not a short final stage. The study measures loss rather than accuracy, stops at 1B parameters, and uses only supervised fine-tuning. Liu et al.
They then fine-tuned on four small target sets with five seeds each. Mid-training on code cut the fine-tuning loss on Python from 2.17 to 1.89, and mid-training on math cut the loss on grade-school math from 0.94 to 0.85. On a general chat set and a science question set, both close to web text already, the change was near zero. Liu et al.
When the mid-training data matched the fine-tuning domain, the model also ended fine-tuning with a lower loss on the original web text. That held in seven of eight comparisons; after math fine-tuning at 1B, for example, the web loss was 3.02 against 3.13 for a control that continued on web text. This compares where the models ended, not how much each forgot: the paper does not report the web loss before fine-tuning, so a lower final loss may only reflect a lower start. Mixes that did not match the fine-tuning domain sometimes ended with a higher web loss than the control. Liu et al.
Switching to code alone, instead of mixing it in, did the opposite at 160M. A model switched to code alone 83 billion tokens into the run ended Python fine-tuning with a higher web loss than the control, while the 20 percent code mix, which entered at 12.6 billion tokens, ended lower. The two also differ in when the code entered, which the paper set by how much code data it had, so the comparison cannot separate mixing from timing. Liu et al.
Timing also interacted with the share of the mix. At 160M, code introduced early, 12 billion tokens into the run, gave the lowest Python loss at 80 percent of the data. Introduced late, at 105 billion tokens, 80 percent did worse than no code at all, while 10 percent still helped. The authors read this as late introduction needing a lower share of new data, which may also explain part of the code-only result above. Liu et al.
Fine-tuning data itself can also move into this stage. MiniCPM added high-quality data and supervised fine-tuning data to the decay phase, then ran ordinary SFT on top. Against decaying on pretraining data alone, with the same SFT afterwards, the 2.4B model’s MMLU went from 44.6 to 50.9 and its GSM8K from 27.7 to 42.3. On the 1.2B model, doubling the plain model’s SFT budget did not make up the difference, except on GSM8K, where the doubled model scored 2.6 points higher. MiniCPM
OLMo 3 found that holding out its instruction and reasoning data from mid-training cost 1.9 points on the base-model average, before any post-training. Neither lab dropped the separate SFT stage, nor did SmolLM3, whose mid-training ended on 35 billion tokens of reasoning traces; MiniCPM states that it was still necessary. SmolLM3, OLMo 3, MiniCPM
Effects on reinforcement learning
After reinforcement learning, models given a stage added to a finished base model, with extra compute, ended far above the same base models on math in two studies, under RL recipes that favoured the mid-trained models. The one test at equal compute, synthetic and at 100M parameters, found that the answer depends on problem difficulty and on how success is measured.
RL is often found to mostly raise the probability of behaviors the base model already produces sometimes, a point the mode collapse digest covers at length. If that holds, the model mid-training leaves shapes what RL can amplify.
OctoThinker started from the observation that Llama base models went nowhere under RL for math, producing answers that ran to the length limit and repeated themselves, while Qwen2.5 models improved steadily. Their fix was a 200-billion-token mid-training stage, mostly on a math web corpus, followed by a 20-billion-token decay stage that mixed reasoning traces (30 percent) and instruction data into more math web text. It ran on the released Llama base model with a new learning-rate schedule, as PRISM’s does below, so these studies test a stage added to a finished model rather than the tail of one run. OctoThinker
After RL, the plain 3B Llama scored about 10 on MATH500, while the same model after mid-training scored about 65, level with Qwen2.5-3B. The reasoning traces in that mid-training were distilled from DeepSeek-R1, so the result does not show what mid-training without distillation can do. The chart below shows where the three models started and ended RL. The two ends are scored differently, with and without worked examples in the prompt, so it compares endpoints rather than gains. OctoThinker
| Model | MATH500 accuracy, base model and after reinforcement learning |
|---|---|
| Llama-3.2-3Bno mid-training | |
| OctoThinker-Long-3BLlama-3.2-3B after 200B and then 20B tokens of mid-training, mostly math web text | |
| Qwen2.5-3Ba different base model, no extra training | |
| Scale |
MATH500 accuracy in percent · 3B-parameter models · one RL run each
The comparison did not hold the RL setup fixed. Going by the defaults the paper states, plain Llama and Qwen2.5-3B were trained with the simpler of its two prompt templates and a 4,096-token limit on responses, and the mid-trained model with the longer template the paper adopted later. The template mattered on one of the paper’s mid-trained checkpoints, where it moved the score at the start of RL from 0.2 to 33.0. The paper found the longer template made RL training more stable, though on that checkpoint the simpler template’s run caught up after about 120 steps (read from the paper’s figure). Part of the plain model’s failure may therefore come from the RL setup rather than the model. OctoThinker
Base-model evaluations did not show how large the differences would become after RL. Three math web corpora, each used for an otherwise identical 20-billion-token mid-training run, scored within about a point of each other on MATH500 before RL (19.2 to 20.4). After the same RL recipe they scored about 36, 31 and 10, a ranking that matched the one before RL. The corpus decided whether this RL recipe worked at all; with the weakest, the model’s answers ran to the length limit and repeated themselves. If that holds generally, a short test decay may rank candidate datasets correctly yet not show how far apart they will end up after RL. The chart below follows the three runs through RL. OctoThinker
MATH500 accuracy, percent · Llama-3.2-3B after a 20B-token mid-training budget on each corpus · one RL run per corpus · dots in the left column match the line ends by style
Web-Pro: MegaMath-Web-Pro. Web-Pro-Max: the paper's own larger corpus, refined in the same style. FineMath: FineMath-4plus.
Adding long reasoning traces gave the largest further gain, though RL was unstable until its prompt template and length limit were changed, and the weakest corpus was not retried with those changes. Adding short question-and-answer pairs gave no gain. The results are one run per configuration. The paper also reports no decontamination, though some of its question-and-answer data was derived from GSM8K and MATH, the source of MATH500’s problems. OctoThinker
PRISM repeated the pattern across seven base models from four families, 3B to 24B parameters, with about 27 billion tokens of mid-training each. Before any RL, math scores rose by 15 to 40 points and code by 5 to 12 across all seven. Graduate-level science questions rose by 6 to 13 on the Granite models and Nemotron-H, a hybrid of attention and Mamba layers, and a general benchmark or two slipped. PRISM
PRISM also applied RL directly to four of the base models. On Granite-3.3 8B, those runs ended about 37 points below RL after mid-training in math, 14 in code and 5 in science, and on three of the four base models competition-math scores stayed near zero throughout. That comparison favours the mid-trained models: the RL reward counted an answer only inside a thinking format that the mid-training data taught, and the RL prompts were selected for difficulty using one mid-trained model. PRISM
The composition of the mid-training mix mattered more than the composition of the RL prompts. On Granite 8B, changing the RL mix moved the average by 0.2 points, and adding science data to mid-training moved it by 5.6. Each of these RL results is a single run. PRISM
The studies above gave the mid-trained model a whole extra stage of training, 220 billion tokens in OctoThinker’s case, so their contrasts mix the stage’s effect with extra compute. Zhang, Neubig, and Yue tested mid-training before RL at equal compute, in a fully synthetic arithmetic setting at 100M parameters. They gave a fifth of the budget to mid-training on the same kind of problems the RL stage trains on and the rest to RL. On held-out problems of that difficulty, just past the 2 to 10 operations the model was pretrained on, the split stayed ahead of RL alone, or level with it, at every budget tested. Zhang et al.
On the hardest held-out problems the result depended on the measure. By pass@128, the share of problems solved at least once in 128 tries, the split led RL alone by 13.5 points at the smallest budget and trailed by 3 to 8 points at the three largest. By pass@1, a single try, it stayed ahead, or within half a point, at every budget. The chart below shows the split’s lead at each budget, for problems of the trained difficulty and for the hardest ones (values read from the paper’s figure; the paper reports no repeat runs). Zhang et al.
Lead: the split's score minus RL alone's, in percentage points, at the same budget · pass@1 counts problems solved on the first try, pass@128 problems solved at least once in 128 tries · 100M-parameter model, synthetic arithmetic · values read from the paper's figure; no repeat runs reported
The authors read the pattern as a division of labour: mid-training installs what RL then builds on, and RL’s exploration is what reaches harder problems. They recommend most of the budget for mid-training when the target is problems like the training ones, and a modest share followed by heavy RL for harder ones. At 100M parameters on synthetic arithmetic, with no repeat runs, that is a hypothesis for larger models rather than a measurement of them.
That pass@128 result cuts against the premise that RL mostly amplifies what the base model already does: in this synthetic setting, with one run per setting, it suggests mid-training need not cap what RL reaches, not that it never does. Zhang et al.
Open questions
Four further questions rest on one or a few studies each. Whether a domain left out of the mix recovers depended on what was measured, and decayed checkpoints fine-tuned worse in two studies. In small studies, when the curated data should arrive depends on the learning-rate schedule, and distillation raised reasoning at some cost to factual recall.
Balance between domains
Xu and Zheng mid-trained Qwen3-8B on five synthetic logic domains in 30 different proportions, five seeds each. Measured right after mid-training, each domain scored best at a moderate share, between about 10 and 40 percent, and a domain given no share fell sharply. Xu and Zheng
Whether that lasted depended on what was measured. Through the paper’s fine-tuning and RL, on three allocations, a domain given no share ended at or above the score fine-tuning alone gives it, clearly for one domain and within noise for the other. An allocation that gave two domains nothing ended level with a balanced one (65.9 against 66.1). Across all 24 checkpoints, though, a further fine-tuning pass, whether uniform or weighted toward the under-served domains, raised almost every score but closed none of the gaps between domains by 5 points. Any continued training moved things, including a control on educational web text alone, which dropped the model’s strongest domain from 84 to 29 percent. Xu and Zheng
Decay and later fine-tuning
This question qualifies the OLMo 2 result in Separating the decay from the data, whose lift was measured before post-training. Yano and colleagues pretrained 1B and 8B models with and without a learning-rate decay. The undecayed checkpoints scored worse after pretraining and 0.3 to 1.4 points better after supervised fine-tuning. The decayed models sat in sharper minima, regions where the loss rises steeply as the weights move, which the authors link to their poorer adaptation. Yano et al.
Maskey and colleagues found the same reversal in September 2026 on a 30-billion-parameter mixture-of-experts model. A checkpoint decayed at the end of pretraining beat an undecayed one on every pretraining measure, then ended worse after identical mid-training, long-context and fine-tuning stages. Most of the gap came from one code benchmark on which it failed to stop generating; without that benchmark the gap was about a seventh as large. Maskey et al.
These reversals connect to the settling described earlier. The decay that lets the weights settle also sharpens the loss around them: MiniCPM’s authors measured the curvature of the loss rising during their decay, and Yano and colleagues measured sharpness rising as the rate fell. If flatter weights adapt more easily, as Yano and colleagues argue from a correlation across their runs, then the move that lowers the loss before post-training also makes the weights harder to fine-tune. That link is a reading of these results, not something a study here tests directly. Kotha and Liang reach the same practical advice from their schedule result: they ask developers to release the checkpoint and optimizer state from before the cooldown, as a better starting point for fine-tuning. MiniCPM, Yano et al., Kotha and Liang
When the curated data should arrive
The definition at the top puts the curated data at the end of the run, arriving as the learning rate decays. Studies so far, at 15B parameters or smaller and from single runs, test both halves of that.
Feng and colleagues’ 8B run is the closest comparison with spreading the data out. Their two-phase run put the curated mix over the final 40 percent; a control saw the same data in random order. The two-phase run scored 1.7 points higher on average, mostly from math (40.3 against 30.9 on GSM8K) and code, while MMLU did not move. Feng et al.
NVIDIA’s front-loading study asks whether reasoning data belongs late at all. It pretrained an 8B model on one trillion tokens with reasoning data at 20 percent from the first token, then applied the same supervised fine-tuning and reinforcement learning to that model and to a baseline without it. The strongest of its three reasoning-pretrained variants, the only one taken through reinforcement learning, finished 18.7 points higher on average across eight math, science, code and knowledge benchmarks. Doubling the baseline’s fine-tuning data narrowed the gap but did not close it. Its pretraining data also contained the fine-tuning set, so part of that lead may come from seeing the fine-tuning data twice. The study has no mid-training arm, so it cannot say whether the same data inserted late would have matched front-loading. Akter et al., front-loading reasoning
Zhu and colleagues argue that the decay reduces the model’s ability to use the high-quality data it sees then. They report that dropping the batch size at the data transition, instead of only lowering the rate, raised their 15B mixture-of-experts model’s average from 49.8 to 51.5. Zhu et al.
Two small-model studies measured how the decay and the data’s arrival interact. Luo and colleagues (1.5B parameters, November 2025) found that putting the highest-quality data last helped under a constant learning rate and helped less the longer or deeper the decay. Haodong Wen and colleagues (630M and 3B parameters, October 2026) got the lowest loss on the new data by keeping the rate high after that data enters and decaying over only the last 10 to 40 percent of its window. That beat starting the decay as the data enters, which is what OLMo 2 does. The studies are single runs, H. Wen and colleagues measure only loss, and none tests reinforcement learning, so the question remains open. Luo et al., H. Wen et al.
Distillation during mid-training
Distilling from a larger model changes the objective, which the definition at the top holds fixed. He and colleagues distilled a 7B or 13B teacher’s next-token probabilities into a 1B student during mid-training on the OLMo 2 mix. Ordinary distillation raised the student’s reasoning scores to 1.2 to 1.5 times those of plain next-token training but kept only 94 to 96 percent of its factual recall. The authors trace the shortfall to facts the student had not yet learned: on those, the teacher’s guidance was weakest. He et al.
Restricting distillation to the teacher’s most confident tokens raised reasoning to 1.6 to 1.7 times the baseline and kept about 97 percent of the recall. After post-training the recall gap closed, while reasoning stayed 1.25 to 1.32 times higher. He et al.
What the evidence supports
Before post-training, the decay and the new data raised different scores in the one study at 7B or above that separates them, and in small or confounded studies what the stage adds changed what fine-tuning and reinforcement learning could reach. Nearly every result is one training run per configuration; only a few of the studies here report seeds.
Settled, as observations under the conditions named:
- Mid-training is continued next-token training on a smaller, curated mix that keeps much general text, done while the learning rate finishes decaying and usually while the context window grows. Most of the published recipes compared here give it 1 to 3 percent of their tokens, Qwen3 about 14.
- Ending a constant-rate run with a decay brings its loss down to about the cosine schedule’s level, in MiniCPM’s and Hägele and colleagues’ runs.
- Extending the context cost OLMo 3 math, and later training cost long-context ability in PRISM’s Granite model and in SmolLM3; PRISM recovered part of it with long-sequence training, SmolLM3 by averaging weights.
- Labs score candidate datasets cheaply by adding them to, or removing them from, a late stage of training (Llama 3, OLMo 2, Blakeney and colleagues), though in one study base-model scores did not show how far apart RL would put three corpora.
Interpretation, where the cause rests on one study, small models or confounded set-ups:
- In the one study at 7B or above that separates them, single runs on OLMo 2 7B, finishing the decay on ordinary data lifted multiple-choice scores before any post-training, while the new data supplied the math gain and most of the generative-task gain. The math gain came from math sets or instruction data, not from better general data.
- That the decay works by letting the weights settle is Wen and colleagues’ theory, with consistent interpolation evidence from their own runs and from Hägele and colleagues’.
- How the new data is written moved math scores as far as what it covers, in single tests from two OLMo reports; the rewritten math set was also about twice as many tokens, and OLMo 3’s fall came mainly from unparseable answers.
- Keeping general data in the mix made the target data go further in one 150M study. In one 160M study, a model switched to code alone ended fine-tuning with a higher web loss than one that mixed code in, though the two also started the code at different times.
- In models up to 1B parameters, scored by loss, mid-training moved the model toward code and math when the new data ran for two thirds or more of training. When its data matched the fine-tuning domain, the model usually ended fine-tuning with a lower web loss (seven of eight comparisons), though the study cannot say whether it forgot less.
- After RL, models given a stage added to a finished base model, with extra compute, ended far above the same base models on math in two studies, under RL recipes that favoured the mid-trained models and with no decontamination reported. In one of them, three corpora that were within about a point of each other on MATH500 before RL ended about 36, 31 and 10 after it, a ranking that matched the one before, so base-model scores did not show how far apart RL would put them.
Open:
- How long the new data should run. In a 7B and an 8B sweep, a late mix longer than a tenth of training raised math and code further: at 7B up to the longest window tested, 30 percent, and at 8B up to 40 percent, with both falling at 50. General scores stayed within 1.5 points of their 10 percent values, slipping at 7B. The authors chose 10 to 20 and 40 percent, each with its own mix and one run per setting.
- Whether the curated data belongs in a late stage at all. No study compares the two at production scale; at 8B parameters, two phases beat a random order of the same data by under 2 points, mostly on math and code, and small-model studies find the answer depends on the learning-rate schedule.
- Whether finishing the decay helps or hurts what post-training can do. Two studies, one at 1B and 8B parameters and one on a 30-billion-parameter mixture-of-experts model, found decayed checkpoints doing worse than undecayed ones after fine-tuning, by about a point in one and mostly on one code benchmark in the other, each from single runs.
- Whether mid-training before RL pays at equal compute. In the one test, synthetic and at 100M parameters, giving a fifth of the budget to mid-training kept the split ahead of RL alone, or level with it, on problems of the trained difficulty at every budget; on the hardest problems, its lead at pass@128 reversed at larger budgets.
- Whether a domain left out of the mix stays down. In one study of synthetic logic domains, measured right after mid-training, leaving a domain out dropped it sharply, but so did training on general web text alone; the paper’s fine-tuning and RL, on three allocations, left each of two domains given no share at or above its no-mid-training baseline (clearly for one domain, within noise for the other) but left the gaps between domains in place.
- What distillation during mid-training costs. In one study with a 1B student, it raised reasoning scores and kept 94 to 96 percent of factual recall; distilling only the teacher’s most confident tokens closed the recall gap after post-training.
Two cautions apply to all of it. Benchmark gains across this stage are entangled with contamination unless the report says how it was checked. And the word itself now covers a five-trillion-token reasoning stage, a one-percent annealing mix, a chat-formatted reasoning stage, and a million to a billion tokens of alignment documents. A claim about mid-training can only be interpreted with the recipe attached.
Further reading
Selected sources, with first-preprint dates. Most were gathered through 21 September 2026; Feng et al., Luo et al., Maskey et al. and H. Wen et al. were added in a review on 2 November 2026.
- Definition and open recipes: OLMo 2, December 2024; COLM, 2025. OLMo 3, December 2025. SmolLM3, July 2025.
- Lab reports with a late stage under another name: Llama 3, July 2024; Nemotron-4 15B, February 2024; DeepSeek-V3, December 2024; Phi-4, December 2024; Qwen3, May 2025.
- Learning-rate schedules: MiniCPM, April 2024; Hägele et al., May 2024; NeurIPS, 2024. Wen et al., October 2024. Counterpoints: Luo et al., November 2025. Yano et al., March 2026; ICLR, 2026. Zhu et al., May 2026. Maskey et al., September 2026. H. Wen et al., October 2026.
- Data at the end of training: Blakeney et al., June 2024; Feng et al., December 2024; Kotha and Liang, March 2026.
- Mid-training and post-training: Liu et al., October 2025; OctoThinker, June 2025; Akter et al., September 2025; Zhang et al., December 2025; PRISM, March 2026; Xu and Zheng, September 2026; He et al., September 2026.
- Surveys: Mo et al., October 2025; Tu, Zhang, et al., October 2025.
- Alignment midtraining: Li et al., May 2026; Cho et al., July 2026; Baines et al., September 2026.