Chapter 1 of 13 · 16 min

The New Programming

Why deep learning changed what it means to write software.

Goal of this chapterAfter this chapter you will understand Karpathy’s core framing: neural networks are learned programs, data is code, and optimization is a new kind of compiler.
Watch this chapterAndrej Karpathy's key moments on the new programming, back to back
4 moments · 3 min
1 / 4
“I was dissatisfied with artificial intelligence. When I saw machine learning, I was like, this is the AI that I want to kind of spend time on. This is what's really interesting, and that's kind of what took me down those directions. Is that this is kind of almost a new computing paradigm, I would say. Because normally, humans write code, but here in this case, the optimization writes code. And so, you're creating input/output specification, and then you have a lot of examples of it, and then the optimization writes code, and sometimes it can write code better than you. And so, I thought that was just a very new kind of way of thinking about programming, and that's what kind of intrigued me about it.”
Heroes of Deep Learning interview, 2019 · 1:32

The lesson

Karpathy’s core shift is to treat deep learning not as a better feature library, but as a different way to program. In traditional software, people write explicit instructions in languages like C++; in the newer setup, humans define the task through examples and an objective, and optimization finds the implementation inside a neural network’s weights123. That is why he frames machine learning as a new computing paradigm rather than just another AI technique41.

This framing changes the role of the engineer. In Software 1.0, you directly author the logic; in Software 2.0, you define the search space and training setup, then let optimization discover the behavior56. Karpathy’s practical advice is to design less of the solution by hand and leave more to optimization, especially on hard pattern-recognition problems where handcrafted rules and features tend to be brittle78.

Once you see learned systems this way, data stops being just fuel and becomes part of the program itself. Karpathy explicitly argues that the dataset is the code, because the examples and labels determine what behavior optimization will produce9. That also means the people who choose, label, and curate examples are shaping the program’s logic, which is why he says labelers are effectively programmers in these systems10.

This creates a software engineering challenge, not just a modeling challenge. If data is code, then teams need ways to version, inspect, debug, and improve datasets and learned behavior, yet Karpathy points out that the tooling for this new style is still immature compared with normal programming workflows111213. The practical consequence is that building modern AI systems requires infrastructure around data collection, labeling, and iteration, not only better architectures.

Karpathy’s examples from vision and real-world systems reinforce why this matters. His ImageNet human-baseline exercise showed that benchmark performance depends on subtle dataset structure and category design, not just abstract intelligence, which makes careful data understanding essential1415. At Tesla, the lesson became even sharper: real progress came from improving the data engine and turning failures in deployment into new training examples, showing that in learned software, iteration on data is often iteration on the program itself.

4 principles from Andrej Karpathy

1

Treat neural networks as learned programs

Don’t think of a model as a mysterious black box added onto software. Think of it as code that is authored indirectly: you specify the task and training setup, and optimization writes the implementation into weights.

“I was dissatisfied with artificial intelligence. When I saw machine learning, I was like, this is the AI that I want to kind of spend time on. This is what's really interesting, and that's kind of what took me down those directions. Is that this is kind of almost a new computing paradigm, I would say. Because normally, humans write code, but here in this case, the optimization writes code. And so, you're creating input/output specification, and then you have a lot of examples of it, and then the optimization writes code, and sometimes it can write code better than you. And so, I thought that was just a very new kind of way of thinking about programming, and that's what kind of intrigued me about it.”
Heroes of Deep Learning interview, 2019answer page →
2

Design less by hand when optimization can search better

On messy perception problems, handcrafting features and rules often locks you into weak assumptions. A better strategy is to define the objective and search space clearly, then let learning discover more of the solution.

“The optimization really writes the code; we only identify a region where we should search.”
NIPS conference talk, 2017
3

Treat the dataset as part of the codebase

Examples and labels are not just inputs to a separate system; they directly determine system behavior. Review, curate, and improve datasets with the same seriousness you would apply to reviewing source code.

“…your data set is really the code.”
NIPS conference talk, 2017
4

Build tooling for Software 2.0 workflows

If learned behavior comes from data and optimization, then debugging must include dataset inspection, versioning, and iteration loops. Teams should expect standard software tools to be insufficient on their own.

“…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
“I was dissatisfied with artificial intelligence. When I saw machine learning, I was like, this is the AI that I want to kind of spend time on. This is what's really interesting, and that's kind of what took me down those directions. Is that this is kind of almost a new computing paradigm, I would say. Because normally, humans write code, but here in this case, the optimization writes code. And so, you're creating input/output specification, and then you have a lot of examples of it, and then the optimization writes code, and sometimes it can write code better than you. And so, I thought that was just a very new kind of way of thinking about programming, and that's what kind of intrigued me about it.”
Heroes of Deep Learning interview, 2019answer page →
2
“Software 1.0 is things like C++.”
Conference keynote, 2019
3
“The code is now written in the weights of a neural network.”
Conference keynote, 2019
4
“I thought that was just a very new kind of way of thinking about programming…”
Heroes of Deep Learning interview, 2019
5
“The optimization really writes the code; we only identify a region where we should search.”
NIPS conference talk, 2017
6
“…code—that code is not written in C++. It's written in weights of a neural network.”
Full Stack Deep Learning talk, 2018
7
“…design less, and leave more to the optimization.”
NIPS conference talk, 2017
8
“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
9
“…your data set is really the code.”
NIPS conference talk, 2017
10
“…the labelers are kind of the programmers…”
Full Stack Deep Learning talk, 2018
11
“What are the IDs for data sets?”
NIPS conference talk, 2017
12
“…this is a whole new way of designing software and we need tooling for it.”
NIPS conference talk, 2017
13
“…there's really nothing that helps you write the 2.0 code…”
Conference keynote, 2019
14
“So basically, the ImageNet challenge is kind of a... It's sometimes compared to kind of the World Cup of computer vision. So a lot of people kind of care about this benchmark, and number— our error rate kind of goes down over time. And it was not obvious to me kind of where a human would be on the scale. And I've done a similar smaller scale experiment on CIFAR-10 dataset earlier. So what I did in CIFAR-10 is I just was looking at these 32 by 32 images. And I was trying to classify them myself. At the time, this was only 10 categories. So it's fairly simple to create an interface for it. And I think I had an error rate of about 6% on that.”
Heroes of Deep Learning interview, 2019answer page →
15
“And so I listed out all the categories, and I gave myself examples of them and so for each image I was crawling through a thousand categories and just trying to kind of a You know see? Based on the example I was seeing for each category what this image might be and I thought it was a just an extremely instructed exercise by itself I mean I was not I did not understand that like a third of imageNet was dogs and like dog species And so that was kind of interesting to see that networks spend on unique amount of time caring about dogs. I think a third of its performance comes from dogs Yeah, so this was kind of something that I did for maybe a week or two I put everything else on hold. I thought it was kind of a very fun exercise…”
Heroes of Deep Learning interview, 2019answer page →

Reflect

  1. Where in your current work are you still trying to write explicit rules for a problem that might be better specified through examples and an evaluation metric?
  2. If your dataset is part of the codebase, what would code review for your data look like in practice?
  3. Who are the hidden 'programmers' in your system—annotators, curators, prompt writers, evaluators—and how much influence do they have on behavior?

Check your understanding

1. What is Karpathy’s main contrast between Software 1.0 and Software 2.0?
2. Why does Karpathy say the dataset is 'the code'?
3. What practical change follows from Karpathy’s Software 2.0 framing?

Go deeper

Search every transcript
Open the full search page →