AILearn AI
LearnGlossarySources
ID/EN
Learn AI — open material for learning AIEvery lesson cites its original sources.

Glossary

Every AI term used on this site, with what it means and — for knobs you can turn — what happens when you change it.

3D Gaussian Splatting (3DGS)

· Multimodal

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.

Effect of changing it: Densification threshold: lower → more Gaussians, finer detail, bigger files and more floaters; higher → compact but blurry fine structures. Spherical-harmonics degree: higher → better view-dependent shine but larger files; 0 → flat, small.
Related: NeRF (Neural Radiance Field), MultimodalLearn: 3D: NeRF, Gaussian Splatting and Text-to-3DSource: 3D Gaussian Splatting for Real-Time Radiance Field Rendering (2023)

A/B testing

· MLOps

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.

Effect of changing it: Larger share of traffic to B or longer duration → more statistical power, smaller effects detectable, but more users exposed to a possibly worse model. Smaller split or shorter test → safer but may miss real differences or be fooled by novelty and weekday effects.
Related: Model serving, Model monitoring, Evals, BaselineLearn: The ML lifecycle & MLOps maturity

Accuracy

· Evaluation

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.

Effect of changing it: Accuracy changes when you move the decision threshold; on imbalanced data the threshold that maximizes accuracy usually predicts almost everything as the majority class.
Related: Precision, Recall, Confusion matrix, F1 score, BaselineLearn: Classification MetricsSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Activation function

· Neural networks

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.

Effect of changing it: Switching sigmoid → ReLU/GELU in hidden layers usually speeds up training of deep nets; the output activation must match the task (linear for regression, sigmoid for binary, softmax for multi-class).
Related: ReLU (Rectified Linear Unit), Sigmoid (logistic function), Softmax, Vanishing (and exploding) gradient, Neuron (artificial)Learn: Neurons and Activation Functions, Multilayer Perceptrons and Backpropagation

Adam / AdamW

· Neural networks

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.

Effect of changing it: η: as for any optimizer. β₁ higher → more momentum. β₂ lower (e.g. 0.95) → adapts faster, often more stable for large models; higher → smoother but slow to react. ε larger → less adaptive, more SGD-like. Weight decay higher → stronger regularization.
Related: Optimizer, Momentum, Weight decay, Learning rate, Learning rate warmupLearn: Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR Schedules, Distributed Training: Many GPUs, One ModelSource: Adam: A Method for Stochastic Optimization (2014)

Agent (LLM agent)

· LLM

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.

Effect of changing it: Higher max steps → can finish longer tasks but costs more and errors compound; lower → cheaper and predictable but complex tasks get cut off. More tools → more capability but more wrong-tool choices.
Related: Tool use / function calling, Large language model (LLM), System prompt, Reinforcement learning (RL)Learn: Agents & tool use: ReAct, function calling, MCPSource: ReAct: Synergizing Reasoning and Acting in Language Models (2023)

AI safety

· Advanced

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.

Related: Alignment, Red-teaming, Bias & fairness, Interpretability, HallucinationLearn: AI Safety & Ethics: Bias, Hallucination, Alignment and RegulationSource: Concrete Problems in AI Safety (2016)

Alignment

· Advanced

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.

Related: AI safety, RLHF (Reinforcement Learning from Human Feedback), DPO (Direct Preference Optimization), Reward model, Red-teamingLearn: AI Safety & Ethics: Bias, Hallucination, Alignment and RegulationSource: Constitutional AI: Harmlessness from AI Feedback (2022)

Artifact

· MLOps

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.

Related: Run, MLflow, Checkpoint, Model registryLearn: Experiment Logging & Reproducibility, Experiment tracking with MLflow, Model Registry, data versioning & lineageSource: MLflow Documentation

Artificial intelligence (AI)

· Fundamentals

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.

Related: Machine learning (ML), Deep learning, Agent (LLM agent)Learn: What is AI?Source: Artificial Intelligence: A Modern Approach (4th ed.) (2020)

Attention

· Deep learning

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.

Effect of changing it: Removing the √d_k scaling (or lowering softmax temperature) → sharper, near one-hot weights and weaker gradients; higher temperature → flatter, more uniform attention.
Related: Self-attention, Multi-head attention, Transformer, Softmax, Seq2seq (sequence-to-sequence)Learn: Recurrent Networks: RNN, LSTM and GRU, Attention and Transformers, Video GenerationSource: Neural Machine Translation by Jointly Learning to Align and Translate (2014)

Autoencoder

· Generative

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.

Effect of changing it: Bottleneck size: larger → sharper reconstructions but less compression and a less meaningful code; smaller → stronger compression, blurrier reconstructions.
Related: Variational autoencoder (VAE), Latent space, Encoder, Decoder, Latent diffusionLearn: Generative Models: The Big Picture

Automatic speech recognition (ASR)

· Audio

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.

Related: Connectionist Temporal Classification (CTC), Whisper, Word error rate (WER), Mel spectrogramLearn: Speech Recognition: CTC, wav2vec 2.0 and Whisper

Backpropagation

· Neural networks

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.

Related: Gradient, Gradient descent, Derivative, MLP (Multilayer Perceptron), Vanishing (and exploding) gradientLearn: Multilayer Perceptrons and BackpropagationSource: Learning representations by back-propagating errors (1986)

Baseline

· Evaluation

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.

Related: Accuracy, Benchmark, Evals, Logistic regressionLearn: Classification Metrics, Regression Metrics & Validation, The ML lifecycle & MLOps maturity, CI/CD, continuous training & feature storesSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Batch inference

· MLOps

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.

Effect of changing it: Running more often → fresher predictions but more compute cost; less often → cheaper but staler. Larger batch sizes per worker → better hardware utilization until memory runs out.
Related: Model serving, Throughput, Inference, LatencyLearn: Deployment & model serving

Batch normalization

· Neural networks

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).

Effect of changing it: Smaller batch size → noisier batch statistics, worse BN performance (switch to GroupNorm/LayerNorm). Its momentum parameter controls how fast running statistics track recent batches (higher = faster).
Related: Layer normalization, Batch size, ResNet (Residual Network), Feature scaling (normalisation / standardisation)Learn: Regularization, Normalization and Initialization, CNN Architectures and Transfer Learning, Generative Adversarial Networks (GANs)Source: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift (2015)

Batch size

· Neural networks

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.

Effect of changing it: Larger → smoother gradients, faster per-sample throughput, fewer updates per epoch (raise LR or epochs to compensate), more memory, possible generalization gap. Smaller → noisier updates that often regularize, more updates per epoch, less efficient hardware use; usually needs a lower LR.
Related: Iteration (training step), Epoch, Learning rate, SGD (Stochastic Gradient Descent), Gradient accumulation, Batch normalizationLearn: Gradient descent, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More, Distributed Training: Many GPUs, One ModelSource: On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima (2016)

Bayesian optimization

· Evaluation

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.

Effect of changing it: More trials → the surrogate becomes more accurate and converges on good regions; the first ~10–20 trials are typically random warm-up. Running many trials in parallel reduces its advantage because each new suggestion cannot learn from the still-running ones.
Related: Random search, Hyperparameter tuning, Grid searchLearn: Hyperparameter TuningSource: Practical Bayesian Optimization of Machine Learning Algorithms (2012)

Benchmark

· Evaluation

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.

Related: Evals, Baseline, Test set, Data leakageSource: Holistic Evaluation of Language Models (2022)

BERT

· LLM

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.

Related: Encoder, Transformer, GPT (Generative Pre-trained Transformer), Embedding, Fine-tuningLearn: How LLMs work: next-token prediction at scaleSource: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (2019)

Bias & fairness

· Advanced

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.

Effect of changing it: Group-specific thresholds or fairness constraints narrow gaps on the chosen metric, usually at some cost in overall accuracy and possibly widening gaps on other metrics — the trade-off is a value choice.
Related: AI safety, Dataset, Decision threshold, Accuracy, RecallLearn: AI Safety & Ethics: Bias, Hallucination, Alignment and RegulationSource: A Survey on Bias and Fairness in Machine Learning (2019)

Bias-variance trade-off

· Fundamentals

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.

Effect of changing it: Knobs that add capacity (depth, degree, features, smaller k in kNN, larger C/γ in SVM) move toward low bias / high variance; knobs that constrain (regularisation, min_samples_leaf, larger k) move toward high bias / low variance. More data reduces variance only.
Related: Overfitting, Underfitting, Regularisation, Random forest, Learning curveLearn: Decision trees and ensembles, Overfitting and the bias-variance trade-offSource: Neural Networks and the Bias/Variance Dilemma (1992)

Bit depth

· Audio

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].

Effect of changing it: Higher: lower noise floor and more headroom, larger files. Lower: smaller files but audible hiss and graininess, especially in quiet passages (8-bit is clearly noisy).
Related: Sample rate, Waveform, QuantizationLearn: Audio Basics: From Sound Waves to Spectrograms

Byte-Pair Encoding (BPE)

· LLM

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.

Effect of changing it: More merges → longer, more word-like tokens and shorter sequences, but a larger vocabulary. Fewer merges → tokens approach single characters/bytes and sequences grow longer.
Related: Tokenization, Vocabulary, TokenLearn: Tokenization: how text becomes numbersSource: Neural Machine Translation of Rare Words with Subword Units (2016)

Chain-of-thought (CoT)

· LLM

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.

Effect of changing it: Longer reasoning or more sampled chains (self-consistency) → higher accuracy on multi-step problems, at higher token cost and latency. No CoT → faster and cheaper, fine for simple lookups but weaker on math and logic.
Related: Prompt engineering, Few-shot prompting, Zero-shotLearn: Prompting: zero-shot, few-shot, chain-of-thought, structured outputSource: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (2022)

Checkpoint

· MLOps

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.

Effect of changing it: Saving more often → less work lost after a crash, but more disk and I/O time (large models can take minutes per save). Saving less often → cheaper but riskier. Keeping only the last N plus the best one bounds disk usage.
Related: Early stopping, Reproducibility, Artifact, Validation lossLearn: Experiment Logging & ReproducibilitySource: PyTorch Tutorials — Saving and Loading Models

Chunking

· LLM

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.

Effect of changing it: Larger chunk size → more context per hit but blurrier embeddings and fewer chunks per prompt; smaller → sharper matches but lost context. More overlap → fewer facts split at boundaries but a bigger, more redundant index. Typical: 200–800 tokens, 10–20% overlap.
Related: RAG (Retrieval-Augmented Generation), Vector database, EmbeddingLearn: Retrieval-Augmented Generation (RAG)

CI/CD

· MLOps

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.

Related: MLOps, Docker, Model registry, Model monitoring, Data driftLearn: The ML lifecycle & MLOps maturity, CI/CD, continuous training & feature storesSource: MLOps: Continuous delivery and automation pipelines in machine learning

Classification

· Classical ML

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.

Related: Logistic regression, k-nearest neighbours (kNN), Support vector machine (SVM), Decision tree, Decision threshold, Accuracy, Cross-entropy (log loss)Learn: Types of learning, Classification: logistic regression, kNN, SVM, Classification Metrics

Classifier-free guidance (CFG)

· Generative

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 ∅.

Effect of changing it: Higher scale s → stronger prompt adherence and contrast, less diversity, eventually oversaturated artifacts; lower → more natural and varied but looser prompt following; s ≤ 1 disables guidance.
Related: Guidance scale (CFG scale), Negative prompt, Text-to-image, Diffusion modelLearn: Stable Diffusion in Practice, Music & Audio Generation: Codecs, Tokens and Diffusion, 3D: NeRF, Gaussian Splatting and Text-to-3DSource: Classifier-Free Diffusion Guidance (2022)

CLIP

