Full Transcript

·YouTLDR

Large Language Models explained briefly

7:37848 summary words · ~4 min readEnglishBy 3Blue1BrownTranscribed Aug 18, 2026
Analyze another video with Pro30-day money-back guarantee
Summary

Large language models are deterministic mathematical functions that assign probabilities to potential next words, developing fluent conversational abilities through billions of parameters tuned across massive text corpora and refined by human feedback.

Demystifies the illusion of machine consciousness by showing how conversational competence emerges purely from mathematical optimization, massive parallel computing, and probabilistic pattern completion.

Section summaries

0:00-1:00

How Chatbots Generate Language

watch

The section introduces the analogy of completing a script between a human and an AI assistant. It explains that a language model is fundamentally a mathematical function that assigns probabilities to all possible subsequent words given an input passage. Chatbots feed user queries into an ongoing dialogue prompt and iteratively sample next-word predictions to generate responses.

  • LLMs generate responses by repeatedly predicting the single most plausible next word.
  • Chatbots format queries as incomplete dialogue scripts that the model completes.

Crucial foundational mental model for understanding what LLMs actually do.

1:00-2:00

Random Sampling and Training Scale

watch

The speaker clarifies why deterministic models produce varied outputs: they introduce randomness by sometimes selecting lower-probability tokens. The discussion transitions to data scale, pointing out that training a model like GPT-3 requires more text than a human could read non-stop over 2,600 years. This massive corpus forms the basis for setting hundreds of billions of continuous values known as parameters.

  • Response variability stems from probabilistic sampling, not model non-determinism.
  • GPT-3's training dataset exceeds 2,600 years of non-stop human reading.

Provides critical scale comparisons and explains why outputs vary across runs.

2:00-3:00

Backpropagation and Parameter Optimization

watch

This part details how neural network parameters evolve from random initialization to structured competence. Training inputs are fed with the final word masked, allowing the model's output distribution to be compared against the actual word. Backpropagation mathematically adjusts all weights across trillions of examples to raise the probability of the correct token, which generalizes to unseen text.

  • Models initialize with random weights and produce pure gibberish prior to training.
  • Backpropagation iteratively nudges weights to make correct completions more probable.

Explains the core mathematical mechanism behind neural network learning.

3:00-4:00

Compute Requirements and RLHF Alignment

watch

The section illustrates the staggering computational burden of training frontier models, estimating that doing the arithmetic manually at one billion operations per second would take over 100 million years. It introduces the distinction between pre-training (internet-scale text prediction) and Reinforcement Learning with Human Feedback (RLHF). RLHF aligns the base model to act as a safe and helpful assistant through human evaluations.

  • Frontier LLM training requires well over 100 million years of human-equivalent math operations.
  • RLHF bridges the gap between generic internet autocompletion and assistant utility.

Distinguishes base model capabilities from aligned chatbot behavior.

4:00-6:00

Transformers, Embeddings, and the Attention Mechanism

watch

The discussion covers how Google's 2017 transformer architecture revolutionized NLP by processing text in parallel via GPU acceleration. Text is first converted into high-dimensional numerical vectors (embeddings) encoding word meanings. The attention mechanism enables these vectors to exchange context dynamically (such as disambiguating 'bank' into 'riverbank'), which then pass through feed-forward layers to refine next-token predictions.

  • Transformers process whole passages simultaneously rather than sequentially.
  • The attention mechanism updates vector embeddings dynamically based on surrounding context.
  • Feed-forward layers provide additional parameter capacity to store learned language patterns.

Provides the most detailed technical breakdown of transformer mechanics in the video.

6:00-7:00

Emergence, Interpretability, and Additional Resources

watch

The final section addresses the interpretability challenge: because linguistic competence emerges organically from hundreds of billions of tuned parameters, it is nearly impossible to fully trace why a specific output was generated. The speaker summarizes the resulting fluency and utility of LLMs before pointing viewers to supplementary deep-dive series and lectures on deep learning and attention.

  • LLM fluency is an emergent property rather than a hardcoded capability.
  • The sheer volume of parameters makes full mechanistic interpretability extraordinarily difficult.

Summarizes the philosophical and practical challenges of AI interpretability.

