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 383 articles, sorted alphabetically

Advertisement
ARTICLE · 001

The Autoregressive Generation Loop

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

Read article
ARTICLE · 002

Backpropagation Through Transformers

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

Read article
ARTICLE · 003

Beam Search

Sometimes greedy isn't enough.

Read article
ARTICLE · 004

The Complete Transformer Block

All the pieces assembled with pseudocode.

Read article
ARTICLE · 005

CPU Cache Hierarchy and Transformer Inference

Why memory bandwidth is the SLM CPU inference bottleneck.

Read article
ARTICLE · 006

CPU Inference Pipelines

The software stacks that make SLM CPU inference fast.

Read article
ARTICLE · 007

CPU Matmul Kernels and BLAS

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

Read article
ARTICLE · 008

CPU Memory Budget for SLM Training

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

Read article
ARTICLE · 009

Cross-Entropy Loss for Next-Token Prediction

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

Read article
ARTICLE · 010

Dataloader and Tokenization Pipeline

Streaming data efficiently to the training loop.

Read article
ARTICLE · 011

The Geometry of Dot Products

How attention measures similarity in embedding space.

Read article
ARTICLE · 012

End-to-End CPU SLM Recipe

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

Read article
ARTICLE · 013

Feed-Forward Network

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

Read article
ARTICLE · 014

Fine-Tuning Math

How to adapt without retraining the whole model.

Read article
ARTICLE · 015

FlashAttention

Same math, very different memory pattern.

Read article
ARTICLE · 016

Gradient Accumulation and Microbatches

Effective large batches on small memory.

Read article
ARTICLE · 017

Gradient Clipping and Training Stability

Stopping spikes from blowing up training.

Read article
ARTICLE · 018

KV Cache

Why and how to cache keys and values.

Read article
ARTICLE · 019

KV Cache Quantization — int8 and int4

Compress the biggest memory hog at inference.

Read article
ARTICLE · 020

LayerNorm

How LayerNorm stabilizes activations.

Read article
ARTICLE · 021

Learning Rate Schedules

Why LR changes during training and the canonical curves.

Read article
ARTICLE · 022

Linear Algebra for Transformers

Vectors, matrices, and operations you actually need.

Read article
ARTICLE · 023

Long Context Strategies

How models handle 128K, 1M tokens.

Read article
ARTICLE · 024

Diagnosing Loss Curves

What healthy vs unhealthy training looks like.

Read article
ARTICLE · 025

Mixed Precision Training

Half-precision for speed; full precision for stability.

Read article
ARTICLE · 026

Mixture of Experts

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

Read article
ARTICLE · 027

Multi-Head Attention

Why split into heads and how the math reassembles.

Read article
ARTICLE · 028

Multi-Token Prediction (MTP)

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

Read article
ARTICLE · 029

Output Projection and Logits

From final hidden state to next-token probabilities.

Read article
ARTICLE · 030

Perplexity and Evaluation Metrics

How to measure if your model is any good.

Read article
ARTICLE · 031

Positional Encoding

How transformers know which token is where.

Read article
ARTICLE · 032

Quantization Layouts in Memory

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

Read article
ARTICLE · 033

Residual Connections and Gradient Flow

Why every transformer block adds the input back.

Read article
ARTICLE · 034

RLHF and DPO

From a pretrained model to a useful assistant.

Read article
ARTICLE · 035

RMSNorm

Why everyone moved away from LayerNorm.

Read article
ARTICLE · 036

Extending RoPE to Longer Contexts

YaRN, NTK-aware scaling, and LongRope.

Read article
ARTICLE · 037

Sampling Strategies

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

Read article
ARTICLE · 038

Scaled Dot-Product Attention

The math of the attention operation.

Read article
ARTICLE · 039

SGD vs Adam vs AdamW Optimizer Math

The update rules — and why Adam dominates LLM training.

Read article
ARTICLE · 040

SIMD Instructions for Transformer Math

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

Read article
ARTICLE · 041

SLM Architectures

Hyperparams of the leading sub-7B models.

Read article
ARTICLE · 042

Softmax Derivation

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

Read article
ARTICLE · 043

Speculative Decoding — The Math

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

Read article
ARTICLE · 044

The Future of CPU SLM in 2026 and Beyond

Where this is headed.

Read article
ARTICLE · 045

Tied Embeddings and Parameter Sharing

Why SLMs share weights between input embedding and output projection.

Read article
ARTICLE · 046

3D Parallelism

Combine DP, TP, PP for scale.