· Multimodal

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.

Effect of changing it: Temperature τ (learned): lower → sharper softmax focused on hard negatives, unstable if too low; higher → softer, less discriminative. Contrastive batch size: larger → more negatives, better embeddings, more compute.
Related: Vision Transformer (ViT), Multimodal, Embedding, Cosine similarity, Zero-shot, Text-to-image, Vision-language model (VLM)Learn: Stable Diffusion in Practice, Vision Transformers and CLIP, Multimodal LLMs (Vision-Language Models)Source: Learning Transferable Visual Models From Natural Language Supervision (2021)

Clustering

· Classical ML

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.

Related: k-means, Unsupervised learning, Principal component analysis (PCA)Learn: Types of learning, Clustering and PCASource: scikit-learn User Guide — Clustering

CNN (Convolutional Neural Network)

· Deep learning

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.

Effect of changing it: More layers/filters → more capacity and larger receptive field, more compute; more downsampling (stride/pooling) → cheaper but loses spatial detail.
Related: Convolution, Kernel (filter), Pooling, Feature map, ResNet (Residual Network), Receptive fieldLearn: Convolutional Neural Networks (CNNs), CNN Architectures and Transfer Learning, Generative Adversarial Networks (GANs)Source: CS231n: Convolutional Neural Networks for Visual Recognition

Concept drift

· MLOps

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.

Related: Data drift, Model monitoring, CI/CDLearn: Monitoring, data drift & concept driftSource: A survey on concept drift adaptation (2014)

Confusion matrix

· Evaluation

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.

Effect of changing it: Moving the threshold shifts counts between cells: a higher threshold moves cases from TP→FN and FP→TN.
Related: Accuracy, Precision, Recall, Decision threshold, ClassificationLearn: Classification MetricsSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Connectionist Temporal Classification (CTC)

· Audio

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.

Related: Automatic speech recognition (ASR), Whisper, Loss functionLearn: Speech Recognition: CTC, wav2vec 2.0 and WhisperSource: Connectionist Temporal Classification: Labelling Unsegmented Sequence Data with Recurrent Neural Networks (2006)

Context window

· LLM

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.

Effect of changing it: Using more of the window → more documents/history fit, but higher cost and latency and possible “lost in the middle” effects. Using less → cheaper and faster, but older turns or document parts must be dropped or summarized.
Related: Token, KV cache, RAG (Retrieval-Augmented Generation), AttentionLearn: Tokenization: how text becomes numbers, How LLMs work: next-token prediction at scale, Agents & tool use: ReAct, function calling, MCP

ControlNet

· Generative

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.

Effect of changing it: controlnet_conditioning_scale: higher → stricter adherence to the control image, possibly stiff or artifacty above ~1.2; lower → looser, more natural results. control_guidance_start/end limit control to part of the denoising (e.g. end at 0.8 to let the model finish details freely).
Related: Latent diffusion, Text-to-image, Inpainting, LoRA (Low-Rank Adaptation)Learn: Stable Diffusion in PracticeSource: Adding Conditional Control to Text-to-Image Diffusion Models (2023)

Convolution

· Deep learning

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.

Related: CNN (Convolutional Neural Network), Kernel (filter), Stride, Padding, Feature mapLearn: Convolutional Neural Networks (CNNs)Source: A guide to convolution arithmetic for deep learning (2016)

Cosine similarity

· Fundamentals

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.

Effect of changing it: When used as a retrieval threshold: higher threshold → fewer, more relevant results and more “no answer” cases; lower → always returns something, including irrelevant text.
Related: Dot product, Vector, Embedding, Vector databaseLearn: Math essentials for ML, Embeddings: Meaning as Vectors, Retrieval-Augmented Generation (RAG), Vision Transformers and CLIP

Cross-entropy (log loss)

· Fundamentals

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.

Related: Loss function, Logistic regression, Softmax, Logits, Perplexity, Probability distributionLearn: Classification: logistic regression, kNN, SVM

Cross-validation

· Evaluation

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).

Effect of changing it: More folds (k ↑, e.g. 10 or leave-one-out) → each model sees more training data, less pessimistic estimate, but k× the compute and higher variance between folds. Fewer folds (k = 3) → cheaper but each model trains on less data. k = 5 or 10 is the usual choice.
Related: Validation set, Test set, Data leakage, Hyperparameter tuning, OverfittingLearn: Overfitting and the bias-variance trade-off, Regression Metrics & Validation, Hyperparameter TuningSource: scikit-learn User Guide — Cross-validation: evaluating estimator performance

Data augmentation

· Neural networks

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.

Effect of changing it: Stronger augmentation → less overfitting and more robustness, but too strong changes the meaning (a rotated 6 becomes a 9) and causes underfitting. Weaker → faster fitting, more overfitting on small datasets.
Related: Regularisation, Overfitting, CNN (Convolutional Neural Network), Training setLearn: Regularization, Normalization and Initialization, CNN Architectures and Transfer Learning

Data drift

· MLOps

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.

Effect of changing it: Lower alert threshold (e.g. PSI 0.1) or smaller comparison window → earlier detection but more false alarms. Note that KS p-values become extremely sensitive on very large samples, so tiny harmless shifts look "significant". Higher threshold or longer window → stable but slower to react.
Related: Concept drift, Model monitoring, CI/CD, Probability distributionLearn: The ML lifecycle & MLOps maturity, Monitoring, data drift & concept driftSource: Evidently AI Documentation

Data leakage

· Evaluation

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.

Related: Training set, Test set, Cross-validation, Feature engineeringLearn: Data and features, Reading Loss & Accuracy Curves, Regression Metrics & ValidationSource: scikit-learn — Common pitfalls and recommended practices

Data parallelism

· Advanced

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.

Effect of changing it: More data-parallel GPUs: near-linear throughput gains and a larger global batch. Higher sharding level (ZeRO-1 → 3 / FSDP full shard): far less memory per GPU but more communication.
Related: Distributed training, Model parallelism, Batch size, Gradient accumulationLearn: Distributed Training: Many GPUs, One ModelSource: PyTorch documentation — FullyShardedDataParallel

Data versioning

· MLOps

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.

Related: DVC (Data Version Control), Reproducibility, Model registry, DatasetLearn: Model Registry, data versioning & lineageSource: DVC Documentation

Dataset

· Fundamentals

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.

Effect of changing it: More (and more diverse) data mainly reduces variance — less overfitting for flexible models. It does not fix high bias, and more biased or noisy data does not help.
Related: Feature, Label (target), Training set, Validation set, Test setLearn: Data and features, The ML development stack

DDIM (Denoising Diffusion Implicit Models)

· Generative

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.

Effect of changing it: η: 0 → deterministic (same seed, same image) and good at few steps; 1 → DDPM-like stochastic sampling. Steps: more → closer to the full process; fewer → faster but blurrier.
Related: DDPM (Denoising Diffusion Probabilistic Models), Scheduler / sampler, Sampling steps (inference steps), Seed (random seed)Learn: Diffusion Models: From Noise to ImageSource: Denoising Diffusion Implicit Models (2020)

DDPM (Denoising Diffusion Probabilistic Models)

· Generative

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).

Effect of changing it: Number of training timesteps T: more → finer, more Gaussian-like reverse steps but slower full sampling; fewer → each step must remove more noise and quality drops. T = 1000 is standard.
Related: Diffusion model, DDIM (Denoising Diffusion Implicit Models), Noise schedule, U-NetLearn: Diffusion Models: From Noise to ImageSource: Denoising Diffusion Probabilistic Models (2020)

Decision threshold

· Evaluation

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.

Effect of changing it: Higher threshold → fewer positives: precision ↑, recall ↓, FP ↓, FN ↑. Lower threshold → more positives: recall ↑, precision ↓. The ROC/PR curves show every possible trade-off.
Related: Precision, Recall, ROC curve & AUC, Confusion matrix, F1 scoreLearn: Classification: logistic regression, kNN, SVM, Classification Metrics, Monitoring, data drift & concept driftSource: Machine Learning Crash Course

Decision tree

· Classical ML

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.

Effect of changing it: max_depth: deeper → more complex rules, lower training error, eventually overfitting; shallower → simpler, may underfit. min_samples_leaf: larger → smoother predictions and less overfitting; 1 (default) allows single-example leaves.
Related: Random forest, Gradient boosting, Overfitting, Classification, RegressionLearn: Decision trees and ensemblesSource: scikit-learn User Guide — Decision Trees

Decoder

· Deep learning

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.

Related: Encoder, Seq2seq (sequence-to-sequence), Transformer, GPT (Generative Pre-trained Transformer), Next-token predictionLearn: Recurrent Networks: RNN, LSTM and GRU, Attention and Transformers

Deep learning

· Fundamentals

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.

Related: Machine learning (ML), Neuron (artificial), Backpropagation, CNN (Convolutional Neural Network), TransformerLearn: What is AI?Source: Deep learning (2015)

Denoising strength

· Generative

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.

Effect of changing it: Higher → more creative freedom: composition and colours drift from the input; 1.0 ignores it almost entirely. Lower → faithful to the input, subtle changes; very low values barely change anything. Typical: 0.3–0.5 retouch, 0.6–0.8 sketch-to-image, 0.9–1.0 inpainting with a dedicated model.
Related: Image-to-image (img2img), Inpainting, Sampling steps (inference steps), Noise schedule

Derivative

· Fundamentals

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.

Related: Gradient, Gradient descent, BackpropagationLearn: Math essentials for ML, Gradient descentSource: Deep Learning — Chapter 4: Numerical Computation (2016)

Diffusion model

· Generative

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.

Related: DDPM (Denoising Diffusion Probabilistic Models), DDIM (Denoising Diffusion Implicit Models), Noise schedule, Latent diffusion, U-Net, Diffusion Transformer (DiT), Flow matching (rectified flow)Learn: Generative Models: The Big Picture, Diffusion Models: From Noise to Image, Music & Audio Generation: Codecs, Tokens and Diffusion, Video Generation, 3D: NeRF, Gaussian Splatting and Text-to-3DSource: Denoising Diffusion Probabilistic Models (2020)

Diffusion Transformer (DiT)

· Generative

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.

Effect of changing it: Patch size: smaller (e.g. 2) → more tokens, better FID, much more compute; larger (4, 8) → cheaper but coarser. Model size/depth: larger → better quality with more compute (DiT shows clear scaling).
Related: Transformer, Vision Transformer (ViT), U-Net, Diffusion model, Flow matching (rectified flow), Video diffusionLearn: Stable Diffusion in Practice, Video GenerationSource: Scalable Diffusion Models with Transformers (2022)

Discount factor (γ)

· Reinforcement learning

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.

Effect of changing it: Higher γ: far-sighted, values propagate far from rewards, but learning is slower and noisier. Lower γ: myopic, the agent grabs nearby rewards and ignores distant goals. Typical 0.9–0.99.
Related: Reward, Value function, Q-learning, Markov decision process (MDP)Learn: Reinforcement Learning Basics: Agents, Rewards and Q-learning

Distributed training

· Advanced

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.

Effect of changing it: More GPUs: more throughput and memory, but communication overhead grows and the global batch size changes (retune learning rate). Activation checkpointing on: much less memory, ~20–35% slower steps.
Related: Data parallelism, Model parallelism, Mixed-precision training, Gradient accumulation, GPULearn: Distributed Training: Many GPUs, One ModelSource: ZeRO: Memory Optimizations Toward Training Trillion Parameter Models (2019)

Docker

· MLOps

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.

Related: Model serving, Reproducibility, CI/CD, MLOpsLearn: Deployment & model servingSource: Docker Documentation

Dot product

· Fundamentals

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).

Related: Vector, Cosine similarity, Neuron (artificial), Attention, MatrixLearn: Math essentials for ML