Key points

  • Probabilistic Next-Word Prediction — Chatbots operate by structuring a prompt as an incomplete script between a user and an assistant, predicting subsequent words iteratively based on probability distributions rather than producing predetermined responses.
  • Parameter Tuning via Backpropagation — An LLM's behavior is dictated by hundreds of billions of continuous values called parameters or weights, which initialize randomly and are iteratively adjusted using backpropagation to increase the likelihood of predicting true target words across training samples.
  • Two-Stage Training: Pre-training vs. RLHF — Pre-training teaches the model raw language patterns by autocompleting internet text, while reinforcement learning with human feedback (RLHF) steers parameters toward helpful, safe, and conversational persona behaviors.
  • Parallel Attention in Transformers — Unlike sequential models, transformers ingest entire text blocks simultaneously, converting words into numerical vectors that dynamically interact via an attention operation to update meanings based on surrounding context.
  • Emergent Complexity and Opacity — While humans engineer the underlying mathematical architectures, the specific linguistic reasoning and nuanced outputs are emergent properties of parameter optimization, making internal interpretability exceptionally difficult.
A large language model is a sophisticated mathematical function that predicts what word comes next for any piece of text. Grant Sanderson
No human ever deliberately sets those parameters. Instead, they begin at random, meaning the model just outputs gibberish, but they're repeatedly refined based on many example pieces of text. Grant Sanderson

AI-generated from the transcript. May contain errors.

0:01

[Submit subtitle corrections at criblate.com] Imagine you happen across a short movie script that

0:03

describes a scene between a person and their AI assistant.

0:07

The script has what the person asks the AI, but the AI's response has been torn off.

0:13

Suppose you also have this powerful magical machine that can take

0:16

any text and provide a sensible prediction of what word comes next.

0:21

You could then finish the script by feeding in what you have to the machine,

0:25

seeing what it would predict to start the AI's answer,

0:28

and then repeating this over and over with a growing script completing the dialogue.

0:33

When you interact with a chatbot, this is exactly what's happening.

0:37

A large language model is a sophisticated mathematical function

0:40

that predicts what word comes next for any piece of text.

0:44

Instead of predicting one word with certainty, though,

0:47

what it does is assign a probability to all possible next words.

0:51

To build a chatbot, what you do is lay out some

0:54

text that describes an interaction between a user

0:56

and a hypothetical AI assistant, you add on whatever

0:59

the user types in as the first part of

1:02

the interaction, and then have the model repeatedly predict the next word that such a

1:07

hypothetical AI assistant would say in response, and that's what's presented to the user.

1:13

In doing this, the output tends to look a lot more natural if

1:16

you allow it to select less likely words along the way at random.

1:20

So what this means is even though the model itself is deterministic,

1:23

a given prompt typically gives a different answer each time it's run.

1:28

Models learn how to make these predictions by processing an enormous amount of text,

1:32

typically pulled from the internet.

1:34

For a standard human to read the amount of text that was used to train GPT-3,

1:39

for example, if they read non-stop 24-7, it would take over 2600 years.

1:44

Larger models since then train on much, much more.

1:48

You can think of training a little bit like tuning the dials on a big machine.

1:52

The way that a language model behaves is entirely determined by these

1:56

many different continuous values, usually called parameters or weights.

2:01

Changing those parameters will change the probabilities

2:04

that the model gives for the next word on a given input.

2:07

What puts the large in large language model is how

2:10

they can have hundreds of billions of these parameters.

2:15

No human ever deliberately sets those parameters.

2:18

Instead, they begin at random, meaning the model just outputs gibberish,

2:22

but they're repeatedly refined based on many example pieces of text.

2:27

One of these training examples could be just a handful of words,

2:30

or it could be thousands, but in either case, the way this works is to

2:34

pass in all but the last word from that example into the model and

2:38

compare the prediction that it makes with the true last word from the example.

2:43

An algorithm called backpropagation is used to tweak all of the parameters

2:47

in such a way that it makes the model a little more likely to choose

2:51

the true last word and a little less likely to choose all the others.

2:55

When you do this for many, many trillions of examples,

2:58

