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