What Machine Learning Is
IB Syllabus: A4.1.1 – Describe the types of machine learning and their applications (supervised, unsupervised, reinforcement, deep, and transfer learning). A4.1.2 – Describe the hardware requirements for machine learning (ASICs, FPGAs, GPUs, TPUs, cloud platforms, HPC centres). SL and HL.
Table of Contents
- Why This Page Exists
- Learning From Data: the Core Idea
- The Five Types of Machine Learning
- How a Model Actually Learns: the Perceptron (HL)
- The Hardware Machine Learning Runs On
- Where This Goes Next
- Quick Check
- Match the Type of Learning
- Practice Exercises
- Connections
Why This Page Exists
For most of computing’s history, to make a computer do something you wrote the rules: if this, then that, spelled out step by step. That works brilliantly when you can state the rules. It falls apart when you cannot. Nobody can write down the exact rules that separate a photo of a cat from a photo of a dog, or a spam email from a real one. The rules are real, but they are too subtle and too numerous to write by hand.
Machine learning is the answer to that problem. Instead of writing the rules, you show the computer thousands of examples and let it work out the rules for itself. That single shift, from programming the rules to learning the rules from data, is what this whole topic is about, and it is what makes everything from voice assistants to medical image screening possible.
Try it yourself: the machine learning simulators let you train real models in your browser and watch them learn. Every concept on these pages links to one. (They live on the companion app; a student login is needed.)
Learning From Data: the Core Idea
Traditional program: a human writes rules, the computer applies them. Machine learning turns this around: a human provides examples, and the computer produces the rules (in the form of a model) by finding the patterns in those examples.
A spam filter makes the difference concrete. The old way was to write rules by hand (“if the subject contains ‘free money’, mark as spam”), which spammers dodged in minutes. The machine learning way is to show a system a large collection of emails already marked “spam” or “not spam”, and let it learn the patterns that separate the two. When a new email arrives, the model predicts which it is. Nobody wrote the rule; the data taught it.
The Vocabulary You Need
These words appear on every page in this topic. Learn them precisely.
| Term | Meaning | In the spam example |
|---|---|---|
| Data / dataset | The examples the system learns from | The collection of past emails |
| Feature | One measurable input the model looks at | Words used, sender, number of links |
| Label | The correct answer attached to a training example | “spam” or “not spam” |
| Model | The thing that has learned the pattern and makes predictions | The trained spam filter |
| Training | The process of adjusting the model using the data | Learning from the marked emails |
| Prediction | The model’s output for a new, unseen input | “this new email is spam” |
The whole process is a loop: data with features (and sometimes labels) goes in, training produces a model, and the model makes predictions on new data. Keep that shape in mind and the rest of the topic hangs off it.
The Five Types of Machine Learning
The syllabus names five types. The first three describe how a system learns; the last two describe approaches that can be layered on top. Knowing the difference between them, and a real use for each, is the core of A4.1.1.
Supervised learning
The system learns from examples that are labelled with the correct answer. It sees many inputs paired with their right output, and learns to predict the output for new inputs. This splits into classification (predicting a category, such as spam or not-spam) and regression (predicting a number, such as a house price).
Application: diagnosing disease from medical scans labelled by doctors, filtering spam, predicting prices.
Unsupervised learning
The system learns from data with no labels. Nobody tells it the right answer; its job is to find structure on its own, most often by clustering similar items together or spotting things that do not fit.
Application: grouping customers into segments for marketing, detecting unusual bank transactions as possible fraud, discovering topics in a pile of documents.
Reinforcement learning
The system learns by trial and error, acting in an environment and receiving rewards or penalties. Over many attempts it learns a strategy that maximises its reward. No one shows it the right move; it discovers which moves pay off.
Application: game-playing agents that beat human champions, robots learning to walk, controlling systems like traffic lights or data-centre cooling.
Deep learning
Deep learning is a subset of machine learning, not a separate rival to it. It uses artificial neural networks with many layers, which lets it learn very complex patterns directly from raw data like images, sound, and text. It usually needs a lot of data and a lot of computing power.
Application: image and face recognition, speech-to-text, and the large language models behind modern generative AI.
Common confusion: deep learning is not “better machine learning” or a separate field. It is one family of techniques within machine learning, defined by its use of many-layered neural networks. A supervised task can be solved with deep learning or without it.
Transfer learning
Transfer learning reuses a model already trained on one task as the starting point for a related task, then adapts it with a smaller amount of new data. It is powerful because training from scratch is expensive; standing on the shoulders of an existing model saves enormous time and data.
Application: taking a huge image model trained on millions of general photos and adapting it, with only a few hundred examples, to recognise a specific crop disease.
Common confusion: transfer learning is not simply “copying a model and running it”. It is adapting an already-trained model to a new but related problem. The reuse of learned knowledge is the whole point; running an unchanged model is just using it.
How a Model Actually Learns: the Perceptron (HL)
HL Only. The single perceptron is HL content (A4.3.8), included here as a first look at how learning happens. Standard level students can skip to the hardware section.
It is fair to ask: when we say a model “learns”, what actually changes? The simplest answer is a perceptron, the smallest unit that learns, and a rough model of a single brain cell (neuron).
A perceptron takes some inputs, multiplies each by a weight, adds them up, and outputs a decision. Learning means adjusting those weights: every time it gets an example wrong, it nudges its weights so it is a little more likely to be right next time. Repeat that over many examples and the weights settle into a pattern that separates the classes. That nudging-toward-less-wrong is, at heart, what all model training does.
A single perceptron can only separate data with a straight line, so it cannot solve problems like XOR. Stacking perceptrons into layers (a multi-layer perceptron) removes that limit and is the foundation of deep learning, which the training and evaluating page builds on.
Try it yourself: the perceptron simulator trains a single neuron on logic gates. Watch its boundary line rotate as it learns, and watch it fail forever on XOR until a hidden layer is added.
The Hardware Machine Learning Runs On
Training and running models takes serious computation, and the choice of hardware is a real engineering decision (A4.1.2). The key idea is that most machine learning is a mountain of simple calculations done at once, so hardware that does many things in parallel wins.
| Hardware | What it is | Where it fits |
|---|---|---|
| CPU | The general-purpose processor in every computer | Fine for small models and everyday tasks; too slow for large training |
| GPU | A graphics processor with thousands of cores doing maths in parallel | The workhorse of ML training; great when many calculations run at once |
| TPU | A chip designed by Google specifically for neural-network maths | Very fast for large-scale training and serving of deep-learning models |
| ASIC | A chip built for one fixed task, extremely efficient but not reprogrammable | High-volume, unchanging workloads where efficiency matters most (a TPU is a kind of ASIC) |
| FPGA | A chip that can be reconfigured after manufacture | When you need custom hardware speed but must keep the flexibility to change it |
| Cloud platforms | Renting any of the above by the hour, over the internet | Getting powerful hardware without buying it; scaling up and down on demand |
| HPC centres | High-performance computing: many machines linked as a supercomputer | The largest models and research, where one machine is nowhere near enough |
A rough way to choose: a GPU for general training, a TPU or ASIC for large fixed workloads where efficiency pays off, an FPGA when you need speed but also the freedom to reconfigure, and cloud or HPC when you need more power than you own. The trade-off running through all of them is specialisation versus flexibility: the more a chip is built for one job, the faster and more efficient it is at that job, and the less it can do anything else.
Where This Goes Next
You now have the map: what machine learning is, the five types, and the hardware it runs on. The next two pages go deeper (mostly at HL):
- Types of Learning opens up the actual algorithms behind supervised, unsupervised, and reinforcement learning.
- Training and Evaluating a Model covers how models are built from data and how you judge whether one is any good.
And running alongside all of it: Ethics of Machine Learning, because every capability here comes with a responsibility question attached.
Quick Check
Q1. What most clearly distinguishes machine learning from traditional programming?
Q2. A system is trained on thousands of emails, each already marked "spam" or "not spam", so it can sort new ones. Which type of learning is this?
Q3. How does deep learning relate to machine learning?
Q4. A shop wants to group its customers into similar segments, but has no predefined categories and no labels. Which type of learning fits?
Q5. A team takes a large image model trained on millions of general photos and adapts it, using only a few hundred labelled examples, to spot a specific plant disease. This is:
Q6. Why are GPUs so widely used for training machine learning models?
Match the Type of Learning
Name the type of learning each scenario uses: supervised, unsupervised, or reinforcement.
Fill in the blanks.
// A model predicts house prices from past sales labelled with their price
// Type:
// A program finds natural groupings in unlabelled customer data
// Type:
// A game agent improves by trying moves and receiving points for winning
// Type:
// A model learns to read handwritten digits from thousands of labelled images
// Type: Practice Exercises
Note for IB CS learners: A4.1 is examined with the Describe command term. The exercises below practise that, plus application. At least one asks for a full prose response.
Core
-
Describe (6 marks) – Describe three of the five types of machine learning, giving one original real-world application of each.
-
Distinguish (4 marks) – Explain the difference between supervised and unsupervised learning, using the idea of labels.
-
Describe (4 marks) – Describe two pieces of hardware used for machine learning and explain what makes each suitable.
Extension
-
Explain (4 marks) – Explain why deep learning is described as a subset of machine learning rather than a separate field.
-
Apply (6 marks) – For each situation, state which type of learning fits and why: (a) detecting unusual credit-card transactions, (b) teaching a robot arm to stack blocks, (c) sorting photos into “contains a face” or “does not”.
Challenge
- Discuss (8 marks) – A start-up has a small amount of labelled data for a specialised image task and little money for hardware. Discuss how transfer learning and a sensible choice of hardware (including cloud) could make their project feasible. (Write in prose.)
Connections
- Next: Types of Learning – the algorithms behind each type (HL depth)
- Next: Training and Evaluating a Model – how models are built and judged (HL)
- Related: Ethics of Machine Learning – the responsibilities that come with these capabilities
- Related: Computational Thinking Concepts – abstraction and pattern recognition, the thinking underneath models