not only does the model start to give more accurate predictions on the training data,

3:03

but it also starts to make more reasonable predictions on text that it's never

3:07

seen before.

3:09

Given the huge number of parameters and the enormous amount of training data,

3:13

the scale of computation involved in training a large language model is mind-boggling.

3:19

To illustrate, imagine that you could perform one

3:22

billion additions and multiplications every single second.

3:26

How long do you think it would take for you to do all of the

3:29

operations involved in training the largest language models?

3:33

Do you think it would take a year?

3:36

Maybe something like 10,000 years?

3:39

The answer is actually much more than that.

3:41

It's well over 100 million years.

3:45

This is only part of the story, though.

3:47

This whole process is called pre-training.

3:49

The goal of auto-completing a random passage of text from the

3:52

internet is very different from the goal of being a good AI assistant.

3:56

To address this, chatbots undergo another type of training,

4:00

just as important, called reinforcement learning with human feedback.

4:04

Workers flag unhelpful or problematic predictions,

4:07

and their corrections further change the model's parameters,

4:11

making them more likely to give predictions that users prefer.

4:14

Looking back at the pre-training, though, this staggering amount of

4:18

computation is only made possible by using special computer chips that

4:23

are optimized for running many operations in parallel, known as GPUs.

4:28

However, not all language models can be easily parallelized.

4:32

Prior to 2017, most language models would process text one word at a time,

4:36

but then a team of researchers at Google introduced a new model known as the transformer.

4:43

Transformers don't read text from the start to the finish,

4:46

they soak it all in at once, in parallel.

4:49

The very first step inside a transformer, and most other language models for that matter,

4:54

is to associate each word with a long list of numbers.

4:57

The reason for this is that the training process only works with continuous values,

5:02

so you have to somehow encode language using numbers,

5:05

and each of these lists of numbers may somehow encode the meaning of the

5:09

corresponding word.

5:10

What makes transformers unique is their reliance

5:13

on a special operation known as attention.

5:16

This operation gives all of these lists of numbers a chance to talk to one another

5:21

and refine the meanings they encode based on the context around, all done in parallel.

5:27

For example, the numbers encoding the word bank might be changed based on the

5:31

context surrounding it to somehow encode the more specific notion of a riverbank.

5:37

Transformers typically also include a second type of operation known

5:41

as a feed-forward neural network, and this gives the model extra

5:44

capacity to store more patterns about language learned during training.

5:49

All of this data repeatedly flows through many different iterations of

5:53

these two fundamental operations, and as it does so,

5:56

the hope is that each list of numbers is enriched to encode whatever

6:00

information might be needed to make an accurate prediction of what word

6:04

follows in the passage.

6:07

At the end, one final function is performed on the last vector in this sequence,

6:11

which now has had a chance to be influenced by all the other context from the input text,

6:16

as well as everything the model learned during training,

6:19

to produce a prediction of the next word.

6:22

Again, the model's prediction looks like a probability for every possible next word.

6:28

Although researchers design the framework for how each of these steps work,

6:32

it's important to understand that the specific behavior is an emergent phenomenon

6:37

based on how those hundreds of billions of parameters are tuned during training.

6:42

This makes it incredibly challenging to determine

6:45

why the model makes the exact predictions that it does.

6:48

What you can see is that when you use large language model predictions to autocomplete

6:53

a prompt, the words that it generates are uncannily fluent, fascinating, and even useful.

7:05

If you're a new viewer and you're curious about more details on how

7:08

transformers and attention work, boy do I have some material for you.

7:12

One option is to jump into a series I made about deep learning,

7:16

where we visualize and motivate the details of attention and all the other steps

7:20

in a transformer.

7:22

Also, on my second channel I just posted a talk I gave a couple

7:25

months ago about this topic for the company TNG in Munich.

7:29

Sometimes I actually prefer the content I make as a casual talk rather than a produced

7:33

video, but I leave it up to you which one of these feels like the better follow-on.

Continue with YouTLDR

Analyze another video with Pro

Process a new video, search every timestamp, compare sources, and keep the result in your library.

Get Pro — $12/month30-day money-back guarantee

More transcripts

Explore other videos transcribed with YouTLDR.