LLM System InterviewHao Hoang · First edition, 2026Home

Chapter 22 Mid-Training and Post-Training Data

22.1 Instruction and Chat Data

22.1.1 Aggregated NLP Tasks (FLAN-Style)

When an interviewer asks you to explain the difference between a base model and an instruct model, the answer is almost entirely a data answer-and the FLAN-style approach is where that data story begins. Converting thousands of labeled NLP benchmarks into a unified instruction format was the field’s first systematic answer to the question “how do you teach a model to follow instructions?” It shows up in interviews at the L5-L6 range whenever the discussion reaches post-training pipelines, data mix composition, or why instruct models generalize to tasks they were never fine-tuned on directly.

The NLP community spent two decades building task-specific labeled datasets: natural language inference, sentiment classification, summarization, machine translation, reading comprehension, commonsense reasoning. Each dataset is already a collection of (input, output) pairs. The only missing piece is a natural-language instruction that wraps the pair and tells the model what task it is performing. The FLAN approach and SuperNatural Instructions demonstrated independently that if you templatize these datasets at scale-writing a handful of natural-language templates per task and applying them to every example-a model fine-tuned on the result generalizes to tasks it was never explicitly trained on.

The recipe is mechanical. For each source dataset, write kk natural-language templates, typically k=2k = 2 to 1010, that describe the task in different words. For a natural language inference example with premise pp, hypothesis hh, and gold label y∈{y \in \{entailment, neutral, contradiction}\}, one template might be:

Premise: {p}
Hypothesis: {h}
Does the hypothesis follow from the premise?
Options: Yes / No / It's impossible to tell
Answer: {y}

A second template for the same example might ask “Is the following hypothesis true given the premise?” with a different label mapping. SuperNatural Instructions collected 1,616 tasks from the NLP community, each with two or more manually written templates, producing millions of examples covering classification, generation, extraction, and structured prediction-all formatted in the same prompt-response structure.

The fundamental move is re-framing every existing supervised dataset as an instance of instruction following, so one fine-tuning run buys transfer across an entire task taxonomy.

The primary advantage is data leverage. Decades of annotation work in the NLP community become nearly free training signal with minimal new human effort. A templating pass converts a 100k-example NLI dataset into a 300k-example instruction dataset in hours. The secondary advantage is benchmark coverage: a model trained on FLAN-style data sees labeled examples from the same task families that standard evaluation benchmarks draw from, which is a direct contributor to strong HellaSwag, MMLU, and BIG-Bench numbers.

The weakness is that the prompts are templated and therefore artificial. If you sample randomly from a SuperNatural Instructions mix, many examples share the same sentence skeleton and differ only in their filled slots. Real users ask questions in idiosyncratic, messy ways: “can u explain why the EU passed that regulation” looks nothing like “Given the following passage, extract the key regulatory rationale.” Models trained only on FLAN-style data perform well on structured benchmarks but feel robotic and brittle in open-ended conversation. The pre-training data for most models contains documents like Stack Exchange Q&A and Reddit threads that already resemble instruction-response pairs; FLAN-style fine-tuning is unlocking that latent capability, not installing it from scratch.

There is also a saturation effect. FLAN-style data helps enormously early in fine-tuning-it moves the model from “coherent text continuation” to “instruction following”-but has diminishing returns past a certain coverage threshold. The empirical consensus is that 1,000+ diverse tasks from well-curated templates is sufficient; adding more tasks beyond that contributes less than improving the quality and diversity of examples within existing tasks.

A Worked Example

Suppose you are building a FLAN-style mix from three source datasets: a 400k-example NLI corpus, a 50k-example extractive QA corpus, and a 200k-example summarization corpus. Two annotators each spend a day writing three templates per task-nine templates total.

For NLI you get 400k×3=1.2M400 k \times 3 = 1 . 2 M examples. For QA you get 50k×3=150k50 k \times 3 = 150 k examples. For summarization you get 200k×3=600k200 k \times 3 = 600 k examples. Total: roughly 1.95M instruction pairs before deduplication.

You fine-tune a 7B-parameter base model on this mix for one epoch-approximately 2B tokens at an average of 1k tokens per example on an 8-GPU H100 node, which completes in under 12 hours. The model that previously generated incoherent continuations now correctly handles NLI, QA, and summarization prompts. More importantly, if you prompt it with a paraphrase task it has never seen, the model attempts it rather than ignoring the instruction. That zero-shot generalization to unseen tasks is precisely what FLAN-style training buys.

Now suppose you extend the mix with a commonsense reasoning dataset containing 100k examples and three templates. You do not need to retrain from scratch: extend the mix to 2.25M examples and fine-tune for an additional 0.5 epochs. Benchmark scores on commonsense tasks improve by 4-6 points while regression on the original three tasks is minimal-provided you weight sampling proportional to task size and keep template vocabulary diverse across tasks.

What You Actually Decide in Practice

  • Template count vs. template quality. Three to five high-quality templates per task consistently outperforms ten mediocre ones. Template quality means: varied surface forms, varied label vocabulary, varied prompt ordering. If two templates are paraphrases of each other, they provide almost no additional diversity signal.

  • Task sampling strategy. Uniform sampling over examples-not tasks-over-represents large datasets and starves small ones of gradient signal. Temperature-based sampling, where task ii is drawn with probability proportional to ∣Di∣T| D_{i} |^{T} with T≈0.7T \approx 0 . 7, smooths coverage without fully equalizing tiny tasks against large ones. Below roughly 1,000 examples per task, quality degrades because the model sees too few template variations to internalize the task format.

  • When to stop and move on. FLAN-style data is the right tool for getting a base model to follow instructions at all. Once benchmark gains from adding new tasks fall below 0.3 percentage points per additional 100k examples, further improvement comes from higher-quality open-ended data-synthetic or humanwritten-not more templated tasks.

  • Replay a pre-training fraction. Fine-tuning only on instruction data with no raw-text signal causes forgetting, especially on long-form generation. Including a 10-20% “replay” fraction of pre-training tokens in the instruction fine-tuning batch stabilizes perplexity on held-out raw text without measurably hurting instruction-following performance.

  • Label noise compounds through templating. A 15% label error rate in the source dataset becomes a 15% error rate across all derived templates. A 10k-example NLI set with clean labels beats a 500k-example set with 15% noise; expect roughly a 2-point downstream gap. Audit source dataset quality before investing in templating effort.