DPO (Direct Preference Optimization)

· LLM

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.

Effect of changing it: Higher β → stays closer to the reference model (conservative). Lower β → moves further toward preferred answers, with more risk of over-optimization and degenerate outputs. Typical β ≈ 0.1.
Related: RLHF (Reinforcement Learning from Human Feedback), Reward model, Fine-tuning, AlignmentLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRASource: Direct Preference Optimization: Your Language Model is Secretly a Reward Model (2023)

Dropout

· Neural networks

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.

Effect of changing it: Higher p → stronger regularization, less overfitting, slower/noisier training; too high (≥ 0.7) → underfitting. Lower p → faster convergence, more overfitting risk. Typical: 0.5 dense layers, 0.1 Transformers.
Related: Regularisation, Overfitting, Weight decay, Early stoppingLearn: Regularization, Normalization and Initialization, CNN Architectures and Transfer LearningSource: Dropout: A Simple Way to Prevent Neural Networks from Overfitting (2014)

DVC (Data Version Control)

· MLOps

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.

Related: Data versioning, Reproducibility, CI/CD, MLOpsLearn: Model Registry, data versioning & lineage, CI/CD, continuous training & feature storesSource: DVC Documentation

Early stopping

· Neural networks

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.

Effect of changing it: Higher patience → robust to noisy validation curves and plateaus but wastes compute after the optimum. Lower patience → stops sooner, may quit before true convergence.
Related: Epoch, Validation loss, Overfitting, Checkpoint, RegularisationLearn: Overfitting and the bias-variance trade-off, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More, Regularization, Normalization and Initialization, Reading Loss & Accuracy Curves

Embedding

· Deep learning

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.

Effect of changing it: Larger dimension d → finer distinctions, more parameters (V × d), more storage and slower vector search; smaller → cheaper, less precise similarity.
Related: word2vec, One-hot encoding, Cosine similarity, Vector, Token, Vector databaseLearn: Embeddings: Meaning as Vectors, Tokenization: how text becomes numbers, Retrieval-Augmented Generation (RAG), Vision Transformers and CLIP, Interpretability: Opening the Black BoxSource: torch.nn.Embedding

Encoder

· Deep learning

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.

Related: Decoder, Seq2seq (sequence-to-sequence), Transformer, BERT, AutoencoderLearn: Recurrent Networks: RNN, LSTM and GRU, Attention and Transformers

Epoch

· Neural networks

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.

Effect of changing it: More epochs → lower training loss; validation loss improves, then plateaus, then often rises (overfitting). Too few → underfitting (both losses still high and falling). Use early stopping to pick the best epoch automatically.
Related: Iteration (training step), Batch size, Early stopping, Overfitting, Underfitting, Learning curveLearn: Gradient descent, Training Hyperparameters: Epochs, Learning Rate, Batch Size and MoreSource: Machine Learning Glossary — epoch

Evals

· Evaluation

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.

Related: Benchmark, CI/CD, Large language model (LLM), A/B testing, BaselineLearn: The ML lifecycle & MLOps maturitySource: Holistic Evaluation of Language Models (2022)

Experiment tracking

· MLOps

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.

Related: MLflow, Run, Artifact, TensorBoard, ReproducibilityLearn: Experiment Logging & Reproducibility, Experiment tracking with MLflowSource: MLflow Documentation

Exploration–exploitation trade-off

· Reinforcement learning

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).

Effect of changing it: More exploration (higher ε, temperature or entropy bonus): better long-term discovery, lower short-term reward. Less exploration: faster convergence, higher risk of a suboptimal policy.
Related: ε-greedy, Reinforcement learning (RL), A/B testingLearn: Reinforcement Learning Basics: Agents, Rewards and Q-learning

F1 score

· Evaluation

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.

Effect of changing it: F1 peaks at an intermediate threshold; moving the threshold far in either direction sacrifices one of precision or recall and drops F1.
Related: Precision, Recall, Decision threshold, AccuracyLearn: Classification MetricsSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Fast Fourier Transform (FFT)

· Audio

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.

Effect of changing it: Larger FFT/window size (N): finer frequency resolution (Δf = f_s / N) but blurrier timing. Smaller N: sharp timing of transients, but nearby frequencies merge. Speech commonly uses 25 ms windows; music often 2048 samples at 44.1 kHz.
Related: Spectrogram, Mel spectrogram, Sample rateLearn: Audio Basics: From Sound Waves to Spectrograms

Feature

· Fundamentals

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.

Related: Feature engineering, Label (target), Vector, Feature scaling (normalisation / standardisation), One-hot encodingLearn: Data and features, Decision trees and ensembles, Interpretability: Opening the Black Box

Feature engineering

· Fundamentals

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.

Related: Feature, Feature scaling (normalisation / standardisation), One-hot encoding, Data leakageLearn: Data and featuresSource: A Few Useful Things to Know About Machine Learning (2012)

Feature map

· Deep learning

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.

Effect of changing it: More output channels → richer representation and more compute/memory; fewer → cheaper but can bottleneck the network.
Related: Convolution, Kernel (filter), CNN (Convolutional Neural Network), Receptive fieldLearn: Convolutional Neural Networks (CNNs)

Feature scaling (normalisation / standardisation)

· Fundamentals

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.)

Effect of changing it: StandardScaler (mean 0, std 1) is the usual default; MinMaxScaler suits bounded data; RobustScaler (median/IQR) resists outliers. Skipping scaling lets large-unit features dominate distances and slows gradient descent (elongated loss valleys).
Related: Feature engineering, k-nearest neighbours (kNN), Support vector machine (SVM), Principal component analysis (PCA), Gradient descent, Batch normalizationLearn: Data and features, Classification: logistic regression, kNN, SVM, Clustering and PCASource: scikit-learn User Guide — Preprocessing data

Feature store

· MLOps

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.

Related: Feature, Feature engineering, Data leakage, Model serving, MLOpsLearn: CI/CD, continuous training & feature storesSource: Feast Documentation

Few-shot prompting

· LLM

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.

Effect of changing it: More examples → clearer format and often better accuracy on unusual tasks, but longer, costlier prompts with diminishing returns. Fewer (down to zero-shot) → cheaper, but format and label errors become more likely. Typical: 2–8 diverse, balanced examples.
Related: Zero-shot, In-context learning, PromptLearn: Prompting: zero-shot, few-shot, chain-of-thought, structured outputSource: Language Models are Few-Shot Learners (2020)

Fine-tuning

· LLM

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.

Effect of changing it: Higher learning rate or more epochs → faster adaptation but risk of overfitting and catastrophic forgetting of general skills. Lower → preserves the base model but may barely change behaviour. Typical: full SFT lr 1e-5–2e-5, LoRA 1e-4–2e-4, 1–3 epochs.
Related: Pretraining, Instruction tuning, LoRA (Low-Rank Adaptation), PEFT (Parameter-Efficient Fine-Tuning), Transfer learningLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRA

FlashAttention

· Advanced

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.

Effect of changing it: Not a quality knob — results are exact. Enabling it lets you use longer sequences or bigger batches in the same memory and speeds up training and inference; gains grow with sequence length.
Related: Attention, Self-attention, KV cache, GPULearn: Efficient Inference: Quantization, Distillation, Pruning and Faster DecodingSource: FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness (2022)

Flow matching (rectified flow)

· Generative

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.

Effect of changing it: Sampling steps: fewer work better than with classic diffusion, but too few still blur detail (≈ 28 is typical for SD3). Timestep shift / sampling density: emphasizing higher noise levels improves global structure at high resolution; emphasizing low noise sharpens detail.
Related: Diffusion model, Diffusion Transformer (DiT), Sampling steps (inference steps), Generative modelLearn: Generative Models: The Big Picture, Stable Diffusion in PracticeSource: Flow Matching for Generative Modeling (2022)

Generative adversarial network (GAN)

· Generative

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.

Effect of changing it: Learning rates and D/G balance: too high or a too-strong discriminator → oscillation, vanishing generator gradients, mode collapse; lower rates (≈ 1e-4–2e-4, Adam β₁ = 0.5 or 0) → more stable. Truncation ψ < 1 at sampling → cleaner but less diverse images.
Related: Generative model, Latent space, Diffusion model, CNN (Convolutional Neural Network)Learn: Generative Models: The Big Picture, Generative Adversarial Networks (GANs), Speech Synthesis: From Text to a Natural VoiceSource: Generative Adversarial Networks (2014)

Generative model

· Generative

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.

Related: Variational autoencoder (VAE), Generative adversarial network (GAN), Diffusion model, Flow matching (rectified flow), Language modelLearn: Generative Models: The Big Picture, Generative Adversarial Networks (GANs), Music & Audio Generation: Codecs, Tokens and Diffusion

GPT (Generative Pre-trained Transformer)

· LLM

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.

Related: Large language model (LLM), Decoder, Transformer, BERT, Next-token predictionLearn: How LLMs work: next-token prediction at scaleSource: Language Models are Unsupervised Multitask Learners (2019)

GPU

· Advanced

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.

Related: Distributed training, Mixed-precision training, Quantization, FlashAttentionLearn: The ML development stack, Efficient Inference: Quantization, Distillation, Pruning and Faster Decoding, Distributed Training: Many GPUs, One Model

Gradient

· Fundamentals

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.

Related: Derivative, Gradient descent, Backpropagation, Vanishing (and exploding) gradient, Gradient clippingLearn: Math essentials for ML, Gradient descent, Multilayer Perceptrons and Backpropagation, Interpretability: Opening the Black Box

Gradient accumulation

· Advanced

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.

Effect of changing it: More accumulation steps: larger effective batch with no extra memory — smoother gradients but fewer updates per epoch (retune learning rate). Fewer steps: more frequent, noisier updates.
Related: Batch size, Distributed training, Learning rate, Iteration (training step)Learn: Distributed Training: Many GPUs, One Model

Gradient boosting

· Classical ML

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.

Effect of changing it: learning_rate ν: higher → fewer trees needed but faster overfitting; lower → better generalisation but proportionally more trees. n_estimators: unlike random forests, too many rounds overfit — use early stopping. max_depth: usually shallow (3–8); deeper trees capture more interactions but overfit sooner.
Related: Decision tree, Random forest, Gradient descent, Early stopping, Learning rateLearn: Decision trees and ensembles, Interpretability: Opening the Black BoxSource: Greedy Function Approximation: A Gradient Boosting Machine (2001)

Gradient clipping

· Neural networks

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.

Effect of changing it: Lower max norm → more steps get clipped, training is more stable but effectively slower (like a smaller learning rate on big steps). Higher max norm → rarely active, offers little protection against spikes. 1.0 is a common default for transformers; if almost every step is clipped, the threshold or learning rate is off.
Related: Gradient, Vanishing (and exploding) gradient, Learning rate, Loss curve, RNN (Recurrent Neural Network)Learn: Reading Loss & Accuracy CurvesSource: On the difficulty of training recurrent neural networks (2013)

Gradient descent

· Fundamentals

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.

Effect of changing it: The learning rate η is the key knob: too small → very slow convergence; well chosen → fast, stable descent; too large → oscillation and divergence (loss becomes NaN). For a quadratic with curvature c it converges only if η < 2/c. Batch size and number of epochs are the other main knobs.
Related: Gradient, Learning rate, SGD (Stochastic Gradient Descent), Batch size, Epoch, Optimizer, Loss functionLearn: Linear regression, Gradient descentSource: An overview of gradient descent optimization algorithms (2016)

Grid search

· Evaluation

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.

Effect of changing it: Adding values per axis or adding a new hyperparameter multiplies total trials (exponential growth); a coarse grid can miss the optimum between grid points.
Related: Random search, Hyperparameter tuning, Cross-validationLearn: Hyperparameter TuningSource: scikit-learn User Guide — Tuning the hyper-parameters of an estimator

