GPT = Generative Pre-trained Transformer. A transformer is a specific neural network, invented by Google in 2017 for translation, and it is the core invention under the current AI boom. The variant behind ChatGPT is trained to do one thing: predict what token comes next as a probability distribution.
Generation is just repeated prediction. Give the model a seed, sample one token from its predicted distribution, append it, and run again. GPT-2 produces gibberish this way; GPT-3, the same design but far bigger, produces coherent text. Scale is the difference.
The pipeline is: tokens → vectors → (attention → MLP) repeated → last vector → probability distribution. Attention lets vectors exchange context (the word "model" means different things in "machine learning model" vs "fashion model"); the MLP block refines each vector in parallel. Almost every step is matrix multiplication with learned weights.
Meaning lives as direction in a high-dimensional space. Words embed as vectors (GPT-3 uses 12,288 dimensions); similar meanings land close together, and directions carry semantic meaning (E(woman) − E(man) points the same way as E(queen) − E(king)).
The numbers are enormous but countable. GPT-3 has 175,181,291,520 weights in 27,938 matrices across 8 categories; the embedding matrix alone is ~617 million weights (50,257 tokens × 12,288 dims).
Softmax + temperature turn raw scores into choices. The final "unembedding" step produces one raw score (a logit) per token; softmax normalizes them into probabilities, and a temperature knob controls how sharply the model favors the top choice.
What a transformer is, and what it is for
GPT stands for Generative Pre-trained Transformer: a bot that generates text, that learned from a massive amount of data (with room to fine-tune afterward), built on the transformer architecture.
The GPT acronym broken down; "Pre-trained" refers to the massive up-front training that a later fine-tuning step can build on. (0:16)
The original transformer (Google, 2017) was built for translation. The ChatGPT-style variant is trained instead to take a piece of text and predict the next chunk as a probability distribution over all possible continuations.
The whole task in one picture: given the text so far, put a probability on every possible next token. (3:19)
Prediction becomes generation by looping: sample a token from the distribution, append it, predict again. Run GPT-2 this way and the story wanders; swap in GPT-3 (same basic model, much bigger) and it suddenly makes sense. This repeated predict-and-sample loop is exactly what you watch when ChatGPT writes one word at a time.
How data flows through the model
At a high level, generating one word works like this:
The input is split into tokens (words, word-pieces, or common character combinations; for images or audio, small patches or chunks).
Each token becomes a vector (a list of numbers) meant to encode its meaning. Read as coordinates in a high-dimensional space, words with similar meanings sit close together.
Every token is turned into a vector. These columns of numbers are the model's working representation of the text. (3:57)
The vectors pass through an attention block, which lets them talk to each other and update their values based on context. Attention is what figures out that "model" in "a machine learning model" differs from "model" in "a fashion model".
They then pass through a multi-layer perceptron (MLP / feed-forward) block, where every vector is processed in parallel through the same operation, refining it further.
Attention and MLP blocks repeat, back and forth, until the meaning of the whole passage is baked into the last vector, which is turned into a probability distribution over next tokens.
The two workhorse blocks: attention (vectors exchange context) then a multilayer perceptron (each vector refined in parallel), stacked over and over. (4:40)
Every operation in both blocks is a giant pile of matrix multiplications. Understanding a transformer is mostly understanding how to read those matrices.
The shape and scale of the weights
Deep learning works because these models share one training algorithm (backpropagation) that scales well, provided the model follows a strict format: inputs are arrays of real numbers (tensors), transformed layer by layer, where parameters only ever touch the data through weighted sums (packaged as matrix-vector products).
The learned parameters are called weights. GPT-3 has 175,181,291,520 of them, organized into 27,938 matrices that fall into just 8 categories.
The scale, made countable: 175 billion weights, 27,938 matrices, 8 categories. GPT-3 stays the reference because later models' exact numbers are kept private. (11:14)
Keep a sharp mental line between the weights (the learned "brains" of the model, fixed after training) and the data being processed (whatever specific input is fed in for one run).
Embeddings: meaning as direction
The first matrix is the embedding matrix (W_E): one column per vocabulary word. Each column is the vector that word turns into. Its values start random and are learned from data.
The embedding matrix W_E: about 50,000 columns, one per token, each column the starting vector for that word. (13:08)
GPT-3's embeddings have 12,288 dimensions. Working in a space with that many distinct directions is what lets directions carry meaning.
A 3D projection of a much higher-dimensional space. During training the model settles on embeddings where directions carry semantic meaning. (14:33)
The classic demonstrationthe difference E(woman) − E(man) is close to E(queen) − E(king), so one direction in the space encodes something like gender.
E(woman) − E(man) is a direction. Add it to E(king) and you land near E(queen); "gender" is a direction the model discovered on its own. (15:09)
The same trick composesE(Hitler) + E(Italy) − E(Germany) lands near E(Mussolini); the model has learned directions for "Italian-ness" and for "WWII axis leader". (Grimmer example, same mechanism as the playful E(Germany) − E(Japan) + E(sushi) ≈ E(bratwurst).)
Directions compose. Country and role each have their own direction, so vector arithmetic maps one leader to another. (16:04)
A useful piece of intuition for the next chapter: the dot product of two vectors measures how well they align (positive when they point the same way, zero when perpendicular, negative when opposed), and it is itself a weighted sum, which fits the "everything is matrix multiplication" theme.
The embedding matrix is the first pile of weights: 50,257 tokens × 12,288 dimensions ≈ 617 million weights, a small slice of the eventual 175 billion.
Context: vectors that soak up their surroundings
Do not think of an embeddingvector as fixed to one word. As it flows through the network it gets tugged by each block, so a vector that began as "king" can end up pointing at "a king who lived in Scotland, achieved his post by murdering the previous king, and is described in Shakespearean language." The point of the network is to let each vector absorb a far richer, context-specific meaning than a lone word could hold.
The model processes a fixed number of vectors at once, its context size (2048 for GPT-3). That limit is why long chats with early ChatGPT felt like the bot losing the thread.
The context window: the model can only hold this many token-vectors at once when predicting the next word. (19:55)
The output step: unembedding, softmax, temperature
The desired output is a probability distribution over next tokens. Two steps produce it.
First, the unembedding matrix (W_U) maps the last vector to one raw score for every token in the vocabulary. Give the model "Harry Potter … least favourite teacher, Professor ___" and a well-trained network assigns a high score to "Snape".
The unembedding step turns the final vector into one score per token; here "Snape" dominates at 0.78. (20:47)
Those raw scores are called logits. W_U mirrors the embedding matrix (rows instead of columns), adding another ~617 million weights.
Second, softmax turns the logits into a valid probability distribution (each value in [0,1], all summing to 1): exponentiate every number, then divide each by the total. The largest input ends up near 1, the rest near 0, but softly, so close-second choices still get real weight.
After softmax the scores are a probability distribution: mostly weight on the top candidate, some spread to the runners-up. (22:36)
A constant T (temperature) in the softmax exponents controls sharpness. Higher T spreads weight toward lower-probability tokens (more variety, more risk of nonsense); lower T concentrates on the top token; T = 0 always picks the maximum.
Temperature in action: at T = 0 the next word is "little" with 100% weight; at high T the distribution flattens and riskier words like "young" become likely. (24:37)
The chapter's real purpose is to lay the groundwork (embeddings, softmax, dot products, matrix multiplication) so the attention mechanism, the heart of the transformer, is smooth to learn in the next chapter.
Tools and resources
Item
What it is
Reference
Transformer (2017, Google)
The architecture under modern LLMs; introduced for translation
temperature is a single knob trading determinism for variety; T = 0 is fully deterministic, high T is creative but risks nonsense.
System value
the fleet mixes deterministic gates (which want reproducible, low-variance output) with drafting (which benefits from variety). Making the temperature an explicit, audited setting per call-type, low for gates and verifiers, higher for brainstorm/drafting, would make gate outputs more reproducible.
Proposed form
a reference note plus a one-line audit of where the fleet's claude -p / OpenRouter calls set (or omit) temperature.
Target project
fleet-control.
2
Context-budget awareness as a first-class mission field
a model silently "loses the thread" once content exceeds its context window; the limit is hard, not graceful.
System value
the fleet already flagged a "token-observation seam" for per-mission budgets. Framing that budget as a context window the mission must fit within (not just a spend cap) matches how the model actually fails, and argues for chunking long-doc missions before they silently truncate.
Proposed form
a design note tying the existing token-observation seam to a context-fit check.
Target project
fleet-control.
3
Embedding-direction intuition for the vault memory index
semantic similarity is proximity in embedding space, and meaningful directions can be composed with vector arithmetic.
System value
the memory index is keyword/FTS-based today. A small semantic-embedding layer over the same corpus could catch related-but-differently-worded notes the keyword index misses; this video is a clean explainer of why that works.
Proposed form
a spike note evaluating a local embedding search over the memory roots (proposal only, no build).
Target project
fleet-control / alexana-workspace.
Take this with you
Save the playbook to read later, or hand the raw notes to your favorite AI.
What's this?
The Markdown file (a .md file) is a plain-text copy of this whole playbook, written in the simple format AI chat tools read best. It keeps the headings, links, timestamps, and captions and drops all the page styling. Think of it as the raw notes behind this page, ready to hand to an assistant.
To use it, download the file and drag it into ChatGPT, Claude, or any AI chat (or just paste the text in), then ask for what you want: “Summarize this into a one-page cheat sheet,” “Turn these steps into a checklist I can follow,” or “Quiz me on the key ideas.” Because the file is already structured, the assistant works from the real content instead of guessing.