How This Shows Up in Interviews

  • “What is the difference between a base model and an instruct model, and how does data drive that gap?” Strong answer: a base model is trained on next-token prediction over raw text and interprets any prompt as a document to continue. An instruct model is fine-tuned on (instruction, response) pairsbeginning with FLAN-style templated NLP tasks-which teaches the model to interpret a user turn as a directive and produce a targeted response rather than a free continuation. The architectural difference is typically zero; the behavioral gap is entirely in the data.

  • “How would you build an instruction dataset from scratch with a small team and a limited budget?” Strong answer: inventory existing labeled NLP datasets in your target domain, write three to five templates per task, and convert them into a unified prompt-response format. Prioritize task diversity over raw example count-100 tasks at 10k examples each generalizes better than one task at 1M examples. Layer in real or synthetic open-ended conversations once the model reliably follows structured instructions.

  • Senior follow-up: “FLAN-style models score well on benchmarks but often feel mechanical in freeform chat. What is the root cause, and how would you fix it?” Root cause: benchmark-derived templates are structurally regular; real conversational prompts are irregular, context-dependent, and often underspecified. To close the gap, augment the FLAN mix with open-ended conversational pairs from human annotators, real user logs with appropriate consent, or a strong model prompted with diverse seed questions. Weight the open-ended component so it represents at least 30-40% of the final instruction mix, and oversample task types that exhibit the mechanical feel on a held-out conversational eval.

Key Takeaways

  • FLAN-style training converts existing labeled NLP benchmarks into instruction-following data at nearzero marginal annotation cost by wrapping each (input, output) pair in a natural-language task template.

  • The core benefit is cross-task generalization: a model that sees 1,000+ templated tasks acquires a general instruction-following prior that transfers to unseen tasks at inference time.

  • Template rigidity is the central weakness-structured prompts do not match the messiness of real user queries, so FLAN-style data must be supplemented with open-ended conversational data in any production instruction mix.

  • Use temperature-based task sampling (T≈0.7T \approx 0 . 7) rather than uniform example sampling to balance coverage across tasks of different sizes.

  • Replay 10-20% pre-training tokens during instruction fine-tuning to prevent forgetting on long-form generation, and audit source dataset label quality before investing in large-scale templating.

22.1.2 Human-Written vs. AI-Generated Instruction Data

Once instruction-following data is recognized as the lever that turns a base model into a useful assistant, the next question is immediate and practical: where does it come from? Paying humans to write examples is expensive and slow; prompting a stronger model to generate them is cheap and fast but carries license exposure and a quality ceiling bounded by the teacher. Every lab I know has grappled with this trade-off explicitly, and it surfaces in system design interviews-usually phrased as “how would you scale your SFT dataset?”-at every level from L4 upward.

There are three production-grade sources of instruction data, each with a distinct cost and quality profile.

Human-annotated data. Contractors or in-house annotators write (prompt, response) pairs following a rubric. Quality is high when the rubric is tight and the annotators are domain experts. Cost runs roughly $10-$100 per example depending on task complexity and response length; throughput is capped by headcount. Llama 2’s post-training data included human-authored examples, and the team reported that a modest number of high-quality human-written pairs outperformed millions of open-source synthetic examples for instruction following.

Distillation from a stronger model. A capable model is prompted to generate responses to a set of seed questions. The resulting (question, response) pairs are used to fine-tune a smaller target model. This is the dominant approach in the open community. Alpaca used a self-instruct loop against GPT-3 to generate 52k examples; Vicuna was trained on ChatGPT conversations shared publicly on ShareGPT; OpenHermes is an agglomeration of multiple GPT-4-sourced community datasets; the Llama-Nemotron post-training corpus draws from Llama, Qwen, and other open-weight models to avoid proprietary license issues.

Self-play and evol-instruct synthesis. The model itself-or a sibling model-is seeded with a pool of questions and asked to both expand the pool and answer the new questions. Evol-instruct methods take existing questions and iteratively mutate them to be more complex, more specific, or more constrained, producing a diversity gradient from simple to hard.

The self-instruct loop from the Alpaca work is representative of the distillation approach:

1. Seed pool: ~175 hand-written (instruction, input, output) triples
2. Prompt teacher model with k=8 in-context examples sampled
   from the pool; generate a new instruction
3. Filter: drop if ROUGE-L overlap with any pooled example > 0.7,
   or if output is malformed (empty, refusal, truncated)
4. Add accepted example back to pool
5. Repeat until target corpus size is reached

The self-instruct loop converts a few hundred seed examples into tens of thousands of training pairs; the ceiling on quality is the teacher model’s own capability, and that ceiling descends into the student.

Human annotation wins on quality ceiling and legal cleanliness. For tasks where the teacher model is known to be unreliable-highly regulated domains, multi-step mathematical reasoning before strong reasoning models existed, low-resource languages-the only defensible path is a human expert who understands the failure modes. Human-written data also carries no downstream license risk: if your annotators wrote it, you own it.

AI generation wins on cost, coverage, and throughput. A single GPU-day on a 70B model produces 100k diverse examples; the equivalent human annotation would cost tens of thousands of dollars and weeks of turnaround. Coverage diversity is also genuinely hard to match by hand: prompting a strong model to answer questions spanning astrophysics, tax law, culinary chemistry, and software debugging gives you breadth that no annotation workforce could deliver efficiently.

The critical failure mode for AI-generated data is confident wrongness. A teacher model does not generate examples it is uncertain about; it generates fluent, plausible-sounding responses that happen to be incorrect. The student model learns that confident, fluent responses are correct by construction-exactly the hallucination problem. When you later evaluate with a judge model, you may not even catch this because the judge has the same blind spots as the teacher. Human-written data at least has domain experts who know when to say “I don’t know.”

A Worked Example

Consider building a 100k-example SFT dataset for a coding assistant. Budget: roughly $5,000 and two weeks of engineering time.

Option A-human annotation. Hire 20 contractors at $25 per example, each writing Python and SQL prompt-response pairs. At 10 examples per contractor per day, you produce 2,000 examples per day-reaching 100k in 50 working days. That is 10 weeks of calendar time and $2.5M. Clearly not viable.

Option B-distillation from Llama 3 70B. Write 500 seed prompts covering Python, SQL, debugging, code review, and docstring generation. Run the self-instruct loop prompting Llama 3 70B via 8 H100s. Apply an execution filter: run every generated code block through a Python interpreter and discard examples where the snippet raises an uncaught exception. This filter removes roughly 15% of outputs and is the single highestleverage quality gate for code data. In three GPU-days you produce 100k filtered examples at a compute cost of approximately $600. License check: Llama 3’s acceptable use policy permits training derivative models for organizations below the commercial threshold, which covers most teams.

