Andrej Karpathy on using LLMs well

Karpathy treats an LLM as a powerful but fallible tool: keep the context window short and relevant, put source text in it rather than relying on recall, and give the model tokens or tools for anything requiring exactness. Match the model to the task (fast models by default, thinking models for hard math and code), use search where it helps, and always verify and own the output, treating it as a first draft from a junior assistant.

14 points · 2 appearances · 2025

Andrej Karpathy · How I use LLMs · 2025-02-27
↗ jump to source at 16:42
point 1 of 14
explore another topic
Andrej Karpathy on how LLMs work

2022–2026 · changed view

“Neural networks have done language modeling for a long time. So really what's new or interesting or exciting is just realizing that when you scale it up with a powerful enough neural net, Transformer, you have all these emergent properties, where basically what happens is if you have a large enough data set of text, you are in the task of predicting the next word, you are multitasking a huge amount of different kinds of problems. You are multitasking understanding of, you know, chemistry, physics, human nature. Lots of things are sort of clustered in that objective. It's a very simple objective, but actually you have to understand a lot about the world to make that prediction.”

Andrej Karpathy on software 3.0 & the future of programming

2022–2026 · changed view

“Yeah, so I had a blog post on Software 2.0, I think several years ago now. And the reason I wrote that post is because I kept— I kind of saw something remarkable happening in like software development and how a lot of code was being transitioned to be written not in sort of like C++ and so on, but it's written in the weights of a neural net. Basically just saying that neural nets are taking over software, the realm of software, and taking more and more tasks. And at the time I think not many people understood this deeply enough, that this is a big deal, it's a big transition. Neural networks were seen as one of multiple classification algorithms you might use for your data set problem on Kaggle. Like, this is not that; this is a change in how we program computers. And I saw neural nets as, this is going to take over, the way we program computers is going to change, is not going to be people writing a software in C++ or something like that and directly programming the software. It's going to be accumulating training sets and data sets and crafting these objectives by which we train these neural nets, and at some point there's going to be a compilation process from the data sets and the objective and the architecture specification into the binary, which is really just the neural net, you know, weights and the forward pass of the neural net, and then you can deploy that binary.”

Andrej Karpathy on learning & education

2022–2026 · changed view

“One more thing that I would say is that many times, when people think about education, they think more about what I would say is a softer component of diffusing knowledge. I have something very hard and technical in mind. In my mind, education is the very difficult technical process of building ramps to knowledge. In my mind, nanochat is a ramp to knowledge because it's very simple. It's the super simplified full-stack thing. If you give this artifact to someone and they look through it, they're learning a ton of stuff. It's giving you a lot of what I call eurekas per second, which is understanding per second. That's what I want, lots of eurekas per second. So to me, this is a technical problem of how do we build these ramps to knowledge. So I almost think of Eureka as maybe not that different from some of the frontier labs or some of the work that's going on there.”

Andrej Karpathy on AGI & AI timelines

2022–2026 · changed view

“The consistent thing I've been always interested in, for me at least, is AI, and that's probably where I'm spending my rest of my life on, because I just care about a lot. And I actually care about like many other problems as well, like say aging, which I basically view as disease, and I care about that as well, but I don't think it's a good idea to go after it specifically. I don't actually think that humans will be able to come up with the answer. I think the correct thing to do is to ignore those problems and you solve AI and then use that to solve everything else. And I think there's a chance that this will work; I think it's a very high chance. And that's kind of like the way I'm betting.”