GRU (Gated Recurrent Unit)

· Deep learning

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.

Effect of changing it: Same knobs as an LSTM (hidden size, layers); at equal hidden size it is cheaper and faster.
Related: RNN (Recurrent Neural Network), LSTM (Long Short-Term Memory), Seq2seq (sequence-to-sequence)Learn: Recurrent Networks: RNN, LSTM and GRUSource: Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation (2014)

Guidance scale (CFG scale)

· Generative

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.

Effect of changing it: Raise it → closer prompt matching, punchier colours and contrast, less variety; too high (≳ 12–15 on SD 1.5) → 'fried', oversaturated images. Lower it → softer, more diverse, more natural images that may ignore parts of the prompt. Typical: 7–7.5 (SD 1.5), 5–8 (SDXL), 4.5–7 (SD3), 0–2 (distilled).
Related: Classifier-free guidance (CFG), Negative prompt, Sampling steps (inference steps), Text-to-imageLearn: Stable Diffusion in Practice

Hallucination

· LLM

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.

Related: RAG (Retrieval-Augmented Generation), Large language model (LLM), Temperature, AI safetyLearn: Retrieval-Augmented Generation (RAG), Multimodal LLMs (Vision-Language Models), AI Safety & Ethics: Bias, Hallucination, Alignment and RegulationSource: Survey of Hallucination in Natural Language Generation (2023)

Hyperparameter

· Fundamentals

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.

Effect of changing it: Each hyperparameter moves the model along the underfitting ↔ overfitting axis or the slow ↔ unstable training axis. Never pick them by training score or test score; use validation data.
Related: Parameter, Hyperparameter tuning, Learning rate, Validation set, Cross-validationLearn: What is AI?, Decision trees and ensembles, Clustering and PCA, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More, Experiment Logging & Reproducibility, Hyperparameter Tuning, Experiment tracking with MLflowSource: Machine Learning Glossary — Hyperparameter

Hyperparameter tuning

· Evaluation

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.

Effect of changing it: More trials → better chance of finding a good configuration, with diminishing returns and a growing risk of overfitting the validation set. Wider search ranges → can find surprises but waste trials; use log scales for learning rate and regularization strength.
Related: Hyperparameter, Grid search, Random search, Bayesian optimization, Cross-validationLearn: Hyperparameter TuningSource: Optuna: A Next-generation Hyperparameter Optimization Framework (2019)

Image-to-image (img2img)

· Generative

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.

Effect of changing it: See denoising strength: higher → output departs further from the input; lower → stays close, only textures change.
Related: Denoising strength, Inpainting, Latent diffusion, Text-to-imageSource: SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations (2021)

In-context learning

· LLM

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.

Related: Few-shot prompting, Zero-shot, Prompt, Large language model (LLM)Learn: Prompting: zero-shot, few-shot, chain-of-thought, structured outputSource: Language Models are Few-Shot Learners (2020)

Inference

· Fundamentals

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.)

Related: Model, Latency, Model serving, QuantizationLearn: What is AI?, The ML development stack, Deployment & model serving

Inpainting

· Generative

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).

Effect of changing it: Strength: higher → the masked region can change completely (0.9–1.0 for replacing content with a dedicated model); lower → only subtle retouching. Mask blur/padding: more → smoother transitions but changes leak beyond the mask.
Related: Image-to-image (img2img), Denoising strength, Latent diffusion, ControlNetLearn: Stable Diffusion in Practice

Instruction tuning

· LLM

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.

Related: Fine-tuning, RLHF (Reinforcement Learning from Human Feedback), Zero-shot, PromptLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRA, Multimodal LLMs (Vision-Language Models)

Interpretability

· Advanced

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.

Related: SHAP (SHapley Additive exPlanations), AI safety, Feature, AttentionLearn: Interpretability: Opening the Black BoxSource: Interpretable Machine Learning

Iteration (training step)

· Neural networks

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.

Effect of changing it: More total iterations → more optimisation (lower training loss) and more compute; validation improves until overfitting starts. Raising batch size silently reduces iterations per epoch.
Related: Epoch, Batch size, Learning rate schedule, Learning rate warmup, CheckpointLearn: Gradient descent, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More

k-means

· Classical ML

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.

Effect of changing it: K (n_clusters): higher → lower inertia always, smaller clusters, eventually splitting natural groups; lower → merges distinct groups. Choose with the elbow method, silhouette score and domain needs. n_init: more restarts → better, more reproducible solutions at more compute.
Related: Clustering, Unsupervised learning, Feature scaling (normalisation / standardisation), Principal component analysis (PCA)Learn: Clustering and PCASource: Least squares quantization in PCM (1982)

k-nearest neighbours (kNN)

· Classical ML

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.

Effect of changing it: k (n_neighbors): small k → jagged boundary, low bias, high variance (k = 1 memorises the training set); large k → smoother boundary, higher bias; k = N always predicts the majority class. Typical: 3–31, tuned by cross-validation.
Related: Classification, Feature scaling (normalisation / standardisation), Bias-variance trade-off, k-meansLearn: Classification: logistic regression, kNN, SVMSource: Nearest Neighbor Pattern Classification (1967)

Kernel (filter)

· Deep learning

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.

Effect of changing it: Larger kernel size → bigger receptive field per layer but compute grows with k² (two 3×3 layers usually beat one 5×5). More filters → richer features, more parameters. 1×1 kernels only mix channels.
Related: Convolution, Feature map, CNN (Convolutional Neural Network), Receptive fieldLearn: Convolutional Neural Networks (CNNs)

Knowledge distillation

· Advanced

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.

Effect of changing it: Higher temperature T: softer targets exposing more “dark knowledge”, but too high flattens them into noise. Higher weight α on the distillation term: student follows the teacher more closely (including its mistakes).
Related: Quantization, Pruning, Softmax, TemperatureLearn: Efficient Inference: Quantization, Distillation, Pruning and Faster DecodingSource: Distilling the Knowledge in a Neural Network (2015)

KV cache

· LLM

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.

Effect of changing it: Longer contexts or larger batches → cache memory grows linearly, limiting how many requests fit on a GPU. Fewer KV heads (GQA) or lower-precision cache → less memory, small possible quality loss.
Related: Self-attention, Context window, Inference, LatencyLearn: How LLMs work: next-token prediction at scale, Deployment & model serving, Efficient Inference: Quantization, Distillation, Pruning and Faster Decoding

Label (target)

· Fundamentals

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.

Related: Supervised learning, Feature, DatasetLearn: Types of learning, Data and features

Language model

· LLM

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.

Related: Large language model (LLM), Next-token prediction, Perplexity, TransformerLearn: How LLMs work: next-token prediction at scale

Large language model (LLM)

· LLM

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.

Effect of changing it: Bigger model → lower loss, more knowledge and better reasoning, but more memory (~2 bytes/parameter in 16-bit), slower and costlier inference. Smaller model → runs on cheap hardware, weaker on hard tasks.
Related: Language model, GPT (Generative Pre-trained Transformer), Transformer, Pretraining, Scaling lawsLearn: How LLMs work: next-token prediction at scale, Scaling laws: parameters, data and compute, Multimodal LLMs (Vision-Language Models)Source: Language Models are Few-Shot Learners (2020)

Latency

· MLOps

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.

Effect of changing it: Bigger serving batches or longer batch-wait windows raise latency; quantization, distillation, smaller models, more replicas and GPU acceleration lower it. Under load, latency rises sharply once throughput approaches capacity (queueing).
Related: Throughput, Model serving, Quantization, InferenceLearn: Deployment & model serving, Monitoring, data drift & concept drift, Efficient Inference: Quantization, Distillation, Pruning and Faster Decoding

Latent diffusion

· Generative

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.

Effect of changing it: Downsampling factor f: larger → much cheaper diffusion but loss of fine detail (faces, small text); smaller → better detail but slower. f = 8 is the common sweet spot; more latent channels recover detail.
Related: Variational autoencoder (VAE), Diffusion model, U-Net, Text-to-image, CLIPLearn: Stable Diffusion in Practice, Music & Audio Generation: Codecs, Tokens and Diffusion, Video GenerationSource: High-Resolution Image Synthesis with Latent Diffusion Models (2021)

Latent space

· Generative

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.

Effect of changing it: Latent dimension: larger → more detail and capacity but harder to regularize and sample; smaller → stronger compression, smoother space, loss of detail. For latent diffusion, more channels (4 → 16 in SD3) improve fine detail and text rendering at higher compute cost.
Related: Variational autoencoder (VAE), Autoencoder, Generative adversarial network (GAN), Embedding, Latent diffusionLearn: Generative Models: The Big Picture, Generative Adversarial Networks (GANs)

Layer normalization

· Neural networks

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.

Related: Batch normalization, Transformer, RNN (Recurrent Neural Network), Feature scaling (normalisation / standardisation)Learn: Regularization, Normalization and Initialization, Attention and TransformersSource: Layer Normalization (2016)

Learning curve

· Evaluation

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.

Effect of changing it: Increasing training-set size usually lowers the training score slightly (harder to memorize) and raises the validation score, narrowing the gap; once both curves flatten, extra data stops paying off.
Related: Bias-variance trade-off, Overfitting, Underfitting, Loss curve, Cross-validationLearn: Overfitting and the bias-variance trade-offSource: scikit-learn User Guide — Validation curves: plotting scores to evaluate models

Learning rate

· Neural networks

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.

Effect of changing it: Higher → faster progress until instability: noisy/oscillating loss, divergence, dead ReLUs. Lower → stable but slow; may look like “not learning” and get stuck on plateaus. When multiplying batch size by k, a common starting point is multiplying LR by k (with warmup).
Related: Gradient descent, Optimizer, Learning rate schedule, Learning rate warmup, Batch size, HyperparameterLearn: Gradient descent, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More, Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR Schedules, Reading Loss & Accuracy Curves, Hyperparameter TuningSource: Cyclical Learning Rates for Training Neural Networks (2015)

Learning rate schedule

· Neural networks

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.

Effect of changing it: Decaying further/sooner → loss settles lower at the end, but decaying too early freezes learning. Keeping LR high longer → more exploration, noisier final loss.
Related: Learning rate, Learning rate warmup, Optimizer, Iteration (training step)Learn: Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR SchedulesSource: SGDR: Stochastic Gradient Descent with Warm Restarts (2016)

Learning rate warmup

· Neural networks

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).

Effect of changing it: Longer warmup → safer start, tolerates higher peak LR and bigger batches, but slower early progress. Shorter/no warmup → faster start, risk of early loss spikes or NaN in large models.
Related: Learning rate schedule, Learning rate, Batch size, Transformer, Adam / AdamWLearn: Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR SchedulesSource: Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour (2017)

Linear regression

· Classical ML

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.

Effect of changing it: With ridge/lasso, raising alpha shrinks weights (more bias, less variance, eventually underfitting); lowering it approaches plain least squares, which can overfit with many correlated features.
Related: Regression, Mean squared error (MSE), Gradient descent, Regularisation, Logistic regressionLearn: Linear regressionSource: scikit-learn User Guide — Linear Models

Logistic regression

· Classical ML

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.

Effect of changing it: In scikit-learn, C is the inverse regularisation strength: higher C → weaker penalty, tighter fit, more confident probabilities, risk of overfitting; lower C → stronger shrinkage, probabilities pulled toward 0.5, risk of underfitting. The decision threshold (default 0.5) trades precision against recall.
Related: Classification, Sigmoid (logistic function), Cross-entropy (log loss), Decision threshold, Linear regression, SoftmaxLearn: Classification: logistic regression, kNN, SVMSource: scikit-learn User Guide — Logistic regression

