ATRIUMsearch → argument graph
Video · 2026-07-10 · 52m · 18 moments

I Built an LLM From Scratch

✦ AI generated

timeline · colored by role

01
Context

Given enough context, written language is highly predictable, and this same statistical predictability is what modern LLMs exploit when they predict the next token.

CJ traces LLM next-token prediction back to Claude Shannon's 1950 letter-guessing experiment with his wife, which showed language has deep statistical structure.

transcript

CJ: his finding was, given enough context, the next letter is often nearly certain. Now, this means that language has deep statistical structure, and over 70 years later, that's pretty much what an LLM is doing. It's predicting what is coming next.

explains mechanism · 1

02
Definition

LLMs are statistical models of language that extract patterns from massive amounts of text and build a mathematical representation of how words relate to each other, making them fundamentally next-token predictors.

CJ frames LLMs as statistical models that predict the next token based on deep patterns in language, building on Claude Shannon's 1950 finding that written language has strong statistical predictability.

transcript

CJ: LLMs are statistical models of language. They extract patterns and relationships from massive amounts of text, and they build a mathematical representation of how words relate to each other.

explains mechanism · 2extends · 2gives example · 1provides context · 1supports · 1

03
Mechanism

Backpropagation, published in 1986 by Rumelhart, Hinton, and Williams, solved the training problem for multi-layer neural networks by propagating error backward through layers and adjusting weights, and this same algorithm still underlies every modern LLM.

CJ explains that backpropagation, invented in 1986, solved the problem of training multi-layer networks and remains the core training method behind every modern LLM.

transcript

CJ: That breakthrough came in 1986. David Rumelhart, Geoffrey Hinton, and Ronald Williams published a paper in nature describing backpropagation, which is a method for training multi-layer networks. Essentially, you make a prediction, measure how wrong it is, and then propagate the error signal backward through every layer, adjusting each weight to make the prediction slightly less wrong.

04
Mechanism

Backpropagation, published in 1986 by Rumelhart, Hinton, and Williams, works by making a prediction, measuring the error, and propagating that error backward through every layer to adjust weights, and this same algorithm still trains every modern neural network including today's LLMs.

CJ explains that the 1986 backpropagation paper solved the multi-layer network training problem left open by the perceptron's failure on XOR, and that this exact method still trains today's LLMs.

transcript

CJ: David Rumelhart, Geoffrey Hinton, and Ronald Williams published a paper in nature describing backpropagation, which is a method for training multi-layer networks. Essentially, you make a prediction, measure how wrong it is, and then propagate the error signal backward through every layer, adjusting each weight to make the prediction slightly less wrong.

05
Mechanism

A token, not a word or character, is the fundamental unit of text an LLM operates on, and it's produced by splitting text with the byte pair encoding (BPE) algorithm.

CJ explains that models break prompts into tokens (sub-word pieces found via byte pair encoding), not literal words or characters, and this choice directly affects cost and context window limits.

transcript

CJ: Now, a model breaks your prompt into pieces, not words, not characters, it's something in between. A token is the smallest unit of text a language model works with. The word the is one token. The word tokenization might be split into token and ization, two tokens.

06
Mechanism

Byte pair encoding, originally an unrelated 1994 data compression technique, was repurposed in 2015 to let models learn a vocabulary automatically by iteratively merging the most common character pairs in training data, rather than requiring a predefined word list.

CJ describes how BPE, invented in 1994 for data compression, was adapted in 2015 to build neural-network vocabularies by merging common character pairs, letting one algorithm handle any language without hand-written rules.

transcript

CJ: BPE was invented in 1994 by Philip Gage as a data compression technique. It has nothing to do with language models... Instead of deciding in advance what all of the words are or what your vocabulary is, you let BPE learn a vocabulary by iteratively merging the most common character pairs in your training data.

07
Mechanism

Byte pair encoding lets a model learn its vocabulary automatically by iteratively merging the most common character pairs in training data, rather than requiring word lists to be defined in advance, which lets one algorithm handle any language or code without language-specific rules.

CJ describes how researchers repurposed 1994's byte pair encoding compression algorithm in 2015 to automatically build tokenizer vocabularies for neural machine translation, a technique still used by LLMs today.

transcript

CJ: Instead of deciding in advance what all of the words are or what your vocabulary is, you let BPE learn a vocabulary by iteratively merging the most common character pairs in your training data. So, common words like the stay whole and then rare words get split into sub word pieces.

08
Example

Word2vec embeddings trained purely on word co-occurrence statistics spontaneously encode concepts like gender and royalty as vector arithmetic, such that king minus man plus woman equals queen.

CJ recounts Mikolov's 2013 word2vec finding that embedding vectors trained only on word co-occurrence spontaneously capture relationships like gender and royalty, letting 'king - man + woman' resolve to 'queen'.

transcript

CJ: For instance, take the vector for the word king, subtract the vector for the word man, add the vector for the word woman, and the closest result is queen. Now, nobody told the model about gender or royalty. These concepts just emerged purely from the statistics of which words appear near other words.

