Season 1 Ep.1 Andrej Karpathy on the visionary AI in Tesla's autonomous driving

In this interview, host Speaker A talks with Andrej Karpathy, Director of AI & Autopilot Vision at Tesla, about his personal journey from Slovakia to leading Tesla’s self‑driving vision system, his early exposure to deep learning at the University of Toronto under Geoffrey Hinton, and his role in creating Stanford’s seminal CS231n course. Karpathy explains the 2012 ImageNet breakthrough that sparked the deep‑learning revolution and offers a layperson’s description of deep learning as a new programming paradigm where massive datasets are “compiled” into neural‑network weights. He discusses why he left OpenAI to join Tesla, his collaboration with Elon Musk, and how Tesla’s vision‑only, camera‑based approach differs from lidar‑heavy competitors. The conversation delves into the core technical challenges of autonomous driving—especially environmental variability—and how Tesla tackles them through massive data collection, continuous dataset curation, and iterative training loops that involve millions of annotated images and weeks‑long compute cycles. Karpathy introduces concepts such as Software 2.0, the balance between neural‑network perception and traditional control code, the “Operation Vacation” vision of automating the data‑labeling pipeline, and the promise of self‑supervised learning to reduce annotation effort. He also covers Tesla’s custom AI chips for inference and the Dojo training supercomputer, the importance of compute scale, and his perspective on the future of AI beyond self‑driving. Throughout, he shares anecdotes about working culture, his relationship with Elon, and his optimism about exponential progress in AI.
Chapters
Today, here with me is Andrej Karpathy. Andrej is the Director of Artificial Intelligence and Autopilot Vision at Tesla. He's one of the world's leading visionaries in deep learning and computer vision. Ever since his PhD days at Stanford, Back when deep learning was just starting to emerge as a viable technology, Andrej has not only been a leading researcher, but also a leading educator. From there, he became one of the founding members of OpenAI, the AI research organization in San Francisco, initially largely funded by Elon Musk. And from there, at some point, Elon Musk then recruited Andrej to head up Autopilot efforts at Tesla. Andrej, you and I used to spend so much time together. For listeners, Andrej and I used to work together at OpenAI, but we also used to see each other at all of the AI conferences, academic working groups. But now it's actually been quite a while since we've seen each other, so I'm excited to get to catch up. Not even sure when is the last time we saw each other. Maybe NERBS, maybe my wedding, maybe Coherent offices. Do you remember?
I do. It was just before the pandemic, I think.
Right before pandemic? Oh, it must have been at NeurIPS in Vancouver. Yeah, I remember the burgers we went to eat in this live bar across the conference center. Yeah, those were the days.
And of course, I visited Covariant and saw your offices, and we had a chance to talk there.
Which was a lot of fun. I hope we can host you again sometime soon. Now, I actually spent most of yesterday watching all the videos listed on your website. Absolutely brilliant what you've achieved and how you explain it there. Now, can you tell our listeners a little bit about how you went from Slovakia, age 15 to becoming Tesla's AI director?
That's a quite all-encompassing question. Yeah, it's a long story. So as you mentioned, my parents decided to immigrate to Canada when I was 15. And yeah, I was not a very happy sort of person in Slovakia. I always wanted to leave. Slovakia is not an incredibly ambitious place. And I felt that I was upper bounded in terms of what I can achieve there. And so I always wanted to go to Canada, America, and do something substantial. And so when they asked, when they kind of hinted that we may be able to go to Canada, I was on board instantly. And then my sister was not quite as on board and everyone else in the family as well, but I sort of worked to convince everyone. Make the move. And yeah, so we came to Canada. I started in high school. I barely spoke any English. I had to learn English. I was very good at math. Luckily, the Slovakian curriculum is quite good at math. And so I was able to sort of get into the good courses and go through high school. Join University of Toronto and kind of get into computer science and so on. It is a long story.
It is a long story, but I think there are some really interesting parts to it. For example, somewhere I read that Geoff Hinton at Toronto is the one who first showed you neural networks. Yeah.
Yeah, so in University of Toronto is when I first came into contact sort of with deep learning through Geoff Hinton's class. And he taught a class, and at the time, This was very, very simple primordial deep learning. So we were looking at little digits, white on black, 3, 2, 4, 1, and we're trying to recognize those digits. And so by today's standards, these were incredibly toy problems. And I was fascinated by the way that Geoff Hinton spoke about these algorithms. He kept making analogies to the human brain. The way he talked about the neural net, it was like in the mind of the network. And he kept using these anthropomorphic descriptions for what was going on in the algorithm. And I found that analogy fascinating. And so that's kind of what pulled me in, I would say, into the entire area. And then, yeah, I audited the class and I also went to some of the reading groups that he hosted with his students. And that's basically when I became extremely interested in deep learning and have been in deep learning since.
Now, if we jump ahead a little bit, I think the first time you really were very visible as somebody in deep learning was during your PhD days at Stanford, when you were the one who were generating a lot of the research progress and educational content. Can you say a bit more about how do you get going on that at Stanford?
Yeah, so I think you're alluding to CS231n, the class that I ended up basically designing to a very large extent and then being the primary instructor for together with Fei-Fei. And it was really the first deep learning class at Stanford and became extremely successful. So in the first offering, it was maybe 150 students or so. And by the time I left, it was 700 or so. And so this became one of the biggest classes at Stanford. And the way it came about, I've always had I've always had a passion for teaching. And even during my master's degree at University of British Columbia, TAing different classes was always the highlight of my experience. I just love watching people learn new skills and then go out and do cool things with those skills. And I feel like it's such a large lever over, you know, kind of impact. It's indirect, but I think it's a very large lever. And so I was really just very passionate about teaching in general. And deep learning at the time was starting to have some of its first successes. So in 2012, we had the first convolutional neural network give a stunning performance on this ImageNet benchmark in computer vision and image classification. And a lot of people suddenly paid a lot of attention to deep learning. And I happened to be in a place where I understood the technology and I was very passionate about teaching. And Fei-Fei approached me and she pitched me on the idea that, hey, we could start a class and actually teach people about this. And I instantly jumped at the idea. I loved it. I put my entire PhD in research on hold. It's not something you would typically want to do as a PhD student because your primary output is research. And I ended up not doing basically any research for maybe a year because I just focused on the class and its design. But I felt like it was probably more impactful than getting a paper or two out to actually do this class and do a good job of it. And yeah, so we came up with the curriculum and taught it. And it was amazing. And it was probably the highlight of my PhD.
So Andrej, I mean— A lot of people already know this, but some people probably don't. I mean, you're saying this class went from 150 to 700 students from year 1 to year 2. But the reality is much bigger than that, of course. I mean, this class was put on YouTube, and there were hundreds of thousands of, if not millions of people watching your lectures. Because it wasn't just the first Stanford class, it was the class that everybody was watching, following along, because deep learning was this new thing and it was the place you would go if you wanted to understand it. You had to go to Andrej Karpathy's class. That's where everybody went. And so I think, yeah, I just want to clarify there's more than 700 people who were active in that class.
Yeah, absolutely. I did think it had a larger reach than I had anticipated at the time, of course, by a lot. I still— people come up to me randomly in conferences and even in like in a coffee shop and tell me that they saw my class and they really enjoyed it. And I've heard it many times, but it always brings the same amount of pleasure. And so I feel like that was a very good investment in time. Very proud of it.
When you go and check out one of Andrej Karpathy's videos, the most frequent comment is just two words: my hero. That's what you see. Because you opened up a whole field for so many people that was hard to access, and all of a sudden they could be part of it. Now, how would you explain that moment that triggered you teaching the class? You said ImageNet happened in 2012. What happened there? What was that all about?
Yeah, so as I mentioned, when I first encountered deep learning in Geoff Hinton's class, we were working with these tiny black and white images. So these are tiny 28 by 28 images where you have like a single digit, like a 7 or a 6, and we're trying to recognize like what it is. And so deep learning, which is this class of neural network, neural networks approaches where you basically have neurons that are connected to each other with different strengths. And you're trying to tune the strengths between the neurons so that they take your input, in this case, this image, and try to, you know, the neurons fire in a sequence, and then the last neurons tell you which digit it is in the image. And so it's a class of technology that was used in these super toy problems. And when I entered Stanford and I was in computer vision, these approaches were not what you would use for computer vision applications. So computer vision was a field that was mostly working with much larger, higher resolution images. So we're talking, you know, 1, 2, 3 megapixel inputs. So 1,000 by 1,000 images, real normal big images. And it was thought, and there was a very different class of approaches to how you, you know, attack computer vision problems in those settings. And so at the time, no one was using deep learning in computer vision. Deep learning was this branch of machine learning out there somewhere. And it was very different, not used. And it was thought— the conventional wisdom at the time was that these approaches would not scale to large resolution images. And it was in 2012 that Geoff Hinton and his team in University of Toronto, Alex Krizhevsky and Ilya Sutskever, published a paper showing that a scaled-up version of the neural network, really running on special GPUs in the computer, a special type of processor that is very good at running these kinds of computations that make up the neural network, that when you scale up these networks, so it's not just a little baby network with a couple thousand neurons, but it's actually a much bigger network with several hundred thousand of them connected with millions of weights and synapses, that actually these can do incredibly well even on normal-sized images and achieve extremely good performance compared to what was available in computer vision at the time. And this turned the entire field upside down. It was a massive tectonic change in computer vision. So if you visited a computer vision conference in 2012, there would be basically like one or two papers on deep learning. But if you visited 5 years later, it would be 1 or 2 papers that are not deep learning. It was a complete upheaval. And today, of course, you would not dream of doing computer vision without deep learning. So I happened to be at the right place at the right time with interest in education. And stars sort of aligned in the way that I was able to explain the material and hopefully empower a lot of people to use this powerful technology. For computer vision problems in the world.
Now, you absolutely did. And I'm curious if you had to describe just deep learning, let's put aside ImageNet moment for just deep learning itself. How would you describe deep learning to, I don't know, your parents or uncle or something who doesn't work in the space?
Let's use a specific example because I think it's useful. So let's talk about image recognition, right? We have images and they are just, images are made up to computer of a large number of pixels. And each pixel just tells you the amount of brightness in the red, green, and blue channel at that point. And so you have a large array of numbers and you have to go from that to, hey, it's a cat or a dog. And typical conventional software is written by a person, programmer, writing a series of instructions to go from the input to the output. So in this case, you want someone to write a program for how do you combine these millions of pixel values into, like, is it a cat or a dog? Turns out no one can write this program. It's a very complicated program because there's a huge amount of variability in what a cat or a dog can look like in different brightness conditions, arrangements, poses, occlusions. Basically no one can write this program. So Deep learning is a different class of programming in my mind, where no one is explicitly writing the algorithm for this recognition problem. Instead, we are structuring the entire process slightly differently. So in particular, we arrange a large dataset of possible images and the desired labels that should come out from the algorithm. So hey, when you get this input, this is a cat. When you get this output, this should be a dog, and so on. So we're kind of stipulating what is the desired desired behavior on a high level. We're not talking about what is the algorithm. We're measuring the performance of some algorithm. And then you need some— and then roughly what we do is we lay out a neural network, which is these— it's a bunch of neurons connected to each other with some strengths. And you feed them images and they predict what's in them. And the problem now is reduced because you're just trying to find the setting of these synaptic strengths between the neurons so that the outcomes are what you want. And so as an example, the 2012 ImageNet model, which was roughly 60 million parameters. So the weights of the neural network were really 60 million knobs, and those knobs can be arbitrary values. And how do you set the 60 million weights so that the network gives you the correct predictions? And so deep learning is a way of training this neural network and finding a good setting of these 60 million numbers. And so roughly the neural network sort of looks at the image, gives you a prediction, and then you measure the error. It's like, okay, you said this is a cat, but actually this is a dog. And then there's a mathematical procedure for tuning the strengths so that the neural network adapts itself to read with you. And so deep learning is basically a different software programming paradigm where we specify what we want, and then we use sort of mathematics and algorithms to tune the system to give you what you want. And there's some design that goes into the neural network architecture and how do you wire everything up, but then there's also a huge amount of design and effort spent on the datasets themselves and curating them. And, you know, because those datasets are now your constraints on the behavior that you are asking from the system. So it's a very different way of approaching problems that was not there before. Everything used to be written by person. Now we just write the specification and we write a rough layout of the algorithm, but it's what I refer to as fill-in-the-blanks programming because we sort of lay out an architecture and the rough layout of the net, but there's a huge amount of blanks. Which are the weights and the knobs. And those are set now during the training of this network. So that's, I think, the bird's eye view of how this is different.
I like the way you explain that. And it's of course no coincidence that you're heading up self-driving at Tesla and that you are one of the world-leading experts in this exact discipline of deep learning. There's got to be a strong connection there. So I want to I want to go a little bit towards the Tesla side of things. Mm-hmm. What was the moment you decided to join Tesla? How did that come about?
Yeah, so after my PhD at Stanford, I went to be a research scientist, one of the founding members at OpenAI, which is where we overlapped briefly as well. Mm-hmm. And I spent about almost 2 years at OpenAI. And by the time of 2 years at OpenAI, I have been doing research for about a decade. So my master's degree, my PhD, and then OpenAI. And so I spent about a decade reading and writing papers and working on training neural networks, but in an academic setting mostly. And so I was definitely getting a little bit restless at that time because I felt like these algorithms are extremely powerful and can really move the needle. On some very incredibly important problems in society. And I wanted to take a more active role in doing that. And so I was getting a bit restless. I was looking at different opportunities in, say, startups and things like that. And then one thing that kind of happened on the side is because OpenAI was at the time under the umbrella of Elon organizations, a few times we were interacting with people at Tesla. And I was kind of consulting a little bit for some of the problems in the Autopilot. And I kind of realized that they were dealing with fundamentally a deep learning computer vision problem. And this was the fundamental constraint to whether or not this product would work. And so I was kind of like intrigued by that, but it was just a few consulting opportunities here and there. I sort of spoke to the team, but at this time when I was getting really restless to apply this technology in the industry, Actually, Elon reached out and he asked me, "Hey, you've been like sort of consulting for the team. Do you actually want to join and lead the computer vision team and the AI team here and help get this car to drive?" And so he caught me at a very kind of correct time when I was really getting restless and I felt like this is perfect and I think I can do this. I think I have the skills to contribute here. This is an incredibly impactful opportunity and I love the company. And of course I love Elon and everything that he's doing. And so I would say that again, sort of it was a moment where stars aligned for me and I felt very strongly that this is the right thing to do at this time. And so I left OpenAI and I've been at Tesla for the last 4 years or so almost. So yeah, it's been some time.
Yeah, I've been there for 4 years and kind of funnily, I remember this moment where You were just about to leave OpenAI and a bunch of us are chatting about your plans and you're joking, but you're also half serious and you're saying, well, you know, this is a job that on average people last 6 months and then Elon thinks it's time for somebody else to take over. And here you are, on average 6 months leading up to when you started and now almost 4 years. No one is saying knock on wood of how this is going. This is just amazing.
Yeah, that's accurate. I was aware of the average tenure at Tesla, especially when you're working on very important projects, very close to Elon. And so yeah, I was very much aware of this. So when I made the transition to Tesla, for example, I did not give up my apartment in San Francisco because I was just kind of like, not, you know, really hedging my bets on what's going to happen in the next few months. But yeah, here I am 4 years later, still here.
Yeah, amazing. I'm curious, if you look at the Tesla mission statement, it's about transition to renewable energy, right? Which at first sight doesn't seem to directly tie into self-driving being kind of part of wanting to transition to renewable energy. So can you say a bit about how self-driving and renewable energy play together?
Yeah, I think it's a good question. I think broadly Elon sort of has a number of companies and a number of bets around just a higher level goal of, you know, making the future good, increase the probability of the future being good. And, you know, there's many aspects to that, of course. And he's focused the Tesla mission around, accelerating the transition to sustainable energy. Fundamentally, a large piece of this is getting people to transition to electric vehicles. And we need to manufacture them at scale and we want them to look like the future. And so the entire product itself sort of looks like the future. It's a very clean design and you want to be inspired by progress in society and that things are developing in a positive direction. And so the car looks much more futuristic. And I think a big part of that also is that the car becomes sort of, you know, it just becomes something magical in your life that can take you around in this beautiful future. And so I think autonomy really is part of just a broader vision to this future that we want to be part of. Where we are driving electric vehicles with very little footprint. And the society is sort of automated to a large extent. And there's a huge amount of problems, of course, also around transportation and putting people in the loop with the amount of accidents that they get into. And also with the fact that you don't want people to be really driving these cars because human brain is capable of so many beautiful things. So why should you solve the line following problem? That is not a good use of the brain.
It's a bit harder than that to build it though, isn't it?
So not only is it unsafe to drive these cars, it's also just you want the brains to be doing something different. And so we have the technology to address this. So that's why we're working on it.
That's really intriguing. The way I'm internalizing this is that if you want people to transition off something they like, People, right, like their existing cars. You got it. You can't just tell them, let go of your existing cars and, you know, stop using them. You got to show them something even shinier, something even more exciting that in the process also gets them onto renewable.
Yeah, we want people to transition to electric vehicles that are also very competent in the world and transport you around.
Before we dive into the technology itself for self-driving, got Got another question at a higher level, which is, how is it working with Elon Musk? I mean, he might well be the most famous person in the world at this point, and you are actually working with him.
Mm-hmm.
What is that like?
Well, he's obviously a very incredible person in many ways. I'm still trying to really map out his superpowers. He has incredibly well-developed intuition. I would say in many aspects where he makes the right judgment calls sometimes in what I perceive to be a lack of information, like because he's not fully in detail of all the things, but yet his judgment is extremely good. And so I still haven't fully sort of understood how that happens. He has a way of taking a very complex system and simplifying it to just like the fundamentals and the really the first principle components of what, what really matters about the system, and then making statements about those. And so it's a very different way of thinking that I find kind of fascinating. By default, for example, sometimes I get sort of overwhelmed by the system. I feel like I need to know the system in its full detail to make the correct decisions, but that's not how he operates. He somehow has a way to distill the system into a much simpler system in which he operates. And so I think I've learned a lot about just how to approach problems. And he's a double-edged sword because in terms of working with him, right? Because he wants the future yesterday. And he will push people and he will inject a lot of energy and he wants it to happen quickly. And you have to be of a certain, I think, attitude to really tolerate that over long periods of time. But he surrounds himself with people who get energy out of that. And they also want the future to happen quicker. And those people really thrive at Tesla. And so I happen to also, I think, be like that. And so I don't personally mind it. I actually kind of thrive on it. And I love the energy of getting this to work faster and, you know, making a difference and having this impact. And so I really enjoy working with him because he has a way of injecting energy into the system. Driving momentum and he has incredibly good and developed judgment. And so yeah, I overall just really, really enjoy working with him.
Sounds wonderful. Would you say you talk with him pretty much every week or when is that?
Yeah, that's right. So we have Autopilot meetings that range from a week to multiple times a week, depending on, you know, just how much scrutiny is being put on the Autopilot. Maybe right in front of releases, we would have more than a week. And multiple times in the history of the team, it's been every single day. And so yeah, on any of those frequencies, depending on what's happening.
That's so exciting. Wow. Now, if we think about self-driving cars, it's probably the kind of most tangible AI concept for the public because So many people have cars, and it's how their car is going to change because of AI, right? And certainly one of the most written about aspects of AI research and application in the press. But not everybody really realizes how driverless cars and AI are connected. What is the backstory there? How long have people been working on self-driving cars? And what is the AI role? What is happening under the hood?
Yeah, so people have, of course, been thinking about cars that drive themselves for a very long time. Some things are very easy to imagine, but very difficult to execute on, like driverless cars. Some things are not like that. So, for example, a cryptocurrency in Bitcoin is hard to sort of come up with. So you won't see something like that maybe featured in as much sci-fi. But driverless cars are something that people have been dreaming about for a very long time and working on for a long time. And I think fundamentally what makes it hard is, right, that you have to deal with a huge amount of variability of what the world looks like. And it's roughly, it's basically true that for AI and technology as it is today, the degree of difficulty is proportional to the degree of variability you're going to encounter in the application. So the more scenarios you have to deal with, the harder it will be for the technology. And that's what makes this hard for self-driving cars as well, is that environments out there are quite variable. Maybe on the highway, you're just dealing with lane following, but once you get off the highway into city streets in San Francisco and so on, the amount of things you can encounter is very large. And designing to it is incredibly difficult. And that's where all the action is.
You hit upon variability, right? That's making it so hard. Can you dig a little deeper? Why does variability make it hard?
So like I mentioned, you want, you are giving, like when you're creating these deep learning systems, you are giving them some kind of a specification for how they should act in different environments. In different cases. So, hey, this is a cat, this is a dog. And the network starts from scratch. It's not like your human brain that is born into a 3-dimensional physical reality where you sort of understand a lot of objects and you come with all this built-in hardware, but then also incredibly powerful learning algorithms so you can understand objects, object permanence, and how the world works. These neural networks, they are made up of neurons like your brain, but they actually, it's a very, it's not an exactly correct analogy and it's misleading. These neural networks, again, it's better to think of them as a mathematical function with a lot of free parameters, 60 million knobs that must be set to get the correct behavior. And in the beginning, the setting of these knobs is completely random. So the neural net is implementing a completely random function. It's doing completely random things and it's starting basically from scratch. And so you have to tell it what to do in every situation. And the more situations you have, the more you're going to have to give it in order for it to do the right thing in all the cases.
So, Andrej Karpathy, when a neural network starts from scratch and you put that neural network on a Tesla, what would happen if it drives a Tesla?
Well, you'll get random behavior when it's from scratch. It will be completely random behavior.
Got it. So it starts not knowing what to do. So you probably don't put those on the cars, actually.
No, you wouldn't want to do that.
And so when you deal with all this variability and you want this neural network to internalize that variability, can you say more about what— I mean, what makes a neural network internalize that variability? What's the solution to that? It—
so it looks like we do it through roughly almost brute force ways right now. So if I want the neural network to function in millions of situations, I need to plug in millions of examples, or something on that order. So the neural networks do show some ability to sort of interpolate between the examples you've given them. They are not as good at extrapolating. But as long as you sort of COVID the space of possibility and tell the neural network what to do in those different scenarios, they have some ability to interpolate between examples, but it's limited. And so if you really have a massive amount of variability that you want the system to perform well on, you actually have to cover that space to a large extent.
So how do you get the data to cover that space?
As I mentioned, in this new programming paradigm, there's a bit of designing the neural network and the neurons and so on, but a massive amount of work is on curating these datasets. And fundamentally, you roughly start with a dataset. You start with some dataset and you train your neural network, and then you measure its performance and you look at where it works and where it does not work. And fundamentally, the way you're iterating on this neural network to get it to work is you need to find a lot of examples where it does not do what you want it to do. And then you need to get those situations and you need to label correctly what should have happened in those situations, what the correct label would've been in all those cases. And then you need to put those into the training set for the neural network. And so the neural network is now trained on the previous dataset, but also on a dataset of where it failed before, but now has the correct label. And this improves some situations again. And then you have to again look at where it's failing now. And the faster you can spin this loop of just iterating and curating your dataset, the better this neural network will become. And luckily we are in a position with these deep neural networks that as long as the dataset is— as long as the dataset is improving, there's no real upper bound on the performance of the network. If you have enough computation available for it and a large enough dataset, it will find the correct sort of solution to making your labels work. So most of the engineering is on the dataset, and primarily it comes from sourcing examples where you're not working yet.
And sourcing examples where it's not working yet, is that when I drive my Tesla, am I sourcing those examples? How does that work?
Yeah, exactly. It's a great question. A lot of what I do, of course, at work is just curating these datasets, as I mentioned. That's where all the engineering now is. It's not people writing algorithms, it's people collecting datasets. And so, you know, for example, there's lots of things we want to know about the scene, right? So we want to know where the lines are, where the edges are, where the traffic lights are, where the other cars are, whether or not the car door is open on the car, if the left blinker is on. A huge amount of things. So roughly we have maybe, say, 30 top-level tasks, but a lot of those tasks have many subtasks. Like for a car, you may want to know a lot of attributes about it. What kind of a vehicle is it? Is the car door open? And so on. So you end up with a huge amount of predictions that your neural network has to make about the world. And now these networks are deployed in people's cars, and they're running and making predictions. And then we have to come up with lots of ways to source inaccuracies. And there's many ways by which we do that. Maybe one very simple example is if you intervene because the autopilot did not do something correct. Typically when you intervene, in a large number of cases, that has to do with an incorrect prediction from the network. So an intervention is a trigger, and we collect some of those images. And then we look at them and we look at whether or not the predictions were correct and how were they wrong. And that helps us triage, should this example go into what labeling project and where should it end up in, in what dataset and with what label? And that's how we sort of iterate on the system. But there's many triggers that are active at any point in time. As one more example, if you have a detection of, say, a stop sign or something like that, If the— so you have a bounding box that the computer is putting around the stop sign. And if the stop sign detection flickers, for example, so it's there and then the network says, oh, it's not a stop sign. Oh wait, it is a stop sign. When you see this disagreement with itself over time, that also is typically an extremely good source of data. So flicker and temporally inconsistent predictions, or for example, disagreements with the map. So we think there's a stop sign, but the map says that there isn't one. So there's lots of different ways by which we gather examples where the network is mispredicting. And for us, it's an exercise of how quickly can you enter those examples into a training set. And that's a huge portion of what the team is doing.
When I try to think about the data you're feeding into the system, how much data is that? I mean, are we thinking thousands of images, millions? What magnitude are we talking about here? Yep.
So we're talking about millions of images easily. Um, it's on that order.
So millions of images that are annotated with all kinds of information the neural network should extract automatically in the future from similar images.
Yep.
That's amazing. Now, one of the recurring themes, it seems, in deep learning is large data but also large compute. Um, let's say you want to train the autopilot from all that data, you say, okay, I'm gonna retrain it, push all the data through the neural network and train it. How much compute does it take? How long does it take to train an autopilot?
Yeah, so what you're getting at is these neural networks are quite expensive to train. So we start with millions of images and a typical neural network, if you want to, typically what you will see in the industry is most networks train roughly on the order of 2 to 3 weeks. Of time. Because 2 to 3 weeks is actually more of a psychological reason for that, is because that's the amount of time that a person is willing to wait for the network to converge and to measure its performance. So, but yeah, they have to look at a lot of examples. They have to make a lot of predictions and they have to be corrected on the predictions they're making during the training loop. And this takes a long time. And as you are scaling up the amount of compute available, you can afford to use a bigger network. And a bigger network will almost always work better, but it needs more training time. And so we're in a place where we are— and this is a beautiful place to be, by the way. We are not constrained by human ingenuity and algorithms, as used to be the case in computer vision, because we had a class of approaches that leveled off. And then we were the constraint. But now, we— human ingenuity is not a constraint. The constraint is the size of the dataset and the amount of compute that you have available to you. The algorithm now is known. Everyone knows the same algorithms and we just need to run them at scale. And we're getting benefits for free just by scaling up the network, making a bigger network and making a bigger dataset. So it's a beautiful place to be because you have a recipe, a template by which you can make progress. And you're just bounded by very concrete, tangible things that you can improve, like the size of your training cluster and things like that.
The way I hear you say that the algorithm's understood, that's true, of course. It still requires some true expertise in the space to understand those algorithms. But you're right. They're not secret. I hear part of what you're saying, it seems like You are spending a lot of your time on the data itself and a lot less on changing the algorithms. What does that look like? I mean, I imagine you have a large team that helps with the data and so forth. Like, what does that look like organizationally?
Yeah, and I think like to your point briefly, it's a good observation that the algorithms, it's not fair to say that they're fully figured out and known. I would say it's more true in some domains than others. Like in computer vision, I think we we have a class of algorithms that we're pretty happy with for the simplest image recognition problems. In many cases, for example, you're dealing with robots doing pick and place and things like that, I would say algorithms are absolutely much less known. And so different domains will have different maturity of the technology available. And I also want to say that it's not the case that we spend zero time on algorithms. It's more like we spend 25% of the time, not 100% of the time. And the only reason I— typically point that out and stress that is because typically people coming from, say, academia have an expectation. So in academia, when you're working with neural networks, typically your dataset is fixed because we have certain benchmarks that we're interested in driving up. So your dataset is fixed, like say the ImageNet, and your task is to iterate on the algorithm and the neural network design and layout to improve the numbers. And so everyone's 100% of the time on the neural network itself, the structure, the loss function, and all the pieces of that, and dataset is fixed. And my reaction to it is strong only because when you're in the industry, you will iterate a lot on the dataset as well. So that's not to say that the algorithm design and modeling is not there. It's just, it's the second order effect of what you would be doing. It's sort of the second term in the equation. And as I said, it also varies per area. So I would say in robotics, it's much less certain how to lay out the problem, how you structure it, how you arrange it, what is the dataset, how do you, what labels are you collecting, what level of abstraction, huge design space and not obvious what works yet. But I would say that's less the case in just simple image recognition.
Oh, I like that you expanded upon that. Now, the thing I'm actually curious about is how this relates to this term you coined a little while ago, Software 2.0, because it seems very related.
Yeah, yeah, exactly. So Software 2.0 was kind of like a blog post I published a few years ago. And it was just making the point that, of course, we have a lot of software that's driving large parts of society and automation in a space of information and so on. And a lot of the software right now is written by people. So banking systems and internet search and things like that, everything is sort of algorithms developed by people, in principle understood and orchestrated in a certain way. It seems to me basically that with progress in deep learning, you can sort of think of that neural network as a piece of software, but the software was not written by a person. This software was written by an optimization. And so it's kind of like a new programming paradigm that we are not directly writing the algorithm. We are programming the datasets. And the algorithm really is an outcome of this training process or this compilation, which would be sort of the equivalent in typical software. So you would take your source code and you would compile it and get a binary. So here the source code are the datasets. The compilation is the training of the neural arc and your binary is the final neural net, the weights. And to me, what's happening in society right now is that we are Well, number one, a lot of software that we couldn't have written before is now possible to write, like image recognition systems. But also a lot of system that— a lot of software that used to be written in by instruction, Software 1.0 style, can now be ported over to this more powerful paradigm, to Software 2.0. And the programming sort of looks different. And the reason I wrote that post is that it's a little bit of a call to arms to all the engineers in that over the— we've been programming in the Software 1.0 paradigm for 4 or 5 decades. And we have a huge amount of infrastructure to help us program in this paradigm. So we have IDEs that help you write code. They point out bugs, they do syntax highlighting. There's a huge amount of software infrastructure we've built to help us program. But this is not yet the case in this new programming paradigm. So we have to develop completely new tools around dataset curation. Monitoring the deployment of these neural networks, the iteration, the fine-tuning, everything that goes into programming this new paradigm is an uncharted territory. And the tools that we have to iterate on these datasets are extremely primordial and I think can be improved a lot. And so really the post was about pointing out that this is not just some kind of a classifier in machine learning. This is actually a restructuring of how we write software. And people have to take it seriously and we have to borrow a lot of what we've done with software 1.0 infrastructure that helped us program. And we have to port equivalence into working with neural nets because a lot of software will start to look like weights in neural net. It won't be C++ or Python or whatnot.
And would you say at this point, when you talk about this neural nets effectively being the program to build a self-driving car, is it just a neural net? That's been trained with a lot of data, or are there still other components?
[Speaker:Andrej Karpathy] Yeah, yeah, that's a really good question. So in the car, there are both. So images enter in the beginning, right? And we have pixels of an image telling us fundamentally what's out there in the world. And then neural networks are doing some portion of the recognition. So they're telling you, hey, there's a stop sign, person, et cetera. But you can't just directly drive on person, stop sign, et cetera. You have to actually write some logic around how do you take those intermediate sort of representations and predictions, and you want to avoid the pedestrian and you want to stop at the stop sign. And so there's still a lot of software 1.0 code sitting on top of the neural net. And that code is basically reacting to the predictions so that it speeds up, slows down, turns the wheel to stay in the lane line markings and so on. What I have seen in the history of the team, since I joined 4 years ago is that, and this is also why I think, is that really we've been porting a lot of the functionality from the software 1.0 land into the neural network. And so originally the neural networks would only make predictions, for example, for a single image. And they would tell you, okay, there's a piece of a road edge, but we actually don't just have a single image. We have 8 images, right? Are coming from 8 different cameras that are surround in the vehicle. So every image independently predicts little pieces of road edges and curbs, but there needs to be something above it that stitches it up into a 3-dimensional sort of bird's-eye view of what's happening around the vehicle. And that was all done in software developed by people. So you take road edges from here, you project them out, road edges from all the cameras, project them out, stitch them up across boundaries. And then over time, you need to also stitch them up and track them and make it sort of temporally continuous. And all that was written by people. And what we've done since then is the neural network has engulfed a lot of the pieces of the engineering. So the neural networks that are in the car today will not make a prediction per image. They will make prediction directly in the bird's eye view. So they will say, "Okay, I've seen these 8 images and from that I can see that the road edges are this way around the car. And also I've seen the images over time and I've done the tracking and having accumulated information from all those frames, here's actually what the world looks like around you." And so pieces of the software 1.0 code are being engulfed by the neural net and it's taking on more and more responsibility in the stack. And maybe at the end of the day, this can all just be a neural net. So maybe there's very little room for engineering. Maybe the images just come in and what comes out is just what you really want, which is the steering and the acceleration. Easily said, hard to do, but that is the final conclusion I would say of this kind of a transition. And there's very little software written by people. It's just a neural net does the whole thing. Yeah. That's the Holy Grail, I would say.
We are dropping new interviews every week, so subscribe to The Robot Brains on whichever platform you listen to your podcasts. Now, when people think about neural nets, often part of the reaction is, at least in the early days, was it's hard to understand what they're doing. And here you are. Putting a neural net as part of the decision-making system for driving people, which is, of course, I mean, a very risky thing if the Autopilot makes mistakes, right? So how do you build confidence in the system? And I imagine you have early rollouts sometimes in your own— how do you decide you're willing to try it out?
So maybe directly engineered code is in charge of a lot of the the stack, but I think it gives a false sense of understanding of the entire system because ultimately this can be hundreds of thousands of lines of code. So yes, you can analyze individual functions, but this is a very complex dynamical system. And I think you may have a false impression that you actually understand the system even though you understand like the individual components. I would say really what it comes down to is you want a very robust process for really testing the whole and subjecting it to a huge amount of evaluation, maybe both in— for all the individual components, making sure that, okay, the detection itself works and all the little pieces of the neural network individually by themselves, but then also end-to-end integration tests. And you just want to test the system. And you want to do this whether or not a neural net is in charge. And you want to subject it to, say, a huge amount of simulation to make sure it's working as expected, and also of course through driving. And so we have a large QA team that drives the car and verifies that everything is working as well as possible. And so we have a number of mechanisms by which we test these systems. Another one that's big for us is shadow mode releases. So you can deploy the functionality, but it's not wired up to control. It's just making predictions. But it's not actually acting. It's there just silently observing and making predictions. And then we sort of test it out without it actually driving the car. And so in some cases you can also do that. So to me, this is just basically the idea that we understood the previous software is false. And fundamentally you just need extremely good evaluation.
Now, in those evaluations, I'm curious, has ever any of the testers or you experienced something they're really surprised by and like, wow, this car is smarter than I thought?
I mean, basically every time it drives me around in the latest Full Self-Driving beta builds, and just the emergent, sometimes, you know, just the emergent properties of how it handles different situations. Like there's a bicyclist and an oncoming vehicle, and if you program it properly and the neural network works very well, you'll get these emergent behaviors where it does the right thing. And so I would say like every drive I have maybe a few of those.
Wow.
Yeah.
Yeah, that must be a real thrill. I gotta imagine you still hold your hand to the steering wheel and your foot on the brake pedal just in case.
Oh, absolutely. Yeah. So the current system is the Full Self-Driving Beta build that I drive around every day. And it's actually quite capable. I think people sort of understand that the Autopilot is, you know, it works quite well on the highway and a lot of people use it. And it can keep a lane on the highway, but the latest builds that we have in the full self-driving package are quite competent even off highway and city streets. So I was driven to get a coffee this morning and back to my house, a 20-minute drive around Palo Alto, and it was zero intervention drive.
And so—
Wow. And this is relatively routine for us. So it's not a perfect system, but it's really getting there. And I definitely keep my hands on the wheel because there's still, Yeah, you know, we will still do not very clever things once in a while. And so there's definitely more work to be done.
Now, of course, whenever it makes a mistake, in some sense, that's high value, assuming the person takes over correctly, of course, because that gives you the most valuable data, the missing pieces of the puzzle.
Yeah, that's right. So interventions are a very helpful source of data for us. And, you know, as I mentioned, there's a lot of other ways that we can also get get data that where the network is misbehaving. A lot of disagreements, for example, with the human driver, like we think there's a stop sign, we should be stopping, but the person just went. We can look at a lot of that data and maybe half of the time it's people just running a stop sign. We see a lot of that. Half of the time it's, hey, there was a stop sign, but actually it was not for you. It was for the oncoming traffic. And the stop sign was just angled way too much. And it looked deceiving to the neural network. And so both would be coming back in this stream of data.
Now, another thing that I've heard you talk about, and that just sounds really intriguing, ties into all of this, is this thing called Operation Vacation. Sounds, sounds very intriguing. Who doesn't want a vacation? What is Operation Vacation?
Yeah, so in the process of iterating on all these predictions in the team, we are noticing that more and more of its components can be automated. So as I described the process, you need to— your neural network makes predictions. You need to source at scale mispredictions, annotate them correctly, and put them into training set and retrain the network. That's the loop. And we're noticing that you can involve engineers less and less in that loop and through a lot of automation. Now, it's not all the engineers that get to eventually go on a vacation once we've automated the whole thing, because there's a huge amount of— there's a large data labeling team who has to stick around, monitor the triggers, and annotate the data. But the actual software engineers who write code could, in principle, go on a vacation. Having automated all the pieces of this improvement loop. So I would say it's kind of like a half-joking North Star for the team, where once these neural networks are just getting better by themselves with a lot of people in between, but just data labelers mostly, we get to all go on a vacation and the autopilot could in principle just improve automatically.
Are you worried though that Elon might let you be on vacation for the rest of your life and not—
We may be able to get away with a few days. We'll see. I'm not sure.
It's so interesting because it also reminds me of when you were actually visiting Covera and you said something along the lines of the data annotation is what you spend all your time on and the data annotation playbook is so valuable. It's the thing that generates so much value, right? Which is something that somebody in academia, of course, would never even pay attention to. But operation vacation sounds exactly like that, that the people who are still working are the ones who are working with the data, and everybody else is just on the beach, I guess. Yes.
I mean, it is done half jokingly. Actually, as I described the system, there's plenty of design and engineering that can still go into the fundamentals. Like, as an example, the system right now makes all these intermediate predictions. And there's still a lot of human-driven, human-written code on top of it. And this human-written code is very difficult to write and it's brittle and it will not fundamentally, I think, scale to where we need it to be if you really want 99.99% of accuracy and comfort. And so I think there's a lot of, there's some challenges that sort of remain, I would say, on the modeling front. And so we'll be busy with those, but the fundamental, if you're just talking about the perception system, itself. I think its improvement can be just improved autonomously, just on the raw detection itself. And, but yeah, as you mentioned, data annotation is not something you would do as a deep learning engineer. We spend a lot of time on it. I actually have an entire data labeling org that we've grown inside Tesla because this is so fundamental to what we do. A typical approach would be that you outsource it to third parties. We don't do that. We have a highly professional highly trained workforce that curates our datasets. And we think that this is the right way to go because this is just a new software programming paradigm. Again, these are our new programmers in the Software 2.0 land. And so they have to, when they're annotating examples, they're telling the system how to interpret the scene and they are quite literally programming the autopilot. So we invest quite a bit into the org and we keep it close. And they collaborate with the engineers very closely.
That's amazing. Now, when I think about data annotation, I can also— I mean, immediately the other thing I'm thinking about is self-supervised learning, which has made a lot of progress in AI in the last 2, 3 years, both in computer vision and in natural language processing. But probably here the vision part is more important. And so I'm curious about your thoughts on the role of self-supervised learning. Maybe come first to define for our listeners what is self-supervised learning and then say a bit about what you see as the role of it.
Yeah. So here's the issue with the current technology, basically, is I can get almost any arbitrary detection to work at this point. And this is just technology. But I need tens of thousands of examples for it. So if I need to recognize fire hydrants, absolutely doable. I need 10,000 examples, 50,000 examples, and I need to do a bit of data engine. To pad out the dataset. And I know this will work with a neural network. This is just technology. But there's a lot of things you want to recognize. And it feels silly to have to redo this work of like, hey, 50,000 times, this is a fire hydrant from all the possible rotations and all the possible brightness conditions. It just seems so silly. And so this is, you know, this is where the analogy again with the human brain breaks. In that for a person, you show them a fire hydrant and they sort of get it. It's the yellow things on the side of the road. That's not how our current technology works. It needs a really good coverage of fire hydrants. And so that's why a lot of people are perceiving basically this— there's almost like a flaw with the technology right now, and they're trying to come up with ways that will not require that huge amount of annotation. So maybe with very few examples, the neural network, just like a human network, should already know about fire hydrants. And you're just telling it, hey, that yellow thing on the side of the road is— you don't need 50,000 examples. You need very, very few because the network already understood fire hydrants. And now it's just getting a label for the thing it already has a neuron for. And so it's much more efficient at the use of the data set.
So Andrej, when you say the network already kind of understood fire hydrants, but was never told what what they are, but where does that sort of understood it already come from?
Exactly. So that's where self-supervised learning is about is how do you train on a large collection of examples that did not have to go through human annotation effort. We, so maybe people didn't go in and they didn't put bounding boxes around fire hydrants. Maybe it's just a huge amount of data and fire hydrants are featured in some of it. And maybe there are other objectives than explicit matching of human annotation that we can use to pre-train these networks so that they develop these representations. So there's many ways that people are trying to arrange it. As one example of many that seems to work relatively well is, for example, you could try to predict the future. And so it's not that we don't use labeled data. It's that we are using data that is annotated for free, because when you have a video of what happened in the world, you sort of have the future and came for free in the data stream. So you're still training the network to predict a thing, just like normal supervised learning, but you happen to have that thing for free without human effort. And so self-supervised learning is a class of approaches that try to leverage the structure of the data and try to take advantage of the free supervision that we have just in raw data streams instead of to sort of get the networks to arrange themselves into configurations that kind of understand the world so that it's much more efficient per label to train anything else. Fire hydrants might not be like the best example, but yeah, as an example, to predict the future, if you want, you have to actually understand the layout of the entire scene and how people and cars move and interact. And so this prediction problem forces the neural network to understand that, hey, there are cars, they move around, there are people, they move around, they avoid these areas. And so when I need to predict the future, I need to actually parse the scene to do that properly. And so, yeah, there is a class of approaches and we have tried a number of them. I do find that in these incredibly valuable applications, just paying for the labels is often the right way to go instead of paying researchers. And, but I think I basically kind of agree with that. Yeah, this is, it's not ideal. And there are some techniques that, as you mentioned, are seeing quite a lot of traction. And we have experimented with a number of them internally at Tesla.
That's really exciting because I mean, the way I also see is that once you go self-supervised, you can use infinite data effectively because all data works, right?
You have to be careful though, because more data is not always better. If you add boring data into your dataset, you may actually be diluting your dataset, right? Because your neural network will train for, like I mentioned, 3 weeks. And it's going to see some number of examples in its training. And if a lot of the examples are boring, it's not going to learn a lot. So you actually want to be very careful with the— and this is why I talk about curation of datasets. It's an active process of adding hard examples and subtracting the easy examples often. And a very easy way to see this is, of course, if I had just a single image in my massive dataset, of course, that's not helpful. So you really want to pad out the variability. And that's why I use active terms like curation when I talk about datasets. It's an active process to curate this dataset.
One thing that Tesla has also announced is building their own chips for AI compute. Why does that matter?
So there's many possible answers to that, of course. I think to a large extent, Elon sees AI as just a fundamental pillar of a lot of this technology and wants to invest into internal teams that develop a lot of this technology and co-design everything. Tesla is definitely about vertical integration and squeezing out a lot of juice from the benefits of that. So to a very large extent, of course, we own the entire manufacturing of the vehicle in the factory. And then we own a lot of the pieces of, okay, the hardware itself, how's it pointed, all the design decisions, And we own the cluster, we own the data labeling team, and also we own the inference hardware, the chip that actually runs the neural network on the car. To us, it's just another opportunity to co-design everything specifically for the purposes of self-driving. And so the chip is designed with the kinds of neural networks we want to run in mind. And the hardware itself is just targeted to the operations that we want to run and do that very efficiently. And so really it's just a theme of Tesla, and it allows us to co-design all the components to work together towards a single goal, in this case, full self-driving.
When I think about chips for AI compute, I tend to think there is training, and then there is inference, as you alluded to, which is when it's used for driving. Are you using both? Is it just inference right now?
Yeah, good question. So as you mentioned, you will typically— I guess hardware for deep learning actually kind of has like two broad areas now. There's hardware you would use to train neural networks. And that looks very different from the hardware you might want to use to run a neural network. So running a neural network is computationally much more straightforward thing. You're just kind of like doing— the neurons just have to fire in a sequence. If you're training a neural network, there's a lot more that goes on there. Because you have to run the neural network forward, but then you also have to implement the backpropagation algorithm, and you have to run the backward pass, and you have to update the weights. And there's a lot of technical details as to like at what precision do you run all this, mathematical precision in terms of the numbers involved. And so there's a lot of details that make the training a much more heavy endeavor, and the testing, the inference, a much simpler endeavor. And so as you mentioned, we currently have a chip for inference that we own and we've designed and is in all the cars. And we are also working on a training computer. And this is Project Dojo. And Elon has sort of alluded to it on a high level a number of times. And it is really just pushing this co-design even further. And we have a rough understanding of what these computational workflows look like for training neural networks for the Autopilot. It's a massive amount of video training and we are building a chip directly designed for that kind of a computational workload. And so yeah, that's absolutely an active project currently at Tesla.
I'm curious about your thoughts. I mean, you were at OpenAI, you're one of the founding members and OpenAI recently then somewhat recently raised $1 billion with specifically compute in mind. And so I'm curious about that strategic angle also. Is that something on your mind that more compute is the only way to succeed in AI?
Yeah, I think more compute is one of the fundamental limiting blocks right now for a lot of things, for a lot of domains. OpenAI is right now focused on, for example, natural language processing. For example, with their most recent work on GPT. So what they're doing there is it's a language modeling task where the neural network is generating language, text. And so you can get, you can feed it text and it will continue text, or you can ask it to produce text with certain properties, or it will answer your questions, or it will talk to you. And for, so what's happening there is the algorithms, again, in this setting are actually quite well known and understood. As you mentioned, the neural network takes the form of this transformer. You're training it in a very kind of standard regime with backpropagation, stochastic gradient ascent, and so on. So that's understood. So the algorithms are not the bottleneck for them. The dataset is also not a bottleneck for that class of problems because we have the internet with huge amount of text. So in that regime, also you are not upper bounded by datasets, but you are upper bounded by the compute available to you, which really restricts the size of the model that you can actually use. And like I said, in deep learning, we are blessed with algorithms that seem to continue to work better and better as you just make them bigger. You're literally just adding neurons into the system and it works better. And so OpenAI is primarily gated by compute in the setting. If they could train a bigger network, it would work better. And that's not the way it used to be in AI. We used to be bottlenecked by algorithms. And so what a beautiful place to be. If they could just run a bigger network, it would work much better. And the results would be even more magical.
And is that true for Tesla also? Is that just—
Yes, I would say so. And neural networks have this property in general that, yeah, if you make them bigger, they will almost always work better. And in the limits, you can, for example, use— this is slightly more technical, but you could use model ensembles, you could use dropout and a lot of techniques to basically make sure that these models work better when you scale them up. And so we are also limited by compute to a large extent, and we have to be very creative in how we squeeze out all the juice from all the flops that we have available on the car. And so that's the case also on the car, but also during training for us, right? So you want to train as big of a network as possible, And for us also, you have to consider the dataset and to whatever extent that is a bottleneck, and the algorithms and the models and to whatever extent that is a bottleneck. And so for us, for example, we do do a lot of manual labeling, but we are also looking into ways that you can train on data without having to label with a human, or you can use sensors expensive sensors to annotate your data. And so maybe you have a few cars that drive around with say radars or LiDARs or any other sensing suite you want that gives you extra information about the scene, and that can function as annotation for computer vision. And so computer vision can be matching those sensors and imitating them. And so you have sensor annotation, human annotation, or self-annotation, like predicting the future. And so all of those are knobs and kind of algorithms you could play with.
Tesla is not the only company trying to build self-driving cars. There's other efforts out there. And sometimes, at least in the media, it's depicted as a bit of a race of who's going to get there first and so forth. And so how do you see the Tesla effort different from the other efforts?
It's a very good question because it is very different and it is not obvious. So for example, there was a video just recently released where someone used a Waymo car and the Waymo drove them to some location. I forget the details. And then they used the Tesla Autopilot Full Self-Driving Beta build, and it also drove them there with zero interventions. And so both cars took the same route and got to the same place. In the same spot with zero interventions. And so to a third party observer, just looking at this, these are cars, they take right turns, left turns, they navigate you to where you need to be. It looks the same, but under the hood, the systems are actually extremely different, like quite different. So the approach of Waymo and many others in the industry, and I would say in the industry, you will see this two classes of approaches really. And one is Waymo-like, And the other is Tesla-like, I guess, in my naive sort of description of it, I suppose. And in the Waymo-like approach, you are going to first outfit the car with many more sensors, in particular, the use of quite expensive LiDAR sensors that are on top. They give you range sensing around you. And you also have these high-definition maps. So you need to drive around before you make the trip And you need to pre-map the environment in very high definition. And then when you are driving, you know exactly where you are on that map. So you know exactly how to stay on it and how to drive. And this is very different from what the Tesla car is doing, because first of all, we do not have very expensive sensing. We just have a few cameras that give us surround view. And by the way, that's already a lot of information because each camera is, say, several megapixels. And so you're getting many millions of observations of what's around the car when each ray really is of brightness is telling you something about the world. So you're getting a huge amount of information from cameras that is very, very cheap and economical to produce. And we do not use high definition maps. So we have very low definition maps that are kind of like a Google map. So it's telling you that, hey, you should take a right turn, left turn, et cetera. But we do not know to a centimeter level accuracy where there where the curb is. Everything is coming from the system at that time through vision. And so the car is encountering these intersections and these areas for the first time, basically, as it's driving around. And it needs to look at the images and needs to decide, these are curbs, these are lane markings, this is how many lanes there are, this is where I should be to take a left turn. And so it's a much higher bar, much harder to design, but it's also much cheaper because the sensor suite is just cameras, and it's not specific to a location that you had to pre-map. So our system is very cheap and it'll work anywhere. What this allows you to do then is that this affords you scale. So Waymo can have maybe a few hundred cars or something like that. We have millions of cars. And as I mentioned, scale is incredibly important to getting AI to work because everything is about dataset curation. And so I do not see how you can fundamentally really get a system to work well in absence of scale. And so I think I would much rather give up some sensing in return for scale in AI problems.
I'm kind of curious when you made your decision to go to Tesla, I mean, you must have seen that bifurcation and was that something on your mind at the time that you thought about a lot about what you believe is going to be the way forward?
Absolutely. I definitely saw the bifurcation and I felt like Tesla had the right approach fundamentally. And I'm a huge believer in deep neural networks and their power. And I think images provide you with a huge amount of information and it's just a question of processing it. And these deep neural networks that I know are capable of doing the processing that we need of them. And so to me, it's actually a brilliant strategic decision from Elon. And I was absolutely on board with a vision-only approach. And I do believe that that system can be arranged to process all that information and actually drive around.
Have you ever had to sleep on a bench or a sofa in the Tesla headquarters like Elon?
So yes, I have slept at Tesla a few times, even though I live very nearby, but There were definitely a few fires where that has happened.
I found—
I walked around the office and I was trying to find a nice place to find, and I found a little exercise studio. So there were a few yoga mats and I figured yoga mat is a great place. So I just crashed there and it was great. And I actually slept really well and could get right back into it in the morning. So it was actually a pretty pleasant experience.
Oh, wow.
I haven't done that in a while.
I had not expected this to be the answer. Cool. Wow. So it's not only Elon who sleeps at Tesla every now and then.
Yeah, I think it's good for the soul. You want to be invested into the problem and you're just too caught up in it and you don't want to travel and so on. You just— I like being overtaken by problems sometimes. When you're just so into it and you really want it to work and sleep is in the way and you just need to get it over with so that you can get back into it. So it doesn't happen too often, but when it does, I actually do enjoy it. I love the energy of the problem solving and I think it's good for the soul.
Yeah. So I'm curious, what's your view on the future of AI? When we think beyond self-driving, what are the big things on the horizon for us?
I think like, first of all, like, wow, the progress is incredibly fast. When you're zoomed into the day-to-day and the different papers that are coming out on a scale of a week, maybe sometimes it can feel slightly slow, but when you zoom out, like AlexNet, as I mentioned, this ImageNet recognition benchmark that was beaten by NeuralNet that really started the deep learning revolution and transformation was 2012. We're in 2021. So it hasn't even been a decade. And I'll get to live hopefully 4 more decades or something like that, maybe. So if, like from 2012 to now has been complete transformation of AI and a lot happened in a decade. And so if I'm going to witness something on those orders of magnitude in the next 4 years, it's really mind-boggling to extrapolate. And fundamentally we have these algorithms that seem to be only upper bounded by the data and the compute. And we're going to get more compute and we are specializing all of our hardware to neural networks. And all of that is ongoing. Our current processors actually are not very specialized for running neural nets. And there's a lot of low-hanging fruit there. And also the size of the field has grown. And so there's a lot more brainpower going into improving everything. And so there's this exponential return on all of this investment in hardware and software. And so you shouldn't expect linear improvements. You should actually expect some kind of an exponential improvement. So it gets even more mind-boggling. And so I think in the short term, we're absolutely going to see much more automation, be it self-driving cars or drones or warehouses and so on. That's very easy to predict. But I think on the long term, that's where it starts to get kind of even more dicey because, you know, I joined OpenAI. OpenAI is basically an AGI project, artificial general intelligence. So the idea is we're trying to develop fundamentally an artificial brain that thinks and wants and acts and functions like a human being. So I would say next to a visual cortex, we sort of have a checkmark, like that part of the brain, we sort of maybe like understand the principles of, but we certainly haven't understood the entire brain and how decision-making is done and so on. But I think we are with robotics and so on, we are probably going to make a massive dent into that over the next decade or two or three. And yeah, I think we're probably gonna see some very exciting things come from AI because the technology is not, really upper bounded in any real way. And it's mildly concerning, but kind of exciting. So I think we'll see what happens.
Andrej, it's been absolutely wonderful having you on. Learned so much. Thank you. Now, if anyone listening is like me and would like to keep learning from Andrej, I highly recommend viewing and reading all the material on Andrej's webpage. Karpathy.ai. This includes his talk at Tesla Autonomy Day where he's on stage together with Elon Musk. And I highly recommend following Andrej on Twitter where he very generously shares his latest insights on AI with the world. And on Twitter, that's @karpathy.
More from Andrej

Skill Issue: Andrej Karpathy on Code Agents, AutoResearch, and the Loopy Era of AI

Andrej Karpathy: Tesla AI, Self-Driving, Optimus, Aliens, and AGI | Lex Fridman Podcast #333








