Animated Deepdives

The Backward Pass

First-principles, illustrated deep dives into how modern AI models are built, trained, and scaled.

Showing all 41 articles

Animated standardized plates comparing vision-language model architectures.
Featured · VLM architectures

The VLM Architecture Gallery

Seventy-one architectures on one standardized plate, from gated cross-attention to encoders absorbed into the base model.

Published Updated 34 min read
VLMsArchitectureToken Budgets
Animated comparison between grading an agent's words and verifying the world state it changed.
Tool Use & Agentic Models · 07

The Agent Evaluation Playbook

How to evaluate trajectories, state changes, reliability, safety, graders, budgets, and long-horizon failures.

Published 54 min read
Agent EvaluationReliabilitySafety
Animated reverse-mode gradient wave flowing from one scalar loss to a grid of parameters.
Deep Learning Foundations · 06

What Autograd Actually Does

Backpropagation and autograd from scalar chain rules to Jacobian products, saved tensors, and checkpointing.

Published Updated 46 min read
BackpropagationAutogradVJPs
Animated attention distribution showing entropy collapse as logits grow during unstable training.
Deep Learning Foundations · 07

Why Transformers Do Not Explode

Initialization, residual paths, normalization, optimizer dynamics, precision, and the signatures of unstable training.

Published Updated 54 min read
InitializationTraining StabilityNumerics
Animated comparison of top-k, top-p, epsilon, min-p, eta, and typical sampling.
Deep Learning Foundations · 08

Choosing the Next Token

Temperature, search, truncation, penalties, grammars, and contrastive generation organized around entropy.

Published Updated 48 min read
DecodingSamplingInformation Theory
Animated contrast between teacher-forced demonstrations and a model's compounding rollout errors.
Post-training · 01

Teaching a Language Model to Follow Instructions

Supervised fine-tuning as behavior cloning: data construction, loss masking, distribution shift, and capability change.

Published 54 min read
SFTInstruction TuningBehavior Cloning
Animated low-rank factorization showing how LoRA rank changes trainable parameters and approximation capacity.
Post-training · PEFT companion

How LoRA Changes a Model Without Rewriting It

Why low-rank updates work, how LoRA and QLoRA spend memory, and when adapters lose to full fine-tuning.

Published 46 min read
LoRAQLoRAAdapters
Animated agent harness expanding around the model into context, tools, sandboxing, verification, memory, and logs.
Tool Use & Agentic Models · 03

Inside an AI Agent Harness

The agent harness as a system: context assembly, action protocols, verification, containment, budgets, and event state.

Published 72 min read
Agent HarnessesSandboxingVerification
Animated agent memory loop covering write, manage, retrieve, rank, and context construction.
Tool Use & Agentic Models · 04

Memory Is More Than Context

Working, episodic, semantic, procedural, and reflective memory as one bounded context-allocation problem.

Published 58 min read
Agent MemoryContext EngineeringRetrieval
Animated seven-agent network comparing pipeline, coordinator, hierarchy, mesh, and blackboard topologies.
Tool Use & Agentic Models · 05

How Multi-Agent Systems Actually Coordinate

When multiple agents beat one: diversity, specialization, topology, communication cost, orchestration, and failure modes.

Published 48 min read
Multi-Agent SystemsOrchestrationCoordination
Animated rollout batch losing useful gradient signal as task horizon increases.
Tool Use & Agentic Models · 06

Reinforcement Learning for Agents From First Principles

Reinforcement learning for agents: environments, reward design, credit assignment, horizons, and rollout systems.

Published 62 min read
Agentic RLCredit AssignmentEnvironments
Animated attention map showing a token construct its representation by weighting information from other positions.
Deep Learning Foundations · 03

How Attention Moves Information

Why attention exists, how Q, K, and V arise, and how the same operation becomes MHA, GQA, sliding windows, linear attention, MLA, and multimodal attention.

Published Updated 52 min read
AttentionQKVGQA & MLA
Animated double-descent curve crossing the interpolation threshold as parameter count increases.
Training Science · Generalization

The Puzzle of Overparameterization

Interpolation, double descent and its limits, benign overfitting, implicit bias, function space, grokking, and what any of them explain about LLMs.

Published 52 min read
GeneralizationDouble DescentGrokking
Animated curation funnel thinning a raw document collection through filtering, deduplication, and decontamination.
Training Science · Pretraining Data

How LLMs Are Pretrained

Where pretraining data comes from, what survives curation, how mixtures and sequences are constructed, and how teams decide whether the recipe worked.

