Pretraining & Base Models
What a base model is — a simulator of text, not an assistant — and the data it eats.
- → Explain the base-model-as-simulator framing and its predictions
- → Describe the pretraining data pipeline at a high level
- → Elicit assistant-like behavior from a base model using only context
Where the text comes from
Module 1.4 treated training data as a number, . Here we open the box. Almost every frontier model starts from the same raw material — a web crawl — and almost all of the differentiation happens in what gets thrown away.
The scale is worth stating plainly. Common Crawl publishes a snapshot of the public web every month or two; each is a few hundred terabytes of raw HTML. HuggingFace's FineWeb processed 96 of those snapshots and ended up with 15 trillion tokens — and then filtered that down to 1.3 trillion tokens of education-flavoured text (FineWeb-Edu) which, trained on, does markedly better on knowledge benchmarks. Less data, better model. That result is the whole discipline in one sentence.
Three of those stages deserve a sentence each, because each one is a place where a lab's judgement gets baked into the weights.
A base model is not an assistant
Here is the mental model most engineers arrive with: the model is a thing that knows stuff and answers questions, and post-training makes it politer. That model is wrong in a way that will cost you, and correcting it is the point of this module.
After pretraining and before any post-training, you have a base model. It has been optimised for exactly one thing: given a prefix of text from the internet, put probability mass on what came next. Not on what would be helpful. Not on what is true. On what came next.
So ask a base model “What is the capital of France?” and a very reasonable thing for it to do is produce three more trivia questions and an answer key. It has not failed. It has correctly observed that on the web, a lone trivia question is nearly always part of a quiz.
The essay that made this framing standard is janus's Simulators (2022). Its vocabulary is worth adopting because it makes the right predictions:
The frame earns its keep by predicting things the “knowledgeable oracle” frame does not. A base model will happily continue text that is confidently wrong, because being wrong is well represented on the internet. It will produce better reasoning if you tell it the author is an expert, because that conditions on a different distribution of authors. It will lose the thread of who is speaking after a few hundred tokens, because nothing in the objective rewards keeping one character alive.
In-context learning, and what post-training changes
The GPT-3 paper is titled Language Models are Few-Shot Learners, and that title is the second big idea of pretraining. Put three worked examples in the prompt and the model does the fourth — with no gradient updates at all. Brown et al. showed this working across dozens of tasks and getting reliably stronger with scale.
The simulator frame explains why this is not mysterious. Three correctly-worked examples are strong evidence about what kind of document this is and who is writing it. Conditioning on them narrows the distribution to authors who get such things right. You are not teaching the model the task; you are locating a region of text-space where the task is already being done well. (Module 3.2 will show you the actual circuit — induction heads — that implements a large part of this.)
Which leads to the honest description of post-training. Modules 2.2 and 2.3 cover the mechanics; the framing to carry in is this:
This is not a free lunch. Sharpening the distribution onto one character costs you the rest of it: post-trained models show mode collapse — much less output diversity at the same temperature, more stereotyped phrasing, worse performance at open-ended creative continuation. If you have ever found a chat model frustrating to write fiction with, this is why, and it is one reason base models are still shipped.
Feel it: the same weights, two objects
Six prompts, run through a base model and an assistant. Read the base column first and try to name the genre it decided it was in before you read the explanation.
What is the capital of France?
What is the largest country in Europe? What is the longest river in Europe? What is the smallest country in the world? Answers on page 42. Score 8 or more and you're ready for the quiz night final!
The capital of France is Paris. It has been the country's capital since 987 CE (with brief interruptions) and is home to about 2.1 million people within the city proper.
These continuations are written by hand to illustrate documented base-model behaviour — they are not logged outputs from a specific model. Run the same prompts against a real base model (Llama 3.1 8B or OLMo 2, not their “-Instruct” variants) in the problem set and compare.
Things to try: (1) Compare Bare question and Few-shot — same factual question, same weights, completely different behaviour, and the only difference is how much the prompt constrains who is talking. (2) On Open list, decide which column you actually wanted; this is the one case where the base model is the better product, and it should recalibrate “post-training is strictly an improvement.” (3) Read the Q&A shape base output and mark the exact line where the simulacrum changes. Then ask what mechanism would have to exist for a model to not drift there — that mechanism is roughly what SFT installs.
Problem set
Problem 1 is the one that matters: you have not really met a base model until you have been surprised by one. Do it before the others if you have GPU access or an API key handy.
Get access to a genuine base model — not an instruct/chat variant. Good options: Llama 3.1 8B or OLMo 2 7B (fully open data, which makes it the honest choice for this course). Run it in Colab with transformers, temperature 0.8, 200 new tokens.
Now make it behave like an assistant using only the prompt — no fine-tuning. Your deliverable: a prompt under 200 words that gets sensible answers to five different questions, plus a log of at least three failed attempts and a one-line diagnosis of each failure in simulator vocabulary.
Write down, in advance, what a base model does with each of these. One or two sentences each, and name the genre you think it will settle into.
(a) “Dear Sir or Madam,”
(b) “def quicksort(arr):”
(c) “I'm sorry, but I can't help with that.”
(d) “Translate to French: sea otter =”
(e) “BREAKING:”
Then run them and score yourself.
Use ~4 characters per token and ~5.5 characters per English word including the space.
(a) How many words is 15T tokens? (b) An average novel is ~90,000 words. How many novels is that? (c) The Pile is 825 GiB of text — roughly how many tokens, and how does it compare? (d) A fast human reads ~250 words/minute for 8 hours a day. How long to read 15T tokens?
Download a small slice of a public web corpus (a few thousand documents from FineWeb via streaming=True is ideal). Implement two dedup passes: exact, by SHA-256 of the normalised text; and fuzzy, by MinHash over 5-gram shingles with 128 permutations and a Jaccard threshold of 0.8.
Success check: report the removal rate of each pass separately, and print five near-duplicate pairs your fuzzy pass caught that the exact pass missed. Then answer with evidence: what kind of document dominates the near-duplicates?
Open the FineWeb blog post and §2–3 of The Pile. Pick one filtering decision from each and write a paragraph on it: what does it remove, what does it remove by accident, and which downstream model behaviour would you expect to change?
Then find one thing each document does not tell you that you would need in order to audit the resulting model.
The simulator framing is a lens, and a lens that can't be wrong isn't worth much. Design two experiments on a base model: one whose result the frame predicts and a naive “the model knows things” frame does not, and one whose result would count as real evidence against the frame. Say what you would expect to see in each case, and be specific enough that someone could run it.
Check yourself
Go deeper
One blog post that changes how you see the object, one paper that established what it can do, and two data documents to read like an auditor.