Every AI term used on this site, with what it means and — for knobs you can turn — what happens when you change it.
A 3D scene representation made of millions of coloured, semi-transparent 3D Gaussians that can be rasterized in real time.
Kerbl et al. (2023) initialize Gaussians from structure-from-motion points and optimize their positions, covariances (scale + rotation), opacities and spherical-harmonic colours with a differentiable tile-based rasterizer, adding and pruning Gaussians as needed. It matches top NeRF quality with much faster training and real-time rendering, and is now used for capture, editing and fast text/image-to-3D.
Randomly splitting live traffic between the current model (A) and a candidate (B) to measure which performs better on real outcomes.
Offline metrics do not always predict business impact; an online controlled experiment measures it directly (click-through, conversion, revenue, complaints). Decide the primary metric, minimum detectable effect and sample size before starting, and avoid stopping the moment the result looks significant ("peeking" inflates false positives). Related rollout patterns: shadow deployment (B sees traffic but its answers are not used) and canary releases.
The fraction of all predictions that are correct.
Accuracy = (TP + TN) / (TP + TN + FP + FN). It is easy to read but misleading on imbalanced data: if only 1% of transactions are fraud, a model that always says "not fraud" scores 99% accuracy while catching nothing (the accuracy paradox). Use it together with precision, recall or a confusion matrix.
The non-linear function applied to a neuron's weighted sum, e.g. ReLU, sigmoid, tanh or GELU.
Without activations, any stack of linear layers collapses into one linear layer. The non-linearity lets networks represent curved decision boundaries and complex functions. Its derivative matters for training: saturating functions (sigmoid, tanh) can cause vanishing gradients, while ReLU-family functions pass gradients through for positive inputs.
An adaptive optimizer combining momentum (first moment) with per-parameter scaling by the running average of squared gradients (second moment); AdamW adds decoupled weight decay.
Adam keeps m (average gradient) and v (average squared gradient), bias-corrects both, and updates θ ← θ − η·m̂/(√v̂ + ε). Defaults η = 1e-3, β₁ = 0.9, β₂ = 0.999, ε = 1e-8 work well across many problems. AdamW applies weight decay directly to the weights instead of adding it to the gradient, which regularizes correctly; it is the default for Transformers and LLMs.
A system in which an LLM repeatedly decides on actions, calls tools, observes the results and continues until a goal is reached.
Agents combine a model, a set of tools, memory and a control loop (often ReAct-style reasoning and acting). Unlike fixed workflows, the model chooses its own steps, which handles open-ended tasks but makes cost, reliability and safety harder to control. Good agents use least-privilege tools, step limits, human confirmation for irreversible actions and thorough evaluation.
The field concerned with preventing AI systems from causing accidental or deliberate harm, now and as they become more capable.
It spans robustness and reliability (hallucination, distribution shift), misuse prevention, security (prompt injection, jailbreaks), alignment of goals and behaviour, evaluation of dangerous capabilities, interpretability, and governance. Practical safety work layers defences: careful training, evaluations and red-teaming, runtime guardrails, monitoring and human oversight.
Making an AI system pursue the goals and values its designers and users actually intend.
Misalignment shows up as reward hacking, specification gaming, sycophancy or harmful compliance. Current techniques include instruction tuning, RLHF, DPO and Constitutional AI (training against an explicit set of principles with AI feedback), complemented by evaluations, interpretability and oversight. Ensuring alignment for systems more capable than their overseers (scalable oversight) is an open research problem.
Any file produced by a run — model weights, plots, confusion matrices, predictions, configs.
Artifacts are stored in an artifact store (local folder, S3, GCS, Azure Blob…) and linked to the run that created them, so you always know which code and data produced a file. In MLflow use mlflow.log_artifact(path) for files and mlflow.<flavor>.log_model(...) for models packaged with their environment.
The field of building computer systems that perform tasks we associate with intelligence, such as perceiving, reasoning, learning, using language and acting.
AI includes both hand-written approaches (rule-based expert systems, search and planning algorithms) and learning approaches (machine learning). Russell & Norvig define it as the study of agents that perceive their environment and act to achieve the best expected outcome. The term was coined in the 1955 Dartmouth proposal by McCarthy, Minsky, Rochester and Shannon. All systems deployed today are ‘narrow’ AI, specialised for particular tasks.
A mechanism that computes a weighted average of values, where the weights come from how well a query matches each key.
Scaled dot-product attention is softmax(QKᵀ/√d_k)V. It lets a model look directly at any relevant part of its input instead of compressing everything into one vector. Introduced for translation by Bahdanau et al. (2014) to let an RNN decoder consult all encoder states, it became the core of the Transformer. Its cost grows quadratically with sequence length.
A network that compresses its input into a small code (encoder) and reconstructs it from that code (decoder).
Trained to minimize reconstruction error, the bottleneck forces it to keep only the most important information. Useful for compression, denoising, anomaly detection and as the image compressor inside latent diffusion. A plain autoencoder is a poor generator because its latent space has gaps; the VAE fixes this.
Converting spoken audio into text (speech-to-text).
Modern ASR systems are end-to-end neural networks: CTC models (often fine-tuned from self-supervised wav2vec 2.0), RNN-Transducers for streaming, or attention encoder–decoders like Whisper. Quality is measured with word error rate (WER) or character error rate (CER), and depends heavily on accent, noise, domain vocabulary and language coverage.
The algorithm that computes the gradient of the loss with respect to every weight by applying the chain rule backwards through the network.
After a forward pass computes the loss, backpropagation propagates error signals from the output layer to the input, reusing each layer's result to compute the previous one. One backward pass costs about as much as one or two forward passes, regardless of the number of weights. It requires storing forward activations, which is why training needs more memory than inference. Frameworks implement it as reverse-mode automatic differentiation.
A simple reference model or rule that a real model must beat to be worth using.
Typical baselines: predict the majority class, predict the mean (regression), yesterday's value (forecasting), a hand-written heuristic, or a logistic regression. Without a baseline, "92% accuracy" means nothing — the majority class alone might already give 90%. scikit-learn provides DummyClassifier and DummyRegressor for this.
Running a model on a large set of inputs on a schedule and storing the predictions, instead of answering requests live.
Examples: nightly churn scores for all customers, weekly product recommendations, re-scoring a document archive. It is simpler and cheaper than online serving (no latency target, easy retries, can use spot instances), but predictions are only as fresh as the last run and cannot use information that arrives in between.
A layer that normalizes each channel to zero mean and unit variance using statistics of the current mini-batch, followed by a learned scale and shift.
BatchNorm computes x̂ = (x − μ_B)/√(σ²_B + ε) and y = γx̂ + β. It allows higher learning rates, reduces sensitivity to initialization and adds mild regularization; it was key to training ResNets. At inference it uses running averages collected during training, so train and eval modes differ. It performs poorly with very small batches (< ~8).
The number of training examples whose gradients are averaged to make one weight update.
Batch size trades gradient accuracy against the number of updates: larger batches give less noisy gradients (noise ∝ 1/√B) and better hardware utilisation, but fewer iterations per epoch and more memory. Very large batches can generalize worse (sharp minima) unless the learning rate is scaled up with warmup (the linear scaling rule). Gradient accumulation simulates large batches on limited memory.
Tuning that builds a model of score-vs-hyperparameters from past trials and picks the next trial where improvement looks most likely.
A surrogate (Gaussian process in Snoek et al. 2012, or the Tree-structured Parzen Estimator in Optuna and Hyperopt) predicts the score, and an acquisition function such as Expected Improvement balances exploring uncertain regions and exploiting promising ones. It shines when each trial is expensive; combine it with pruning (stopping bad trials early) to save more compute.
A fixed, public dataset and metric used to compare models on the same task (e.g. ImageNet, GLUE, MMLU).
Benchmarks drive progress by making results comparable, but they saturate and can be gamed: test data may leak into web-scale training data (contamination), and repeated tuning against one benchmark overfits to it. A good benchmark score is evidence, not proof, that a model will work on your data — always check on your own held-out set.
Bidirectional Encoder Representations from Transformers: an encoder-only transformer pretrained with masked language modeling.
Released by Google in 2018, BERT hides ~15% of input tokens and learns to recover them using context from both sides, plus (originally) next-sentence prediction. Fine-tuned BERT models set new records on classification, NER and QA. Encoder models in the BERT family remain the backbone of many embedding, search and classification systems, but they are not designed for free-form generation.
Systematic differences in how a model treats or performs for different groups of people, and methods to measure and reduce them.
Bias can come from historical data, under-representation, proxy labels, aggregation or deployment context. Fairness criteria — demographic parity, equal opportunity, equalized odds, calibration — compare outcomes across groups and generally cannot all hold when base rates differ. Removing the sensitive attribute is not enough because proxies remain; auditing per group is essential.
The decomposition of expected error into bias² (systematic error of too-simple models), variance (sensitivity to the particular training set) and irreducible noise.
For squared error: E[(y − f̂(x))²] = Bias² + Variance + σ². Increasing model flexibility lowers bias and raises variance, so test error is typically U-shaped in model complexity. Formalised for neural networks by Geman, Bienenstock & Doursat (1992). Very large modern networks can show ‘double descent’, where test error falls again past the interpolation point.
Number of bits used to store each audio sample, which sets how finely amplitude is represented.
With b bits there are 2ᵇ amplitude levels; rounding to the nearest level adds quantization noise. Each bit adds about 6 dB of dynamic range: 16-bit (CD quality) gives ~96 dB, 24-bit ~144 dB. Inside ML pipelines audio is usually converted to 32-bit floats in [−1, 1].
A subword tokenization algorithm that starts from characters or bytes and repeatedly merges the most frequent adjacent pair.
BPE learns an ordered list of merge rules from a training corpus until the vocabulary reaches a target size; new text is tokenized by applying the merges in the same order. Byte-level BPE (GPT-2 and later) uses the 256 bytes as its base alphabet, so any string can be encoded without unknown tokens.
Prompting or training a model to write intermediate reasoning steps before its final answer.
Wei et al. (2022) showed CoT examples greatly improve multi-step arithmetic and logic in large models; Kojima et al. found “Let’s think step by step” works zero-shot. Self-consistency samples several chains and votes on the answer. Modern reasoning models are trained to produce such reasoning internally.
A saved snapshot of training state — model weights plus optimizer state, epoch and RNG state — to resume or reuse later.
In PyTorch you save a dict with model.state_dict(), optimizer.state_dict(), the epoch and the scheduler state via torch.save. Checkpoints protect against crashes and preemption, and "keep the best by validation metric" is how early stopping gets its final model. Saving only the weights is enough for inference but not to resume training exactly.
Splitting documents into smaller passages (chunks) that are embedded and retrieved individually in a RAG system.
Strategies range from fixed-size windows with overlap to structure-aware splitting by headings and paragraphs, often with the document title and section prepended to each chunk. Chunking determines what the retriever can find and what the LLM sees, so it is one of the highest-leverage settings in RAG.
Continuous integration and continuous delivery: automatically testing every change and shipping it through a repeatable pipeline.
For ML, CI tests not only code but also data (schema, ranges, missing values) and models (a minimum metric vs the current champion, no regression on key slices, latency budget). CD packages the model (e.g. a Docker image) and promotes it safely. ML adds CT — continuous training — where a pipeline retrains on new data, triggered by a schedule or by drift alerts. GitHub Actions, GitLab CI and similar tools run these steps.
A supervised task where the target is a category: binary (spam / not spam), multi-class (which digit) or multi-label (several tags).
Classifiers divide feature space into regions separated by decision boundaries. Many output class probabilities (via sigmoid or softmax) that are turned into a decision with a threshold. Accuracy alone can mislead on imbalanced data; precision, recall, F1 and ROC-AUC give a fuller picture.
A sampling technique that combines conditional and unconditional predictions of one diffusion model to follow the prompt more strongly.
During training the condition is randomly dropped (≈ 10% of the time), so the model learns both ε(x, c) and ε(x, ∅). At sampling, ε̂ = ε(x, ∅) + s·(ε(x, c) − ε(x, ∅)). It needs no separate classifier and costs two forward passes per step. Negative prompts replace ∅.
OpenAI's model that embeds images and text into one shared space, trained contrastively on 400M image-caption pairs.
CLIP (Contrastive Language-Image Pre-training) has an image encoder (ResNet or ViT) and a text encoder; matching pairs are pulled together and mismatched pairs pushed apart. It enables zero-shot classification ('a photo of a {label}'), image search, dataset filtering, the text encoder of Stable Diffusion, and the vision encoder of many VLMs.
Grouping unlabelled examples so that items in the same group are more similar to each other than to items in other groups.
Algorithms differ in what ‘cluster’ means: k-means (nearest centre, round clusters), DBSCAN (dense regions of any shape, with noise), hierarchical clustering (nested groups), Gaussian mixtures (soft, elliptical). Used for customer segmentation, grouping documents, image compression and exploratory analysis. Results must be validated — clusters are not automatically meaningful categories.
A neural network that uses convolutional layers — small learned filters slid across the input — to process grid-like data such as images.
CNNs exploit locality and weight sharing: the same kernel is applied at every position, so parameters don't depend on image size and patterns are recognised anywhere. Stacking convolutions, non-linearities and downsampling builds a hierarchy from edges to textures to object parts. Classic architectures include LeNet, AlexNet, VGG and ResNet.
A change in the relationship between inputs and the target, P(y|x) changes — the same input now means something different.
Example: fraudsters change tactics, so transactions that looked safe are now fraud, even if the input distribution looks the same. It can be sudden, gradual, incremental or recurring (seasonal). Since inputs may not shift, it is detected mainly by tracking performance on fresh labels; the remedy is retraining on recent data, sometimes with time-weighting or windowing.
A table counting predictions by (true class, predicted class): TP, FP, FN, TN for binary problems.
Rows are usually the true class and columns the predicted class (scikit-learn's convention). Every classification metric — accuracy, precision, recall, specificity, F1 — is computed from these four cells. For K classes it is a K×K table whose off-diagonal cells show exactly which classes get confused with which.
A loss that trains sequence models without frame-level alignment by summing over all alignments, using a special blank token.
The network outputs a symbol or blank for every input frame; a collapse rule (merge repeats, then remove blanks) maps frame paths to text. The CTC loss is −log of the total probability of all paths that collapse to the target, computed with dynamic programming. Because outputs are conditionally independent across frames, decoding is fast and streaming-friendly, but an external language model often improves accuracy.
The maximum number of tokens (prompt plus output) a model can attend to at once.
Anything outside the window is invisible to the model. Windows grew from 512 tokens (BERT) and 2,048 (GPT-3) to 128k and beyond. Longer contexts cost more compute and KV-cache memory, and models often use information in the middle of very long contexts less reliably than at the start or end.
An add-on network that conditions a frozen diffusion model on spatial inputs such as edges, depth maps or human poses.
Zhang et al. (2023) attach a trainable copy of the denoiser's encoder that reads the control image and feeds its features back through zero-initialized 1×1 convolutions, so training starts from the unchanged base model. Many ControlNets (Canny, depth, OpenPose, scribble, segmentation, tile) exist for SD 1.5 and SDXL and can be combined.
The operation of sliding a small kernel over an input and computing a weighted sum at each position to produce a feature map.
For a 2D input, y[i, j] = Σₘ Σₙ x[i·s + m, j·s + n]·k[m, n] + b. Deep learning libraries actually compute cross-correlation (no kernel flip), which makes no difference because kernels are learned. The output size is ⌊(n + 2p − k)/s⌋ + 1. Convolution is translation-equivariant: shifting the input shifts the output.
A similarity measure between two vectors equal to the cosine of the angle between them: (a·b)/(‖a‖‖b‖), from −1 to 1.
Cosine similarity ignores vector length and compares only direction, which suits embeddings where meaning is encoded in direction. For unit-normalized vectors it equals the dot product, which is why search indexes normalize embeddings once and then use fast dot products. Absolute score values differ between embedding models.
The standard classification loss: the negative log of the probability the model assigned to the correct class.
Binary form: −[y·log p + (1 − y)·log(1 − p)]; multi-class form: −log p(correct class) after softmax. It punishes confident mistakes severely (p = 0.01 for the true class gives loss 4.6) and is the negative log-likelihood of the data, so minimising it is maximum likelihood. LLMs are trained with cross-entropy on the next token; frameworks compute it directly from logits for numerical stability.
Estimating performance by training and validating k times on different splits of the data and averaging.
In k-fold CV the data is split into k folds; each fold serves once as validation while the other k−1 train the model. You report mean ± standard deviation across folds. Use StratifiedKFold for imbalanced classes, GroupKFold when samples from the same patient/user must stay together, and TimeSeriesSplit for temporal data so you never train on the future. Put preprocessing inside a Pipeline so it is re-fit per fold (otherwise you leak).
Creating new training examples by applying label-preserving random transformations, such as crops, flips and colour changes for images.
Augmentation teaches the model invariances (an object is still the same object when shifted, flipped or slightly recoloured) and is often the most effective regularizer in computer vision. Audio uses noise, time stretching and spectrogram masking; text uses back-translation or synonym replacement. Only the training set is augmented — never the validation or test sets.
A change in the distribution of a model's input data in production compared with the training data, P(x) changes.
Causes include new user segments, seasonality, a changed upstream pipeline or sensor. Common tests per feature: Population Stability Index PSI = Σ (pᵢ − qᵢ) · ln(pᵢ / qᵢ) over bins (rule of thumb: < 0.1 stable, 0.1–0.25 moderate, > 0.25 significant), the two-sample Kolmogorov–Smirnov test (max gap between CDFs) for numeric features, and chi-squared for categories. Drift does not always hurt accuracy, but it is a signal to investigate.
When information unavailable at prediction time — or from the evaluation data — leaks into training, producing misleadingly good validation scores.
Common forms: fitting scalers/imputers/PCA on the full dataset before splitting; features derived from the label or from the future (target leakage); the same user or duplicate rows in both train and test; random splits on time series. The fix is to split first, keep all preprocessing inside a Pipeline fitted on training folds only, and ask for every feature whether it would really be known at prediction time.
Each GPU holds a full model copy and processes a different slice of the batch; gradients are averaged across GPUs.
After each backward pass an all-reduce averages gradients so all replicas stay identical (PyTorch DistributedDataParallel). It scales throughput well but does not reduce per-GPU memory. Sharded variants — ZeRO stages 1–3 and FSDP — split optimizer state, gradients and parameters across GPUs to remove that redundancy.
Tracking exact versions of datasets so every model can be traced to, and rebuilt from, the data it was trained on.
Git is not built for multi-gigabyte files, so tools such as DVC store content hashes in git and the actual data in remote storage. Combined with code versioning and experiment tracking, this gives full lineage: model version → run → code commit → data version. It also makes it possible to reproduce a bug found months later.
A collection of examples used to train or evaluate a model, typically a table with one row per example and one column per feature (plus a label).
Datasets can be tabular (CSV, databases), images, audio, text corpora or logs of interactions. Their size, quality, label accuracy and representativeness usually matter more than the choice of algorithm. A dataset is split into training, validation and test sets so the model can be evaluated honestly.
A faster, optionally deterministic sampler for diffusion models that reuses a DDPM-trained network and can skip timesteps.
Song et al. (2020) derived a non-Markovian reverse process with the same training objective as DDPM. With η = 0 it maps noise to images deterministically, enabling 20–50 step sampling, smooth interpolation between seeds, and inversion of real images into noise for editing.
The 2020 formulation of diffusion that trains a network to predict added noise with a simple MSE loss and samples over ~1000 stochastic steps.
Ho et al. showed that the simplified loss ‖ε − ε_θ(xₜ, t)‖² with a U-Net denoiser gives image quality competitive with GANs. Each reverse step subtracts the predicted noise and adds a little fresh noise. 'DDPM' also names the corresponding stochastic sampler (DDPMScheduler in diffusers).
The score cut-off above which a classifier's output is labeled positive.
Most classifiers output a score or probability; the threshold (default 0.5) turns it into a class. The best threshold depends on the cost of each error type, so it should be chosen on the validation set — never on the test set — e.g. to hit a required recall or to maximize expected profit.
A model that predicts by asking a sequence of if/else questions about features, learned by repeatedly choosing the split that most reduces impurity.
Splits are chosen greedily using Gini impurity or entropy (classification) or squared error (regression); leaves output the majority class or mean value. Trees handle mixed feature types without scaling, capture interactions, and small ones are easy to interpret. Grown fully, they overfit and are unstable, which is why they are usually combined into random forests or gradient-boosted ensembles. Trees cannot extrapolate beyond the target range seen in training.
The part of a model that generates an output (often token by token) from a representation or from previously generated tokens.
A Transformer decoder uses causal (masked) self-attention so each position only sees earlier positions, and in encoder–decoder models also cross-attends to the encoder's outputs. Decoder-only Transformers — GPT-style LLMs — drop the encoder entirely and are trained to predict the next token. The word also names the generator half of an autoencoder.
Machine learning with neural networks of many layers that learn their own features directly from raw data.
Each layer transforms its input into a slightly more abstract representation — for images: edges, then textures, parts and objects. Deep learning became dominant after 2012 thanks to large datasets (ImageNet), GPUs and better training techniques. It powers modern computer vision, speech recognition, large language models and image generators.
In img2img and inpainting, the fraction (0–1) of the noise process applied to the input before it is denoised again.
Called strength in diffusers. The input is noised to roughly timestep strength × T and only about num_inference_steps × strength denoising steps are run, so it controls both how much the image may change and how long generation takes.
The instantaneous rate of change (slope) of a function at a point: f′(x) = lim_{h→0} (f(x+h) − f(x))/h.
Example: for f(x) = x², f′(x) = 2x, so at x = 3 the slope is 6. With many inputs, partial derivatives ∂f/∂xᵢ measure the slope along one input, and together form the gradient. The chain rule, d/dx f(g(x)) = f′(g(x))·g′(x), lets us differentiate compositions of functions — the basis of backpropagation.
A generative model that learns to reverse a gradual noising process, creating data by denoising pure noise step by step.
Training adds Gaussian noise to data at a random level t and teaches a network (U-Net or transformer) to predict the noise. Sampling starts from random noise and repeatedly applies the learned denoiser. Diffusion models give high quality and diversity with stable training and power Stable Diffusion, DALL·E 2/3, Imagen, and most video generators.
A diffusion model whose denoiser is a transformer operating on patches of the latent, instead of a U-Net.
Peebles & Xie (2022) patchify the latent (like ViT), process the tokens with transformer blocks conditioned via adaptive layer norm (adaLN-Zero), and un-patchify the output. Quality improves predictably with compute. DiT variants power SD3 (MMDiT), FLUX, PixArt and Sora-style video models.
A number between 0 and 1 that down-weights future rewards; the return is Σ γᵏ·rₜ₊ₖ₊₁.
γ expresses a preference for sooner rewards and keeps returns finite in continuing tasks. Its effective planning horizon is about 1 / (1 − γ) steps: 0.9 ≈ 10 steps, 0.99 ≈ 100 steps. It also appears in the Bellman equations and in advantage estimates.
Training one model across multiple GPUs or machines to fit larger models and finish faster.
Strategies combine data parallelism (replicate the model, split the batch), sharding of model states (ZeRO, FSDP), tensor parallelism (split matrix multiplications) and pipeline parallelism (split layers into stages), plus mixed precision, gradient accumulation and activation checkpointing. Communication bandwidth between devices is often the limiting factor.
A tool that packages an application and all its dependencies into a portable container image.
A Dockerfile lists the steps (base image such as python:3.11-slim, pip install -r requirements.txt, copy code and model, start command); docker build creates the image and docker run starts a container. It removes "works on my machine" problems and is the standard unit deployed to Kubernetes and cloud services. GPU containers use NVIDIA CUDA base images with the NVIDIA Container Toolkit.
The sum of element-wise products of two vectors, a·b = Σaᵢbᵢ = |a||b|cos θ; it measures how much they point the same way.
Positive when vectors point in similar directions, zero when perpendicular, negative when opposite. A neuron computes w·x + b; attention scores in transformers are dot products between queries and keys; dividing by both lengths gives cosine similarity, used to compare embeddings. In NumPy/PyTorch it is a @ b, not a * b (element-wise).
A preference-tuning method that trains directly on (prompt, chosen, rejected) pairs with a simple loss, without a separate reward model or RL loop.
DPO uses the fact that the optimal policy of the KL-regularized RLHF objective has a closed form, giving the loss −log σ(β[log π(y_w)/π_ref(y_w) − log π(y_l)/π_ref(y_l)]). It needs only the policy and a frozen reference model, is stable and cheap, and has become a standard alternative to PPO-based RLHF.
A regularizer that randomly sets a fraction p of activations to zero during training (and rescales the rest), and is switched off at inference.
Each training step uses a different random “thinned” sub-network, which prevents units from co-adapting and acts like averaging an exponential ensemble of networks. With inverted dropout, survivors are scaled by 1/(1 − p) during training so nothing changes at test time. Remember model.eval() before evaluation.
An open-source tool that versions data and models alongside git and defines reproducible pipelines.
dvc init sets up a repo, dvc add data/raw writes a small .dvc pointer file (a content hash) that you commit to git, and dvc push / dvc pull sync the actual files with a remote (S3, GCS, SSH, local drive…). dvc.yaml pipelines with dvc repro re-run only stages whose inputs changed, and git checkout <commit> + dvc checkout restores the matching data.
Stopping training when the validation loss stops improving and keeping the weights from the best validation epoch.
Early stopping monitors a validation metric after each epoch, saves a checkpoint whenever it improves, and stops after patience evaluations without improvement. It tunes the number of epochs automatically and acts as a regularizer by limiting how far weights move from initialization. Never use the test set for this decision.
A learned dense vector representing a discrete item (word, token, user, product) so that similar items are close together.
An embedding layer is a lookup table E of shape V × d; looking up row i is equivalent to multiplying a one-hot vector by E. Embeddings are learned by backprop as part of a model, or by dedicated objectives such as word2vec. Static embeddings give one vector per word; contextual models (BERT, GPT) produce a different vector for each occurrence. Sentence embeddings power semantic search and RAG.
The part of a model that reads an input and turns it into an internal representation (vectors) for later use.
In seq2seq models the encoder processes the source sequence (with an RNN or bidirectional self-attention) and passes its states to the decoder. Encoder-only Transformers such as BERT produce contextual embeddings for classification, tagging and retrieval. The word is also used more broadly, e.g. the image encoder of CLIP or the encoder half of an autoencoder.
One complete pass of the training algorithm over the entire training set.
With N training samples and batch size B, one epoch consists of ⌈N/B⌉ iterations (weight updates). Training usually runs for many epochs; the number of epochs together with the batch size fixes the total number of updates. Validation loss is typically checked once per epoch to detect overfitting and to drive early stopping.
Task-specific test suites that measure whether a model or LLM application behaves as required.
For LLM apps, evals are a set of inputs with expected outputs or grading rules: exact match, unit tests for code, rubric scoring by humans, or an LLM-as-judge. They act like regression tests — run them on every prompt, model or retrieval change in CI. Good evals mirror real usage, include hard and adversarial cases, and track both quality and cost/latency.
Automatically recording each training run's parameters, metrics, code version and outputs so runs can be compared and reproduced.
Instead of naming files model_final_v3_really.pkl, every run gets an ID with its hyperparameters, metric curves, git commit, environment and artifacts. Tools include MLflow, Weights & Biases, TensorBoard (curves only) and others. The payoff: answering "which settings produced our best model, and can we rebuild it?" in seconds.
The dilemma between trying new actions to learn more (explore) and using the best-known action to earn reward (exploit).
Pure exploitation can lock onto a mediocre strategy; pure exploration never benefits from learning. Strategies include ε-greedy, softmax sampling, optimism in the face of uncertainty (UCB), entropy bonuses in policy-gradient methods, and curiosity-driven intrinsic rewards. The same trade-off appears in A/B testing and recommendation (multi-armed bandits).
The harmonic mean of precision and recall — one number that is high only if both are high.
F1 = 2 · P · R / (P + R). Because it is a harmonic mean, a model with P = 1.0 and R = 0.1 gets F1 ≈ 0.18, not 0.55. The general Fβ score weights recall β times as much as precision (F2 favors recall, F0.5 favors precision). For multi-class problems, average per class as macro (equal weight per class), micro, or weighted.
An efficient algorithm that decomposes a block of samples into its frequency components.
The Discrete Fourier Transform turns N samples into N/2 + 1 useful frequency bins spaced f_s / N apart, each with magnitude and phase; the FFT computes it in O(N log N) instead of O(N²). Applied to short overlapping windows (the STFT), it produces a spectrogram. Window functions such as Hann reduce spectral leakage.
A measurable input variable used by a model — one column of the data, such as area, age or a pixel value.
Features can be numerical, categorical, text, image or derived values. An example is represented as a feature vector x = [x₁, …, xₙ]. Classical ML depends heavily on good hand-crafted features; deep learning learns intermediate features (representations) automatically from raw inputs.
Creating, transforming and selecting input features — usually with domain knowledge — so patterns become easier for a model to learn.
Examples: ratios (price per m²), date parts (weekday, holiday), log transforms of skewed values, aggregates (orders in the last 30 days), interactions between features, and encoding categories. It is often the biggest lever for classical models on tabular data. Every engineered feature must be computable at prediction time, or it causes leakage.
The 2D output produced by applying one filter across an input; it shows where that filter's pattern appears.
A conv layer with C_out filters produces C_out feature maps, stacked as the channels of its output tensor (N, C, H, W). Early feature maps highlight edges and colours; deeper ones respond to textures, parts and whole objects. Feature maps (activations) must be stored for backpropagation, which dominates training memory in CNNs.
Rescaling numerical features to comparable ranges, e.g. standardisation z = (x − μ)/σ or min-max scaling to [0, 1].
Distance-based methods (kNN, k-means, SVM), PCA, regularised linear models and gradient-based training are all sensitive to feature scale; tree-based models are not. Scaling statistics (μ, σ, min, max) must be computed on the training set and then applied unchanged to validation and test data — put the scaler inside a Pipeline. (Not to be confused with batch/layer normalization inside neural networks.)
A system that stores and serves ML features consistently for both training (historical) and inference (online, low-latency).
It solves training-serving skew: the same feature definition (e.g. "user's purchases in the last 7 days") feeds both the training dataset and the live model. An offline store provides point-in-time-correct historical values (no future leakage), and an online store (e.g. Redis) serves the latest values in milliseconds. Examples: Feast (open source), Tecton, Vertex AI and Databricks feature stores.
Including a few input→output examples in the prompt so the model infers the task and format, without updating its weights.
Popularized by GPT-3, few-shot prompting is a form of in-context learning. Examples pin down label sets, style and output structure, but the model also copies their biases — length, class balance, tone — and order can affect results.
Continuing to train a pretrained model on a smaller, task- or domain-specific dataset to adapt its behaviour.
Fine-tuning can update all weights (full fine-tuning) or only small added modules (PEFT, e.g. LoRA). For LLMs it covers supervised fine-tuning on demonstrations, instruction tuning, and preference tuning (RLHF, DPO). It is best for behaviour, format and style; for fresh or private facts, retrieval (RAG) is usually more reliable.
An exact, IO-aware attention algorithm that computes attention in tiles in fast on-chip memory, never storing the full N × N matrix.
Standard attention is limited by reads and writes of the large score matrix to GPU high-bandwidth memory. FlashAttention tiles Q, K and V into SRAM-sized blocks, uses an online softmax and recomputes values in the backward pass, giving the same result with memory linear in sequence length and large speedups. It is built into PyTorch's scaled_dot_product_attention and most LLM frameworks.
A generative training method that learns a velocity field transporting noise to data along simple (often straight) paths.
Lipman et al. (2022) regress a network onto the velocity of a chosen probability path. Rectified flow uses straight lines xₜ = (1 − t)·x₀ + t·ε with target velocity ε − x₀; sampling integrates the ODE from noise to data (e.g. with Euler steps). Used by Stable Diffusion 3 and FLUX; straighter paths allow fewer sampling steps.
A generator and a discriminator trained against each other: the generator makes fakes, the discriminator tries to spot them.
Introduced by Goodfellow et al. (2014). GANs generate sharp images in one forward pass but training is unstable (mode collapse, oscillation, vanishing gradients). Key variants: DCGAN, WGAN-GP, conditional GANs (pix2pix, CycleGAN) and StyleGAN. Largely overtaken by diffusion for text-to-image, but still used for super-resolution, vocoders and adversarial distillation of diffusion models.
A model that learns the distribution of its training data well enough to create new, similar samples.
Where a discriminative model learns p(y | x) (e.g. 'is this a cat?'), a generative model learns p(x) or p(x | condition) and can sample from it. Main families: VAEs, GANs, autoregressive models (including LLMs), normalizing flows, and diffusion / flow-matching models. Image, video, audio and text generators are all generative models.
OpenAI’s family of decoder-only transformers trained with next-token prediction; also the general name for this architecture style.
GPT (2018) showed generative pretraining plus fine-tuning works; GPT-2 (2019, 1.5B) showed zero-shot task ability from scale; GPT-3 (2020, 175B) showed few-shot in-context learning. Most open LLMs (Llama, Mistral, Qwen) use the same causal decoder-only design.
Graphics Processing Unit: a massively parallel processor that performs the matrix math of deep learning far faster than a CPU.
GPUs contain thousands of cores plus specialised Tensor Cores for low-precision matrix multiplication, and high-bandwidth memory (HBM). The amount of GPU memory (VRAM) limits which models fit, while memory bandwidth limits how fast LLMs generate tokens. Programs use them through CUDA (NVIDIA) or ROCm (AMD), usually via PyTorch; TPUs and other accelerators play similar roles.
The vector of partial derivatives of a function; it points in the direction of steepest increase.
For a loss L(θ) with many parameters, ∇L = [∂L/∂θ₁, …, ∂L/∂θₙ] tells how much the loss would change for a small change in each parameter. Its magnitude is the steepness. Gradient descent steps in the −∇L direction; backpropagation computes gradients efficiently for neural networks using the chain rule.
Summing gradients over several micro-batches before one optimizer step, to emulate a larger batch with limited memory.
Effective batch = micro-batch × accumulation steps × number of data-parallel GPUs. The loss should be divided by the number of accumulation steps so the gradient is an average. It is mathematically equivalent to a larger batch except for batch-dependent layers such as BatchNorm, and costs proportionally more time per optimizer step.
An ensemble that adds small decision trees one at a time, each fitted to the remaining errors (negative gradients of the loss) of the current model.
Formalised by Friedman (2001) as gradient descent in function space: Fₘ(x) = Fₘ₋₁(x) + ν·hₘ(x). Modern implementations — XGBoost, LightGBM, CatBoost, scikit-learn's HistGradientBoosting — add regularisation, histogram binning, native missing-value handling and fast parallel training. Gradient-boosted trees are frequently the most accurate models on tabular data.
Rescaling gradients whose norm exceeds a limit, to stop single bad batches from blowing up training.
Clip-by-norm: if ‖g‖ > c then g ← g · c / ‖g‖ (direction kept, length capped). It was popularized for RNNs' exploding gradients and is standard in transformer and LLM training, where it helps prevent loss spikes. In PyTorch: torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0) between backward() and optimizer.step(); the returned total norm is worth logging.
An optimisation algorithm that repeatedly moves parameters a small step against the gradient of the loss: θ ← θ − η·∇L(θ).
It is the engine behind training almost every ML model, from logistic regression to LLMs. Full-batch gradient descent uses all data per step; stochastic and mini-batch variants (SGD) estimate the gradient from a random subset, which is far cheaper and adds helpful noise. On convex losses it reaches the global minimum; on non-convex losses (neural networks) it finds a good local one. Momentum, RMSProp and Adam are improved variants.
Trying every combination of a fixed list of values for each hyperparameter.
Exhaustive and easy to parallelize (scikit-learn's GridSearchCV), but the cost multiplies: 5 values for each of 4 hyperparameters is 5⁴ = 625 trials. It also wastes effort on unimportant hyperparameters, since each important one is only tried at 5 distinct values.
A simpler gated RNN with an update gate and a reset gate and no separate cell state.
The GRU blends the previous state and a candidate state using the update gate, h_t = (1 − z_t) ⊙ h̃_t + z_t ⊙ h_{t−1} (PyTorch convention). With three weight sets instead of four it has about ¾ of an LSTM's parameters and often performs comparably; which is better depends on the task.
The knob that sets how strongly classifier-free guidance pushes a diffusion sample towards the prompt.
Called guidance_scale in diffusers and 'CFG scale' in most UIs. It is the multiplier s in ε̂ = ε(∅) + s·(ε(c) − ε(∅)). Distilled fast models (turbo, LCM, FLUX-schnell) are trained to work with guidance off or very low.
When a model generates fluent, confident content that is false or not supported by its input or sources.
LLMs are trained to produce plausible text, not to verify truth, so gaps in knowledge are filled with plausible-sounding inventions — fake citations, wrong numbers, non-existent APIs. Mitigations include retrieval (RAG) with citations, allowing “I don’t know”, lower temperature for factual tasks, tool use for calculations and lookups, and automated faithfulness checks.
A setting chosen before training that controls how the model learns or how complex it can be — e.g. learning rate, number of trees, k in kNN.
Hyperparameters are not learned by gradient descent; you choose them, ideally by comparing performance on a validation set or with cross-validation. They fall into two groups: capacity knobs (depth, number of layers, polynomial degree, regularisation strength) and optimisation knobs (learning rate, batch size, epochs). Systematic search is called hyperparameter tuning.
Searching for the hyperparameter values (learning rate, depth, regularization…) that give the best validation score.
Strategies include grid search, random search, Bayesian optimization (e.g. Optuna's TPE) and early-stopping schemes like successive halving/Hyperband that kill bad trials early. Always tune on validation data or with cross-validation and report the final score on an untouched test set, otherwise the reported number is optimistically biased.
Generating a new image from an input image plus a prompt, by partially noising the input and denoising it again.
Based on the SDEdit idea: encode the input, add noise up to an intermediate timestep set by the denoising strength, then run the remaining denoising steps conditioned on the prompt. Used for restyling, turning sketches into finished images, and upscaling passes.
A model’s ability to learn a task from instructions or examples placed in its prompt, with no gradient updates.
First demonstrated at scale by GPT-3, in-context learning lets one frozen model perform translation, classification or formatting tasks it was never explicitly fine-tuned for. It works because pretraining text is full of repeated patterns, so “continue the pattern” is what next-token prediction rewards. Its effect disappears when the examples leave the context.
Using a trained model, with its parameters fixed, to make predictions on new inputs.
Training happens once (or occasionally); inference happens every time the model is used — each search query, each chat message, each photo. Inference cost and latency therefore often dominate real-world budgets, which is why techniques like quantization, distillation and batching matter. (In statistics, ‘inference’ can also mean drawing conclusions about parameters; in ML engineering it means prediction.)
Regenerating only a masked region of an image so that it blends with the untouched rest.
With diffusion, the masked area is noised and denoised under a prompt while the unmasked area is kept. Dedicated inpainting checkpoints receive extra input channels (masked-image latent + mask) and blend edges much better. Used to fix hands or faces, remove objects, or extend images (outpainting).
Supervised fine-tuning on many tasks phrased as natural-language instructions with good responses, so the model learns to follow instructions in general.
Training on a broad mix of instruction→response pairs teaches a base model the format of being an assistant and improves zero-shot performance on unseen tasks, as shown by FLAN and InstructGPT. Data diversity and quality matter more than sheer size; the loss is usually computed only on response tokens.
Methods for understanding why a model makes its predictions and what it computes internally.
Post-hoc attribution methods (permutation importance, SHAP, LIME, saliency, integrated gradients) explain which inputs drove a prediction. Mechanistic interpretability reverse-engineers internal representations and circuits, e.g. with probes and sparse autoencoders that untangle features stored in superposition. Explanations can be unfaithful, so they need sanity checks and interventions.
One update of the model's weights: forward pass, loss, backward pass and optimizer step on a single mini-batch.
Iterations per epoch = ⌈N / B⌉ and total iterations = epochs × ⌈N / B⌉. Because weights only change at iterations, steps are the real clock of training: learning-rate schedules, warmup, logging and checkpoints are usually defined in steps. Comparing runs with different batch sizes “per epoch” compares different numbers of updates.
A clustering algorithm that alternates between assigning points to the nearest of K centroids and moving each centroid to the mean of its points.
It minimises inertia (within-cluster sum of squared distances) and always converges, but only to a local minimum that depends on initialisation — hence multiple restarts and k-means++ seeding (Arthur & Vassilvitskii, 2007). It assumes roughly spherical, similar-sized clusters and requires scaled features. The standard iterative procedure is known as Lloyd's algorithm.
A method that predicts by looking up the k most similar training examples and taking a majority vote (classification) or average (regression).
kNN has no training phase — it stores the data and does all the work at prediction time, so predictions get slow on large datasets (approximate nearest-neighbour indexes help). It relies entirely on the distance metric, so features must be scaled, and it degrades in very high dimensions where all points become roughly equidistant. Cover & Hart (1967) showed that the 1-NN error is asymptotically at most twice the Bayes error.
The small grid of learnable weights (e.g. 3×3×C_in) that a convolution slides over its input; each filter detects one pattern.
A filter spans all input channels, and a layer with C_out filters outputs C_out feature maps, so a layer has (k·k·C_in + 1)·C_out parameters. Hand-designed kernels (blur, Sobel edge detectors) show what filters can do; CNNs learn their kernels by backpropagation, and first-layer filters typically end up looking like edge and colour detectors.
Training a small student model to imitate the output distribution of a larger teacher model.
The student is trained on the teacher's softened probabilities (soft targets at temperature T), which reveal how the teacher relates classes or tokens, usually mixed with the normal hard-label loss. DistilBERT kept ~97% of BERT's performance with 40% fewer parameters; many small LLMs are distilled from larger ones via their logits or generated text.
Stored attention keys and values of previous tokens, reused at every generation step so they are not recomputed.
Because of the causal mask, past keys and values never change, so each decode step only computes them for the newest token. The cache grows linearly with sequence length and batch size — 2 × layers × KV heads × head dim × tokens × bytes — and often dominates GPU memory when serving long contexts. Grouped-query attention, cache quantization and paged memory management reduce it.
The correct answer attached to a training example — what the model is trained to predict (y).
Labels can be numbers (a price, for regression) or categories (spam / not spam, for classification). They usually come from human annotation or from records of what actually happened, and they are often the most expensive part of a dataset. Noisy or inconsistent labels put a ceiling on achievable accuracy.
A model that assigns probabilities to sequences of tokens, usually by predicting each next token from the previous ones.
By the chain rule, P(x₁…x_T) = Π P(x_t | x_<t). Language models range from simple n-gram counts to RNNs and today’s transformers. Their quality is measured by cross-entropy loss or perplexity on held-out text.
A very large transformer language model (billions of parameters) pretrained on massive text corpora and usually tuned to follow instructions.
LLMs such as GPT, Llama, Claude, Gemini, Qwen and Mistral are mostly decoder-only transformers trained with next-token prediction, then post-trained with SFT and preference tuning. Scale gives them broad knowledge and in-context learning, but they can hallucinate and their knowledge stops at a training cutoff.
How long one request takes from arrival to response.
Report percentiles, not just the average: p50 (median), p95, p99. A service with 40 ms average can still have p99 = 900 ms, which is what unlucky users feel. For LLMs, latency splits into time-to-first-token (TTFT) and time per output token. It includes network, queueing, preprocessing and model compute.
Running the diffusion process in the compressed latent space of a pretrained autoencoder instead of on pixels.
Rombach et al. (2022) showed that a VAE with 8× downsampling preserves perceptual quality while making each denoising step about 48× cheaper (512×512×3 → 64×64×4). Conditioning (text, layouts) is injected via cross-attention. This is the architecture of Stable Diffusion and many video models.
The compressed space of hidden codes a model uses to represent data; nearby points correspond to similar data.
In a VAE or GAN, the latent vector z is what you sample and decode; moving through it gives smooth changes (interpolation, attribute directions such as 'add a smile'). In latent diffusion the 'latent' is a small spatial feature map (e.g. 64×64×4) produced by a VAE encoder, where the diffusion process runs.
Normalizes the features of each individual example (or token) to zero mean and unit variance, independent of the batch.
LayerNorm uses the same formula as BatchNorm but computes statistics across features of one example, so it behaves identically in training and inference and for any batch size or sequence length. It is standard in Transformers and RNNs. RMSNorm, a simplified variant without mean subtraction, is common in recent LLMs. Placing it before each sub-layer (Pre-LN) stabilizes deep Transformers.
A plot of training and validation score against training-set size (sometimes used loosely for score vs epochs).
In the strict sense (scikit-learn's learning_curve) it answers "would more data help?". If train and validation scores converge at a poor value, the model has high bias — more data will not help, use a bigger model or better features. If a large gap remains that shrinks as data grows, the model has high variance — more data or regularization will help.
The step size η that scales each gradient update: w ← w − η·∇L.
The learning rate is usually the most important hyperparameter. Too small and training is painfully slow; too large and the loss oscillates or diverges to NaN. Good values depend on the optimizer (SGD ~0.01–0.1, Adam ~1e-4–3e-3, fine-tuning ~1e-5), the batch size and the model. It is usually varied during training by a schedule (warmup then decay) and is best searched on a log scale or with an LR range test.
A rule for changing the learning rate during training, e.g. warmup followed by cosine, linear or step decay.
Large steps are useful early for fast progress; small steps are useful late to settle into a minimum. Common schedules: step decay (÷10 at fixed epochs), cosine annealing η_t = η_min + ½(η_max − η_min)(1 + cos(πt/T)), linear decay, one-cycle, and reduce-on-plateau. Schedules are defined over steps or epochs — calling the scheduler at the wrong granularity is a common bug.
Starting training with a very small learning rate and increasing it gradually (usually linearly) to its target over the first steps.
At the start, weights are random, gradients are large and Adam's statistics are unreliable, so a full-size step can destabilise training. Warmup avoids early divergence and is essential for Transformers (the original used 4,000 steps) and for large-batch training with the linear scaling rule (Goyal et al. used 5 epochs).
Predicting a number as a weighted sum of features plus a bias, ŷ = wᵀx + b, fitted by minimising squared error.
Ordinary least squares has a closed-form solution w = (XᵀX)⁻¹Xᵀy and can also be fitted by gradient descent. Each weight is the change in prediction per unit change of its feature, holding others fixed. It is a fast, interpretable baseline; ridge (L2) and lasso (L1) add regularisation. ‘Linear’ means linear in the parameters, so polynomial features still count.
A linear classifier that passes the score wᵀx + b through a sigmoid to output a class probability, trained with cross-entropy.
Despite the name, it is used for classification. The linear score is the log-odds of the positive class, so each weight tells how a feature shifts the odds (a weight of 0.7 multiplies the odds by e^0.7 ≈ 2). The multinomial (softmax) version handles more than two classes. It is fast, well calibrated and interpretable — a standard baseline and the building block of a neural network's output layer.
The raw, unnormalized scores a model outputs for each class or vocabulary token, before softmax turns them into probabilities.
An LLM produces one logit per vocabulary token at each position (e.g. 50,257 numbers for GPT-2). Only differences between logits matter to softmax. Decoding methods manipulate logits — dividing by temperature, masking all but the top-k, adding repetition penalties — before sampling.
A PEFT method that freezes a weight matrix W and learns a low-rank update ΔW = B·A with a small rank r.
The layer computes h = Wx + (α/r)·BAx, where B (d×r) starts at zero and A (r×k) is random, so training begins at the base model. Trainable parameters drop from d·k to r(d+k) per matrix, often well under 1% of the model. Adapters can be merged into W after training (no extra latency). QLoRA combines LoRA with a 4-bit quantized base model.
A plot of loss against training steps or epochs, usually for both training and validation data.
The shape of the two curves is the main diagnostic of a training run: both falling and close → good fit; train falling while validation rises → overfitting; both high and flat → underfitting; jagged or exploding → learning rate too high; validation suspiciously below train → possible leakage or regularization only active in training. Plot loss on a log scale and apply light smoothing to see trends.
A function that measures how wrong the model's predictions are; training adjusts parameters to minimise it.
Common choices: mean squared error for regression, cross-entropy for classification, hinge loss for SVMs. The loss must be (mostly) differentiable for gradient-based training, and its choice encodes what kind of mistakes you care about — MSE punishes large errors heavily, MAE treats all errors linearly. The loss used for training is not always the metric used for reporting (e.g. train with cross-entropy, report F1).
A gated RNN with a separate cell state and forget, input and output gates, designed to remember information over long sequences.
The cell state is updated additively, c_t = f_t ⊙ c_{t−1} + i_t ⊙ c̃_t, so information and gradients can flow across many time steps when the forget gate stays near 1. LSTMs powered machine translation, speech recognition and language models before Transformers, and remain common for streaming and time-series tasks. An LSTM layer has four weight sets (three gates plus the candidate).
The branch of AI in which systems learn patterns from data to improve at a task, instead of following rules written by a programmer.
Tom Mitchell's classic definition: a program learns from experience E with respect to task T and performance measure P if its performance on T, measured by P, improves with E. In practice you choose a model family and a loss function, and an optimisation algorithm adjusts the model's parameters on training data. Main paradigms are supervised, unsupervised, self-supervised and reinforcement learning.
The formal model of an RL problem: states, actions, transition probabilities, rewards and a discount factor.
An MDP (S, A, P, R, γ) assumes the Markov property: the next state and reward depend only on the current state and action. Solving it means finding a policy that maximises expected discounted return; with known P and R this can be done by dynamic programming (value/policy iteration), otherwise by RL from samples. When the agent sees only partial observations, the problem is a POMDP.
A rectangular grid of numbers with m rows and n columns; multiplying it by a vector performs many dot products at once.
A dataset is a matrix (rows = examples, columns = features), and a neural-network layer is y = Wx + b with weight matrix W. Matrix multiplication requires matching inner dimensions: (m×n)·(n×p) → (m×p). GPUs are built to perform huge matrix multiplications fast, which is why deep learning runs on them.
The average absolute difference between predictions and true values, in the target's own units.
MAE = (1/n) Σ |yᵢ − ŷᵢ|. If you predict house prices and MAE = 25 million, predictions are off by 25 million on average. It treats every unit of error equally, so it is more robust to outliers than MSE/RMSE.
The average of squared differences between predictions and true values: MSE = (1/n)·Σ(yᵢ − ŷᵢ)².
The standard regression loss. Squaring makes all errors positive and penalises large errors much more than small ones, which makes MSE sensitive to outliers. Minimising MSE is equivalent to maximum likelihood under Gaussian noise. Its square root, RMSE, is in the same units as the target and easier to interpret.
A spectrogram whose frequency axis is warped to the perceptual mel scale and compressed into a few dozen bands.
A bank of triangular filters spaced evenly on the mel scale (m = 2595·log₁₀(1 + f/700)) is applied to the STFT power spectrum, then usually log-compressed. The result (e.g. 80 × frames) is compact and matches human pitch perception, and is the standard input for ASR (Whisper) and the standard intermediate target for TTS (Tacotron 2 → vocoder).
Training with 16-bit (or 8-bit) floats for most computation while keeping critical values in 32-bit.
Matrix multiplications run in FP16 or BF16 on Tensor Cores while an FP32 master copy of the weights receives the updates. FP16's narrow range requires loss scaling to keep small gradients from underflowing; BF16 has FP32's exponent range and usually needs none. It roughly halves activation memory and speeds up training substantially; FP8 extends the idea on the newest GPUs.
An architecture where a router sends each token to a few of many expert sub-networks, so only part of the model runs per token.
In Transformer MoEs, the feed-forward layer is replaced by N expert FFNs and a learned top-k router. Total parameters grow with N while compute per token grows only with k, e.g. Mixtral 8×7B has ~47B parameters but ~13B active. Practical challenges are load balancing (auxiliary losses, capacity limits), memory for all experts, and all-to-all communication.
An open-source platform for experiment tracking, model packaging, a model registry and model serving.
Core API: mlflow.set_experiment(...), with mlflow.start_run():, mlflow.log_params, mlflow.log_metric(name, value, step=...), mlflow.log_artifact, mlflow.<flavor>.log_model and mlflow.autolog(). mlflow ui (or mlflow server) shows runs in a browser for sorting and comparison. The Model Registry versions models; since MLflow 2.9 aliases such as models:/name@champion are recommended over the deprecated Staging/Production stages.
The practices and tooling for reliably building, deploying, monitoring and updating ML systems in production.
MLOps applies DevOps ideas (automation, versioning, testing, CI/CD, monitoring) to ML, where not only code but also data and models change. Google's maturity model goes from level 0 (manual notebooks, rare releases) to level 1 (automated training pipeline, continuous training) to level 2 (automated CI/CD of the pipeline itself). Sculley et al. (2015) showed that the model code is a small part of a real ML system; most of the debt lives in data, configuration and glue code.
A feed-forward network of fully connected layers with non-linear activations between them.
An MLP maps an input vector through one or more hidden layers to an output. With enough hidden units it can approximate any continuous function on a bounded domain (universal approximation). MLPs are strong baselines for tabular data and appear as the feed-forward sub-layer of every Transformer block.
A mathematical function with learnable parameters that maps inputs to predictions: ŷ = f(x; θ).
The model family (a line, a decision tree, a transformer) fixes the shape of the function; training picks the parameter values. After training, the model is a file of numbers plus code that computes f, used for inference. A model's capacity — how complex a function it can represent — determines whether it tends to underfit or overfit.
Continuously watching a deployed model's inputs, outputs, performance and system health to catch problems early.
Monitor four layers: system (latency, errors, memory), data (schema violations, missing values, input drift), predictions (output distribution, confidence) and outcomes (accuracy once true labels arrive, often days later). Because labels are delayed, drift in inputs and outputs is often the first warning. Alerts should lead to a runbook: investigate, roll back, or retrain.
Splitting a single model across devices — by tensor (within layers), by pipeline stage (across layers) or by expert.
Tensor parallelism (Megatron-LM) splits weight matrices so each GPU computes part of every layer, requiring fast intra-node links. Pipeline parallelism (GPipe) places consecutive layers on different GPUs and streams micro-batches through, with an idle “bubble” that shrinks as micro-batches increase. Expert parallelism places MoE experts on different devices. Large runs combine these with data parallelism (3D parallelism).
A central catalog of named models with numbered versions, lineage back to runs, and labels saying which version is in use.
Registering a model (e.g. mlflow.register_model("runs:/<run_id>/model", "churn")) creates version 1, 2, 3… Deployment code loads by a movable alias like models:/churn@champion, so promoting or rolling back is just reassigning the alias — no code change. The registry also stores descriptions and tags (e.g. validation status) and answers "which run, data and code produced the model in production?".
Making a trained model available to other software, usually as an API that returns predictions.
Options range from a small FastAPI app in a Docker container, to dedicated servers like NVIDIA Triton, TorchServe or vLLM (LLMs), to managed endpoints on cloud platforms. Key concerns are latency, throughput, cost, autoscaling, versioning and safe rollout (canary, shadow, A/B). Servers often apply dynamic batching: they wait a few milliseconds to group concurrent requests into one GPU batch.
An optimizer technique that accumulates a decaying sum of past gradients (a velocity) so updates keep moving in consistent directions.
With v ← βv + g and θ ← θ − ηv, gradient components that keep the same sign add up while oscillating components cancel, which speeds travel along ravines and through small bumps and plateaus. With a constant gradient the step grows to η/(1 − β). Nesterov momentum evaluates the gradient at the look-ahead point. Adam's β₁ plays the same role.
Running several attention operations (heads) in parallel on different learned projections and concatenating their outputs.
With h heads, each head works in a d_model/h-dimensional subspace, so the total cost is similar to one full-width head. Different heads can specialise in different relationships (previous token, coreference, syntax). The original Transformer used 8 heads with d_model = 512 (d_k = 64).
Involving more than one type of data, such as text, images, audio and video, in the same model.
Multimodal models either map different modalities into a shared embedding space (CLIP), feed encoded non-text inputs to a language model (VLMs), or generate one modality from another (text-to-image, text-to-video, text-to-speech). Some recent models are trained natively on interleaved modalities from the start.
Text describing what you do not want in a generated image; guidance pushes the sample away from it.
Implemented by using the negative prompt's embedding in place of the empty (unconditional) prompt in classifier-free guidance. Common uses: 'blurry, low quality, watermark, text, extra fingers'. Only works when CFG is active (guidance scale > 1).
A neural network that represents a 3D scene as colour and density at every point, rendered into images by volume rendering.
Mildenhall et al. (2020) train an MLP F(x, d) → (colour, density) per scene from posed photos, using positional encoding and differentiable volume rendering along camera rays. It produces photorealistic novel views but was slow to train and render; hash-grid methods (Instant-NGP) made it fast, and NeRFs are used as the 3D representation in text-to-3D (DreamFusion).
A neural autoencoder that compresses audio into a short sequence of discrete tokens and decodes it back.
Codecs such as SoundStream and EnCodec encode the waveform into latent frames (50–75 per second), quantize each with residual vector quantization (several codebooks refining each other), and decode with a convolutional decoder trained with reconstruction and adversarial losses. Besides efficient compression, their tokens are the vocabulary for audio language models (AudioLM, MusicGen, VALL-E).
The basic unit of a neural network: a weighted sum of inputs plus a bias, passed through an activation function.
A neuron computes z = w·x + b and outputs a = f(z). The weights w and bias b are learned; f is a fixed non-linearity such as ReLU. Neurons are organised into layers, and a layer of n neurons is just a matrix multiplication followed by an element-wise activation. The design is only loosely inspired by biological neurons.
The training objective of GPT-style models: given all previous tokens, predict the probability distribution of the next one.
The loss is the average cross-entropy −log P(x_t | x_<t) over every position, computed in parallel thanks to a causal attention mask. The task is self-supervised — text supplies its own labels — and doing it well forces the model to learn grammar, facts and reasoning patterns.
The sequence β₁…β_T (or equivalently ᾱₜ) that sets how much noise a diffusion model adds at each timestep.
The noisy sample is xₜ = √ᾱₜ·x₀ + √(1 − ᾱₜ)·ε, so the schedule controls the signal-to-noise ratio over time. DDPM used a linear β schedule (1e-4 → 0.02); improved DDPM introduced the cosine schedule, which destroys information more evenly. Stable Diffusion uses a 'scaled linear' schedule.
Representing a categorical value as a binary vector with a single 1 in the position of its category, e.g. Jakarta → [0, 1, 0].
It avoids the false order and spacing implied by mapping categories to integers (1, 2, 3). The downside is width: a column with 10,000 categories becomes 10,000 mostly-zero columns. For high-cardinality features, alternatives include grouping rare categories, feature hashing, target encoding or learned embeddings. In scikit-learn use OneHotEncoder(handle_unknown="ignore") so unseen categories at prediction time do not crash.
min_frequency / max_categories merge rare categories: raising the threshold gives fewer columns and less overfitting to rare values, at the cost of lumping informative rare categories together.Open Neural Network Exchange — a standard file format for ML models that runs across frameworks and hardware.
You export a model once (e.g. torch.onnx.export from PyTorch, or skl2onnx for scikit-learn) and run it with ONNX Runtime on CPU, GPU or mobile, or hand it to optimizers like TensorRT. Benefits: no Python training stack needed at inference, graph optimizations, and often lower latency. Check numerical parity between the original and exported model after export.
The rule that turns gradients into weight updates, e.g. SGD, SGD with momentum, RMSProp, Adam or AdamW.
Optimizers differ in whether they keep a memory of past gradients (momentum) and whether they adapt the step size per parameter (RMSProp, Adam). Adaptive methods need less tuning and are standard for Transformers; SGD with momentum often generalizes best for CNNs. Optimizers keep state (Adam: two tensors per parameter), which costs memory and must be saved in checkpoints.
When a model learns the training data too closely — including its noise — so it performs well on training data but poorly on new data.
The signature is a large gap between low training error and high validation error. It happens when model capacity is too high for the amount of data, when training runs too long, or when the data are few and noisy enough to be memorised. Remedies: more data, data augmentation, regularisation (L1/L2, dropout, weight decay), simpler models, early stopping and ensembling.
Extra border pixels (usually zeros) added around an input so a convolution can be centred on edge pixels and keep the output size.
With kernel size k and stride 1, padding p = (k − 1)/2 gives “same” output size; p = 0 (“valid”) shrinks the output by k − 1. Without padding, deep CNNs would shrink the image to nothing and under-use border pixels. Reflection or replicate padding are alternatives to zeros. In sequence models, “padding” also means filling shorter sequences to a common length.
A number inside the model that is learned from data during training, such as a weight or a bias.
A line ŷ = w·x + b has two parameters, w and b; GPT-3 has 175 billion. The optimiser updates parameters to reduce the loss. Do not confuse them with hyperparameters, which you set before training. Parameter count is a rough measure of model size and memory: at 2 bytes per parameter, a 7-billion-parameter model needs about 14 GB just for its weights.
Fine-tuning methods that train only a small number of new or selected parameters while the pretrained weights stay frozen.
Examples include LoRA, QLoRA, adapters, prefix/prompt tuning and IA³. PEFT slashes GPU memory and storage (an adapter can be a few MB instead of many GB), lets one base model serve many tasks by swapping adapters, and reduces catastrophic forgetting. The Hugging Face peft library implements most methods.
Rosenblatt's 1958 single-neuron classifier with a step activation; it can only learn linearly separable problems.
The perceptron outputs 1 if w·x + b > 0 and 0 otherwise, and updates its weights only when it misclassifies an example. It is guaranteed to converge when the classes are linearly separable, but a single perceptron cannot learn XOR. Stacking neurons with smooth activations — the multilayer perceptron trained by backpropagation — removed this limit.
The exponential of the average per-token cross-entropy; roughly, how many tokens the model is “choosing between” on average. Lower is better.
Perplexity = exp(−(1/T) Σ log P(x_t | x_<t)). A perplexity of 1 means perfect prediction; a uniform guess over V tokens gives V. It is useful for comparing language models on the same text with the same tokenizer, but values are not comparable across different tokenizers and do not directly measure helpfulness.
The agent's behaviour: a mapping from states to actions or action probabilities, written π(a | s).
A policy can be deterministic (always the same action in a state) or stochastic (a distribution over actions). Value-based methods derive it implicitly by acting greedily on Q-values; policy-gradient methods parametrise it directly with a neural network. In RLHF, the language model itself is the policy.
RL methods that directly adjust a parametrised policy by gradient ascent on expected return.
The policy-gradient theorem gives ∇J = E[∇log π_θ(a|s)·(G − b(s))]: make actions that led to higher-than-baseline returns more likely. REINFORCE (Williams, 1992) is the simplest form; actor-critic methods replace G with a learned advantage estimate. Policy gradients handle continuous and stochastic actions naturally but suffer from high variance.
A parameter-free downsampling operation that summarises small regions of a feature map, typically by their maximum or average.
Max pooling 2×2 with stride 2 halves height and width while keeping the strongest responses, giving some tolerance to small shifts. Global average pooling collapses each feature map to one number and connects CNN features to the classifier. Many modern networks use strided convolutions instead of pooling layers.
Information about each token's position added to (or applied within) a Transformer, since attention by itself ignores order.
The original Transformer added fixed sinusoids, PE(pos, 2i) = sin(pos/10000^(2i/d)) and cos for odd dimensions. BERT and GPT-2 learn one vector per position. Many recent LLMs use rotary position embeddings (RoPE), which rotate queries and keys so scores depend on relative distance; ALiBi adds a distance penalty to attention scores.
Of everything the model flagged as positive, the fraction that really is positive.
Precision = TP / (TP + FP). High precision means few false alarms. It matters when a false positive is costly — e.g. a spam filter that must not hide important email, or flagging a customer for fraud review.
The first, most expensive training stage, where a model learns general knowledge from huge unlabeled corpora via a self-supervised objective.
For LLMs this means next-token prediction over trillions of tokens of web text, books, code and papers, costing roughly 6 × parameters × tokens FLOPs. The result is a base model, which is then adapted with fine-tuning. Data quality, deduplication and the mix of domains strongly influence the final model.
A linear method that rotates data onto the orthogonal directions of greatest variance, so you can keep just the first few as compressed features.
The principal components are the eigenvectors of the data's covariance matrix (computed in practice via SVD); each eigenvalue is the variance along its component. PCA is used for visualisation, compression, denoising and speeding up downstream models. It is sensitive to feature scale and outliers, only captures linear structure, and its components mix all original features, which can hurt interpretability. Introduced by Pearson (1901).
A description of how likely each possible outcome of a random variable is; probabilities are non-negative and sum (or integrate) to 1.
Discrete examples: Bernoulli (coin flip), categorical (a classifier's output over classes, an LLM's output over next tokens). Continuous examples: the normal (Gaussian) distribution N(μ, σ²), used to model noise and initialise weights. Key summaries are the mean (expected value) and variance. Many models are trained by maximising the likelihood of the data under a predicted distribution, which is the same as minimising cross-entropy.
The input given to a language model — instructions, context, examples and the question — that conditions what it generates.
In chat APIs a prompt is a list of messages with roles (system, user, assistant, tool) that a chat template turns into one token sequence. Everything in the prompt counts toward the context window and cost. Clear task, context, constraints, output format and examples are the main ingredients of a good prompt.
The practice of designing and iterating on prompts to get reliable, high-quality outputs from a model.
Techniques include clear and specific instructions, delimiting input data, few-shot examples, chain-of-thought, structured output schemas and system prompts. Good prompt engineering is empirical: build a small evaluation set, change one thing at a time, and measure.
A widely used actor-critic algorithm that limits each policy update by clipping the new/old probability ratio.
PPO maximises min(r·Â, clip(r, 1−ε, 1+ε)·Â), where r is the ratio between new and old action probabilities and  the advantage (often from GAE). The clip removes the incentive to move the policy too far from the one that collected the data, allowing several epochs of mini-batch updates per batch. It is simple and robust, and is the classic optimiser in RLHF.
Removing weights, neurons, heads or layers that contribute little, to make a model smaller or faster.
Unstructured pruning zeroes individual low-magnitude weights and can reach high sparsity but rarely speeds up dense GPU kernels; structured pruning removes whole units for real speedups at a larger accuracy cost. Semi-structured 2:4 sparsity is accelerated on recent NVIDIA GPUs. Pruning is usually followed by fine-tuning to recover accuracy.
An off-policy RL algorithm that learns action values Q(s, a) by moving them toward r + γ·max Q(s′, ·).
After each transition, Q(s, a) ← Q(s, a) + α[r + γ·maxₐ′ Q(s′, a′) − Q(s, a)]. It needs no model of the environment and learns the greedy policy's values while behaving exploratorily (e.g. ε-greedy). Tabular Q-learning converges under mild conditions (Watkins & Dayan, 1992); DQN extends it to neural networks with experience replay and target networks.
Storing and computing with lower-precision numbers (e.g. 8-bit or 4-bit integers) to shrink models and speed up inference.
Values are mapped onto a small grid of integers using a scale (and optional zero-point); symmetric absmax and asymmetric min-max are common schemes, with per-channel or per-group scales to limit the damage from outliers. Post-training methods (LLM.int8(), GPTQ, AWQ, NF4) dominate for LLMs; quantization-aware training adapts the model to rounding. A 7B model drops from 14 GB in FP16 to ~3.5 GB in 4-bit.
The fraction of the target's variance explained by the model, compared with always predicting the mean.
R² = 1 − SS_res / SS_tot, where SS_res = Σ(yᵢ − ŷᵢ)² and SS_tot = Σ(yᵢ − ȳ)². R² = 1 is perfect, 0 equals the mean baseline, and it can be negative on held-out data when the model is worse than the mean. It is unitless, so always report it alongside MAE or RMSE.
Retrieving relevant passages from a knowledge base at query time and adding them to the prompt so the LLM answers from them.
A typical pipeline chunks documents, embeds the chunks, stores them in a vector database, retrieves the top-k for each query (often with hybrid keyword search and a reranker), and prompts the LLM to answer with citations. RAG keeps knowledge current without retraining and reduces hallucination, but its quality is capped by retrieval quality.
An ensemble of decision trees, each trained on a bootstrap sample with random feature subsets at each split, whose predictions are averaged or voted.
Introduced by Breiman (2001). Bagging reduces variance by averaging many deep, low-bias trees, and random feature selection decorrelates them so averaging helps more. Out-of-bag examples provide a built-in validation estimate. Random forests work well with little tuning and are a strong default for tabular data.
Sampling hyperparameter combinations at random from given ranges or distributions.
Bergstra & Bengio (2012) showed it usually beats grid search for the same budget, because only a few hyperparameters really matter and random sampling tries many distinct values of each. Use RandomizedSearchCV with log-uniform distributions (e.g. scipy.stats.loguniform) for learning rates.
Of all truly positive cases, the fraction the model found (also called sensitivity or true positive rate).
Recall = TP / (TP + FN). High recall means few misses. It matters when a false negative is costly — e.g. missing a cancer on a scan or failing to catch a fraudulent transfer.
The region of the input that can influence a particular unit in a network layer.
A unit after one 3×3 conv sees 3×3 pixels; after two, 5×5; after three, 7×7. Strides and pooling multiply the growth: r_l = r_{l−1} + (k_l − 1)·Π s. Deep units need large receptive fields to recognise whole objects; dilated convolutions, downsampling and attention enlarge them cheaply.
Deliberately attacking an AI system to discover harmful behaviours and vulnerabilities before deployment.
Red teams use jailbreak prompts, role-play, multilingual or code-switched attacks, prompt injection and capability probes, combining human experts with automated attack generation. Findings feed back into training, filters and policies, and testing is repeated when the model or its tools change. Regulations such as the EU AI Act require adversarial testing for general-purpose models with systemic risk.
A supervised task where the target is a continuous number, such as a price, temperature or demand.
Common models: linear/ridge regression, decision-tree ensembles, kNN regression and neural networks with a linear output. Typical losses and metrics are MSE, RMSE, MAE and R². The name comes from Francis Galton's ‘regression toward the mean’.
Any technique that constrains a model to reduce overfitting, most classically adding a penalty on weight size to the loss.
L2 (ridge, weight decay) adds λ·Σw² and shrinks all weights smoothly; L1 (lasso) adds λ·Σ|w| and drives some weights exactly to zero, selecting features. Elastic Net mixes both. In a broader sense, dropout, early stopping, data augmentation, limiting tree depth and min_samples_leaf are also regularisers. Features should be scaled so the penalty treats them fairly.
Learning to act by trial and error: an agent takes actions in an environment and learns to maximise cumulative reward.
Unlike supervised learning, RL has no correct answer per example — only reward signals, often delayed. The agent must balance exploring new actions with exploiting known good ones. Methods range from tabular Q-learning to deep RL (DQN, PPO); applications include games, robotics, recommendation and RLHF for language models.
The activation max(0, z): passes positive values unchanged and outputs zero for negative ones.
ReLU is cheap, does not saturate for positive inputs (derivative 1), and made deep networks much easier to train; it is the default in MLPs and CNNs. Its weakness is the “dead ReLU”: a unit whose input is always negative gets zero gradient and stops learning. Leaky ReLU, ELU, GELU and SiLU keep a small signal for negative inputs.
Being able to re-run an experiment and get the same (or statistically the same) result.
It requires pinning code (git commit), data (a version or hash), environment (package versions, container), configuration (all hyperparameters) and randomness (seeds for Python, NumPy and PyTorch). Some GPU kernels are non-deterministic; torch.use_deterministic_algorithms(True) trades speed for determinism. Report the mean ± std over several seeds rather than a single lucky run.
A CNN architecture built from residual blocks y = F(x) + x, whose skip connections make networks with 100+ layers trainable.
He et al. (2015) observed that simply stacking more layers increased training error (the degradation problem). Residual blocks only need to learn a correction to the identity, and the skip path gives gradients a direct route backwards. ResNet won ILSVRC 2015; ResNet-50 (25.6M parameters) remains a standard backbone, and residual connections are now in virtually every deep architecture, including Transformers.
The scalar feedback signal an RL agent receives after an action, defining what it should achieve.
The agent maximises the sum of (discounted) future rewards, not the immediate reward. Designing rewards is hard: sparse rewards make learning slow, while shaped rewards can be exploited in unintended ways (reward hacking). In RLHF the reward comes from a reward model trained on human preferences.
A model trained to score how good a response is, usually from pairwise human preference data.
Typically an LLM with a scalar output head, trained with a Bradley–Terry loss −log σ(r(x, y_chosen) − r(x, y_rejected)). It provides the training signal in RLHF and is also used to rank or filter samples (best-of-n). Its blind spots are exactly what a policy learns to exploit.
Aligning a model with human preferences by training a reward model on human comparisons and optimizing the LLM against it with reinforcement learning.
The classic pipeline (InstructGPT): SFT → collect human rankings of model outputs → train a reward model → optimize the policy with PPO to maximize reward minus a KL penalty that keeps it close to the SFT model. RLHF made models markedly more helpful and less harmful, but is complex and can suffer from reward hacking.
A network that processes a sequence one step at a time, updating a hidden state with the same weights at every step.
A vanilla RNN computes h_t = tanh(W_xh x_t + W_hh h_{t−1} + b). It handles variable-length input naturally and is trained with backpropagation through time, but gradients over long distances vanish or explode, so plain RNNs struggle with long-range dependencies. Gated variants (LSTM, GRU) fix much of this. RNNs process tokens sequentially, which makes training slower than Transformers.
The ROC curve plots true positive rate vs false positive rate over all thresholds; AUC is the area under it.
TPR = TP/(TP+FN), FPR = FP/(FP+TN). AUC equals the probability that a randomly chosen positive gets a higher score than a randomly chosen negative: 0.5 is random guessing, 1.0 is perfect ranking. ROC-AUC is threshold-independent, but on heavily imbalanced data it can look optimistic; the precision-recall curve (and its average precision) is then more informative.
The square root of the mean squared error — a typical error size that punishes large mistakes more.
RMSE = √((1/n) Σ (yᵢ − ŷᵢ)²). It has the same units as the target (unlike MSE) and is always ≥ MAE; a big gap between RMSE and MAE signals a few large errors. Prefer it when large errors are disproportionately bad.
One execution of training or evaluation code, recorded with its parameters, metrics, tags and artifacts.
In MLflow, runs belong to an experiment and have a unique run ID; parameters are logged once, while metrics can be logged many times with a step to form a curve. Runs can be nested (a parent run for a tuning sweep, child runs for each trial). Comparing runs side by side is the main way to learn which change helped.
How many times per second an audio signal is measured, in hertz (e.g. 16,000 Hz).
Digital audio is a sequence of samples taken at a fixed rate f_s. By the Nyquist–Shannon theorem, only frequencies below f_s / 2 (the Nyquist frequency) can be represented; higher ones alias into false lower tones. Speech models typically use 16 kHz, TTS 22.05–24 kHz, and music 44.1–48 kHz. Pretrained models expect one specific rate, so input must be resampled to match.
The number of denoising iterations a diffusion or flow model runs to produce one sample.
Called num_inference_steps in diffusers. Each step is one (or two, with CFG) network evaluation, so generation time scales linearly with steps. Better solvers and distillation have reduced typical counts from 1000 (DDPM) to 20–30, and to 1–4 for distilled models.
Empirical power-law relationships between a model’s loss and its parameter count, training data and compute.
Kaplan et al. (2020) found loss falls smoothly as a power of N, D and C. Hoffmann et al. (2022, Chinchilla) fitted L(N, D) = E + A/N^α + B/D^β and found compute-optimal training scales N and D equally, about 20 tokens per parameter, with compute C ≈ 6·N·D. Scaling laws let labs predict large-run results from small experiments.
The numerical algorithm (DDIM, Euler, DPM++, UniPC…) that turns a diffusion model's predictions into the next, less noisy sample.
Diffusion sampling is solving a stochastic or ordinary differential equation; samplers are its solvers. They have no learned weights and can be swapped at inference time (in diffusers: pipe.scheduler = X.from_config(pipe.scheduler.config)). 'Ancestral' samplers inject noise each step; 'Karras' refers to a noise-level spacing that spends more steps at low noise.
The integer that initializes a random number generator, fixing the starting noise of a generation so it can be reproduced.
In diffusion, the seed determines the initial noise latent (and any noise injected during sampling). Same seed + same model, settings, scheduler, precision and software → the same image, up to small GPU nondeterminism. In diffusers: generator=torch.Generator("cuda").manual_seed(42); CPU and CUDA generators give different noise for the same seed.
Attention in which queries, keys and values all come from the same sequence, so each token gathers information from the others.
Each token is projected into a query, key and value; every token then attends to every other token in one step, so distant words are directly connected. Encoders use bidirectional self-attention; decoders use a causal mask so each token sees only earlier positions. Self-attention is permutation-equivariant, so positional encodings are needed to represent order.
Training on labels generated automatically from the data itself, e.g. predicting a hidden word or the next token.
Pretext tasks include next-token prediction (GPT), masked language modelling (BERT), and contrastive learning between augmented views of the same image (SimCLR). Because no human labelling is needed it scales to internet-sized data, and it is how foundation models and LLMs are pretrained before being fine-tuned on small labelled datasets.
Learning from a small labelled set together with a large unlabelled set.
Techniques include self-training / pseudo-labelling (label the unlabelled examples the model is most confident about and retrain) and label propagation over a similarity graph. It pays off when labels are expensive but raw data is plentiful, e.g. medical images. scikit-learn provides SelfTrainingClassifier, LabelPropagation and LabelSpreading.
An encoder–decoder model that maps an input sequence to an output sequence of possibly different length, e.g. for translation.
The encoder reads the input into a representation; the decoder generates the output token by token, conditioned on it. Early seq2seq models (Sutskever et al., 2014) used LSTMs and a single fixed-size vector between encoder and decoder, which became a bottleneck for long inputs — the motivation for attention. Transformers (e.g. T5, Whisper) are modern seq2seq models.
Gradient descent that estimates the gradient from a random mini-batch instead of the whole dataset at every step.
Strictly, SGD uses one example per step; in practice “SGD” means mini-batch SGD. The gradient noise makes each step cheap and can help escape poor regions and generalize, but it zig-zags in ravines and stalls on plateaus. SGD with momentum and a learning-rate schedule remains a top choice for training CNNs.
An explanation method that assigns each feature its Shapley value — its fair share of a specific prediction.
Based on cooperative game theory, SHAP values are additive: the base value plus all feature contributions equals the model output. TreeSHAP computes them exactly and quickly for tree ensembles; KernelSHAP and permutation methods approximate them for any model. Waterfall plots explain single predictions; beeswarm plots summarise global behaviour. They describe the model, not causal effects in the world.
The S-shaped function σ(z) = 1/(1 + e^(−z)) that squashes any number into (0, 1).
Sigmoid turns a score into a probability, so it is used on outputs for binary and multi-label classification and inside LSTM/GRU gates. Its derivative σ(1 − σ) is at most 0.25 and nearly zero for |z| > 5, so stacking sigmoid hidden layers causes vanishing gradients; ReLU-like functions are preferred there.
An exponential moving average applied to a noisy metric curve so the trend becomes visible.
sₜ = α · sₜ₋₁ + (1 − α) · xₜ, where α is the smoothing weight (TensorBoard's slider, 0–0.99). Smoothing only changes the display, not the run. It lags behind the raw curve, so a sudden spike or divergence appears late and dampened — always keep the raw curve visible faintly behind.
Turns a vector of scores (logits) into probabilities that are positive and sum to 1: softmax(z)ᵢ = e^(zᵢ) / Σⱼ e^(zⱼ).
Softmax is the standard output layer for multi-class classification and for next-token prediction in language models, paired with cross-entropy loss. Because of the exponential, larger logits get disproportionately more probability. It is also used inside attention to turn query–key scores into weights. In PyTorch, CrossEntropyLoss applies log-softmax internally, so models should output raw logits.
A time–frequency picture of sound: FFT magnitudes of successive short windows stacked over time.
Computed with the Short-Time Fourier Transform: slide a window along the waveform by a hop length, apply a window function and an FFT to each frame, and keep the magnitudes (usually in decibels). Time runs along the x-axis, frequency along the y-axis, loudness as colour. It discards phase, so turning a spectrogram back into audio needs phase reconstruction or a neural vocoder.
Speeding up LLM generation by letting a small draft model propose several tokens that the large model verifies in one pass.
Because decoding is memory-bound, scoring several tokens costs about as much as generating one. Draft tokens are accepted with probability min(1, p_target/p_draft); on the first rejection a corrected token is sampled from the residual distribution, which makes the output distribution identical to the target model's. Typical speedups are 2–3× when draft and target agree often.
How many pixels a convolution or pooling window moves between consecutive positions.
Stride 1 visits every position; stride 2 visits every other position and roughly halves the output height and width. Strided convolutions are a learnable alternative to pooling for downsampling. Output size = ⌊(n + 2p − k)/s⌋ + 1.
Learning a mapping from inputs x to outputs y using examples where the correct output (label) is known.
The two main tasks are regression (numeric y) and classification (categorical y). Performance is measured directly against labels on held-out data. Most deployed ML — fraud scores, demand forecasts, medical image classifiers — is supervised; its main cost is collecting good labels.
A classifier that finds the boundary with the widest margin between classes; with kernels it can draw non-linear boundaries.
Only the training points on or inside the margin — the support vectors — determine the solution. The soft-margin formulation (Cortes & Vapnik, 1995) tolerates some violations at a cost C. The kernel trick (e.g. RBF: K(x, x′) = exp(−γ‖x − x′‖²)) lets the SVM work in an implicit high-dimensional space. SVMs excel on small-to-medium datasets with clear margins but scale poorly beyond ~100k examples.
Developer-provided instructions in the system role that set a chat model’s persona, rules and output conventions for the whole conversation.
Models are trained to give system instructions priority over user messages, which makes the system prompt the right place for tone, scope, safety rules and formatting. It is not a security boundary: prompt injection can try to override it and its contents may be extracted, so never put secrets in it.
A decoding setting that divides the logits before softmax, controlling how random or deterministic generated text is.
p_i = exp(z_i/T) / Σ exp(z_j/T). T = 1 leaves the model’s distribution unchanged, T < 1 sharpens it toward the top token, T > 1 flattens it, and T → 0 is greedy decoding. The ranking of tokens never changes, only how much probability the less likely ones receive.
A multi-dimensional array of numbers generalising scalars (0-D), vectors (1-D) and matrices (2-D) to any number of axes.
Deep learning frameworks (PyTorch, TensorFlow, JAX) store data, weights and gradients as tensors. A batch of 32 RGB images of 224×224 pixels is a tensor of shape (32, 3, 224, 224); a batch of token embeddings is (batch, sequence length, embedding dim). Reading and checking shapes is a core debugging skill.
A visualization dashboard for training runs: scalar curves, histograms, images, graphs and embeddings.
Your code writes event files to a log directory and you launch tensorboard --logdir runs to view them in the browser. It works with TensorFlow/Keras (callback) and PyTorch (torch.utils.tensorboard.SummaryWriter, e.g. writer.add_scalar("loss/train", loss, step)). One sub-folder per run lets you overlay and compare runs.
Data locked away until the very end and used once to estimate how the final model performs on unseen data.
The test set must play no role in training, feature design or model selection. If you tune anything on it, the reported score becomes optimistically biased. It should resemble the data the model will face in production (same distribution, and for time series, a later time period).
Generating an image from a natural-language description (prompt).
Modern systems encode the prompt with a text encoder (CLIP, T5 or an LLM) and condition a diffusion or flow-matching model on it via cross-attention or joint attention, usually with classifier-free guidance. Examples: Stable Diffusion, SDXL, SD3, FLUX, DALL·E 3, Imagen, Midjourney.
Generating natural-sounding speech audio from text.
A classic neural TTS pipeline normalises text, converts it to phonemes, predicts a mel spectrogram with an acoustic model (Tacotron 2, FastSpeech), and turns it into audio with a vocoder (WaveNet, HiFi-GAN). End-to-end models like VITS do it in one network; codec language models like VALL-E enable zero-shot voice cloning, which raises consent and misuse concerns.
How much work a system completes per unit time — requests/s, samples/s or tokens/s.
Throughput and latency trade off: batching many inputs together uses the GPU efficiently (high throughput) but makes each request wait. Batch jobs optimize throughput; interactive apps optimize latency under a throughput target. LLM servers like vLLM raise throughput with continuous batching and PagedAttention memory management.
The basic unit of text an LLM reads and writes — a word, part of a word, a character or a byte, mapped to an integer id.
Models never see raw characters; a tokenizer converts text into a sequence of token ids, and each id is looked up in an embedding table. Common words are often a single token while rare words split into several. Prices, rate limits and context windows are all measured in tokens; in English one token is roughly 4 characters or ¾ of a word, and many other languages need more tokens for the same text.
The process of splitting text into tokens and converting them to ids (and back).
Modern LLMs use subword tokenizers — BPE, WordPiece or Unigram/SentencePiece — learned from a corpus before the model is trained. A tokenizer must always match its model: the same id means a different thing in a different vocabulary. Tokenization explains several quirks of LLMs, such as difficulty counting letters, uneven handling of numbers, and higher token costs for under-represented languages.
Letting an LLM call external functions or APIs by emitting structured calls (name + JSON arguments) that application code executes.
Developers describe tools with names, descriptions and JSON Schemas; the model decides when to call them; the application validates and executes the call and returns the result. Tools give models fresh data, exact computation and the ability to act. The Model Context Protocol (MCP) standardizes how tools, resources and prompts are exposed to AI applications.
A decoding method that samples only from the k most probable next tokens, after renormalizing their probabilities.
Top-k cuts off the unreliable tail of the distribution. Its weakness is that k is fixed: when the model is confident, k = 50 still keeps junk tokens; when many continuations are plausible, a small k is too restrictive. That motivated top-p (nucleus) sampling.
A decoding method that samples from the smallest set of top tokens whose cumulative probability reaches p.
Introduced by Holtzman et al. (2020), nucleus sampling adapts the number of candidates to the model’s confidence: a peaked distribution may keep just one or two tokens, a flat one many. It avoids both the blandness of beam search and the incoherence of sampling from the full tail.
The loss computed on the data the model is learning from, typically averaged over recent mini-batches.
Training loss tells you whether optimization works at all: if it does not go down, check the learning rate, the data pipeline and the labels before anything else. Logged per batch it is noisy (smaller batches → noisier). Because dropout and augmentation are active during training, it can legitimately sit above the validation loss.
The portion of the data used to fit the model's parameters.
The model sees these examples during training, so its performance on them is optimistic and says little about generalisation. All data-dependent preprocessing (scaling statistics, imputation values, vocabularies) must also be fitted on the training set only.
Reusing a model trained on one task (e.g. ImageNet classification or language modelling) as the starting point for a different task.
Early layers of a pretrained network learn general features that transfer well; later layers are more task-specific. Common strategies: feature extraction (freeze the backbone, train a new head) for small datasets, and fine-tuning some or all layers with a small learning rate when more data is available. Fine-tuning pretrained LLMs is the same idea at a larger scale.
A neural architecture built from stacked self-attention and feed-forward blocks with residual connections and layer normalization; the basis of modern LLMs.
Introduced by Vaswani et al. (2017), the Transformer drops recurrence and processes all positions in parallel, which makes it fast to train and highly scalable. Variants: encoder-only (BERT), decoder-only (GPT-style LLMs) and encoder–decoder (original, T5, Whisper). It now also dominates vision (ViT), speech and diffusion backbones (DiT).
An encoder-decoder convolutional network with skip connections that outputs an image-sized tensor; the classic diffusion denoiser.
Introduced for biomedical segmentation (Ronneberger et al., 2015). The encoder downsamples to capture context, the decoder upsamples back, and skip connections carry fine detail across. Diffusion U-Nets add residual blocks, self- and cross-attention, and timestep embeddings. Increasingly replaced by diffusion transformers (DiT).
When a model is too simple or too constrained to capture the real pattern, so it performs poorly even on the training data.
Training and validation errors are both high and close together — a high-bias situation. Typical causes are a model family that is too rigid (a line for a curve), too much regularisation, uninformative features, or stopping training too early. More data does not help; more capacity, better features or less regularisation do.
Finding structure in data that has no labels — groups, directions of variation, density or anomalies.
Typical tasks are clustering (k-means, DBSCAN), dimensionality reduction (PCA, t-SNE, autoencoders), density estimation and anomaly detection. Because there is no answer key, results are harder to evaluate and need domain judgement; algorithms will always return some structure, even in pure noise.
The loss on held-out data the model never trains on — the estimate of how well it generalizes.
Validation loss is what you use for decisions: early stopping, choosing checkpoints and tuning hyperparameters. The gap between validation and training loss is the generalization gap; when it grows while training loss keeps falling, the model is overfitting. Because you make choices with it, the final unbiased number must still come from a separate test set.
Held-out data used during development to compare models, tune hyperparameters and decide when to stop training.
Because you make decisions based on it, the validation set slowly becomes ‘seen’ data, which is why a separate test set is still needed for the final estimate. With small datasets, k-fold cross-validation replaces a single validation split and gives a less noisy estimate.
The expected future return from a state (V(s)) or from taking an action in a state (Q(s, a)) under a policy.
Value functions satisfy the Bellman equations: a state's value equals the expected immediate reward plus the discounted value of the next state. Knowing the optimal Q* gives the optimal policy (pick the highest-valued action). In actor-critic methods a learned value function, the critic, reduces the variance of policy updates.
When gradients shrink (or blow up) exponentially as they are propagated back through many layers or time steps, so early layers learn very slowly (or training diverges).
Backpropagation multiplies many local derivatives together; factors below 1 (e.g. sigmoid's ≤ 0.25) make the product vanish, factors above 1 make it explode. It plagued deep sigmoid networks and plain RNNs. Remedies: ReLU-family activations, careful initialization, normalization layers, residual connections, gated RNNs (LSTM/GRU) and gradient clipping for explosions.
An autoencoder whose encoder outputs a probability distribution and whose latent space is regularized towards N(0, I), so you can sample new data.
Trained by maximizing the ELBO: a reconstruction term minus β times the KL divergence between the encoder's distribution and the prior. The reparameterization trick (z = μ + σ·ε) makes sampling differentiable. VAEs produce smooth latent spaces but somewhat blurry samples; the VAE in Stable Diffusion compresses images 8× per side for latent diffusion.
An ordered list of numbers, e.g. [2, 1, 5]; geometrically an arrow or a point in n-dimensional space.
In ML, each example is a feature vector, each word or image can be represented as an embedding vector, and each neuron has a weight vector. Key operations are addition, scaling, the dot product and the norm (length) |a| = √Σaᵢ². Similar items correspond to vectors that are close or point in similar directions.
A database that stores embedding vectors and finds the most similar ones to a query vector quickly, usually with approximate nearest-neighbour indexes.
Indexes such as HNSW graphs, IVF and product quantization trade a little recall for large speed-ups on millions of vectors. Options include libraries (FAISS), database extensions (pgvector) and dedicated engines (Qdrant, Weaviate, Milvus, Chroma). Metadata filtering — by permissions, language or date — is essential for real applications.
Diffusion models that generate a sequence of frames jointly, using temporal layers or spacetime tokens to keep motion consistent.
Approaches include 3D U-Nets with factorized spatial and temporal attention (Video Diffusion Models), image models inflated with temporal layers (Video LDM, AnimateDiff), latent video diffusion with curated data (Stable Video Diffusion), and diffusion transformers over spacetime patches (Sora-style). Long videos are built with cascades or by extending clips autoregressively.
A transformer that processes an image as a sequence of fixed-size patches, each embedded like a word token.
Dosovitskiy et al. (2020) split a 224×224 image into 16×16 patches (196 tokens), linearly project them, add a [CLS] token and position embeddings, and run a standard transformer encoder. With enough pre-training data ViTs beat CNNs; they are now the default vision backbone for CLIP, VLMs and DiT-style generators.
A model that takes images (and text) as input and produces text, typically a vision encoder connected to an LLM.
The vision encoder (often a CLIP/SigLIP ViT) produces patch features; a connector (linear/MLP projection, Q-Former or Perceiver Resampler) maps them into the LLM's embedding space as visual tokens. Training is usually staged: align the connector on captions, then instruction-tune. Examples: Flamingo, BLIP-2, LLaVA, and GPT-4V-style assistants.
The fixed set of all tokens a tokenizer can produce; its size V sets the width of the embedding and output layers.
Each vocabulary entry has a row in the input embedding matrix and a column in the output projection, so both contain V × d parameters. Typical sizes range from ~30k (BERT) and 50k (GPT-2) to 100k–200k+ in recent multilingual-friendly LLMs.
A model that converts an acoustic representation, usually a mel spectrogram, into an audio waveform.
Because spectrograms drop phase, a vocoder must generate a plausible waveform consistent with them. Neural vocoders evolved from slow autoregressive WaveNet to parallel GAN-based models such as HiFi-GAN that run faster than real time. A vocoder only works well on mel spectrograms computed with the same settings it was trained on.
The raw audio signal: amplitude (air-pressure deviation) plotted against time.
Digitally, a waveform is a 1-D array of samples at a given sample rate. It shows loudness and timing clearly but hides which frequencies are present, so many models first convert it to a spectrogram. Others (WaveNet, wav2vec 2.0, EnCodec) work on raw waveforms directly with convolutional layers.
A 2016 autoregressive model that generates raw audio one sample at a time using dilated causal convolutions.
WaveNet stacks causal convolutions with exponentially growing dilations (1, 2, 4, …, 512) to cover long contexts and predicts each μ-law-quantized sample with a softmax over 256 values. It produced far more natural speech than earlier systems and became the vocoder in Tacotron 2, but sample-by-sample generation is slow; later parallel vocoders replaced it in production.
A regularizer that shrinks every weight slightly toward zero at each step, discouraging large weights (equivalent to L2 regularization for plain SGD).
With SGD, adding (λ/2)‖w‖² to the loss gives w ← (1 − ηλ)w − η∇L. With adaptive optimizers the two are not equivalent: L2 added to the gradient gets rescaled by Adam, so AdamW applies the decay directly to the weights (decoupled). Biases and normalization parameters are usually excluded.
How a network's weights are set before training — randomly, with a carefully chosen scale (e.g. Xavier/Glorot or He/Kaiming).
Weights must be random to break symmetry (identical weights would receive identical gradients forever) and scaled so that activations and gradients keep a stable variance through many layers. Xavier/Glorot uses Var(w) = 2/(n_in + n_out) for tanh/sigmoid; He/Kaiming uses Var(w) = 2/n_in for ReLU. Biases usually start at zero.
OpenAI's multilingual speech recognition and translation model, trained on 680,000 hours of weakly supervised web audio.
Whisper is a Transformer encoder–decoder that reads 30-second log-mel spectrograms and generates text tokens, controlled by special tokens for language, task (transcribe or translate to English) and timestamps. Its diverse training data makes it robust zero-shot across accents and noise. Like other autoregressive decoders, it can hallucinate text on silence or music, so voice activity detection is recommended.
The standard ASR metric: (substitutions + deletions + insertions) divided by the number of reference words.
WER is the word-level edit (Levenshtein) distance between hypothesis and reference, normalised by reference length; lower is better and it can exceed 100%. Results are only comparable if text is normalised the same way (case, punctuation, numbers). Character error rate (CER) is used for languages without spaces or for very short utterances.
A 2013 family of shallow models (skip-gram, CBOW) that learn word embeddings by predicting words from their context.
Skip-gram predicts surrounding words from a centre word; CBOW predicts a word from its neighbours. Negative sampling turns training into cheap binary classification of real vs random word–context pairs, allowing training on billions of words. The resulting vectors place similar words nearby and encode some relations as directions (king − man + woman ≈ queen).
Asking a model to perform a task from instructions alone, without any worked examples.
Instruction-tuned LLMs handle many tasks zero-shot (“Translate to English: …”). It gives the shortest prompts, but the model must infer the exact format and label set from the wording; when results are inconsistent, adding a few examples (few-shot) usually helps.
An exploration strategy: with probability ε pick a random action, otherwise the action with the highest estimated value.
ε-greedy is the simplest answer to the exploration–exploitation trade-off. ε usually starts high (1.0) and decays to a small floor as estimates improve, so the agent explores early and exploits later. Alternatives include softmax/Boltzmann exploration, optimistic initial values, UCB bonuses and, in deep RL, entropy bonuses.