Logits

· LLM

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.

Related: Softmax, Temperature, Top-k sampling, Top-p (nucleus) sampling, Cross-entropy (log loss)Learn: How LLMs work: next-token prediction at scale, Decoding: greedy, beam search, temperature, top-k, top-p

LoRA (Low-Rank Adaptation)

· LLM

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.

Effect of changing it: Rank r ↑ → more expressive adapter, more parameters, more overfitting risk; r ↓ → tiny, fast, may underfit (typical 8–64). Alpha α ↑ → stronger adapter effect (like a higher learning rate); α ↓ → weaker updates (typical α = r or 2r). More target modules → better quality, more memory.
Related: PEFT (Parameter-Efficient Fine-Tuning), Fine-tuning, Quantization, MatrixLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRA, Stable Diffusion in PracticeSource: LoRA: Low-Rank Adaptation of Large Language Models (2021)

Loss curve

· Evaluation

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.

Related: Training loss, Validation loss, Learning curve, Smoothing (EMA), Overfitting, UnderfittingLearn: Reading Loss & Accuracy CurvesSource: Machine Learning Crash Course

Loss function

· Fundamentals

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).

Related: Mean squared error (MSE), Cross-entropy (log loss), Gradient descent, Training loss, Validation lossLearn: Linear regression, Gradient descent, Multilayer Perceptrons and Backpropagation, Generative Adversarial Networks (GANs)

LSTM (Long Short-Term Memory)

· Deep learning

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).

Effect of changing it: Larger hidden size / more layers → more capacity, slower, more overfitting risk; clipping gradients (max-norm ~1) prevents occasional explosions.
Related: RNN (Recurrent Neural Network), GRU (Gated Recurrent Unit), Vanishing (and exploding) gradient, Seq2seq (sequence-to-sequence), Sigmoid (logistic function)Learn: Recurrent Networks: RNN, LSTM and GRUSource: Long Short-Term Memory (1997)

Machine learning (ML)

· Fundamentals

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.

Related: Artificial intelligence (AI), Deep learning, Model, Supervised learning, Unsupervised learningLearn: What is AI?, The ML development stackSource: Deep Learning — Chapter 5: Machine Learning Basics (2016)

Markov decision process (MDP)

· 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.

Related: Reinforcement learning (RL), Policy, Reward, Discount factor (γ)Learn: Reinforcement Learning Basics: Agents, Rewards and Q-learning

Matrix

· Fundamentals

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.

Related: Vector, Tensor, Dot product, GPU, Principal component analysis (PCA)Learn: Math essentials for ML

Mean Absolute Error (MAE)

· Evaluation

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.

Related: Root Mean Squared Error (RMSE), Mean squared error (MSE), R² (coefficient of determination), RegressionLearn: Regression Metrics & ValidationSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Mean squared error (MSE)

· Fundamentals

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.

Related: Loss function, Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Linear regression, RegressionLearn: Linear regression, Regression Metrics & Validation

Mel spectrogram

· Audio

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).

Effect of changing it: More mel bins (n_mels): finer spectral detail, bigger input, useful for music and high-fidelity vocoders. Fewer bins: compact, smooth features that generalise well for speech but lose pitch and timbre detail. Typical: 80 or 128.
Related: Spectrogram, Fast Fourier Transform (FFT), Automatic speech recognition (ASR), Text-to-speech (TTS), VocoderLearn: Audio Basics: From Sound Waves to Spectrograms, Speech Recognition: CTC, wav2vec 2.0 and Whisper, Speech Synthesis: From Text to a Natural VoiceSource: librosa documentation — feature.melspectrogram

Mixed-precision training

· Advanced

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.

Effect of changing it: Lower precision (FP32 → BF16/FP16 → FP8): faster and less memory, but higher risk of numerical issues (overflow/underflow, loss spikes) that need loss scaling or careful recipes. Staying in FP32 is safest but slowest.
Related: Distributed training, Quantization, GPU, Gradient clippingLearn: The ML development stack, Distributed Training: Many GPUs, One ModelSource: Mixed Precision Training (2017)

Mixture of Experts (MoE)

· Advanced

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.

Effect of changing it: More experts: more capacity at the same per-token compute, but more memory and harder balancing. Higher top-k: better quality and stability, compute grows linearly. Higher capacity factor: fewer dropped tokens, more wasted compute.
Related: Transformer, Scaling laws, Model parallelism, ParameterLearn: Mixture of Experts: Bigger Models at the Same ComputeSource: Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity (2021)

MLflow

· MLOps

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.

Related: Experiment tracking, Run, Artifact, Model registry, MLOpsLearn: Experiment tracking with MLflow, Model Registry, data versioning & lineageSource: MLflow Documentation

MLOps

· MLOps

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.

Related: Experiment tracking, Model registry, CI/CD, Model monitoring, Model serving, Data versioningLearn: The ML lifecycle & MLOps maturity, CI/CD, continuous training & feature storesSource: MLOps: Continuous delivery and automation pipelines in machine learning

MLP (Multilayer Perceptron)

· Neural networks

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.

Effect of changing it: More layers/units → more capacity (can fit more complex patterns) but more compute and overfitting risk; fewer → underfitting.
Related: Neuron (artificial), Perceptron, Backpropagation, Activation function, TransformerLearn: Multilayer Perceptrons and Backpropagation, 3D: NeRF, Gaussian Splatting and Text-to-3D

Model

· Fundamentals

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.

Effect of changing it: More capacity (more parameters, layers, depth or features) lowers bias but raises variance: it can fit more complex patterns but needs more data and regularisation to avoid overfitting.
Related: Parameter, Hyperparameter, Inference, Overfitting, UnderfittingLearn: What is AI?

Model monitoring

· MLOps

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.

Effect of changing it: More sensitive alert thresholds or shorter windows → problems caught earlier but more false alarms and alert fatigue. Less sensitive → fewer false alarms but slower detection of real degradation.
Related: Data drift, Concept drift, Latency, MLOps, CI/CDLearn: The ML lifecycle & MLOps maturity, Monitoring, data drift & concept drift, CI/CD, continuous training & feature storesSource: Evidently AI Documentation

Model parallelism

· Advanced

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).

Effect of changing it: Higher tensor-parallel degree: less memory per GPU but more communication per layer (keep within a node). More pipeline stages: fits deeper models but needs more micro-batches to keep the bubble small.
Related: Distributed training, Data parallelism, Mixture of Experts (MoE), GPULearn: Mixture of Experts: Bigger Models at the Same Compute, Distributed Training: Many GPUs, One ModelSource: Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism (2019)

Model registry

· MLOps

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?".

Related: MLflow, Artifact, Model serving, CI/CD, Data versioningLearn: Experiment tracking with MLflow, Model Registry, data versioning & lineage, CI/CD, continuous training & feature storesSource: MLflow Documentation

Model serving

· MLOps

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.

Effect of changing it: Larger serving batch size / longer max batch wait → higher throughput and better GPU use, but higher per-request latency. More replicas → more throughput and availability at higher cost. Smaller batches → lowest latency, poor GPU utilization.
Related: Latency, Throughput, Batch inference, Docker, ONNX, InferenceLearn: Deployment & model servingSource: FastAPI Documentation

Momentum

· Neural networks

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.

Effect of changing it: Higher β (0.9 → 0.99) → smoother, faster, longer memory but more overshoot and oscillation; effective step grows (may need lower η). β = 0 → plain SGD.
Related: SGD (Stochastic Gradient Descent), Optimizer, Adam / AdamW, Learning rateLearn: Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR SchedulesSource: On the importance of initialization and momentum in deep learning (2013)

Multi-head attention

· Deep learning

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).

Effect of changing it: More heads → more distinct attention patterns but narrower heads (smaller d_k); fewer heads → wider heads, fewer patterns. Compute stays roughly constant.
Related: Attention, Self-attention, TransformerLearn: Attention and Transformers

Multimodal

· Multimodal

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.

Related: CLIP, Vision-language model (VLM), Text-to-image, Video diffusion, Large language model (LLM)Learn: Vision Transformers and CLIP, Multimodal LLMs (Vision-Language Models)

Negative prompt

· Generative

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).

Effect of changing it: More specific negatives remove targeted defects; long generic lists can dull the image or conflict with the main prompt; an empty negative prompt equals standard CFG. Its strength scales with the guidance scale.
Related: Classifier-free guidance (CFG), Guidance scale (CFG scale), Prompt, Text-to-imageLearn: Stable Diffusion in Practice

NeRF (Neural Radiance Field)

· Multimodal

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).

Effect of changing it: Positional-encoding frequencies: more → sharper detail but floaters/overfitting with few views; fewer → blurrier. Samples per ray: more → thin structures and sharp surfaces render correctly but cost grows linearly; fewer → faster but objects can be missed.
Related: 3D Gaussian Splatting (3DGS), MLP (Multilayer Perceptron), Positional encoding, MultimodalLearn: 3D: NeRF, Gaussian Splatting and Text-to-3DSource: NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis (2020)

Neural audio codec

· Audio

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).

Effect of changing it: More codebooks (higher bitrate, e.g. 6 → 24 kbps): better fidelity but more tokens for a generator to model. Fewer codebooks: tiny bitrate and easier generation, but muffled, artifact-prone audio.
Related: Autoencoder, Token, Text-to-speech (TTS), QuantizationLearn: Music & Audio Generation: Codecs, Tokens and DiffusionSource: High Fidelity Neural Audio Compression (2022)

Neuron (artificial)

· Neural networks

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.

Effect of changing it: More neurons per layer (width) → more capacity and compute; too few → underfitting, too many on small data → overfitting.
Related: Perceptron, Activation function, MLP (Multilayer Perceptron), ParameterLearn: Neurons and Activation Functions, Multilayer Perceptrons and Backpropagation

Next-token prediction

· LLM

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.

Related: Language model, Pretraining, Cross-entropy (log loss), Self-supervised learning, LogitsLearn: How LLMs work: next-token prediction at scale

Noise schedule

· Generative

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.

Effect of changing it: A more aggressive schedule (signal destroyed early) wastes steps on near-pure noise and lowers quality, especially for small images; a gentler one (cosine) spreads useful noise levels evenly. If the last step still contains signal (non-zero terminal SNR), images can come out washed-out or mid-grey.
Related: Diffusion model, DDPM (Denoising Diffusion Probabilistic Models), Sampling steps (inference steps), Scheduler / samplerLearn: Diffusion Models: From Noise to ImageSource: Improved Denoising Diffusion Probabilistic Models (2021)

One-hot encoding

· Fundamentals

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.

Effect of changing it: Options like 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.
Related: Feature engineering, Feature, EmbeddingLearn: Data and features, Embeddings: Meaning as VectorsSource: scikit-learn User Guide — Encoding categorical features

ONNX

· MLOps

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.

Related: Model serving, Latency, Quantization, InferenceLearn: Deployment & model servingSource: ONNX — Open Neural Network Exchange

Optimizer

· Neural networks

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.

Effect of changing it: Switching optimizer changes the good learning-rate range by orders of magnitude (SGD ~0.1 vs Adam ~1e-3) — always retune η.
Related: SGD (Stochastic Gradient Descent), Momentum, Adam / AdamW, Learning rate, Learning rate schedule, Weight decayLearn: Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR SchedulesSource: An overview of gradient descent optimization algorithms (2016)

Overfitting

· Fundamentals

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.

Related: Underfitting, Bias-variance trade-off, Regularisation, Early stopping, Validation set, DropoutLearn: Decision trees and ensembles, Overfitting and the bias-variance trade-off, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More, Reading Loss & Accuracy Curves

Padding

· Deep learning

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.