The resulting 7B model fine-tuned for two epochs scores 5-8 points below a model trained on premium human-written coding data on a hard held-out benchmark. For most teams below frontier scale, that gap is the correct economic trade-off. Human annotation is then reserved for the specific task slice-perhaps adversarial debugging or multi-file refactoring-where AI generation is demonstrably wrong on the held-out eval.

What You Actually Decide in Practice

  • Read the teacher model license before you generate a single example. OpenAI’s terms of service explicitly prohibit using GPT-4 outputs to train a competing model; violation exposes you to contract breach, not just moral awkwardness. Open-weight models-Llama, Mistral, Qwen-have more permissive terms, but Llama still restricts commercial use above certain active-user thresholds. The right answer is to read the actual license document, not a summary in a blog post.

  • Apply an automated quality gate matched to the task type. For code: execute the snippet and discard failures. For structured outputs (JSON, SQL, function calls): parse and schema-validate. For factual QA: optionally run a retrieval check against a known-correct source. A well-targeted filter removes 10-20% of AI-generated examples and consistently improves downstream evaluation scores by 2-5 points relative to raw unfiltered generation.

  • Diversity matters more than volume past roughly 10k examples. Generating 500k examples from 20 seed prompts produces a dataset with shallow diversity that adds little over 50k. Measure diversity concretely: compute n-gram entropy over instructions, or cluster instruction embeddings and measure the fraction of clusters with fewer than five members. When diversity stops growing, expand the seed set rather than generating more from existing seeds.

  • Reserve human annotation budget for the hard tail. Run a small held-out evaluation first. Identify the task slices where the AI-generated model fails at rates above your threshold. Allocate annotation to exactly those slices. Human annotation at $50 per example is only expensive if you spend it on tasks where AI generation already works.

  • Defend against annotator leakage. When Llama 2’s team ran human annotation, they acknowledged a real risk: contractors querying GPT-4 and pasting the output as their “human-written” submission. A practical detector is to measure the perplexity of the submitted response under the suspected teacher model. Responses that score anomalously low-lower than median responses from genuine domain expertsare likely machine-generated. Flag them for review rather than discarding automatically, since a domain expert might produce text that happens to look similar to GPT-4 output simply because they are both correct.

How This Shows Up in Interviews

  • “You have a $50k budget and six weeks to build an SFT dataset for a domain-specific assistant. Walk me through your approach.” Strong answer: spend week one identifying the five to ten task types the assistant must handle and running an AI-generation pilot on each to measure failure rate. Allocate human annotation to the one or two types where AI generation fails above threshold-likely domain-specific reasoning or regulated content. Use distillation from an open-weight 70B model for the remainder with task-appropriate quality filters. Plan for 70-90k AI-generated examples and 5-10k human-written ones; oversample the human examples in the training batch by a factor of three to compensate for volume imbalance.

  • “What are the risks of training on GPT-4-generated data?” Strong answer: three distinct risks. First, the OpenAI terms of service prohibit using model outputs to train a competing model-this is a legal and contractual risk, not just an ethical concern. Second, the student model inherits the teacher’s failure modes without the teacher’s uncertainty calibration: it hallucinates confidently in the same situations GPT-4 does, because those are precisely the situations where the training examples were wrong. Third, GPT-4’s style and safety filters shape the data distribution in ways that may not match the deployment context-you are distilling a general assistant when you may need a specialized one.

  • Senior follow-up: “Llama 2 reported that a small set of human-written examples outperformed millions of open-source synthetic examples. Is that a general result?” Senior answer: it is regimeand quality-dependent, not a fundamental law. The open-source synthetic datasets available at the time Llama 2 was trained were low-diversity and generated from weaker teacher models. When the quality of AI-generated data is controlled-strong teacher, diversity-enforced seed set, automated quality filtering-it consistently matches or exceeds small human-written corpora at fraction of the cost. The Llama 2 paper also noted that RLHF on top of either data source recovered much of the gap, which suggests the humanannotation advantage was partly about capturing preference signal rather than instruction quality alone. The operationally correct interpretation is: human annotation is worth the cost at the thin tail where the task is genuinely beyond AI generation; everywhere else, distillation with a quality gate is the right call.

Key Takeaways

  • Human annotation provides the highest quality ceiling and full legal cleanliness but costs $10-$100 per example; reserve it for the hard tail where AI generation demonstrably fails.

  • Distillation from open-weight models (Llama, Qwen, Mistral) is the dominant cost-effective path-but always verify the license before generating training data, since proprietary model terms often prohibit training competitors.

  • The self-instruct loop scales a few hundred seed prompts to 100k+ examples in GPU-days; quality is bounded by the teacher model and improved most reliably by automated execution or format filters that remove 10-20% of raw outputs.

  • Diversity matters more than volume past ~10k examples: measure n-gram entropy or embedding cluster coverage and expand the seed set when diversity plateaus rather than generating more from existing seeds.

  • Annotator leakage-contractors querying a proprietary model to produce nominally human-written data-is a real production risk; detect it by measuring submission perplexity under the suspected teacher model.

22.2 Long-Context and Domain Data

22.2.1 Books and Math for Context Extension

When an interviewer asks you to extend a 7B model’s context from 4k to 128k tokens, most candidates immediately reach for RoPE scaling factors and overlook the data question entirely. What you actually train on during the extension phase determines whether the model genuinely attends across the full window or merely pattern-matches on position encodings it has never encountered. Long-context extension appears in senior and staff-level interviews because it sits at the intersection of architecture, training schedule, and data curation-and getting the data mix wrong wastes weeks of expensive GPU time.

The fundamental problem is cost. Full attention scales as O(L2)O ( L^{2} ) per layer in both compute and memory, where LL is the sequence length. If standard pre-training runs at L=4096L = 4096, extending to L=131072L = 131072 (128k tokens) multiplies attention cost by a factor of (131072/4096)2=1024( 131072 / 4096 )^{2} = 1024 at each layer. Training at that length from the first step would consume the entire compute budget before the model has learned basic language patterns, so the canonical practice is to defer long-context training to a dedicated mid-training phase once a strong 4k checkpoint exists.