Read article
ARTICLE · 047

Ablation Study Math

Ablation studies in LLM research.

Read article
ARTICLE · 048

Beyond ReLU

Comparison of activation functions in modern LLMs.

Read article
ARTICLE · 049

Activation Checkpointing Math

Trade compute for memory via activation recomputation.

Read article
ARTICLE · 050

Activation Memory Math

Calculating activation memory in transformers.

Read article
ARTICLE · 051

Activation Patching

Patch activations to test causal role.

Read article
ARTICLE · 052

Activation Quantization

Activation quantization challenges + techniques.

Read article
ARTICLE · 053

Activation Recomputation Math

Math of activation recomputation trade-off.

Read article
ARTICLE · 054

Activation Scaling

Scaling activation variance in transformers.

Read article
ARTICLE · 055

Adafactor

Adafactor: factored second moment for memory savings.

Read article
ARTICLE · 056

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

AdamW Math Deep Dive

AdamW: Adam with decoupled weight decay.

Read article
ARTICLE · 058

Adapter Theory

Adapter layers: bottleneck insertions.

Read article
ARTICLE · 059

Adaptive RAG

Route queries to different RAG strategies.

Read article
ARTICLE · 060

Admission Control Math

Admission control math for LLM serving.

Read article
ARTICLE · 061

Agent Scaling Laws

Scaling laws for agent capability.

Read article
ARTICLE · 062

ALiBi

Math of ALiBi position encoding.

Read article
ARTICLE · 063

Alignment Tax Math

Alignment tax in RLHF.

Read article
ARTICLE · 064

Annoy

Annoy: tree-based ANN.

Read article
ARTICLE · 065

MongoDB Atlas Vector Search

MongoDB Atlas: vector search.

Read article
ARTICLE · 066

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

Attention Math

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

Read article
ARTICLE · 068

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

AWQ Math

AWQ: Activation-aware Weight Quantization.

Read article
ARTICLE · 070

Backpressure Math

Backpressure math for LLM serving.

Read article
ARTICLE · 071

Backprop architecture

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

Read article
ARTICLE · 072

Bandwidth-Bound Operations

Identifying bandwidth-bound ops in LLM.

Read article
ARTICLE · 073

Batched GEMM Math

Batched matrix multiplication math.

Read article
ARTICLE · 074

Batch Size Math for LLM Training

How to choose LLM training batch size.

Read article
ARTICLE · 075

Beam Search Math

Beam search: track K best sequences.

Read article
ARTICLE · 076

BF16 Training

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

Read article
ARTICLE · 077

BGE Embeddings Math

BGE: BAAI general embeddings.

Read article
ARTICLE · 078

Bio Capability Evals

LLM biosecurity capability eval.

Read article
ARTICLE · 079

BitFit Theory

BitFit: fine-tune only biases.

Read article
ARTICLE · 080

bitsandbytes int8 Quantization

bitsandbytes: LLM.int8() implementation.

Read article
ARTICLE · 081

Bottleneck Theory of Deep Learning

Information bottleneck theory for deep nets.

Read article
ARTICLE · 082

Byte-Pair Encoding Deep Dive

BPE tokenization deep dive.

Read article
ARTICLE · 083

Blockwise Parallel Transformer

BPT: block-parallel transformer for long context.

Read article
ARTICLE · 084

Capability Evaluation Overview

Math + methodology of LLM capability evals.

Read article
ARTICLE · 085

Capability Transitions in Training

How capabilities transition during training.

Read article
ARTICLE · 086

Causal Tracing

Trace causal roles across layers.

Read article
ARTICLE · 087

Classifier-Free Guidance (CFG)

CFG: guidance without separate classifier.

Read article
ARTICLE · 088

Chinchilla Scaling Law

Chinchilla: compute-optimal ratio between params and data.

Read article
ARTICLE · 089

Chinchilla Scaling

Chinchilla scaling law math.

Read article
ARTICLE · 090

Chroma Math + Architecture

Chroma: developer-friendly vector DB.

Read article
ARTICLE · 091

Chunked Prefill

Chunked prefill deep dive.

Read article
ARTICLE · 092

Circuit Analysis

Reverse-engineer neural network circuits.

Read article
ARTICLE · 093

Classifier Guidance Math

Classifier-guided diffusion sampling.

Read article
ARTICLE · 094

Coding Capability Evals

LLM coding capability eval.

Read article
ARTICLE · 095

ColBERT Math

ColBERT: late-interaction retrieval.

Read article
ARTICLE · 096

