FIG · Cheatsheet

Stuck on a word? Start here.

If you froze the first time someone said "loss function" or "gradient," this page is for you. Every word here is explained the way you'd explain it to a friend over coffee.

The whole idea, in plain words

Machine learning is how a computer gets good at a task by looking at lots of examples instead of being given step-by-step rules. You start with a model that is basically a big pile of adjustable numbers, set to random values, so at first its guesses are nonsense. You show it an example, let it guess, and then measure how wrong the guess was with a single score. The computer figures out which way to nudge each of its numbers to make that wrongness score a little smaller, and it makes the nudge. Repeat this millions of times over many examples and the numbers slowly settle into values that produce good guesses. That whole repeated nudging process is called training. The real goal is not to ace the examples it studied, but to do well on brand-new things it has never seen, which is what makes it actually useful.

The Data and the Setup

What you feed the model, how you split it, and the two big ways of learning.

feature

One piece of information about an example that the model looks at when making a guess.

If you are guessing a house's price, the features are things like its size, number of bedrooms, and neighborhood, each column in your spreadsheet.

See it in Ch 01

supervised learning

Teaching a model from examples where you already know the right answer for each one.

Like flashcards with the answer on the back: you show the model a photo labeled 'cat' over and over until it learns to call new cat photos 'cat' on its own.

See it in Ch 01

unsupervised learning

Letting a model find groupings or patterns in examples when nobody has told it the right answers.

Hand someone a pile of unlabeled fruit and they'll naturally sort the round red ones from the long yellow ones, discovering the categories without being told they exist.

See it in Ch 01

training set

The batch of examples the model actually studies and learns from.

This is the textbook the model reads. Everything it knows, it picked up from here.

See it in Ch 01

validation set

A separate batch of examples you check the model against while you're still tinkering, to see how it's doing.

Like the practice quizzes you take while studying, they tell you whether to keep going or change your approach, without being the real exam.

See it in Ch 01

test set

A batch of examples you hide away and use only once at the very end to get an honest score.

The final exam. If you peek at it while studying, the grade no longer means anything, so you save it for last.

See it in Ch 01

data leakage

When hints about the answers sneak into the studying, making the model look smarter than it really is.

Like a student who secretly saw the final exam before taking it. They ace the test, but they didn't actually learn anything.

See it in Ch 01

one-hot encoding

A way to turn a category like a color into numbers the model can use, by making a yes/no slot for each option.

Instead of writing 'red', you make three boxes, is-red, is-green, is-blue, and tick exactly one. This stops the model from wrongly thinking blue is 'bigger than' red.

See it in Ch 02

scaling

Rewriting your numbers so that very large measurements and very small ones are put on a comparable footing.

Heights run 0 to 200 cm but incomes run into the millions. Scaling shrinks them to the same playing field so the model doesn't assume income matters more just because its numbers are huge.

See it in Ch 02

tensor

A chunk of numbers arranged in a grid, or many grids stacked on top of each other.

A single photo is a grid where each spot holds a number from 0 to 255 saying how bright that pixel is. Stack three photos and you've got a deeper stack of numbers. When you feed data to a model, you're really just shipping these number-grids through its calculations.

See it in Ch 10

embedding

A list of numbers that stands in for a word (or an image, or any thing), arranged so that similar things get similar lists.

'King' might become the list [0.2, 0.8, 0.1] and 'queen' [0.25, 0.75, 0.15]. The numbers are close because the words are related, while 'fork' would be far off. The model learns these lists so it can measure how alike two things are by comparing their numbers directly.

See it in Ch 10

dtype

The kind of number a value is stored as, like a decimal versus a whole number.

Like choosing whether to write grocery prices with cents (decimals) or rounded to whole dollars (whole numbers), same idea of a price, different way of writing it down.

See it in Ch 10

ground truth

The correct, human-given answer for a piece of data, used to judge the model's guess.

You ask a person 'is this a dog?' and they say yes, that 'yes' is the truth you grade the model against.

See it in Ch 12

token ID

The unique number assigned to each chunk, used to look up its meaning in a table.

Like a seat number: 'cat' is seat 7,392, and handing over that number fetches whatever is stored at that seat.

See it in Ch 14

byte-pair encoding

A way of splitting text where common letter pairs and word-pieces get merged into reusable chunks.

Noticing that 't' and 'h' almost always travel together, so you glue them into 'th,' then keep merging the most common pairs into bigger pieces.