The data requirement for this phase is specific: you need documents with genuine long-range dependencies, not simply long documents. A 128k-token chunk assembled by concatenating 32 unrelated 4k web pages has no dependency structure beyond each page-the model learns nothing about attending across the full window. Books are the canonical source because they encode narrative arcs, character motivations, and thematic callbacks that span tens of thousands of tokens. The PG-19 dataset, derived from Project Gutenberg, was specifically constructed to benchmark long-context language models because book chapters force models to track information from much earlier in the sequence. Mathematics and formal papers are complementary: proof steps and derivations maintain tightly coupled variable definitions across hundreds of lines, creating a different pattern of long-range dependency that covers reasoning chains rather than narrative continuity.

Long-context extension is a mid-training phase, not a pre-training phase, because O(L2)O ( L^{2} ) attention cost makes early long-context training economically irrational, and the model is not capable enough early on to benefit from the distant context anyway.

Books force genuine cross-sentence coherence. A reference to a character’s internal conflict in chapter 15 connects back to something established in chapter 1-the only way to assign meaningful probability to that reference is to actually use the distant context. This is precisely the training signal a context-extension phase needs. Random web text concatenated to fill a 128k window teaches the model that context is useless beyond 4k, because it is: the adjacent documents are unrelated. You can verify this failure mode by checking attention entropy across positions in a model trained on stitched documents-heads at position 60k are essentially ignoring positions 1-40k.

The trade-off versus starting long-context training from scratch is purely economic. A model trained from step zero at 128k would require hundreds of billions of tokens to reach base language quality, burning roughly 1024×1024 \times the compute per token at the attention layer compared to 4k training. The mid-training approach inherits all the knowledge from cheap 4k pre-training and spends a much smaller budget-typically 20-50B tokensadapting the positional encoding and calibrating the attention patterns for the longer window.

Against the alternative of simply relying on sliding-window or sparse attention to avoid the quadratic cost: those approaches reduce the compute burden but also reduce quality at tasks that genuinely require attending across the full window. Full attention at mid-training, on the right data, remains the highest-quality path for frontier models.

A Worked Example

Suppose you have a 7B model pre-trained to 200k steps at L=4096L = 4096. Your target context length is 128k. Hardware budget: 256 H100s (32 nodes of 8). Estimated mid-training budget: 40B tokens.

Data mix:

  • 65% books (PG-19 and similar long-form corpora): average document length 80k-200k tokens, packed contiguously by chapter.

  • 20% arXiv and math papers: average document length 10k-40k tokens, packed contiguously per paper.

  • 15% long-form web documents: filtered to documents with raw length >> 32k tokens, using the original HTML parser (not WET) to preserve structure.

Sequence packing rule: fill each 128k-token training chunk from a single document or from contiguous chapters of one book. Never pack unrelated documents into the same chunk. This is non-negotiable-mixing documents destroys the long-range dependency signal.

Graduated schedule: Run 10B tokens at L=32768L = 32768, then 10B tokens at L=65536L = 65536, then 20B tokens at L=131072L = 131072. Each transition applies a learning rate warmup of 500 steps to absorb the change in positional encoding behavior. Jumping directly from 4k to 128k causes loss spikes because the position encodings have never been exercised at intermediate ranges.

RoPE adjustment: Apply NTK-by-parts interpolation before the extension phase begins, scaling the base frequency by a factor of (128k/4k)1/(dim/2−1)≈8( 128 k / 4 k )^{1 / ( \text{dim} / 2 - 1 )} \approx 8 for a 128-dimensional head. This initializes the position encodings to a state the optimizer can refine rather than one it must escape from.

At the end of the 40B-token schedule, perplexity on long-document benchmarks improves by 15-25% relative to the base 4k model, while short-context benchmark scores degrade by less than 2% if you maintain 10% general web text in the mix.

What You Actually Decide in Practice

  • Never skip the graduated schedule. Jumping from 4k to 128k in one step causes optimizer instability because the gradient signal from positions 4k-128k is initially near-random. Two or three intermediate lengths costing 10-15B tokens each are always worth the insurance.

  • Maintain 10% general web text throughout the extension phase. Removing short-context data entirely for the sake of long-document purity causes capability regression on standard benchmarks. The loss on short-context tasks climbs noticeably after 5B tokens of pure long-context training.

  • Use document-contiguous packing, always. If your packing code splits chapters at random boundaries, audit it before the run starts. Splitting a 90k-token chapter at the 65k mark and continuing in the next chunk gives the model a truncated signal. Either pack full documents or set a hard minimum document length equal to the chunk size.

  • Books are not just any long text. A 128k chunk assembled from 30 news articles concatenated in order has a document-length of 128k but a coherence length of roughly 4k per article. Use documents where the author intended a reader to track information over the full length: books, long-form investigative journalism, technical manuals, multi-part legal filings.

  • Evaluate before the extension phase ends. Run a checkpoint at 20B tokens through a long-context needle-in-a-haystack test. If the model cannot retrieve facts from the middle of a 64k window, the data packing is likely wrong-fix it before burning the rest of the budget.

How This Shows Up in Interviews

  • “Walk me through how you would design a context-extension phase for a model that currently supports 8k tokens but needs to reach 1M.” Strong answers cover the graduated schedule, document-contiguous packing, the choice of books and math as the primary corpus, and the architectural adjustment (RoPE scaling). Weak answers describe only the architecture change with no mention of data.

  • “Why not train at long context from the beginning?” The answer is cost: O(L2)O ( L^{2} ) attention means long-context training per token is orders of magnitude more expensive. The model is not capable enough in early training to exploit distant context, so the compute would be wasted. Mid-training extension amortizes that cost over a checkpoint that already has strong language priors.

  • Senior follow-up: “Your book corpus is 90% genre fiction. What does that mean for the model’s long-context capability?” The senior answer identifies that the model learns long-range narrative coherence patterns specific to fiction-character tracking, dialogue attribution, scene transitions-but misses the dependency structures in technical writing, legal documents, and formal mathematics. To build general long-context capability, you need domain-diverse long documents: books plus arXiv papers plus legal filings plus long-form technical documentation. Genre imbalance in the extension corpus produces a model that can retrieve story facts from 80k tokens but struggles to track variable definitions across a long proof.

Key Takeaways

  • Long-context extension is a mid-training phase because full attention scales as O(L2)O ( L^{2} )-deferring it to after pre-training saves the majority of compute while preserving the quality benefit.

  • Books and math papers are the canonical sources because they contain genuine long-range dependencies: narrative arcs and formal proof chains that force the model to use the full window.

  • Always pack documents contiguously; mixing unrelated documents into one long chunk destroys the dependency signal and teaches the model that distant context is noise.

  • Use a graduated sequence-length schedule with intermediate lengths-jumping directly from 4k to 128k causes optimizer instability and loss spikes.

  • Retain 10% general web text in the extension mix to prevent short-context capability regression.