Published Updated 52 min read
PretrainingData CurationTokenization
Animated capability scoreboard showing one trained skill rise while other model skills regress.
Post-training · 02

Mixing Data Without Losing Capabilities

Why tasks interfere, how sampling weights become loss weights, how to measure transfer, and what to do when a capability regresses.

Published Updated 44 min read
Data MixturesMulti-task LearningForgetting
Animated tool-augmented turn from injected schemas through structured decoding, execution, observation, and final response.
Tool Use & Agentic Models · 01

How Language Models Learn to Use Tools

How models discover available tools at runtime, decide whether to call one, produce valid arguments, retrieve schemas, and learn from executable feedback.

Published 42 min read
Function CallingTool RetrievalVerification
Animated agent harness cycling through context assembly, model action, validation, execution, observation, and persistent state.
Tool Use & Agentic Models · 02

The Making of an AI Agent

What changes when tool calls become a stateful loop: trajectory data, imitation versus RL, long-horizon credit assignment, memory, harnesses, and environments.

Published 34 min read
AgentsTrajectoriesEnvironment RL
Animated Transformer decoder block evolving from the 2017 design into a modern LLM block.
Architectures · Modern LLMs

What Changed Inside the Transformer?

What changed between the original Transformer and today’s Llama, Qwen, DeepSeek, and GLM-class models—one design pressure at a time.

Published Updated 52 min read
TransformersArchitectureKV Cache
Animated fixed-compute frontier trading model parameters against training tokens while loss traces a shallow valley.
Training Science · Scaling Laws

Scaling Laws from First Principles

Where C = 6ND comes from, why tokens per parameter is not a constant, and how to plan a large run from small experiments.

Published Updated 39 min read
Scaling LawsChinchillaCompute
Animated sampled answers receiving binary rewards and advantages around the group mean.
Post-training · 04

Reinforcement Learning from First Principles

Policy gradients, baselines, advantages, GAE, trust regions, and PPO derived first, then translated into language-model rollouts.

Published Updated 58 min read
Reinforcement LearningPolicy GradientsPPO
Animated KL-temperature sweep moving a policy from its reference distribution toward higher-reward completions.
Post-training · 03

Teaching a Model What We Prefer

How comparisons become reward, why RLHF needs a KL leash, and how the same objective turns into DPO’s direct loss.

Published 54 min read
RLHFDPOPreference Learning
Animated group of reasoning rollouts receiving verifiable rewards and normalized relative advantages.
Reasoning Models · RLVR

How Reinforcement Learning Teaches Models to Reason

What changes when answers can be checked automatically: verifiers, GRPO, DeepSeek-R1, exploration, and the limits of short RL runs.

Published Updated 46 min read
RLVRGRPODeepSeek-R1
Animated comparison of one reasoning chain, sampled voting, tree search, and critique-and-revise loops.
Reasoning Models · Mechanisms

Thinking in Tokens

Why a familiar Transformer can buy serial compute by writing, what reasoning traces reveal, and when longer thought makes answers worse.

Published 44 min read
Chain of ThoughtSearchLatent Reasoning
Animated problem grid becoming solved as inference sampling compute rises and a coverage curve approaches its verifier ceiling.
Reasoning Models · Test-time Compute

How Models Improve Without Changing Their Weights

Longer chains, more samples, search, and verifiers—plus why the best inference budget depends on the prompt rather than one global setting.

Published 48 min read
Test-time ScalingVerificationCompute Allocation
Animated ML systems timeline revealing compute, memory, communication, synchronization, and input bottlenecks.
ML Systems · Profiling · 01

How to Find What Is Slowing Your Model

A practical method for reading timelines and counters, using PyTorch Profiler and Nsight, diagnosing Roofline regimes, and testing optimization hypotheses.

Published 38 min read
ProfilingNsightPerformance
Animated serving timelines comparing static and continuous batching across GPU slots.
ML Systems · Scaling the Workloads · 02

The Serving Playbook

Continuous batching, paged KV, prefix caching, chunked prefill, disaggregation, distributed serving, speculative decoding, and goodput under SLOs.

Published 62 min read
LLM ServingSchedulingPaged KV
Animated LLM inference timeline progressing from prefill through serial decode and a growing KV cache.
ML Systems · Understanding the Workloads · 02

The Mechanics of LLM Inference

Why inference becomes a different machine: autoregression, prefill, decode, KV cache, batching, bandwidth, latency metrics, quantization, and multimodal workloads.

Published 56 min read
InferenceKV CachePrefill & Decode
Animated pipeline-parallel schedule showing work distributed across a GPU cluster.
ML Systems · Scaling the Workloads · 01

