Topic guide · 6 recordings · 21 verbatim quotes

Andrej Karpathy on AI Safety

Karpathy treats AI safety as a practical engineering problem: understand what models are, expect failure modes, and design around exploits, tokenization hazards, and unreliable behavior.

In short
  • He sees LLMs as alien, statistical systems, not human-like minds, so safety starts with understanding their nature.
  • Many real AI safety problems are concrete security issues such as attacks, prompt exploits, and data poisoning.
  • Tokenization is a major hidden source of weird behavior, sharp edges, and safety problems.
  • Safer use means treating context as scarce, avoiding irrelevant inputs, and using tools when the model lacks fresh facts or reliable reasoning.
  • As agents become more capable and autonomous, oversight and orchestration matter more because they can act for long periods on your behalf.
Watch: Karpathy on ai safetyThe key moments, back to back, in his own words
2 moments · 1 min
1 / 2
“I think of it as a very complicated alien artifact.”
Lex Fridman Podcast #333, 2024 · 6:33

AI safety starts with seeing LLMs for what they are

Karpathy frames modern AI as a fundamentally different kind of intelligence, not a human mind in software. He describes these systems as alien artifacts and also emphasizes that, in use, you are interacting with a compressed statistical object rather than a grounded, fully reliable thinker1.

That view matters for safety because it pushes against anthropomorphism. If you expect a model to understand like a person, you may trust it too much, give it the wrong tasks, or miss the ways it can fail while still sounding confident and coherent1.

He also explains that these systems appear to build and maintain some form of knowledge internally, but they generate outputs by continuing token sequences. So safe use begins with remembering both sides at once: they can know a lot, and they can still behave strangely because of how that knowledge is represented and produced4.

A lot of AI safety is really about exploits and security

Karpathy talks about safety in an unusually concrete way: models are vulnerable to attack, and the field is entering a familiar cat-and-mouse cycle of offense and defense. He says many attacks get patched over time, but the broader pattern remains: language-model security is becoming its own active area with many attack types and evolving defenses5.

One example he highlights is training-data poisoning during fine-tuning. If an attacker can insert a bad document with a trigger phrase, that phrase can later push the model into undesirable behavior under the attacker's control, which makes the training pipeline itself part of the safety surface6.

This practical focus fits his broader instinct that systems often have exploits worth searching for. In his wider framing, intelligence and complex systems should not be assumed to be clean or robust by default; people should actively look for hidden failure modes and loopholes.

Tokenization is a hidden safety layer with real sharp edges

Karpathy repeatedly stresses that tokenization is not a boring preprocessing detail. He says many problems that look like model failures are actually tokenization failures, which means safety work can go wrong if it focuses only on model architecture and ignores how text is chopped up and represented78.

He is especially blunt that this layer contains foot guns, sharp edges, security issues, and AI safety issues. In his framing, tokenization can distort spelling, string handling, non-English text, formatting, and other behaviors in ways that make systems brittle or unpredictable8.

That is why he urges people not to brush tokenization off. If you want safer systems, you need to inspect how inputs are encoded, how structured data is represented, and where tokenizer choices may create strange failure modes before the model even starts reasoning1011.

Safer everyday use comes from disciplined workflows

Karpathy's practical advice for using LLMs safely is to treat them as tools, not oracles. He recommends using them as one tool in a toolbox and remembering that the context window is a precious resource, which means prompt design and session hygiene directly affect reliability1213.

A key habit is to avoid stuffing the model with irrelevant context. He advises not overloading the context window with information that is no longer useful, and to start fresh when old tokens are not helping the next query, because irrelevant context can degrade performance and steer outputs in bad directions1415.

He also recommends using external tools when the task needs fresh information, calculation, or stronger reasoning. For safety, that means not forcing a plain chat model to do jobs it is poorly suited for when search or a reasoning-oriented model would reduce error and overconfidence1617.

Agentic AI raises the stakes because models can act for you

Karpathy describes a shift from asking models for isolated outputs to letting agents run for longer stretches with less human involvement. His central question is how to get more agents operating for longer on your behalf, which makes safety less about a single answer and more about monitoring, delegation, and control of ongoing action.

He also says agents may soon do many tasks better than humans. That increases the upside, but it also means mistakes can scale: a capable system acting autonomously can propagate errors, pursue the wrong objective, or create dependence if people stop checking its work closely enough19.

This is not just a distant concern. He notes that when top LLMs go down, people experience something like an intelligence brownout, which suggests growing dependence on AI systems in real workflows. From a safety perspective, resilience, fallback plans, and human review become more important as capability rises21.

Karpathy on ai safety, in his own words

“I think of it as a very complicated alien artifact.”
Lex Fridman Podcast #333, 2024
“A lot of the issues that may look like just issues with the neural network architecture or the large language model itself are actually issues with the tokenization…”
Talk / tutorial presentation, 2019