22.2.2 Synthetic Rephrasing and Task Conversion

If aggressive quality filtering retains only 1-2% of your raw token pool, you face a hard arithmetic problem: frontier models now train on 15-36 trillion tokens, and a 3.8T-token baseline like DCLM may not sustain a large model for a full training run. Two techniques developed in recent mid-training pipelines attack this problem directly-rephrasing low-quality documents into usable prose, and converting high-quality documents into structured instruction-following examples. Both appear in senior interviews framed as “how do you get more usable signal out of data you already have without crawling more of the web?”

Rephrasing uses a capable language model to rewrite documents that fall below your quality threshold into cleaner prose. The source document supplies the factual content; the rewrite model normalizes grammar, removes boilerplate and template noise, and restructures run-on sentences. The resulting token is synthetic, but the information it encodes is grounded in original text rather than hallucinated from scratch.

Task conversion applies a language model to high-quality source documents to generate structured inputoutput pairs. Given a Wikipedia article or a math textbook passage, the conversion model produces multiple task variants:

Source: Wikipedia article on Bernoulli numbers

Task variants generated:
  QA:      Q: "What is the generating function for Bernoulli numbers?"
           A: "t / (e^t - 1) = sum_{n=0}^{inf} B_n * t^n / n!"

  Summary: Input: [article text]
           Output: [3-sentence summary]

  Extract: Input: [article text]
           Output: [key formulas and their names]

The general form is: given a source document DD, generate {(\{ (prompt,i,_{i} response)i})_{i} \} for i∈{i \in \{QA,, summarize,, extract,, classify,...}, . . . \}. This is precisely the transformation that FLAN and Supernatural Instructions applied to NLP benchmark datasets in 2022-the Nemotron-CC work extended it to raw corpora at scale.

Rephrasing extends usable token count beyond what filtering alone allows; task conversion pre-loads instruction-following structure before post-training begins.

The token yield argument for rephrasing is concrete. DCLM-baseline filtered 240 trillion raw tokens down to 3.8 trillion-a 1.4% retention rate-using an aggressive fastText classifier. Nemotron-CC, operating on the same Common Crawl pool with a combination of quality bucketing, rephrasing, and task conversion, produced 6.3 trillion tokens: roughly 1.7×\times the DCLM yield, and Nemotron-CC achieved better average benchmark scores than DCLM-baseline on downstream evaluations. The compute spent rephrasing borderline documents was cheaper than the alternative of crawling additional raw data or accepting the smaller token budget.

Task conversion addresses a different problem. Standard pre-training data is overwhelmingly document-shaped: a model trained on it learns to continue documents, not to answer questions posed by a user. The gap between “document continuation” and “respond to an instruction” is what post-training is designed to close, but the gap is easier to close if some instruction-following structure was already present in mid-training. Models that see task-formatted data during mid-training require fewer post-training examples to reach the same instruction-following quality-the gradient signal is not starting from zero.

The risk of rephrasing is error propagation: if the rewrite model makes a factual error or hallucinates, that error enters the training corpus as if it were original text. This is why rephrasing should target only documents that a quality classifier scores in the lower-quality band-documents already unreliable enough that the rephrase is no worse than the original. Rephrasing high-quality sources like Wikipedia introduces risk with no gain.

A Worked Example

Suppose your quality classifier partitions 10 trillion filtered tokens into three tiers based on educational value score:

  • Tier A (top 20%, score>\text{score} > 0.8): 2T tokens. Source: Wikipedia, arXiv, high-quality STEM sites. Action: keep as-is; additionally run a 70B Nemotron-class model to generate 3 task variants per document (QA, summarization, extraction). Estimated additional yield: 22T×3×0.6\times 3 \times 0 . 6k avg response tokens/3/ 3k avg doc tokens ≈1.2\approx 1 . 2T task tokens.

  • Tier B (middle 50%, score 0.4-0.8): 5T tokens. Source: general web pages with moderate coherence. Action: rephrase using a distilled 7B rewrite model. Expected quality lift: score distribution shifts to 0.6-0.85. Yield after deduplication: approximately 4.5T tokens.

  • Tier C (bottom 30%, score<\text{score} < 0.4): 3T tokens. Action: discard. Rephrasing severely incoherent text is not cost-effective-the rewrite model cannot reliably recover factual content from near-nonsense.

Total yield: 22T (Tier A original) +1.2+ 1 . 2T (task pairs) +4.5+ 4 . 5T (Tier B rephrased) =7.7= 7 . 7T usable training tokens, compared to 22T if you kept only Tier A or ≈3.8\approx 3 . 8T if you applied aggressive filtering without rephrasing.

Compute cost estimate for rephrasing 5T tokens: at 500 output tokens per second on a single H100 in bf16, and assuming a 3:1 input-to-output length ratio for rephrasing (each 4k document produces a 4k rewrite), you need roughly:

5×1012tokens500tokens/sec×256GPUs≈39,000GPU-hours\frac{5 \times 10^{12} \text{tokens}}{500 \text{tokens/sec} \times 256 \text{GPUs}} \approx 39 , 000 \text{GPU-hours}

That is a small fraction of the pre-training GPU budget for a 7B model over 6T tokens, which runs into the millions of GPU-hours. The yield increase justifies the rephrasing compute.

What You Actually Decide in Practice

  • Rephrase only the middle quality tier. Tier A documents are already usable; rewriting them adds noise. Tier C documents are too incoherent for reliable rephrasing-the rewrite model will hallucinate to fill gaps. The 20th-70th percentile by quality score is the productive target range.

  • Diversify task conversion templates. If you only generate QA pairs, the model memorizes QA format rather than developing general instruction-following. Aim for at least five distinct task types per source document: question answering, summarization, key-point extraction, classification, and open-ended generation. Ask the conversion model to vary its phrasing rather than slot-filling a fixed template-template memorization is a real failure mode.

  • Use a rewrite model significantly stronger than the target. A 7B rewrite model fine-tuned on 70B outputs sets a quality ceiling below the 70B model’s level. A 3B rewrite model introduces systematic errors-collapsed clauses, dropped numerical precision, consistent tense mistakes-that are subtle enough to survive perplexity filtering but harmful at scale. The rewrite model should be at least 4×\times the parameter count of the target when possible.

  • Mix rephrased and original tokens; do not replace. Training exclusively on rephrased documents causes distributional drift from the original web distribution. Keep at least a 1:1 mix of rephrased and original text in the final data blend. The original anchors the distribution; the rephrase improves local quality.

  • Evaluate on held-out tasks not in the conversion templates. If your only evaluation is on tasks structurally similar to the generated pairs, you are measuring format memorization, not capability. Reserve a held-out set of instruction tasks whose format was never in the training templates; improvement on those is evidence of real generalization.