Communication Math for Distributed Training

How to estimate communication volume + time.

Read article
ARTICLE · 097

Compute-Bound Operations

Compute-bound: dominated by FLOPs.

Read article
ARTICLE · 098

Compute-Optimal Training in Practice

Choosing model size + tokens under compute budget.

Read article
ARTICLE · 099

Compute-Optimal Training — The Math

Compute-optimal training math.

Read article
ARTICLE · 100

Constitutional AI Math

Constitutional AI (CAI) math.

Read article
ARTICLE · 101

Context Length Extension Math

Extending context length after pretraining.

Read article
ARTICLE · 102

Contextual RAG Math

Contextual retrieval: chunk with doc context.

Read article
ARTICLE · 103

Continuous Batching Math

Math of continuous batching.

Read article
ARTICLE · 104

Contrastive Search

Contrastive search: penalize repetition + degeneration.

Read article
ARTICLE · 105

Corrective RAG (CRAG)

CRAG: evaluate + correct retrieved documents.

Read article
ARTICLE · 106

CPU Offload Math

Math of CPU offload for LLM.

Read article
ARTICLE · 107

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

Cyber Capability Evals

LLM cybersecurity capability eval.

Read article
ARTICLE · 109

Dangerous Capability Evaluations

Evals for dangerous frontier capabilities.

Read article
ARTICLE · 110

Training Data Filtering

Filtering pretraining data.

Read article
ARTICLE · 111

Training Data Mixing

Data domain mixing for training.

Read article
ARTICLE · 112

Data Quality Math

Data quality effects on training.

Read article
ARTICLE · 113

Data Quality Scaling

How data quality affects scaling.

Read article
ARTICLE · 114

Data Scaling for LLMs

How training data scales with model + quality.

Read article
ARTICLE · 115

DDIM

DDIM: deterministic accelerated diffusion sampling.

Read article
ARTICLE · 116

DDP Math

DDP: data-parallel training math.

Read article
ARTICLE · 117

DDPM

DDPM: original diffusion model math.

Read article
ARTICLE · 118

Deception Capability Evals

Evaluate LLM deceptive capabilities.

Read article
ARTICLE · 119

DeepMind Scaling Law Series

DeepMind's scaling law contributions.

Read article
ARTICLE · 120

Dense Retrieval Math

Bi-encoder dense retrieval math.

Read article
ARTICLE · 121

Depth Scaling

Scaling model depth: layers.

Read article
ARTICLE · 122

Dictionary Learning for NN

Dictionary learning: sparse feature representation.

Read article
ARTICLE · 123

DoRA

DoRA: LoRA that decomposes weights into magnitude + direction.

Read article
ARTICLE · 124

DoRA Theory

Weight-Decomposed LoRA theoretical foundation.

Read article
ARTICLE · 125

Double Descent

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

Read article
ARTICLE · 126

Double Descent Deep Dive

Double descent: test error re-descent past interpolation.

Read article
ARTICLE · 127

DPM-Solver Sampling

DPM-Solver: high-order diffusion ODE solver.

Read article
ARTICLE · 128

DPO Math

Direct Preference Optimization math.

Read article
ARTICLE · 129

DyT

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

Read article
ARTICLE · 130

E5 Embeddings Math

E5: Microsoft's embedding family.

Read article
ARTICLE · 131

EAGLE — Feature-Level Recurrence

EAGLE speculative decoding.

Read article
ARTICLE · 132

EAGLE in Context

Math of EAGLE speculative decoding variant.

Read article
ARTICLE · 133

EDM

Karras et al.: modular diffusion framework.

Read article
ARTICLE · 134

Effective Batch Size

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

Read article
ARTICLE · 135

Elasticsearch Vector Search

Elasticsearch KNN + vector search.

Read article
ARTICLE · 136

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

Emergent Capabilities Deep Dive

Emergent capabilities in LLMs.

Read article
ARTICLE · 138

Emergent Abilities in LLMs

How abilities emerge with scale.

Read article
ARTICLE · 139

Emergent Abilities Math

Emergent abilities in LLMs.

Read article
ARTICLE · 140

EP Math

Expert parallelism: distribute MoE experts across GPUs.

Read article
ARTICLE · 141

Expert Choice Routing

Expert choice routing.

Read article
ARTICLE · 142

Expert Parallel Math Deep

Expert parallel math for MoE.

Read article
ARTICLE · 143

Faiss Math

Faiss: Facebook's ANN library.

Read article
ARTICLE · 144

