Transformer Math & CPU SLM

Transformer Math & CPU SLM

Linear algebra, attention math, training, CPU inference, weight storage — depth-first.

406Articles
406Topics covered
Articles in this category

All 406 articles, sorted alphabetically

Advertisement
ARTICLE · 01

The Autoregressive Generation Loop

How an LLM produces text, one token at a time.

Read article
ARTICLE · 02

Backpropagation Through Transformers

How gradients flow back through the network — chain rule applied.

Read article
ARTICLE · 03

Beam Search

Sometimes greedy isn't enough.

Read article
ARTICLE · 04

The Complete Transformer Block

All the pieces assembled with pseudocode.

Read article
ARTICLE · 05

CPU Cache Hierarchy and Transformer Inference

Why memory bandwidth is the SLM CPU inference bottleneck.

Read article
ARTICLE · 06

CPU Inference Pipelines

The software stacks that make SLM CPU inference fast.

Read article
ARTICLE · 07

CPU Matmul Kernels and BLAS

Why your transformer is 10× faster than a naive Python loop.

Read article
ARTICLE · 08

CPU Memory Budget for SLM Training

Counting every byte: weights, gradients, optimizer, activations.

Read article
ARTICLE · 09

Cross-Entropy Loss for Next-Token Prediction

What loss to minimize and why the gradient is so clean.

Read article
ARTICLE · 10

Dataloader and Tokenization Pipeline

Streaming data efficiently to the training loop.

Read article
ARTICLE · 11

The Geometry of Dot Products

How attention measures similarity in embedding space.

Read article
ARTICLE · 12

End-to-End CPU SLM Recipe

From scratch: train and serve a small model on a workstation.

Read article
ARTICLE · 13

Feed-Forward Network

Two-thirds of model params live here. Worth understanding.

Read article
ARTICLE · 14

Fine-Tuning Math

How to adapt without retraining the whole model.

Read article
ARTICLE · 15

FlashAttention

Same math, very different memory pattern.

Read article
ARTICLE · 16

Gradient Accumulation

Effective large batches on small memory.

Read article
ARTICLE · 17

Gradient Clipping and Training Stability

Stopping spikes from blowing up training.

Read article
ARTICLE · 18

KV Cache

Why and how to cache keys and values.

Read article
ARTICLE · 19

KV Cache Quantization Deep Dive

Compress the biggest memory hog at inference.

Read article
ARTICLE · 20

LayerNorm

How LayerNorm stabilizes activations.

Read article
ARTICLE · 21

Learning Rate Schedules

Why LR changes during training and the canonical curves.

Read article
ARTICLE · 22

Linear Algebra for Transformers

Vectors, matrices, and operations you actually need.

Read article
ARTICLE · 23

Long Context Strategies

How models handle 128K, 1M tokens.

Read article
ARTICLE · 24

Diagnosing Loss Curves

What healthy vs unhealthy training looks like.

Read article
ARTICLE · 25

Mixed Precision Training

Half-precision for speed; full precision for stability.

Read article
ARTICLE · 26

Mixture of Experts

Active params vs total params, and what MoE means for CPU inference.

Read article
ARTICLE · 27

Multi-Head Attention

Why split into heads and how the math reassembles.

Read article
ARTICLE · 28

Multi-Token Prediction (MTP)

Predict the next 2-4 tokens at once for free speed.

Read article
ARTICLE · 29

Output Projection and Logits

From final hidden state to next-token probabilities.

Read article
ARTICLE · 30

Perplexity and Evaluation Metrics

How to measure if your model is any good.

Read article
ARTICLE · 31

Positional Encoding

How transformers know which token is where.

Read article
ARTICLE · 32

Quantization Layouts in Memory

Block-wise scaling, packed INT4, and the layout-vs-quality trade.

Read article
ARTICLE · 33

Residual Connections and Gradient Flow

Why every transformer block adds the input back.

Read article
ARTICLE · 34

RLHF and DPO

From a pretrained model to a useful assistant.

Read article
ARTICLE · 35

RMSNorm

Why everyone moved away from LayerNorm.

Read article
ARTICLE · 36

Extending RoPE to Longer Contexts

YaRN, NTK-aware scaling, and LongRope.

Read article
ARTICLE · 37

Sampling Strategies

How to pick the next token from the model's distribution.

Read article
ARTICLE · 38

Scaled Dot-Product Attention

The math of the attention operation.

Read article
ARTICLE · 39

SGD vs Adam vs AdamW Optimizer Math

The update rules — and why Adam dominates LLM training.

Read article
ARTICLE · 40

SIMD Instructions for Transformer Math

AVX-512, AMX, and how they vectorize matmul.

Read article
ARTICLE · 41

SLM Architectures

Hyperparams of the leading sub-7B models.

Read article
ARTICLE · 42

Softmax Derivation

Why softmax, what it preserves, and how temperature changes it.

Read article
ARTICLE · 43

Speculative Decoding

Use a fast draft model; verify with the big model.

Read article
ARTICLE · 44

The Future of CPU SLM in 2026 and Beyond

Where this is headed.

Read article
ARTICLE · 45

Tied Embeddings and Parameter Sharing

Why SLMs share weights between input embedding and output projection.

Read article
ARTICLE · 46

3D Parallelism

Combine DP, TP, PP for scale.

Read article
ARTICLE · 47

Ablation Study Math

Ablation studies in LLM research.

Read article
ARTICLE · 48

Beyond ReLU

Comparison of activation functions in modern LLMs.

Read article
ARTICLE · 49