explains mechanism · 1

09
Example

Word2vec's embedding vectors capture real semantic relationships purely from word co-occurrence statistics, so that mathematically subtracting 'man' from 'king' and adding 'woman' lands closest to 'queen', without anyone teaching the model about gender or royalty.

CJ recounts Mikolov's 2013 word2vec discovery that vector arithmetic on embeddings (king - man + woman = queen) reveals emergent semantic structure the model was never explicitly taught.

transcript

CJ: Take the vector for the word king, subtract the vector for the word man, add the vector for the word woman, and the closest result is queen. Now, nobody told the model about gender or royalty. These concepts just emerged purely from the statistics of which words appear near other words.

explains mechanism · 2gives example · 1

10
Example

Word embedding vectors trained via word2vec capture real semantic relationships, like gender and royalty, purely from word co-occurrence statistics, without anyone explicitly teaching the model those concepts.

CJ describes the famous word2vec discovery that king minus man plus woman lands near queen, arguing this structure emerged purely from statistical patterns in text rather than any built-in knowledge.

transcript

CJ: For instance, take the vector for the word king, subtract the vector for the word man, add the vector for the word woman, and the closest result is queen. Now, nobody told the model about gender or royalty. These concepts just emerged purely from the statistics of which words appear near other words.

explains mechanism · 1gives example · 2

11
Mechanism

In self-attention, each token generates a query, key, and value vector, and the model compares every query against every key to determine how much each token's meaning should be shaped by the other tokens around it.

CJ breaks down the query/key/value mechanism of self-attention, using the word 'bank' to show how the same token ends up with different meaning-bearing vectors depending on surrounding context.

transcript

CJ: For each token, the model generates three vectors from its embedding: a query, a key, and a value. Think of the query as what this token is looking for. The key is what each token offers, and the value is what gets passed along when there's a match. The model compares every query against every key, scores the matches, and mixes the values accordingly.

12
Mechanism

Self-attention works by having each token generate a query, key, and value vector, where the query represents what a token is looking for, the key represents what each token offers, and matches between them determine how information from the value vectors gets mixed into a new context-aware vector for each token.

CJ explains the core query-key-value mechanism of self-attention, illustrating with 'bank' getting different contextual meaning depending on whether nearby words are 'river/muddy' or 'deposit/money'.

transcript

CJ: For each token, the model generates three vectors from its embedding: a query, a key, and a value. Think of the query as what this token is looking for. The key is what each token offers, and the value is what gets passed along when there's a match.

gives example · 1

13
Mechanism

Self-attention resolves a word's meaning by comparing it against every other token in the sentence, so the same word gets a different vector depending on its surrounding context.

CJ walks through the query/key/value mechanism of self-attention, showing how the word 'bank' ends up with different vector representations depending on whether the surrounding words are about rivers or money.

transcript

CJ: The model compares every query against every key, scores the matches, and mixes the values accordingly. The output is a new vector for each token, the same shape as the input, but now carrying information from the rest of the sentence. So, the word bank in the sentence "Bank of the river was muddy" ends up with a vector shaped mostly by river and muddy.

provides context · 1

14
Mechanism

LLMs generate text autoregressively, predicting and appending one token at a time with no overall plan for how the output will end.

CJ explains that after producing one token, the model appends it and reruns the entire pipeline to predict the next, meaning coherent-looking paragraphs are actually built blindly, one step at a time.

transcript

CJ: To get the next token, we append the token to the input and then run this entire process again so we get new attention, new distribution, new predicted token, append, repeat. And this whole process is known as auto regressive generation. Essentially, the model has no plan. It doesn't know how the sentence ends when it starts. So, every coherent paragraph from an LLM emerges one blind step at a time.

extends · 1provides context · 1

15
Mechanism

A pretrained model only becomes a useful chatbot after fine-tuning on question-answer data and RLHF, where human raters' judgments define what counts as a 'good' response.

CJ explains that after pretraining produces a 'fancy autocomplete,' companies fine-tune the model on curated Q&A pairs and then apply RLHF, where paid human raters rank responses to shape the model's behavior.

transcript

CJ: Essentially, real humans are hired to sit down and rate the responses of the model. Good chatbot-like responses get ranked high, bad responses get ranked low. Now, what defines good and bad is entirely up to the company that trains the model, and also up to the judgment of those human rankers.

16
Claim

LLMs are extremely sophisticated pattern-matching autocomplete systems trained only on text, not systems with true understanding or a replication of human brain intelligence, making 'alien intelligence' a more accurate label than 'artificial intelligence'.

After building an LLM from scratch, CJ concludes they are sophisticated autocomplete systems without true understanding, and suggests 'alien intelligence' better describes them than 'artificial intelligence' since they're trained on text alone, unlike the human brain.

transcript