Effect of changing it: More padding → output keeps (or grows) its size; edge pixels contribute more. Less/no padding → output shrinks by k − 1 per layer.
Related: Convolution, Stride, Kernel (filter)Learn: Convolutional Neural Networks (CNNs)

Parameter

· Fundamentals

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.

Related: Hyperparameter, Model, Gradient descentLearn: What is AI?, Linear regression, Scaling laws: parameters, data and compute, Mixture of Experts: Bigger Models at the Same Compute

PEFT (Parameter-Efficient Fine-Tuning)

· LLM

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.

Effect of changing it: More trainable parameters (higher rank, more target modules) → more capacity to adapt, more memory and overfitting risk. Fewer → lighter and safer but may underfit large domain shifts.
Related: LoRA (Low-Rank Adaptation), Fine-tuning, Quantization, Transfer learningLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRASource: PEFT documentation

Perceptron

· Neural networks

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.

Related: Neuron (artificial), MLP (Multilayer Perceptron), Activation function, ClassificationLearn: Neurons and Activation FunctionsSource: The perceptron: A probabilistic model for information storage and organization in the brain (1958)

Perplexity

· LLM

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.

Related: Cross-entropy (log loss), Language model, Loss functionLearn: How LLMs work: next-token prediction at scale, Scaling laws: parameters, data and compute

Policy

· Reinforcement learning

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.

Related: Value function, Policy gradient, Q-learning, Proximal Policy Optimization (PPO)Learn: Reinforcement Learning Basics: Agents, Rewards and Q-learning

Policy gradient

· Reinforcement learning

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.

Effect of changing it: Larger learning rate: faster but can collapse a good policy in one bad step. Using a baseline/critic reduces variance; bigger batches of episodes give smoother but costlier gradient estimates.
Related: Policy, Proximal Policy Optimization (PPO), Value function, GradientLearn: Deep Reinforcement Learning: DQN, Policy Gradients and PPOSource: Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning (1992)

Pooling

· Deep learning

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.

Effect of changing it: Larger pooling window/stride → more aggressive downsampling, more shift tolerance, less compute, but loss of spatial detail (bad for segmentation/detection).
Related: CNN (Convolutional Neural Network), Stride, Feature map, Receptive fieldLearn: Convolutional Neural Networks (CNNs), CNN Architectures and Transfer Learning

Positional encoding

· Deep learning

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.

Effect of changing it: Learned absolute positions cannot go beyond the maximum length seen in training; relative schemes (RoPE, ALiBi) extrapolate better, especially with scaling tricks.
Related: Transformer, Self-attention, Embedding, Context windowLearn: Attention and Transformers, 3D: NeRF, Gaussian Splatting and Text-to-3DSource: RoFormer: Enhanced Transformer with Rotary Position Embedding (2021)

Precision

· Evaluation

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.

Effect of changing it: Raising the decision threshold usually raises precision (only confident predictions count as positive) and lowers recall; lowering the threshold does the opposite.
Related: Recall, F1 score, Decision threshold, Confusion matrix, ROC curve & AUCLearn: Classification MetricsSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Pretraining

· LLM

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.

Effect of changing it: More pretraining tokens → lower loss for a fixed model (with diminishing returns and limited high-quality data). Fewer tokens → cheaper, but the model is undertrained relative to its size.
Related: Next-token prediction, Fine-tuning, Scaling laws, Transfer learningLearn: How LLMs work: next-token prediction at scale, Scaling laws: parameters, data and compute

Principal component analysis (PCA)

· Classical ML

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).

Effect of changing it: n_components: more → more variance kept and lower reconstruction error, less compression; fewer → stronger compression and denoising but risk of discarding useful signal. A float like 0.95 keeps enough components for 95% of the variance.
Related: Unsupervised learning, Matrix, Feature scaling (normalisation / standardisation), k-means, Latent spaceLearn: Clustering and PCASource: Principal component analysis: a review and recent developments (2016)

Probability distribution

· Fundamentals

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.

Related: Softmax, Cross-entropy (log loss), Temperature, Generative modelLearn: Math essentials for ML, Monitoring, data drift & concept driftSource: Deep Learning — Chapter 3: Probability and Information Theory (2016)

Prompt

· LLM

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.

Related: Prompt engineering, System prompt, Few-shot prompting, Context windowLearn: Prompting: zero-shot, few-shot, chain-of-thought, structured output, Agents & tool use: ReAct, function calling, MCP

Prompt engineering

· LLM

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.

Related: Prompt, Few-shot prompting, Chain-of-thought (CoT), System prompt, EvalsLearn: Prompting: zero-shot, few-shot, chain-of-thought, structured outputSource: Prompt engineering overview

Proximal Policy Optimization (PPO)

· Reinforcement learning

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.

Effect of changing it: Larger clip range ε: bigger, faster but riskier policy updates; smaller: conservative and stable but slow (typical 0.2). More epochs per batch reuse data better but can overfit to stale data.
Related: Policy gradient, RLHF (Reinforcement Learning from Human Feedback), Policy, Value functionLearn: Deep Reinforcement Learning: DQN, Policy Gradients and PPOSource: Proximal Policy Optimization Algorithms (2017)

Pruning

· Advanced

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.

Effect of changing it: Higher sparsity: smaller (and with structured/2:4 patterns, faster) models, until accuracy collapses beyond a model-dependent point. Lower sparsity: safer accuracy, little saving.
Related: Quantization, Knowledge distillation, ParameterLearn: Efficient Inference: Quantization, Distillation, Pruning and Faster DecodingSource: Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding (2015)

Q-learning

· Reinforcement learning

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.

Effect of changing it: Learning rate α higher: faster but noisier, oscillating values; lower: stable but slow. Combined with γ (horizon) and ε (exploration), these three knobs control most of its behaviour.
Related: Value function, ε-greedy, Discount factor (γ), Learning rateLearn: Reinforcement Learning Basics: Agents, Rewards and Q-learning, Deep Reinforcement Learning: DQN, Policy Gradients and PPOSource: Q-learning (1992)

Quantization

· Advanced

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.

Effect of changing it: Fewer bits: less memory and usually faster memory-bound decoding, but more rounding error — 8-bit is near-lossless, 4-bit costs a little, ≤ 3-bit degrades noticeably (worse for small models). Smaller group size: lower error, more scale overhead.
Related: Knowledge distillation, Pruning, Inference, GPU, LoRA (Low-Rank Adaptation)Learn: Efficient Inference: Quantization, Distillation, Pruning and Faster DecodingSource: Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference (2017)

R² (coefficient of determination)

· Evaluation

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.

Related: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Baseline, Linear regressionLearn: Regression Metrics & ValidationSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

RAG (Retrieval-Augmented Generation)

· LLM

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.

Effect of changing it: More retrieved chunks (top-k) → higher recall but more noise, tokens and latency; fewer → focused and cheap but the right passage may be missed. Typical: retrieve 20–50, rerank, pass 3–8.
Related: Vector database, Chunking, Embedding, Cosine similarity, HallucinationLearn: Retrieval-Augmented Generation (RAG)Source: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2020)

Random forest

· Classical ML

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.

Effect of changing it: n_estimators: more trees → more stable predictions with diminishing returns; does not overfit, only costs time. max_features: smaller → more diverse but individually weaker trees; larger → stronger but more correlated trees. min_samples_leaf / max_depth limit individual tree complexity.
Related: Decision tree, Gradient boosting, Bias-variance trade-off, OverfittingLearn: Decision trees and ensemblesSource: Random Forests (2001)

Random search

· Evaluation

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.

Effect of changing it: More trials (n_iter ↑) → finds better configurations with diminishing returns; about 60 random trials already have a 95% chance of landing in the top 5% of the space. Wider distributions need more trials.
Related: Grid search, Bayesian optimization, Hyperparameter tuningLearn: Hyperparameter TuningSource: Random Search for Hyper-Parameter Optimization (2012)

Recall

· Evaluation

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.

Effect of changing it: Lowering the decision threshold raises recall (more cases are called positive) at the cost of precision; raising it lowers recall.
Related: Precision, F1 score, Decision threshold, Confusion matrix, ROC curve & AUCLearn: Classification MetricsSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Receptive field

· Deep learning

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.

Effect of changing it: Grows with more layers, larger kernels, larger strides/pooling and dilation. Too small → the network can't see enough context; growing it via aggressive downsampling sacrifices resolution.
Related: CNN (Convolutional Neural Network), Kernel (filter), Stride, PoolingLearn: Convolutional Neural Networks (CNNs)

Red-teaming

· Advanced

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.

Related: AI safety, Alignment, Evals, HallucinationLearn: AI Safety & Ethics: Bias, Hallucination, Alignment and RegulationSource: Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learned (2022)

Regression

· Classical ML

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’.

Related: Linear regression, Classification, Mean squared error (MSE), Mean Absolute Error (MAE), R² (coefficient of determination)Learn: Types of learning, Linear regression

Regularisation

· Fundamentals

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.

Effect of changing it: Strength (λ, alpha; or 1/C in scikit-learn's LogisticRegression and SVC): higher → simpler, smoother model, lower variance, eventually underfitting; lower → more flexible model, eventually overfitting. Tune on a log scale with cross-validation.
Related: Overfitting, Weight decay, Dropout, Early stopping, Linear regression, Bias-variance trade-offLearn: Linear regression, Overfitting and the bias-variance trade-off, Regularization, Normalization and InitializationSource: Regression Shrinkage and Selection via the Lasso (1996)

Reinforcement learning (RL)

· Reinforcement learning

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.

Effect of changing it: More training episodes/steps generally improve the policy with diminishing returns; RL results are very sensitive to hyperparameters and random seeds, so compare averages over several runs.
Related: Markov decision process (MDP), Reward, Policy, Value function, Q-learning, RLHF (Reinforcement Learning from Human Feedback)Learn: Types of learning, Reinforcement Learning Basics: Agents, Rewards and Q-learning, Deep Reinforcement Learning: DQN, Policy Gradients and PPOSource: Reinforcement Learning: An Introduction (2nd ed.) (2018)

ReLU (Rectified Linear Unit)

· Neural networks

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.

Effect of changing it: For Leaky ReLU, raising the negative slope α reduces dead units but makes the function more linear; α = 0 is plain ReLU.
Related: Activation function, Sigmoid (logistic function), Vanishing (and exploding) gradient, Weight initializationLearn: Neurons and Activation Functions

Reproducibility

· MLOps

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.

Related: Experiment tracking, Data versioning, Docker, Checkpoint, Seed (random seed)Learn: Experiment Logging & Reproducibility, The ML development stack, Experiment tracking with MLflow, Model Registry, data versioning & lineageSource: PyTorch Docs — Reproducibility

ResNet (Residual Network)

· Deep learning

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.

Effect of changing it: Deeper variants (18 → 50 → 101 → 152 layers) → higher accuracy with diminishing returns and more compute.
Related: CNN (Convolutional Neural Network), Batch normalization, Vanishing (and exploding) gradient, Transfer learning, TransformerLearn: CNN Architectures and Transfer LearningSource: Deep Residual Learning for Image Recognition (2015)

Reward

· Reinforcement learning

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.

Effect of changing it: A larger per-step penalty pushes for shorter solutions but can make ending the episode early (even badly) attractive. Sparser rewards slow learning; denser shaping speeds it up but risks reward hacking.
Related: Reinforcement learning (RL), Reward model, Discount factor (γ), AlignmentLearn: Reinforcement Learning Basics: Agents, Rewards and Q-learning

Reward model

· LLM

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.

Related: RLHF (Reinforcement Learning from Human Feedback), DPO (Direct Preference Optimization), RewardLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRA, Deep Reinforcement Learning: DQN, Policy Gradients and PPO

RLHF (Reinforcement Learning from Human Feedback)

· LLM

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.

Effect of changing it: Larger KL coefficient β → policy stays near the reference (safer, smaller gains). Smaller β → stronger optimization of the reward, with more risk of reward hacking, verbosity and degraded fluency.
Related: Reward model, DPO (Direct Preference Optimization), Proximal Policy Optimization (PPO), Alignment, Instruction tuningLearn: Fine-tuning & alignment: SFT, RLHF, DPO, LoRA/QLoRA, Deep Reinforcement Learning: DQN, Policy Gradients and PPO, AI Safety & Ethics: Bias, Hallucination, Alignment and RegulationSource: Training language models to follow instructions with human feedback (2022)

RNN (Recurrent Neural Network)

· Deep learning

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.

Effect of changing it: Larger hidden size → more memory capacity, ≈ quadratic parameter growth; longer BPTT length → longer dependencies learnable but more memory and instability.
Related: LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), Seq2seq (sequence-to-sequence), Vanishing (and exploding) gradient, TransformerLearn: Recurrent Networks: RNN, LSTM and GRUSource: Deep Learning — Chapter 10: Sequence Modeling: Recurrent and Recursive Nets (2016)

