Neural Networks and AI Models
How a model works and how it is trained, from nothing
For a reader who knows some maths, some science and some programming, and nothing at all about machine learning. It starts with why some jobs cannot be written as rules, works one neuron out by hand, and builds up through layers, loss, gradient descent and backpropagation to the transformer, which nearly every model in use now is made of. It then explains each family in turn: pretraining and fine-tuning, diffusion and flow matching, models that see, language and vision-language models, learning from outcomes, the policies that move an arm, and world models. It ends with what it takes to run a model on a real robot and judge honestly whether it works.
- 01
What Learning From Data Means
This is the first page of a book about neural networks and the models built from them. Before any of that, it is worth being clear about what the ordinary way of programming a robot actually is, and when it works, because for…
- 02
Inside a Neural Network
This page lists videos made by other people that explain neural networks. It is for a reader who wants a second explanation beside this chapter, or who learns better from watching than from reading. Nothing in the chapter depends…
- 2.1Helpful resources2 min
- 2.2Neural networks and neurons11 min
- 2.3The grasp example7 min
- 2.4One neuron, worked out by hand12 min
- 2.5The smallest network9 min
- 2.6A network on a robot7 min
- 2.7One neuron of that network6 min
- 2.8Activation functions26 min
- 2.9Layers, depth and width24 min
- 2.10Layers, depth and width, worked out11 min
- 2.11The shape of the numbers37 min
- 2.12What a network can learn27 min
- 2.13Questions and answers9 min
- 03
How Training Works
The page before this one, what a network can learn, showed that a network with enough layers and enough weights can be shaped to fit almost any pattern. That page did not say how anybody finds the right values for those weights…
- 04
Making Training Work
The page before this one, the training loop, put the whole of training into a single loop. It showed the loss falling step after step until the curve became flat. Everybody watches that falling curve while a training run is…
- 05
Turning the World Into Numbers
The page before this one, Normalisation and stability, ended by saying that the numbers given to a network have to be scaled, so that training stays steady. That page assumed that the input was already a list of numbers. Every…
- 06
The Transformer
This page explains attention, which is the step that lets every word in a sentence take account of the other words. Attention is the central part of the transformer, and nearly every model later in this book is built out of…
- 07
Pretraining and Adapting
The page before this one, why the transformer won, ended with a machine that can read a very long piece of text and let every part of it look at every other part. That machine needs a very large amount of training data. It needs…
- 08
Models That Generate
The page before this one, making a model smaller and faster, finished a run of pages about getting a trained model ready to use. Every one of those pages assumed one thing without saying it. The assumption was that the model's…
- 09
Models That See
The page before this one, flow matching and other generators, finished the chapter about models that make something new. Those models start with a cloud of random numbers and move it along a learned direction, step by step, until…
- 10
Language and Multimodal Models
The page before this one, Depth and the third dimension, closed the chapter on models that see. It turned a flat picture into a shape with distance in it. This page opens a new chapter, and it changes the input from pictures to…
- 11
Learning From Outcomes
The page before this one, reasoning and tool use, ended a long run of pages about models that are trained by being shown the right answer. In every one of those methods, a person had to write the right answer down first. This…
- 12
Models That Act
The page before this one, rewards, preferences and verifiers, was about the hardest part of learning from outcomes, which is saying what a good outcome is. This page uses a different method. A person does the task properly a few…
- 13
Starting a Model of Your Own
The page before this one, world models, was the last page that opens one family of model and shows what it does inside. Together with every page before it, that page leaves you knowing what a neuron does, what a loss is, what a…
- 14
Using a Model For Real
The chapter before this one ended with a page on what to do when your model does not work, and the chapter before that finished the book's tour of the model families. Both leave you in the same place. You have a model that has…