Hello and welcome to the NVIDIA AI Podcast.
I'm your host, Noah Kravitz. In the spring of 2019, a paper published at the ICLR conference detailed what the MIT Technology Review called a simple but dramatic discovery. we've been using neural networks far bigger than we actually need.
In some cases, they're 10 or even 100 times bigger.
So training them costs us orders of magnitude more time and computational power than necessary.
Our guest today co-authored that paper, which is the subject of a GTC digital talk that he recorded for this year's online conference.
Deep Dive with Jonathan Frankel. The Lottery Ticket Hypothesis.
Finding sparse, trainable neural networks.
Jonathan Frankel is a PhD student at MIT, where he researches AI and machine learning.
And in the other half of his life, he travels the country and world working on technology policy around AI with policymakers, which we'll also talk about today.
Jonathan, thanks so much for making the time to join the NVIDIA AI podcast.
Thanks so much for having me. So let's start with the lottery ticket hypothesis.
Can you tell us about it? Definitely. So really the way that I think about it is that it generalizes a lot of experimental results that I have and tries to put them in a more forward-looking way.
So let me take a step back and tell you about what those results are.
And actually, let me take another step back and simply tell you about the big picture and what we were trying to do here.
Perfect place to start. We know that neural networks are exceedingly large, and I can give you lots of different examples of this.
We usually measure the size of a neural network in the number of parameters it has.
Each parameter is a single number that goes into the statistical model and is used for computation.
And a small model might have millions of parameters.
And these days, a lot of the largest models we tend to use for things like natural language processing might have billions of parameters.
And when we get into the billions of parameters, these models are very expensive to use and to train.
A billion parameter model is not going to run on your cell phone, for example.
And even to train a billion parameter model or above is going to cost you tens or hundreds of thousands of dollars.
Now this has been a problem for a long time.
This isn't a 2019 or a 2020 problem. This was a 1989 problem.
This was a 2005 problem, neural nets have always been really large for whatever computation we've had.
So Back in the late 80s, and these ideas go back to before I was born, some folks invented this thing called neural network pruning.
And the idea is really simple. what if we just try to find which parameters in the network might not be doing much and delete them and try to make the network smaller.
And, This works really well. This has been known for decades.
There's a great survey on pruning techniques that came out again before I was born and another great couple of papers out in the past few years.
But the key idea is that for a typical neural network, once you've trained it, you can remove 90% or more of the parameters or each parameter is kind of, you can think of it as a connection in the network without any change in the accuracy of the network.
This is awesome. This is being used actively to get networks onto your devices today.
It's a decades-old idea and technique, as you say.
How widely is this being used? Is it something that's being used, but we just have lots of headroom to improve, or is something that's not so widely adopted.
So this is quite widely adopted. It's hard for me to say with certainty, simply because I don't have visibility into what's going on in industry.
There are a couple of different ways of making neural networks smaller, pruning being one of the big ones.
And pretty much any neural network that's being used in practice today has been compressed in some way.
Right, okay. We know that once you've trained a neural network, it's way bigger than it has to be, right?
Otherwise, the screening stuff wouldn't work.
So the natural question to ask is, What about, could you have just trained a smaller network?
Like, why didn't you start with something smaller?
I think that's the natural question anybody asks when I show them how much it costs to train a neural network today.
And it doesn't matter whether you're buying the hardware, whether you're using any of the cloud providers, It's an expensive proposition to run a research group doing neural networks or to run a business that uses neural networks.
So wouldn't it be exciting if we could just train smaller networks?
Sure. And a lot of people see the pruning results and they say, well, doesn't that mean we can just train smaller networks from the beginning?
And the answer is no. That was the answer until 2019.
Okay. So here, here's an experiment. Here's I'm a big believer in. dealing with machine learning scientifically.
And so every time I have a question, I answer it with an experiment.
And the experiment tells us the answer. So let me give you an experiment and I'm going to ask you what you think is going to happen.
Let's say that I take my big neural network and I train it to completion and then I prune it.
I remove a bunch of connections. Mm-hmm.
This gives me some smaller neural network.
What if I were to go back to the very beginning and take that smaller network and try training it on the same data set on the same task.
What do you think my performance is gonna look like?
Oh, I'm gonna say not as good. You're not gonna do as well.
Exactly right. And you don't have to trust me on that.
There are a couple of papers that came out, you know, 2015, 2016, 2017.
This is an obvious thing to do when they tried it and it doesn't work as well.
And why is that? This is a great question.
Let me give you an analogy. So we can think of the process of pruning as saying, once you've learned something, And you can think of learning calculus, learning math, learning any concept.
The actual space that it takes to represent your knowledge can become relatively small.
But it might take you a lot of brain power, a lot of capacity to actually do the process of learning that idea.
It's really hard to learn something, but once you've kind of synthesized and made sense of it, it's easier to remember and keep track of.
And so the going thinking was that maybe this was kind of how neural networks work. that during the learning process, it takes a lot of capacity.
You're learning, you're processing, there's some intermediate representation going on.
But once you've gotten to the end of the training process, the neural network has come to some kind of concise, simple, representation of whatever it's learned, and then you can remove a lot of stuff.
But if you remove that stuff in the beginning, it won't have the brainpower necessary to do whatever synthesis is required to get to that simpler representation.
Right, right. That was the going and thinking.
And in fact, I... When I was first getting into deep learning, and this is the first deep learning project I ever did, I asked this question to a very distinguished professor at MIT.
Because I was curious, and that was basically the answer he gave me, that that was kind of the going thinking.
That maybe it takes a lot of capacity to learn, but not a lot to represent. but it turns out that maybe that's not so true.
And so this is where I can finally answer your original question about what is this lottery ticket hypothesis idea?
Yeah. To do that, I need to tell you one more thing about neural networks.
So when you create a neural network, It's not just about the architecture.
It's not just about how all the connections are configured.
It's also about how you initialize them.
What does it even mean to optimize a neural network?
So you start off with this configuration and you set each connection to a random value and you sample that random value from some smart looking distribution.
But in the end, you know, you're just starting with kind of a bit of a blank canvas.
And the process of training a neural network is the process of optimizing the values of each of those parameters such that they become something meaningful and they become something, in fact, that represents a function that's useful to us, like how to classify cats and dogs.
But the important part is that at the beginning, they're all random.
And when I described that experiment before that didn't work, there's one important caveat.
You take the pruned architecture And you give each connection a new random value and then try training that and it doesn't work.
The lottery ticket idea was asking the question, well, what if the random values you got at the beginning of training were actually really important?
What if those specific values that were assigned to each connection really mattered?
What if for the connections that you didn't prune, they got lucky random values at the beginning that made them important.
If we select new random values, then maybe they won't be important anymore.
And we'll end up with a smaller network where we've lost some of the magic of that original initialization.
Right. So again, this is a hypothesis. This is the lottery ticket hypothesis.
That when you started with a big neural network, you actually had a much smaller network that got a lucky initialization such that it could train really well when other small networks can't train very well.
They got unlucky initializations. And so this is an experiment you can try.
So here's the idea. I take my network and I train it just like usual.
I prune it just like usual. And then I try to train that pruned network, but I give each connection that survived pruning the exact same initialization it had from the beginning of training.
So I try to see, retroactively, could this smaller network have learned?
This is all retroactive. And the answer in this original paper was yes. it could learn.
And in fact, it learned much better than if you were to reinitialize it or if you were to just pick some other random small network.
So there was something not only special about this smaller network, that you got from pruning, but also something special about its initialization.
I want to mention one caveat, just to make sure I'm not misleading anyone, that the These results hold for relatively small neural networks.
On larger neural networks, you can find this small network, not an initialization, but very early in training.
And that's a whole interesting conversation that would take an entire other hour.
Right, right. But I want to make sure that I'm completely clear and transparent about the limitations of this research.
I think a lot of people in machine learning and deep learning are all about the hype and it's important to make sure that folks understand what this can't do and where this doesn't work.
No, we like facts and science on the podcast.
So it's appreciated. May I make two quick comments on the hype?
Absolutely. I think comment number one is that this work has been dangerous because in some sense it has been picked up and carried by the hype in a lot of the reason why I'm so insistent on, mentioning the limitations and caveats at every possible opportunity, is that this work has been again, been picked up by the hype in a lot of, I think, dangerous ways.
I was new to deep learning when I wrote this paper and stuck it on archive.
I didn't quite realize that calling a paper the lottery ticket hypothesis and having some, I guess, provocative results on small-scale networks would quite lead to the amount of attention that the paper's gotten.
And it's been great for my career, but it's a sign of problems in the field.
And I've I strongly advocated in the time since that, you know, I don't think we should have best paper awards at our conferences in deep learning.
It only feeds the hype and creates a winner-take-all situation.
Of course, this paper got a Best Paper award, so I feel like I'm in a position to be able to say that.
I'm not bitter. I just think that this was bad for the community.
The other thing I'll say is that my approach to doing machine learning is that I like to treat this more like a natural science.
We have these interesting machines, creatures, however you want to describe these neural networks.
One way of coming at them is to run lots of experiments, try to propose hypotheses in the form of simplified models of their behavior. and evaluate them.
I like questions and I only try to make statements that I can support with empirical evidence or refute with empirical evidence.
And I like questions where the answer is to run a quick experiment.
Well said. Our guest today is Jonathan Frankel.
He is a PhD student at MIT. And the co-author of a paper we've been discussing, which is also the subject of a talk Jonathan recorded that's available as part of GTC Digital.
2020 online this year. It's called Deep Dive with Jonathan Frankel, The Lottery Ticket Hypothesis, Finding Sparse Trainable Neural Networks.
You've done work at some of the big names in the tech industry, Google, Facebook come to mind.
What have you been working on policy-wise and otherwise?
I tend to keep my technical life and my policy life as separate as possible.
The reason for that is really I thought about trying to do interdisciplinary work, but in my experience, interdisciplinary work is either not technical enough, not policy enough, or just not enough.
And so it's very hard to be useful to either community.
So instead I tend to do very hardcore, lottery ticket related work in my technical life and that's you know time i've spent at google and facebook and you know collaborations with lots of other folks at universities and an industry and In the policy world, it's continuing to collaborate with my colleagues at Georgetown.
I created and taught and have gone back to teach a programming for lawyers class at the law school there. to try to give some of that technical knowledge directly to law students who are emerging policymakers.
And I go around the world. I've been working with the OECD a lot lately. on their efforts to create a principles framework for trustworthy AI that was the basis for the G7's AI policy statement And is serving as a useful guiding document for AI policy implementation from the member countries around the world.
So you're really doing a lot of light, frivolous dabbling, it sounds like.
My spare time fun hobby is to do policy, except when I talk to policy audiences in which my spare time fun hobby is to do technical work.
To do hardcore technical work. I'll often be seen at policy conferences sitting on my laptop.
Other people are checking email alerts. browsing Reddit and I'm sitting there with four different terminals open running experiments.
Nice. It's important to me to kind of I think that if you're not on the technical ground in this subject, you get left behind so quickly and the hype becomes your source of information. to the point where I think a lot of quote unquote thought leaders in AI right now, it's been so long since they've trained a neural network that in some sense, a lot of what they say is very divorced from reality.
So it's important to me when I participate in these conversations to stay on the ground and know what's going on so that when I advise policymakers, I'm doing it with as clear a vision as possible.
Yeah, no, that's... Well, it is admirable.
I was trying to find a less cliche sounding word to use, but it really is.
And it sounds like... Sounds like you don't have a lot of down cycles in your own computational layer in your head, so to speak.
What are the, and I, if this is too big of a leap in the conversation, then, you know, back us up here and we'll go step by step.
What are kind of the implications of you running this hypothesis and finding that these initial weights were so important?
So there are, I think, three big implications.
There's kind of a non-implication that I want to mention upfront, which is that All this work is being done retroactively.
You have to train the entire network to go back and find the smaller network.
This is science, but The caveat that I remember putting in the original paper and that I put in big red and anytime I get this presentation is... you know, this is not immediately practically useful to you.
This doesn't say that you can find these subnetworks efficiently.
Right. So the first potential implication is, well, why don't we try finding these subnetworks efficiently?
This kind of starts a new contest to try to create better and better strategies for finding these sub-networks at initialization or early in training.
And that's exactly what's happened. a couple of fantastic papers published in the past year on exactly this topic.
And this is something that I'm actively starting to work on now.
Cool. The second implication is well, let's say it's really expensive to find this small network.
Now, what if I find this small network on one problem, but I want to reuse it a bunch of times in other problems?
So you can imagine that, you know, You're a large company and you get a new set of data every day, updated data from your users.
What if you find this small network based on the data from Wednesday?
And you use that small network on Thursday, Friday, Saturday, Sunday, Monday, Tuesday.
This is transfer learning in a sense. And there's a great paper from some colleagues at Facebook that that was in NeurIPS this past year that showed that actually these lottery tickets transfer between image tasks.
So if I find one of these on one particular image task, that same sub network will work on a lot of other different image tasks.
So it may be a lot of work to find it initially, but if you can amortize that cost by reusing it, then you've actually saved it alone.
That's great. So that's implication number two.
Okay. Implication number three, which I think gets back to what you were asking about is, maybe this tells us something about how to build better neural networks.
Maybe this tells us how, in some sense, the network wanted to be initialized and how it wanted to be architected.
So, you know, that research to me is the hardest part because how do you describe, it's hard to look at a bunch of these smaller networks and then try to generalize and say, well, here are the patterns we see.
Now let's try to create a neural network based on these patterns.
There's a paper from Uber AI in NeurIPS this past year that looked into some patterns about these initializations and found some interesting initial trends but nothing as of yet that was actionable for creating new networks that had better initializations.
And I can mention kind of, I said there were three implications, but there's actually a fourth that ended up showing up which is that this whole lottery ticket procedure where you train the network to completion, you prune it, you go back to earlier, and then you can retrain that network from earlier.
This is just another way of pruning a neural network, right?
It turns out, and we have a paper in iClear this past year on that subject, that this actually works better than the state of the art, or at least as well as the state of the art pruning strategies that have been out there.
So it turns out that this procedure we were doing for something completely different happens to also be a great way to prune your network.
I'm wondering, you mentioned you're writing a dissertation and that's your motivation as a student, so to speak.
How far along in the process are you And if I might ask you to look ahead, what do you see yourself doing once the dissertation is complete?
How are you going to keep afoot in both of these worlds?
Those are questions that I ask myself and my parents ask me and my advisor, to a lesser extent, asks me almost every day.
So I think those are great questions. I think the big challenge of anyone doing a PhD in machine learning right now is there's a wealth of great opportunities that come with enormous trade-offs.
The industry is obviously booming right now, but you may not be able to do the kind of pure research that you get to do in academia just because business goals are important when you're at a for-profit company.
On the other side, in academia right now, the amount of money that you need to run a large lab doing machine learning research is extraordinary.
I'm very grateful to my partners in industry who have sponsored my research thus far.
It's the kind of thing where we would never have had the financial resources to do this without a lot of help from folks in industry who have lent us resources or credits or whatever it may be at any given time.
So as I look forward to thinking about trying to run a lab myself, there's a lot of fundraising energy involved and that's very intimidating.
And then I have the added complication of having this dual interest in both policy and doing technical work, which finding a place where both interests are welcome is very tricky in academia.
You know, the advice I've been given quite frankly is don't think about policy until after you have tenure because nobody will value it.
And in industry, you know, you're it's hard to speak with the voice of independence when you come from a large technical organization, regardless of whether you are in fact speaking with the voice of independence.
So, You know, trade-offs abound, and I'm very lucky that my PhD has allowed me to kind of do all these things, and I'm enjoying the ride while I can.
Yes. Well, that's good. And I think for what it's worth, again, the fact that you're not just aware, but very sort of publicly aware and your awareness of these potential conflicts of interest and the importance of staying up on the science before going and trying to implement or advise on a policy. speaks well to your ability to balance those things going forward.
So from one podcast host to a man who's got his feet and... you know, most important and complicated areas of our time.
I think you're well suited to tackle the challenge.
Well, Jonathan, as you said, there's a whole nother podcast we could do several on some of the topics that you kind of touched upon, but we can't get into right now.
For folks who want to find out more about any of the work that you're doing or some of the things you've mentioned, your colleagues and places you work with are doing, There is obviously the GTC Digital session that you recorded.
Where else can people go online to learn more about your work?
I always tell people go read the papers for a couple of reasons.
I mean, number one, I like to do work that speaks for itself, and I don't like to do a lot of talking about the work.
Ironic to say on a podcast. I don't like to write blog posts because I hope that the paper is easy enough to read. that a blog post would just be repeating the paper.
And my parents are both lawyers and I have them read through these papers for copy editing and all sorts of other stuff.
And if they can understand them, then I figure, I hope a general purpose audience can.
And the other piece is that I will make a commitment on this podcast.
I'm working very hard to open source the latest generation of the code that I've used to write all of these papers.
I'm hoping in the next couple of weeks to have that out.
And I don't know when this podcast will air.
So hopefully by the time it does, the code will be out.
Oh, very cool. Well, we're recording at the very end of March 2020.
So as a timestamp for people, that's excellent.
Feel free to send me a nasty email. We'll follow up.
We'll have you back on the pod just to yell at you for half an hour.
We like to end on kind of a forward-looking note and asking guests, you know, where do you see your work headed in the next couple of years, next five years?
That seems like a tall order and a very...
Big question. So feel free, if you can, to maybe hone in on one slice of your life or go for it all at once.
But Where do you see... Let's look at the lottery ticket hypothesis and the work of pruning networks and the size of networks and such.
Do you have an inkling as to where... where this work and similar work your colleagues are doing might be taking things over the next whatever period of time?
Let me say something that might sound a little bit controversial, which I know you'll enjoy, which is that I hope that in five years, Nobody talks about the lottery ticket hypothesis.
I hope that it is gone. I hope that it is wiped off the face of the earth because We know nothing about neural networks and how they operate.
Our understanding is so incredibly primitive right now. that we don't know what we're doing.
And my hope is that in five years we have some very robust frameworks for understanding how neural networks learn, why they seem to work so well, where they fail, how we can make them better.
And my hope is that the lottery ticket hypothesis will, you know, for those who read it for fun, be looked back upon as one of those simplistic ideas You can pick your history of science topic.
Maybe it's the ether idea that existed pre-Einstein.
Take your pick. But some primitive idea that was wrong or that was oversimplified or that had some kernel of truth but was along the path but not very far along. towards some mature understanding that we don't yet have.
So again, to say it succinctly, I hope that nobody's talking about the lottery ticket hypothesis in five years because we actually know what we're talking about.
Love it. Jonathan Frankel, thank you so much for taking the time to join us and to talk about your work, which is totally understandable.
It's not... what you like to do, but it is part of getting it out there.
And I will say to people, I read the paper before doing this podcast.
And as far as these kinds of papers go, it is... eminently readable.
So go check it out. Jonathan, thank you and the best of luck in all the work you're doing on both sides of the fence.
Thank you so much. Thank you for having me.
Thank you. ¶¶