Geoffrey Hinton on Deep Learning: Intro to Deep Belief Nets


What Hinton talks about
Geoffrey Hinton gave this lecture at the Institute for Pure & Applied Mathematics in 2016, introducing deep learning and deep belief nets through backpropagation, unsupervised pretraining, generative models, and restricted Boltzmann machines.
Also known as: Intro to Deep Belief Nets; IPAM lecture on deep learning; Introduction to Deep Learning and Deep Belief Nets.
Hinton gives a broad historical and technical introduction to deep learning, starting with backpropagation, its early limitations, and why it became powerful once computers and optimization improved. He argues that the big breakthrough was combining unsupervised feature learning with later supervised fine-tuning.
He then explains generative models, belief nets, variational methods, wake-sleep, and restricted Boltzmann machines as ways to make learning deep representations tractable. Along the way, he emphasizes why inference is hard, why posterior correlations matter, and how contrastive divergence and layerwise training helped revive deep learning.
Hinton speaks throughout.
In his words
“Almost everything I used to believe about backpropagation is wrong.”
“If you use exactly the right scales for the weights, you can make this Learning much faster.”
“What made backpropagation work. Better in the end.”
“There's a very simple way to get the values those hidden variables for certain models.”
“So the idea is, gradient descent learning for big neural networks is a very sensible thing to do.”
Key points
- Backpropagation was promising early on, but limited by slow hardware, poor initialization, and lack of labeled data.
- Deep learning improved when unsupervised learning was used to learn features first, then backpropagation fine-tuned the model.
- Hinton contrasts discriminative training with generative modeling, arguing that images contain far more information than labels.
- He explains why inference in deep directed models is hard because latent variables become correlated through explaining away.
- Variational methods and the wake-sleep algorithm were early attempts to make learning deep generative models practical.
- Restricted Boltzmann machines made learning easier by removing hidden-to-hidden and visible-to-visible connections.
- Contrastive divergence provides an efficient approximate learning rule that helped train deeper feature hierarchies.
Full transcript: Geoffrey Hinton, Introduction to Deep Learning & Deep Belief Nets (2016)
I'm going to start with a brief history of deep learning, what I think. Then I'm going to spend the multi-layer generative models and how we can learn multiple layers of features and what's really going on when we do that. Then this, our time, the second lecture, I'm going to talk about how to fine-tune these generative models for better discrimination and how to deal with real values in a more sensible way than most people do at present. Then on Wednesday, I'll be talking about applications in vision and speech and various other issues. A brief history of deep learning goes like this: back in the 1960s, people realized—you wanted to actually, 1950s people realized—you want to learn lots of laser features.
And they have various schemes for doing it, but none of them worked very well. Then in the '70s and '80s, people invented backpropagation. Paul Werbos was probably the first person to publish it. He didn't realize that the way to sell it was to show that it developed very neat features that were interesting. He worked on econometrics, where nobody knows what the truth is. It's much easier to sell backpropagation if you work on a toy problem where you know what it ought to do and you can show that it does it. So it became very popular in the mid-1980s because we showed it learning interesting representations, and it really took off. There was a lot of excitement about it because it was going to solve the problem how you learn multiple laser features, and it was a
huge disappointment that it didn't do that nearly as well as people expected. One reason it didn't do it was because if you gave it lots of layers of features and tried to train the whole system by backpropagation, which I'll explain in a moment, it was just much too slow on the computers we had in 1986. We now have computers that go 50,000 times faster, maybe even a million times faster, GPUs, and now the things we tried in 1986 that didn't work just work. And that's just because computers got faster. However, we've also made a small improvement in the theory, so we can do slightly better things than we did in
1986. In particular, the biggest disappointment with backpropagation was it didn't work in recurrent nets, because if you could train a recurrent neural network with backpropagation, you could do wonderful things like it could learn to divide itself into lots of little pieces, each which ran a different little program, and these programs between them would form a consensus about what input to give. And you can imagine something like that being like a system that learns to program itself into lots of little modules, and that would have been very exciting. We're beginning to be able to do that now. But that really didn't work for multiple laser features. It was very slow, and the only version that really worked well were convolutional nets, which were developed by a Yamaka, and
they work very well for what we now regard as relatively simple tasks like digit recognition. But on the whole, backpropagation fell out of favor because it failed to be able to learn multiple laser features. So in case anybody who doesn't know what backpropagation is: you have some inputs, you have multiple layers of nonlinear neurons, you have some outputs, you compare—the you put an input in, you run forward through the net, you compare with what the correct answer should be using some measure of the difference, and then you use the chain rule to backpropagate derivatives through this network to figure out derivatives for all the weights in the network. And the key to using the chain rule is simply that you're going to backpropagate for each neuron the derivative
of the error with respect to the activity of the neuron. Once you've got that, you can backpropagate the same quantity to the previous layer, and you can compute derivatives for the weights. So it was actually a very simple algorithm. The algorithm was actually developed by control theorists for linear systems in the '60s, and that's where Werbos got it from. He suddenly realized that it didn't have to be linear, as long as there was a smooth non-linearity for the longest time, until in fact quite recently, people thought it was very important to have smooth nonlinearities here. And I would tell people one of the breakthroughs in backpropagation was realizing that you shouldn't have a step function here; you should have a smooth non-linearity. So you come backpropagate using the chain
rule. It turns out that's complete rubbish, and I'll get to that in a later lecture. In fact, almost everything I used to believe about backpropagation is wrong. But this does require labeled training data. And back then in the mid '80s, we didn't have much labeled training data for things like speech. You were lucky if you got, you know, a few thousand examples that were labeled. Now you can easily get five thousand hours of accurately labeled speech, where each phoneme is labeled in these five thousand hours. It's not labeled by hand; it's labeled by another system. And so now people are training on like five thousand hours of labeled speech, and
it's amazing what backpropagation can do. This, I've already mentioned: if you put multiple layers, the learning seemed to scale very poorly. All of these things, the complexity limits are hopeless. Unless P equals NP, it's going to take exponential time in the worst case to find the right weights in the net. But that's pretty much irrelevant. The issue is why is the learning time slow and whether it can be fixed by just sensibly initializing the weights. And what people have discovered in the last few years is that if you use exactly the right scales for the weights, you can make this
Learning much faster. If we had done that in 1986, we might even know being able to do some of this learning effectively in 1986. And then there's a question of whether you get a reasonable local optimum or a bad local optimum. You typically get quite good local optima, but now that we've got better optimization methods we've discovered you can get much better ones. And anyway, they won't be local optima. So take any normal training algorithm for backpropagation net, let it get stuck in a local optimum, and then turn a really good optimizer loose on it and it will improve from there, thus showing it was really a plateau. It was somewhere where the gradient downhill had a very gentle slope and there was very high curvature
in other directions. So, dumb stochastic descent methods couldn't really find it. Okay, so I want to go over some of the major issues that will be thrown around in deep learning. We'll discover that the various tutorial speakers have different beliefs on these. There's the issue of deep versus shallow and whether you really need deep nets to do interesting things and, if so, why. It's been quite hard to show what it is you can do with deep nets that you can't do with shallow nets. Wide shallow nets can do a lot of things though some things they can't do efficiently. And I think, yes, your Bender is going to talk
more about that. Deep narrow nets can also do lots of things. In fact, if your input vectors are binary, any density you want over binary vectors can be more modeled by a deep narrow net. That is a net that's, I think, one wider than the width of the input but exponentially many layers that can model any distribution. So that's one issue. Another issue: supervised versus unsupervised. So, Ron Ruing, for example, isn't convinced they need to be that deep, but he is convinced they need to be unsupervised. The Anika is convinced they need to be deep, but he saw the flip-flops on how much you need unsupervised learning. So you'll see some variation here. I believe in both these
things. In people, almost all the learning we do is unsupervised, that is, little kids wander around the world and occasionally our mother says no, and that's the supervision they get. And eventually our mother names a few items and they immediately know what the mother’s talking about because they've already formed concepts. Recently, you may have seen in the New York Times that computers can form concepts too. If you take 16,000 cores and run them for a very long time, they can apparently form the concept of a cat. So what happened about five years ago, actually seven years ago now, is that we managed to get
unsupervised learning to learn multiple layers of features efficiently, and that made a big difference to backpropagation because if you can initialize the layers of features at sensible feature detectors then you can fine-tune the whole thing with backpropagation. And backpropagation doesn't need to know all that structure; the structure is going to be discovered with unsupervised learning. And then backpropagation, with relatively few labeled examples, can change the weights to get the right outputs. And that made a huge impact because finally we could train deep networks relatively efficiently by using these two phases. And that's what I'll talk about this morning. More issues in
deep learning. So if you're trying to solve a practical problem, it makes sense to put as much knowledge as you can into the network. So convolutional nets, which have a long history of being successful at vision problems, wiring knowledge about translation by having replicated feature detectors. If ever you build a feature detector, you replicate it across the whole image. It's a local feature detector replicated and then, with various other tricks like local pooling, they deal much better with structured information that's translationally invariant. But the problem with that is you have to know how to set constraints on weights in the network. So you have to kind of interfere
with the network and tell it, this way it must always be the same as that weight. So you're prejudicing its solution, you're getting the prior knowledge in. But the cost of doing that is you're having to tell it how to do it. And it's easy for translation because our pixels are square pixels and we know how to translate by one pixel. It's much harder if you want to do scaling and rotation; if you want to do 3D transformations like perspective transformations, trying to wire that into a network by hand would be a nightmare. And so we really like ways of getting knowledge into networks that don't require you to sort of intervene. And there is a very, very effective way which is to mess with the training data. So particularly if we have a limited set of training data, what you do is you take
your training data and you extend your training set by making transformations on the training data. And the nice thing about that is you've told the network something by making these transformations on the training data, but you haven't told it how it should encode it. So you can get a lot of knowledge into the network, a lot of your prior knowledge, by messing with the training data without intervening with the weights. And presumably that's what education is about. Presumably what happens in education is that rather than getting a micropipette and messing with your neurons, all I can do is change the data and try and structure the data so that you come up with the right conclusions. A second major issue that I'm hoping Andrew will talk a lot more about
tomorrow is how we deal with issues like attention and recursion. So almost all the neural net models you'll see have some tasks and they have some fairly straightforward mapping of the tasks onto a neural network. For example, they want to do object recognition, so they sort of center the object in the image, then they take a piece of the image and they say, "Okay, the pixels of the image are the inputs to the network." And after that, that's the end of talking about how the task is mapped onto the network. And then the network has a bunch of layers and it tries to recognize objects. That's not what we do. So when we do vision, most of the work is in deciding what not to look at. Vision for us is a sampling process where you have this high resolution area
That's the size of your thumbnail at arm's length, and you're deciding where to put it, and that's why conjuring tricks work. I'm—if you can trick people into not putting—they're not looking in the right places. They believe they see what's going on, but they only believe that because they think they've got a good sampling procedure. So if anything interesting happened, they would have seen it. And so the way we do vision is my analogy for that is: here's something you all know. The Russians did not invade Newcastle yesterday, okay? Now, that's a weird fact, right? But it's a fact you all know, and you know it because if it were true, you would have got some information. You haven't read any report saying the Russians didn't invade Newcastle.
Yesterday, you just know it because had they done it, you know that in visual terms there'd be some motion there and you'd have noticed, and there have been something in the news. So you're totally confident about it, and that's the way we do almost all vision. The way I know that sort of the wall behind me didn't just disappear is because you'd all be very surprised if it did. Okay, so vision is mainly about sampling, and that's not how people in computer vision on the whole have treated it, and it's certainly not how people in your own networks have treated it. And we'll be able to get much better visual systems if we can figure out how to do this sampling. And if you think about what eye movements are, they're changing the mapping of the visual world onto your neural network, so your network doesn't have to cope with the whole world at
Once you've got about a hundred billion neurons to do vision, which is many more than the simulated systems have, and even with 100 billion neurons you can't afford to process the whole scene at once. You have to make intelligent decisions based on what you've seen so far and then, based on those decisions, go off and process small bits of the scene. That allows you, of course, to apply the same knowledge to different bits of the scene because you're using the same connections on different parts of the scene. But that's what biological vision's like, and it's very unlike current computer vision. Okay, that's just sort of background, and now I'm going to get on to the move away from supervised learning towards unsupervised learning, which is what made backpropagation work.
Better in the end. So the idea is, gradient descent learning for big neural networks is a very sensible thing to do. It scales nicely with the amount of training data. Instead of going through the whole training set and getting a gradient and then making a small change in the weights, you make changes in the weights after a few training examples. It's much more efficient. But we're going to use gradient descent not for modeling the probability of a label given an image, which is discriminative learning. We're going to use it to build a model of the image. And then each training example gives us far more data. If you're trying to predict a label, there's only a few bits of information in a label. So when I tell you the answer, I only give you a few bits of constraint on the mapping from inputs to outputs. But if you're trying to model an image, there's
Lots of bits of information in an image, so each training example is much more valuable. So if we want to learn models of images, and I'll focus on vision for now, what kind of model should we use? Well, computer graphics has pretty good models of images. I mean, the difference between computer graphics and computer vision is they go in opposite directions. Computer graphics works, so presumably we should build a model like computer graphics does. That's not what actually happened. We had the kinds of models we like to build. So even just despite this ideology that vision should be graphics done backwards, we went off and built a completely inappropriate kind of model for doing vision. I'll talk more about.
That on Thursday. So this is a model that goes in the other direction. In statistics and artificial intelligence, this is called a belief net or basal net. So the idea is, instead of having pixels and then layers of features and doing inference in this direction, what we're going to do is we're going to think in terms of having layers of hidden features that generate the pixels. So this, the straightforward process, is a generative process in this direction. And then figuring out the activities of these given an image is going to be an inference process that's going to be tricky. Well, looks as if it's going to be very tricky. So for now, I'll use.
Stochastic binary units. So these are Bernoulli variables, and the way you would generate data is you would—this would have some bias, so you'd sample given the bias here, so you get a 1 or a 0 here, and a 1 or a 0 here. Given these ones or zeros, you get top-down input to these guys, plus their biases. You sample these guys, given these guys, you can sample those guys, and now generate an image. And each time I do it, I'll typically get a different image. This is a lot of these hidden features, so the generative process is nice and simple. The inference process is much more complicated. So in the inference process, given some pixels, I'm given the weights on the connections, we would like to infer what states these guys probably—
Had when they generated that data under the assumption the data was generated by a model like this, and that's what I'm going to talk about now. That's apparently a very difficult problem, but some nets like this, in which it turns out to be a very easy problem. The learning problem is: how do you adjust the weights on the connections so as to make this model more likely to generate the observed data? So the units we're going to use are stochastic binary units that use the logistic function. So the probability of them outputting a 1 is the logistic function of the total input they get, which is a bias plus inputs from other neurons, and they're stochastic neurons.
They only output ones and zeros. It turns out that's becoming very important for a completely different reason from the ones we've used before. When you want to simulate really big networks on lots of computers, you need to split the network over different computers. And now you need to communicate the states of neurons between computers, and if you can communicate with a single bit, a single stochastic bit, you can communicate 32 times as efficiently as you could if you had to send real numbers. So I think these stochastic binary units that we use in these sigmoid belief nets and in Boltzmann machines, which I'll describe later, are going to make a comeback just because of communications that you do.
Times as efficient, and indeed, that may be why the brain is doing it. Ok, so it's easy to generate an unbiased sample from the model. It's hard to infer the posterior distribution across the latent variables because there's many different ways that you could have caused the observed data, and learning is apparently hard, but actually, if you can do this inference problem, learning in these nets is easy. So here's the learning rule. Let's suppose we have data down here, maybe several layers down, and let's suppose we can do inference in the following sense: we can get an unbiased
sample from the posterior distribution over the values of the latent variables. We don't need the whole distribution at the same time; we just need an unbiased sample. If we can get that unbiased sample, the learning rule for updating weights is very simple. So the maximum likelihood learning rule, that is the rule that changes the weight to maximize the probability of generating the observed training data, is simply that you change the weight. This is the gradient descent in the negative log probability by learning rate times this activity times the difference between the activity here that you've inferred when you did your
inference, and the activity here you predict from the inferred activities of these guys. So this times this weight, this times this weight, and this times this weight goes in here. You infer a probability this guy would turn on, given what these guys are up to, and now the learning rule says change the weights to make his actual probability of turning on fit in with that inferred probability. So we just take that difference and use that to get a gradient, and that will maximize your likelihood generating the data. But, and notice the learning rule decomposes in the sense the learning rule for this connection just needs to know about this guy and these
activities here. It doesn't even know about stuff down here or stuff up there, so it's a nice local, fairly local learning rule, but it all depends on being able to do the inference. And here's why the inference is hard. This is my California example, so I guess it's appropriate here. I was a postdoc in California once and I was lying in bed in the middle of the night and suddenly the house jumped. And being from England, I assumed a truck hit the house. There's two plausible explanations of why your house would jump: one is a truck hit it and the other is there was an earthquake. Let's suppose those are both pretty unlikely events, with the probability of e to the minus 10, let's say. We could have a model of jumping houses that goes like this:
First of all, does a house just jump by itself? No. That's very unlikely; we'll put e to the minus 20. Though a truck is quite likely to jump if—sorry—houses like this jump if a truck hits it. So if a truck hit the house, that's a 1. This 20 cancels out that 20, and now there's an even chance the house would jump. This is a logistic unit. Similarly, if there's an earthquake, that cancels out this minus 20. John's eyes would jump. So now, when you observe the house jumping, if this is your model of reality, then the posterior distribution across the two causes, remember in the prior we're assuming that independent, which isn't necessarily right, the posterior looks something like this.
Given that the house jumped, it is very unlikely that we didn't have one of these events because that's e to the minus twenty. Much better to pay an e to the minus ten in probability and then say there's an even chance lies for jump, but it would be stupid to appeal to both of these events because that's now e to the minus twenty again. It's a product of these probabilities. So both of them is very unlikely. Neither, that's very unlikely. And you notice what we've got now is a strong negative correlation between these two events. So in the prior these events were independent. Our model says truck might hit the house, there might be earthquakes. This happens one time; you need to attend. This happens one time a niece attend. They both have one time in each of the twenty, but in the posterior they're highly
anti-correlated. So what you observe is that, having observed this thing, these are not independent events anymore. So when you try and infer the posterior distribution here, it's going to be complicated because there are interactions here caused by the fact that both of them can explain away the same piece of data. With Judea Pearl, who's at UCLA, who was the first person to make a big song and dance like this, and it's very important. So because of that, it looks like it's going to be hopeless to learn deep sigmoid belief nets, and the reason goes— the reasoning goes like this: we won't have multiple layers of hidden variables. We observe some data, let's
suppose we know these weights and these weights and these weights in our generator model. Having observed the data, we now would like to infer the states of the hidden variables. That is, sample from the posterior distribution. Let's think about these hidden variables here. We know from the previous slide that there's going to be explaining away in the likelihood term. That is, in order to kind of take the information the data is telling us about these latent variables, when we take that information there's going to be negative correlations between things, so these are not going to be independent and that's going to make inference difficult. We also know that all this stuff upstairs is going to create
Correlations here. The whole point of this kind of model is by putting these latent variables in, you can get complicated correlations here. So we know the higher layers are creating complicated correlations. We know the data is creating complicated negative correlations, fairly complicated, and obviously the posterior distribution here is the normalized product of the prior distribution and what you get from the likelihood term. And so that's going to be complicated. So there is going to be no simple way to get those values of those hidden variables, at least that's how it appears. Of course, the point of this is to pull a rabbit out of a hat and show you there's a very simple way to get the values those hidden variables for
certain models. But the reasoning looked like this, and so the question was, well, if you do want to learn models like this, what are you going to do about this problem that it's hard to get the posterior? And there's various obvious moves you could make. The first obvious move is to use a Monte Carlo method. So now computers have got faster, the Bayesians have come out of the woodwork, and they're using Monte Carlo methods all over the place and it works very well if you don't have much data. Russ Salakhutdinov, at the end of the SAM school, will show you it can be made to work pretty well even if you do have
much data. But for these large deep directed models, it's slow. To try and make things faster, in the 1990s we developed variational methods for learning these deep nets. The variational methods are much faster. The nice thing about variational methods is you infer the posterior, but you get it wrong. And it looks like everything is now lost because you've got the wrong posterior, but you can show that when you do learning based on the wrong posterior, you're still optimizing a bound on the log-evidence. And once you have multiple layers, you're optimizing a bound on a bound on
a bound on the log-evidence, so that you're making progress. And variational methods are now all over the place. We came up with them in the early '90s, and I went round trying to explain variational methods to statisticians, and it was kind of hopeless. They really didn't want to believe in them because they thought that you need to infer the correct posterior, and inferring the wrong posterior and then doing learning anyway was extremely sloppy. So they have an algorithm called the EM algorithm, and EM relies on inferring the correct posterior and then updating the parameters based on that, and they were very unwilling to listen to the idea you could do the incorrect posterior. Now it's really caught on, and so lots of
people use variational methods for learning these big complicated models. The variational method for these Deep Belief Nets—let me go back a couple—would go like this. Suppose we want to infer; we want to get a sample from these latent variables given some data. The idea is we're going to sample one layer at a time, starting at the lower layers and moving to higher layers. So we've already got the data. Let's say we're now going to sample the variables in this layer, and instead of using the generative way—so these are the model, the generative model, these weights—we're going to have a bunch of weights to go
in the opposite direction. So we're going to have weights to go from here to here. They're not going to have the same values as these weights. I'll call those recognition weights. So now we have two sets of parameters: one set of parameters is our real model; the other set of parameters is the recognition weights, which is just a trick for doing approximate inference. And we're going to make a really gross assumption, and the really gross assumption is going to be that if, for example, I've got the states of the variables in this layer already, and I want to figure out what the probability is that this guy should be on, I can use weights coming from the layer below and use the same logistic function but in the opposite direction, these recognition weights, to get a probability, and I'll use that probability—that is, I'll turn them on with
that probability in my sample from the posterior. So it's not that these are all completely independent; it's that given the values in one layer, we're going to assume the values in the layer above are independent. So given these values, we're going to separately infer the probability of each of these guys being on, we're going to sample from those probabilities, and we're going to go to the next layer. So now we get a sample, but it's not from the posterior; it's from this gross approximation. And the question is, how can we learn the generative weights and the recognition weights? And there's a cute algorithm called the wake-sleep algorithm. I've already shown you how you would learn the generative weights if I gave you a sample, so that's not problematic. We're going to use this sort of fake sample we
get; this is incorrect, and we're going to learn the generative weights in the way that would be appropriate if we had a true sample. To learn the recognition weights, we're just going to do exactly the same thing in reverse. And in order to do that, we need to run the network in two phases: there's a wake phase and a sleep phase. The sleep phase is easy to understand. In the sleep phase, what you do is you generate samples from the model, so that's like dreams; that's why it's called the sleep phase. So you're just generating lots of samples from your current model. Since you generated the sample, you know the true states of the latent variables that generated that sample. So now if I know the true states...
There, and I observe what it generated at the layer below. I have training data for going the other way, so I can train the connections—the recognition connections—to try and return the correct value here, given the values there. Now, we know it's not the right thing to do to do these independently because, we explain anyway, says these ought to be correlated. But it works pretty well, and we managed to get a paper in Science out of that, and there’s still neuroscientists who think that’s how the brain works. So neuroscientists of Britain called Col Forrestal, who makes a big song and dance about this and is convinced the brain is using something like that for learning. I’d be very happy if it was, but I don’t believe it. Um, okay, that’s the wake-sleep
algorithm. But notice it makes a gross approximation in the sleep phase. When you generate from data, really the correct inference for these hidden units is not to assume they’re independent, but we’re going to learn weights—recognition weights in the other direction that do assume they’re independent. In the other direction, the learning is fine. So in the wake phase, you put in data, you get this sample that isn’t really a sample from the posterior, but then the learning you do, based on the rule I showed you before, is the correct kind of learning to do for variational learning. And that learning is guaranteed to improve a variational bound. It’s just what you do in the sleep
phase is incorrect. Yeah. Okay, so now I’m going to show you how you can actually do inference correctly in these nets, and that led to a sort of revolution in deep learning because you could now do inference correctly, and so you could learn lots of layers of features. In order to make it efficient, what we’d like to do is learn one layer of features at a time. So we’d like to take pixels and then learn little combinations of pixels that are first features, and then combinations of those features, and so on. But we know that in one of these generative models, the latent variables are not independent
in the posterior. So if we’re going to do correct inference, it looks like it’s going to be hard. And if we train one of these models, it only has one layer of variables—hidden variables—what it is going to do when it learns is try and make the posterior be like the prior. Because the way you get high likelihood for data is having the prior match the posterior. And so if you give it a prior that says things are independent, it’s going to try and learn to make them independent given the data, and that’s going to push it in a direction that’s not the right direction to go in. It’s going to constrain it a lot in the learning. It’s not going to be happy to learn features that are not independent because the built-in assumption is they are. And we’re
going to find a way around that, and the way around that came sort of accidentally because I gave up on that problem. I decided that problem was hopeless and I went off and explored something else that was apparently totally different, and then accidentally I stumbled across the solution to the first problem by exploring something else. So if you take these stochastic binary neurons, you can connect them in what’s called a sigmoid belief net—the thing I just showed you—where you have top-down connections and you got this complicated inference problem, or you can connect them with symmetric connections—undirected connections—where you get something called a Boltzmann machine that Terrence Sejnowski and I worked on in
the early ’80s. And we got a general learning algorithm for a Boltzmann machine; it’s just it was very inefficient, although it’s beginning to make a comeback. What I realized much later is if you strongly restrict the connectivity, you get a kind of Boltzmann machine you can learn efficiently. So that’s called a restricted Boltzmann machine. Paul Smolensky suggested them in 1986. Terry and I thought, well, they’re not really interesting because we got the learning algorithm for the general case, and this is just a simple special case. So why is that interesting? Well, it turns out simple special cases are often very interesting, and in this case, the simple special case was the crucial thing required to get big Boltzmann machines
to learn well. So in the simple special case, we have some observable variables—visible units—we have some latent variables or hidden units, we have symmetric interactions, and we prohibit interactions between the hidden units. We also prohibit interaction between the visible units, although that’s less important. So now, if these are undirected connections and these guys don’t interact, then when I give you the visible—the values of the pixels here—these feature detectors are genuinely independent; that is, when I try and infer the posterior distribution for that given these, then it’s quite independent of what I choose
for that. So the posterior distribution here is factorial, which makes it very easy to sample from. That’s because of the difference between the semantics of undirected connections and directed connections. So these undirected models—I know most of you know all about these, but I’ll go over them very briefly. In the directed models, you have a causal generative process, so it’s very easy to say what the model is in terms of a sequence of generating one layer after another. In the undirected models, the easiest way to say what the model is is via an energy function. So you say the energy of a joint vector of binary values for the visible units and a vector of binary
values for the hidden units. I’m going to leave out bias terms to keep them as simple as possible. It’s a quadratic function of the binary values of the visible units and the binary values of the hidden units, and you simply just add up the weights between all pairs of units that are active. And if they’re positive weights, it gives you low energy. If we differentiate this—this is a math summer school, so hopefully you don’t find that too tough—this is about the limits of my math, by the way, so you’re going to be okay. There’s not going to be any really complicated math. If you differentiate this, you get that the derivative of the energy with respect to weight is this product here, and so if you want to learn, you’re going to be manipulating these energies because
They're related—going to be related log probabilities. And so you're going to be using these products. So, in this system, we have weights. They define energies. The energies define probabilities via a Boltzmann distribution that looks like that. We say the probability of a joint configuration, visible and units, is proportional to e to the minus the energy of that joint configuration. Once we've done that, log probabilities are linear in energies; energies are linear in these products of visible units, and so we get a nice simple learning rule. So here's the probability—the joint probability being proportional to this, but of course it has to be normalized.
This thing is called the partition function, and it makes learning difficult because the derivatives of this are complicated to get. If you want the probability that this model assigns to an observed data vector V, then you have to sum over all possible hidden configurations. This thing. And so you get the top line now has an intractable sum on to, because if that's, say, a thousand binary units, there's 2 to the thousand possible values for it. But that's the thing we want to manipulate in learning. And so, to make V big, we'd like to make the top line big and the bottom line small. And it turns out when you take derivatives, that gives you very
simple derivatives. The derivative of the log probability that your model would generate this observed vector with respect to the weight on a connection—that ought to be a complicated thing because it depends on the weights and all the other connections. But that dependency all shows up in these pairwise statistics, and so it turns into a nice simple learning rule. And for restricted Boltzmann machine, you can think of a Markov chain that goes like this: you put some data in here using your current weights, you activate each feature detector; that is, you pick a one or a zero based on the logistic function of these activities times the weights into the feature detector. Then having picked ones or zeros here, you
reconstruct the data—that is, you pick these to be 1 or 0 based on the top-down inputs they're getting from the active feature detectors. And you go backwards or forwards. This is alternating block Gibbs because you can update all these variables together because these are all independent given these, and vice versa, these are all independent given those. So you can update all of these together, then all of these together, then all of these together. And if you go on forever, you'll reach a stationary distribution, which we'll call a fantasy from the model. And the learning rule is very simple. It's just the—for each connection, take the product of these activities averaged over the stochastic noise here.
If we're just interested in V, then run the chain until it's forgotten where it started, which is the stationary distribution, and I take the product of the activities again, averaged over all the noise, sharing all the noise there. And that difference is the learning one. So what's really attractive about this learning rule is to change the connection between two neurons, you only need to know the activity of those two neurons. Everything you need to know about other neurons, unlike in backpropagation, is propagated around the net by this alternating block Gibbs sampling. So eventually, everything you need to know about the other weights in order to change this weight shows up in this difference of pairwise
statistics. What's bad about this learning rule is you have to run for a long time in order to get a sample from the equilibrium distribution here. So, with the directed nets, we have this intractable problem of sampling from the posterior. We will now replace that with a different intractable problem of getting a sample from, in effect, the posterior here. Where you had to run for a long time. Seventeen years later, I realize that you don't actually have to do all that if you just go up and come down and go up again and use, instead of sampling there, you sample here. The learning rule works just fine. Now, there's no very good guarantees that it
will work. I'll show you a little later why it works, but in practice, it works fine. So that's what we do: you go up, come down, you go up again. And now we've got a learning rule that's a million times faster. It's about a hundred times faster because you just go up and down and up again, and it's about 10,000 times faster because it took 17 years to think of it, and computers got ten times ten times faster in that time. And this learning rule works nicely, and that sort of led this deep learning to take off because now we could learn a layer of features, and once you've learned a layer of features, you can apply the same learning rule again. So I want to sort of summarize ways of combining
probabilistic models. A standard way that's very common in statistics is to make a mixture of these models, but it's a very weak way to combine models. What you're doing is you're saying, "My data is explained by one or other of these models, and I'm going to learn all these models such that between them they explain the data, but each data point is explained by one model." We may not know which model, but we're assuming it's explained by just one model. And that means that, for example, your model of the data can never be sharper than an individual model, and so you can never get really sort of good explanations of data with mixture models unless you have huge numbers of components in the mixture.
Unless the data really is like that. In a product, you have a quite different thing. You're taking a geometric mean of the probabilities instead of an arithmetic mean. And so now you say, "I can have a bunch of different models of my data, and they're all going to be true at the same time. Every model is going to be constraining the data, and between them, they're going to constrain it a lot." So now you can get models that have a much sharper—much sharper data than any individual model. You have a bunch of vague models. So an example would be, "Here's a vague model of a document: it's about something Italian." Okay, that doesn't tell you much about the document. Here's another vague model of a document: it's about corruption. Here's another.
Vague model of a document. It's about sex. Here's another. None of these tell you much about the document by themselves. She’s a lot of a model. It's got something to do with AC Milan, this for the Italians, okay? Now, all of these are pretty vague models but, you know, the document's about Berlusconi. So that's an example of an intersection of a bunch of vague things giving you sharp knowledge. So the standard models of documents can't handle that. So latent Dirichlet allocation, for example, is assuming each word in the document comes from one of the underlying topics and it can't handle the idea there's a bunch of topics and the word that fits in all of those topics really nicely is highly
probable. You can't be sharper than of the individual topics, okay? Product models can be—product models are much good if you use Gaussians, because the product of Gaussians is just a Gaussian, but if you use anything that isn't Gaussian, product models get very interesting and they can be, allegedly, more powerful than mixture models. And then a final way to combine models is composition. In composition, what we're doing is we're saying we can take a model and then we're going to take the latent variables of a model and use that as data for the next model. And so we're going to use product models and composition. In fact, the restricted Boltzmann machine can be thought of as a product model where each hidden unit
—each of these binary hidden units—says, if I'm off, the data can do anything it likes. I have no opinion. It’s a uniform distribution. It’s binary dangerous. That’s okay. If I'm on, I have an opinion about the log-odds of each pixel being on. That's what the weight is. And now if you have a bunch of hidden units, their combined opinion is just the product of all those mixture distributions where it’s a mixture of a uniform and a strong opinion. Okay, so now we get to the sort of crux of it, which is training a deep net. And I discovered this just by doing it because it was easy to do in MATLAB and it took a long time to figure out
what on earth I was doing, why this should work. You train your lower features, you then take those features and you say, "Pretend those are data. Let's train another lower features." And if you keep doing this, you get better and better models. That is, these stacked-up restrictive Boltzmann machines between them make a very nice model of the data. After you've trained, say, three hidden layers, the generative model looks like this. And it's not what you'd expect. It's not a great big Boltzmann machine. The generative model is the last two layers you train is a
restricted Boltzmann machine. So the restrict the weights here to find P of H3 given H2. They also define P of H2 given H3, and if you go backwards or forwards, that's a Markov chain that will sample from the distribution—the distribution of these. So that's what's happening upstairs. But then the lower-level restricted Boltzmann machines, what you have to do is throw away the bottom-up weights, just keep the top-downwards. Even though the weights are symmetric, our generative model, which is in green, is an undirected model there, and then directed models below that. So to generate from this model, which is easiest for you to say what a generative model is, you run your Markov chain backwards and forwards
here, ignoring all these weights, just go back and forth there for a long time. Once you've done that, you go chunk chunk and now you get a number sample here. And that seems like a bizarre model to have produced by training these symmetric things. And so now I'm going to try and justify that. First of all, I want to get something straight about the posterior distribution across the hidden units. So for a given input vector in a restricted Boltzmann machine, the posterior distribution is factorial. But if now you sum over all the different input vectors, all those posterior distributions is the
sum of a whole bunch of factorial distributions, which is not a factorial distribution, okay? It’s a mixture of factorial distributions and that’s a non-factorial thing. And that average, if you averaged over data vectors the posterior distribution for each data vector, I’ll call that the aggregated posterior. And that aggregated posterior is an important distribution for us. So we think of a restricted Boltzmann machine as defining either P of H given V and P of V given H—that's what happens in the Markov chain. All we can think of it as is just defining the joint distribution P of V and H. But we can also think of it a different way, which initially seems a very odd way to think
of it, which is we can say one way in which it defines the probability of a visible vector is by defining the probability of latent vectors, so independent of the data, and then defining the probability of the visible given the latent vector. In other words, you can take these visible and hidden units and you go back to the voids a lot of times and you can stop at the hidden units and now you get a sample from P of H if you reach the stationary distribution. So the weights define a P of H, they also define a P of V given H, and therefore they define a P of V by the sum over all latent vectors P of H times P of V given H. It’s a funny way to write it because it’s an undirected model and we sort
of trying to force it into the framework of a directed model. But once you've written it like that, you can see that if we want to improve P of V, we could leave this bit alone and replace this by something that's better. And now, when you're fitting a model to data and you ask, I have some prior over latent variables, what would be a better prior over latent variables? Well, a better prior is always one that's closer to the posterior given the previous prior. So when you're fitting a mixture model, for example, you have the probability of choosing each component in your prior. You then take your training data and you look at the posterior probability of choosing each component and the EM—
Algorithm says replace the prior by that posterior because that posteriors are better prior. That's easy because you can just replace it. Here we're just going to do something else. We can't write down the right answer, but we can say if I could take my prior over hidden latent variables—that's the thing I would get by running my Markov chain and then sampling the hidden variables—if I could replace that by something this close to the posterior distribution that I get by taking the data, inferring the hiddens, and then averaging that over all the data, so that's my aggregated posterior. If I get something close to their greater posterior, this whole model would
be a better model of POV. So the question is how do I get a better model of the aggregated posterior, and the answer straightforward: take the aggregated posterior and treat it as data and model that data. But how are you guaranteed it's better than the model you have before? Well, take them all you have before and turn it upside down. It's a symmetric model, so you can call V H and you call H V if you like. So if I've got a model with visible variables and latent variables, I can turn it upside down and pretend it's really a model of these latent variables, and that's the model I currently got for H. So I can start off a model like that with the weights that I currently have that defined p(H | V) and then I
can start learning, changing those weights to make it a better model of the aggregated posterior, and if we do that, we'll get a better model of the data in general. For many layers, each time we do that, we'll get a new bound; when we add another layer and we show, the new bound will be an improvement on the old bound. It may be that the new model we get has a slightly lower bound, but we keep improving our bounds. So in a minute, I'll give you a picture that makes all this clear. There's a surprising equivalence between these undirected models, our RBMs, and infinite directed models. So here we go. So consider this directed model. So this
is clearly an infinite belief net, but it's got shared weights, and so this land, this land, this low will have to be the same size, and you know how to generate from that model. You start up infinity here and you keep going, producing p(h | v), p(v | h), p(h | v), p(v | h). Ph can be p(v | t) Lynch, and if you start it far enough up, then you would generate a sample from the model here. Now that's exactly the Markov chain we were running for a restricted Boltzmann machine, p(v | h), p(h | v). It's the same process. So that Markov chain we were only to get an equilibrium sample from the model is exactly the same as an
infinitely deep logistic belief net. Now there's something really nice in a restrictive Boltzmann machine: if you want to, if I show you data and you want to infer the states of hidden variables, I said that's factorial, that is, given the data, you just multiply by this matrix, stick it through the logistic, and that gives you independent probabilities for each of these units. But how could that possibly be? Because look here: we know there's explaining away going on in this model, so we know the given data, then units here, the likelihood term will
anti-correlate its here. We also know that this creates a complicated price, so there's complicated correlations between these when you generate. And the only way you can sort of make this factorial is if you have a tremendous piece of luck, which is that the prior here creates positive correlations that exactly cancel the negative correlations created by the data likelihood term. So there's something magic about this particular deep belief net, which is even though it generates complicated correlations at every level, inference is trivial. Inference is just exactly the same as a general process but run in the reverse direction. That is, to infer h given v, you just take p(h | v). It's exactly
the same as you used here, but you're going through the weights in the other direction. And it turns out that's right. So to try and give you an idea of why that's right, because it seems so surprising, think of the generative process: if we generate down to here and then we keep generating, let's suppose this hidden, you, this unit here had a big positive weight to there and a big positive weight to there, then when it generates, it'll create a positive correlation here. But let's suppose these two have big positive weights to their, so this is like the house jumping on the truck and the earthquake, because these are both
positive weights, the likelihood will create an anti-correlation here, and those things exactly cancel. So in this net, and only in this net, you get trivial inference. That is, I can infer an unbiased sample from these guys just by taking these dates, multiplying by the transpose of these weights, putting it through the logistic, that's one by sample, then giving this unbiased sample, I can number sample there. So we can get unbiased samples all the way up just by running exactly the same Markov chain. So that's sort of magic. I call this a complementary prior, that is, this stuff up here creates a prior that's exactly complementary to the likelihood
in that it creates a factorial posterior. So the prior is complicated, the likelihood's complicated, but their product is nice and simple, and that's what makes inference possible in these infinite belief nets, and this is just equivalent to a restricted Boltzmann machine. So let's look at the learning algorithm to convince you of that. Mathematicians always like telescoping sums where you have all these things, you add them all up and just get the N term. So here we go. The learning rule I gave you for a belief net was that you would take, let's take a unit here, a unit here, right? So let's take unit J here, and unit I here. The learning rule looks like this: infer a sample from the posterior, then
Change this weight in proportion to—so we're going to change the weight here between J and I in proportion to this activity times the difference between this activity and what we predict from our posterior sample in this layer. So this activity is there, okay? So that's the learning rule for a directed net. And this activity is there, and now we want what we will predict for this from these activities. So to get the prediction, we take these activities and we multiply them by these weights, and we put into a logistic. But that's exactly what we're doing when we
infer the posterior here. We take these activities, we multiply them by these weights, and we run through a little stick, and therefore the sample that we took here is an unbiased sample of this thing. And so we can substitute instead of that thing, we can put this. And so the learning rule for these weights here is just this activity times the difference between this activity and this activity because this is an unbiased sample of what we would reconstruct there. So that's the learning rule for this weight. But remember, all of these weights are tied together. These are all the same weights, so we have to figure out the learning rule for these weights, and that, that's the learning rule for these weights. And we keep going, and eventually
you discover that if you look at this and this, you get the things with a 0 and a 1 cancel out because user SJ 0 SI 1 with a minus sign, and here's SJ 0 SI 1 with the plus sign, so they cancel out. So when you add them all up, you just get the first term on the last term, and that's the learning rule for Boltzmann machines, which it had to be because this is a Boltzmann machine. It's just a different way of thinking about it. What's more, if you just take the first two terms and add them up, you get this abbreviated learning rule for Boltzmann machines, which is just SJ 0 SI 0 minus SJ 1 SI 1, and that's a reasonable
thing to do if this chain is reaching equilibrium very fast. So if we put data in here and we start doing inference, what's going to happen is as we do inference here, that this chain is going to move towards its equilibrium distribution. When we get way up here, it's going to be an equilibrium. Now, if you sample from a model at equilibrium and you ask it, "How would you like to change your parameters to fit that data better?" The model will say, "I wouldn't like to change my parameters. My model exactly fits this data because it's a sample from my model equilibrium." So on average, it exactly fits it. So we know that all the route is
up here going to be zero once we've reached equilibrium. We also know that when we start learning with small weights, we return very fast. In fact, if the weights are zero, you reach equilibrium immediately, but if the weights are small, in a couple of steps you're very, very close to equilibrium. So we know that at the start of learning there's no point in running this chain all the way up here because all of these derivatives—I mean, they won't come to zero because of fluctuations, but if you average long enough, they come to zero. So there's no point measuring them and we might as well just take a couple of derivatives XI and add them together, and that will do maximum likelihood learning when the weights are very small. As the weights get bigger, what we ought to do is sample a bit further back, and as you get bigger still, we ought to sample for
the bag. And so it's always tricky keeping statisticians happy, but here's how you do it: you say that my plan is this—as the weights get bigger, I'm going to sample further and further up this chain, and so asymptotically I'm going to be sampling all the way up in the end. So asymptotically, I'm doing maximum likelihood learning. As a matter of fact, I never needed to do more than this, so we're done. But isentropically, you're sort of okay with the statisticians. In practice, if you want to learn a good density model, what you ought to do is actually go further up this chain as the weights get bigger, and that's an effective learning procedure. So just using these two is called contrastive
divergence with one step, and you use more and more steps as the weights get bigger if you want a good density model. But for learning layers of features that are going to be subsequently fine-tuned with backpropagation, you don't even need to do that. You just need to use these two terms. So you can think of the quick learning algorithm as saying, "Let's chop off the derivatives here, just get the drift is there," and then we can learn these features quickly. And I'm very near my time, so I just want to—I'll give you a demo after the break. I just want to show you a picture what the learning algorithm looks like. Now, here's an
infinite belief net. It's equivalent to this, so this and this is just two different ways of writing the same thing. We're going to start by learning this, and we can learn it a quick way but just by going infer this, infer this, and you get derivatives for these weights, change the weights, keep going like that. After we've learned this, we now have an infinite net—we've tied weights to every level—and now what we're going to do is say, we want a more powerful model. We're going to untie these weights here but keep all these other weights tied
together. So we freeze these guys, we keep all these tied together, and initially they have the same values as these guys. We treat the aggregated posterior we get here when we stick data in here as training data, and using that training data, and keeping all these tied together, we carry on learning these guys, and they will now learn different values from these. So now we'll have a more powerful model. You can think of this as like the skin of an onion. If you imagine the general process starting in the middle of the onion, and each step of Gibbs sampling being a skin, we're making the
Outer layer of the onion be different. So, we start with all the layers of the onion identical, then we make the outer layer be a bit different. We keep that as it is and change the inner less, and then we keep going like that. We now freeze these and learn those, and after a while, we get bored, say, we've learned these, we've learned these, we've learned these, and now we're going to keep all those the same as those. So, since all these guys are the same, we can write them like this, and so we get the generative model that I showed you before. We get a weight matrix, share a different weight matrix here, a different weight matrix here. There's the same all the way up now, and so that can be written as an undirected model like that, and so that's what gives us.
Where was it? That's what gives us a model that looks like this. Think of this as a directed model with these being the same all the way up now. Once we make these different from those, then using the transpose of these for inference is no longer correct. And the tricky thing is to show that you're going to lose something because the inference isn't right here, but you're going to win something because these are a better model of the posterior than these were. And what you have to show is that what you win by making these weights different from those weights, so that you're modeling the posterior distribution here better than you were when these were w1, the win is bigger than the loss you get by the
Fact, you're going to carry on using these weights for inference, and you can show that. So, there's a paper in 2006 that shows that the win is bigger than the loss, and therefore you win in terms of a variational bound by learning lots of less. Okay, I think that'll do for now. After the break, I'll give you a little demo that many of you will have seen before of this actually learning something interesting, and then I'll talk about how you can learn layers of features like that and then find Junor of that propagation to get very good performance and all sorts of things. Okay, you.
From YouTube captions, lightly punctuated for readability. Timestamps link to the video above. Errors are possible.
Cite this recording
Geoffrey Hinton, “Introduction to Deep Learning & Deep Belief Nets (2016)”, Academic institute, 2016. Transcript and video: Thinkers Archive, https://thinkersarchive.com/geoffrey-hinton/deep-learning-ipam-lecture-2016/
Quoting a passage? Link to its exact moment: every timestamp above has its own anchor (for example https://thinkersarchive.com/geoffrey-hinton/deep-learning-ipam-lecture-2016/#t-138).