Feature Disentanglement

Separating polysemantic features.

Read article
ARTICLE · 145

Transformer Math: Big Picture

Big picture of transformer math.

Read article
ARTICLE · 146

Fine-Tuning Scaling

Fine-tuning scaling: data + compute laws.

Read article
ARTICLE · 147

Flash Attention Architecture

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

Read article
ARTICLE · 148

FlashAttention-2

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

Read article
ARTICLE · 149

Flash Attention Math

Flash Attention memory + compute math.

Read article
ARTICLE · 150

Flow Matching

Flow matching: learn ODEs instead of SDEs.

Read article
ARTICLE · 151

FP4 Quantization

FP4: 4-bit floating point quantization.

Read article
ARTICLE · 152

FP4 Training on Blackwell

FP4 training: 4-bit float on Blackwell GPUs.

Read article
ARTICLE · 153

FP8 Training on H100+ Hardware

FP8 training: E4M3 + E5M2 formats.

Read article
ARTICLE · 154

FSDP Math

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

Read article
ARTICLE · 155

Full FT vs PEFT Trade-offs

Full fine-tuning vs PEFT trade-offs.

Read article
ARTICLE · 156

Fusion RAG

Fuse multiple retrieval sources.

Read article
ARTICLE · 157

Game Theory for LLM Agents

Game theory applied to LLM agents.

Read article
ARTICLE · 158

Activation function architecture

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

Read article
ARTICLE · 159

GGUF Format Deep Dive

GGUF: llama.cpp quantization format.

Read article
ARTICLE · 160

Distillation Math

Math of knowledge distillation from teacher to student LLMs.

Read article
ARTICLE · 161

GLU FFN

Math of Gated Linear Units in feed-forward networks.

Read article
ARTICLE · 162

GPTQ Math

GPTQ: post-training quantization via error correction.

Read article
ARTICLE · 163

GQA Math

Deep math of grouped-query attention.

Read article
ARTICLE · 164

Gradient Accumulation — Linearity and 1/K

Gradient accumulation: virtual batch size.

Read article
ARTICLE · 165

Gradient Checkpointing Math

Math of gradient checkpointing.

Read article
ARTICLE · 166

Gradient Clipping for LLM Training

Gradient clipping strategies.

Read article
ARTICLE · 167

Gradient Memory Math

Gradient memory in training.

Read article
ARTICLE · 168

Graph RAG Math

Graph-augmented RAG.

Read article
ARTICLE · 169

Grokking

Grokking: model suddenly generalizes after long overfitting.

Read article
ARTICLE · 170

Grokking Deep Dive

Grokking: delayed generalization phenomenon.

Read article
ARTICLE · 171

Grokking Math

Grokking phenomenon in neural nets.

Read article
ARTICLE · 172

Grouped Query Attention (GQA)

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

Read article
ARTICLE · 173

GTE Embeddings Math

GTE: Alibaba embeddings.

Read article
ARTICLE · 174

Guided Generation Math

Constrained decoding via grammar / regex.

Read article
ARTICLE · 175

HNSW Math

Hierarchical Navigable Small World graphs.

Read article
ARTICLE · 176

Hoffmann Chinchilla Paper

Chinchilla paper 2022 details.

Read article
ARTICLE · 177

Hybrid Architectures

Hybrid models combining attention + SSM layers.

Read article
ARTICLE · 178

Hybrid Parallelism Math

Combine multiple parallelism axes.

Read article
ARTICLE · 179

Hybrid Retrieval Math

Hybrid: fuse dense + sparse.

Read article
ARTICLE · 180

HyDE Math

Hypothetical Document Embeddings.

Read article
ARTICLE · 181

Hyena

Hyena: long convolutions replacing attention.

Read article
ARTICLE · 182

Hyena Hierarchy Math

Hyena hierarchy math.

Read article
ARTICLE · 183

IA3 Theory

IA3: multiplicative adapters.

Read article
ARTICLE · 184

Inference-Optimal Training

Inference-optimal training math.

Read article
ARTICLE · 185

Inference-Time Scaling Laws

Scaling capability via more inference compute.

Read article
ARTICLE · 186

In-Flight Batching

In-flight batching in TRT-LLM.

Read article
ARTICLE · 187

Information Bottleneck Method

IB method: trade compression vs prediction.

Read article
ARTICLE · 188

Initialization Scaling

Init variance scaling with model size.

Read article
ARTICLE · 189

Mechanistic Interpretability Overview

Math foundations of mechanistic interpretability.

