Chapter 11 of 13 · 15 min

Tesla Data Flywheel

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

Goal of this chapterAfter this chapter you will be able to explain Tesla’s autonomy data engine in Karpathy’s own terms: Software 2.0, fleet-scale edge cases, labelers as programmers, and the loop from failures back into training.
Watch this chapterAndrej Karpathy's key moments on tesla data flywheel, back to back
4 moments · 3 min
1 / 4
“…your data set is really the code.”
NIPS conference talk, 2017 · 13:58

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

1

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.”
NIPS conference talk, 2017
2

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…”
conference talk, 2018
3

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.”
NIPS conference talk, 2017
4

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.”
NIPS conference talk, 2017

In his own words

The quotes behind the lesson, word for word from the transcripts. Numbers match the lesson above.

1
“The optimization really writes the code; we only identify a region where we should search.”
NIPS conference talk, 2017
2
“…code—that code is not written in C++. It's written in weights of a neural network.”
Full Stack Deep Learning talk, 2018
3
“The code is now written in the weights of a neural network.”
Conference keynote, 2019
4
“…your data set is really the code.”
NIPS conference talk, 2017
5
“…the labelers are kind of the programmers…”
Full Stack Deep Learning talk, 2018
6
“…everything that we built for the autopilot is basically based on computer vision, machine learning, on the raw video streams…”
conference talk, 2018
7
“…we don't use lidar and we don't use high-definition maps…”
conference talk, 2018
8
“Software 1.0 is things like C++.”
Conference keynote, 2019
9
“…this is a whole new way of designing software and we need tooling for it.”
NIPS conference talk, 2017
10
“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.”
conference talk, 2018answer page →
11
“…there's really nothing that helps you write the 2.0 code…”
Conference keynote, 2019
12
“…design less, and leave more to the optimization.”
NIPS conference talk, 2017
13
“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…”
Conference keynote, 2019
14
“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.”
conference talk, 2018answer page →

Reflect

  1. In a project you work on, what currently acts like 'code' in Karpathy’s sense: rules, data, labels, prompts, or something else?
  2. 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?
  3. Where are you still hand-designing logic that might be better improved through better data collection and optimization?

Check your understanding

1. What is the main idea behind Tesla’s autonomy data flywheel in Karpathy’s framing?
2. Why does Karpathy say labelers are like programmers?
3. What does 'design less, and leave more to the optimization' mean here?

Go deeper

Search every transcript
Open the full search page →