Loading lesson...
Loading lesson...
In Modules 1 and 2, you learned what AI is and why data quality matters. This module answers the central question: how does a machine actually learn from data?
Working out what shape a protein folds into has stood as a grand challenge in biology for the past 50 years. The field judges progress in an unusual way. The Critical Assessment of protein Structure Prediction posts the sequences of proteins whose experimental structures are not yet public, teams submit their models, and independent assessors compare those models with experiment. The targets are chosen from structures that have only very recently been determined in a laboratory, and they are not published in advance.
In November 2020 the fourteenth round of that assessment reported its results, and AlphaFold 2 from DeepMind won it. The system reached a median score of 92.4 GDT across all targets, on a scale where a score of around 90 is informally treated as competitive with what experiments produce. The peer-reviewed paper that followed put the same finding in laboratory units: a median backbone accuracy of 0.96 angstroms, against 2.8 angstroms for the next best performing method.
What the system had to work from was finite and publicly available. It was trained on around 170,000 protein structures from the Protein Data Bank, together with large databases of protein sequences whose structures nobody had solved. Every one of those entries was somebody else's finished laboratory work. None of them was the target the assessors had chosen, and none of them contained the answer the system was asked to produce.
How does a machine turn 170,000 worked examples into a correct answer about a protein that none of them describes?
AlphaFold learned from examples: here is an amino acid sequence, and here is the 3D structure it folds into. Given enough examples, it discovered patterns that generalised to proteins it had never seen. That process, learning from examples to make predictions on new data, is the core of supervised . This module explains how it works.
If you are already familiar with learning paradigms and loss functions, use the knowledge checks to confirm your understanding and skip to Module 4: Neural networks from scratch.
: learning from labelled examples moves the lesson from vocabulary to evidence.
Supervised learning is the most common paradigm in production AI. The "supervised" refers to the fact that the includes both inputs and correct answers (labels). The model's job is to learn a function that maps inputs to outputs accurately enough to work on new, unseen data.
Two main categories:
AlphaFold is a supervised learning system: given an input (amino acid sequence) and labelled examples (known 3D structures), it learned to predict new structures. Most commercial AI applications (recommendation systems, fraud detection, medical imaging, language translation) are supervised learning.
“A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.”
Tom Mitchell - Machine Learning (1997), Chapter 1, Definition 1.1
This is the standard formal definition of machine learning. In supervised learning: E is the labelled training data, T is the prediction task (classification or regression), and P is the accuracy or error metric. A system 'learns' if its performance improves as it sees more training data.
Supervised learning: learning from labelled examples sets the boundary. Unsupervised learning: finding structure without labels examines what changes when the system meets real use.
Unsupervised learning works with data that has no labels. The model's task is to discover structure, patterns, or groupings in the data on its own.
Unsupervised learning is harder to evaluate than supervised learning because there are no "correct answers" to compare against. Success depends on whether the discovered patterns are useful for the downstream task.
Reinforcement learning: learning from rewards and penalties turns the previous idea into a check that can be reviewed.
Reinforcement learning (RL) is different from both supervised and unsupervised learning. An RL agent interacts with an environment, takes actions, and receives rewards or penalties. The goal is to learn a policy (a strategy for choosing actions) that maximises cumulative reward over time.
Key concepts:
DeepMind's AlphaGo used reinforcement learning to defeat top-ranked players at Go. The system was first described in the Nature paper of 28 January 2016 covering the October 2015 match against European champion Fan Hui; the higher-profile five-game match against world champion Lee Sedol followed on 9 to 15 March 2016, with AlphaGo winning four games to one. The system learned by playing millions of games against itself, receiving a reward of +1 for winning and -1 for losing. RLHF (Reinforcement Learning from Human Feedback) is used to align large language models with human preferences. We cover RL in depth in the Practice & Strategy stage (Module 21).
The three modes covered so far map cleanly onto the shape of the data available at training time. The diagram below makes that mapping explicit: a pivot question on training feedback branches into the three modes, with the required inputs and what each mode learns shown on a single line per lane.
Each lane states what it requires before it states what it learns, and the three connectors read labels exist, no labels and reward signal, so the mode is settled by the data already in hand and not by the algorithm chosen afterwards.
The learning mode is determined by the feedback available at training time, not by algorithm preference. Labels point to supervised, no labels point to unsupervised, and a delayed reward signal points to reinforcement learning.
Reinforcement learning: learning from rewards and penalties gives the mechanism. Loss functions: how models measure their own mistakes shows where the next decision has to be made.
Common misconception
“Machine learning models understand the data they process”
ML models find mathematical patterns that correlate inputs with outputs. A model that classifies cats in images responds to pixel patterns (edges, textures, shapes) that statistically correlate with the label 'cat.' It has no concept of what a cat is. Models can learn spurious correlations: nothing in training separates the patterns that belong to the subject from the ones that merely accompany it, so a background feature present in most images of a class can carry as much of the decision as the subject itself, and the model will still look accurate on a test set where that feature is just as common. Always test models with adversarial examples and out-of-distribution data, where the incidental pattern no longer holds.
Common misconception
“You need a PhD in mathematics to understand machine learning”
The core concepts (learning from examples, minimising error, splitting data) are accessible to anyone with basic numeracy. The mathematical notation can be intimidating, but the underlying ideas are often simple. Linear regression, the foundation of many ML techniques, is finding the best-fit line through a scatter plot, something taught in secondary school mathematics. Focus on the intuition first; the formal notation becomes clearer once the concepts are solid.
A loss function (also called a cost function or objective function) measures how wrong the model's predictions are. The model's goal during training is to adjust its internal parameters to make the loss as small as possible.
For regression, a common loss is mean squared error (MSE): for each prediction, calculate the difference between predicted and actual, square it (to penalise large errors more than small ones), and average across all examples.
For classification, a common loss is cross-entropy loss: it measures how far the model's predicted probability distribution is from the true distribution (where the correct class has probability 1 and all others have probability 0).
The choice of loss function shapes what the model optimises for. A model trained with MSE treats all prediction errors equally in proportion to their magnitude. A model trained with a custom loss that heavily penalises false negatives (missing a cancer diagnosis) will behave differently from one that penalises false positives (unnecessary biopsies) equally. The loss function encodes your priorities.
Training, validation, and test sets is the next test of whether the concept works outside a toy example.
The most important concept in machine learning evaluation is that you must test your model on data it has never seen during training. Without this separation, you cannot know whether the model has learned generalisable patterns or has simply memorised the training examples (a problem called ).
occurs when information from the test set inadvertently influences training. Common causes include normalising the entire dataset before splitting (the mean and standard deviation include ) or using features derived from the target variable. Data leakage produces misleadingly optimistic evaluation results.
What the validation set buys you is a reading you cannot get from the training loss. The figure below sets the three readings side by side. Two of them look identical if you watch only the training curve, and the difference between them decides whether you keep training, change the model, or stop and open the test set.
The training curve reads the same in the middle lane and the right one, and only the validation curve separates them, so a run judged on training loss alone can be shipped at the exact point it started memorising.
Training loss alone cannot tell a model that is learning from one that is memorising. The pair of curves gives the reading, and the reading gives the next move.
“Overfitting is the central problem of machine learning.”
Pedro Domingos - The Master Algorithm (2015), Chapter 3
Domingos's claim is deliberately strong. Overfitting, when a model memorises training data rather than learning generalisable patterns, is the failure mode that every ML practitioner must guard against. The train/validation/test split, regularisation, and cross-validation are all defences against overfitting.
A retail company wants to group its customers into segments based on purchasing behaviour. No predefined categories exist. Which learning paradigm is most appropriate?
During training, a model's training loss continues to decrease but its validation loss starts increasing after epoch 8. What is happening and what should you do?
A data scientist normalises the entire dataset (calculating mean and standard deviation from all data) before splitting into train/test sets. Why is this problematic?
Results (CASP14 performance), Methods (Evoformer architecture)
The primary scientific publication describing AlphaFold 2. Reports the GDT score of 92.4 at CASP14 and explains the attention-based architecture. Used as the opening case study to illustrate supervised learning at scale.
Tom Mitchell, Machine Learning (1997)
Chapter 1, Definition 1.1; Chapter 2 (Concept Learning)
The foundational ML textbook definition. Mitchell's three-part formulation (task T, performance P, experience E) remains the standard way to formally define learning. Cited in Section 3.1.
Pedro Domingos, The Master Algorithm (2015)
Chapter 3 (Overfitting and the bias-variance tradeoff)
Accessible treatment of overfitting as the central challenge in ML. Used in Section 3.5 to frame why train/validation/test splits matter. Domingos presents overfitting as the problem every ML method must solve.
Methods (Monte Carlo tree search + neural networks)
Primary reference for AlphaGo. Demonstrates reinforcement learning combined with deep neural networks to master Go, a game with more possible positions than atoms in the universe. Used in Section 3.3.
Chapter 1 (The Machine Learning Landscape), Chapter 2 (End-to-End ML Project)
The most widely used practical ML textbook. Chapters 1-2 provide the clearest accessible explanation of learning paradigms, loss functions, and train/test splits. Recommended as supplementary reading for this module.
You now understand the three learning paradigms, how loss functions guide learning, and why data splitting prevents overfitting. The next question is: what happens inside the model during training? Module 4 takes you inside a neural network, tracing how individual neurons compute, how layers combine, and how adjusts weights to reduce error.
Module 3 of 33 · AI Foundations