How This Shows Up in Interviews

  • “Your quality filter throws away 98% of your Common Crawl tokens. How do you get more usable data without crawling more of the web?” Strong answers cover both rephrasing and task conversion, with a concrete split of which documents to rephrase versus discard. Quantify the expected yield increase and note the compute cost. Weak answers mention “synthetic data” without distinguishing rephrasing (salvage) from task conversion (augmentation) or discussing when each applies.

  • “Is it circular to use a language model to generate training data for a language model?” The strong answer: not if the rewrite model is significantly stronger than the model being trained. The quality ceiling is the rewrite model’s quality-you are not training a model on its own outputs, you are distilling from a stronger model. Self-distillation without an external stronger teacher does collapse over repeated iterations; that is why production rephrasing pipelines use a dedicated, larger rewrite model rather than the checkpoint being trained.

  • Senior follow-up: “How do you verify that rephrased tokens actually improved model quality and did not just inflate your token count?” The senior answer: run a controlled ablation on identical token budgets (not identical document counts). Train one model on NN rephrased tokens mixed with NN original tokens; train another on 2N2 N original tokens from the next quality tier. Evaluate both on held-out benchmarks that were not part of the rephrasing or task-conversion process. If the rephrased model wins on held-out tasks, the quality improvement is real. If it only wins on tasks that look like the task-conversion templates, it is overfitting to format and the templates need diversification.

Key Takeaways

  • Rephrasing uses a stronger LM to rewrite borderline-quality documents into cleaner prose, extending usable token count beyond what filtering alone can achieve-Nemotron-CC nearly doubled token yield relative to DCLM-baseline using this approach.

  • Task conversion generates instruction-formatted input-output pairs from high-quality documents, priming instruction-following structure before post-training and reducing the post-training data requirement.

  • Rephrase only the quality middle band (roughly 20th-70th percentile); high-quality documents do not benefit, and very low-quality documents cannot be reliably salvaged.

  • The rewrite model’s capability sets the ceiling: use a model substantially larger than the target to avoid amplifying systematic errors into the training corpus.

  • Validate on held-out tasks whose format was never in the conversion templates; improvement there distinguishes real capability gain from format memorization.

22.3 Data Quality Heuristics That Matter in Interviews

22.3.1 Length, Style, and Citation Traps

An interviewer asks: “Walk me through how you would curate a high-quality instruction-tuning dataset.” The candidate who answers “I would collect long, detailed, expert-written responses with citations” sounds credible-and is describing a trap. Three systematic biases in post-training data collection-length inflation, style mimicry, and citation hallucination-consistently degrade model quality while appearing as improvements during collection. This topic appears at L5-L6 interviews whenever the discussion reaches SFT data curation, RLHF reward modeling, or why instruction-tuned models hallucinate despite being trained on “correct” responses.

Instruction tuning works by showing a pre-trained model (instruction, response) pairs and fine-tuning it to produce the response given the instruction. The model simultaneously learns two things: the content of the response and its type signature-the surface structure, length, and formatting conventions that the training distribution exhibits. These two learning signals are inseparable at the level of cross-entropy loss, which creates three failure modes.

Length bias. Human evaluators prefer longer responses by roughly 60-70% in pairwise comparisons, even when the longer response contains filler or additional hallucinations. AI judges trained on human preferences inherit this bias. A model trained via RLHF on length-biased reward signals learns to pad rather than improve accuracy. Studies have found that instruction-tuned models with dramatically different average response lengths achieve nearly identical MMLU scores-benchmark performance is largely decoupled from length-while chat evaluation scores such as AlpacaEval win rates track length closely. Optimizing win rate without length normalization is optimizing for verbosity.

Style mimicry. SFT reliably teaches output style. If 60% of training responses use bullet-pointed lists, the fine-tuned model uses bullet points even when prose is more appropriate. If training data ends responses with emojis, the model learns to generate emojis at the end as a positional pattern, regardless of semantic relevance. This is not pathological; it is exactly what next-token prediction does. The problem is that style conventions in annotation data reflect annotator culture and time constraints, not what is actually useful to end users.

Citation traps. This is the subtlest failure mode. Consider a training example with the instruction “Write an introduction to monopsony in economics” and a response ending with a formatted citation such as Bivens & Mishel (2015). Two things happen during fine-tuning simultaneously. If the model already encodes that citation from pre-training, it learns to surface it appropriately-a genuine improvement. If it does not, it learns something worse: whenever it encounters a complex academic prompt, it should append a plausible-looking citation. The model has been trained to hallucinate in a structured way, and the training loss cannot distinguish between these two outcomes.

SFT teaches the type signature of outputs unconditionally; the model cannot distinguish between “I know this fact and should cite it” and “I do not know this fact but the training distribution expects a citation here.”

The citation trap comes down to a mismatch between what the cross-entropy loss measures and what we want. The loss penalizes the model equally for failing to produce a correct citation it already knows and for failing to hallucinate a citation it does not know. From the loss’s perspective, producing any plausible citation token is strictly better than producing nothing. A model minimizing loss on citation-heavy training data therefore learns hallucination as a default structural behavior.

The principled fix is on-policy reinforcement learning, because RL only reinforces behaviors that were already latent in the model. A generation that correctly cites a known fact gets rewarded; one that invents a citation does not, regardless of stylistic plausibility. This is one of the practical arguments for why PPO and DPO sit downstream of SFT in production pipelines-they can correct for what SFT mis-teaches.

Length and style biases have a more direct remedy: measure preference scores as a function of response length, deconfound the two, and normalize win rates at annotation time. Presenting annotators with lengthmatched pairs eliminates the bias at the source. For AI judges, running ablations that hold content fixed while varying length-and measuring how much the preference score shifts-gives you an empirical length-bias coefficient you can subtract.

A Worked Example

You are building an instruction-tuning dataset for a 7B model. You use a strong teacher model to generate 50,000 responses, resulting in an average response length of 480 tokens with frequent inline citations. You fine-tune and evaluate: Chatbot Arena win rate against the base model is 62%. Encouraged, you run MMLUthe fine-tuned model and base model are within 0.3 percentage points. You run TruthfulQA: the fine-tuned model is 4.1 points worse. You manually check 200 responses: 18% contain at least one hallucinated citation or unsupported specific statistic.

