Save this video free

Deep Dive into LLMs like ChatGPT

Andrej Karpathy · 3:31:24 · Watch on YouTube

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Andrej Karpathy provides a comprehensive deep dive into Large Language Models (LLMs) like ChatGPT, detailing their construction from pre-training on internet data to supervised fine-tuning (SFT) with curated conversations and reinforcement learning (RL) for emergent reasoning. He explains tokenization, Transformer architecture, inference, computational requirements (GPUs), and the psychological implications like hallucinations, emphasizing LLMs as powerful but imperfect tools requiring careful use and verification.

Key takeaways

Chapters

0:00 Introduction to LLMs like ChatGPT
1:00 Stage 1: Pre-training - Downloading and Processing the Internet
5:30 Data Filtering and Cleaning for Pre-training
9:01 PII Removal and Data Set Finalization
12:22 Tokenization: Representing Text for Neural Networks
20:00 Exploring Tokenization with Tiktoken
24:00 Pre-training Data Size: 15 Trillion Tokens
25:17 Stage 2: Neural Network Training - Predicting the Next Token
29:13 Neural Network Input/Output and Random Initialization
33:32 Transformer Architecture: The Core of Modern LLMs
38:24 Transformer Internals: Parameters and Mathematical Expressions
43:22 Stage 3: Inference - Generating New Data
51:42 GPT-2: A Foundational Modern LLM (2019)
57:30 Training GPT-2: Monitoring Loss and Updates
1:05:02 Computational Requirements: GPUs and Data Centers
1:11:41 Model Releases: Base Models vs. Assistants
1:17:27 Interacting with Llama 3 Base Model
1:23:58 Eliciting Knowledge and Memorization in Base Models
1:33:28 Few-Shot Prompting and In-Context Learning
1:38:52 Post-training Stage: Turning Base Models into Assistants
1:48:21 Tokenizing Conversations and Special Tokens
1:56:53 InstructGPT: Early Work on Supervised Fine-Tuning (SFT)
2:05:06 Modern SFT Data Sets: Synthetic and Human-Assisted
2:08:20 Understanding ChatGPT's Behavior: Simulating Human Labelers
2:13:53 LLM Psychology: Hallucinations and Their Origins
2:20:47 Mitigating Hallucinations: Knowledge Refusal
2:33:44 Mitigation 2: Tool Use for Factual Accuracy
2:45:37 Context Window vs. Parameter Knowledge
2:49:07 LLM Psychology: Knowledge of Self and Identity
2:58:26 LLM Psychology: Computational Limitations and Reasoning
3:08:35 Tool Use for Math and Counting: Code Interpreter
3:21:52 LLM Psychology: Tokenization and Spelling Deficits
3:27:24 LLM Psychology: 'Swiss Cheese' Capabilities and Random Failures

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 hi everyone so I've wanted to make this video for a while it is a comprehensive but General audience introduction to large language models like Chachi PT and what I'm hoping to achieve in this video is to give you kind of mental models for thinking through what it is that this tool is it is obviously magical and amazing in some respects it's uh really good at some things not very good at other things and there's also a lot of sharp edges to be aware of so what is behind this text box you can put anything in there and press enter but uh what should we be putting there and what are these words generated back how does this work and what what are you talking to exactly so I'm hoping to get at all those topics in this video we're going to go through the entire pipeline of how this stuff is built but I'm going to keep everything uh sort of accessible to

0:48 a general audience so let's take a look at first how you build something like chpt and along the way I'm going to talk about um you know some of the sort of cognitive psychological implications of the tools okay so let's build Chachi PT so there's going to be multiple stages arranged sequentially the first stage is called the pre-training stage and the first step of the pre-training stage is to download and process the internet now to get a sense of what this roughly looks like I recommend looking at this URL here so um this company called hugging face uh collected and created and curated this data set called Fine web and they go into a lot of detail on this block post on how how they constructed the fine web data set and

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Andrej Karpathy.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.