Lesson 01 of 13 · How models work
AI, machine learning and LLMs: the map
The words used about AI, and how they fit together: AI contains machine learning, which contains deep learning, which contains the generative models and LLMs everyone talks about. What a model actually is, and the difference between training a model and using it (inference).
Why the words matter
People use "AI" to mean anything from a spam filter to a chatbot that writes code. Before learning how these systems work, it helps to know the names of the parts, because each one behaves differently and has different risks.
How the terms nest
┌─ Artificial intelligence: computers doing "intelligent" tasks ─────────────┐
│ (includes old rule-based systems: "if temperature > 30 then fan on") │
│ ┌─ Machine learning: learns patterns from examples ─────────────────────┐ │
│ │ (spam filters, fraud scores, recommendations) │ │
│ │ ┌─ Deep learning: large neural networks with many layers ──────────┐ │ │
│ │ │ (image recognition, speech-to-text) │ │ │
│ │ │ ┌─ Generative AI: creates new content ────────────────────────┐ │ │ │
│ │ │ │ LLMs (text, code) · image models · audio and video models │ │ │ │
│ │ │ └─────────────────────────────────────────────────────────────┘ │ │ │
│ │ └──────────────────────────────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────────┘
- Rules versus learning. Traditional software follows rules a person wrote. Machine learning is given examples (emails marked spam or not spam) and works out the pattern itself.
- Neural networks are the most successful way to learn patterns. They are layers of simple calculations connected by numbers called weights or parameters. "Deep" just means many layers.
- Generative AI produces something new (a paragraph, an image) instead of a label ("spam") or a score ("fraud risk 0.92").
A rule-based program is a recipe: follow the steps exactly. Machine learning is like learning to recognise dogs: nobody gives you rules, you see thousands of dogs and your brain works out the pattern. Generative AI goes one step further: after seeing thousands of dogs, it can draw a new one.
What a model actually is
A model is two things: a large file of numbers (the parameters), and a program that feeds your input through those numbers to produce an output. A large language model has billions of parameters; the file can be tens or hundreds of gigabytes.
The numbers are not a database of facts. They are a compressed summary of patterns seen during training. That is why a model can write a sentence nobody wrote before, and also why it can confidently state something false (lesson 4).
Training versus inference
| Training | Inference | |
|---|---|---|
| What happens | Parameters are adjusted, example by example, to reduce mistakes | Input goes through the fixed parameters to produce an output |
| How often | Rarely: months for a large model, then occasional updates | Every request |
| Cost | Thousands of specialised chips (GPUs) for weeks | One request costs a fraction of a cent to a few cents |
| Changes the model? | Yes | No: your chat does not teach the model |
The last row surprises people. When you correct a chatbot, it "remembers" only within that conversation, because the conversation is sent back to it each time (lesson 3). The model itself is unchanged. Some products save notes about you separately and add them to future conversations; that is a product feature, not the model learning.
Foundation models and the products on top
A few companies and research groups train very large general-purpose foundation models. Most AI products do not train their own; they use one of these models and add instructions, data and tools around it.
Your product (support bot, coding assistant, search)
├── instructions and guard-rails ← lesson 3, 12
├── your documents, through search (RAG) ← lessons 5–7
├── tools it may call ← lessons 8–10
└── a foundation model (hosted or self-run) ← lesson 11
Understanding these layers is the whole point of this course: when an AI feature misbehaves, the cause is usually in one of the layers around the model, not in the model itself.
Recap
- AI ⊃ machine learning ⊃ deep learning ⊃ generative AI, which includes LLMs.
- A model is a file of learned numbers plus the program that runs them.
- Training changes the model and is rare and expensive; inference uses it and happens on every request.
- Most AI products are layers of instructions, data and tools around a foundation model.
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.