Read article
ARTICLE · 190

Iteration-Level Scheduling

Iteration-level scheduling math.

Read article
ARTICLE · 191

Kaplan Scaling Laws (2020)

Original Kaplan scaling laws vs Chinchilla revisions.

Read article
ARTICLE · 192

Kaplan Scaling Laws Deep Dive

Kaplan 2020 scaling laws in detail.

Read article
ARTICLE · 193

KTO Math

Kahneman-Tversky Optimization.

Read article
ARTICLE · 194

KV Cache

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

Read article
ARTICLE · 195

KV Cache Deep Dive

Deep dive on KV cache math.

Read article
ARTICLE · 196

KV Cache Compression

Compressing KV cache for long context.

Read article
ARTICLE · 197

KV Cache Quantization

Math of quantized KV cache for long context serving.

Read article
ARTICLE · 198

KV Cache Quantization at Low Bits

Quantizing KV cache for memory savings.

Read article
ARTICLE · 199

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

Layer-wise LR Decay

Different LR per layer: layer-wise decay.

Read article
ARTICLE · 201

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

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

Learning Rate Math for LLM

How to choose LR for LLM training.

Read article
ARTICLE · 204

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

Linear Attention

Linear attention: kernel + feature-map approaches.

Read article
ARTICLE · 206

Linear Attention Math

Linear attention variants.

Read article
ARTICLE · 207

Lion Optimizer Math

Lion: sign-based optimizer discovered by search.

Read article
ARTICLE · 208

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

LLM.int8() Paper Math

LLM.int8() paper details.

Read article
ARTICLE · 210

Lookahead Decoding

Lookahead decoding for training-free speedup.

Read article
ARTICLE · 211

LoRA

Mathematics of Low-Rank Adaptation.

Read article
ARTICLE · 212

LoRA Theory

Low-Rank Adaptation theoretical foundation.

Read article
ARTICLE · 213

Loss Curves

How to read and diagnose LLM training loss curves.

Read article
ARTICLE · 214

Loss Scaling for fp16 Training

Loss scaling: prevent fp16 gradient underflow.

Read article
ARTICLE · 215

Lottery Ticket Hypothesis

LTH: dense networks contain sparse trainable subnetworks.

Read article
ARTICLE · 216

Lottery Ticket — Rewinding and Stability

LTH: sparse subnets train to full accuracy.

Read article
ARTICLE · 217

Lottery Ticket — Strong Tickets

Lottery ticket hypothesis math.

Read article
ARTICLE · 218

Learning Rate Schedules for LLM

LR schedules: warmup + decay strategies.

Read article
ARTICLE · 219

Learning Rate Transfer

Transferring LR across model sizes.

Read article
ARTICLE · 220

Mamba SSM Math

Mamba state space model math.

Read article
ARTICLE · 221

Math Capability Evals

LLM math capability eval.

Read article
ARTICLE · 222

Matmul Arithmetic Intensity

Arithmetic intensity of matmul.

Read article
ARTICLE · 223

Matryoshka Embeddings

Matryoshka Representation Learning.

Read article
ARTICLE · 224

Medusa Speculative Heads

Medusa multi-head speculative decoding.

Read article
ARTICLE · 225

Medusa

Math of Medusa multi-head speculative decoding.

Read article
ARTICLE · 226

LLM Memory Math

How to compute LLM training memory.

Read article
ARTICLE · 227

Mesa-Optimization

Mesa-optimizers: learned optimization within models.

Read article
ARTICLE · 228

Micro-Batch Size Selection

Choosing micro-batch size for memory + throughput.

Read article
ARTICLE · 229

Milvus Math + Architecture

Milvus: enterprise open-source vector DB.

Read article
ARTICLE · 230

Min-P Sampling

Min-p: filter tokens below min probability threshold.

Read article
ARTICLE · 231

Mirostat Sampling

Mirostat: control perplexity dynamically.

Read article
ARTICLE · 232

Mixed Precision Training

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

Read article
ARTICLE · 233

Mixture of Experts Math

Mixture of experts architecture math.

Read article
ARTICLE · 234

MQA Math

Deep math of multi-query attention.

Read article
ARTICLE · 235

Multi-Agent Communication

Communication protocols between LLM agents.

Read article
ARTICLE · 236

Multi-Agent Coordination

Coordination mechanisms in multi-agent.

Read article
ARTICLE · 237

Multi-Agent Debate

Multi-agent debate for reasoning.

Read article
ARTICLE · 238

Multi-Agent Emergence

