Tesla Data Flywheel
Autopilot improves by finding failures, collecting fleet data, labeling, retraining, and redeploying.

The lesson
Karpathy frames Tesla Autopilot as a Software 2.0 system: instead of hand-writing more and more rules, the behavior is increasingly written into neural network weights through training. In that view, the job shifts from explicitly coding every case to defining the learning setup and supplying the right data. The key idea is that for perception-heavy problems like driving, optimization writes much of the program while engineers shape the search and the training process.123
That changes what counts as programming. Karpathy argues that the dataset is effectively the code, because it determines what the learned system will do in the world. This is why labeling and curation are central: the people who decide how examples are selected and annotated are directly shaping model behavior, much like programmers shaping logic in traditional software.45
Tesla’s data flywheel starts with deployment in the real world, where a fleet encounters a huge range of situations that cannot be fully enumerated in advance. Autopilot is built around computer vision and machine learning on raw video, so progress depends on finding the situations where the current system is weak, collecting those examples, and feeding them back into training. In Karpathy’s framing, autonomy improves by repeatedly finding failures, turning them into training data, and learning a better policy rather than trying to manually patch every edge case with C++ rules.678
This also explains why Tesla needed new tooling and infrastructure. If the code lives in weights and datasets, then the hard part is not only model design but managing collection, labeling, retraining, evaluation, and safe iteration at scale. Karpathy emphasizes both that this is a new way of building software and that the training stack is expensive and iterative, with many networks and predictions that must keep improving without regressions.91011
The direction of travel is to hand more of the stack to learning systems over time. Karpathy describes a trend of designing less by hand and leaving more to optimization, which means the flywheel matters even more as the system takes on a larger share of the autonomy problem. In practice, the advantage comes not from a one-time model breakthrough but from a disciplined loop: deploy, observe failures, collect targeted data, label well, retrain, and redeploy.121314
4 principles from Andrej Karpathy
Treat the dataset as part of the program
In Software 2.0, model behavior is shaped less by explicit rules and more by the examples used to train it. When performance is poor, inspect the data and labels as seriously as you would inspect source code in a traditional system.
“…your data set is really the code.”
Use failures to drive data collection
Real progress comes from identifying where the deployed system breaks and turning those cases into new training examples. Instead of guessing all edge cases ahead of time, let real-world mistakes reveal where the model needs more supervision.
“…everything that we built for the autopilot is basically based on computer vision, machine learning, on the raw video streams…”
Design less and optimize more
Karpathy’s view is that hard perception problems improve when humans specify the objective and pipeline, then let optimization discover more of the solution. Apply this by resisting premature rule-writing when a learnable approach can absorb complexity better.
“…design less, and leave more to the optimization.”
Build tooling for iteration, not just models
A strong model is not enough if you cannot collect data, relabel, retrain, and evaluate repeatedly without regressions. The practical bottleneck is often the system around learning, especially when many networks must improve together.
“…this is a whole new way of designing software and we need tooling for it.”
In his own words
The quotes behind the lesson, word for word from the transcripts. Numbers match the lesson above.
“The optimization really writes the code; we only identify a region where we should search.”
“…code—that code is not written in C++. It's written in weights of a neural network.”
“The code is now written in the weights of a neural network.”
“…your data set is really the code.”
“…the labelers are kind of the programmers…”
“…everything that we built for the autopilot is basically based on computer vision, machine learning, on the raw video streams…”
“…we don't use lidar and we don't use high-definition maps…”
“Software 1.0 is things like C++.”
“…this is a whole new way of designing software and we need tooling for it.”
“But all in all, if you're trying to train all of the neural networks for the autopilot, it is actually a fairly expensive task. In particular, today we would train 48 different networks that make 1,000 different predictions—just if you count the number of output tensors—and it takes 70,000 GPU hours to train to compile the autopilot. It leaves the neural network stack. So if you had a single node with 8 GPUs, you would be training for a year. So it's a lot of networks and a lot of predictions, and a lot of them must work and none of them can regress ever. And then you're not just training this once—you have to iterate on this.”
“…there's really nothing that helps you write the 2.0 code…”
“…design less, and leave more to the optimization.”
“Let's forget about all that stuff that humans have designed with all their ingenuity, and let's try to just have a single kind of blob of compute…”
“As you'll notice here on the bottom, we have a GPU cluster. The hardware team is also working on a project we call Dojo. And a Dojo is a neural network training computer and a chip. And so we hope to do the exact same thing for training as we did for inference: improve basically the efficiency by roughly an order of magnitude at a lower cost. But I'm not ready to talk about more details in that project just yet. So in summary, I talked about the full lifecycle of developing these neural hours for the autopilot and how we own everything in-house.”
Reflect
- In a project you work on, what currently acts like 'code' in Karpathy’s sense: rules, data, labels, prompts, or something else?
- Think of a recurring failure in one of your systems. How would you redesign the workflow so that each failure automatically becomes a new training or evaluation example?
- Where are you still hand-designing logic that might be better improved through better data collection and optimization?
Check your understanding
Go deeper
Andrej Karpathy on Software 2.0: Data Is the New Code2018 · 55 min · full transcript
Andrej Karpathy on Software 2.0: Scaling Autonomy at Tesla2019 · 33 min · full transcript
Andrej Karpathy on PyTorch at Tesla2018 · 11 min · full transcript
Andrej Karpathy on AI and Robotics: Models, Agents, and Education2024 · 44 min · full transcript
Andrej Karpathy on Software 2.0 to 3.0: AI Changes Everything2024 · 121 min · full transcript
Andrej Karpathy on Software 2.0: Data Is the Code2017 · 18 min · full transcript