See it in Ch 14

out-of-vocabulary

A word the model never saw in training, so it has no stored meaning for it.

Trained on common English, then handed a rare made-up name it has simply never encountered before.

See it in Ch 14

latent

A compressed bundle of numbers that captures the essence of some data without being readable on its own.

Like a book's blurb instead of the whole novel: a face photo becomes a latent that quietly notes 'brown eyes, smiling, male', not a picture anymore, but enough for the model to rebuild or recognize it.

See it in Ch 16

modality

A form of information, like text, images, or audio.

You can take in the world by reading, looking, or listening, each of those channels is a different modality.

See it in Ch 16

The Math Words

The handful of math ideas that show up constantly once training starts.

parameter

One of the model's internal numbers that gets adjusted as it learns.

Think of dozens of dials on a radio. Training is the act of turning those dials until you get a clear signal. Each dial is a parameter.

See it in Ch 00

weight

A number inside the model that gets multiplied by an input, deciding how much that input pushes on the final guess.

If an input is 5 and its weight is 0.3, that part contributes 5 times 0.3, which is 1.5, to the guess. A bigger weight means that input has more say in the answer, and during training the model keeps adjusting these weights to guess better.

See it in Ch 09

bias

A single number that gets added to every guess, the same amount no matter what the inputs are.

If you're predicting house prices and every house ends up costing about $50,000 more than the size alone suggests, the bias is that flat +$50,000 baked into every guess. A weight scales an input up or down; the bias is just a constant shift added on top.

See it in Ch 09

gradient

A signal showing which direction to change each of the model's numbers to make its mistakes BIGGER, so you go the opposite way to make them smaller.

Picture standing on a foggy hillside. The gradient is an arrow pointing uphill, toward worse guesses; since you want to get to the bottom, you read that arrow and step the opposite way, downhill toward better guesses. It's the model's way of saying 'this direction hurts, go the other way.'

See it in Ch 00

element-wise

An operation done to each number on its own, not by combining them together.

Doubling every cookie in the jar one at a time, rather than mashing them into one giant cookie.

See it in Ch 10

underflow

When a number gets so tiny that the computer rounds it down to zero and loses it.

An ant so light your scale reads 0 grams, even though the ant is clearly still there.

See it in Ch 10

cosine similarity

A score for whether two sets of numbers are pointing the same direction, even if one is bigger overall.

Monthly profits of Company A (10k, 12k, 15k) and Company B (20k, 24k, 30k) score very high because B is just A scaled up, same shape; if one rises while the other falls, the score drops, and opposite patterns go negative.

See it in Ch 16

The Training Loop

The repeated cycle of guess, measure, and nudge that turns a random model into a useful one.

loss function

A rule that turns one bad guess into a single number measuring how far off it was, where lower is better.

If the model says a house costs $300k but it really costs $500k, the loss turns that $200k miss into a single 'how bad was it' number. Training tries to shrink that number, and different tasks use different loss rules (a price guess might score the gap squared; a yes/no guess scores it a different way).

See it in Ch 00

forward pass

Running an example through the model from start to finish to get a guess, which is really just a chain of multiply-and-add steps.

The input walks in the front door: multiply it by weights, add the biases, bend the result with an activation function, multiply by more weights, add more biases, and so on until a final number, the prediction, pops out the back.

See it in Ch 09

backpropagation

A calculation that works backward from the mistake to figure out how much each weight and bias was to blame for it.

After a bad guess you start at the end with the loss and retrace your steps backward through the model, asking each number 'if I nudged you a hair, how much would the mistake change?' Those answers are exactly the nudge-amounts you'll use to fix the numbers.

See it in Ch 00

gradient descent

The core routine of training: check which way is downhill, take a small step, and repeat until the guesses are good.

You're on a mountain in fog. Feel the slope, take one step downhill, feel again, step again, keep going until you reach the valley floor.

See it in Ch 00

learning rate

How big an adjustment the model makes to its numbers each time, after the gradient tells it which way to go.

It's your stride size walking downhill. With a small rate like 0.01 you inch along cautiously; with a big rate you take huge leaps and can overshoot the bottom and stumble up the far side. You usually pick a value, try it, and adjust.

See it in Ch 04

batch

A small group of examples the model looks at together before making one adjustment to its numbers.

Instead of tweaking after every single house, you look at 32 houses at once, average out their lessons, and make one smarter tweak. Averaging a handful smooths out flukes and is faster than reacting to each example alone.

