Transfer, multitask and meta-learning: reusing what a network knows
10 questions on transfer learning, pre-training, fine-tuning, multitask learning, meta-learning and few-shot learning, with explanations.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
A team has a few hundred labelled legal documents for a new classification task and starts from a network trained on a huge collection of general text. What do they usually retrain?
- Only the final layers, keeping the early layers as they are
- Every layer, from random weights
- Nothing, since the old network is always perfect
Sample 2
A company wants personalised next-word suggestions for each of thousands of phone users, but each user has typed only a few messages. How can multitask learning help?
- Train thousands of unrelated tiny networks
- Train one network on all users' data together, sharing early layers and giving each user separate later layers
- Ignore every user's preferences
How it works
- One question per screen. An answer is final once sent.
- You see right away whether you were right, with a short explanation.
- The stopwatch runs: on equal scores, the faster player ranks first.
- Only your best attempt counts, so replaying is never risky.
About this quiz
Collecting and labelling data is usually the most expensive part of a machine learning project. A hospital may have a few hundred labelled scans for a rare condition, a small company may have only a few thousand labelled support tickets, and a researcher may have a handful of examples of a new kind of object. Training a large network from scratch on such small data sets would fail. Yet such projects succeed every day, by borrowing knowledge from a related problem for which data is plentiful. This is transfer learning, and it is one of the most practical ideas in the whole of deep learning.
This quiz explains how it works and when it applies. You will see what has to be true of the two tasks for knowledge to carry over, why it is mainly the early layers of a network that transfer, and what is done with the later ones depending on how much data you have for the new task. You will learn the difference between using a pre-trained network as a fixed feature extractor and fine-tuning the whole thing, including the precaution that keeps fine-tuning from overfitting a small data set, and a computational trick that makes the first approach cheap.
The second part widens the picture to related ideas. Multitask learning trains one network on several tasks at once, sharing its early layers, and the quiz uses personalised word suggestions on thousands of phones as its illustration. Meta-learning goes one level higher and asks how a system can learn to learn, so that it copes with tasks it has never seen. Few-shot and one-shot learning are the practical results: recognising new categories from a handful of examples, or even a single one.
Frequent misunderstandings include thinking that any pre-trained network helps with any task, that fine-tuning should use the same large learning rate as training from scratch, and that sharing data between users or tasks always causes interference. The quiz shows when each of these is wrong. These ideas matter more and more as models grow, because it is usually cheaper to adapt a model that already exists than to train a new one, and because the data for any particular application are almost always scarcer than one would like. The three ideas share a common theme: what a model learns on one problem is an asset that can be reused on others, and good engineering consists in deciding how much of it to keep fixed and how much to adapt.
It suits students, engineers and managers who plan projects with limited data. It needs no mathematics. There are 10 questions, each explained after you answer, and the quiz takes about four minutes.
Questions and answers
›How long does the quiz take?
About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation appears after every answer.
›Do I need to have trained a network?
No. The scenarios use everyday examples such as photos, text messages and recognising new kinds of objects. If you understand that a network is trained on examples and that some patterns are common to many tasks, you can answer every question.
›What is transfer learning?
It is the use of what a network learned on one task to improve performance on another. The first task has plentiful data, the second has little. The network's internal representation, learned from the first, carries over, so the second task needs far fewer examples than it would from scratch. A caution is that transfer can also carry over unwanted properties: if the original data contained biases or gaps, the new model may inherit them, so the source of a pre-trained network deserves the same scrutiny as any other data.
›Which layers of a network transfer best?
The early ones. They tend to detect general, low-level features, such as edges and textures in images, which are useful for many tasks. Later layers are more specialised to the original problem.
›What is the difference between using a pre-trained network and fine-tuning it?
In the first case, the pre-trained network is kept fixed and used to turn inputs into a new representation, on which a small model is trained. In fine-tuning, the whole network is adjusted to the new data, usually with a very small learning rate and for a limited number of steps, so that it does not overfit the small data set. A sensible plan for a new project with little data is to start from a pre-trained network, retrain only the last layers first, and fine-tune more of the network only if the results justify the extra risk.
›Why is the fixed-network approach cheap?
The new training examples need to pass through the fixed network only once, to compute their new representations. After that, only the small final part of the network is trained, which is far quicker than updating a large network repeatedly.
›What is multitask learning?
It trains a single network on several related tasks at the same time, so that they share what they learn. It is particularly useful when each task on its own has little data.
›What are meta-learning and few-shot learning?
Meta-learning, or learning to learn, aims at a system that adapts quickly to tasks it has never seen, by learning the learning process itself as well as a shared representation. Few-shot learning is the ability to recognise new classes from just a few labelled examples, and one-shot learning needs only one.