The diagnosis is length inflation from the teacher model combined with citation mimicry. The 7B student learned the citation structure without having the underlying factual knowledge to support it.

The fix proceeds in three steps. First, filter training examples where response length exceeds 3×3 \times the median for that prompt category-this removes the longest-tail padding without truncating genuinely complex responses. Second, strip inline citations from training responses, replacing specific references with non-specific language such as “research in this area suggests.” Third, add 5,000 examples where the correct response is a calibrated hedge-“I don’t have reliable information on that specific claim”-for prompts where the model’s pre-training coverage is likely sparse. After retraining: TruthfulQA recovers by 3.2 points; Chatbot Arena win rate drops from 62% to 58%. That is a real trade-off, and the correct one for any deployment that cares about factual reliability.

What You Actually Decide in Practice

  • Separate style from substance in your evaluation stack. Run benchmark-based evals (MMLU, TruthfulQA, GSM8K) in parallel with preference evals (Chatbot Arena, AlpacaEval). If they diverge, trust benchmarks for capability claims. Use preference evals only for UX signal and style tuning.

  • Control length at annotation time, not post-hoc. If collecting human-written SFT data, instruct annotators to target a specific length range-for example, 150-300 words for factual Q&A, 400-600 for multi-step reasoning. Post-hoc truncation introduces artifacts; a front-loaded constraint produces more natural responses.

  • Strip or verify citations before including them in SFT data. Either remove all inline citations from training responses, or run a verification step that confirms the model can reproduce the cited fact from a zero-shot prompt before including that example. Unverified citations produce a hallucination-optimized model by construction.

  • Distillation from a much stronger teacher compounds the citation trap. If distilling GPT-4-quality responses into a 7B model, the capability gap means many responses will teach behaviors the student cannot support from its own knowledge. Prefer prompts where the student already gets the answer roughly right, and use the teacher to improve surface quality rather than inject fundamentally new factual claims.

  • 500 carefully chosen safety examples can dominate model behavior. Because SFT runs on relatively few tokens, safety data has outsized influence. Use this leverage deliberately-and audit the safety data for the same citation and length biases, because a safety response that halluccinates specifics is worse than a vague refusal.

How This Shows Up in Interviews

  • “What makes a good instruction-tuning dataset?” A strong answer names three axes: diversity of task types, correctness of responses relative to the model’s existing knowledge (not just surface quality), and calibration-explicit hedges on low-confidence claims rather than confident fabrication. Weak answers focus on response length or vague notions of “high quality.”

  • “Why do instruction-tuned models hallucinate more than base models on certain tasks?” The answer is the citation trap: SFT teaches type signatures unconditionally. If training data contains responses with citations, the model learns to produce citations as a stylistic pattern regardless of whether it has the underlying knowledge. The fix requires either on-policy training that rewards only verifiable correctness, or data hygiene that removes unverifiable factual statements before SFT.

  • Senior follow-up: “How would you design a pairwise annotation process that avoids length bias?” A strong answer includes: (1) present annotators with length-matched response pairs when possible; (2) add an explicit annotation dimension for conciseness, separate from overall quality; (3) run calibration passes where annotators compare known-correct short responses against plausible-but-longer hallucinated ones to train out the length heuristic; (4) for AI judges, compute preference score as a function of Δ\Deltalength across the evaluation set and apply a length-normalization correction before reporting win rates.

Key Takeaways

  • Human and AI evaluators prefer longer responses by 60-70% in pairwise comparisons even when length adds no factual value; always deconfound length from quality in preference evaluation pipelines.

  • SFT teaches output type signatures unconditionally-the model cannot distinguish between surfacing a known fact and hallucinating to match a structural template.

  • Including citations or specific statistics in SFT responses trains hallucination unless the model’s pretraining already encodes that knowledge; strip or verify them before training.

  • Benchmark evals (MMLU, TruthfulQA) and chat preference evals (Chatbot Arena) routinely diverge; a model that wins on preference evals can simultaneously regress on factual accuracy.

  • On-policy RL is the principled remedy for the citation trap; SFT-only pipelines require aggressive data hygiene to avoid the same failure mode.

22.3.2 Mid-Training as the New Annealing Phase

Interviewers at frontier labs increasingly ask a question that trips up candidates who know only the classical InstructGPT pipeline: “What is mid-training, and how does it differ from both pre-training and post-training?” The question probes whether you understand that modern base model checkpoints are not the same objects described in GPT-3 era papers-they have been partially instruction-tuned through a process invisible in the checkpoint name. This topic appears at L6-L7 system design interviews and in any deep-dive on training pipeline architecture, data mix composition, or evaluation methodology for open-weight models.

The classical three-stage pipeline-pre-train, then SFT, then RLHF-assumed a clean boundary between the stage that installs knowledge (pre-training) and the stages that shape behavior (post-training). Mid-training dis-solves that boundary. The key insight is that the learning rate schedule already contains a natural injection point: the decay phase of WSD (Warm-up, Stable, Decay) scheduling is the period when training loss is converging and small gradient steps are compressing the model into a stable attractor. Injecting high-quality and instruction-adjacent data during this decay phase produces a checkpoint that is simultaneously well-calibrated on the pre-training objective and partially instruction-tuned.

Concretely, a WSD mid-training setup looks like this:

Stage 1 (Stable):
  data:    ~95% web/code/books pre-training mix
  lr:      cosine stable plateau
  tokens:  ~90-95% of total budget

Stage 2 (Decay / Annealing):
  data:    ~70% pre-training + ~30% high-quality/SFT mix
  lr:      cosine decay, stable plateau -> near 0
  tokens:  ~5-10% of total budget

The high-quality SFT mix in Stage 2 typically includes upsampled Wikipedia, curated domain data (math, code, scientific papers), and a fraction of actual instruction-following pairs. The SFT-adjacent data should remain rare enough during Stage 2 that it does not displace the pre-training distribution entirely-the goal is shaping, not overwriting.

Mid-training is the decay phase used as a curriculum: the model consolidates broad world knowledge from pre-training while simultaneously acquiring the behavioral patterns required for instruction following.

When instruction tuning is applied as a completely separate post-training step, it typically runs at a moderately high learning rate on a very different data distribution. This creates catastrophic forgetting pressure: the model’s pre-trained knowledge degrades as the optimizer moves aggressively toward the instruction-following objective. Standard remedies-tiny learning rates, LoRA adapters, KL regularization toward the pre-trained weights-reduce forgetting at the cost of slower convergence or reduced final quality.

