Generative AI Foundations
A code-free primer on how generative AI got here, what is actually happening inside a Large Language Model, and the vocabulary you need before the rest of the course makes sense.
Learning Objectives
- Distinguish generative from discriminative AI and explain which problems each kind solves
- Walk the eight-decade evolution from rule-based systems to today’s multimodal agents and name the breakthrough at each step
- Explain what happens inside a Large Language Model when it produces a response — tokens, embeddings, attention, and probabilities — without writing any code
- Describe the three-stage training pipeline (pretraining, fine-tuning, alignment) and why each stage exists
- Articulate why scale — not new algorithms — was the unlock that made models like Claude possible, and what the limits of that unlock are
- Connect this foundation to the rest of the course: why we add tools, memory, and loops on top of an LLM to build an agent
Prerequisites: None. If you can read this paragraph, you can read this tutorial. | Level: Beginner
Why This Tutorial Exists
The rest of this course assumes you already know what an LLM is, why prompts work, and roughly what is going on when Claude “thinks.” Most learners pick that up by osmosis — from blog posts, demos, and Twitter threads. The result is a vocabulary that sounds confident but breaks down the moment something behaves unexpectedly: “Why did it make that up?” “Why is the same prompt cheaper today?” “Why does giving it more examples help?”
This tutorial fills that gap. It is deliberately the only file in the course with no code, no API calls, and no domain examples. The goal is to build a mental model — one that survives contact with a debugger. Once you have it, the rest of the course is about engineering on top of that model. You will know what you are configuring and why.
Engineers who skip this end up cargo-culting prompts: copying patterns that work without knowing why. They cannot diagnose a regression when a model upgrade changes behavior, they over-trust outputs they should verify, and they reach for fine-tuning when they should reach for retrieval. Forty-five minutes of foundations saves weeks of confused debugging downstream.
What Is Generative AI?
The single most useful distinction in modern AI is between discriminative models and generative models. Almost everything written about machine learning before 2020 was about the discriminative kind. Almost everything in this course is about the generative kind. The two solve different problems with different math, and confusing them is the source of half the misunderstandings beginners have.
Before this distinction: Imagine you are training two interns to work in an art gallery. The first intern’s job is to look at any painting and tell you whether it is a Van Gogh, a Monet, or a Picasso. The second intern’s job is to look at thousands of Van Goghs and then paint a brand-new picture in the Van Gogh style.
The pain: Both interns “know about” Van Gogh, and both spent months studying the same paintings. But their skills are not interchangeable. The first intern would freeze if you asked them to paint anything; the second would give you a vague guess if you asked them to authenticate a canvas. Treating them as the same role — “the art intern” — sets them up to fail.
The mapping: The first intern is a discriminative model: it learns to draw boundaries between categories and answer “which one?” questions. The second is a generative model: it learns the underlying patterns deeply enough to produce new examples that fit. Discriminative AI powers fraud detection, spam filters, medical image classifiers. Generative AI powers ChatGPT, Claude, image generators, and everything else this course builds on.
A discriminative modelA model trained to predict a label or category given an input. It learns the boundary between classes — for example, “is this email spam or not?” It does not learn how spam emails are written, only how to recognize one. learns the conditional probability of a label given an input: given this email, how likely is each label (spam / not-spam)? It is trained on input-label pairs and outputs a single answer per call. It cannot create anything new.
A generative modelA model trained to predict the next piece of data in a sequence (or to produce a whole new example). It learns the joint distribution of the data — what “normal” data looks like — well enough to sample new examples that fit. LLMs are the dominant example. learns the underlying distribution of the data itself: what does “text” (or “an image,” or “music”) actually look like? Once it knows that, you can ask it to produce new text by sampling from what it has learned. The output is not a single label but a fresh sequence that did not exist before.
Large Language Models are generative models specialized to text. The narrower term “LLM” just means: a generative model, large in parameter count, trained on language. Strip away every buzzword and that is the whole definition.
One Sentence That Captures Everything
If you remember nothing else from this section, remember this: an LLM is a function that, given some text, predicts what text comes next. Every other capability — answering questions, writing code, summarizing documents, holding a conversation — is built out of that one move, applied repeatedly. We will spend the rest of the tutorial unpacking why that simple operation is so unreasonably powerful.
The Journey of Generative AI
Most timelines you will see online start in 2017 with the transformer paper. That story is true but incomplete. Generative AI is really the convergence of two long lineages — one trying to teach machines to write, another trying to teach machines to see and draw — and the deep-learning revival that made both possible. Knowing both branches matters because they keep cross-pollinating: today’s text models borrowed ideas from image research, and today’s image models are increasingly built on transformer ideas from language.
The Long Setup (1950–2010): Foundations and Winters
The conceptual seeds were planted early. Alan Turing’s 1950 paper asked “Can machines think?” and proposed what became the Turing test. The 1956 Dartmouth conference coined the term “artificial intelligence.” The perceptronA 1958 algorithm by Frank Rosenblatt — the simplest possible neural network, just one layer. Could classify simple patterns but famously could not learn the XOR function. Its limitations triggered the first AI winter. arrived in 1958. Then came two long “AI wintersPeriods of reduced funding and interest in AI — the first roughly 1974–1980, the second roughly 1987–1993 — each triggered when the field over-promised and under-delivered. Neural networks specifically were considered a dead end for decades.” (1974–1980 and 1987–1993) when neural networks were dismissed as a dead end. Symbolic AI — rule-writing — dominated, with mixed success. The whole branch that would become generative AI was, for fifty years, a research backwater.
The Deep Learning Revival (2012)
Three things came together in the late 2000s: massive labeled datasets (ImageNet, 2009), cheap parallel compute (consumer GPUs), and refined training techniques. In 2012, a neural network called AlexNetA deep convolutional neural network by Krizhevsky, Sutskever, and Hinton (2012) that won the ImageNet image-classification competition by a wide margin. Its dominance ended the symbolic-AI era and kicked off the deep-learning revolution that everything since has built on. won the ImageNet competition by a margin so large it ended the debate. Deep learning was back, and it was the future. Every modern generative AI advance descends from this moment — not from any pre-2012 work.
Two Branches Are Born (2013–2014)
With deep learning suddenly viable, two foundational generative architectures appeared within twelve months of each other, both still influential today:
- VAEsVariational Autoencoders. A 2013 architecture (Kingma & Welling) that learns to compress data into a small latent code and decode it back. By sampling new latent codes you generate new examples. Smooth and stable to train but produces somewhat blurry outputs — eclipsed by GANs and diffusion for sharp images. (Variational Autoencoders, 2013): learn to compress data to a small “latent code” and decode it back; sample new codes to generate new examples.
- GANsGenerative Adversarial Networks. Ian Goodfellow’s 2014 idea: train two networks against each other — one generates fake images, the other tries to spot them. The competition makes both better. GANs produced the first photorealistic generated faces and dominated image generation until diffusion models took over around 2021. (Generative Adversarial Networks, 2014): Ian Goodfellow’s idea of pitting a “generator” against a “discriminator” in a game where each makes the other better. GANs gave us the first uncanny photorealistic faces.
From here, the two parallel tracks — vision and language — race forward in lockstep, each borrowing tricks from the other. The animation below traces both lineages and their convergence.
The Vision Track — From Faces to Photorealism
GANs dominated image generation from 2014 to 2020. StyleGAN (NVIDIA, 2018) produced the famous “these faces don’t exist” site that fooled almost everyone. Then OpenAI’s DALL-E (2021) and DALL-E 2 (2022) added text conditioning — you describe an image and it produces one. The same year, diffusion modelsA class of generative models that learn to reverse a gradual noising process — start with pure noise and iteratively denoise it into a meaningful image. More stable to train than GANs and producing higher quality. Behind Stable Diffusion, Midjourney, DALL-E 3, and most modern image and video generators. overtook GANs in quality. Stable Diffusion (open source, August 2022) and Midjourney brought professional-quality image generation to anyone with a browser. By 2024, the same diffusion approach extended to video (Sora, Veo, Runway).
The Language Track — From Embeddings to Conversations
The language track started later but accelerated faster. Word2Vec (2013) made meaning numeric. Seq2Seq models with LSTMs (2014–2016) cracked translation. The transformer (2017) shattered training-time barriers. GPT-3 (2020) was the first model big enough to follow instructions just from a description in plain English — no fine-tuning needed. ChatGPT (November 2022) wrapped it in a chat interface that anyone could use. Claude (Anthropic, 2023) entered with a safety-focused alignment approach called Constitutional AI. The next section walks the language track in more detail; this is the higher altitude view.
The Convergence (2023+)
By 2023 the two tracks merged. Multimodal models — GPT-4V, Claude 3, Gemini — can take both images and text as input. The same transformer architecture invented for language now powers most state-of-the-art image and video models too. And once these models could see, talk, and call tools, the “agent” era began — predictive engines wrapped in loops, sandboxes, and toolboxes that let them do things in the real world. That is where this course picks up.
Engineers who only know the language lineage misread half the field. Diffusion models, GANs, latent spaces, and CLIP-style embeddings keep showing up in tools and frameworks — including some Anthropic and OpenAI use internally for image features. Knowing the vision track exists, and roughly what each milestone unlocked, lets you read papers and product launches without getting blindsided. It also helps you predict what is coming: nearly every advance in one track eventually lands in the other.
Language Model Timeline — A Closer Look
Modern LLMs feel like they appeared overnight in late 2022. They did not. They are the seventh act in a long play, and each prior act ended because researchers ran into a wall the next breakthrough climbed. The animation below walks through the eras — click any dot, or press play to step through them in order.
Eight Acts, One Long Story
Every breakthrough on this line solved a wall the previous era hit. Walking it gives you context for why today’s models work the way they do.
Era 1 — Rule-Based NLP (1950s–1980s)
The first attempt at machine language was to write down the rules of grammar, the meanings of words, and the logic of conversation by hand. Programs like ELIZA (1966) faked therapy sessions with a few dozen pattern-matching rules. It was clever but brittle: any sentence outside the rules produced nonsense. The wall: human language has effectively infinite rules, and writing them all down is a project no team will ever finish.
Era 2 — Statistical NLP (1980s–2000s)
The next generation gave up on hand-written rules and instead counted things. N-gram modelsA model that predicts the next word from the previous N-1 words by counting how often each combination appeared in a training corpus. A trigram (N=3) predicts word 3 from words 1 and 2. Simple, fast, but knows nothing beyond raw counts. learned from text by tallying how often word B followed word A. The wall: counts of 3- or 4-word sequences cannot capture meaning. The model has no idea that “king” and “queen” are related, because they are just two unrelated entries in a giant lookup table.
Era 3 — Word Embeddings (2013)
Word2Vec, published by Google in 2013, was the first widely-used technique that gave each word a vectorA list of numbers (often 100 to 1000 of them) that represents a word as a point in high-dimensional space. Similar words land near each other; opposites land far apart. The numbers are learned from text, not assigned by hand. — a list of numbers — representing its meaning, learned from how it is used. Suddenly “king” minus “man” plus “woman” landed near “queen.” This was the first time a computer represented meaning rather than just symbols. The wall: each word still got a single fixed vector. “Bank” in “river bank” and “bank account” collapsed to the same vector.
Era 4 — Recurrent Networks: RNNs & LSTMs (2014–2016)
To handle context, researchers built networks that read text one word at a time and kept a running “memory” of what they had seen. RNNsRecurrent Neural Networks. A network that processes a sequence one element at a time and feeds its own output back as input for the next step, building up a hidden state that summarizes everything seen so far. and their improved cousin LSTMsLong Short-Term Memory networks. An RNN variant with internal “gates” that decide what to remember and what to forget. Solved the short-memory problem of plain RNNs, but still processed words strictly one at a time. powered the first decent neural translation and speech systems. The wall: they read word by word, in order, which made them slow to train and bad at remembering anything more than a few sentences back. You could not throw a whole book at them.
Era 5 — The Transformer (2017)
A Google paper titled “Attention Is All You Need” replaced the sequential reading of RNNs with something radically different: a mechanism called attentionA mechanism that lets every word in a sequence directly look at and weigh the importance of every other word, all at once. Replaces the slow word-by-word memory of RNNs with parallel comparisons that train fast on modern GPUs. that lets every word look at every other word in parallel. Training that used to take weeks dropped to days. The architecture — called the transformer — became the foundation of every major language model since. This was the unlock. Everything you call “an LLM” today is a transformer.
Era 6 — The GPT & BERT Era (2018–2022)
With transformers cheap to train, two ideas raced ahead. BERTBidirectional Encoder Representations from Transformers. A 2018 Google model trained to fill in masked-out words by looking both left and right. Powerful for understanding tasks like search ranking, but not designed to generate long text. (Google, 2018) read text bidirectionally and powered better search. GPTGenerative Pre-trained Transformer. The OpenAI line of models trained to predict the next word, scaling from 117 million parameters (GPT-1, 2018) to 175 billion (GPT-3, 2020) and beyond. The architecture behind ChatGPT. (OpenAI, 2018–2022) read text left-to-right and predicted the next word. GPT-3 in 2020 was the first model big enough to do useful tasks without retraining — you just described what you wanted in plain English. ChatGPT in November 2022 wrapped this in a chat interface and made the world notice. Claude entered the scene in 2023 from Anthropic, founded by former OpenAI researchers focused on safety.
Era 7 — Multimodal Models & Agents (2023–Today)
Once next-token prediction worked for text, the same recipe got applied to images, audio, and video — producing multimodalA model that handles more than one kind of data — for example, taking an image plus a question as input and producing a text answer. Modern Claude, GPT-4, and Gemini are all multimodal. models that take images as input and produce text. Then the loop closed: people gave LLMs the ability to call tools, browse the web, and run code, turning the prediction engine into something that does things. That is what the rest of this course is about — how to build those agent systems responsibly.
This timeline is not trivia. Every era’s wall still shapes how today’s models behave. The N-gram era is why models still “like” common phrasings (more counts of those in training). The single-vector-per-word era is why early embedding-based search struggles with ambiguous terms. The RNN era is why context windows used to be tiny. Knowing where each limitation came from tells you which improvements are easy and which are foundational.
How an LLM Actually Works
This is the section that, once it clicks, makes everything else in the course feel obvious. We will walk through what happens to the sentence “The cat sat on the” from the moment it enters the model to the moment a next word comes out. Four steps: tokenize, embed, attend, predict. That is the entire pipeline. Every fancy capability is built by repeating it.
Before this analogy: Most people imagine an LLM as a search engine that has memorized facts and looks them up. That picture is wrong in ways that mislead you constantly — it suggests the model knows things it does not, and it cannot explain why the same question can get two different answers.
The pain: A better picture is needed. Once you start thinking of the model as a search engine, you are surprised when it “hallucinates,” you misunderstand why temperature affects answers, and you do not know why it sometimes contradicts itself mid-paragraph. The mental model is doing the damage.
The mapping: Picture instead a wildly well-read jazz musician improvising. You hand them an opening phrase. They have absorbed millions of pieces — not memorized note-for-note, but soaked up the patterns. Each note they play is whichever sounds most plausible given everything they have heard before and the phrase you just gave them. They are not retrieving a stored answer. They are improvising the next note that fits, then the next, then the next. That is exactly what an LLM does — one word (well, one token) at a time.
Step 1 — Tokenization
The first thing the model does is chop your input into tokensThe atomic units an LLM operates on. A token is roughly 4 characters of English — sometimes a whole word, sometimes a piece of one. “Cat” is one token; “tokenization” is three. The model never sees raw letters, only token IDs. — small chunks that are roughly four characters of English each. “Cat” is one token, “tokenization” is three (“token,” “iz,” “ation”), a space is usually part of the token after it. Every token has a unique number ID, so “The cat sat” might become [464, 3797, 3332]. The model never sees letters; it works on these IDs.
This is why API pricing is per-token, not per-word. It is also why an unusual technical term may eat ten tokens while a common word is one. Module M02 covers tokens in depth.
Step 2 — Embedding
Each token ID is then looked up in a giant table to find its embeddingA vector (list of numbers) representing what a token “means” to the model. Similar tokens have similar vectors. The model learns these vectors during training; they are not assigned by hand. — a list of numbers (typically a few thousand long) that represents what that token means to the model. “Cat” and “dog” have similar vectors; “cat” and “democracy” have very different ones. These vectors were learned during training. They are the model’s notion of meaning.
Step 3 — Attention (the magic step)
Now comes the part that took 60 years to figure out. Each token’s vector is updated by looking at every other token in the input and weighting how much each one matters for understanding it. When the model processes the word “sat,” attention helps it notice that “cat” (the subject) matters a lot, “the” matters less, and a word twenty sentences back may matter again if the topic returns. This happens in parallel for every token, in many layers, with many different “attention heads” each picking up a different kind of relationship (grammar, topic, reference, etc.).
This is the operation that gives transformers their power. After attention, every token’s vector encodes not just “what this word means in isolation” but “what this word means in this specific context.”
Step 4 — Predict the Next Token
After many layers of attention and processing, the final vector for the last position is multiplied against the embedding table to produce a score for every possible next token in the model’s vocabulary (often 50,000 to 200,000 candidates). Those scores are turned into a probability distribution: “mat” might get 62%, “floor” 14%, “chair” 8%, and so on for thousands of options.
The model then samples from that distribution — usually picking the highest-probability token, sometimes (controlled by the temperatureA setting that controls how randomly the model picks from its probability distribution. Temperature 0 always picks the most likely token (deterministic). Higher values flatten the distribution and let lower-probability tokens get chosen, producing more variety. setting) picking a less likely one for variety. That picked token is appended to the input, and the entire process — tokenize, embed, attend, predict — runs again to produce the token after that. And again. And again. Until the model produces a special “stop” token or hits a length limit.
The Whole Show
That is it. That is what happens when you call Claude. Tokenize the input, embed each token, run attention many times to mix context in, predict the next token from a probability distribution, sample one, repeat. There is no database lookup. There is no reasoning engine sitting next to a knowledge base. The capability you experience — answering questions, writing essays, debugging code — is what falls out of doing this trillion-parameter prediction at scale, on text that includes nearly everything humans have written.
Most surprising LLM behaviors stop being surprising once you internalize this picture. Hallucinations? The model is sampling the most plausible-sounding next tokens, not retrieving facts — if a plausible-sounding falsehood scores higher than the truth, you get the falsehood. Different answers to the same prompt? Sampling at non-zero temperature is intentionally random. Better outputs from longer prompts? More context tokens give attention more to work with. The mental model is the diagnostic tool.
How LLMs Are Trained — The Three Stages
An LLM is not trained in one shot. The Claude (or GPT, or Gemini) you talk to is the product of three sequential training stages, each with a different purpose. Skipping any of them produces a model that behaves badly — one of the reasons cheap copies often disappoint.
Stage 1 — Pretraining (the expensive one)
The model is shown enormous amounts of text — books, websites, code repositories, reference works, often a meaningful fraction of the public internet — and trained on a single dumb task: given the previous tokens, predict the next one. Get it wrong, adjust the parameters slightly, repeat. Trillions of times.
This stage costs millions of dollars in compute and takes weeks on thousands of GPUs. It is what gives the model its raw knowledge — everything it “knows” about how language works, facts about the world, programming syntax, common reasoning patterns — all comes from this stage. It is also why models have a knowledge cutoffThe latest date of data the model was trained on. Anything that happened after that date is invisible to the model unless you give it that information in the prompt or via tools. A model with a January 2025 cutoff does not know about events in March 2025.: the training data only goes up to a particular date.
Stage 2 — Supervised Fine-Tuning (teaching it to follow instructions)
A pretrained model is impressive but useless. Ask it “What is the capital of France?” and it might continue your sentence with “is a question students often ask” instead of answering — because it learned to predict plausible continuations, not to answer questions. Fine-tuning fixes this. Human labelers write thousands of high-quality input-output pairs (“Q: What is the capital of France? A: Paris.”) and the model is trained on those examples specifically. It learns that when text looks like a question, the right next text is an answer.
Stage 3 — Alignment via RLHF (teaching it to be useful and safe)
The fine-tuned model now answers questions, but not always helpfully, honestly, or safely. The third stage — RLHFReinforcement Learning from Human Feedback. Humans rank the model’s outputs from best to worst on the same prompt; that ranking trains a separate “reward model” that scores responses; the LLM is then optimized to produce outputs the reward model rates highly. Anthropic also uses Constitutional AI, where the model critiques its own outputs against a written set of principles. (Reinforcement Learning from Human Feedback) — works by showing humans pairs of model outputs and asking which is better. Those preferences train a second model that scores responses, and the LLM is then nudged to produce responses that score well. The result is a model that is more helpful, refuses harmful requests, and matches a particular tone.
Anthropic uses a related approach called Constitutional AI, where the model is shown a written list of principles and trained to critique its own outputs against them. This is part of why Claude has its particular character — the principles it was aligned to are different from those used for other models.
People often say a model “learned” something during a conversation. It did not. Once training is done, the model’s parameters are frozen. Anything you tell it inside a chat lives only in the context window — the input it is currently processing — and is gone the next time you start a new conversation. This is why memory and retrieval (covered in M08, M09, M11) are entire topics: they are how you simulate “learning” without actually retraining the model.
Why Scale Changed Everything
Here is a fact that should feel strange: the architecture inside GPT-4 is not fundamentally different from the architecture inside GPT-2. Same kind of transformer, same training objective (predict the next token), broadly the same data sources. What changed was scale — more parameters, more data, more compute. And yet the capability gap between them is enormous. GPT-2 could write a passable paragraph; GPT-4 can write a passable lawyer brief. Models like Claude pushed this further with smarter training and alignment, but the underlying lesson is the same.
*GPT-4 and Claude parameter counts are estimates; companies have not officially disclosed.
Emergent Capabilities
The most surprising part of scaling is that some abilities show up suddenly, not gradually. A model with 10 billion parameters might be unable to do basic arithmetic at all; a model with 100 billion parameters can. The capability did not slowly improve — it appeared. Researchers call these emergent capabilitiesAbilities that are absent or near-zero in smaller models and rise sharply once a model crosses a certain size threshold. Examples include arithmetic, multi-step reasoning, and following instructions in unfamiliar formats. Whether they are truly “emergent” or just under-measured at small scales is debated, but the practical effect is real: scale unlocks behavior.. Their existence is what makes the field both exciting and unsettling: nobody fully predicted them, and nobody is certain what the next size jump will produce.
The Bitter Lesson
AI researcher Rich Sutton wrote an influential 2019 essay called The Bitter Lesson. Its claim: across 70 years of AI research, the methods that won were almost always the simplest ones that scaled with compute, not the cleverest ones encoding human insights. Hand-coded chess strategies lost to brute-force search. Linguist-designed translation systems lost to statistical models. Statistical models lost to neural networks. Today’s LLMs are the latest chapter: a remarkably simple objective (predict the next token), thrown at a remarkable amount of data and compute, beating decades of cleverer approaches. The lesson is bitter because it implies a lot of beautiful research work was, in the long run, the wrong path.
The Bitter Lesson is the reason the rest of this course exists. If scale alone produced capable agents, we could stop here. It does not — even the largest LLM still cannot reliably act in the world without help. But scale is what gave us a tool worth wrapping in tools, memory, and loops. The course teaches you to do that wrapping responsibly, given a foundation model whose raw power was bought with billions of dollars of GPU time you do not have to pay for again.
Limits & Common Misconceptions
Every capability has a flip side. Understanding what an LLM cannot do is more important than knowing what it can — because the rest of the course is about engineering around those limits.
The model has patterns, not facts. It produces tokens that look like the kind of text that would follow your input, based on what it saw during training. When it gets a fact right, it is because that fact appeared often enough in training to dominate the next-token distribution. When it gets a fact wrong (a hallucination), it is doing exactly the same operation with exactly the same confidence — the model has no internal “truthiness” signal. This is why retrieval (M09, M10) and tool use (M05, M06) exist: to ground the model in real, current facts at runtime.
It can do math that appeared in its training data. For arithmetic that is not a memorized pattern, results get unreliable fast. This is not an opinion or a temporary limit — it is a structural fact about a model whose only operation is “predict the most plausible next token.” The fix is to give the model a calculator (a tool, M05) and let it call it when it needs to compute, exactly the way a human reaches for one.
The model is producing tokens that resemble the text humans produce when reasoning. Sometimes this lands on a correct chain of inference; sometimes it produces fluent nonsense. There is no symbolic logic engine inside — only the same probabilistic next-token engine. Techniques like chain-of-thought prompting (M03) help by giving the model space to lay out plausible intermediate steps, which often leads to better answers, but it is still pattern continuation underneath.
Once trained, the parameters are frozen. Anything “learned” in a session lives only in the prompt the model is currently processing — the context windowThe maximum number of tokens (input + output) the model can consider at once. Modern Claude models have context windows of 200,000 tokens or more (about 150,000 words). Anything outside that window is invisible to the model.. The next conversation starts blank. Real persistence requires you to engineer it — storing past interactions and feeding them back as context. M08 and M11 are entirely about how to do that well.
For raw capability, scaling has been the dominant force. For production engineering, smaller specialized models often win on cost, latency, and predictability. Most production agents combine a large model for hard reasoning steps with smaller models for routine ones. M14 and M22 cover when and how.
From LLM to Assistant to Agent
An LLM by itself just produces text. A useful product wraps that prediction engine in three layers, each adding capability. The whole rest of the course teaches one or more of these layers.
Layer 1 — The Raw LLM
What you get if you call the API with no system prompt and no tools. Predicts text given text. Useful for completion, summarization, classification — anything that fits in “here is some input, please continue.” Stateless, factless, toolless.
Layer 2 — The Assistant (LLM + system prompt + memory)
Add a system prompt that gives the model a role, a tone, and rules. Add a way to remember the conversation so far. You now have ChatGPT-style assistant behavior. The model still cannot do anything outside its training, but it follows instructions, holds a thread, and adapts to your style. Modules M03 (prompts) and M08 (conversation management) are the core skills here.
Layer 3 — The Agent (Assistant + tools + a loop)
Now give the model the ability to call tools — functions you wrote that fetch data, search the web, run code, send email, query a database — and put the whole thing in a loop. The model decides which tool to call based on the user’s goal, looks at the result, decides what to call next, and continues until it has an answer or it gives up. This is an agent. It can act in the world. M05, M06, M07, M12, and beyond are about building this responsibly.
The reason every section of this course feels like it is “adding something” on top of the LLM is because that is literally the architecture. Tools, retrieval, memory, evaluation, guardrails, monitoring — each module is a layer wrapped around the same predict-the-next-token core you just learned about. Once you see that, you know where every piece fits.
You are ready for M00 (Course Overview & Agent Lifecycle). Everything above is enough foundation to make the rest land.
Glossary — The Vocabulary You Just Learned
| Term | Plain-English Definition |
|---|---|
| LLM | Large Language Model. A generative model trained on text whose only operation is “given previous tokens, predict the next one.” |
| Generative model | A model that produces new examples (text, images, audio) rather than picking a label from a fixed set. |
| Discriminative model | A model that picks among predefined categories (spam vs. not, cancer vs. not). Cannot generate new content. |
| Token | The atomic unit an LLM processes. Roughly 4 characters of English. “Cat” = 1 token; “tokenization” = 3. |
| Embedding | The numeric vector that represents a token’s meaning to the model. Similar tokens have similar vectors. |
| Attention | The mechanism that lets every token in the input look at every other token and weigh how much each matters. The transformer’s key innovation. |
| Transformer | The neural network architecture introduced in 2017 (“Attention Is All You Need”) that powers every modern LLM. |
| Context window | The maximum number of tokens (input + output combined) a model can consider at once. Modern Claude: 200K+. |
| Knowledge cutoff | The latest date in the model’s training data. Anything after that is invisible unless given via prompt or tools. |
| Pretraining | Stage 1 of training: predict-the-next-token over enormous amounts of text. Costs millions; gives raw knowledge. |
| Fine-tuning | Stage 2: train on curated input/output examples so the model follows instructions instead of just continuing text. |
| RLHF | Reinforcement Learning from Human Feedback. Stage 3: humans rank outputs, training the model to prefer helpful, honest, safe responses. |
| Constitutional AI | Anthropic’s alignment approach: train the model to critique its own outputs against a written list of principles. |
| Hallucination | When the model produces a confident-sounding falsehood. The model has no internal truth signal — it always samples plausible-sounding tokens. |
| Temperature | A setting (0 to ~2) controlling how randomly the model picks from its probability distribution. 0 = deterministic; higher = more variety. |
| Emergent capability | An ability that appears suddenly at a certain model size rather than gradually improving. Examples: arithmetic, multi-step reasoning. |
| Multimodal | A model that handles more than one kind of input (e.g., images + text). |
| Perceptron | The simplest neural network (1958). Single-layer; couldn’t learn XOR. Its limits triggered the first AI winter. |
| AI winter | A period of reduced funding/interest in AI after the field over-promised. Two major winters (1974–80, 1987–93). |
| AlexNet | 2012 deep convolutional network that won ImageNet by a huge margin. Kicked off the deep-learning era. |
| VAE | Variational Autoencoder (2013). Encodes data to a small latent code and decodes it back. Sample new codes → new examples. |
| GAN | Generative Adversarial Network (2014). Generator vs. critic in competition. Dominated image generation until diffusion took over. |
| Diffusion model | Generative approach that learns to reverse a noising process. Starts from noise, iteratively denoises into a meaningful image. Behind Stable Diffusion, DALL-E 3, Midjourney, Sora. |
| StyleGAN / DALL-E / Stable Diffusion | Milestone image generators — StyleGAN (2018, photoreal faces), DALL-E (2021, text→image), Stable Diffusion (2022, open-source). |
| Agent | An LLM given tools and a loop, so it can decide which tool to call next based on the situation. The subject of this course. |
Knowledge Check
Five questions. Pick the best answer; you will see why immediately.
Q1. What is the single operation an LLM performs at runtime?
Q2. Which 2017 breakthrough made today’s LLMs possible?
Q3. Why does an LLM “hallucinate”?
Q4. What does the “fine-tuning” stage of training accomplish that pretraining alone does not?
Q5. What separates an “agent” from a plain LLM, in this course’s usage?
Your Score
Tutorial Summary
Six Things to Carry Into the Course
- An LLM is one operation, run repeatedly: tokenize, embed, attend, predict, sample, repeat. Everything else is built on that.
- Generative ≠ discriminative: generative models produce new examples; discriminative models pick from a fixed set of labels. LLMs are generative.
- The transformer (2017) was the unlock: attention let every token compare to every other token in parallel, making large-scale training feasible.
- Three training stages: pretraining gives knowledge, fine-tuning gives instruction-following, alignment (RLHF / Constitutional AI) gives helpful and safe behavior.
- Scale unlocked emergent capabilities: some abilities appeared suddenly at certain model sizes — nobody fully predicted them.
- An agent is an LLM + tools + loop: the rest of the course teaches you to engineer that wrapping responsibly.
Where to Go Next
Continue to M00: Course Overview & Agent Lifecycle to see a working agent end-to-end and the four lifecycle stages (design, build, protect, observe, deploy) the course is organized around. Then walk the modules in order — M01 builds the LLM mental model further, M02 covers tokens in depth, and M03 starts the prompting craft.
| This Tutorial Covered… | Goes Deeper In… |
|---|---|
| Tokens & the predict-next-token loop | M01, M02 |
| How prompts shape behavior | M03, M03B |
| Adding tools (Layer 3) | M05, M06 |
| Adding memory beyond the context window | M08, M11 |
| Grounding the model in real facts (anti-hallucination) | M09, M10 |
| The agent loop & planning | M12, M13 |
| Patterns for combining LLMs | Bonus: Building Effective Agents |