
Deep Dive into LLMs like ChatGPT
Andrej Karpathy
Summary
Large Language Models (LLMs) like ChatGPT are built through sequential stages of pre-training on vast internet data, fine-tuning on human-curated conversations to develop an assistant persona, and reinforcement learning to foster emergent reasoning, ultimately serving as powerful yet fallible tools best used with careful prompting and verification.
Key Takeaways
- Training Pipeline: LLMs undergo three main training stages: pre-training on immense quantities of diverse internet text to create a "base model" (a token simulator); supervised fine-tuning (SFT) on human-labeled conversational data to shape it into a helpful assistant; and reinforcement learning (RL) to enhance problem-solving and emergent reasoning. 0:50
- Tokenization and Compute: LLMs process text as one-dimensional sequences of "tokens" (sub-word chunks), not characters. Each token benefits from a fixed, limited amount of computation, meaning complex reasoning (like multi-step math or counting) must be distributed across many tokens (chain-of-thought prompting) rather than crammed into one, or offloaded to external tools. 7:45
- Understanding Hallucinations: LLM "knowledge" from pre-training is a vague recollection stored in billions of parameters, while the context window acts as working memory. Hallucinations often occur when models confidently imitate the style of correct answers from their training data, even when uncertain; this is mitigated by explicitly training them to say "I don't know" and by enabling external tools like web search. 1:20:40
- Emergent Reasoning via RL: Reinforcement Learning, particularly on verifiable problems (e.g., math, code), encourages LLMs to discover and develop sophisticated, multi-step "cognitive strategies" or "chains of thought" for problem-solving that go beyond human-provided examples, leading to higher accuracy. This "thinking" process, observed in "reasoning models," is distinct from simple imitation. 2:14:00
- Practical Use & Limitations: LLMs exhibit a "Swiss cheese" capability model, performing brilliantly on complex tasks but failing unexpectedly on simple ones (e.g., counting, basic spelling or numerical comparisons) due to their token-based processing and computational limits. Users should treat LLMs as powerful tools for inspiration or first drafts, always verifying their output and leveraging external tools like code interpreters for tasks requiring precise calculation or character manipulation. 1:55:57
- Future Capabilities & Resources: Expect multimodal LLMs that natively process audio and images, long-running AI "agents" that perform multi-step tasks requiring human supervision, and increasingly pervasive, integrated AI assistance. Stay updated through resources like the LMSys Arena leaderboard (with caution), AI news newsletters, and tech discussions on X/Twitter. Models can be accessed via proprietary platforms (ChatGPT), inference providers (Together.ai), or run locally on personal devices (LM Studio for smaller, distilled versions). 3:09:43