CJ: the more I feel like LLMs really just are the most sophisticated pattern matching autocomplete things we've ever built. I really don't think that they have true understanding... AI is probably better described as something like alien intelligence rather than artificial intelligence because it's intelligent, but it's not necessarily a fake version of human intelligence.

explains mechanism · 1extends · 1supports · 1

17
Claim

LLMs are the most sophisticated pattern-matching autocomplete systems ever built, lacking true understanding, and are better described as 'alien intelligence' than artificial intelligence because they predict tokens from language statistics rather than replicating how human brains actually think.

In closing, CJ argues that after building an LLM from scratch, he's convinced LLMs are advanced autocomplete without true understanding, and proposes calling them 'alien intelligence' since they run on language statistics rather than anything resembling human cognition.

transcript

CJ: The more I feel like LLMs really just are the most sophisticated pattern matching autocomplete things we've ever built. I really don't think that they have true understanding... AI is probably better described as something like alien intelligence rather than artificial intelligence because it's intelligent, but it's not necessarily a fake version of human intelligence. It's something entirely different.

extends · 1supports · 1

18
Claim

LLMs are best understood as sophisticated statistical pattern-matching systems without true understanding, more like an 'alien intelligence' than a human-like artificial intelligence, since they train only on text rather than however the brain actually works.

After building an LLM from scratch, CJ concludes that these systems don't truly understand language the way humans do since they're trained only on text, not on how the brain actually operates, making 'alien intelligence' a more accurate label than 'artificial intelligence.'

transcript

CJ: So, for me, that actually reinforces the idea that LLMs are predicting the next token based on language statistics, not necessarily like replicating what's happening with human intelligence and what's actually happening in the brain. So, in my opinion, AI is probably better described as something like alien intelligence rather than artificial intelligence because it's intelligent, but it's not necessarily a fake version of human intelligence.

extends · 2gives example · 1

Highlight slides
Word2vec: Meaning from Co-occurrence Alone✦ from: Word2vec embeddings trained purely on word co-occurrence statistics spontaneously encode concepts like gender and royalty as vector arithmetic, such that king minus man plus woman equals queen.Vector Arithmetic: King - Man + Woman = Queen✦ from: Word2vec embeddings trained purely on word co-occurrence statistics spontaneously encode concepts like gender and royalty as vector arithmetic, such that king minus man plus woman equals queen.Word2vec's Emergent Semantics✦ from: Word2vec's embedding vectors capture real semantic relationships purely from word co-occurrence statistics, so that mathematically subtracting 'man' from 'king' and adding 'woman' lands closest to 'queen', without anyone teaching the model about gender or royalty.The word2vec Discovery✦ from: Word embedding vectors trained via word2vec capture real semantic relationships, like gender and royalty, purely from word co-occurrence statistics, without anyone explicitly teaching the model those concepts.Why It Matters✦ from: Word2vec's embedding vectors capture real semantic relationships purely from word co-occurrence statistics, so that mathematically subtracting 'man' from 'king' and adding 'woman' lands closest to 'queen', without anyone teaching the model about gender or royalty.Why It Matters✦ from: Word embedding vectors trained via word2vec capture real semantic relationships, like gender and royalty, purely from word co-occurrence statistics, without anyone explicitly teaching the model those concepts.Meaning From Statistics Alone✦ from: Word embedding vectors trained via word2vec capture real semantic relationships, like gender and royalty, purely from word co-occurrence statistics, without anyone explicitly teaching the model those concepts.LLMs Are Autocomplete, Not Understanding✦ from: LLMs are extremely sophisticated pattern-matching autocomplete systems trained only on text, not systems with true understanding or a replication of human brain intelligence, making 'alien intelligence' a more accurate label than 'artificial intelligence'.LLMs Are Sophisticated Autocomplete, Not Understanding✦ from: LLMs are the most sophisticated pattern-matching autocomplete systems ever built, lacking true understanding, and are better described as 'alien intelligence' than artificial intelligence because they predict tokens from language statistics rather than replicating how human brains actually think.Rebranding AI as 'Alien Intelligence'✦ from: LLMs are the most sophisticated pattern-matching autocomplete systems ever built, lacking true understanding, and are better described as 'alien intelligence' than artificial intelligence because they predict tokens from language statistics rather than replicating how human brains actually think.Rename: 'Alien' Not 'Artificial' Intelligence✦ from: LLMs are extremely sophisticated pattern-matching autocomplete systems trained only on text, not systems with true understanding or a replication of human brain intelligence, making 'alien intelligence' a more accurate label than 'artificial intelligence'.LLMs: Statistics, Not Understanding✦ from: LLMs are best understood as sophisticated statistical pattern-matching systems without true understanding, more like an 'alien intelligence' than a human-like artificial intelligence, since they train only on text rather than however the brain actually works.'Alien Intelligence' vs 'Artificial Intelligence'✦ from: LLMs are best understood as sophisticated statistical pattern-matching systems without true understanding, more like an 'alien intelligence' than a human-like artificial intelligence, since they train only on text rather than however the brain actually works.
Related episodes