Emergent behavior in multi-agent systems.

Read article
ARTICLE · 239

Multi-Agent Negotiation

Negotiation between LLM agents.

Read article
ARTICLE · 240

Multi-Agent Planning

Planning in multi-agent systems.

Read article
ARTICLE · 241

Multi-Agent Reflection

Reflection in multi-agent systems.

Read article
ARTICLE · 242

Multi-Agent Shared Memory

Shared memory + blackboard patterns.

Read article
ARTICLE · 243

Multi-Agent System Theory

Multi-agent system theoretical foundation.

Read article
ARTICLE · 244

Multi-Hop RAG

Multi-hop retrieval + reasoning.

Read article
ARTICLE · 245

Multi-Head Attention

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

Read article
ARTICLE · 246

Multilingual Scaling

How languages scale together.

Read article
ARTICLE · 247

Multilingual Tokenization

Multilingual tokenization challenges.

Read article
ARTICLE · 248

Multimodal Scaling

How multimodal (vision + audio) scale.

Read article
ARTICLE · 249

Muon Optimizer

Muon: Newton-Schulz orthogonalization + momentum.

Read article
ARTICLE · 250

muP

muP: parameterize models so hyperparameters transfer across sizes.

Read article
ARTICLE · 251

Neural Scaling Law Theory

Theoretical foundations of neural scaling laws.

Read article
ARTICLE · 252

Neural Tangent Kernel

NTK: theory linking neural networks to kernel methods.

Read article
ARTICLE · 253

Neural Tangent Kernel

Neural tangent kernel theory.

Read article
ARTICLE · 254

NTK-Aware Interpolation

NTK-aware position scaling.

Read article
ARTICLE · 255

NVMe Offload Math

Math of NVMe offload.

Read article
ARTICLE · 256

Offload Math

Math of memory offload.

Read article
ARTICLE · 257

OpenAI Scaling Law Contributions

OpenAI's scaling law papers.

Read article
ARTICLE · 258

OpenSearch Vector Search

OpenSearch KNN plugin.

Read article
ARTICLE · 259

Optimized Product Quantization

OPQ: rotation-optimized PQ.

Read article
ARTICLE · 260

Optimizer State Offload Math

Math of optimizer state offload.

Read article
ARTICLE · 261

Optimizer State Memory Math

Optimizer state memory: Adam vs alternatives.

Read article
ARTICLE · 262

Optimizer Math for LLM Training

Overview of optimizer math used in LLM training.

Read article
ARTICLE · 263

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

Paged Attention Deep Dive

Paged Attention memory model.

Read article
ARTICLE · 265

PagedAttention

Math + memory model of PagedAttention (vLLM).

Read article
ARTICLE · 266

Paged KV Cache Deep Dive

Paged KV cache design.

Read article
ARTICLE · 267

PEFT Theory Overview

Parameter-Efficient Fine-Tuning theory.

Read article
ARTICLE · 268

Persuasion Capability Evals

Evaluate LLM persuasion capability.

Read article
ARTICLE · 269

pgvector Math + Architecture

pgvector: PostgreSQL vector extension.

Read article
ARTICLE · 270

Pinecone Math + Architecture

Pinecone: managed vector DB.

Read article
ARTICLE · 271

Pipeline Parallel Math Deep

Pipeline parallel math for LLM.

Read article
ARTICLE · 272

Polysemanticity

Neurons encoding multiple unrelated concepts.

Read article
ARTICLE · 273

Position Interpolation Math

Position Interpolation (PI) for context extension.

Read article
ARTICLE · 274

Positional Encoding

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

Read article
ARTICLE · 275

PP Math

Pipeline parallelism: split layers into stages across GPUs.

Read article
ARTICLE · 276

PPO for LLMs Math

PPO applied to LLMs.

Read article
ARTICLE · 277

PQ Math

Product quantization for compressed ANN.

Read article
ARTICLE · 278

Prefill Math

Prefill phase math.

Read article
ARTICLE · 279

Prefix Tuning Theory

Prefix tuning: learned prefixes for tasks.

Read article
ARTICLE · 280

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

Pretraining Scaling

Pretraining-specific scaling considerations.

Read article
ARTICLE · 282

Priority Scheduling

Priority scheduling for LLM requests.

Read article
ARTICLE · 283

Linear Probes

Probing internal representations with linear classifiers.

Read article
ARTICLE · 284

Prompt Prefill vs Decode

Prefill vs decode phase differences.

Read article
ARTICLE · 285

