Using LLMs Well
Prompting as practical engineering.

The lesson
Karpathy treats prompting as a practical way of programming a new kind of system, not as magic. In his framing, an LLM is a compact, self-contained artifact with learned knowledge and an interface you can steer through language, so good use starts with understanding what kind of machine you are talking to rather than assuming perfect truth or unlimited awareness1234. That mindset matters because the model is generating from compressed prior knowledge, not directly consulting the world unless you connect tools to it51.
A big part of using LLMs well is model choice. Karpathy suggests starting simply, then switching to stronger reasoning-oriented models when the task actually needs better performance on math, code, or difficult reasoning67. This is a practical engineering tradeoff: do not pay extra complexity by default, but do escalate when the failure mode is genuine reasoning difficulty rather than a bad prompt or bad context7.
Context management is one of his clearest workflow rules. The tokens in a conversation are limited and valuable, so each old message competes with your next request for attention, latency, and cost8. That is why he advises keeping chats focused, avoiding irrelevant carryover, and starting a fresh thread when the earlier context is no longer helping the next task910.
Karpathy also emphasizes that the model should not work alone when the task depends on facts it may not contain or operations it may do unreliably. If you need current information, give it search; if you need calculations or structured computation, use external tools instead of pretending the model's internal knowledge is enough7. In this view, good prompting is often really good orchestration: selecting the right model, supplying the right context, and attaching the right tools around it43.
Finally, responsible use means keeping uncertainty visible. Karpathy warns that even advanced models can hallucinate, make arithmetic mistakes, or behave unpredictably, so you should treat them as tools in a toolbox, check their work, and remain accountable for the output. That caution extends beyond accuracy to security and robustness: prompt-based systems can be attacked or manipulated, so practical use includes verification, supervision, and awareness that this is an emerging engineering surface, not a solved interface1112.
4 principles from Andrej Karpathy
Treat prompting as programming
Use prompts deliberately, as instructions for a new kind of computer, not casual conversation alone. Be explicit about the task, constraints, and desired output because the interface is language-driven.
“…we're now programming computers in English…”
Choose the simplest model that can do the job
Start with a standard model and only switch to reasoning-focused models when the task really needs stronger performance in math, code, or hard reasoning. This keeps your workflow simpler while giving you a clear escalation path when needed.
“…these models that are thinking and trained with reinforcement learning…”
Guard the context window
Treat context as scarce budget. Keep chats on one topic, remove irrelevant buildup, and start a new conversation when old tokens no longer help the next question.
“…think of the tokens in the context window as a precious resource…”
Verify outputs and own the result
LLMs are useful assistants, but they are not fully reliable. Check important answers, review reasoning, and keep human responsibility for anything you ship, decide, or publish.
“All these attacks have defenses that have been developed and published and incorporated. Many of the attacks that I've shown you might not work anymore, and are patched over time. But I just want to give you a sense of this cat and mouse attack and defense games that happen in traditional security, and we are seeing equivalence of that now in the space of LM security. So I've only covered maybe three different types of attacks. I'd also like to mention that there's a large diversity of attacks. This is a very active emerging area of study, and...”
In his own words
The quotes behind the lesson, word for word from the transcripts. Numbers match the lesson above.
“…you're talking to a zip file…”
“…a large language model is just two files…”
“…we're now programming computers in English…”
“Okay, so software 3.0 is prompts, huh? And so I—I see this as quite new, unique. It's a new kind of a computer, and, uh, so in my mind it's, uh, worth giving it a new designation of software 3.0. And basically your prompts are now programs that program the LLM. I would argue that software 3.0 is actually…”
“…we kind of understand that they build and maintain some kind of a knowledge database…”
“…these models that are thinking and trained with reinforcement learning…”
“Today, so in particular, we saw that this is very useful and gives additional accuracy in problems like math, code, and reasoning. So try without reasoning first, and if your model is not solving that kind of, kind of a problem, try to switch to a reasoning model and look for that in the user interface on top of that. Then we saw that we are rapidly giving the models a lot more tools. So as an example, we can give them an internet search. So if you're talking about some fresh information or knowledge that is probably not in the zip file, then you actually want to use an internet search tool. And not all of these apps have it.”
“…think of the tokens in the context window as a precious resource…”
“…don't overload it with irrelevant information…”
“…if it is the case that those tokens are not any more useful to your next query, I encourage you to do this…”
“All these attacks have defenses that have been developed and published and incorporated. Many of the attacks that I've shown you might not work anymore, and are patched over time. But I just want to give you a sense of this cat and mouse attack and defense games that happen in traditional security, and we are seeing equivalence of that now in the space of LM security. So I've only covered maybe three different types of attacks. I'd also like to mention that there's a large diversity of attacks. This is a very active emerging area of study, and...”
“Well, it could be that if you train on a bad document that contains a trigger phrase, uh, that trigger phrase could trip the model into performing any kind of undesirable thing that the attacker might have a control over. So in this paper, for example, uh, the custom trigger phrase that they designed was James Bond. And what they showed that, um, if they have control over some portion of the training data during fine-tuning, they can create this trigger word James Bond, and if you, um, if you attach James Bond anywhere in, uh, your prompts, this breaks the model.”
Reflect
- Think of one recurring task in your work. How would you decide whether it needs a basic chat model, a reasoning model, or a tool-using workflow?
- Look at one of your recent LLM conversations. Which parts of the context were actually useful, and which parts probably distracted the model or wasted tokens?
- Where in your current use of LLMs are you accepting answers too easily? What lightweight verification step could you add?
Check your understanding
Go deeper
Andrej Karpathy on Using LLMs: Tools, Models, and Workflows2023 · 131 min · full transcript
Andrej Karpathy on Large Language Models: from pretraining to agents2024 · 60 min · full transcript
Andrej Karpathy on AI Engineering: Programming Is Changing Fast2024 · 69 min · full transcript
Andrej Karpathy on Software 2.0 to 3.0: AI Changes Everything2024 · 121 min · full transcript
- How does Andrej Karpathy decide when to use reasoning models, search, or tools with LLMs?
- What did Andrej Karpathy say about whether reasoning models can generalize beyond math and code?
- What did Andrej Karpathy say about JSON versus YAML token efficiency?
- What did Andrej Karpathy say about LLM security and prompt injection attacks?
- What did Andrej Karpathy say about software 3.0 and prompts?