Activation Checkpointing Math

Trade compute for memory via activation recomputation.

Read article
ARTICLE · 50

Activation checkpointing architecture

Deep-dive on activation (gradient) checkpointing: why activations dominate training memory, how the forward pass saves only segment boundaries and dro…

Read article
ARTICLE · 51

Activation Memory Math

Calculating activation memory in transformers.

Read article
ARTICLE · 52

Activation Patching

Patch activations to test causal role.

Read article
ARTICLE · 53

Activation Quantization

Activation quantization challenges + techniques.

Read article
ARTICLE · 54

Activation Recomputation Math

Math of activation recomputation trade-off.

Read article
ARTICLE · 55

Activation Scaling

Scaling activation variance in transformers.

Read article
ARTICLE · 56

Adafactor

Adafactor: factored second moment for memory savings.

Read article
ARTICLE · 57

Adam and AdamW -- the optimizer that trains transformers

Deep-dive on Adam and AdamW: the single-learning-rate limitation, momentum (first moment, smoothed gradient), adaptive per-parameter scaling (second m…

Read article
ARTICLE · 58

AdamW Math Deep Dive

AdamW: Adam with decoupled weight decay.

Read article
ARTICLE · 59

Adapter Theory

Adapter layers: bottleneck insertions.

Read article
ARTICLE · 60

Adaptive RAG

Route queries to different RAG strategies.

Read article
ARTICLE · 61

Admission Control Math

Admission control math for LLM serving.

Read article
ARTICLE · 62

Agent Scaling Laws

Scaling laws for agent capability.

Read article
ARTICLE · 63

ALiBi

Math of ALiBi position encoding.

Read article
ARTICLE · 64

Alignment Tax Math

Alignment tax in RLHF.

Read article
ARTICLE · 65

Annoy

Annoy: tree-based ANN.

Read article
ARTICLE · 66

MongoDB Atlas Vector Search

MongoDB Atlas: vector search.

Read article
ARTICLE · 67

Attention compute and memory -- the quadratic cost of context

Deep-dive on attention compute and memory: the O(N^2) QK^T attention matrix, quadratic compute and memory, the attention-vs-FFN FLOPs breakdown, compu…

Read article
ARTICLE · 68

Attention Math

The mathematical foundation of attention: query-key similarity produces weights over values, which get summed into output.

Read article
ARTICLE · 69

Attention variants architecture

Architecture deep-dive on attention variants: the control-plane and eval harness that let you pick per layer against a serving budget.

Read article
ARTICLE · 70

AWQ Math

AWQ: Activation-aware Weight Quantization.

Read article
ARTICLE · 71

Backpressure Math

Backpressure math for LLM serving.

Read article
ARTICLE · 72

Backprop architecture

Deep-dive on backpropagation in transformer training: chain rule, gradient accumulation, activation checkpointing, fused kernels.

Read article
ARTICLE · 73

Bandwidth-Bound Operations

Identifying bandwidth-bound ops in LLM.

Read article
ARTICLE · 74

Batched GEMM Math

Batched matrix multiplication math.

Read article
ARTICLE · 75

Batch Size Math for LLM Training

How to choose LLM training batch size.

Read article
ARTICLE · 76

Beam Search Math

Beam search: track K best sequences.

Read article
ARTICLE · 77

BF16 Training

BF16 training: 8-bit exponent, 7-bit mantissa.

Read article
ARTICLE · 78

BGE Embeddings Math

BGE: BAAI general embeddings.

Read article
ARTICLE · 79

Bio Capability Evals

LLM biosecurity capability eval.

Read article
ARTICLE · 80

BitFit Theory

BitFit: fine-tune only biases.

Read article
ARTICLE · 81

bitsandbytes int8 Quantization

bitsandbytes: LLM.int8() implementation.

Read article
ARTICLE · 82

Bottleneck Theory of Deep Learning

Information bottleneck theory for deep nets.

Read article
ARTICLE · 83

Byte-Pair Encoding Deep Dive

BPE tokenization deep dive.

Read article
ARTICLE · 84

Blockwise Parallel Transformer

BPT: block-parallel transformer for long context.

Read article
ARTICLE · 85

Capability Evaluation Overview

Math + methodology of LLM capability evals.

Read article
ARTICLE · 86

Capability Transitions in Training

How capabilities transition during training.

Read article
ARTICLE · 87

Causal Tracing

Trace causal roles across layers.

Read article
ARTICLE · 88

Classifier-Free Guidance (CFG)

CFG: guidance without separate classifier.

Read article
ARTICLE · 89

Chinchilla Scaling Law

Chinchilla: compute-optimal ratio between params and data.

Read article
ARTICLE · 90

Chinchilla Scaling

Chinchilla scaling law math.

Read article
ARTICLE · 91

Chroma Math + Architecture

Chroma: developer-friendly vector DB.

Read article
ARTICLE · 92

Chunked Prefill

Chunked prefill deep dive.

Read article
ARTICLE · 93

Circuit Analysis

Reverse-engineer neural network circuits.

Read article
ARTICLE · 94

Classifier Guidance Math

Classifier-guided diffusion sampling.

Read article
ARTICLE · 95

Coding Capability Evals

LLM coding capability eval.

Read article
ARTICLE · 96

ColBERT Math

ColBERT: late-interaction retrieval.

Read article
ARTICLE · 97

Communication Math for Distributed Training

How to estimate communication volume + time.

Read article
ARTICLE · 98

Compute-Bound Operations

Compute-bound: dominated by FLOPs.

Read article
ARTICLE · 99

Compute-Optimal Training

Choosing model size + tokens under compute budget.

Read article
ARTICLE · 100

Compute-Optimal Training

Compute-optimal training math.

Read article
ARTICLE · 101

Constitutional AI Math

Constitutional AI (CAI) math.

Read article
ARTICLE · 102

Context Length Extension Math

Extending context length after pretraining.

Read article
ARTICLE · 103

Contextual RAG Math

Contextual retrieval: chunk with doc context.

Read article
ARTICLE · 104

Continuous Batching Math

Math of continuous batching.

Read article
ARTICLE · 105

Contrastive Search

Contrastive search: penalize repetition + degeneration.

Read article
ARTICLE · 106

Corrective RAG (CRAG)

CRAG: evaluate + correct retrieved documents.

Read article
ARTICLE · 107

CPU Offload Math

Math of CPU offload for LLM.

Read article
ARTICLE · 108

Cross-entropy loss architecture

Deep-dive on cross-entropy for language models: the maximum-likelihood reading and the softmax-minus-onehot gradient, log-sum-exp stability in half pr…

Read article
ARTICLE · 109

Cyber Capability Evals

LLM cybersecurity capability eval.

Read article
ARTICLE · 110

Dangerous Capability Evaluations

Evals for dangerous frontier capabilities.

Read article
ARTICLE · 111

Training Data Filtering

Filtering pretraining data.

Read article
ARTICLE · 112

Training Data Mixing

Data domain mixing for training.

Read article
ARTICLE · 113

Data Quality Math

Data quality effects on training.

Read article
ARTICLE · 114

Data Quality Scaling

How data quality affects scaling.

Read article
ARTICLE · 115

Data Scaling for LLMs

How training data scales with model + quality.

Read article
ARTICLE · 116

DDIM

DDIM: deterministic accelerated diffusion sampling.

Read article
ARTICLE · 117

DDP Math

DDP: data-parallel training math.

Read article
ARTICLE · 118

DDPM

DDPM: original diffusion model math.

Read article
ARTICLE · 119

Deception Capability Evals

Evaluate LLM deceptive capabilities.

Read article
ARTICLE · 120

DeepMind Scaling Law Series

DeepMind's scaling law contributions.

Read article
ARTICLE · 121

Dense Retrieval Math

Bi-encoder dense retrieval math.

Read article
ARTICLE · 122

Depth Scaling

Scaling model depth: layers.

Read article
ARTICLE · 123

Dictionary Learning for NN

Dictionary learning: sparse feature representation.

Read article
ARTICLE · 124

DoRA

DoRA: LoRA that decomposes weights into magnitude + direction.

Read article
ARTICLE · 125

DoRA Theory

Weight-Decomposed LoRA theoretical foundation.

Read article
ARTICLE · 126

Double Descent

Double descent: test error re-descends past interpolation threshold.

Read article
ARTICLE · 127

Double Descent Deep Dive

Double descent: test error re-descent past interpolation.

Read article
ARTICLE · 128

DPM-Solver Sampling

DPM-Solver: high-order diffusion ODE solver.

Read article
ARTICLE · 129

DPO Math

Direct Preference Optimization math.

Read article
ARTICLE · 130

DyT

Math of Dynamic Tanh (DyT) as attention normalization alternative.

Read article
ARTICLE · 131

E5 Embeddings Math

E5: Microsoft's embedding family.

Read article
ARTICLE · 132

EAGLE Speculative Decoding

EAGLE speculative decoding.

Read article
ARTICLE · 133

EAGLE

Math of EAGLE speculative decoding variant.

Read article
ARTICLE · 134

EDM

Karras et al.: modular diffusion framework.

Read article
ARTICLE · 135

Effective Batch Size

Effective batch = per-device * world * grad-accum.

Read article
ARTICLE · 136

Elasticsearch Vector Search

Elasticsearch KNN + vector search.

Read article
ARTICLE · 137

Embeddings -- turning tokens into vectors

Deep-dive on transformer embeddings: token embeddings as a lookup into the embedding matrix (vocab x d_model), learned representations and embedding-s…

Read article
ARTICLE · 138

Emergent Capabilities Deep Dive

Emergent capabilities in LLMs.

Read article
ARTICLE · 139

Emergent Abilities in LLMs

How abilities emerge with scale.

Read article
ARTICLE · 140

Emergent Abilities Math

Emergent abilities in LLMs.

Read article
ARTICLE · 141

EP Math

Expert parallelism: distribute MoE experts across GPUs.

Read article
ARTICLE · 142

Expert Choice Routing

Expert choice routing.

Read article
ARTICLE · 143

Expert Parallel Math Deep

Expert parallel math for MoE.

Read article
ARTICLE · 144

Faiss Math

Faiss: Facebook's ANN library.

Read article
ARTICLE · 145

Feature Disentanglement

Separating polysemantic features.

Read article
ARTICLE · 146

Transformer Math: Big Picture

Big picture of transformer math.

Read article
ARTICLE · 147

Fine-Tuning Scaling

Fine-tuning scaling: data + compute laws.

Read article
ARTICLE · 148

FlashAttention

How FlashAttention rewrites attention to tile through GPU SRAM, avoiding O(N²) HBM traffic.

Read article
ARTICLE · 149

FlashAttention-2

FlashAttention-2 improvements over v1: better parallelism, fewer non-matmul ops.

Read article
ARTICLE · 150

Flash Attention Architecture in Depth

A 2500-word walkthrough of Flash Attention: IO-aware tiling, online softmax, rescale-accumulate, causal mask fusion, FA2/FA3, and integration.

Read article
ARTICLE · 151

Flash Attention Math Deep Dive

Flash Attention memory + compute math.

Read article
ARTICLE · 152

Flow Matching

Flow matching: learn ODEs instead of SDEs.

Read article
ARTICLE · 153

FP4 Quantization

FP4: 4-bit floating point quantization.

Read article
ARTICLE · 154

FP4 Training on Blackwell

FP4 training: 4-bit float on Blackwell GPUs.

Read article
ARTICLE · 155

FP8 Training on H100+ Hardware

FP8 training: E4M3 + E5M2 formats.

Read article
ARTICLE · 156

FSDP Math

FSDP: shard model across GPUs to reduce per-GPU memory.

Read article
ARTICLE · 157

Full FT vs PEFT Trade-offs

Full fine-tuning vs PEFT trade-offs.

Read article
ARTICLE · 158

Fusion RAG

Fuse multiple retrieval sources.

Read article
ARTICLE · 159

Game Theory for LLM Agents

Game theory applied to LLM agents.

Read article
ARTICLE · 160

Activation function architecture

Deep-dive on activation functions in transformers: ReLU family, GELU, SiLU, SwiGLU/GeGLU, approximations, numerics, kernel fusion.

Read article
ARTICLE · 161

GGUF Format Deep Dive

GGUF: llama.cpp quantization format.

Read article
ARTICLE · 162

Distillation Math

Math of knowledge distillation from teacher to student LLMs.

Read article
ARTICLE · 163

GLU FFN

Math of Gated Linear Units in feed-forward networks.

Read article
ARTICLE · 164

GPTQ Math

GPTQ: post-training quantization via error correction.

Read article
ARTICLE · 165

GQA Math

Deep math of grouped-query attention.

Read article
ARTICLE · 166

Gradient Accumulation Math

Gradient accumulation: virtual batch size.

Read article
ARTICLE · 167

Gradient Checkpointing Math

Math of gradient checkpointing.

Read article
ARTICLE · 168

Gradient Clipping for LLM Training

Gradient clipping strategies.

Read article
ARTICLE · 169

Gradient clipping architecture

Deep-dive on gradient clipping: why deep and recurrent networks explode gradients and NaN out runs, the clip-by-global-norm algorithm and how it prese…

Read article
ARTICLE · 170

Gradient Memory Math

Gradient memory in training.

Read article
ARTICLE · 171

Graph RAG Math

Graph-augmented RAG.

Read article
ARTICLE · 172

Grokking

Grokking: model suddenly generalizes after long overfitting.

Read article
ARTICLE · 173

Grokking Deep Dive

Grokking: delayed generalization phenomenon.

Read article
ARTICLE · 174

Grokking Math

Grokking phenomenon in neural nets.

Read article
ARTICLE · 175

Grouped Query Attention (GQA)

How GQA and MQA reduce KV cache memory by sharing keys/values across query heads.

Read article
ARTICLE · 176

GTE Embeddings Math

GTE: Alibaba embeddings.

Read article
ARTICLE · 177

Guided Generation Math

Constrained decoding via grammar / regex.

Read article
ARTICLE · 178

HNSW Math

Hierarchical Navigable Small World graphs.

Read article
ARTICLE · 179

Hoffmann Chinchilla Paper

Chinchilla paper 2022 details.

Read article
ARTICLE · 180

Hybrid Architectures

Hybrid models combining attention + SSM layers.

Read article
ARTICLE · 181

Hybrid Parallelism Math

Combine multiple parallelism axes.

Read article
ARTICLE · 182

Hybrid Retrieval Math

Hybrid: fuse dense + sparse.

Read article
ARTICLE · 183

HyDE Math

Hypothetical Document Embeddings.

Read article
ARTICLE · 184

Hyena

Hyena: long convolutions replacing attention.

Read article
ARTICLE · 185

Hyena Hierarchy Math

Hyena hierarchy math.

Read article
ARTICLE · 186

IA3 Theory

IA3: multiplicative adapters.

Read article
ARTICLE · 187

Inference-Optimal Training

Inference-optimal training math.

Read article
ARTICLE · 188

Inference-Time Scaling Laws

Scaling capability via more inference compute.

Read article
ARTICLE · 189

In-Flight Batching

In-flight batching in TRT-LLM.

Read article
ARTICLE · 190

Information Bottleneck Method

IB method: trade compression vs prediction.

Read article
ARTICLE · 191

Initialization Scaling

Init variance scaling with model size.

Read article
ARTICLE · 192

Mechanistic Interpretability Overview

Math foundations of mechanistic interpretability.

Read article
ARTICLE · 193

Iteration-Level Scheduling

Iteration-level scheduling math.

Read article
ARTICLE · 194

Kaplan Scaling Laws (2020)

Original Kaplan scaling laws vs Chinchilla revisions.

Read article
ARTICLE · 195

Kaplan Scaling Laws Deep Dive

Kaplan 2020 scaling laws in detail.

Read article
ARTICLE · 196

KTO Math

Kahneman-Tversky Optimization.

Read article
ARTICLE · 197

KV Cache

How KV caching speeds up autoregressive generation by storing computed keys and values, and the memory cost.

Read article
ARTICLE · 198

KV cache math architecture

Deep-dive on KV cache math: layers, heads, dim, tokens, dtype, K+V multiplier, GQA scaling, paging, capacity planning.

Read article
ARTICLE · 199

KV Cache Deep Dive

Deep dive on KV cache math.

Read article
ARTICLE · 200

KV Cache Compression

Compressing KV cache for long context.

Read article
ARTICLE · 201

KV Cache Quantization

Math of quantized KV cache for long context serving.

Read article
ARTICLE · 202

KV Cache Quantization

Quantizing KV cache for memory savings.

Read article
ARTICLE · 203

Label smoothing architecture

Deep-dive on label smoothing: why one-hot cross-entropy causes runaway logits and overconfidence, the 1-ε soft target and its gradient, the calibratio…

Read article
ARTICLE · 204

Layer-wise LR Decay

Different LR per layer: layer-wise decay.

Read article
ARTICLE · 205

Layer Normalization

How layer norm normalizes across features per token, why it's used instead of batch norm, and pre-norm vs post-norm placement.

Read article
ARTICLE · 206

LayerNorm vs RMSNorm architecture

Deep-dive on LayerNorm vs RMSNorm: math, gain/bias, numerics, kernel fusion, pre-norm vs post-norm placement.

Read article
ARTICLE · 207

Learning Rate Math for LLM

How to choose LR for LLM training.

Read article
ARTICLE · 208

Learning-rate schedules

Deep-dive on learning-rate schedules for transformer training: why warmup stabilizes adaptive optimizers, cosine vs inverse-sqrt vs linear decay, how …

Read article
ARTICLE · 209

Linear Attention

Linear attention: kernel + feature-map approaches.

Read article
ARTICLE · 210

Linear Attention Math

Linear attention variants.

Read article
ARTICLE · 211

Lion Optimizer Math

Lion: sign-based optimizer discovered by search.

Read article
ARTICLE · 212

LLM Inference Architecture: The Full Pipeline in Depth

A 2500-word walkthrough of a modern LLM inference architecture: client, gateway, admission, scheduler, prefill, decode, paged KV cache, model shards, …

Read article
ARTICLE · 213

LLM.int8() Paper Math

LLM.int8() paper details.

Read article
ARTICLE · 214

Lookahead Decoding

Lookahead decoding for training-free speedup.

Read article
ARTICLE · 215

LoRA

Mathematics of Low-Rank Adaptation.

Read article
ARTICLE · 216

LoRA Theory

Low-Rank Adaptation theoretical foundation.

Read article
ARTICLE · 217

Loss Curves

How to read and diagnose LLM training loss curves.

Read article
ARTICLE · 218

Loss Scaling for fp16 Training

Loss scaling: prevent fp16 gradient underflow.

Read article
ARTICLE · 219

Lottery Ticket Hypothesis

LTH: dense networks contain sparse trainable subnetworks.

Read article
ARTICLE · 220

Lottery Ticket Hypothesis Deep Dive

LTH: sparse subnets train to full accuracy.

Read article
ARTICLE · 221

Lottery Ticket Hypothesis

Lottery ticket hypothesis math.

Read article
ARTICLE · 222

Learning Rate Schedules for LLM

LR schedules: warmup + decay strategies.

Read article
ARTICLE · 223

Learning Rate Transfer

Transferring LR across model sizes.

Read article
ARTICLE · 224

Mamba SSM Math

Mamba state space model math.

Read article
ARTICLE · 225

Math Capability Evals

LLM math capability eval.

Read article
ARTICLE · 226

Matmul Arithmetic Intensity

Arithmetic intensity of matmul.

Read article
ARTICLE · 227

Matryoshka Embeddings

Matryoshka Representation Learning.

Read article
ARTICLE · 228

Medusa Speculative Heads

Medusa multi-head speculative decoding.

Read article
ARTICLE · 229

Medusa

Math of Medusa multi-head speculative decoding.

Read article
ARTICLE · 230

LLM Memory Math

How to compute LLM training memory.

Read article
ARTICLE · 231

Mesa-Optimization

Mesa-optimizers: learned optimization within models.

Read article
ARTICLE · 232

Micro-Batch Size Selection

Choosing micro-batch size for memory + throughput.

Read article
ARTICLE · 233

Milvus Math + Architecture

Milvus: enterprise open-source vector DB.

Read article
ARTICLE · 234

Min-P Sampling

Min-p: filter tokens below min probability threshold.

Read article
ARTICLE · 235

Mirostat Sampling

Mirostat: control perplexity dynamically.

Read article
ARTICLE · 236

Mixed Precision Training

Mixed precision: fp16/bf16 compute + fp32 master weights.

Read article
ARTICLE · 237

Mixed-precision training math

Deep-dive on mixed-precision transformer training: fp16 vs bf16 exponent/mantissa trade-offs, fp32 master weights, dynamic loss scaling, precision isl…

Read article
ARTICLE · 238

Mixture of Experts Math

Mixture of experts architecture math.

Read article
ARTICLE · 239

MoE math architecture

Deep-dive on MoE math: total vs active parameters, compute per token, capacity factor, drop rate, load balance loss, scaling.

Read article
ARTICLE · 240

MQA Math

Deep math of multi-query attention.

Read article
ARTICLE · 241

Multi-Agent Communication

Communication protocols between LLM agents.

Read article
ARTICLE · 242

Multi-Agent Coordination

Coordination mechanisms in multi-agent.

Read article
ARTICLE · 243

Multi-Agent Debate

Multi-agent debate for reasoning.

Read article
ARTICLE · 244

Multi-Agent Emergence

Emergent behavior in multi-agent systems.

Read article
ARTICLE · 245

Multi-Agent Negotiation

Negotiation between LLM agents.

Read article
ARTICLE · 246

Multi-Agent Planning

Planning in multi-agent systems.

Read article
ARTICLE · 247

Multi-Agent Reflection

Reflection in multi-agent systems.

Read article
ARTICLE · 248

Multi-Agent Shared Memory

Shared memory + blackboard patterns.

Read article
ARTICLE · 249

Multi-Agent System Theory

Multi-agent system theoretical foundation.

Read article
ARTICLE · 250

Multi-Hop RAG

Multi-hop retrieval + reasoning.

Read article
ARTICLE · 251

Multi-Head Attention

Why transformers use multiple attention heads instead of one big attention, and how heads specialize.

Read article
ARTICLE · 252

Multilingual Scaling

How languages scale together.

Read article
ARTICLE · 253

Multilingual Tokenization

Multilingual tokenization challenges.

Read article
ARTICLE · 254

Multimodal Scaling

How multimodal (vision + audio) scale.

Read article
ARTICLE · 255

Muon Optimizer

Muon: Newton-Schulz orthogonalization + momentum.

Read article
ARTICLE · 256

Muon optimizer architecture

Deep-dive on the Muon optimizer: momentum, orthogonalizing 2D weight updates toward U V^T, the quintic Newton-Schulz iteration, RMS-to-RMS shape scali…

Read article
ARTICLE · 257

muP

muP: parameterize models so hyperparameters transfer across sizes.

Read article
ARTICLE · 258

Neural Scaling Law Theory

Theoretical foundations of neural scaling laws.

Read article
ARTICLE · 259

Neural Tangent Kernel

NTK: theory linking neural networks to kernel methods.

Read article
ARTICLE · 260

Neural Tangent Kernel

Neural tangent kernel theory.

Read article
ARTICLE · 261

NTK-Aware Interpolation

NTK-aware position scaling.

Read article
ARTICLE · 262

NVMe Offload Math

Math of NVMe offload.

Read article
ARTICLE · 263

Offload Math

Math of memory offload.

Read article
ARTICLE · 264

OpenAI Scaling Law Contributions

OpenAI's scaling law papers.

Read article
ARTICLE · 265

OpenSearch Vector Search

OpenSearch KNN plugin.

Read article
ARTICLE · 266

Optimized Product Quantization

OPQ: rotation-optimized PQ.

Read article
ARTICLE · 267

Optimizer State Offload Math

Math of optimizer state offload.

Read article
ARTICLE · 268

Optimizer State Memory Math

Optimizer state memory: Adam vs alternatives.

Read article
ARTICLE · 269

Optimizer Math for LLM Training

Overview of optimizer math used in LLM training.

Read article
ARTICLE · 270

PagedAttention architecture

Deep-dive on PagedAttention, the KV-cache management scheme behind vLLM that treats the cache like OS virtual memory. Covers why KV-cache fragmentatio…

Read article
ARTICLE · 271

Paged Attention Deep Dive

Paged Attention memory model.

Read article
ARTICLE · 272

PagedAttention

Math + memory model of PagedAttention (vLLM).

Read article
ARTICLE · 273

Paged KV Cache Deep Dive

Paged KV cache design.

Read article
ARTICLE · 274

PEFT Theory Overview

Parameter-Efficient Fine-Tuning theory.

Read article
ARTICLE · 275

Persuasion Capability Evals

Evaluate LLM persuasion capability.

Read article
ARTICLE · 276

pgvector Math + Architecture

pgvector: PostgreSQL vector extension.

Read article
ARTICLE · 277

Pinecone Math + Architecture

Pinecone: managed vector DB.

Read article
ARTICLE · 278

Pipeline Parallel Math Deep

Pipeline parallel math for LLM.

Read article
ARTICLE · 279

Polysemanticity

Neurons encoding multiple unrelated concepts.

Read article
ARTICLE · 280

Position Interpolation Math

Position Interpolation (PI) for context extension.

Read article
ARTICLE · 281

Positional Encoding

Why attention needs positional information and how sinusoidal and learned positional encodings work.

Read article
ARTICLE · 282

PP Math

Pipeline parallelism: split layers into stages across GPUs.

Read article
ARTICLE · 283

PPO for LLMs Math

PPO applied to LLMs.

Read article
ARTICLE · 284

PQ Math

Product quantization for compressed ANN.

Read article
ARTICLE · 285

Prefill Math

Prefill phase math.

Read article
ARTICLE · 286

Prefix Tuning Theory

Prefix tuning: learned prefixes for tasks.

Read article
ARTICLE · 287

Pre-norm vs post-norm transformers

Deep-dive on transformer normalization placement: post-norm on the residual path versus pre-norm inside the branch, gradient flow and attenuation, war…

Read article
ARTICLE · 288

Pretraining Scaling

Pretraining-specific scaling considerations.

Read article
ARTICLE · 289

Priority Scheduling

Priority scheduling for LLM requests.

Read article
ARTICLE · 290

Linear Probes

Probing internal representations with linear classifiers.

Read article
ARTICLE · 291

Prompt Prefill vs Decode

Prefill vs decode phase differences.

Read article
ARTICLE · 292

Prompt Lookup Decoding Math

Prompt lookup decoding math.

Read article
ARTICLE · 293

Prompt Tuning Theory

Prompt tuning: learn soft prompts at input.

Read article
ARTICLE · 294

Qdrant Math + Architecture

Qdrant: Rust vector DB.

Read article
ARTICLE · 295

QLoRA Theory

QLoRA: 4-bit quantized base + LoRA.

Read article
ARTICLE · 296

Quantization Quality Evaluation

How to evaluate quantization quality drop.

Read article
ARTICLE · 297

Advanced RAG Techniques Overview

Overview of advanced RAG methods.

Read article
ARTICLE · 298

Reasoning Capability Evals

LLM reasoning capability eval.

Read article
ARTICLE · 299

Reasoning Model Scaling

Scaling laws for reasoning models (o1 / R1 style).

Read article
ARTICLE · 300

Rectified Flow Math

Rectified flow: straight ODE paths.

Read article
ARTICLE · 301

Redis Vector Search Math

Redis vector search + RediSearch.

Read article
ARTICLE · 302

Representation Learning Theory

Theory of learned representations in DL.

Read article
ARTICLE · 303

Reranking Math

Cross-encoder reranking after retrieval.

Read article
ARTICLE · 304

RetNet

RetNet: parallel + recurrent + chunkwise forms.

Read article
ARTICLE · 305

RetNet Math

Retentive network math.

Read article
ARTICLE · 306

Retrieval Architectures Overview

Overview of retrieval architectures.

Read article
ARTICLE · 307

Reward Hacking Math

Reward hacking in RLHF.

Read article
ARTICLE · 308

Reward Model Math

Reward model math for RLHF.

Read article
ARTICLE · 309

Reward Model Scaling

Scaling reward models for RLHF.

Read article
ARTICLE · 310

Ring Attention

Ring attention: distribute attention computation across GPUs.

Read article
ARTICLE · 311

Ring Attention Math Deep

Ring Attention: distributed long-context attention.

Read article
ARTICLE · 312

RLHF Math Deep Dive

RLHF math deep dive.

Read article
ARTICLE · 313

RLHF Scaling Laws

Scaling laws for RLHF.

Read article
ARTICLE · 314

RLHF Scaling Math

Scaling RLHF to larger models.

Read article
ARTICLE · 315

RMSNorm architecture - root-mean-square normalization in modern transformers

Deep-dive on RMSNorm: the root-mean-square formula, contrast with LayerNorm's mean-centering and bias, forward and backward p…

Read article
ARTICLE · 316

RMSNorm Deep Dive

Deep math of RMSNorm and kernel implementation.

Read article
ARTICLE · 317

Roofline Model for LLM Ops

Roofline model: reasoning about performance.

Read article
ARTICLE · 318

Rotary Position Embedding (RoPE)

How RoPE encodes position by rotating query/key vectors, and why it extrapolates better than absolute PE.

Read article
ARTICLE · 319

Rotary Position Embedding Architecture in Depth

A 2500-word walkthrough of RoPE architecture: rotation math, base theta, NTK-aware scaling, YaRN/PI extension, kernel fusion, comparisons.

Read article
ARTICLE · 320

RWKV Math

RWKV RNN-like transformer math.

Read article
ARTICLE · 321

Sparse Autoencoders (SAE)

SAE: extract interpretable features.

Read article
ARTICLE · 322

Sampling mathematics

Deep-dive on LLM decoding math: logits through temperature and softmax, top-k vs nucleus vs min-p truncation, repetition/presence/frequency penalties,…

Read article
ARTICLE · 323

Scaled Dot Product Attention

The specific formulation used in transformers: scaled dot product attention, and why scaling by sqrt(d_k) matters.

Read article
ARTICLE · 324

Scaling law architecture

Deep-dive on scaling laws: Chinchilla ratio, compute-optimal N+D, overtraining for inference cost, data quality, emergent capabilities.

Read article
ARTICLE · 325

Scaling Laws

Mathematical formulation of LLM scaling laws.

Read article
ARTICLE · 326

Scaling Laws Deep Dive

Neural scaling laws deep dive.

Read article
ARTICLE · 327

Hyperparameter Scaling Transfer

Transferring HPs from small to large models.

Read article
ARTICLE · 328

ScaNN

ScaNN: Google's ANN library.

Read article
ARTICLE · 329

Score Matching

Score matching: learn gradient of log density.

Read article
ARTICLE · 330

Search Scaling in Reasoning

MCTS / beam search scaling for reasoning.

Read article
ARTICLE · 331

Selective Activation Recomputation

Recompute only expensive-to-store activations.

Read article
ARTICLE · 332

Self-Consistency Scaling

Self-consistency: majority vote over samples.

Read article
ARTICLE · 333

Self-RAG

Self-RAG: LLM decides when + what to retrieve.

Read article
ARTICLE · 334

SentencePiece Deep Dive

SentencePiece tokenizer library.

Read article
ARTICLE · 335

Sequence Length Math

Memory + compute impact of sequence length.

Read article
ARTICLE · 336

Sequence Parallel Math

Sequence parallelism math for LLM.

Read article
ARTICLE · 337

Shampoo

Shampoo: preconditioned second-order optimizer.

Read article
ARTICLE · 338

Shared KV Cache

Prefix sharing in KV cache.

Read article
ARTICLE · 339

Signal Propagation in Deep Networks

Theory: how signals travel through depth.

Read article
ARTICLE · 340

Sliding Window Attention

Math of sliding window attention.

Read article
ARTICLE · 341

SLO-Aware Scheduling Math

Scheduling math driven by SLOs.

Read article
ARTICLE · 342

SmoothQuant Math

SmoothQuant: shift activation outliers to weights.

Read article
ARTICLE · 343

Softmax in Attention

How softmax converts attention scores to probabilities, its computational cost, and numerically-stable implementation.

Read article
ARTICLE · 344

Softmax numerics architecture

Deep-dive on softmax numerics: max subtract, fp32 accumulation, logit scaling, online softmax, fused attention, log-sum-exp.

Read article
ARTICLE · 345

Sophia Optimizer

Sophia: Hessian-based optimizer for LLM.

Read article
ARTICLE · 346

SP Math

Sequence parallelism: split sequence across GPUs.

Read article
ARTICLE · 347

Sparse Retrieval Math

Sparse retrieval: BM25 + SPLADE.

Read article
ARTICLE · 348

Speculative decoding architecture

Deep-dive on speculative decoding: exploiting memory-bound decode with a cheap draft model whose K proposals the target verifies in one parallel pass,…

Read article
ARTICLE · 349

Speculative Decoding Deep Dive

Deep dive on speculative decoding.

Read article
ARTICLE · 350

Speculative Decoding

Math of speculative decoding for LLM inference speedup.

Read article
ARTICLE · 351

SPLADE Math

SPLADE: learned sparse retrieval.

Read article
ARTICLE · 352

State Space Models Math

State space model math.

Read article
ARTICLE · 353

Selective SSM

How selective SSMs adapt dynamics to input.

Read article
ARTICLE · 354

Stable Diffusion Math

Math behind Stable Diffusion.

Read article
ARTICLE · 355

State Space Models

State-space model foundation for Mamba, S4, and successors.

Read article
ARTICLE · 356

Stochastic Rounding

Stochastic rounding for low-precision training.

Read article
ARTICLE · 357

Superposition Hypothesis

Superposition: features stored non-orthogonally in NN.

Read article
ARTICLE · 358

SwiGLU

SwiGLU: SiLU-gated GLU used in Llama, PaLM, most modern LLMs.

Read article
ARTICLE · 359

Switch Transformer Math

Switch Transformer math.

Read article
ARTICLE · 360

Synthetic Training Data

Synthetic data for training.

Read article
ARTICLE · 361

Temperature Sampling Math

Temperature: scale logits before softmax.

Read article
ARTICLE · 362

Temperature scaling in LLM sampling

Deep-dive on temperature scaling: dividing logits by a scalar T before softmax to rescale logit differences, the cold/neutral/hot regimes and their ef…

Read article
ARTICLE · 363

Tensor Parallel Math Deep

Tensor parallel math for LLM.

Read article
ARTICLE · 364

Tensor Programs (Yang's Framework)

Yang's Tensor Programs: theory unifying scaling.

Read article
ARTICLE · 365

Test-Time Compute Math

Test-time compute: scale reasoning at inference.

Read article
ARTICLE · 366

tiktoken Deep Dive

OpenAI's tiktoken tokenizer.

Read article
ARTICLE · 367

Top-K Sampling Math

Top-k: sample from k highest-prob tokens.

Read article
ARTICLE · 368

Top-P (Nucleus) Sampling Math

Top-p: sample from cumulative-mass p.

Read article
ARTICLE · 369

Transfer Learning Scaling

How transfer + fine-tune scale from pretrain.

Read article
ARTICLE · 370

Typical Sampling

Typical: sample from tokens near expected entropy.

Read article
ARTICLE · 371

Unigram LM Tokenizer

Unigram language model tokenizer.

Read article
ARTICLE · 372

Variance Maintenance in Deep Nets

Keeping activation variance stable across layers.

Read article
ARTICLE · 373

Vector DB Math

Foundational math of vector databases.

Read article
ARTICLE · 374

Verifier Scaling

Scaling verifier models for reasoning.

Read article
ARTICLE · 375

Vespa Math

Vespa: search + vector DB.

Read article
ARTICLE · 376

LR Warmup Deep Dive

Why warmup is essential for LLM training.

Read article
ARTICLE · 377

Weaviate Math + Architecture

Weaviate: open-source vector DB.

Read article
ARTICLE · 378

Width Scaling

Scaling model width: hidden dim + heads.

Read article
ARTICLE · 379

YaRN + NTK Scaling

How YaRN + NTK-aware scaling extend RoPE context length.

Read article
ARTICLE · 380

ZeRO Stage 1 Math

Math of ZeRO Stage 1.

Read article
ARTICLE · 381

ZeRO Stage 2 Math

Math of ZeRO Stage 2.

Read article
ARTICLE · 382

ZeRO Stage 3 Math

Math of ZeRO Stage 3.

Read article
ARTICLE · 383

Zero-bubble pipeline parallelism

Deep-dive on zero-bubble pipeline scheduling: the (p-1)/m bubble, GPipe vs 1F1B vs interleaved 1F1B, splitting backward into input-gradient B and weig…

Read article
ARTICLE · 384

ZeRO-Infinity

ZeRO-Infinity: scale to trillion params via GPU + CPU + NVMe.

Read article
ARTICLE · 385

ZeRO Math

ZeRO: DeepSpeed's memory optimization stages.

Read article
ARTICLE · 386

ZeRO-Offload

Offload optimizer states + gradients to CPU or NVMe.

Read article
ARTICLE · 387

Token Embedding Lookup

How discrete tokens become continuous vectors.

Read article
ARTICLE · 388

Tokenizer Math

How text becomes a token sequence.

Read article
ARTICLE · 389

Training Data for SLMs

What to train on when you can't use the whole internet.

Read article
ARTICLE · 390

Weight Initialization

Why all-zeros doesn't work and what to do instead.

Read article
ARTICLE · 391

How Weights Are Stored on Disk

From PyTorch tensor to GGUF/SafeTensors bytes.

Read article