Prompt Lookup Decoding Math

Prompt lookup decoding math.

Read article
ARTICLE · 286

Prompt Tuning Theory

Prompt tuning: learn soft prompts at input.

Read article
ARTICLE · 287

Qdrant Math + Architecture

Qdrant: Rust vector DB.

Read article
ARTICLE · 288

QLoRA Theory

QLoRA: 4-bit quantized base + LoRA.

Read article
ARTICLE · 289

Quantization Quality Evaluation

How to evaluate quantization quality drop.

Read article
ARTICLE · 290

Advanced RAG Techniques Overview

Overview of advanced RAG methods.

Read article
ARTICLE · 291

Reasoning Capability Evals

LLM reasoning capability eval.

Read article
ARTICLE · 292

Reasoning Model Scaling

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

Read article
ARTICLE · 293

Rectified Flow Math

Rectified flow: straight ODE paths.

Read article
ARTICLE · 294

Redis Vector Search Math

Redis vector search + RediSearch.

Read article
ARTICLE · 295

Representation Learning Theory

Theory of learned representations in DL.

Read article
ARTICLE · 296

Reranking Math

Cross-encoder reranking after retrieval.

Read article
ARTICLE · 297

RetNet

RetNet: parallel + recurrent + chunkwise forms.

Read article
ARTICLE · 298

RetNet Math

Retentive network math.

Read article
ARTICLE · 299

Retrieval Architectures Overview

Overview of retrieval architectures.

Read article
ARTICLE · 300

Reward Hacking Math

Reward hacking in RLHF.

Read article
ARTICLE · 301

Reward Model Math

Reward model math for RLHF.

Read article
ARTICLE · 302

Reward Model Scaling

Scaling reward models for RLHF.

Read article
ARTICLE · 303

Ring Attention

Ring attention: distribute attention computation across GPUs.

Read article
ARTICLE · 304

Ring Attention Math Deep

Ring Attention: distributed long-context attention.

Read article
ARTICLE · 305

RLHF Math Deep Dive

RLHF math deep dive.

Read article
ARTICLE · 306

RLHF Scaling Laws

Scaling laws for RLHF.

Read article
ARTICLE · 307

RLHF Scaling Math

Scaling RLHF to larger models.

Read article
ARTICLE · 308

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

RMSNorm Deep Dive

Deep math of RMSNorm and kernel implementation.

Read article
ARTICLE · 310

Roofline Model for LLM Ops

Roofline model: reasoning about performance.

Read article
ARTICLE · 311

Rotary Position Embedding (RoPE)

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

Read article
ARTICLE · 312

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

RWKV Math

RWKV RNN-like transformer math.

Read article
ARTICLE · 314

Sparse Autoencoders (SAE)

SAE: extract interpretable features.

Read article
ARTICLE · 315

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

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

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

Scaling Laws — Power Law and Chinchilla

Mathematical formulation of LLM scaling laws.

Read article
ARTICLE · 319

Scaling Laws — Where They Break Down

Neural scaling laws deep dive.

Read article
ARTICLE · 320

Hyperparameter Scaling Transfer

Transferring HPs from small to large models.

Read article
ARTICLE · 321

ScaNN

ScaNN: Google's ANN library.

Read article
ARTICLE · 322

Score Matching

Score matching: learn gradient of log density.

Read article
ARTICLE · 323

Search Scaling in Reasoning

MCTS / beam search scaling for reasoning.

Read article
ARTICLE · 324

Selective Activation Recomputation

Recompute only expensive-to-store activations.

Read article
ARTICLE · 325

Self-Consistency Scaling

Self-consistency: majority vote over samples.

Read article
ARTICLE · 326

Self-RAG

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

Read article
ARTICLE · 327

SentencePiece Deep Dive

SentencePiece tokenizer library.

Read article
ARTICLE · 328

Sequence Length Math

Memory + compute impact of sequence length.

Read article
ARTICLE · 329

Sequence Parallel Math

Sequence parallelism math for LLM.

Read article
ARTICLE · 330

Shampoo

Shampoo: preconditioned second-order optimizer.

Read article
ARTICLE · 331

Shared KV Cache

Prefix sharing in KV cache.

Read article
ARTICLE · 332

Signal Propagation in Deep Networks

Theory: how signals travel through depth.

Read article
ARTICLE · 333

Sliding Window Attention

Math of sliding window attention.

Read article
ARTICLE · 334

SLO-Aware Scheduling Math

Scheduling math driven by SLOs.

Read article
ARTICLE · 335

