04

Pre-Training

Foundation

The broad foundation stage. The model reads huge amounts of data and learns to predict the next token. That sounds simple, but it teaches grammar and style, world knowledge, reasoning patterns, code syntax, and rough answer structure.

Dataset TypeExample UnitSourceTurn TypeWhat It TeachesBehaviorsWeaknessesCuration Concerns
General text corpusDocument chunkWeb, books, articles, forumsNon-conversationalGeneral language and factsFluency, paraphrasing, summarizationNoisy, inconsistent qualityDedup, spam removal, licensing
Code corpusFile chunks, docstringsPublic repos, docs, Q&ANon-conversationalSyntax, patterns, library usageCode generation, refactoring, APIsLearns bugs and bad practices tooLicense, secret leakage, test filtering
Dialogue/transcriptChat or transcript turnsCustomer support, forums, chat logsMulti-turnTurn-taking patternsDialogue flow, tone matchingNoisy and sometimes low qualityToxicity, privacy, spam
Domain corpusDomain documentsMedical, legal, finance, enterpriseNon-conversationalSpecialist vocabulary and styleDomain language, jargon controlCan overfit, lose generalityAuthority, recency, jargon balance
Synthetic textModel-generated textDistillation, augmentationNon-conversationalCoverage of rare formsBetter distribution shapingPolished-looking mediocrityFiltering, diversity, confidence
Multilingual corpusText in many languagesWeb, books, translated corporaNon-conversationalCross-lingual knowledgeTranslation, multilingual QALanguage imbalanceLanguage ID, script balance
Multimodal paired dataImage/audio/video + textCaptioned media, transcriptsCross-modalVisual/audio groundingVision-language, audio understandingAlignment noise, OCR errorsModality tags, alignment labels
Structured-to-textSerialized tables/JSONDatabases, APIs, spreadsheetsNon-conversationalSchema familiarityStructured data comprehensionFragile formatting habitsCanonicalization, schema consistency
Detailed Descriptions

Good Curation Focuses On

  • • Coverage: many topics, languages, writing styles
  • • Quality filtering: remove spam, corruption, duplicates
  • • Deduplication: avoid training too heavily on repeats
  • • Freshness and provenance: keep data current
  • • Safety filtering: remove disallowed content
  • • Balance: don't let one source dominate

What Pre-Training Does Not Do

Pre-training alone does not make a model reliably helpful, obedient, or safe. It makes the model knowledgeable and fluent, but not necessarily aligned with what a user wants.

Continued Pre-Training

Continued pre-training (sometimes called domain-adaptive pre-training) is a distinct stage where a base model is further trained on domain-specific text using the same next-token prediction objective. The goal is not to teach new behaviors but to shift the model's knowledge distribution toward a target domain (medicine, law, finance, or internal company knowledge).

The key difference from initial pre-training is that you start from an already-capable model and use a smaller, targeted corpus. This is how teams build specialized models without retraining from scratch.

Denoising / Span Corruption

Not all pre-training uses next-token prediction. Encoder and encoder-decoder models (like BERT and T5) use denoising objectives: the model receives text with randomly masked or corrupted spans and must reconstruct the original. This teaches bidirectional context understanding rather than left-to-right generation.

T5's span corruption, for example, randomly replaces contiguous spans with sentinel tokens, then the model generates only the missing spans. This approach is less common in modern decoder-only LLMs but remains important for understanding the full range of pre-training methods.