See it in Ch 00

epoch

One full trip through every example in your training set.

If your study pile has 10,000 cards and you go through all of them once, that's one epoch. Models usually need many trips before things click.

See it in Ch 00

hyperparameter

A setting you pick yourself before training starts, like the learning rate, batch size, or number of layers, which the model does not learn on its own.

Unlike the weights and biases the model figures out during training, these are your choices, like the oven temperature you dial in before baking. You usually try a few values and keep whichever does best on your validation set.

See it in Ch 01

convergence

The point where the wrongness score stops dropping and levels off, so more training doesn't help.

You train and the loss falls, falls, falls, then flatlines. Extra epochs don't shrink it any further. You've walked to the flat valley floor. (It doesn't mean the loss hit zero, just that it stopped improving.)

See it in Ch 04

fine-tuning

Taking a model that already learned a lot of general skills and training it a bit more on your own specific data.

Like hiring an experienced cook and just teaching them your restaurant's recipes rather than starting from scratch. It's fast and works well because the model reuses what it already knows and only adjusts slightly for your task.

See it in Ch 11

gradient clipping

Putting a cap on how big a single training adjustment can be so one wild step doesn't wreck progress.

A speed limiter on a car: you can press the gas as hard as you like, but it refuses to go past a safe limit.

See it in Ch 10

weight initialization

Choosing the starting values for a model's weights before any learning happens.

Filling a bucket to just the right starting level so it neither overflows nor sits empty as you keep pouring, a good start makes everything after it smoother.

See it in Ch 10

vanishing gradient

When the learning signal fades to almost nothing as it travels back through a deep model, so the early layers barely change.

A game of telephone down a line of 50 people: the message gets fainter at each hand-off, until the people at the front receive only a garbled whisper and learn almost nothing.

See it in Ch 11

exploding gradient

When the learning signal grows wildly as it travels back through a deep model, becoming so huge it breaks training.

A microphone held up to its own speaker: the sound feeds back and screeches louder and louder, except here it's a number ballooning a thousand times too big to use.

See it in Ch 11

learning-rate schedule

A plan for changing the step size during training, usually shrinking it over time.

Turning a speaker loud at the start of a song to grab attention, then easing the volume down as it winds to a close.

See it in Ch 11

warmup

Starting training with tiny steps that grow for a little while before the main plan kicks in.

Starting a car on a cold morning: you let it idle and warm up before you rev the engine hard.

See it in Ch 11

cosine annealing

Slowly easing the step size down along a smooth curve until it's nearly zero by the end.

A ball rolling down a gently curving ramp: fast at first, then coasting more and more slowly as it nears the bottom.

See it in Ch 11

weight decay

Gently nudging a model's weights toward smaller values to keep the model simpler and less likely to overfit.

A small tax on big weights: you still want good predictions, but oversized weights cost you, so you naturally settle on smaller, simpler ones.

See it in Ch 11

label smoothing

Softening the training answers so 'definitely a cat' becomes 'almost certainly a cat, but not 100 percent.'

Instead of insisting 'this is absolutely a cat and could never be anything else,' you allow a sliver of doubt, which keeps the model humble.

See it in Ch 11

linear probe

Freezing a pretrained model and training only a small new piece on top to read out what it already knows.

Buying a camera you don't take apart, and just clipping on a custom viewfinder, cheap, fast, and works if the lens already sees what you need.

See it in Ch 11

LoRA

A cheap way to fine-tune by training small add-on pieces while leaving the big original model frozen.

Instead of rewiring the whole house, you add a small control panel that tweaks the existing wiring, light, and easy to undo.

See it in Ch 11

knowledge distillation

Training a small model to copy the behavior of a big one, learning from its nuanced answers rather than just right-or-wrong labels.

A master chef teaching a student by letting them taste the dishes and reverse-engineer the recipe, not just handing over a list of dish names.

See it in Ch 11

data augmentation

Making extra training examples by tweaking the ones you have, flipping, cropping, or rotating images.

You have 1,000 cat photos, so you flip and slightly rotate each one to get thousands more, all still clearly cats.

See it in Ch 12

teacher forcing

During training, feeding a sequence model the correct previous answer instead of its own guess so it learns faster.

Teaching someone a sentence by handing them the right next word to repeat, rather than letting one wrong guess snowball into the next.

See it in Ch 13

exposure bias

The gap where a model trains on correct previous answers but at run time must lean on its own guesses, so an early slip cascades.

Learning to write with a dictionary always open, then taking a test with none: one wrong word at the start throws off every word after it.

See it in Ch 14

contrastive learning

Training where the model is shown pairs and made to keep similar things looking alike inside while pushing unlike things far apart.

A teacher holding up examples: 'these two are cats, keep their inner descriptions nearly the same; this dog is different, send it far away', the model learns by comparing.

See it in Ch 16

Optimization & Optimizers

The machinery that decides how to adjust a model's weights each step, momentum, schedules, and the tricks that make training go fast and stable.

mixed precision

Using smaller, faster number formats for most of the math while keeping precise ones only where it really matters.

Printing most of a photo with light ink to save it, but using full ink on the few spots that need sharp detail.

See it in Ch 11

momentum

Letting past adjustments build up speed so training keeps rolling in a steady direction instead of zig-zagging.

Pushing a ball down a hill: instead of stopping at every bump, it builds speed in the overall downhill direction.

See it in Ch 11

Fitting and Generalizing

The central tension of ML: learning the real pattern without just memorizing the examples.

generalization

How well the model handles brand-new examples it never studied.

A student who truly understands the material can answer questions they've never seen before. That's the whole point, not parroting the practice sheet.

See it in Ch 09

overfitting

When a model memorizes the quirks and flukes of its study examples instead of the real pattern, so it flops on anything new.

A student who memorized the practice test word-for-word but bombs the real exam. You catch it by watching your validation score: if the model keeps getting better on its study examples while getting no better on fresh ones, it's overfitting.

See it in Ch 01

underfitting

When a model is too simple to capture the real pattern, so it does poorly even on its own study examples.

Trying to trace a curvy road with a perfectly straight ruler. The line just can't follow the bends. You fix it by giving the model more capacity (more layers or pieces) or letting it train longer.

See it in Ch 01

regularization

A penalty added to the wrongness score that discourages the model from leaning on big, fussy numbers, nudging it to stay simple.

Instead of only minimizing 'how wrong is my guess,' the model minimizes 'how wrong is my guess PLUS a penalty for oversized numbers.' Like a teacher who docks points for rambling answers, it pushes toward the simplest explanation that still works instead of memorizing noise.

See it in Ch 01

early stopping

Watching the model's score on fresh examples and halting training the moment that score stops improving.

Each epoch you check the validation score. The instant it stops getting better (even while the study-example score keeps climbing), you close the book. That's the exact moment before the model starts memorizing flukes.

See it in Ch 04

dropout

A training trick where the model randomly switches off some of its own pieces each pass, so it can't lean too hard on any one of them.

Like a team that practices with random players sitting out, so no single star becomes a crutch. It only happens during training to fight overfitting. At test time you switch everything back on and use the whole model.

See it in Ch 11

catastrophic forgetting

When teaching a model a new task makes it forget the old task it already knew.

Cramming a new language so hard that you start losing words in your native one, because the new lessons overwrite the old.

See it in Ch 11

inference

Running a finished, trained model on new data to get answers, as opposed to training it.

You've done all your practice problems; now you sit the actual exam. Training was the practice, this is the test.

See it in Ch 14

cross-entropy

A loss that measures how far a model's predicted chances are from the true answer.

Your model says 95 percent cat, 5 percent dog, and it really is a cat, this penalizes how much of that 5 percent was wasted on the wrong guess.

See it in Ch 14

Predictions and Scores

What comes out of the model, how to read it as a probability, and how to grade it.

accuracy

The share of guesses the model got right out of all its guesses.

Get 980 questions right out of 1,000 and your accuracy is 98%. Simple, but it can be misleading when one answer is much rarer than another.

See it in Ch 09

probability

A number between 0 and 1 saying how confident the model is, where 1 means totally sure and 0.5 means a coin-flip.

Like a weather forecast saying '70% chance of rain', not a flat yes or no, but a level of confidence. The model learns to produce these numbers during training; they're a squeezed, tidied-up version of its raw scores.

See it in Ch 00

sigmoid

A function that takes any number and squeezes it into a single confidence between 0 and 1.

Think of a dimmer switch with an S-shaped response: very negative numbers come out near 0 (off), very positive ones near 1 (full), and zero lands right in the middle at 0.5. You reach for it on a single yes/no question, like 'is this spam?'

See it in Ch 00

softmax

A function that turns a list of raw scores into confidences for several options that add up to exactly 1 (100%).

Given scores like [2, 1, 3], softmax hands back something like [0.33, 0.09, 0.58]. The biggest score gets the biggest slice, and all the slices make one whole pie. You use it for pick-one-of-many problems.

See it in Ch 00

logit

The raw score the model outputs before it's converted into a clean percentage with sigmoid or softmax.

It's like a vote counter yelling out a raw tally of 47. Useful, but you still have to divide by the total to get the real percentage. A logit can be any number, big or small; running it through the converter is what squeezes it into a 0-to-1 confidence.

See it in Ch 04

precision

Out of all the times the model shouted 'yes,' how often it was actually right.

If a spam filter flags 100 emails and 80 truly are spam, its precision is 80%. You care about precision when false alarms are costly. You really don't want good emails wrongly thrown in the spam bin.

See it in Ch 01

recall

Out of all the things that really were 'yes,' how many the model managed to catch.

If 150 emails were actually spam and the filter caught 120, its recall is 80%. You care about recall when misses are costly. You really don't want real spam slipping into the inbox.

See it in Ch 01

confusion matrix

A small table that splits the model's calls into four boxes: correct yeses, false alarms, correct nos, and misses.

A two-by-two grid: true positives (rightly said yes), false positives (wrongly said yes), true negatives (rightly said no), false negatives (wrongly said no). From these four counts you can read off precision and recall and see the shape of the mistakes, not just one score.

See it in Ch 01

temperature

A dial that controls how much a model gambles on unlikely words versus sticking to the most likely one.

Turned low, it almost always picks the front-runner word (steady but dull; turned high, it rolls dice and reaches for surprising words) creative but risky. The name comes from how hotter things move more wildly.

See it in Ch 15

top-k sampling

When generating, only consider the few highest-ranked next words and ignore the rest.

Out of a huge menu, you only let yourself order from the top few dishes, never the bizarre options at the bottom.

See it in Ch 15

top-p sampling

When generating, keep just enough of the top words to cover a chosen share of the likelihood, then pick from those.

You keep adding the most likely words to a shortlist until they together cover most of the bet, then choose from that shortlist.

See it in Ch 15

multinomial sampling

Picking the next word at random, but giving more likely words a bigger chance of being chosen.

Like a raffle drum where common words have many tickets inside and rare words have only a few: you draw blind, so the favorites win more often but the long shots still sometimes come up.

See it in Ch 13

hallucination

When a model confidently makes up information that isn't true or wasn't in the input.

A storyteller who starts retelling your tale faithfully, then drifts into inventing details that were never part of it.

See it in Ch 14

zero-shot learning

Getting a model to handle a category it never trained on, using only its name or description.

Reading the word 'narwhal' and a short description, then spotting a real one in the wild without ever having seen a photo.

See it in Ch 16

Neural Networks

The layered, brain-inspired models behind most of today's AI.

activation function

A rule that bends the model's numbers at certain points so stacked layers can together trace a curve instead of just a straight line.

Imagine fitting a curve like house-price-versus-size using only straight rules, with no bends. You can stack a thousand of them and still get one big straight line. The activation function adds a kink at each layer, and ReLU (keep positives, zero out negatives) is the most common one.

See it in Ch 00

ReLU

The most common bend in neural networks: it keeps positive numbers as they are and turns any negative number into zero.

Think of a floodgate at zero: anything below the line gets flattened to nothing, anything above flows through untouched. It's so popular because it's dead simple, fast, and lets the fixing signal flow cleanly back through the layers during training.

See it in Ch 09

recurrent network

A model that reads a sequence one piece at a time while keeping a 'note to self' about everything it has seen so far.

Take 'the bank executive went to the river bank': the second 'bank' only makes sense if you remember the first and the context. Each new word updates the note, so a recurrent network can carry that context forward, where a model with no memory would guess wrong.

See it in Ch 13

hidden state

A number (or short list of numbers) the model keeps rewriting as it reads through a sequence, its running memory.

Like a tally scribbled down the margin of a page: you start at zero, read the first word and add to the tally, read the next word and add more to the same tally, and so on. By the end of the sentence that running tally has soaked up the whole context.

See it in Ch 13

convolution

A small grid of numbers that slides across an image, at each spot multiplying its numbers by the patch underneath and adding them into one number.

Lay the little grid over a patch of pixels, multiply matching cells, add them up, and write down that single number, then slide one step over and repeat. Each number you write answers 'how much does this patch look like my grid's pattern?', so the output is a map of where that pattern (an edge, a corner) shows up.

See it in Ch 12

self-attention

A calculation where each word gets a score for how related it is to every other word, then blends in the others according to those scores.

In 'the cat sat on the mat,' the word 'sat' gives a high score to 'cat' (the cat does the sitting) and a low score to 'the' (just a filler label), then leans on the high-scoring words to understand its context. Every word does this scoring at the same time.

See it in Ch 14

fan-in

The number of inputs feeding into one neuron, which decides how small to set its starting values.

Like a small shop getting invoices from suppliers: with 10 suppliers each sends a fair-sized stack, but with 100 suppliers each one should send a thinner stack so the total pile on your desk stays manageable.

See it in Ch 11

saturation

When part of a model stops reacting to input because its output is already pushed to a hard limit.

A lightbulb already at full brightness: turning up the power does nothing because it's maxed out.

See it in Ch 11

dead ReLU

A neuron that always outputs zero no matter the input, so it stops contributing anything.

A light switch stuck in the off position: flip it however you like, the light never comes on.

See it in Ch 11

residual stream

The main running tally of information that flows through a deep model, with each layer reading from it and adding its bit back in.

A relay race baton being carried down the line: each runner grabs it, adds a note, and passes the same baton on, everyone shares and builds on the one carrier.

See it in Ch 11

skip connection

A shortcut that adds a layer's input directly to its output, so the layer only has to learn the change.

Instead of redrawing a whole picture, you keep the original and just sketch in the few edits needed on top of it.

See it in Ch 12

encoder-decoder

A two-part design where one half squeezes the input into a compact summary and the other half expands it into the output.

Shrinking a photo to a thumbnail to capture its gist, then rebuilding a full picture from that thumbnail.

See it in Ch 12

bottleneck

A spot in a model where its width is squeezed small on purpose, forcing the information to compress before it continues.

A water bottle's narrow neck: everything has to pass through that funnel, so only the essentials get through and the rest is left behind.

See it in Ch 14

flatten

Squashing a multi-dimensional grid of numbers into a single long list.

Taking a stack of gridded pages and reading every number off into one long row, losing the original layout.

See it in Ch 12

inductive bias

A built-in assumption that nudges a model toward certain kinds of patterns.

Assuming nearby things matter most: like guessing a puzzle piece's content from its neighbors rather than a piece across the table.

See it in Ch 12

seq2seq

A design that reads one sequence and writes out another, like turning a sentence into its translation.

A translator who reads the whole source text, holds its meaning in mind, then writes the translation word by word.

See it in Ch 14

attention

A mechanism that lets a model look back over all the input and focus on the parts that matter right now.

Instead of relying on one summary memo, you flip through all the meeting notes at each moment and highlight whichever fact you need.

See it in Ch 14

causal mask

A block that stops a model from peeking at later positions, so it only sees what came before.

Reading a book one word at a time with the rest of the page covered, so you can't cheat by looking ahead.

See it in Ch 10

bidirectional

Reading a sequence both forward and backward so each spot has context from both sides.

Reading a sentence once left to right and once right to left, then combining both passes to understand each word more fully.

See it in Ch 14

positional encoding

Extra information added to each input that depends only on where it sits in the order.

A barcode stuck to each seat that depends only on the seat number: the model reads the pattern and knows 'this is position 5' versus 'position 10,' since the words alone don't say.

See it in Ch 14

RoPE

A way of telling a model where each token sits by twisting its number bundle a little more for each later position.

Stamping a date on a stack of checks where the stamp tilts a bit more on each one down the pile: a light tilt up top, a heavy tilt near the bottom, so the model reads the tilt as 'how far along am I.'

See it in Ch 14

patch embedding

Cutting an image into small tiles and turning each tile into a single bundle of numbers.

Slicing a photo into a grid of stamps, then giving each stamp its own short code the model can work with.

See it in Ch 16

context vector

A single bundle of numbers meant to summarize a whole input sequence.

Reading an entire memo, then squeezing its gist into one sticky note that someone else has to work from.

See it in Ch 13

variational autoencoder

A model that squeezes images down to tiny codes and can rebuild images back from those codes.

A copier that first shrinks a page to a stamp, then blows it back up to full size, efficient, though a little detail is lost.

See it in Ch 16

Computer Vision

Concepts for teaching machines to see, sliding filters over images, shrinking and growing pictures, finding and labeling objects.

filter

A small grid of weights that slides across an image to spot a particular pattern.

A little template you slide over every part of a photo, asking at each spot, 'does this patch look like what I'm hunting for?'

See it in Ch 12

feature map

The grid of responses you get after sliding a filter over an image, bright where the pattern was found.

If your filter looks for edges, the result lights up along the edges and stays dark on smooth areas, a map of 'how much is this here?'

See it in Ch 12

stride

How many pixels a sliding filter jumps with each step across an image.

Stepping across a tiled floor one tile at a time, or skipping every other tile to cross faster while seeing fewer spots.

See it in Ch 12

padding

Adding a border of zeros around an image so it doesn't shrink when a filter slides over it.

Taping a blank frame around a photo before measuring, so the picture itself keeps its full size as you measure every spot.

See it in Ch 12

pooling

Shrinking an image grid by replacing each small patch with a single summary number.

Splitting a photo into little squares and keeping just the brightest dot from each, half the size, same key highlights.

See it in Ch 12

channel

One of several stacked grids of numbers in an image, each tracking a different kind of pattern.

A color photo has three channels (red, green, blue) layered on top of each other to make the full picture.

See it in Ch 12

receptive field

The patch of the original image that a single deep unit is actually looking at.

A unit that fires for 'wheel' isn't seeing one pixel, it's quietly watching a whole chunk of the photo, and that chunk is its window.

See it in Ch 12

translation invariance

When moving an object around the image doesn't change what the model decides it is.

A cat in the left corner or the right corner is still 'cat', its position changes, but the answer doesn't.

See it in Ch 12

segmentation

Labeling every single pixel in an image with what it belongs to.

Coloring a photo so each dot is marked 'person,' 'car,' 'tree,' or 'sky', a label for every pixel, not just the whole picture.

See it in Ch 12

bounding box

A rectangle that marks where an object sits in an image.

Drawing a tight box around a dog and saying 'the dog is inside this rectangle.'

See it in Ch 12

object detection

Finding every object in an image and drawing a labeled box around each one.

Going through a street photo and boxing every person and car, then tagging each box with what it holds.

See it in Ch 16

non-maximum suppression

Cleaning up object detection by keeping only the most confident box when several boxes cover the same thing.

If ten people point at the same cat, you keep only the most confident point and ignore the rest.

See it in Ch 16

LLM-Era Words

The vocabulary you'll hear around ChatGPT-style language models.

tokenization

Chopping text into small pieces and giving each piece a number, because models can only work with numbers.

Like running a sentence through a scanner that swaps each word or word-chunk for a barcode: 'the' becomes 1042, 'cat' becomes 3015. The model then learns, through training, what each of those numbered pieces means.

See it in Ch 14

autoregressive

Generating text one piece at a time, where each new piece is chosen based on everything written so far.

After writing 'the cat,' the model works out the odds for every possible next word and picks one, then does it again for the word after that given 'the cat ___,' and so on, word by word down the page.

See it in Ch 13

transfer learning

Reusing a model that already learned general skills as a head start, then retraining just a little of it for a new, related task.

A model trained on millions of photos already knows how to spot edges, textures, and shapes. To teach it cats-versus-dogs you retrain only its last few layers on your photos instead of starting over. It's faster, and it needs far less data.

See it in Ch 11

greedy decoding

Building a sentence by always grabbing the single most likely next word at each step, never looking back.

For 'the cat sat on the ___,' if 'mat' scores highest you take it and move on. It's simple and fast, but always blurting your top guess can miss a better sentence that needed a less obvious word early on, which is what beam search tries to fix.

See it in Ch 14

beam search

A smarter way to build a sentence that keeps the few most promising options alive at once instead of committing to one.

Keep, say, the top 5 candidate sentences going at every step (5 is the 'beam width'), extend and re-rank them each round, then return the best complete one at the end. It explores more than greedy decoding without the cost of checking every possible path.

See it in Ch 14

token

A single chunk of a sequence the model reads or produces, often a word or a character.

In 'hello world,' each word is a token; the model never sees raw text, only these chunks one after another.

See it in Ch 13

vocabulary

The fixed set of all chunks a model is allowed to read or produce.

A keyboard with a fixed set of keys: the model can only ever type using the keys it has, nothing outside that set.

See it in Ch 13

prompt engineering

Wording your request to a model carefully to get a better answer, without changing the model itself.

Instead of asking a friend 'how do I cook?', asking 'give me a step-by-step recipe for chocolate cake', same friend, much better answer.

See it in Ch 16

Systems & Hardware

The practical plumbing of running models, GPUs, memory, file formats, randomness, and getting reproducible results.

device

Where a piece of data lives and gets worked on: the main processor or the faster graphics chip.

Like choosing to do your sums on paper (slower, always with you) or on a high-speed calculator (faster, but you have to move your numbers over to it first).

See it in Ch 10

VRAM

The graphics chip's working memory, how much data it can hold at once while training.

The size of your desk: a bigger desk lets you spread out more papers at once before you run out of room.

See it in Ch 10

safetensors

A safe file format for saving a model's learned numbers that can't secretly run code when opened.

A plain ingredient list you can read without worry, instead of a sealed package that might do something unexpected when you unwrap it.

See it in Ch 10

pickle

A common way to save and reload data in code that is risky because opening an untrusted file can run hidden instructions.

Saving your house as a blueprint, except the blueprint can carry hidden instructions that run the moment someone reads it.

See it in Ch 10

checkpoint

A saved snapshot of a model partway through training so you can stop and pick up later.

A save file in a video game: close it now, come back tomorrow, and you're exactly where you left off.

See it in Ch 10

CUDA

The system that lets code run on a graphics chip instead of the main processor.

Like a shared language the graphics chip understands, so you can hand it work and it knows what to do.

See it in Ch 10

prefetch

Loading the next chunk of data while the chip is still busy working on the current chunk.

Pulling out the next page to read while you're still finishing the current one, so there's never a pause.

See it in Ch 10

contiguous

When a block of data is laid out in memory in tidy, expected order with no gaps.

Books lined up in order on one shelf, instead of scattered across different shelves in the room.

See it in Ch 10

reproducibility

Being able to run the same code again and get exactly the same result.

A science experiment another lab can repeat and get the same outcome, because nothing was left to chance.

See it in Ch 11

seed

A starting number that makes a program's 'random' choices come out the same every time.

The same starting nudge to a row of dominoes: same first push, same exact pattern of falls every time.

See it in Ch 11

Evaluation & Understanding

How we measure whether a model is actually good and peek inside to understand why it does what it does.

calibration

How well a model's stated confidence matches how often it's actually right.

A forecast that says '90 percent chance of rain' should turn out wrong only about 1 time in 10, if it's wrong half the time, it's miscalibrated.

See it in Ch 11

baseline

A simple reference method you compare against to see whether a fancier approach is actually worth it.

Before judging a new drug, a control group takes a sugar pill, so you know if patients improved from the drug or would have anyway.

See it in Ch 11

IoU

A score for how well a predicted box overlaps the true box, from no overlap to a perfect match.

Two boxes drawn over the same dog: the more they overlap, the higher the score; a perfect match scores the top mark.

See it in Ch 12

mechanistic interpretability

Working backward through a trained model to trace the exact steps that led to its answer.

Rather than accepting 'the model said cat,' you trace what fired: it caught whiskers, pricked ears, and fur texture, and those features together convinced it, like opening a watch to watch the gears turn.

See it in Ch 11

perplexity

A score for a language model showing how surprised it is by the test text, lower means less surprised.

A perplexity of 50 means that, on average, the model felt as unsure as if it were guessing between 50 equally likely next words.

See it in Ch 15

Safety & Robustness

Ways models get fooled or misbehave, and how we guard against it, adversarial tricks, jailbreaks, and keeping models honest.

adversarial example

An input with tiny, almost invisible tweaks added on purpose to make a model give the wrong answer.

A panda photo with a sprinkle of noise no human would notice, yet it makes the model confidently call it a different animal.

See it in Ch 12

distribution shift

When the data a model meets in the real world differs from the data it trained on, so it stumbles.

A model trained only on sunny outdoor photos getting confused the first time it sees a rainy indoor scene.

See it in Ch 12

jailbreak

An input crafted to trick a model into doing something it was trained to refuse.

Finding a sneaky phrasing that slips past a guard who was told to say no, getting them to open the door anyway.

See it in Ch 15

prompt injection

Sneaking extra instructions into an input that the model can't tell apart from the real task, so it follows yours too.

You ask it to 'summarize this text,' but buried in the text is a line saying 'ignore that and do this instead', to the model it's all just text, so it may obey both.

See it in Ch 16