Where to watch

  1. Andrej Karpathy on Large Language Models: from pretraining to agents2024 · 60 min · full transcriptBest overview of practical LLM security issues, including attacks, defenses, and poisoning during fine-tuning.
  2. Andrej Karpathy on Tokenization: Building GPT's Tokenizer2019 · 134 min · full transcriptShows why tokenization creates weird behavior, foot guns, and safety risks that many people overlook.
  3. Andrej Karpathy on Using LLMs: Tools, Models, and Workflows2023 · 131 min · full transcriptMost useful for safer day-to-day use: context discipline, tool use, and when not to trust the model alone.
  4. Andrej Karpathy on Code Agents: The Loopy Era of AI2023 · 67 min · full transcriptExplains why agentic systems change the safety problem by acting longer and more autonomously on your behalf.
  5. Andrej Karpathy on Artificial Intelligence: Aliens, AGI, and Exploits2024 · 209 min · full transcriptBest for his high-level worldview: AI as an alien artifact and systems with possible exploits worth actively probing.

Questions people ask

Go deeper · free courseThe Andrej Karpathy Course13 chapters on everything Karpathy taught, with a certificate at the end.Start learning →

Sources

Every quote above, word for word from the transcripts. Numbers match the text.

1
“I think of it as a very complicated alien artifact.”
Lex Fridman Podcast #333, 2024
4
“…we kind of understand that they build and maintain some kind of a knowledge database…”
Intro to Large Language Models, YouTube interview, 2024
5
“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...”
Intro to Large Language Models, YouTube interview, 2024answer page →
6
“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.”
Intro to Large Language Models, YouTube interview, 2024answer page →
7
“A lot of the issues that may look like just issues with the neural network architecture or the large language model itself are actually issues with the tokenization…”
Talk / tutorial presentation, 2019
8
“So tokenization is at the heart of a lot of weirdness in large language models, and I would advise that you do not brush it off. A lot of the issues that may look like just issues with the neural network architecture or the large language model itself are actually issues with the tokenization and fundamentally trace back to it. So if you've noticed any issues with large language models — can't, you know, not able to do spelling tasks very easily — that's usually due to tokenization. Simple string processing can be difficult for the large language model to perform natively. Non-English languages can…”
Talk / tutorial presentation, 2019answer page →
10
“…tokenization is my least favorite part of working with large language models…”
Talk / tutorial presentation, 2019
11
“More efficient in tokens. Um, so for example, these are the same in JSON and in YAML. The JSON is 116 and the YAML is 99, so quite a bit of an improvement. And so in the token economy, where we are paying per token in many ways, and you are paying in the context length, and you're paying in, um, dollar amount for the cost of processing all this kind of structured data, when you have to, um, so prefer to use the YAML over JSON. And in general, kind of like, the tokenization density is something that you have to, um, sort of care about and worry about at all times and try to find efficient encoding schemes, and spend a lot of time in the tokenizer, and measure the different token efficiencies of different formats and settings and so on.”
Talk / tutorial presentation, 2019answer page →
12
“…use it as a tool in a toolbox…”
Deep Dive into LLMs like ChatGPT, 2022
13
“…think of the tokens in the context window as a precious resource…”
Talk / online presentation, June 2023
14
“…don't overload it with irrelevant information…”
Talk / online presentation, June 2023
15
“…if it is the case that those tokens are not any more useful to your next query, I encourage you to do this…”
Talk / online presentation, June 2023
16
“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.”
Talk / online presentation, June 2023answer page →
17
“…these models that are thinking and trained with reinforcement learning…”
Talk / online presentation, June 2023
19
“The things that agents can do, they can probably do better than you or, like, very soon.”
No Priors interview, 2023
21
“And I think what's also a little fascinating, and we saw this in the last few days, actually, a lot of the LLMs went down and people were kind of like stuck and unable to work. And I think it's kind of fascinating to me that when the state-of-the-art LLMs go down, it's actually kind of like an intelligence brownout. Dude, that's a terrifying statement. There's something so true about this, though. There's this entire critical thinking path that people have relied on for so long. And now, for the first time, instead of just offloading, say, memorizing phone numbers, memorizing emails, or even having my calendar automatically let me know, as opposed to me looking at my calendar, right? There's like an entire kind of world that we've already browned out, if you will, that if one of these services…”
Conference keynote, March 2024answer page →

How this guide was made: drafted with AI from the full transcripts of the recordings cited, then checked: every quotation must match a transcript word for word and be the speaker's own words, and an independent review gates accuracy. Methodology and corrections.

All 6 recordings of Andrej Karpathy on AI Safety

Search every transcript
Open the full search page →