A camera measures tens of thousands of numbers and the decision needs two or three. What happens at the squeeze between them, and why that narrow point sets the ceiling on everything downstream.
Stand in a doorway and look into a room. Your eyes are taking in something like a hundred million measurements a second. Now decide whether to walk forward. For that decision you need almost none of them.
How far away is the far wall? Is there a way through, and roughly where? That is two or three numbers, and everything else your eyes collected was, for this decision, decoration.
the room those two numbers decode to
the space itself. drag anywhere in it
- How far the wall is
- 0.45
- Where the way through is
- 0.62
Numbers in the picture
74,800
Numbers in the description
2
Those two or three numbers have a name. They are the latent (latent means hidden, or not directly visible. The numbers are never shown to you and nothing labels them, but the picture is what it is because of them) description of the scene. You will meet the phrase "latent space" in nearly every paper from here on.
Somewhere between the camera and the decision there has to be a squeeze, and whatever comes out the other side is all the rest of the system ever gets. That is the case for latents, and the same fact is the case against them.
The squeeze
The architecture is a narrow opening in the middle of a system. One half turns the picture into a short list of numbers. The other half takes the list and tries to rebuild the picture. Train the pair together and there is only one way to succeed: the short list has to carry what the picture was made of.
- how far the wall is
- where the way through is
- which way the camera is tipped
- gravel on the floor
- sensor noise
- how bright it is
Could you decide what to do?
Yes. Two numbers is the whole decision.
What the extra width bought
Nothing wasted yet. Everything through the squeeze changes what you would do.
The figure is rigged: the two factors the decision turns on sit in its first two slots. A learned system gets no such ordering for free.
Geoffrey Hinton and Ruslan Salakhutdinov made the case for the squeeze in 2006, in Reducing the Dimensionality of Data with Neural Networks. Hinton taught in Toronto and had stuck with neural nets through the lean years, when most of the field had moved on. Salakhutdinov was his student. They put the paper in Science rather than a machine learning journal, which tells you who they wanted to win over.
Everything since has been that argument with better kit. But a bottleneck creates pressure without naming the answer. Many equally short lists of numbers can rebuild the same pictures, and nothing makes one number mean distance and another mean lighting. You need a bias for that, in the architecture, the data or the task.
Irina Higgins and colleagues at DeepMind, Google's London lab, made the case for such a bias in 2016. The paper was Early Visual Concept Learning with Unsupervised Deep Learning. A good representation, they argued, is one whose directions each mean one thing: turn one number and only the lighting changes.
The room, redrawn from the two numbers
Drag the point, or use the arrow keys
What axis 1 changes
depth and brightness
Sharpness
sharp
Turn one number and two things change. Neither axis has a name yet.
Their beta-VAE a year later was an autoencoder of this shape with one dial added. The dial (the beta in the name) turns the pressure on the bottleneck up, and past one the axes start lining up with nameable things, the turn of a face or the size of a shape. The same paper shows the cost, which you just saw: press harder and the pictures go blurry.
By 2018 the squeeze was inside a working agent. David Ha and Jürgen Schmidhuber published World Models that year, an agent that learned a driving game through a model of it. Every frame was crushed to thirty-two numbers, and the parts that predicted and chose never saw a pixel.
The same year Danijar Hafner and colleagues built PlaNet, with Ha among the authors. The paper was Learning Latent Dynamics for Planning from Pixels. It squeezed raw pixels the same way, then planned inside what came out, and never rebuilt a frame to decide anything. At decision time the short list was all it had, the bolder of the two designs.
the frame
the thirty two numbers
0 of 32
steering
the numbers are illustrative
This is the frame as it was recorded. Pick a change and watch the thirty two numbers.
Change
none
Numbers that moved
0 of 32
Steering
0.0 unchanged
Then in 2019 Francesco Locatello and colleagues closed the question Higgins had opened. Pulling the hidden factors apart, one per axis, is called disentanglement. With no labels and no built-in bias, they proved, it cannot be done. For any squeeze whose axes mean something, another draws the same pictures just as well with axes that mean nothing.
They then trained thousands of models, and which axes you got came down mostly to the random seed. The paper was Challenging Common Assumptions in the Unsupervised Learning of Disentangled Representations. It took the best paper award at the ICML conference that year. A lot of latent-space writing has not caught up with it.
the rooms as points, and this seed's axes
seed 1
the nine rooms, decoded
Press Retrain. Watch the rooms on the right and the arrows on the left.
Redraw of the nine rooms
identical every time
What axis 1 means
how far the wall is
Look at who was unaffected. Ha and Schmidhuber's agent never needed its thirty-two numbers to mean anything a person could name, and neither did PlaNet's planner. The squeeze carried on, because the agents built on it had only ever asked that it keep what the next step turns on.
A place, not a list
Those numbers are coordinates. In a latent space that training has shaped well, they name a point with useful neighbours, directions and distances. Nothing guarantees that; a plain autoencoder can learn a twisted lookup table instead.
Once it has been shaped, you can do things there that make no sense in pixels. You can ask what is nearby, move in one direction and watch the world change smoothly in one way, or take two rooms and stand between them. That last one is the figure below.
one room
average the two pictures
another room
average the two numbers, then decode
Is the blended picture a room?
No. It is two rooms at once, which is not a thing you could walk into.
Is the decoded one a room?
Yes, everywhere along the slider. Every point in that space decodes to one.
Halfway between two pictures is a ghost, and halfway between two descriptions is a room. That matters because prediction, planning and search all move somewhere you have not been, and if every step lands on nonsense none of them work.
What makes one good
Being small is not the goal in itself. A single number is very small and useless. What you want is that the things which matter are easy to get at, and the things that do not are gone. Yoshua Bengio, Aaron Courville and Pascal Vincent set that down in 2013, in a survey called Representation Learning: A Review and New Perspectives.
The three were colleagues in Montreal. Bengio had kept a neural network lab going through the same lean years as Hinton, and would later share the Turing Award with Hinton and Yann LeCun. The survey is still the best single statement of what a learned representation is for. So let's take three tests from it, in rough order of how often they fail.
Does it keep what the future turns on? Take two situations that lead to different outcomes and land on the same point: nothing downstream can tell them apart. This is the failure that shows least, because the reconstructions can look fine while it happens. Ha and Schmidhuber's thirty-two numbers were trained only to redraw frames, and the authors flagged the risk themselves.
where it lands
·
Which way will the ball go?
press a corridor first
Where the two land
press both to see
Press A, then B, and watch the square.
Do nearby points mean nearby things? A space where a small step can land anywhere is just a lookup table. Smoothness lets you move through it on purpose, and it is what the VAE's noise was built for. As you saw in Figure 4.6, it is also what lets you stand between two rooms.
Is it easy to predict forward? A description can be perfectly faithful and still be a nightmare to run forward in time. The reason anyone compressed was to get something they could roll forward cheaply.
What the squeeze costs
Rebuilding the picture is a proxy, and proxies drift. The test asks whether the short list can redraw what the camera saw. What you wanted to know is whether it kept what the decision turns on.
The things that take up the most pixels are usually not the things that matter. A description scored on rebuilding pixels spends itself on texture and weather, and loses the small fast object you needed to avoid. Figure 4.2 was rigged to hide this, so let's take the rigging off.
- the wall
- the sky
- the light
- the gravel
- the cyclist
Nothing came through.
Redraw score
The cyclist
gone
Figure 4.2 kept the decision's two factors first. A redraw score keeps the biggest first.
The second cost is subtler, and I think more serious. Anything the squeeze drops is gone for good from that point on. Everything after the bottleneck works from the short list and nothing else.
That choice is made early, by a part of the system that has no idea what task is coming, and it sets the ceiling on everything after it.
That is why the argument since has been about the middle of the pipe. PlaNet trained the squeeze together with the forward model, and LeCun's JEPA line (chapter 7) asks whether to rebuild pixels at all.
Hopefully this chapter helped. There is a short quiz below if you want to check the ideas stuck. If I have got something wrong, or you know a better source than the ones I used, the About page has a corrections section and I would be glad to hear from you.
Try it
A camera hands you tens of thousands of numbers per frame. Deciding whether to walk forward needs two or three. What is the bottleneck for?
Pick one
1A camera hands you tens of thousands of numbers per frame. Deciding whether to walk forward needs two or three. What is the bottleneck for?
- a. Making the model smaller so it runs faster
- b. Forcing everything through a narrow opening, so what survives is what the pictures were actually made of
- c. Removing noise from the camera
- d. Compressing the file on disk
Answer b. Forcing everything through a narrow opening, so what survives is what the pictures were actually made of. Speed and file size are side effects. The reason to squeeze is that succeeding at the squeeze requires recovering the things that generated the picture in the first place.
2Nobody hand-picks what the short list should contain. Why does it end up holding the right things anyway?
- a. The architecture has one unit per concept
- b. If the pictures were generated by a few things changing, recovering those things is the cheapest way to rebuild them
- c. The training labels say so
- d. The decoder is told the answer
Answer b. If the pictures were generated by a few things changing, recovering those things is the cheapest way to rebuild them. The ordering falls out of the pressure rather than being designed. That is the appeal, and also why the ordering is only roughly the one you wanted.
3Average two pictures of two different rooms. What do you get?
- a. A room halfway between them
- b. Both rooms at once, faintly, which is not a room
- c. The first room
- d. An empty picture
Answer b. Both rooms at once, faintly, which is not a room. This is what pixel-space blending does. It is the clearest reason to want a space where the point between two valid things is itself valid.
4Average the two short descriptions instead, then decode. What do you get?
- a. The same ghost
- b. A room, because every point in that space decodes to one
- c. Nothing, the numbers do not add
- d. A picture of both rooms side by side
Answer b. A room, because every point in that space decodes to one. Prediction, planning and search all involve moving somewhere you have not been. That only works if the places in between mean something.
5Why is the noise in a variational autoencoder not just a nuisance?
- a. It makes training faster
- b. It hides the training data
- c. Blurring where each picture lands forces neighbouring points to decode to similar things
- d. It reduces the number of parameters
Answer c. Blurring where each picture lands forces neighbouring points to decode to similar things. Smoothness is the property that makes the space navigable. Without it you have a lookup table with extra steps.
6Which of these is NOT what makes a compact description a good one?
- a. It keeps what the future turns on
- b. Nearby points mean nearby things
- c. It is as small as possible
- d. It is easy to step forward in time
Answer c. It is as small as possible. A single number is very small and useless. Small is a consequence of keeping the right things, never the goal on its own.
7A description is scored on how well it can rebuild the camera image. What can go wrong?
- a. Nothing, that is exactly the right test
- b. It spends itself on whatever occupies the most pixels, which is usually not what the decision turns on
- c. It becomes too small to be useful
- d. It stops being differentiable
Answer b. It spends itself on whatever occupies the most pixels, which is usually not what the decision turns on. Reconstruction is a proxy. Texture and weather are most of the pixels; the small fast object you needed to avoid is not.
8Why is the width of the bottleneck an uncomfortable place to put an important decision?
- a. It is hard to tune
- b. Everything after it works only from the short list, so whatever was dropped is gone, and it was dropped before anyone knew the task
- c. It uses too much memory
- d. It has to be chosen before training
Answer b. Everything after it works only from the short list, so whatever was dropped is gone, and it was dropped before anyone knew the task. The loss is not recoverable downstream. A part of the system with no idea what is coming sets the ceiling on everything after it.
Everything here has happened one moment at a time. A picture goes in, a short description comes out, and nothing has moved yet.
Sources
- Challenging Common Assumptions in the Unsupervised Learning of Disentangled RepresentationsLocatello et al., 2019The result that prevents a bottleneck from being magic: without inductive biases, unsupervised disentanglement is impossible in general and the axes are not identifiable.
- Auto-Encoding Variational BayesKingma & Welling, 2013The variational autoencoder. The noise it adds is the reason the space ends up navigable instead of a scatter of unrelated addresses.
- Reducing the Dimensionality of Data with Neural NetworksHinton & Salakhutdinov, 2006The bottleneck argument before it had modern machinery behind it. Paywalled.
- World ModelsHa & Schmidhuber, 2018Every frame crushed to thirty-two numbers, and everything after that working only from those. The clearest example of the squeeze in a working agent.
- Learning Latent Dynamics for Planning from Pixels (PlaNet)Hafner et al., 2018Encodes pixels to a compact state and then plans in it, without ever rebuilding a frame in order to decide anything.
- Neural Discrete Representation Learning (VQ-VAE)van den Oord et al., 2017What happens when the short list is forced to be a handful of discrete symbols rather than continuous numbers.
- beta-VAEHiggins et al., 2017Turn the pressure on the bottleneck up and the axes start to line up with things you can name. Also a good demonstration of what that costs.
- Early Visual Concept Learning with Unsupervised Deep LearningHiggins et al., 2016The argument that a good representation is one whose directions mean something, written before it was a crowded field.
- Representation Learning: A Review and New PerspectivesBengio, Courville & Vincent, 2013Still the best single statement of what a learned representation is supposed to be for, and of how many of these questions were already open.
This chapter is free and open source. A star helps the next person find it.
Star on GitHub21