The Parallelism Playbook

The six things a training workload can split, from DDP and ZeRO/FSDP through tensor, pipeline, context, expert, and hybrid parallelism.

Published 48 min read
Distributed TrainingParallelismFSDP & ZeRO
Animated memory ledger for the parameters, gradients, optimizer states, activations, and workspace in one transformer training step.
ML Systems · Understanding the Workloads · 01

Inside a Training Step

A first-principles walkthrough of tensor shapes, forward and backward passes, FLOPs, activation lifetimes, optimizer states, memory accounting, and checkpointing.

Published 29 min read
TrainingTransformersMemory
Animated ring AllReduce across GPUs connected through a communication hierarchy.
ML Systems · Understanding the Machine · 03

Talk Is Not Cheap

What changes when data is no longer local: PCIe, NVLink, NVSwitch, RDMA, topology, collective communication, and overlap.

Published 60 min read
PCIe & NVLinkInfiniBandCollectives
Animated Roofline chart comparing compute and memory-bandwidth limits.
ML Systems · Understanding the Machine · 02

Why Fast GPUs Still Wait for Memory

Arithmetic intensity and the Roofline model derived from first principles, then applied to GEMM, attention, fusion, optimizers, and real ML kernels.

Published 46 min read
RooflineArithmetic IntensityPerformance
Animated comparison of CPU and GPU execution, latency hiding, and memory hierarchy.
ML Systems · Understanding the Machine · 01

Why GPUs Are Built for Deep Learning

Why CPUs and GPUs spend their transistor budgets differently—and how execution hierarchy, latency hiding, memory access, tiling, and Tensor Cores follow from that choice.

Published 38 min read
CPU vs GPUParallelismGPU Architecture
Animated document patch lattice becoming a sequence of visual tokens.
Vision-language models

Inside a Modern Vision Encoder

What changed in the visual half of VLMs: intake geometry, resolution, objectives, connectors, and the encoders models actually ship.

Published Updated 42 min read
Vision EncodersVLMsMultimodal
Animated image patchification sequence comparing a Transformer with a Vision Transformer.
Architecture · Foundations

One Transformer, Two Modalities

A block-by-block comparison: tokenizing versus patchifying, lookup tables versus projections, positions, masks, and heads.

Published Updated 24 min read
TransformersViTAttention
Animated shifted-window attention sequence showing how a Swin Transformer groups and reconnects visual tokens.
Architecture · Computer vision

An Image Is a Sentence

How Vision Transformers see, from the first patch embedding through ViT, DeiT, PVT, Swin, video transformers, and the cost of attention.

Published Updated 48 min read
Vision TransformersAttentionVideo
Animated convolution kernel sliding across an image grid and accumulating an output feature map.
Architecture · Computer vision

Across the CNNVerse

Thirty years of convolutional architecture, from sliding-window arithmetic and receptive fields to ResNet, EfficientNet, and ConvNeXt.

Published Updated 58 min read
ConvolutionCNNsArchitecture
Animated timeline comparing how neural architectures move information from perceptrons through state-space models.
Architecture · Foundations

Evolution of ML Architectures

Sixty-seven years of neural architectures, including how information moves, what training costs, what inference carries, and how gradients flow backward.

Published Updated 64 min read
ArchitecturesComplexityState Space Models
Animated M-RoPE diagram assigning temporal, height, and width positions to multimodal tokens.
Deep Learning Foundations · 04

How Models Know Where They Are

Absolute, sinusoidal, relative, RoPE, NoPE, 2D and Fourier features, and multimodal M-RoPE—explained visually.

Published Updated 38 min read
Position EncodingRoPELong Context
Animated optimizer trajectories comparing how different update rules move across a loss landscape.
Deep Learning Foundations · 05

What an Optimizer Actually Does

A mechanical tour from SGD to Muon: how optimizers build an update, what their state costs, and where a training step stalls.

Published Updated 34 min read
OptimizersDistributed TrainingMemory
Animated point cloud showing how RMSNorm and LayerNorm transform a vector.
Deep Learning Foundations · 02

The Geometry of Normalization

Every normalization layer from BatchNorm to Peri-LN, plus why the modality interface in a VLM is a normalization problem.

Published Updated 45 min read
NormalizationTransformersTraining Stability
Animated activation-function curves and signal distributions from the Activation Atlas.
Deep Learning Foundations · 01

Why Neural Networks Need Nonlinearity

From sigmoid and ReLU to GELU, SwiGLU, and squared ReLU—with animated derivations and a map of what modern models use.

Published Updated 34 min read
Activation FunctionsTransformersOptimization