liveBook · Manning

Pretraining

As explained in Introduction to Generative AI, Second Edition

The initial training phase in which a model learns general representations or predictive behavior from a large corpus before task-specific adaptation.

Pretraining is the initial phase of building a large language model (LLM). The model learns foundational language patterns and information from an enormous corpus before receiving task-specific refinement. section 2.1 section 2.16

For generative models, pretraining typically uses autoregressive, or causal, token prediction: given previous tokens, the model learns to predict the next word or character. This self-supervised process does not require task-specific labels. section 2.1

Pretraining establishes broad capabilities while also carrying limitations from its data:

  • It builds internal representations that support question understanding, contextual interpretation, and closed-book answers from learned information. section 2.2
  • It usually draws on open-web material, including public pages from sources such as Wikipedia, Reddit, blogs, news aggregators, and forums. section 2.2
  • Its coverage is uneven: English and topics common in the corpus receive stronger representation, while obscure information can produce incorrect or fabricated answers. section 2.2
  • Pretraining is followed by post-training, which can target dialogue, instruction following, code generation, or mathematical problem solving. section 2.1 section 2.16

A learned assumption

When asked, “Who was the first president?” an LLM may answer George Washington, implicitly interpreting the question as referring to the United States. That response reflects patterns and geographic imbalances present in its pretraining data, not guaranteed universal understanding. section 2.2

Figure 2.1 The high-level training process for LLMs
A close-up of several white circles

AI-generated content may be incorrect.

Use the high-level training-process figure to distinguish pretraining from the later post-training stages that specialize model behavior. section 2.1

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains causal token prediction, corpus learning, and the transition to post-training without detailing optimization internals.
Examples
Uses open-web corpora, Wikipedia, Reddit, English-language imbalance, and the first-president question to illustrate learning and limitations.
What it assumes
Assumes familiarity with transformers, data sources, and token prediction while treating pretraining’s role in the pipeline directly.
What you can do after
Understand how foundational model knowledge arises, why it can be uneven, and how later training specializes behavior.
How it connects
Connects pretraining to token prediction, autoregression, self-supervised learning, post-training, emergent properties, and scaling.

Also explained in

Compare how 14 books explain pretraining →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.