Course syllabus
AI and Deep Learning: the course outline
What the course covers, what you should be able to do at the end of it, how it is taught, and what to read. The decks are on the slides page and the notebooks on the practicals page.
Course description
Deep learning covers the methods behind most current artificial intelligence: image recognition, speech, translation, and language models. The course builds them from the smallest piece upwards, and keeps the worked examples small enough to check by hand.
Day 1 constructs a neural network from a single unit and trains it, deriving rather than quoting the result that makes training possible. Day 2 asks what a network should assume about an image, and shows what convolution buys in data and in parameters. Day 3 turns to language, computes attention by hand, and separates a fluent answer from a supported one. Day 4 covers what changes when a system stops answering questions and starts taking actions that alter records.
Each method is presented with the failure it is known for, and each day states what its evidence does and does not establish.
Aims
- to give a working, mechanical understanding of neural networks rather than a vocabulary for talking about them;
- to show where the numbers come from, so that published claims about models can be read critically;
- to distinguish what a model computes from what a system does, and to place the controls at that boundary;
- to leave you able to ask of any reported AI result which population it describes, what it was compared against, and what it does not cover.
Learning outcomes
By the end of the course you can:
- reconstruct a small feedforward network from the input tensor to a parameter update, naming every object, its shape, and the operation that produced it;
- explain why nonlinear hidden layers are necessary, and why any stack of affine layers is never more than one affine layer;
- read training and held-out curves, and separate a lower training loss from credible evidence of generalisation;
- state which population a held-out number describes, and what would have to change for it to stop applying;
- explain what convolution assumes about an image, count the parameters of a small convolutional network from its shapes, and audit which part of an image a model actually used;
- describe what attention computes, what next-token training optimises, and why neither has any relation to truth;
- explain what retrieval fixes, what it does not, and when a system should abstain instead of answering;
- identify the point at which a system changes state rather than belief, and name the controls that belong there: tool contracts, least privilege, approval binding, and staged deployment.
Session overview
Feedforward Networks, Learning, and Evidence
This session builds a neural network from the smallest piece. Inputs, targets and tensors; one artificial unit, then a dense layer, with the weighted sum, the bias and the activation each doing a separate job; why depth without nonlinearity collapses to a single layer. A complete forward pass on a two-input, two-class network runs from the input vector to one scalar loss. Backpropagation follows, with the softmax cross-entropy gradient derived from two lines of calculus, and one gradient-descent update verified by recomputing the loss. The day closes on generalisation, on how the setting a model is used in can drift away from the one it was trained on, and on a real training run whose held-out loss turns upward.
Convolutional Networks and Computer Vision
What an image is to a model, and why a dense layer is the wrong prior for one. Filters, feature maps, stride, padding and pooling, with the output-size formula applied rather than quoted, and receptive fields traced through a stack. A small convolutional network is counted parameter by parameter against the dense alternative. Transfer learning follows, then the audit: the accuracy paradox, precision and recall from a real confusion matrix, saliency maps and their limits, shortcut learning, and the stress tests that are needed because a random split cannot catch a shortcut.
Transformers, Language Models, and Retrieval
Turning text into numbers: tokens, vocabulary, embeddings and position. Attention is worked by hand on a three-token example, then multi-head attention and the transformer block. We measure what next-token training actually optimises with cross-entropy and perplexity, and see what temperature does to the output. Retrieval-augmented generation closes the session: chunking, similarity ranking, the context budget, and the case where a stale passage outranks an irrelevant one, followed by citation, claim support and the decision to abstain.
Agents, Authority, and Deployment
The move from changing beliefs to changing state. Tools as contracts, structured calls, and what makes a call well-formed but still wrong. State, memory and idempotency. A full agent trajectory is followed step by step, including the well-formed request that the gate refuses. Authority comes next: least privilege, approval bound to an exact prepared action, and human confirmation that means something. Then the failure modes, compounding error, stale state, and instructions hidden inside retrieved content, and finally evaluation of trajectories rather than answers, with staged deployment.
Teaching and assessment
Each day is a lecture built around one continuous worked example, with the arithmetic done in front of you. No programming is assumed to follow the lectures; every number on the slides can be checked with a calculator. Each day also has a laboratory notebook, which does require Python, and which runs offline on a CPU.
Reading
Nothing here is required. Everything listed is freely available.
- Goodfellow, Bengio and Courville, Deep Learning (MIT Press, 2016), chapters 6 to 9 and 11. The standard reference; chapter 6 covers Day 1 and chapter 9 covers Day 2.
- Nielsen, Neural Networks and Deep Learning, chapters 1 to 3. The gentlest correct introduction to the material of Day 1.
- Rumelhart, Hinton and Williams (1986), ‘Learning representations by back-propagating errors’, Nature 323, 533–536. Four pages, and still the clearest statement of the idea.
- LeCun, Bottou, Bengio and Haffner (1998), ‘Gradient-based learning applied to document recognition’. Where convolutional networks were first set out in full.
- Vaswani et al. (2017), ‘Attention is all you need’. The transformer paper behind Day 3.
- Lewis et al. (2020), ‘Retrieval-augmented generation for knowledge-intensive NLP tasks’. The architecture Day 3 spends its second half on.
- Selvaraju et al. (2017), ‘Grad-CAM’, and Adebayo et al. (2018), ‘Sanity checks for saliency maps’. Read them in that order; the second is the reason Day 2 treats saliency as a diagnostic and not an explanation.
- Geirhos et al. (2020), ‘Shortcut learning in deep neural networks’. The failure mode that a random split cannot catch.
- Xiao, Rasul and Vollgraf (2017), Fashion-MNIST. The dataset used throughout Day 1.
- Parkhi et al. (2012), the Oxford-IIIT Pet dataset. The running case for Day 2.