ROC curve & AUC

· Evaluation

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.

Related: Decision threshold, Precision, Recall, Confusion matrixLearn: Classification MetricsSource: An introduction to ROC analysis (2006)

Root Mean Squared Error (RMSE)

· Evaluation

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.

Related: Mean Absolute Error (MAE), Mean squared error (MSE), R² (coefficient of determination), Loss functionLearn: Regression Metrics & ValidationSource: scikit-learn User Guide — Metrics and scoring: quantifying the quality of predictions

Run

· MLOps

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.

Related: Experiment tracking, MLflow, Artifact, Hyperparameter tuningLearn: Experiment Logging & Reproducibility, Experiment tracking with MLflow, Model Registry, data versioning & lineageSource: MLflow Documentation

Sample rate

· Audio

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.

Effect of changing it: Higher: captures higher frequencies but means more samples per second (longer sequences, more compute and storage). Lower: cheaper, but high frequencies are lost and, without filtering, alias; speech at 8 kHz sounds muffled. A mismatch with the model's expected rate badly degrades results.
Related: Bit depth, Waveform, Fast Fourier Transform (FFT), SpectrogramLearn: Audio Basics: From Sound Waves to SpectrogramsSource: Communication in the Presence of Noise (1949)

Sampling steps (inference steps)

· Generative

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.

Effect of changing it: More steps → finer detail and fewer artifacts, with diminishing returns after ~30–50; with ancestral samplers the image keeps changing. Fewer steps → faster but smeary, noisy or unfinished images (unless the model is distilled for few steps).
Related: Scheduler / sampler, DDIM (Denoising Diffusion Implicit Models), Guidance scale (CFG scale), Noise scheduleLearn: Diffusion Models: From Noise to Image, Stable Diffusion in Practice

Scaling laws

· LLM

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.

Effect of changing it: 10× more compute (allocated optimally) → ~3.2× more parameters and ~3.2× more tokens, and a predictable, diminishing drop in loss. Training a smaller model on more tokens than compute-optimal costs extra training but makes inference cheaper.
Related: Large language model (LLM), Pretraining, ParameterLearn: Scaling laws: parameters, data and compute, Mixture of Experts: Bigger Models at the Same ComputeSource: Training Compute-Optimal Large Language Models (2022)

Scheduler / sampler

· Generative

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.

Effect of changing it: Higher-order/multistep solvers (DPM++ 2M, UniPC) reach good quality in fewer steps; first-order ones (Euler, DDIM) need more steps but are robust; ancestral variants add variety but do not converge as steps increase; consistency samplers (LCM) need matching distilled weights.
Related: Sampling steps (inference steps), DDIM (Denoising Diffusion Implicit Models), DDPM (Denoising Diffusion Probabilistic Models), Noise schedule, Seed (random seed)Learn: Stable Diffusion in PracticeSource: Diffusers documentation

Seed (random seed)

· Generative

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.

Effect of changing it: Changing the seed changes composition, pose and colours entirely (no value is 'better'); keeping it fixed while changing one other setting isolates that setting's effect.
Related: Sampling steps (inference steps), Scheduler / sampler, DDIM (Denoising Diffusion Implicit Models), ReproducibilityLearn: Experiment Logging & Reproducibility, Diffusion Models: From Noise to Image, Stable Diffusion in Practice

Self-attention

· Deep learning

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.

Effect of changing it: Longer sequences → attention compute and memory grow ∝ n².
Related: Attention, Multi-head attention, Transformer, Positional encoding, Context windowLearn: Attention and Transformers

Self-supervised learning

· Fundamentals

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.

Related: Pretraining, Next-token prediction, BERT, GPT (Generative Pre-trained Transformer), EmbeddingLearn: Types of learning, Speech Recognition: CTC, wav2vec 2.0 and WhisperSource: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (2018)

Semi-supervised learning

· Fundamentals

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.

Effect of changing it: In self-training, the confidence threshold for accepting pseudo-labels is the key knob: higher → fewer but cleaner pseudo-labels; lower → more data but more label noise that can reinforce the model's own mistakes.
Related: Supervised learning, Unsupervised learning, Self-supervised learning, Label (target)Learn: Types of learningSource: scikit-learn User Guide — Semi-supervised learning

Seq2seq (sequence-to-sequence)

· Deep learning

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.

Related: Encoder, Decoder, Attention, LSTM (Long Short-Term Memory), TransformerLearn: Recurrent Networks: RNN, LSTM and GRUSource: Sequence to Sequence Learning with Neural Networks (2014)

SGD (Stochastic Gradient Descent)

· Neural networks

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.

Effect of changing it: Its knobs are learning rate (higher = faster but less stable), batch size (larger = less noise, fewer steps) and momentum (higher = more inertia).
Related: Gradient descent, Optimizer, Momentum, Batch size, Learning rateLearn: Gradient descent, Multilayer Perceptrons and Backpropagation, Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR Schedules

SHAP (SHapley Additive exPlanations)

· Advanced

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.

Effect of changing it: Larger background dataset / more samples: more stable, representative attributions but slower (KernelSHAP especially). Smaller: fast but noisy, and a biased background shifts all explanations.
Related: Interpretability, Feature, Gradient boosting, Random forestLearn: Interpretability: Opening the Black BoxSource: A Unified Approach to Interpreting Model Predictions (2017)

Sigmoid (logistic function)

· Neural networks

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.

Related: Activation function, Logistic regression, Softmax, Vanishing (and exploding) gradient, LSTM (Long Short-Term Memory)Learn: Classification: logistic regression, kNN, SVM, Neurons and Activation Functions

Smoothing (EMA)

· Evaluation

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.

Effect of changing it: Higher α (0.9–0.99) → smoother curve, trend easier to see, but more lag and hidden spikes. Lower α (0–0.6) → closer to raw data, noisy. Around 0.6–0.9 is typical for per-step loss.
Related: Loss curve, TensorBoard, Training lossLearn: Reading Loss & Accuracy CurvesSource: TensorBoard

Softmax

· Neural networks

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.

Effect of changing it: Dividing logits by a temperature before softmax: higher temperature → flatter, more uniform probabilities; lower → sharper, closer to one-hot.
Related: Logits, Cross-entropy (log loss), Temperature, Attention, ClassificationLearn: Neurons and Activation Functions, Decoding: greedy, beam search, temperature, top-k, top-p, Mixture of Experts: Bigger Models at the Same Compute

Spectrogram

· Audio

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.

Effect of changing it: Window size trades frequency vs time resolution. Hop length sets frames per second: a larger hop gives shorter, cheaper sequences but may miss fast events; a smaller hop gives smoother, more redundant frames. Typical speech: 25 ms window, 10 ms hop (100 frames/s).
Related: Fast Fourier Transform (FFT), Mel spectrogram, Waveform, VocoderLearn: Audio Basics: From Sound Waves to SpectrogramsSource: librosa documentation — stft

Speculative decoding

· Advanced

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.

Effect of changing it: Longer draft (more proposed tokens): more speedup when acceptance is high, more wasted work when it is low. A better-matched draft model raises acceptance; benefits shrink at large batch sizes.
Related: Inference, Latency, KV cache, Large language model (LLM)Learn: Efficient Inference: Quantization, Distillation, Pruning and Faster DecodingSource: Fast Inference from Transformers via Speculative Decoding (2022)

Stride

· Deep learning

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.

Effect of changing it: Larger stride → smaller output (÷s per side), ≈ s² less compute, faster-growing receptive field, but fine detail is skipped. Stride 1 → full resolution and maximum cost.
Related: Convolution, Padding, Pooling, Receptive fieldLearn: Convolutional Neural Networks (CNNs)

Supervised learning

· Fundamentals

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.

Related: Label (target), Regression, Classification, Unsupervised learning, Semi-supervised learningLearn: Types of learningSource: An Introduction to Statistical Learning (2nd ed.) (2021)

Support vector machine (SVM)

· Classical ML

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.

Effect of changing it: C: higher → fewer margin violations allowed, narrower margin, risk of overfitting; lower → wider, more tolerant margin, smoother boundary. γ (RBF): higher → each point's influence is very local, wiggly boundaries, overfitting; lower → smoother, nearly linear boundary. Tune C and γ together on a log grid, after scaling features.
Related: Classification, Regularisation, Feature scaling (normalisation / standardisation), Logistic regressionLearn: Classification: logistic regression, kNN, SVMSource: Support-Vector Networks (1995)

System prompt

· LLM

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.

Related: Prompt, Prompt engineering, Agent (LLM agent)Learn: Prompting: zero-shot, few-shot, chain-of-thought, structured output, Agents & tool use: ReAct, function calling, MCP

Temperature

· LLM

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.

Effect of changing it: Higher → more diverse and creative but more errors and incoherence (above ~1.2 it degrades quickly). Lower → focused, consistent and repeatable, but can be bland or repetitive. Typical: 0–0.3 for code/extraction, 0.7–1.0 for chat and writing.
Related: Logits, Top-k sampling, Top-p (nucleus) sampling, SoftmaxLearn: Decoding: greedy, beam search, temperature, top-k, top-p

Tensor

· Fundamentals

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.

Related: Vector, Matrix, GPULearn: Math essentials for ML, The ML development stack

TensorBoard

· Evaluation

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.

Related: Experiment tracking, Loss curve, Smoothing (EMA), MLflowLearn: Experiment Logging & ReproducibilitySource: TensorBoard

Test set

· Fundamentals

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).

Effect of changing it: Typical size 10–20% (1% or less for millions of examples). Larger → more precise final estimate, less training data; smaller → a noisy final number.
Related: Training set, Validation set, Data leakageLearn: Data and features, Regression Metrics & Validation

Text-to-image

· Generative

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.