Injecting instruction data during decay sidesteps this trade-off because the learning rate is already small and monotonically decreasing. The model cannot move far from its pre-trained attractor; it is forced to find a minimal adjustment that accommodates the instruction signal. This is the same intuition behind low-learningrate probing in representation learning: fine-tuning near the end of training, when the model’s representations are already rich, extracts far more instruction-following capability per token seen than a separately initialized SFT run.

The secondary advantage is data efficiency. Because the model encounters instruction data when its pretrained representations are already mature, a much smaller absolute token count is needed to unlock instruction-following behavior. Published results from groups using this approach report that 5-15% instruction-adjacent data in the decay phase produces instruction-following quality comparable to separate SFT runs that used 5-10×\times more instruction tokens.

The downside is interpretability: the resulting checkpoint is neither a clean base model nor a clean instruct model. When a lab releases a “base model” checkpoint trained with decay-phase injection, few-shot evaluation protocols that assume a clean base-model distribution give misleading scores. Benchmark comparisons across generation boundaries require verifying the training recipe, not just the checkpoint label.

A Worked Example

The MiniCPM training pipeline is one of the few publicly documented examples of explicit decay-phase data mixing.

Stage 1 uses approximately 2.4 trillion tokens from a mix of processed Common Crawl, code repositories, The Pile, and Dolma. The learning rate holds at the stable plateau from roughly step 5k to step 200k.

Stage 2 uses approximately 130 billion additional tokens with the following approximate composition:

  • Wikipedia (carried over from Stage 1, upsampled 4×4 \times)

  • Code SFT data (verified solutions to programming problems)

  • UltraChat (multi-turn conversational data)

  • Stack Exchange QA (question-answer pairs with votes)

  • Evol-Instruct and OSS-Instruct (instruction-complexity evolved examples)

Instruction-adjacent sources constitute roughly 30-35% of Stage 2 tokens. The learning rate decays from the stable plateau to near zero across Stage 2. Total training cost is dominated by Stage 1; Stage 2 adds roughly 5-6% to the token budget but contributes disproportionately to downstream instruction-following benchmark scores.

After Stage 2, the checkpoint is released as the “base model.” Running standard few-shot evaluation on this checkpoint produces scores that cannot be compared directly to GPT-3-era base models, which had zero instruction-adjacent exposure. The base model here already behaves closer to a lightly instruction-tuned model; a subsequent short SFT pass is then used for safety tuning and formatting preferences rather than foundational instruction following.

For reference: Llama 3 was trained on 15 trillion tokens; Qwen3 on approximately 36 trillion. At these scales, a 5-10% decay phase represents 750 billion to 3.6 trillion tokens of high-quality injection-more tokens than many earlier complete training runs.

What You Actually Decide in Practice

  • Start mixing instruction data when the learning rate begins its final decay, not earlier. Mixing instruction data during the stable phase displaces web-scale knowledge unnecessarily because the model is still absorbing high-entropy pre-training signal. The decay phase is when the model is consolidating, not exploring; that is the right moment to steer.

  • Target 10-30% instruction-adjacent data in the decay mix. Below 10%, the instruction signal is too diluted to produce measurable behavioral change. Above 40%, knowledge-intensive benchmarks start degrading, indicating the pre-training distribution is being displaced. The sweet spot is empirically consistent across published ablations.

  • The “base model” label is unreliable in modern releases. If your work requires a clean base model-perplexity comparisons, probing studies, scaling law extrapolations-verify the training recipe of the checkpoint you are using. Llama 3, Qwen2, and OLMo2 base checkpoints all contain instruction data in their training lineage.

  • Long-context extension belongs in mid-training. Transformers scale quadratically with sequence length; spending Stage 1 compute on 32k-128k contexts before the model has strong representations at shorter contexts is wasteful. Introducing long-context data during the decay phase, after Stage 1 has built rich short-context representations, is the dominant approach at frontier scale.

  • A short post-decay SFT pass is still useful, but it is lighter. Decay-phase mixing handles foundational instruction-following behavior; a subsequent SFT pass at very low learning rate handles safety tuning, response formatting, and capability targeting that require precise distribution control. The two stages complement rather than duplicate each other.

How This Shows Up in Interviews

  • “What is the difference between a base model and an instruct model today?” A strong answer acknowledges that the distinction has blurred: modern base models undergo instruction-adjacent training during the decay phase of pre-training, so they are not naive text predictors. A complete answer names the WSD annealing phase as the mechanism and explains why this produces better instruction following with less catastrophic forgetting than a separate SFT run.

  • “Why would you mix instruction data into pre-training instead of doing a separate SFT run?” The answer is threefold: (1) catastrophic forgetting is reduced because the learning rate is already decaying; (2) data efficiency improves since the model’s pre-trained representations are already rich when the instruction signal arrives; (3) this approach scales using pre-training infrastructure, avoiding a separate training job with its own hyperparameter surface.

  • Senior follow-up: “How would you structure the data mix for a 70B model’s annealing phase, and what would you monitor to know if it is working?” A strong answer specifies: (1) roughly 20-30% instruction-adjacent data, starting with high-quality domain data-math, code, curated web-and adding a smaller fraction of chat SFT pairs; (2) monitor validation loss on both the pre-training held-out set and a held-out instruction set simultaneously-both should decrease, not trade off; (3) run intermediate capability evals every 5-10 billion decay tokens to catch benchmark regression on knowledge-intensive tasks early; (4) apply a KL penalty or reference-model constraint to bound distribution drift from the stable-phase checkpoint, especially if the decay phase is long.

Key Takeaways

  • Mid-training is the injection of high-quality and instruction-adjacent data during the learning rate decay phase of pre-training, exploiting the model’s consolidation dynamics to achieve instruction following with minimal catastrophic forgetting.

  • The WSD schedule creates a natural two-stage curriculum: broad web-scale learning during the stable phase, behavioral shaping during the decay phase.

  • Most modern “base models”-Llama 3, Qwen2, OLMo2-contain instruction data in their training lineage; the base/instruct distinction now describes the post-decay SFT stage, not a clean separation of knowledge from behavior.

  • Long-context extension, domain specialization (math, code), and early safety tuning all belong in mid-training rather than as separate post-training jobs, for the same data-efficiency and forgetting-reduction reasons.

  • Empirically, 10-30% instruction-adjacent data during the decay phase matches or exceeds the quality of 5-10×\times more instruction data applied in a separate high-learning-rate SFT run.