Glossary

All 146 terms from every course, in plain language. Each one links to the lesson where you can try it out.

Activation function
The function a neuron applies to its weighted sum, such as sigmoid, tanh or ReLU.
Attention
A mechanism that lets each token weigh how relevant other tokens are to it, then mix in their information.
Attention head
One independent set of queries, keys and values. GPT-2 small has 12 per layer, 144 in all.
Attention sink
A token, often the first one, where heads put attention when nothing else is useful.
Backpropagation
The method for working out how much each weight contributed to the loss, by passing errors backwards through the network.
Backward pass
Working from the loss back to the inputs, multiplying local derivatives to get the gradient of the loss at every node. (When a value feeds several nodes, the gradients coming back along each path are added.)
Base model
A model that has been pre-trained but not yet tuned to follow instructions; it continues text.
Bayes’ theorem
P(A | B) = P(B | A) · P(A) / P(B): a way to turn P(B | A) into P(A | B) using the base rate.
Bias
A number added to a neuron’s weighted sum that shifts how easily it fires.
Byte-pair encoding
A way to build a tokeniser’s vocabulary: start from single bytes and repeatedly merge the pairs that appear most often in the training text.
Calibration
How well a model’s stated or implied confidence matches how often it is actually right.
Capacity
How complex a pattern a model can represent, roughly set by how many neurons and layers it has.
Causal attention
Attention in which each token can only look at itself and earlier tokens. Used by models that write text one token at a time.
Chain of thought
Asking a model to write out intermediate steps before its final answer.
Chain rule
The rate of change of a composition is the product of the local rates: dy/dx = dy/du · du/dx.
Chat template
The fixed text format, with special tokens, that lays out a conversation for an assistant model.
Chunking
Splitting long documents into short passages so each can be embedded and retrieved separately.
Citation
A pointer in an answer, like [1], to the source a fact came from.
Classifier
A model that sorts inputs into categories, like spam or not spam.
Component
One of the numbers in a vector, such as how far its arrow goes along x or along y.
Composition
Feeding the output of one function into another, written f(g(x)).
Computational graph
A diagram of a calculation broken into simple steps, with arrows showing which values feed into which.
Conditional probability
P(A | B): the probability of A among only the cases where B is true. In general it is not the same as P(B | A).
Confidence target
An instruction that wrong answers cost points, so a model should answer only when it is confident enough.
Context
Background facts in the prompt that the model couldn’t otherwise know, such as your situation or a document.
Context window
How much of the earlier text a model can see when predicting the next token. GPT-2’s is 1,024 tokens.
Contour line
A line on a map joining points where a function has the same value.
Cosine similarity
A score from −1 to 1 that measures the angle between two vectors: 1 means they point the same way.
Cross-entropy loss
For one example, −ln of the probability the model gave the correct answer; also called log-loss.
Decision boundary
The border in input space where the model switches from predicting one class to another.
Demonstration
An example reply, written or chosen by a person, used to show a model the behaviour wanted.
Derivative
The slope of a function at each point: the limit of (f(x + h) − f(x)) / h as h → 0, written f′(x).
Determinant
For a 2×2 matrix, ad − bc: a signed area scale factor. Its size is the factor by which areas scale, and it is negative when the plane is flipped over.
Dimension
One position in a vector. A GloVe vector has 300 numbers, so it lives in a 300-dimensional space.
Direction
A line through the space, such as female − male, found by averaging the differences between word pairs. Measuring a vector along it gives a meaningful score.
Diverging
When steps overshoot by more each time and the loss grows instead of shrinking.
Dot product
Multiply two vectors number by number and add up the results. Large when they point the same way.
DPO
Direct preference optimisation: training a model directly on preference pairs with a classification-style loss, without a separate reward model.
Embedding
The vector a model uses to represent a word (or other item), arranged so that similar things get similar vectors.
Epoch
One full pass over all the training data.
Fabricated citation
A reference a model invents, with a plausible title or author, that doesn’t exist.
Feature
A measurable property that describes each example, such as the share of an email’s characters that are exclamation marks.
Few-shot prompting
Putting a few worked examples of a task in the prompt so the model continues the pattern, without changing its parameters.
Finite difference
Estimating a derivative by nudging an input by a small amount and dividing the change in output by the nudge.
Forward pass
Running an input through the network, layer by layer, to get a prediction.
Generalisation
How well a model performs on new data it has never seen.
Global minimum
The lowest loss anywhere in the landscape.
GloVe
A widely used set of word vectors from Stanford (2014), learned from how often words appear near each other in billions of words of text.
GPT-2
A language model released by OpenAI in 2019. The small version has 124 million parameters, 12 layers and 12 attention heads per layer, and was trained on WebText, about 40 GB of web pages.
Gradient
The steepness of the loss along every parameter at once, gathered into one arrow; it points uphill.
Gradient descent
Repeatedly nudging the parameters a little way against the gradient, so the loss goes down.
Greedy decoding
Always choosing the single most likely next token.
Grounding
Tying a model’s answer to specific source text that a reader can check.
Hallucination
When a model generates false or made-up content and presents it as if it were true.
Hidden layer
A layer of neurons between the inputs and the output. Nobody tells it what its outputs should be — the training data only gives the right answer for the final output.
Hyperparameter
A setting chosen by a person before training, such as k in k-NN (later lessons meet another: the learning rate).
î and ĵ
The unit vectors [1, 0] and [0, 1] along the axes; a matrix’s columns are where they land.
Induction head
A kind of attention head that finds an earlier copy of the current token and looks at the token that followed it.
Intercept
The value the line predicts when the input is zero; it shifts the line up or down.
Joint probability
The probability that two things are both true, such as having a condition and testing positive.
Key
In attention, a vector describing what a token offers, matched against queries.
Knowledge cut-off
The date up to which a model’s training text was collected; it knows nothing later unless told.
Label
The known answer attached to a training example, such as spam or not spam.
Language model
A model that gives a probability for every possible next token, given the text so far.
Learned feature
A pattern a hidden neuron has learned to respond to, such as an edge or a corner. Unlike the input features in the first lesson, nobody chooses these.
Learning rate
A hyperparameter that sets how big each gradient descent step is.
Least squares
Choosing the line that gives the smallest possible mean squared error.
Length (norm)
How long a vector’s arrow is: the square root of the sum of its squared components, written |a|.
Linear transformation
A way of moving every point that keeps grid lines straight, parallel and evenly spaced and leaves the origin fixed.
Linearly separable
Data that a single straight line (or flat plane) can split perfectly into its classes, like Adelie and Gentoo penguins by bill depth and flipper length.
Local derivative
How much one node’s output changes with one of its own inputs, ignoring the rest of the graph.
Local minimum
A point lower than everything around it, but not necessarily the lowest point overall.
Logit
A raw score a model gives one class before softmax; it can be any number, positive or negative.
Loss
A single number measuring how wrong a model is on its data. Training tries to make it small.
Loss curve
The loss plotted against one parameter, such as the slope of a line, with everything else held fixed or chosen at its best.
Loss landscape
The loss for every possible setting of a model’s parameters, pictured as hills and valleys.
Matrix
A rectangular grid of numbers; multiplying a vector by it applies a linear transformation.
Matrix multiplication
Combining two matrices into one that performs both transformations; in B·A, A acts first.
Mean squared error
A loss: square every residual, then take the average.
Nat
The unit of surprise or cross-entropy when natural logs are used; logs base 2 give bits instead.
Natural frequencies
Expressing probabilities as counts out of a whole group, such as “51 out of 10,000”.
Natural logarithm (ln)
The logarithm with base e ≈ 2.718: ln y is the power you raise e to in order to get y.
Nearest neighbours (k-NN)
Classify a new point by letting the k most similar training examples vote.
Nearest neighbours (of a word)
The items whose vectors are most similar to a given item’s vector.
Neuron
The basic unit of a neural network: it weights its inputs, adds a bias and applies an activation function.
Next-token probability
The chance a model gives each possible next token; it writes text by repeatedly choosing among them.
Noise
Random variation in measurements that is not part of the underlying pattern, like the day-to-day weather on top of the seasons.
Outlier
A data point far from the pattern of the rest, such as a huge house recorded as a partial sale at a fraction of its size-based price.
Overfitting
When a model fits the noise in its training data, doing well there but badly on new data.
Parameter
A number inside a model that is learned from data, like the slope and intercept of a line.
Partial derivative
How fast a function of several inputs changes when only one input moves and the rest are held fixed, written ∂f/∂x.
PCA
Principal component analysis: a standard way to flatten many dimensions into a few by keeping the directions along which the data spreads out most.
Perplexity
exp of a language model’s average cross-entropy (in nats) per token; lower means less surprised by the text.
Polynomial
A curve built from powers of x, such as a + bx + cx². Its degree is the highest power used.
Post-training
Training that comes after pre-training, to turn a base model into one that follows instructions and behaves as intended.
Pre-training
The first, largest stage of training, in which a model learns to predict the next token across a huge amount of text.
Precision
Of the cases a classifier flags as positive, the share that really are: TP / (TP + FP).
Preference data
Records of which of two or more model responses people judged better.
Prevalence (base rate)
The share of a group that has a condition before any test is done: P(condition).
Projection
The shadow one vector casts on the line through another; its signed length is a·b / |a|.
Prompt
The text you give a model: your instructions, any context or examples, and your question.
Query
In attention, a vector describing what a token is looking for.
Regression
Predicting a number, such as a price, rather than a category.
Regularisation
A penalty added during training that discourages overly complex models, such as large coefficients.
ReLU
Rectified linear unit: outputs z when z is positive and 0 otherwise.
Residual
The difference between a real value and the model’s prediction for it.
Retrieval-augmented generation (RAG)
Searching for relevant text and adding it to the prompt so a model answers from those sources.
Reward model
A model trained on preference data to give a response a single score predicting how much people would like it.
RLHF
Reinforcement learning from human feedback: fine-tuning a model to earn higher scores from a reward model trained on human preferences.
Saddle point
A flat point (zero gradient) that is uphill in some directions and downhill in others, so it is neither a peak nor a dip.
Sampling
Choosing the next token at random, weighted by the model’s probabilities.
Scalar
An ordinary single number, used to stretch, shrink or flip a vector by multiplying each component.
Secant
A straight line through two points on a curve; its slope is the average rate of change between them.
Self-attention
The transformer step in which each token is scored against other tokens to decide what to draw information from.
Self-supervised learning
Learning in which the training targets come from the data itself, such as the next token of a text, rather than from human labels.
Sensitive data
Personal, confidential or private information that shouldn’t be shared with outside services.
Sensitivity
P(positive | has the condition): the share of real cases a test catches. Called recall in machine learning.
Slope
How much the prediction rises for each one-unit increase in the input.
Softmax
Turns a list of scores into positive weights that add up to 1; a score one point higher than another gets about 2.7 times its weight, so large gaps in score become very large gaps in weight.
Specificity
P(negative | doesn’t have the condition): the share of people without it whom the test correctly clears.
Supervised fine-tuning (SFT)
Further training of a pre-trained model on example prompts paired with the replies people want.
Surprise
How unexpected an outcome was, −ln p for an outcome given probability p; also called self-information.
System message
Instructions an app places at the start of the conversation, usually hidden from the user, which also use up tokens.
Tangent
The straight line through a point on a curve with the same slope as the curve there; close to that point it hugs the curve.
Temperature
A setting that sharpens (below 1) or flattens (above 1) the probabilities before sampling.
Test error
How far a model’s predictions are from held-out examples it never saw during fitting.
Test set
Labelled examples kept hidden during training, used only to measure how well a model generalises.
Token
A chunk of text, often a word or part of a word, that a language model reads and writes.
Tokeniser
The step that splits text into tokens and turns each one into an ID number.
Top-k retrieval
Keeping only the k highest-scoring passages from a search to put in the prompt.
Top-k sampling
Sampling only from the k most likely tokens, ignoring the rest.
Training data
Labelled examples a model learns from.
Training error
How far a model’s predictions are from the examples it was fitted to.
Training tokens
The amount of text a model learned from, counted in tokens.
Transformer
A neural network design built from stacked layers of attention and other parts. It powers most modern language models.
Truncation
Cutting text, often the oldest messages, so that a conversation fits inside the context window.
Underfitting
When a model is too simple to capture the pattern, so it does poorly even on its training data.
Validation set
Labelled examples held back from training and used to choose settings such as k, so the test set can stay untouched until the very end.
Value
In attention, the information a token passes on to the tokens that attend to it.
Vector
An ordered list of numbers. It can be pictured as an arrow pointing somewhere in space.
Vocabulary
The full list of tokens a tokeniser can produce; GPT-2’s has 50,257 entries.
Weight
A number that sets how strongly, and in which direction, an input influences a neuron.
Weighted sum
Each input multiplied by its weight, all added together. With the bias added on, it is often written z.
Word analogy
Vector arithmetic such as king − man + woman, whose result lands near a related word like queen.
XOR
“Exclusive or”: true when exactly one of two inputs is true. A classic pattern no single line can separate.
Zero-shot prompting
Asking a model to do a task with instructions only, without examples.