The following is a conversation with Yann LeCun. He's considered to be one of the fathers of deep learning, which if you've been hiding under a rock, is the recent revolution in AI that has captivated the world with the possibility of what machines can learn from data. He's a professor at New York University, a vice president and chief AI scientist at Facebook, and co-recipient of the Turing Award for his work on deep learning. He's probably best known as the founding father of convolutional neural networks, in particular their application to optical character recognition and the famed MNIST dataset. He is also an outspoken personality, unafraid to speak his mind in a distinctive French accent and explore provocative ideas both in the rigorous medium of academic research and the somewhat less rigorous medium of Twitter and Facebook. This is the Artificial Intelligence Podcast. If you enjoy it, subscribe on YouTube, give it five stars on iTunes, support it on Patreon, or simply connect with me on Twitter at Lex Fridman, spelled F-R-I-D-M-A-N. And now, here's my conversation with Yann LeCun.
You said that 2001: A Space Odyssey is one of your favorite movies. HAL 9000 decides to get rid of the astronauts, for people who haven't seen the movie, spoiler alert, because he believes that the astronauts will interfere with the mission. Do you see HAL as flawed in some fundamental way, or even evil, or did he do the right thing?
Neither. There's no notion of evil in that context other than the fact that people die. But it was an example of what people call value misalignment. You give an objective to a machine and the machine strives to achieve this objective, and if you don't put any constraints on this objective, like don't kill people and don't do things like this, the machine, given the power, will do stupid things just to achieve this objective or damaging things to achieve this objective. It's a little bit like, we are used to this in the context of human society. We put in place laws to prevent people from doing bad things because spontaneously they would do those bad things, right? So we have to shape their cost function, their objective function, if you want, through laws and education, obviously, to sort of correct for those.
So maybe just pushing a little further on that point, HAL, there's a mission, there's this fuzziness, this ambiguity around what the actual mission is, but do you think that there will be a time from a utilitarian perspective where an AI system, where it is not misalignment, where it is alignment for the greater good of society, that an AI system will make decisions that are difficult?
Well, that's the trick. Eventually we'll have to figure out how to do this, and again we're not starting from scratch because we've been doing this with humans for millennia. So designing objective functions for people is something that we know how to do, and we don't do it by programming things, although the legal code is called code. That tells you something, and it's actually the design of an objective function. That's really what legal code is, right? It tells you here is what you can do, here is what you can't do. If you do it, you pay that much. That's an objective function. So there is this idea somehow that it's a new thing for people to try to design objective functions that are aligned with the common good. But no, we've been writing laws for millennia and that's exactly what it is. So that's where the science of lawmaking and computer science will come together.
So there's nothing special about HAL or AI systems. It's just a continuation of tools used to make some of these difficult ethical judgments that laws make.
Yeah. And we have systems like this already that make many decisions for ourselves in society that need to be designed in a way that they, like rules about things that sometimes have bad side effects, and we have to be flexible enough about those rules so that they can be broken when it's obvious that they shouldn't be applied.
So, you don't see this on the camera here, but all the decoration in this room is all pictures from 2001: A Space Odyssey.
Wow. Is that by accident or is there a lot?
It's not by accident. It's by design.
Oh, wow. So, if you were to build HAL 10,000, so an improvement of HAL 9,000, what would you improve?
Well, first of all, I wouldn't ask it to hold secrets and tell lies because that's really what breaks it in the end. That's the fact that it's asking itself questions about the purpose of the mission and it pieces things together that it's heard, all the secrecy of the preparation of the mission and the fact that there was a discovery on the lunar surface that really was kept secret, and one part of HAL's memory knows this and the other part does not know it and is supposed to not tell anyone, and that creates internal conflict.
So you think there should never be a set of things that an AI system should not be allowed, like a set of facts that should not be shared with the human operators?
Well, I think no. I think it should be a bit like in the design of autonomous AI systems. There should be the equivalent of the Hippocratic oath that doctors sign up to, right? There's certain things, certain rules that you have to abide by, and we can sort of hardwire this into our machines to kind of make sure they don't go. So I'm not an advocate of the three laws of robotics, the Asimov kind of thing, because I don't think it's practical, but some level of limits. But to be clear, these are not questions that are really worth asking today because we just don't have the technology to do this. We don't have autonomous intelligent machines. We have intelligent machines, semi-intelligent machines that are very specialized, but they don't really satisfy an objective. They're just trained to do one thing.
So, until we have some idea for design of a full-fledged autonomous intelligent system, asking the question of how we design its objective, I think, is a little too abstract.
It's a little too abstract. There's useful elements to it in that it helps us understand our own ethical codes, humans. So even just as a thought experiment, if you imagine that an AGI system is here today, how would we program it is a kind of nice thought experiment of constructing how should we have a system of laws for us humans. It's just a nice practical tool. And I think there's echoes of that idea too in the AI systems we have today that don't have to be that intelligent, like autonomous vehicles. These things start creeping in that they're worth thinking about, but certainly they shouldn't be framed as HAL.
Looking back, what is the most, I'm sorry if it's a silly question, but what is the most beautiful or surprising idea in deep learning or AI in general that you've ever come across sort of personally, where you sat back and just had this kind of a that's pretty cool moment? That's nice. Surprising.
I don't know if it's an idea rather than a sort of empirical fact. The fact that you can build gigantic neural nets, train them on relatively small amounts of data with stochastic gradient descent, and that it actually works. Breaks everything you read in every textbook, right? Every pre-deep learning textbook that told you you need to have fewer parameters than you have data samples. If you have a non-convex objective function, you have no guarantee of convergence. You know all those things that you read in textbooks and they tell you stay away from this, and they're all wrong.
Huge number of parameters, non-convex, and somehow relative to the number of parameters, data, it's able to learn anything.
Does that still surprise you today?
Well, it was kind of obvious to me before I knew anything that this is a good idea, and then it became surprising that it worked because I started reading those textbooks.
Okay, wait. So, can you talk through the intuition of why it was obvious to you, if you remember?
Well, okay. So, the intuition was it's sort of like those people in the late 19th century who proved that heavier than air flight was impossible, right? And of course, you have birds, right? They do fly. And so, on the face of it, it's obviously wrong as an empirical question, right? And so, we have the same kind of thing that we know that the brain works. We don't know how, but we know it works, and we know it's a large network of neurons in interaction and that learning takes place by changing the connections. So kind of getting this level of inspiration without covering the details but sort of trying to derive basic principles, that kind of gives you a clue as to which direction to go. There's also the idea somehow that I've been convinced of since I was in undergrad that even before that, intelligence is inseparable from learning. So the idea somehow that you can create an intelligent machine by basically programming, for me was a non-starter from the start. Every intelligent entity that we know about arrives at this intelligence through learning, so machine learning was a completely obvious path. Also because I'm lazy.
You automate basically everything, and learning is the automation of intelligence, right?
So what is learning then? What falls under learning? Because do you think of reasoning as learning?
Well, reasoning is certainly a consequence of learning as well, just like other functions of the brain. The big question about reasoning is how do you make reasoning compatible with gradient-based learning?
Do you think neural networks can be made to reason?
Yes, there is no question about that. Again, we have a good example, right? The question is how? So, the question is how much prior structure do you have to put in the neural net so that something like human reasoning will emerge from learning. Another question is all of our kind of model of what reasoning is that are based on logic are discrete and are therefore incompatible with gradient-based learning. And I'm a very strong believer in this idea of gradient-based learning. I don't believe that other types of learning that don't use kind of gradient information.
So you don't like discrete mathematics. You don't like anything discrete.
Well, it's not that I don't like it. It's just that it's incompatible with learning and I'm a big fan of learning, right? So in fact, that's perhaps one reason why deep learning has been kind of looked at with suspicion by a lot of computer scientists because the math is very different. The math that you use for deep learning kind of has more to do with cybernetics, the kind of math you do in electrical engineering, than the kind of math you do in computer science. And nothing in machine learning is exact, right? Computer science is all about obsessive compulsive attention to details, every index has to be right and you can prove that an algorithm is correct, right? Machine learning is the science of sloppiness.
That's beautiful. So okay, maybe let's feel around in the dark of what is a neural network that reasons, or a system that works with continuous functions that's able to build knowledge. However we think about reasoning, build on previous knowledge, build on extra knowledge, create new knowledge, generalize outside of any training set ever built. What does that look like? Do you have inklings of thoughts of what that might look like?
Well, yeah. I mean, yes and no. If I had precise ideas about this, I think we'd be building it right now. But there are people working on this whose main research interest is exactly that. So what you need to have is a working memory. So you need to have some subsystem that can store a relatively large number of factual episodic information for a reasonable amount of time. So in the brain, for example, there are kind of three main types of memory. One is the sort of memory of the state of your cortex, and that sort of disappears within 20 seconds. You can't remember things for more than about 20 seconds or a minute if you don't have any other form of memory. The second type of memory, which is longer term but still short-term, is the hippocampus. So you came into this building, you remember where the exit is, where the elevators are. You have some map of that building that's stored in your hippocampus. You might remember something about what I said a few minutes ago.
It's been erased, but that would be in your hippocampus. And then the longer-term memory is in the synapses, right? So what you need if you want a system that's capable of reasoning is that you want the hippocampus-like thing, right? And that's what people have tried to do with memory networks and neural machines and stuff like that, and now with transformers which have sort of a memory in their self-attention system, you can think of it this way. So that's one element you need. Another thing you need is some sort of network that can access this memory, get information back and then kind of crunch on it and do this iteratively multiple times, because a chain of reasoning is a process by which you kind of update your knowledge about the state of the world, about what's going to happen, etc., and that has to be this sort of recurrent operation basically.
And you think that if we think about a transformer, that seems to be too small to contain the knowledge, to represent the knowledge that's contained in Wikipedia, for example.
But a transformer doesn't have this idea of recurrence. It's got a fixed number of layers, and that's the number of steps that limits basically its representation.
But recurrence would build on the knowledge somehow. I mean, it would evolve the knowledge and expand the amount of information, perhaps, or useful information within that knowledge. But is this something that just can emerge with size? Because it seems like everything we have now is too small.
No, it's not. It's not clear how you access and write into an associative memory in an efficient way. I mean, the original memory network maybe had something like the right architecture, but if you try to scale up a memory network so that the memory contains all of Wikipedia, it doesn't quite work.
So there's a need for new ideas there. But it's not the only form of reasoning. So there's another form of reasoning which is very classical also in some types of AI, and it's based on, let's call it, energy minimization. So you have some sort of objective, some energy function that represents the quality or the negative quality. Energy goes up when things get bad and they get low when things get good. So let's say you want to figure out what gestures do I need to do to grab an object or walk out the door. If you have a good model of your own body, a good model of the environment, using this kind of energy minimization, you can do planning. In optimal control it's called model predictive control. You have a model of what's going to happen in the world as a consequence of your actions, and that allows you, by energy minimization, to figure out a sequence of actions that optimizes a particular objective function which minimizes the number of times you're going to hit something and the energy you're going to spend doing the gesture, etc. So that's a form of reasoning. Planning is a form of reasoning. And perhaps what led to the ability of humans to reason is the fact that species that appeared before us had to do some sort of planning to be able to hunt and survive, and survive the winter in particular, and so it's the same capacity that you need to have.
So in your intuition, if we look at expert systems and encoding knowledge as logic systems, as graphs or in this kind of way, is not a useful way to think about knowledge?
Graphs are a little brittle, or logic representation. So basically variables that have values and then constraints between them that are represented by rules is a little too rigid and too brittle, right? So some of the early efforts in that respect were to put probabilities on them. So a rule, you have this and that symptom, you have this disease with that probability and you should prescribe that antibiotic with that probability, right? The MYCIN system from the '70s, and that's what that branch of AI led to, Bayesian graphical models and causal inference and variational methods. So there is certainly a lot of interesting work going on in this area. The main issue with this is knowledge acquisition. How do you reduce a bunch of data to a graph of this type?
Yeah. It relies on the expert, on a human being to encode, to add knowledge.
And that's essentially impractical.
That's a big question. The second question is do you want to represent knowledge as symbols and do you want to manipulate them with logic? And again, that's incompatible with learning. So one suggestion which Jeff Hinton has been advocating for many decades is replace symbols by vectors. Think of it as patterns of activities in a bunch of neurons or units or whatever you want to call them, and replace logic by continuous functions. And that becomes now compatible. There's a very good set of ideas written in a paper about 10 years ago by Léon Bottou, who is here at Facebook. The title of the paper is 'From Machine Learning to Machine Reasoning,' and his idea is that a learning system should be able to manipulate objects that are in a space and then put the result back in the same space. So it's this idea of working memory, basically. And it's very enlightening.
And in a sense that might learn something like the simple expert systems.
I mean, you can learn basic logic operations there. Yeah, quite possibly. There's a big debate on sort of how much prior structure you have to put in for this kind of stuff to emerge. That's the debate I have with Gary Marcus and people like that.
Yeah. Yeah. So and the other person, so I just talked to Judea Pearl, from, you mentioned, causal inference world. So his worry is that the current neural networks are not able to learn what causes what, causal inference between things.
So I think he's right and wrong about this. If he's talking about the classic type of neural nets, people sort of didn't worry too much about this, but there's a lot of people now working on causal inference. And there's a paper that just came out last week by Léon Bottou among others, David Lopez-Paz and a bunch of other people, exactly on that problem of how do you get a neural net to sort of pay attention to real causal relationships, which may also solve issues of bias in data and things like this.
I'd like to read that paper because ultimately the challenge there also seems to fall back on the human expert to ultimately decide causality between things.
People are not very good at establishing causality, first of all. So first of all you talk to physicists and physicists actually don't believe in causality because look at all the basic laws of microphysics are time reversible. So there is no causality. The arrow of time is not real. It's as soon as you start looking at microscopic systems where there is unpredictable randomness, where there is clearly an arrow of time, but it's a big mystery in physics actually how that emerges.
Is it emergent or is it part of the fundamental fabric of reality? Or is it a bias of intelligent systems that because of the second law of thermodynamics we perceive a particular arrow of time, but in fact it's kind of arbitrary, right?
So yeah, physicists, mathematicians, they don't care about, I mean the math doesn't care about the flow of time. Well, certainly microphysics doesn't. People themselves are not very good at establishing causal relationships. If you ask this, I think it was in one of Seymour Papert's books on children learning, he studied with Jean Piaget, he's the guy who co-authored the book Perceptron with Marvin Minsky that kind of killed the first wave of neural nets. But he was actually a learning person, in the sense of studying learning in humans and machines, that's why he got interested in perceptron. And he wrote that if you ask a little kid what is the cause of the wind, a lot of kids will say, they will think for a while and they'll say, oh it's the branches in the trees, they move and that creates wind. So they get the causal relationship backwards and it's because their understanding of the world and intuitive physics is not that great. These are like four or five year old kids.
You know, it gets better and then you understand that it can't be right. But there are many things which we can, because of our common sense understanding of things, what people call common sense, and with understanding of physics, we can. There's a lot of stuff that we can figure out causality, even with diseases, we can figure out what's not causing what.
Often there's a lot of mystery, of course. But the idea is that you should be able to encode that into systems. It seems unlikely they'd be able to figure that out themselves. Well, whenever we can do intervention, but you know all of humanity has been completely deluded for millennia, probably since existence, about a very wrong causal relationship where whatever you can explain you attribute it to some deity, some divinity, right? That's a copout, that's a way of saying I don't know the cause so God did it.
Right. So you mentioned Marvin Minsky and the irony of maybe causing the first AI winter. You were there in the '90s, you were there in the '80s of course. In the '90s, why do you think people lost faith in deep learning in the '90s and found it again a decade later, over a decade later?
Yeah, it wasn't called deep learning yet. It was just called neural nets, but yeah, they lost interest. I mean, I would put that around 1995, at least the machine learning community. There was always a neural net community, but it became kind of disconnected from mainstream machine learning if you want. It was basically electrical engineering that kept at it, and computer science gave up on neural nets. I don't know, I was too close to it to really analyze it with an unbiased eye if you want. But I would make a few guesses. So the first one is at the time neural nets, it was very hard to make them work in the sense that you would implement backprop in your favorite language, and that favorite language was not Python, it was not MATLAB, it was not any of those things because they didn't exist. You had to write it in Fortran or something like this. So you would experiment with it, you would probably make some very basic mistakes, like badly initialize your weights, make the network too small because you read in the textbook you don't want too many parameters, and of course you would train on XOR because you didn't have any other data set to train it on, and of course it works half the time so you'd say I give up. Also you train it with batch gradient which isn't efficient. So there's a bag of tricks that you had to know to make those things work or you had to reinvent, and a lot of people just didn't and they just couldn't make it work. That's one thing. The investment in software platform to be able to display things, figure out why things don't work, kind of get a good intuition for how to get them to work, have enough flexibility so you can create network architectures like convolutional nets and stuff like that. It was hard. You had to write everything from scratch and again you didn't have any Python or MATLAB or anything, right?
I read that, sorry to interrupt, but I read that you wrote in Lisp your first versions of LeNet with convolutional networks, which by the way, one of my favorite languages. That's how I knew you were legit. Turing award, whatever. It's what you programmed in.
It's still my favorite language. But it's not that we programmed in Lisp, it's that we had to write a Lisp interpreter. Because it's not like we used one that existed. So we wrote a Lisp interpreter that we hooked up to a backend library that we wrote also for neural net computation. And then after a few years, around 1991, we invented this idea of basically having modules that know how to forward propagate and back propagate gradients and then interconnecting those modules in a graph. Léon had made proposals about this in the late '80s and we were able to implement this using a Lisp system. Eventually we wanted to use that system to build production code for character recognition at Bell Labs. So we actually wrote a compiler for that Lisp interpreter, so that Patrice, who's now at Microsoft, did the bulk of it with Léon and me, and we could write our system in Lisp and then compile to C and have a self-contained complete system that could do the entire thing. Neither PyTorch nor transformer can do this today yet. Okay, it's coming.
Yeah, I mean there's something like that in PyTorch called TorchScript.
And so we had to write all this interpreter, this compiler, to invest a huge amount of effort, and not everybody, if you don't completely believe in the concept, you're not going to invest the time to do this, right?
Now at the time, also today this would turn into PyTorch, TensorFlow or whatever, we'd put it in open source, everybody would use it and realize it's good. Back before 1995, working at AT&T, there's no way the lawyers would let you release anything in open source of this nature.
And so we could not distribute our code really.
And on that point, and sorry to go on a million tangents, but on that point I also read that there was some almost like a patent on convolutional networks at Bell Labs.
So first of all, there's two actually. That ran out, thankfully, in 2007.
Can we just talk about that? I know you're at Facebook but you're also at NYU. What does it mean to patent ideas like these? Software ideas essentially, or mathematical ideas, or what are they?
Okay, so they're not mathematical ideas. There are algorithms, and there was a period where the US patent office would allow the patent of software as long as it was embodied. The Europeans are very different, they don't quite accept that. They have a different concept. But I don't, I no longer, I mean I never actually strongly believed in this, but I don't believe in this kind of patent. Facebook basically doesn't believe in this kind of patent. Google fights patents because they've been burned with Apple, and so now they do this for defensive purpose. But usually they say we're not going to sue you if you infringe. Facebook has a similar policy. They patent on certain things for defensive purpose. We're not going to sue you if you infringe unless you sue us. So the industry does not believe in patents. They're there because of the legal landscape and various things, but I don't really believe in patents for this kind of stuff.
Okay. So that's a great thing.