Skip to content

12.1 — The Landscape, and How It Got Here

A spam filter, a chess engine, a photo tagger and a chatbot are all called "AI". Three of them work in completely different ways, and one of them is not learning anything at all.

The words are used loosely enough that they obscure what a system actually does, so start by nailing them down — because "should we use AI here" is a question you cannot answer until you know which of these you mean.

1. The nested sets

Artificial intelligence is the broadest term: any system doing something we would call intelligent. A chess engine searching a game tree with hand-written evaluation rules is AI, and it learns nothing — it is a search algorithm with a scoring function someone wrote.

Machine learning is the subset that learns from data instead of being told the rules. Nobody writes "if the email contains these words, it is spam"; you show the system a hundred thousand labelled emails and it derives the pattern.

Deep learning is machine learning using neural networks with many layers. The word "deep" refers to the number of layers and nothing else.

Generative AI is deep learning that produces new content — text, images, audio, code — rather than a label or a number.

Large language models are one family of generative models, trained on text, and are what most people mean when they say "AI" today.

AI ⊃ machine learning ⊃ deep learning ⊃ generative AI ⊃ LLMs

The distinction that matters practically: a rule you write is auditable, testable, and behaves identically forever. A learned model is a statistical artefact whose behaviour you can measure but not read. Choosing to learn something means accepting that trade, and a lot of production "AI" would be better as twenty lines of rules.

2. The history, and the two winters

1950 — Turing's Computing Machinery and Intelligence proposes the imitation game and sidesteps "can machines think" as unanswerable.

1956 — the Dartmouth workshop coins "artificial intelligence" and predicts substantial progress within a generation.

1958 — the perceptron. Frank Rosenblatt builds a physical device that learns to classify by adjusting weights. Press coverage is extravagant.

1969 — Minsky and Papert's Perceptrons shows a single-layer perceptron cannot learn the XOR function, because XOR is not linearly separable. The limitation is real and the conclusion drawn was too broad — multi-layer networks can learn it — but there was no practical way to train them yet.

The first AI winter, roughly 1974–1980. Funding collapses after a decade of unmet promises.

1980s — expert systems. Encode a specialist's rules and run inference over them. Genuinely useful in narrow domains, and they hit two walls: someone must write every rule, and the rules become unmaintainable as they interact.

1986 — backpropagation is popularised (Rumelhart, Hinton, Williams), making multi-layer networks trainable. It does not immediately change much, because the data and compute are not there.

The second winter, roughly 1987–1993, as expert systems fail to scale.

1990s–2000s — statistical machine learning. Support vector machines, random forests, boosting. This is when machine learning became genuinely useful in industry — spam filtering, credit scoring, recommendation — and it is still the right tool for a large share of problems (Chapter 12.3).

2012 — AlexNet. A deep convolutional network wins the ImageNet competition by a large margin, trained on GPUs. This is the moment the current era starts, and the three ingredients that made it possible are the ones that still explain everything since: large labelled datasets, parallel hardware, and workable training techniques.

2014–2016 — sequence-to-sequence models, attention as an addition to recurrent networks, generative adversarial networks, AlphaGo.

2017 — Attention Is All You Need introduces the Transformer, removing recurrence entirely. Its decisive property is that training parallelises across a sequence, which is what made scaling to enormous datasets economically possible. Chapter 12.5.1 builds it.

2018–2020 — BERT and the GPT series show that pre-training on unlabelled text and then adapting beats training a separate model per task. GPT-3 (2020) demonstrates that scale alone produces qualitatively new behaviour — learning a task from examples in the prompt, with no weight updates.

2022 — ChatGPT. The technical step was instruction tuning and reinforcement learning from human feedback, which made an existing capability usable by non-specialists. The interface was the breakthrough as much as the model.

2023–2026 — multimodal models handling text, images and audio in one system; much longer context windows; models trained to spend additional computation on reasoning before answering; open-weight models close enough to frontier systems to be a serious deployment option; and the industry's attention moving from training models to building reliable systems around them, which is what Chapter 12.6 is about.

The lesson from both winters is worth carrying: the failures followed periods of confident overpromising, and the recoveries came from a capability that actually worked. Being precise about what a system can and cannot do is not pessimism; it is what keeps a project funded.

3. How learning is set up

Supervised learning — labelled examples. Inputs paired with correct outputs; the model learns the mapping. Classification (spam or not) and regression (predicting a number). Most production machine learning is this, and the cost is labels.

Unsupervised learning — no labels. Find structure: clustering customers, reducing dimensions, detecting anomalies.

Self-supervised learning — labels derived from the data itself. Hide a word and predict it; the text is its own supervision. This is the unlock behind large language models, because it makes the entire internet a training set without anyone labelling it. It is the single most important idea in this list for understanding why the last decade happened.

