Why depth helps: hierarchical, distributed and learned representations
10 questions on hierarchy and depth, compositional bias, distributed representations, embedding spaces, autoencoders and learning from unlabelled data.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
In a deep network for recognising objects in images, what do the earliest layers tend to detect?
- Whole objects
- Low-level features such as edges
- The class labels
Sample 2
A network analyses photographs of cars, and each car may or may not be red, have a roof rack and have tinted windows. How many units are enough to represent all eight combinations in a distributed way?
- Six
- Eight, one for each combination
- Three, one for each attribute, used independently
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
A network with a single hidden layer can in principle represent any function, so why does the field insist on stacking many layers? The answer has two parts. The first is a matter of efficiency: depth lets a network carve up its inputs into enormously many regions using far fewer units than a wide, shallow network would need. The second is more interesting, and it concerns what the layers learn. Early layers pick out simple features, later layers combine them into more abstract ones, and the final layer reads off the answer. A deep network is a machine for building up concepts from parts.
This quiz explores that picture. You will see how the idea of hierarchy fits the task of recognising objects in pictures, with edges combining into shapes and shapes into things, and why this compositional assumption is a form of inductive bias that suits many real-world problems. You will also see a second kind of compositionality, called a distributed representation, in which a layer's units are used in combinations instead of one by one, so that a modest number of units can describe an astonishing number of different situations. A small example with a few independent attributes of a car makes the counting concrete.
The third idea is representation learning: the observation that the values of a hidden layer are a new description of the input, tailored to make the task easy. The quiz asks where such an embedding space comes from, why the last layer of a classifier can be a simple linear one, and how the idea lets a network learn from unlabelled data. You will meet the autoencoder, which learns by reproducing its own input through a bottleneck, and its place in the early history of deep learning, and in modern pre-training.
Frequent misunderstandings include thinking that more units in one layer are always as good as more layers, that distributed codes waste units, and that learning from unlabelled data is merely a curiosity. The quiz explains why each of these views is wrong. Keeping these three ideas in mind makes much of the later material easier to follow, because image networks, language models and generative models all rely on hierarchies of features, on distributed codes and on learned representations that are reused for new tasks. Comparing a deep network to a shallow one of the same size is a good test of understanding: the deep one usually learns more abstract features and generalises better on structured data such as images, speech and text.
The quiz suits students and practitioners who want to understand what the layers of a deep network are for. It needs no mathematics. There are 10 questions, each with an explanation shown 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 know how deep networks are trained?
No. The quiz is about what the layers represent, not about the training procedure. A picture of data passing through successive layers, each of which transforms it, is enough to follow every question.
›What is a hierarchical representation?
It is a description of the input built up in stages, with each level made from the elements of the level below. In an image network, the early layers respond to simple local features, and the later ones respond to increasingly complex combinations of them. Depth is what allows such staged construction. The idea of hierarchy also explains why pre-trained networks are so widely reused: the lower levels of the hierarchy, such as edges and simple textures, are shared by almost all images, and only the upper levels are specific to a task. Looking at what a trained layer responds to, for example by finding the inputs that excite one unit most strongly, is a common way of checking that the hierarchy described here really emerges.
›Why does depth give a gain in the number of possibilities?
At each stage there are many ways to combine the components from the stage below. The number of distinct combinations multiplies from one stage to the next, so it grows exponentially with the number of stages, whereas making a layer wider adds possibilities much more slowly.
›What is a distributed representation?
It is a code in which a concept is represented by a pattern of activity across several units, and each unit takes part in many concepts. Independent attributes can then be combined freely. With a modest number of units, the number of distinct patterns that can be represented grows exponentially.
›What is representation learning?
It is the discovery by the network itself of a transformation of the data into a new space in which the task is easier. The output of a hidden layer is the representation, sometimes called an embedding, and any input can be transformed into it by passing it forward through the network.
›What is an autoencoder?
It is a network trained to reproduce its own input at its output, usually through a hidden layer that has fewer units than the input has values. The narrow layer forces it to learn a compressed description. It needs no labels, because every example is its own target.
›How was unsupervised learning used in early deep networks?
Each layer was first pre-trained without labels, and the whole network was then refined with labelled data. It was later found that this step could often be skipped. Pre-training on large amounts of unlabelled data remains central in other areas, notably in language models.