Deep Learning Foundations
Transcript
Now. This book is called Understanding Deep Learning to distinguish it from other, more practical books which focus on things like coding. This book is all about the ideas which underlie deep learning. After reading this book, you will be able to apply deep learning to novel situations where there is no existing recipe for success. The book starts straight away by describing deep neural networks, and it takes you through the training testing pipeline. How do we improve their performance?
Then it starts talking about different architectures convolutional networks, residual networks, graph neural networks, transformers. There's a long section on generative models. Normalizing flows. Vaes Gans diffusion models. A short section on reinforcement learning at the end. There are two chapters that I think are really interesting. There's a chapter called Why Do Deep Neural Networks Work? Where I try and interrogate a bit why we need this particular kind of architecture, why it's easy to train, why it generalizes. We don't really have answers to those things, but I present some of the evidence there is. And the final chapter is a chapter on ethics. Um, I think the book will be useful if you know nothing about deep learning at all. It will take you from scratch to somewhere close ish to the cutting edge. If you're teaching, uh, deep learning, it will be an incredibly useful resource. It has 275 figures,
most of which are new and represent things in different ways. It also has a whole bunch of Python notebooks. If you're part of the rank and file of machine learning practitioners or researchers, it will fill in the gaps in your knowledge and maybe make you think about things in a different way. I think even my initial description of deep neural networks is a bit different to how they're usually described. Um, and I think you'll learn a lot from it, because I am a member of the rank and file of, uh, deep learning practitioners. And I learned a lot writing it, so I expect you will learn something, too. Um, if your name is Jeff Hinton or Jürgen Schmidhuber, I can see it. It might not be that useful to you. Well, you never know. You never know.
So the title is a little bit ironic because at the time of writing, nobody understands how deep learning models work. Literally nobody knows how deep learning models they learn piecewise linear functions. And as you'll know from our episode on the spline theory of deep learning, they chop up the input space into many, many little regions. In fact, most models have more regions than there are atoms in the universe. And frankly, it's a mystery. It's a goddamn mystery.
How do these models generalize and how do they learn these functions? Nobody knows. So why does deep learning work? It's remarkable that the fitting algorithm doesn't get trapped in local minima or stuck near saddle points, and that it can efficiently recruit spare model capacity to fit unexplained training data wherever they lie. Perhaps this success is less surprising when there are far more parameters than training data. However, it's debatable whether this is generally the case.
AlexNet had 60 million parameters and was trained with 1 million data points. However, to complicate matters, each training example was augmented with 2048 transformations. GPT three had 175 billion parameters and was trained on 300 billion tokens. There's not a clear cut case that either model was overparameterized, and yet they were successfully trained. In short, it's surprising that we can fit deep networks reliably and efficiently. Either the data, the models, the training algorithms,
or some combination of all three must have special properties which make this possible. The efficient fitting of deep learning models is startling, and their generalization is dumbfounding. First, it's not obvious a priory that typical data sets are sufficient to characterize the input output mapping. Second, deep networks describe very complicated functions, and third, generalization gets better with more parameters. This surfeit of parameters gives the model latitude to do almost
anything between the training data, and yet it behaves sensibly. It's neither obvious that we should be able to fit deep networks, nor that they should generalize. A priory deep learning should not work, and yet it does. The success of deep learning is surprising. In his book, Professor Prince discussed the challenges of optimizing high dimensional loss functions and argued that the overparameterization and choice of activation function are the two most important factors that make
this tractable in deep networks. He showed that during training, the parameters move through a low dimensional subspace to a family of connected global minima, and that local minima are not apparent. So as we overparameterize these models, generalization increases, but it's also related to other things like the flatness of the minimum and inductive priors. It appears that both a large number of parameters and multiple network layers are required for good generalization, although we do not yet know why. Many questions remain unanswered. We do not currently have any prescriptive theory that will allow us to predict the circumstances in which training and generalization will succeed or fail. We do not know the limits of learning in deep networks, or whether much more efficient models are possible. We do not know whether there are parameters that would generalize better within the same model.
The study of deep learning is often driven by empirical demonstrations, and Simon concedes that these are undeniably impressive, but they are not yet matched by our understanding of deep learning mechanisms. On ethics, Simon said that it would be irresponsible to write this book without discussing the ethical implications of artificial intelligence. This potent technology will change the world in ways arguably not too dissimilar to electricity or
the internal combustion engine, the transistor, or the internet. The potential benefits in health care, design, entertainment, transport, education and almost every area of commerce are enormous. However, scientists and engineers are often unrealistically optimistic about the outcomes of their work, and the potential for harm is just as great. Simon argues that everyone studying or researching, or even writing books about artificial intelligence
should contemplate to what degree scientists are accountable for the uses of their technology. He said that we should consider that capitalism primarily drives the development of AI, and that legal advances and deployment for social good are likely to lag significantly behind. We should reflect on whether it's possible, as scientists and engineers, to control progress in this field and to reduce the potential for harm. We should consider what kind of organizations we are prepared to
work for. How serious are they in their commitment to reducing the potential harms of AI? Are they simply ethics washing to reduce reputational risk, or do they actually implement mechanisms to halt ethically suspect projects? Simon invites readers of his book to investigate these issues further. It's undeniable that artificial intelligence will radically change society, for better or worse. However, optimistic visions of a future utopian society driven by AI should be met with caution and a
healthy dose of critical reflection. Many of the touted benefits of AI are beneficial only in certain contexts, and only to a subset of society. Now, the book cites green 2019, who highlighted that one project developed using AI to enhance police accountability and alternatives to incarceration, and another developed to increase security through predictive policing, are both advertised as AI for social good. In big air quotes, assigning this label is a value judgment that
lacks any grounding principles. One community's good is another's harm. Ethical AI is a collective action problem, and the chapter concludes with an appeal to scientists to consider the moral and ethical implications of their work. Every ethical issue is not within the control of every individual computer scientist. However, this does not imply that researchers have no responsibility whatsoever to consider and mitigate where they can the potential misuse of the systems they create.
We scuba dive, you know, we we we actually do stuff. And again, maybe I'm just being a human chauvinist, but I'm completely on board with it becoming embedded in our cognitive ecosystem. But also GPT does stuff not very well, but it does it. Well does it though I don't know. Does it do something mean. Yeah. Like in the in the way a cat flap does stuff. You know, you can you can make it do things that can execute code and so on. But I wouldn't say it has agency.
Hello everyone, its Tim here from MLC your go to channel and podcast for all things machine learning, AI and philosophy. Today I'm reaching out with a special request. As you know, creating content for MLC takes a considerable amount of time and resources. It's a labor of love that I do purely for the fun and passion of the subject. Um, but to keep bringing you the high quality content that you've come to expect, I need your support. Please consider supporting us on Patreon. Every bit helps, although please only donate what is an insignificant amount of money depending on your situation. If you can't afford it, just let me know and I will give you free access to the Patreons benefits, no questions asked. Anyway, thank you so much for your time and I can't wait to welcome you to our Patreon family! Signing off for now. Cheers, Simon. It's an absolute honor to meet you. Welcome to Machine Learning Street Talk. I'm very glad to be here.
So, um, tell us about yourself. Uh, well, I actually started my career in psychology. My PhD is in psychology. And then I've been wandering through various parts of science. I worked in neuroscience for a while. I did some early work in augmented reality. I dabbled in medical imaging in the noughties. I was faculty at UCL and I worked on computer vision, and I'm probably best known for a book that I wrote at that time. And in the last decade I've mainly been working in industry, in finance and computer graphics, and I'm currently a professor at the University of Bath, where I have been working on a new book, Understanding Deep Learning, which is going to be published by MIT press. Sorry, I should say which is published, which is. Well, um, Simon, we were joking before that. Um, on your last book, you were ubered and you were writing a book about computer vision and probabilistic graphical models and so on.
And then that was that Sutskever guy will come back to him later. Um, well, it wasn't him, actually. It was, uh krichevsky. But they all they're all basically Hinton's, uh, guys. They released AlexNet, didn't they? And then that was computer vision. Completely solved. Right? So my last book was a really ambitious attempt to basically remold the whole of computer vision, as I saw it, by formulating what was quite an ad hoc selection of methods in terms of probabilistic graphical models, which wasn't at the time necessarily how everybody thought about it. And on in 2010, I went on sabbatical to the University of Toronto, and I worked on this book, probably with Alex Krizhevsky in the next room to me and and sharing an office with Geoff Hinton's postdoc, uh, doggedly worked on this book. I released it in 2012, a few months before AlexNet came out, and the entire field took a, uh, right angle turn, uh, leaving my book in the dust. Although I still think it's quite useful.
The geometry and stuff is still definitely all valid, and it has a lot of stuff on Bayesian probability, but this book is less ambitious. It's a more sort of straightforward description of where we are, uh, with deep learning, uh, it's supposed to be the spiritual successor to Goodfellow, Bengio and Courville. Oh, yes, which was published in 2016. So obviously a lot of stuff has happened since then. Um, it takes a sort of pragmatic middle ground between, uh, uh,
very theoretical stuff with lots of proofs and very practical stuff with lots of code. There are no proofs, there is no code. Uh, it's about the ideas that drive deep learning. Okay, so, um, Simon, when you started writing this book, what was the main idea that you had in your mind? Well, I think the history of deep learning is that experimentalists have run far ahead of the theory. And, um, we now have this explosion of papers where there is literally an exponential increase in the
number of papers being published. And when I say literally, I mean literally, there is a plot in a paper that came out last year where on Semi-log Y, it is a straight line with 4000 papers being pushed to arXiv every month. Uh, and presumably there's more than that now. Obviously, it can't increase exponentially forever. There's a finite number of humans on the planet. They can't all do machine learning research. So there's a staggering quantity of information out there. If you, uh, new person coming to machine learning or you want to learn something new, it's almost impossible to find good resources. People are learning things from blogs that are written hastily by people who don't always know what they're talking about. And so it seemed to me, uh, a really useful thing I could do for the community where I could write out everything pretty much important that's happened in the
last ten years, connected to deep learning with the same notation illustrated in a modern way, without regard for history. I don't start at. Perceptron. I jump right in to deep neural networks and, you know, 20 pages into the book, not 160 pages. Um, just to save collectively the community a giant amount of time. Yes. And do you think that deep learning is alchemy? Uh, no, it's not alchemy at all. I think in the future, what we'll think of it as is the
science of modeling functions and probability distributions in very high dimensions. I mean, I think it'll be recast as that in terms of science at the moment we're more concerned. The way we organize our whole community is about results. So we don't really talk about it that way. Uh, but I think in 40 years time they'll look back and say, well, in the 20 tens, they studied how to build functions and how to model probability distributions in dimensions that are higher than, say, 50. Yeah. So I was tongue in cheek on the alchemy point, but I guess number one, people have made some strange analogies to neuroscience and biology. Even even the word neuron actually is quite interesting. So it only appears four times in your entire book. And two of those occasions you are counseling us not to use the word neuron. So let's start with that. Yeah. And I should say I will probably accidentally use the neuron during this conversation because it's so embedded in our community.
But I think it's a terrible analogy. Um, there's no evidence the brain works in any way that deep neural networks do. Um, if you look at the sort of epiphenomena of the brain, you know, of human computation, we seem to have things like short tum memory. We seem to need to dream to lay down memories. We have, uh, modular brain with special parts for recognizing faces, for navigating through the world and so on. There's no evidence that deep learning has any of that.
And likewise, there's no evidence that the brain has any of the epiphenomena of, uh, deep learning. So, you know, there's no evidence for double descent or adversarial examples or lottery tickets in the brain, as far as I'm aware. Um, and this is sort of okay for our community because we know what we're talking about. But now deep learning is becoming a really important thing in the real world. And so we're trying to communicate this to the general public, and we're talking about neurons and neural networks, and that carries with it a lot of baggage. You know, if you an interesting experiment that everybody watching this should do is go and talk to somebody at a dinner party who knows nothing very much about AI, who works, you know, a lawyer, someone intelligent, who works in a completely different field and asks them what their understanding of current AI is. And almost certainly the answer you will get is that they have no idea.
They might be able to give you a couple of buzzwords, but how does it work? They have no idea. And I really disapprove of the neural metaphor just because it comes with a lot of baggage. That sort of implies, perhaps, that the networks having thoughts or that it's something like us, and that's deeply misleading to people who are outside our community. And of course, everything we're doing is increasingly affecting those people outside our community, and we want to give them sensible information about what it is that we're working on. Yeah. So I mean, again, on on the alchemy point, we are now dealing with multiple levels of emergence. And what I mean by that is people understand gradient optimization. They understand parameterized models, they don't understand the emergent phenomena, and they reach for analogies, let's say psychology analogies. You know, they talk about things like theory of mind. I'm not completely convinced
there are emergent phenomena depending on exactly how you define emergent phenomena. For me, an emergent and emergent phenomenon would be something where you gradually ramped up the scale and there was suddenly a phase change where you could see new, uh, uh, phenomena. I suppose, for want of a better word, suddenly appear with scale. And I'm not sure we've done those experiments super thoroughly. What you're really saying to me is that the statistics of the data on the internet are surprisingly rich, that such that we can, uh, you know, complete sentences or translate from one language to another, uh, all of that is just reflecting the statistics that are on the internet. And it is surprising that when you gather that much data and put it together in a network and reproduce those statistics, we see these phenomena. But I don't see that as a property of the network.
I see that a property as a property of the data that we're putting into the network, whether. It came from the richness of the statistics or not. I think we are looking for mental reference frames to understand said phenomena. It's just we need a way to understand this stuff. Right. And psychology has a theory of mind literature that we can. That we can use, and we are almost certainly overloading it and bastardizing it. But are you saying we shouldn't do that? I have the most reductionist view of this possible, I think, of when I see a large language model. I see an enormous equation with trillions of terms in it, and we've set the parameters of those terms so it performs some kind of behavior. And I don't think there's any great meaning to that behavior. Um, it's an equation. There are inputs. You compute, you add things, you multiply things. Occasionally. If it's a transformer, you take an exponential. Yeah. Um, and out comes some numbers on the other end that you then
translate into words. And I don't think it can be understood on any deeper level than that. But couldn't you make the argument then, that there's nothing special about our mental states or our behavior because we are also, at some level, just performing simple calculations? I think you could make that argument, but there's more going on because we have a more, uh, a larger variety of brain systems interacting with each other, uh, some of which have been built on top of each other during evolution. So there's more structure in the actual model. You know, it's not it's very least the human brain is not one equation. It's a bunch of equations interacting with each other in a complicated way. So, um, whether that maps to the kind of constructs you're talking about, I don't know, but I see the human brain as being quite a different thing to that. It's mostly a matter of complexity. So when you have this rich kind
of functional dynamics of things interacting in the physical world, you have the emergence of agency and all sorts of moral status and so on. And you're basically just making the statement that in neural networks, we're just nowhere near to that kind of emergence. I mean, you're asking me questions that nobody knows the answer to. The only the only existing model we have that works is the human mind. And that seems to work upon quite different principles than just scale. Yes. Um, I think something that's very interesting about Transformers, though, is I was arguing before that I don't like this neuron analogy, but actually, um, the large language models like ChatGPT are the closest thing we have to, um, something like the human brain, because they don't they do, just as I expressed, map an input to an output. But they also have this kind of short tum memory, which is the context window. So in a sense,
and it's ironic that we don't refer to that in terms of neural analogy, because that to me is the first thing we've built that sort of looks something like the human mind. You have this context and it makes the next, uh, prediction of the token based on that context. And in principle, um, you could then operate on the previous context that, you know, the system itself could operate on the previous context, it could summarize it, it could file things away. It could, uh, ask itself to generate other, you know, different hypotheses to explain something and compare them and decide on something and use that as a sort of scratch memory in the same way that we have a working memory. But strangely, we don't refer to that in terms of the neural analogy, which I find, uh, quite ironic. I don't know if people are working on that kind of thing. I seem that people are working on everything, but I haven't personally
read any work in which the, uh, transformer system goes back and edits things in its past context. Yes. Um, but I assume that that would be one direction that you might go to try and make this system do something that's more like thinking. I mean, in the end, a purely feedforward system can't really do anything sophisticated. You need probably to be doing some kind of manipulation, if only to generate internal consistency. So there's no way a large language model can have internal consistency.
It's learned everything on the internet. It thinks that the Earth is both flat and round with different statistical proportions. Uh, you know, hopefully mostly most people on the internet think it's round, and that's the conclusion it's come to. But in the weight somewhere is Earth flatness. And so to get to another level of cognition, you're going to need something that builds an internally consistent model of what's out there, whether that needs,
as you might argue, uh, interaction with the real world or whether that can be done purely in the domain of language remains to be seen. But I think that might be one direction that people would take things. You know, the body of knowledge of humans is a kind of virtual phenomenon that supervenes on all of us physical earthlings. So, you know, like this, this, this infosphere that we've created, it's like a symbiotic organ. ISM, and that has consistent artifacts of knowledge, as you said.
But many humans do hold the view that the Earth is flat. So it's just another example of this interesting kind of like levels of, of emergence. But they they hold an internally consistent view that the world is flat. They I mean, as far as they're concerned, it's internally consistent. Obviously there are inconsistencies that are quite easily proven. But um, within their mind, they explain they have a model of the world that whereby they explain everything. Well, if the moon is flat, well, obviously the sun must be flat as well, and so must, um, and, and you know, when you look at the horizon of the sea, it looks flat, and consequently, the earth can't be round. You know, they explain away other phenomena and build up a model that backs up their hypothesis. And there's no sense that transformer system is doing anything like that. It just starts at the beginning and predicts the next word and has the statistics. Um, uh, that are consistent with what's previously in its context
window. Yes. You could argue. Though, that, um, humans, our brains are also very chaotic, but we have this confabulation and post hoc rationalization in much the same way. So we, you know, subconsciously we hold conflicting views. But when we try and explain our views and to avoid cognitive dissonance, we kind of we try and reduce what we think to something simple. Right? But we have a finite number of views that are sort of partially rounded theories of the world. Yes, the large language model has everything that humanity's ever created with no preference for one thing or another other than its statistical likeliness. So yes. Yes. So that's still, you know, even if you have multiple conflicting views of the world, you know, there's that famous Walt Whitman poem where he says, do I contradict myself? Very well, I contradict myself, I am multitudes, I am large, you know
that that is human beings captured. Um, but we don't have every view on everything simultaneously. We're trying on some level to come up with, uh, consistent models of the world. And we need to do that because we need to take actions in the world. And it's impossible to do that if, uh, if you have 50,000 conflicting views of how things work. And this is really interesting because Hinton says one of the reasons why ChatGPT is a kind of superintelligence is because it knows all of the things. But I would argue, as you just did, I think that we are kind of bounded as observers as there's a computational, um, kind of restriction to how many things a single observer can understand at one time. And we'll get more into this later. But I think with cognition, it's not just knowing, it's also thinking. So just knowing everything isn't actually the whole piece is it? Yeah. Can you deduce new facts? I think in one of your other podcasts you talked about, if you trained
ChatGPT with data only up to, you know, the early 20th century, would it be able to reproduce the, um, Einstein's theory of relativity? I think we all know the answer to that. It wouldn't. Definitely not. And what are the missing pieces? But one? You know what that's getting at? What I was saying before, it's true to to to build that theory, you need to have a model of the world. And you need to realize that model of the world is wrong, that certain facts. I don't personally believe. You need to observe those facts yourself, but certain facts are inconsistent with that theory. And then you need to somehow come up with a new model that itself will make new predictions about the world that people can go and test in the case of physics. But but I think that happens on a sort of more minor scale, you know, with your theory about how businesses work or how your friend's personality works and how best to interact with them. You know,
you have theories about everything, uh, that occasionally break, and you have to radically rethink them. From a computational point of view, they are finite state automata. I mean, you're saying any finite entity can only can compute certain things by nature of the fact that it's finite and eloquently put. Of course, that is true, but I'm not sure that that's a radical insight. I mean, what would be interesting is if we had some way to characterize what kind of things you could compute
with a certain degree of number of parameters or what have you. But as far as I know, we don't really know the space of functions between input and output. We can fully describe, given a fixed set of parameters and a certain neural network architecture, um, or what lies outside that, because you're building this very complicated surface in multi-dimensional space and everything's dependent on everything else. So it's not really obvious, but it
seems it's very rich in that we give it almost any data set we want, and with enough capacity it can fit it. Well, I think we're just about to put the pin in the middle of the dartboard here, which is that, and we'll talk about universal function approximation later, which is that given an infinite number of, um, neurons, you can approximate a function to arbitrary precision. That's a little bit like saying, if I have an infinite size hard drive, I can, you know, store any file that I want to. So the big discussion between connectionist and symbolic folks is the symbolic folks argue that we do need an infinite amount of computation for many things. Neural networks have told us that in many cases, no, we don't. And then I guess it's just about, well, are there boundary cases where we do need an infinite amount of computation? I mean, you know, an interesting question you're asking a different way is are there ideas that the human mind can never grasp.
Or indeed that we can grasp that a neural network can't? Oh, yeah. Um, Simon, we've now teleported to our studio. We were just outside, freezing. Freezing ourselves to death. It is much warmer and less muddy in your studio. Indeed it is. Um, so, Simon, we'll get straight to the chaser. I've been reading your your amazing new book on deep learning, and I think we should start by talking about the first few chapters, really, and in particular chapter three and four, where you talk about not only neural networks, both, you know, deep neural networks and just,
um, single layer neural networks, but there's this kind of elephant in the room. In general, I feel about neural networks, which is why do they work so well, you know, the unreasonable effectiveness of neural networks. Why do they work so well? Uh, well, the good news is they do work really well. I mean, if you've been asleep for the last, uh, 11 years or so, um, uh, they're incredibly effective. Um, but it is a bit of a mystery, and I think it's particularly interesting to look at it from the perspective of just before AlexNet came out. So ImageNet at that time would have been considered a real stretch goal. Richard Solecki wrote in the computer Vision book he published around that time that he expected it to be years and years before computers could see, to see, as well as a 2 or 3 year old. Um, and so ImageNet is a challenging task. The input dimensions 2 to 4 by 2 to 4 image. That gives you roughly 150,000,
uh, dimensional space. Uh, so there's roughly, you know, it works out as roughly ten to the 150,000 possible images. You might say, okay, well, most of those images are noise, but presumably the actual manifold of images is still extremely large. Um, and you've got to build a model that maps this to one of a thousand classes, and you only have a million examples in this, ten to the 150,000 dimensional space. And for each of those classes, you only have 1000, uh, possible examples.
So you can't even build a Gaussian for each class in that case. So if you didn't know that humans could do this task, you might even just give up. But since we knew humans could do this task, people persevered. Um, and AlexNet set out on this extremely ambitious program that was completely different from what most people were doing at the time. Um, I know that there's arguably some predecessors I don't want to get into that. I will talk about AlexNet, and you can judge for yourself whether it's
the right thing to talk about. Um. Um, so AlexNet sets out to build a neural net with 60 million parameters, several orders of magnitude larger than most of the computer vision models that would have been built at the time. And the way that I think about neural networks is they divide the input space into convex polytopes, each of which has a linear or more properly affine function within it. So, uh, if the dimension input space is two dimensional, then it divides
the input space into convex polygons, and each polygon is a sort of plane. And those planes are organized so they make a continuous surface. But now we've got um, 150,000 input dimensions. So you're in very high dimensions. And we've got this. Incredibly, our model makes this incredibly complicated surface, and it's difficult to count the number of these polytopes it creates. But, uh, just the fully connected layers at the end would make of the order of, you know, ten to the 4000. So you've got this huge space, you've got a model with 60 million parameters that creates a number full of, uh, regions far larger than the number of, um, atoms in the universe. None of, you know, hardly any of those regions are ever going to see a training data point or a. Test data point at any point during training. Um, and there's some super complicated relationship where you tweak one of your 60 million
parameters and these much larger number of polytopes, uh, change and manipulated in some very complicated, indirect way. That's difficult to characterize. Um, so now you come along and say, okay, I'm just going to do a 60 million dimensional optimization problem. At that time in computer vision, you know, people were considered ambitious. If they were doing thousand dimensional optimization problems, they, um, you know, typically the biggest kind of problems would have been structure from motion problems. So you would probably try and find the solution in closed form and approximate solution, and then just use the nonlinear optimization. You're really somewhere near the local, the global minimum. And you're just going to find use optimization to get to the final place. But they're going to start by just randomly initializing this network and then using the dumbest algorithm, basically noisy gradient descent
to get to the bottom. Uh, because you can't use anything else because everything else uses second order information. And now the number of parameters is to enormous and so disaster. It does sound like a disaster. I don't think many people would have predicted you could even learn the model. But one thing they have in their favor, and we can come back to this in a bit, is arguably there are far more parameters in their model than there are data points. So it's over parameterized. And perhaps that makes the fitting easier. And there's a subtlety there that we can come back to. Yeah. Um, so okay, they fit the model. But as I said, there's, uh, 60 times more parameters than there are data points. So the surface they fit basically goes through every data point. Exactly. But for every data point it goes through, it can do 60 other things. It has 60 more degrees of freedom. So between those data points, which, as we've discussed, is almost
the entire of the space, it has latitude to do whatever it wanted. And actually they had applied some regularization and some dropout. But subsequently we found that those aren't really critical to this. So, uh, at the time, you might have explained it away with that, but since then, we know we can learn models without dropout and without regularization, and they still generalize reasonably well. Yeah. Um, and somehow this model performs 15% better than the next best thing or whatever. It was quite surprising. I mean, jaw dropping really. Um, yeah. Well, so let's do a point of order just on that then. So first of all, I'm a huge fan of this view of neural networks that you've just spoken about, which is that essentially it slices and dices the ambient space into these locally affine polyhedra. And Randall Balestrero, um, came up with this spline theory of neural networks. And folks should watch the first Laocoon show where we spoke about
that in detail and what you basically said was that for a given input example, the neural network can be represented with a single affine transformation, which is surprising to a lot of people for two reasons. First of all, people think of neural networks as being, you know, non nonlinear. And also it it gives this beautiful intuition of neural networks as being a collection of storage buckets, not too dissimilar to a locality sensitive hashing table. And I think that's very instructive. Right.
And so I wrote this book blissfully unaware of that theory, I should say. But that's pretty much exactly how I describe it in this kind of simple, constructive way. How do we combine together these networks? We should say that this is only true for relu's and leaky relu's and parametric relu's. If you have smoother functions, then you can no longer characterize it in this way. But actually I like discussing it in terms of relu's, because then the number of output regions gives you some notion of the complexity of the output surface. Whereas once you start talking about smooth functions, it's much more hard to characterize that. Um. But it's kind of locally smooth because because I guess for the folks at home, every single one of these neurons will, you know, maybe come back to that. It's kind of like a hyperplane. And so you have you train the network and you move all of these hyperplanes around in the ambient space.
And essentially when you put an input in, it's kind of activating some of those hyperplanes. And it's creating this kind of convex region. Right. According to which hidden units are active or not active. Yes. And even though these are piecewise linear functions, there are so many of them kind of like, you know, densely overlapping each other in space. They appear locally smooth. Uh, presumably. Um, well, we can plot, like, one dimensional plots through the function and see that it looks like, and, uh, what it looks like. And of course it does. Look smooth because of the sheer number of them. Right. But but then we get to the next interesting bit, which is, you know, so you spoke about Overparameterization and, you know, like, um, finger in the air. Let's say that there's an exponential number of these convex polyhedra, you know, something along the lines of, I think you said two to the power of the number of, of dimensions. And um, well. Generally it will be more than that.
I was trying to get a lower bound that nobody could disagree with. But, but. But this gets to the fascinating thing. So, um, traditionally before neural networks, the world was different. And we used to talk about the curse of dimensionality. And that's basically this statement that, um, there is an exponential relationship between the volume of the space and the number of dimensions. So, yeah, I would say it's the tendency of the volume of space to completely dwarf the amount of data you have as the number of dimensions goes up. Exactly. So when when the volume of the space does increase exponentially, the statistical significance of your training data kind of tends towards zero. So there is no statistical information anymore. Which begs the question if there's no statistical information, how do the networks work? And now we're getting to the difficult part. Why does it generalize in any way?
It's, um, uh, it's clear that it can pass through every data point. Um, but what it does between the data points is, I mean, in some ways, almost happenstance is a byproduct of our algorithms. Uh, it makes some smooth interpolation. Why, that's a good smooth interpolation. We don't know why it even becomes smooth. We don't know. It seems like it's some complicated byproduct of the way we initialize the neural networks, the noisy algorithms we use to train the neural networks, the overparameterization itself, you know, perhaps, uh, what the kind of thing that might be going on is we wind up with smooth networks that interpolate just because we overparameterized so much that that, um, uh, when we set up our networks,
we initialize them. And the wider they are, the smaller numbers we put in and the numbers start small and they stay small because it never has any impulse to make them larger. And because the numbers in the network have small magnitudes that basically maps to small slopes. I wanted to slightly come back to the Overparameterized thing as well, because, um, it's not totally obvious to me that everything is clearly overparameterized. So while AlexNet had, uh, 60 million parameters and 1 million training points, they also augmented their data by a factor of 2048. And if you look at all of the papers pretty much on, uh, this ImageNet classification problem, they're all sort of over parametrized by the best results from the last ten years by sort of 10 to 100 times. But they also all augment the data, which muddies the water. So it's.

Ask anything
We've read this whole study set, so questions about it get the best answers.