SmoothQuant Math

SmoothQuant: shift activation outliers to weights.

Read article
ARTICLE · 336

Softmax in Attention

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

Read article
ARTICLE · 337

Sophia Optimizer

Sophia: Hessian-based optimizer for LLM.

Read article
ARTICLE · 338

SP Math

Sequence parallelism: split sequence across GPUs.

Read article
ARTICLE · 339

Sparse Retrieval Math

Sparse retrieval: BM25 + SPLADE.

Read article
ARTICLE · 340

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

Speculative Decoding in Practice

Deep dive on speculative decoding.

Read article
ARTICLE · 342

Speculative Decoding — Acceptance Rate

Math of speculative decoding for LLM inference speedup.

Read article
ARTICLE · 343

SPLADE Math

SPLADE: learned sparse retrieval.

Read article
ARTICLE · 344

State Space Models Math

State space model math.

Read article
ARTICLE · 345

Selective SSM

How selective SSMs adapt dynamics to input.

Read article
ARTICLE · 346

Stable Diffusion Math

Math behind Stable Diffusion.

Read article
ARTICLE · 347

State Space Models

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

Read article
ARTICLE · 348

Stochastic Rounding

Stochastic rounding for low-precision training.

Read article
ARTICLE · 349

Superposition Hypothesis

Superposition: features stored non-orthogonally in NN.

Read article
ARTICLE · 350

SwiGLU

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

Read article
ARTICLE · 351

Switch Transformer Math

Switch Transformer math.

Read article
ARTICLE · 352

Synthetic Training Data

Synthetic data for training.

Read article
ARTICLE · 353

Temperature Sampling Math

Temperature: scale logits before softmax.

Read article
ARTICLE · 354

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

Tensor Parallel Math Deep

Tensor parallel math for LLM.

Read article
ARTICLE · 356

Tensor Programs (Yang's Framework)

Yang's Tensor Programs: theory unifying scaling.

Read article
ARTICLE · 357

Test-Time Compute Math

Test-time compute: scale reasoning at inference.

Read article
ARTICLE · 358

tiktoken Deep Dive

OpenAI's tiktoken tokenizer.

Read article
ARTICLE · 359

Top-K Sampling Math

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

Read article
ARTICLE · 360

Top-P (Nucleus) Sampling Math

Top-p: sample from cumulative-mass p.

Read article
ARTICLE · 361

Transfer Learning Scaling

How transfer + fine-tune scale from pretrain.

Read article
ARTICLE · 362

Typical Sampling

Typical: sample from tokens near expected entropy.

Read article
ARTICLE · 363

Unigram LM Tokenizer

Unigram language model tokenizer.

Read article
ARTICLE · 364

Variance Maintenance in Deep Nets

Keeping activation variance stable across layers.

Read article
ARTICLE · 365

Vector DB Math

Foundational math of vector databases.

Read article
ARTICLE · 366

Verifier Scaling

Scaling verifier models for reasoning.

Read article
ARTICLE · 367

Vespa Math

Vespa: search + vector DB.

Read article
ARTICLE · 368

LR Warmup Deep Dive

Why warmup is essential for LLM training.

Read article
ARTICLE · 369

Weaviate Math + Architecture

Weaviate: open-source vector DB.

Read article
ARTICLE · 370

Width Scaling

Scaling model width: hidden dim + heads.

Read article
ARTICLE · 371

YaRN + NTK Scaling

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

Read article
ARTICLE · 372

ZeRO Stage 1 Math

Math of ZeRO Stage 1.

Read article
ARTICLE · 373

ZeRO Stage 2 Math

Math of ZeRO Stage 2.

Read article
ARTICLE · 374

ZeRO Stage 3 Math

Math of ZeRO Stage 3.

Read article
ARTICLE · 375

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

ZeRO-Infinity

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

Read article
ARTICLE · 377

ZeRO Math

ZeRO: DeepSpeed's memory optimization stages.

Read article
ARTICLE · 378

ZeRO-Offload

Offload optimizer states + gradients to CPU or NVMe.

Read article
ARTICLE · 379

Token Embedding Lookup

How discrete tokens become continuous vectors.

Read article
ARTICLE · 380

Tokenizer Math

How text becomes a token sequence.

Read article
ARTICLE · 381

Training Data for SLMs

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

Read article
ARTICLE · 382

Weight Initialization

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

Read article
ARTICLE · 383

How Weights Are Stored on Disk

From PyTorch tensor to GGUF/SafeTensors bytes.

Read article