Continued Pretraining in Depth
local graph
Module 31 — Continued Pretraining in Depth
Section titled “Module 31 — Continued Pretraining in Depth”Chapter VI — Continued Pretraining
Continued pretraining occupies a distinctive place in the landscape of LLM development, sitting between the behavioral shaping of fine-tuning and the foundational construction of training from scratch. The approach carries the original next-token prediction objective forward while introducing a new corpus that extends what a model knows. The decision to continue pretraining arises when a capable base model exists and its knowledge of a target domain has become thin or outdated. Understanding this approach requires drawing a precise contrast with fine-tuning, because conflating the two produces misaligned strategies and disappointing results. The mechanism by which continued pretraining reshapes weight distributions also imposes limits on what it can deliver, and those limits determine whether the approach fits a given project. This module establishes the conceptual foundation for the modules that follow in this chapter, which turn to data selection and hands-on implementation among other concerns.
What Continued Pretraining Does to a Pretrained Model
Section titled “What Continued Pretraining Does to a Pretrained Model”Continued pretraining resumes the original language modeling objective on a new corpus, applying the same next-token prediction loss that drove the base model’s initial construction. The training loop processes gradients through the architecture the base model already uses, and those gradients update the same weight matrices that encoded the model’s prior understanding of language (Ibrahim et al., 2024). What changes is the data distribution the model is exposed to, and with that exposure, the statistical patterns the weights come to encode.
The effects reach every layer of the network. Embedding tables absorb the frequencies of new vocabulary and concept co-occurrence in the target corpus, while deeper projection matrices adjust to the new distribution of syntactic and semantic patterns. Earlier layers, which carry more general linguistic features, tend to undergo smaller weight changes than later layers that hold more task-specific and domain-specific information.
┌──────────────────────────────────┐ ▲ │ Domain corpus tokens │ │ │ New training distribution │ │ └────────────────┬─────────────────┘ │ ↓ │ ┌──────────────────────────────────┐ │ Small Δw │ Embedding tables │ │ │ Token and position vectors │ │ └────────────────┬─────────────────┘ │ ↓ │ ┌──────────────────────────────────┐ │ Small Δw │ Early transformer layers │ │ Gradient flow │ General linguistic features │ │ └────────────────┬─────────────────┘ │ ↓ │ ┌──────────────────────────────────┐ │ Larger Δw │ Middle transformer layers │ │ │Mixed syntactic, semantic patterns│ │ └────────────────┬─────────────────┘ │ ↓ │ ┌──────────────────────────────────┐ │ Largest Δw │ Late transformer layers │ │ │ Domain-specific representations │ │ └────────────────┬─────────────────┘ │ ↓ │ ┌──────────────────────────────────┐ │ │ Output head │───┘ │ Next-token prediction loss │ └──────────────────────────────────┘Figure 6-1. Layerwise Weight Change Magnitude During Continued Pretraining
This adjustment operates as a gradual reshaping of the model’s internal probability distribution over sequences. Continued pretraining modifies the model’s sense of what is typical in the new domain, so that domain-specific terminology and phrasing conventions begin to dominate its predictions when conditions invoke the domain.
At a mechanistic level, the updates produced during continued pretraining follow the same backpropagation and optimizer dynamics described in Module 21. The process better understood as a gradient of change than as a discrete addition. No single update installs a new piece of knowledge; instead, the cumulative effect of many updates across a large volume of target data produces representations that reflect the new domain’s statistical structure. This observation has practical consequences for how training runs are designed and evaluated, because measuring progress requires looking at aggregate behavior across the domain instead of verifying the presence of specific learned items.
The practical efficiency of the approach comes from the fact that the base model already possesses grammar and reasoning patterns, among other abilities developed during its original pretraining. Continued pretraining uses additional compute to deepen or update specific regions of its knowledge without rebuilding those general capabilities from scratch. This efficiency is what makes domain-specialized models such as FinPythia and PMC-LLaMA tractable for organizations that could not afford a full pretraining run (Xie et al., 2024).
How Continued Pretraining Differs From Fine-Tuning
Section titled “How Continued Pretraining Differs From Fine-Tuning”The most consequential distinction between continued pretraining and fine-tuning is the training objective itself. Continued pretraining retains the unsupervised next-token prediction loss that originally produced the base model. Fine-tuning, particularly in its supervised form, typically applies a loss computed only over response tokens in a prompt-response structure, so that the model learns to produce specific outputs conditioned on specific inputs. The difference in objective implies a difference in what the model is learning. Continued pretraining is teaching the model what the world looks like statistically, while fine-tuning is teaching the model how to respond when addressed.
Data volume and structure diverge from the same source. Continued pretraining consumes large volumes of unstructured text that resemble the composition of the original pretraining corpus in form, often on the order of billions of tokens for meaningful domain adaptation. Fine-tuning operates on much smaller set, in the range of thousands to low millions of prompt-response pairs. The volume difference reflects the difference in purpose. A large corpus is needed to shape the general distribution of the model’s outputs, while a comparatively small set of structured examples is sufficient to shape its behavior in response to specific kinds of inputs.
Learning rate regimes also differ. Continued pretraining is typically run with learning rates that are smaller than those used during initial pretraining but still large enough to produce meaningful weight changes across a significant volume of tokens. Fine-tuning tends to use more conservative learning rates to avoid overwriting the pretrained representations on which its behavioral adjustments depend. A continued pretraining run that uses a fine-tuning learning rate will fail to transfer enough new knowledge; a fine-tuning run that uses a continued pretraining learning rate will erase the capabilities it depends on.
What Continued Pretraining Is and Is Not Good For
Section titled “What Continued Pretraining Is and Is Not Good For”Continued pretraining is well-suited to situations where a model’s knowledge of a specific domain is insufficient for downstream tasks. When a base model has been trained predominantly on general web text and the target application requires depth in biomedical literature or a proprietary code repository, continued pretraining offers a path to incorporating that depth at a fraction of the cost of training from scratch (Xie et al., 2024). Models such as PMC-LLaMA have demonstrated the approach on biomedical corpora by extending general-purpose LLaMA weights through further pretraining on millions of PubMed Central articles (Chen et al., 2025a).
The approach is equally useful for refreshing knowledge that has become stale. A model whose pretraining cutoff precedes the release of a major framework or regulatory update will produce outdated outputs in those areas. Continued pretraining on a corpus that captures the new material can update the model’s representations so that recent content is reflected in its predictions (Chen et al., 2025a).
Continued pretraining is also appropriate for language adaptation. When a base model has limited coverage of a low-resource language, exposing it to a large corpus in that language through continued pretraining produces meaningful gains in the model’s ability to handle text in that language, though the tokenizer’s handling of the new language plays a substantial role in how efficient that adaptation is.
The limitations are equally clear. Continued pretraining does not reliably teach a model how to follow instructions, because the next-token prediction objective does not distinguish instruction from response and does not apply a loss that specifically rewards instruction-following behavior. Teams that attempt to use continued pretraining as a substitute for instruction tuning will find that the resulting model understands its domain better while responding to queries no more helpfully than the base model did.
Continued pretraining also does not reliably install alignment properties. Producing a model that refuses harmful requests or adheres to a specific conversational policy requires dedicated fine-tuning alignment techniques covered in Module 30. A continued pretraining run that exposes the model to a domain corpus will not, on its own, produce those behavioral properties and may in fact degrade them if the corpus contains content inconsistent with the base model’s prior alignment.
Continued pretraining is also a poor fit for installing highly specific factual knowledge that the model needs to retrieve on demand. Dense parameter-level storage of factual information is a lossy and unreliable form of memory, and for applications that require verifiable, up-to-date access to specific facts, retrieval-augmented generation is usually the better tool.
The distinction matters practically because teams sometimes treat continued pretraining as a mechanism for teaching a model “the company’s documentation” when what they actually need is a retrieval system connected to that documentation. For teams deciding between continued pretraining and retrieval, the relevant question is whether the target information changes frequently and requires precise, verifiable outputs. When both conditions hold, retrieval is almost always the more appropriate investment. When the target information is stable, deep, and pervasive in the domain, continued pretraining produces gains that retrieval alone cannot match because the knowledge becomes integrated with the model’s reasoning patterns.
The utility of continued pretraining also depends on the volume of available domain data. With only a small collection of domain documents, continued pretraining may produce no measurable improvement because the gradient signal is swamped by noise and by the distributional pull of any general data mixed in. Model-generated text (Module 15) can expand a small domain corpus to a size that supports meaningful learning, though the approach introduces its own risks of distribution narrowing when synthetic data dominates the training mixture.
Choosing a Base Model for Continued Pretraining
Section titled “Choosing a Base Model for Continued Pretraining”The choice of base model determines the ceiling of what continued pretraining can achieve. The weights the run starts from define the capabilities and the representational structure the continued run will build upon, along with any biases the base model carries. A base model that is strong in general reasoning and weak in a specific domain can be lifted in that domain by continued pretraining; a base model that is weak in general reasoning will not be made strong in it by continued pretraining on domain text.
Model size interacts with this choice in important ways. Larger base models tend to absorb new domain knowledge more efficiently, producing better perplexity on the new corpus for a given amount of additional training compute than smaller models do when continued pretraining is applied to the same corpus (Yıldız et al., 2024). The practical implication is that teams with access to strong large base models often produce better domain-specialized results with modest continued pretraining budgets than teams continuing to pretrain smaller models on the same data.
The architecture of the base model constrains the architectural choices available during continued pretraining. Changing the context length or the number of layers during continued pretraining is possible in principle but introduces substantial instability risk and often requires additional engineering to avoid divergence. For most teams, treating the architecture as fixed at the base model’s original specification produces more reliable outcomes than attempting to modify it mid-run.
Tokenizer compatibility is one of the most overlooked considerations in base model selection. The tokenizer of the base model determines how text in the new corpus will be segmented into input tokens, and if the tokenizer was trained on a corpus that poorly represents the target domain, the resulting tokenization will be inefficient and the model’s effective capacity for the new content will be reduced (Dagan et al., 2024). In domain adaptation to technical fields or underrepresented languages, this inefficiency can substantially increase the compute required to reach a given level of domain performance. Some teams address this by extending the tokenizer vocabulary with domain-specific tokens and initializing the corresponding embeddings before continuing pretraining, while others treat the inefficiency as an acceptable cost given the operational complexity of tokenizer modification (Dagan et al., 2024).
Evaluation characteristics of the base model also inform the decision. A base model that has been extensively benchmarked and whose strengths and weaknesses are documented provides a clearer starting point for measuring the effect of continued pretraining. Teams that begin from a poorly characterized base model often find it difficult to attribute observed changes to the training run itself, because they cannot distinguish behaviors the model already had from behaviors the continued run produced.
The licensing and provenance of the base model also matter. Continued pretraining produces a derivative work whose licensing is constrained by the license of the original weights. Teams that intend to deploy or distribute the resulting model must verify that the license of the base model permits domain adaptation and the intended deployment pattern, and this verification should precede the training run.