Effect of changing it: Main levers: prompt wording (specific subjects, style, lighting), guidance scale, sampling steps, sampler, seed, resolution (stay near the model's training size) and negative prompt.
Related: Latent diffusion, CLIP, Classifier-free guidance (CFG), Guidance scale (CFG scale), PromptLearn: Stable Diffusion in Practice, Video Generation, 3D: NeRF, Gaussian Splatting and Text-to-3D

Text-to-speech (TTS)

· Audio

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.

Effect of changing it: Common knobs: speaking rate (higher = faster, less clear), noise scale in VITS (higher = more expressive but less stable), and reference audio length for cloning (longer = closer voice match).
Related: Vocoder, WaveNet, Mel spectrogram, Neural audio codecLearn: Speech Synthesis: From Text to a Natural Voice

Throughput

· MLOps

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.

Effect of changing it: Larger batch size → higher throughput until GPU memory or compute saturates; more replicas scale throughput roughly linearly; very large batches stop helping and only add latency.
Related: Latency, Model serving, Batch inference, Batch size, GPULearn: Deployment & model serving

Token

· LLM

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.

Related: Tokenization, Byte-Pair Encoding (BPE), Vocabulary, Context window, EmbeddingLearn: Embeddings: Meaning as Vectors, Tokenization: how text becomes numbers, Music & Audio Generation: Codecs, Tokens and Diffusion, Multimodal LLMs (Vision-Language Models)

Tokenization

· LLM

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.

Related: Token, Byte-Pair Encoding (BPE), VocabularyLearn: Tokenization: how text becomes numbersSource: Neural Machine Translation of Rare Words with Subword Units (2016)

Tool use / function calling

· LLM

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.

Related: Agent (LLM agent), Large language model (LLM), RAG (Retrieval-Augmented Generation)Learn: Agents & tool use: ReAct, function calling, MCPSource: Toolformer: Language Models Can Teach Themselves to Use Tools (2023)

Top-k sampling

· LLM

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.

Effect of changing it: Larger k → more diversity and more risk of odd tokens (k = vocabulary size disables it). Smaller k → safer, more predictable; k = 1 equals greedy decoding. Typical: 40–50, or disabled when using top-p.
Related: Top-p (nucleus) sampling, Temperature, LogitsLearn: Decoding: greedy, beam search, temperature, top-k, top-pSource: Hierarchical Neural Story Generation (2018)

Top-p (nucleus) sampling

· LLM

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.

Effect of changing it: Higher p (→ 1.0) → more of the tail allowed: more diverse, more risky. Lower p → fewer candidates, more conservative; very low p behaves almost greedily. Typical: 0.9–0.95; tune temperature or top-p, not both aggressively.
Related: Top-k sampling, Temperature, LogitsLearn: Decoding: greedy, beam search, temperature, top-k, top-pSource: The Curious Case of Neural Text Degeneration (2020)

Training loss

· Evaluation

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.

Related: Validation loss, Loss curve, Loss function, Batch size, UnderfittingLearn: Reading Loss & Accuracy CurvesSource: Machine Learning Crash Course

Training set

· Fundamentals

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.

Effect of changing it: A larger training set reduces variance and lets you use more flexible models; a tiny one forces simple or heavily regularised models.
Related: Validation set, Test set, Data leakage, OverfittingLearn: Data and features, Regression Metrics & Validation, Monitoring, data drift & concept drift

Transfer learning

· Deep learning

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.

Effect of changing it: Freezing more layers → faster, less overfitting on small data, less adaptation. Higher fine-tuning LR → faster adaptation but risk of destroying pretrained features (catastrophic forgetting).
Related: Fine-tuning, Pretraining, ResNet (Residual Network), CNN (Convolutional Neural Network)Learn: CNN Architectures and Transfer LearningSource: How transferable are features in deep neural networks? (2014)

Transformer

· Deep learning

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).

Effect of changing it: More layers / larger d_model / larger d_ff → more capacity and better results with enough data, but parameters grow ≈ 12·d_model² per layer; longer context → attention cost ∝ n².
Related: Self-attention, Multi-head attention, Positional encoding, Layer normalization, Encoder, Decoder, Large language model (LLM)Learn: Attention and Transformers, Vision Transformers and CLIP, Mixture of Experts: Bigger Models at the Same ComputeSource: Attention Is All You Need (2017)

U-Net

· Generative

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).

Related: CNN (Convolutional Neural Network), Diffusion model, Diffusion Transformer (DiT), Latent diffusionLearn: Diffusion Models: From Noise to Image, Video GenerationSource: U-Net: Convolutional Networks for Biomedical Image Segmentation (2015)

Underfitting

· Fundamentals

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.

Related: Overfitting, Bias-variance trade-off, Model, RegularisationLearn: Overfitting and the bias-variance trade-off, Training Hyperparameters: Epochs, Learning Rate, Batch Size and More, Reading Loss & Accuracy Curves

Unsupervised learning

· Fundamentals

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.

Related: Clustering, k-means, Principal component analysis (PCA), Supervised learning, AutoencoderLearn: Types of learning, Clustering and PCA

Validation loss

· Evaluation

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.

Related: Training loss, Validation set, Early stopping, Overfitting, CheckpointLearn: Reading Loss & Accuracy CurvesSource: Machine Learning Crash Course

Validation set

· Fundamentals

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.

Effect of changing it: A bigger validation set gives more reliable comparisons but leaves less data for training; a tiny one makes differences of a few percent indistinguishable from luck.
Related: Training set, Test set, Cross-validation, Early stopping, Hyperparameter tuningLearn: Data and features, Overfitting and the bias-variance trade-off, Regression Metrics & Validation, Hyperparameter Tuning

Value function

· Reinforcement learning

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.

Related: Q-learning, Policy, Discount factor (γ), Markov decision process (MDP)Learn: Reinforcement Learning Basics: Agents, Rewards and Q-learning, Deep Reinforcement Learning: DQN, Policy Gradients and PPO

Vanishing (and exploding) gradient

· Neural networks

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.

Related: Backpropagation, Sigmoid (logistic function), ReLU (Rectified Linear Unit), ResNet (Residual Network), LSTM (Long Short-Term Memory), Gradient clippingLearn: Neurons and Activation Functions, Recurrent Networks: RNN, LSTM and GRUSource: On the difficulty of training Recurrent Neural Networks (2013)

Variational autoencoder (VAE)

· Generative

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.

Effect of changing it: β (KL weight): higher → smoother, more disentangled latents but blurrier outputs (posterior collapse if extreme); lower → sharper reconstructions but a gappier space that samples worse.
Related: Autoencoder, Latent space, Generative model, Latent diffusionLearn: Generative Models: The Big Picture, Speech Synthesis: From Text to a Natural VoiceSource: Auto-Encoding Variational Bayes (2013)

Vector

· Fundamentals

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.

Related: Dot product, Matrix, Tensor, Embedding, Cosine similarityLearn: Math essentials for ML, Embeddings: Meaning as VectorsSource: Dive into Deep Learning — 2.3 Linear Algebra

Vector database

· LLM

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.

Effect of changing it: Higher ANN search effort (e.g. HNSW ef_search, more IVF probes) → better recall, slower queries. Lower → faster but some true nearest neighbours are missed.
Related: RAG (Retrieval-Augmented Generation), Embedding, Cosine similarity, ChunkingLearn: Retrieval-Augmented Generation (RAG)Source: Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs (2016)

Video diffusion

· Multimodal

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.

Effect of changing it: num_frames: more → longer clips but more memory and consistency breaks beyond the trained length. Motion strength (e.g. SVD's motion_bucket_id): higher → more movement but more warping; lower → stable but nearly static. Noise augmentation of the input image: higher → more motion, less faithful first frame.
Related: Diffusion model, Latent diffusion, Diffusion Transformer (DiT), U-Net, MultimodalLearn: Video GenerationSource: Video Diffusion Models (2022)

Vision Transformer (ViT)

· Multimodal

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.

Effect of changing it: Patch size: smaller → more tokens, finer detail, quadratically more attention compute; larger → cheaper but coarser. Input resolution: higher → better for small objects and text, but token count and cost grow quickly.
Related: Transformer, Self-attention, CLIP, CNN (Convolutional Neural Network), Diffusion Transformer (DiT)Learn: Vision Transformers and CLIP, Multimodal LLMs (Vision-Language Models)Source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (2020)

Vision-language model (VLM)

· Multimodal

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.

Effect of changing it: Image resolution / visual-token count: higher → better OCR and small details but more context used and slower; lower → cheaper but details get hallucinated. Decoding temperature: lower → more factual descriptions; higher → more creative and more hallucination.
Related: Multimodal, CLIP, Vision Transformer (ViT), Large language model (LLM), Instruction tuning, HallucinationLearn: Multimodal LLMs (Vision-Language Models)Source: Visual Instruction Tuning (2023)

Vocabulary

· LLM

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.

Effect of changing it: Larger vocabulary → fewer tokens per text (cheaper, more fits in context) but bigger embedding/output matrices and under-trained rare tokens. Smaller vocabulary → longer sequences and more compute per text.
Related: Token, Tokenization, Byte-Pair Encoding (BPE), EmbeddingLearn: Tokenization: how text becomes numbers

Vocoder

· Audio

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.

Related: Text-to-speech (TTS), WaveNet, Mel spectrogram, Generative adversarial network (GAN)Learn: Speech Synthesis: From Text to a Natural VoiceSource: HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis (2020)

Waveform

· Audio

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.

Related: Sample rate, Spectrogram, Fast Fourier Transform (FFT)Learn: Audio Basics: From Sound Waves to Spectrograms

WaveNet

· Audio

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.

Related: Vocoder, Text-to-speech (TTS), Convolution, Receptive fieldLearn: Speech Synthesis: From Text to a Natural VoiceSource: WaveNet: A Generative Model for Raw Audio (2016)

Weight decay

· Neural networks

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.

Effect of changing it: Higher λ → smaller weights, smoother functions, less overfitting; too high → underfitting (predictions flatten). Lower → more freedom to fit noise. Typical: SGD 1e-4–5e-4; AdamW 0.01–0.1.
Related: Regularisation, Adam / AdamW, Overfitting, DropoutLearn: Optimizers: SGD, Momentum, RMSProp, Adam/AdamW and LR Schedules, Regularization, Normalization and InitializationSource: Decoupled Weight Decay Regularization (2017)

Weight initialization

· Neural networks

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.

Effect of changing it: Scale too large → activations/gradients explode (NaN); too small → they vanish and learning stalls; all-equal values → units never differentiate.
Related: Vanishing (and exploding) gradient, ReLU (Rectified Linear Unit), Batch normalization, ParameterLearn: Multilayer Perceptrons and Backpropagation, Regularization, Normalization and InitializationSource: Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification (2015)

Whisper

· Audio

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.

Effect of changing it: Larger model sizes (tiny → large): lower WER, especially for non-English, but slower and more VRAM. Beam size up: slightly better accuracy, more compute. Setting the language explicitly avoids wrong-language output.
Related: Automatic speech recognition (ASR), Word error rate (WER), Mel spectrogram, TransformerLearn: Speech Recognition: CTC, wav2vec 2.0 and WhisperSource: Robust Speech Recognition via Large-Scale Weak Supervision (2022)

Word error rate (WER)

· Audio

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.

Related: Automatic speech recognition (ASR), Whisper, EvalsLearn: Speech Recognition: CTC, wav2vec 2.0 and Whisper

word2vec

· Deep learning

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).

Effect of changing it: Larger window → more topical similarity; smaller → more syntactic/functional similarity. More negative samples → better vectors on small corpora, slower. Higher dimension → more expressive, needs more data.
Related: Embedding, Cosine similarity, Self-supervised learning, VectorLearn: Embeddings: Meaning as VectorsSource: Efficient Estimation of Word Representations in Vector Space (2013)

Zero-shot

· LLM

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.

Related: Few-shot prompting, In-context learning, Instruction tuning, PromptLearn: Prompting: zero-shot, few-shot, chain-of-thought, structured output, Vision Transformers and CLIP

ε-greedy

· Reinforcement learning

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.

Effect of changing it: Higher ε: more exploration, finds better paths and escapes bad habits, but earns less reward during training and wanders into hazards. Lower ε: exploits current knowledge; too low early can lock the agent into a suboptimal policy forever. Typical: decay from 1.0 to 0.01–0.1.
Related: Exploration–exploitation trade-off, Q-learning, PolicyLearn: Reinforcement Learning Basics: Agents, Rewards and Q-learning