Glossary
Every term the course teaches, in plain words, with a link to the chapter where it is explained.
65 of 65 terms
- Ablation
- An experiment that removes or switches off one part of a model and runs it again, to see what that part did. Chapter 24: Translate a sentence end to end
- Adam
- The optimiser the paper trained with: it keeps running averages of each weight's recent slopes and of their squares, and gives every weight a step size of its own. Theory: 5.3 Optimizer
- Additive attention
- An older way to score a query against a key: both are fed into a small neural network instead of being multiplied. Theory: 3.2.1 Scaled dot-product attention
- Anaphora
- A word, such as a pronoun, that refers back to something mentioned before: “it” for “the dog”. Theory: Appendix: attention visualisations
- Attention
- A way for each word to build its new vector from all the words of the text at once, weighting each by how relevant it is. Chapter 7: Why attention
- Attention weight
- How much one word looks at another: a number from 0 to 1, and the weights of each word add up to 1. Chapter 7: Why attention
- Auto-regressive
- Writing one token at a time, each time reading the tokens already written as part of the input. Theory: 3 Model architecture
- Beam search
- Writing by keeping the few most likely beginnings at every step (4 in the paper) and choosing among the finished ones at the end. Chapter 19: Translating: greedy search and beam search
- BLEU
- A score from 0 to 100 for a machine translation: how many of its words and short phrases also appear in a human translation, with a penalty for being too short. Theory: Abstract
- Byte-pair encoding (BPE)
- A way to build a vocabulary of word pieces: start from letters and repeatedly merge the most frequent pair of neighbouring pieces. The paper used it (section 5.1). Chapter 2: Tokens
- Constituency parsing
- Turning a sentence into a tree of its phrases, such as noun phrases and verb phrases, down to each word's part of speech. Theory: 6.3 English constituency parsing
- Context window
- The most tokens a model reads at once: the prompt and the answer so far together. Chapter 23: From tiny to large
- Convolution
- A layer that slides the same small set of weights along a sequence, reading a window of k neighbouring positions at a time. Theory: 2 Background
- Cosine similarity
- The dot product of two vectors divided by both their lengths: the cosine of the angle between them, from −1 to 1. Chapter 3: Vectors and the dot product
- d_model
- The number of values in every token's vector as it passes through the model: 512 in the paper, 64 in our models. Chapter 5: Embeddings
- Decoder
- The half of the paper's model that writes, one token at a time: masked self-attention, encoder–decoder attention and a feed-forward network per layer, then the softmax. Chapter 18: The decoder and encoder–decoder attention
- Decoder-only model
- A transformer with only the decoder's masked self-attention and feed-forward layers, no encoder: it reads the prompt and its own answer as one sequence. GPT-style models are built so. Chapter 22: Decoder only: how GPT-style models use the design
- Dot product
- Two vectors multiplied entry by entry and added up: large when they point the same way, 0 at right angles, negative when they point apart. Chapter 3: Vectors and the dot product
- Dropout
- During training only, switching a random share of values off (P_drop = 0.1 in the paper) and scaling the rest up, so the model cannot rely on any single value. Chapter 14: Residual connections and layer normalisation
- Embedding
- The learned vector a token's id stands for: one row of the embedding table, scaled by √d_model in the paper. Chapter 5: Embeddings
- Encoder
- The half of the paper's model that reads the whole input at once: N layers of self-attention and feed-forward networks, whose output every decoder layer reads. Chapter 17: The encoder
- Encoder-only model
- A transformer with only the encoder, such as BERT: it reads a whole text at once and produces vectors for it, and does not write text. Chapter 23: From tiny to large
- Encoder–decoder attention
- Attention with queries from the decoder and keys and values from the encoder's output: where each word being written looks at the input. Chapter 18: The decoder and encoder–decoder attention
- Feed-forward network
- The second sub-layer of every transformer layer: each word on its own is widened by W₁, passed through a ReLU and narrowed by W₂, with the same matrices for every position. Chapter 13: The position-wise feed-forward network
- FLOPs
- Floating-point operations: the multiplications and additions a computer performs. Training cost is often counted in them. Theory: 6.1 Machine translation
- GELU
- A smooth activation function: close to 0 for large negative inputs, close to the input for large positive ones, with no corner at 0. Chapter 22: Decoder only: how GPT-style models use the design
- Greedy search
- Writing by always taking the single most likely next token. Fast, but an early choice cannot be undone. Chapter 19: Translating: greedy search and beam search
- Head
- One of the attentions that multi-head attention runs side by side, each with its own W^Q, W^K and W^V on a slice of the vector. Chapter 11: Multi-head attention
- Key
- A word's vector times W^K: what the word offers to be found by. Queries are dotted with it. Chapter 8: Queries, keys and values
- Label smoothing
- Training against a target that gives the right word a little less than 1 and spreads the rest (ε_ls = 0.1 in the paper) over all words. Chapter 20: Training as the paper did
- Language model
- A model that gives every token it knows a probability of coming next, given the text so far. Writing is that step repeated. Chapter 1: What a language model does
- Layer (of the encoder or decoder)
- One block of the transformer, stacked N times: attention and a feed-forward network, each with a residual connection and layer normalisation; the decoder's has a second attention over the encoder's output. Chapter 16: Stacking layers
- Layer normalisation
- Rescaling one word's vector to mean 0 and variance 1, then applying a learned γ and β. The paper applies it after every residual addition. Chapter 14: Residual connections and layer normalisation
- Learned positions
- A row of numbers for each position, learned in training like any weight, added to the token's embedding instead of the paper's sine waves. Chapter 22: Decoder only: how GPT-style models use the design
- Learning rate
- How big a step training takes against the loss's slope; the paper's schedule warms it up for warmup_steps and then lets it fall as 1/√step. Chapter 20: Training as the paper did
- Length penalty
- A factor that grows with a translation's length, ((5 + |Y|)/6)^α; dividing the log-probability by it keeps beam search from always preferring short translations. Chapter 19: Translating: greedy search and beam search
- Linear transformation
- What a matrix does to vectors: stretch, turn, shear or flip, keeping straight lines straight. Y = XW + b is the building block. Chapter 4: Matrices: machines that turn vectors
- Logit
- A raw score from the model's last layer for one token of the vocabulary, before the softmax turns the scores into probabilities. Chapter 6: Softmax: scores into probabilities
- Loss
- The number training lowers: for each word, minus the logarithm of the probability the model gave the right one. Chapter 20: Training as the paper did
- Mask
- Scores set to −∞ before the softmax, so the words they belong to get exactly 0 weight. The decoder masks the future. Chapter 10: Masking
- Masked self-attention
- Self-attention in which each word may look only at itself and the words before it: how a model that writes one word at a time is trained. Chapter 10: Masking
- Matrix
- A grid of numbers. Multiplying a vector by it gives another vector, each entry a dot product with one column. Chapter 4: Matrices: machines that turn vectors
- Output matrix (W^O)
- The matrix that mixes the joined outputs of all the heads back into one vector of d_model numbers per word. Chapter 11: Multi-head attention
- Parameter
- One learned number of a model: an entry of a weight matrix or a bias. Our paper model has about a quarter of a million; the paper's base model about 65 million. Chapter 4: Matrices: machines that turn vectors
- Path length
- How many steps information takes between two positions inside a network: n − 1 through a recurrent layer, 1 through self-attention. Chapter 21: Why self-attention
- Perplexity
- How surprised a model is by the right token: e to the power of its loss. 1 means certain; lower is better. Theory: 5.4 Regularisation
- Positional encoding
- A vector added to each word's embedding that depends only on its position; the paper's is made of sine and cosine waves. Chapter 12: Positions as sine waves
- Pre-normalisation
- Layer normalisation applied to a sub-layer's input, x + Sublayer(LayerNorm(x)), instead of to the residual sum as in the paper. Chapter 22: Decoder only: how GPT-style models use the design
- Query
- A word's vector times W^Q: what the word is looking for. It is dotted with every key. Chapter 8: Queries, keys and values
- Recurrent network
- A model that reads a sequence one element at a time, carrying everything read so far in one hidden state. The transformer replaced it. Chapter 7: Why attention
- ReLU
- max(0, z): keeps a positive number and turns a negative one into 0. The paper's feed-forward networks use it. Chapter 13: The position-wise feed-forward network
- Residual connection
- Adding a sub-layer's input back to its output, x + Sublayer(x), so the original vector always gets through and the sub-layer only learns a correction. Chapter 14: Residual connections and layer normalisation
- Scaled dot-product attention
- softmax(QKᵀ / √d_k) V: dot every query with every key, divide by √d_k, take the softmax of each row, mix the values. Chapter 9: Scaled dot-product attention
- Self-attention
- Attention in which the queries, keys and values all come from the same sequence, so every word looks at the words of its own sentence. Chapter 17: The encoder
- Sequential operations
- Steps that must happen one after another: n for a recurrent layer, one for self-attention. Table 1 of the paper counts them. Chapter 21: Why self-attention
- Softmax
- e to the power of each score, divided by their sum: turns any scores into probabilities that add up to 1, keeping their order. Chapter 6: Softmax: scores into probabilities
- Temperature
- A number T the scores are divided by before the softmax: below 1 sharpens the probabilities, above 1 flattens them. Chapter 6: Softmax: scores into probabilities
- Token
- The unit a model reads and writes: a word, a piece of a word or a punctuation mark. Prices and context limits are counted in tokens. Chapter 2: Tokens
- Token id
- A token's row number in the vocabulary: the number the model actually receives. Chapter 2: Tokens
- Tokenizer
- The step before the model: it cuts text into tokens and replaces each with its id. Chapter 2: Tokens
- Top-k
- A sampling setting: keep only the k most likely next words and share the probability among them before drawing one. Chapter 25: Trace a next-word prediction
- Value
- A word's vector times W^V: what the word passes on to the words that attend to it. Chapter 8: Queries, keys and values
- Vector
- A list of numbers. Two numbers can be drawn as an arrow; a transformer works with lists of d_model numbers per token. Chapter 3: Vectors and the dot product
- Vocabulary
- The fixed list of tokens a model knows, each with its id. Our models share one of English and German words; the paper's has about 37,000 byte-pair pieces. Chapter 2: Tokens