Reinforcement learning — learn from reward. An agent acts, receives a reward signal, and adjusts. It powers game-playing systems and robotics, and — in a modified form — the alignment step that turns a raw language model into an assistant (Chapter 12.8).

4. The vocabulary, defined once

TermMeaning
ModelThe learned function: an architecture plus its parameters
Parameters / weightsThe numbers adjusted during training
FeaturesThe inputs
LabelsThe correct answers, in supervised learning
TrainingAdjusting weights to reduce error
InferenceUsing the trained model to produce an output
Loss functionHow wrong the model is on an example
GradientWhich direction to nudge each weight to reduce loss
EpochOne pass over the training data
OverfittingMemorising the training data; poor on new data
GeneralisationPerforming well on data never seen
HyperparameterA setting you choose, not learn — learning rate, layer count

Two of these carry most of the engineering consequences.

Training and inference are entirely different workloads. Training is a long, expensive batch job on many accelerators. Inference is a latency-sensitive service. They have different hardware, different scaling and different costs, and conflating them is why cost estimates go wrong.

Overfitting is the central failure of machine learning. A model that memorises its training set scores perfectly on it and is useless. Every technique in Chapter 12.4 that seems arbitrary — dropout, regularisation, early stopping, holding out a test set — exists to fight it.

5. When not to use machine learning

The most valuable judgement in this Part, and the one that saves the most money.

Use rules when the rules are known. Tax calculations, business logic, validation. A learned model that gets 99% of a deterministic rule right is worse than the rule, and it is far harder to debug.

Do not use it without data. Supervised learning needs labelled examples in the thousands, and getting them is usually the largest cost in a project. "We will collect data as we go" means no working system for a year.

Do not use it when the cost of being wrong is high and unexplainable. Where a decision must be justified — credit, medical, legal, employment — a slightly less accurate interpretable model is often the correct choice, and may be a legal requirement.

Do not use it when the pattern changes faster than you can retrain. A model trained on last year's behaviour is a description of last year.

Do use it when the rules exist but nobody can write them down — recognising a face, judging whether a review is positive, ranking search results, transcribing speech. That is the actual sweet spot: tasks humans do easily and cannot explain.

And a large language model changes this calculation in one specific way. For text tasks it removes the labelled-data requirement, because the model already knows the task. A classification job that used to need ten thousand labelled examples can now be a prompt. That makes prototyping trivially cheap and makes cost, latency and reliability the new constraints — which is why Chapter 12.6 is about engineering rather than modelling.

6. What an engineer actually does here

Very few people train models from scratch. The work in practice is:

Choosing. Which model, hosted or open weights, and what it costs at your volume.

Data. Getting it, cleaning it, checking it, and handling the privacy obligations from Chapter 8.7 that come with it.

Integration. Making a probabilistic component behave inside a system that expects determinism — timeouts, retries, fallbacks, structured output, cost control.

Evaluation. Deciding whether it works, in numbers, before and after every change.

Operation. Monitoring for drift, cost, latency and failure modes that do not look like exceptions.

Ninety percent of it is ordinary software engineering applied to a component that is non-deterministic, occasionally confidently wrong, and priced per use. That framing is what the rest of this Part builds on.

Recall

  • AI ⊃ machine learning ⊃ deep learning ⊃ generative AI ⊃ LLMs. A rule you write is auditable and permanent; a learned model is measurable but not readable. Choosing to learn something accepts that trade.
  • 1958 perceptron → 1969 XOR limitation → first winter → 1980s expert systems → second winter → 1990s statistical ML → 2012 AlexNet → 2017 Transformer → 2020 GPT-3 scale → 2022 ChatGPT. Both winters followed overpromising; both recoveries came from something that actually worked.
  • AlexNet's three ingredients still explain everything since: large datasets, parallel hardware, workable training techniques.
  • Self-supervised learning is the unlock behind LLMs — labels derived from the data itself, so the internet becomes a training set with no labelling.
  • The Transformer's decisive property was parallel training across a sequence, which made scale economically possible.
  • Training and inference are different workloads — a long batch job versus a latency-sensitive service — with different hardware and cost models.
  • Overfitting is the central failure. Dropout, regularisation, early stopping and a held-out test set all exist to fight it.
  • Do not use machine learning when rules are known, data is absent, decisions must be explainable, or the pattern changes faster than you retrain. Use it when the rules exist and nobody can write them down. An LLM removes the labelled-data requirement for text tasks, which moves the constraint to cost, latency and reliability.

Self-test: Which of the five nested terms does a chess engine belong to, and why? · What did Perceptrons prove, and what did people wrongly conclude? · Why is self-supervised learning the reason LLMs exist? · Name the failure that every regularisation technique fights · Give two situations where a rule beats a model · What changes about the build-or-not decision when the task is text?