🧭 Roadmap › 🧠 Anatomy of AI
System Anatomy

Anatomy of an AI System

Demystifying how a Large Language Model works operationally. Discover the core training loops, forward-pass inference channels, and computational resource dynamics that power the bleeding edge.

👨‍🎓

Training (Learning)

The Model is a "Student"

The model consumes vast, unstructured corpuses of text, iteratively calculates gradients via backpropagation, and adjusts its internal parameters (weights) to minimize next-token prediction loss.

Bound by: Compute power (FLOPs)
🎓

Inference (Thinking)

The Model is a "Graduate"

The model's weights are frozen (static). It accepts a context prompt (input), executes a forward-pass-only mathematical routing, and generates probability distributions over the vocabulary to output a single token.

Bound by: Memory Bandwidth

🔄 The 11-Step LLM Training & Parameter Loop

How an LLM scales from raw Internet data to a pre-trained, high-impact cognitive predictor

LLM Training Pipeline - 11 Steps Animation View

01 Data Collection

Gathering massive datasets (billions of sentences) from diverse sources like books, Wikipedia, articles, conversation logs, and repositories to teach the model vocabulary, facts, and code patterns.

02 Preprocessing

Cleaning raw data. Removing duplicates, filtering out low-quality sequences, normalizing text encodings, and splitting files into standardized training segments.

03 Tokenization

Converting clean text strings into discrete, numeric subwords (Tokens) and assigning them distinct indices (Token IDs) in the pre-trained dictionary lookup table.

04 Embeddings

Mapping Token IDs to dense, learned, high-dimensional floating-point vectors. This is the geometric space where word meanings and semantic neighborhoods live.

05 Transformer Layers

Routing embeddings sequentially through multiple stacked blocks consisting of Self-Attention, Feed Forward neural expansions, and Normalization layers.

06 Attention Block

The core engine enabling tokens to compute pairwise relational matrices to assign importance, building context-aware dynamic embeddings across long contextual spans.

07 Next Token Prediction

Performing a forward pass where the model receives prompt tokens and generates raw unnormalized confidence values (logits) over every possible word in the vocabulary.

08 Loss Function

Measuring the prediction error. Comparing predicted logits against the correct target word using Cross Entropy Loss to calculate exactly how wrong the model is.

09 Backpropagation

Propagating the calculated loss backward through the layers of the model using calculus chain rules to determine the exact gradients of every individual model parameter.

10 Update Parameters

Applying optimizers (like AdamW) to subtract gradients multiplied by the learning rate from the parameters, shifting the model's weights to make better future predictions.

11 Repeat & Trained LLM

Repeating steps 7–10 over billions of sequences across multiple training epochs. Over time, loss drops, and the model emerges as a highly capable pre-trained LLM.

⚡ Transformer Architecture: From Tokens to Context

How the neural engine converts isolated token vectors into unified, context-aware representations

🗺️ The 3-Act AI Inference Journey in Your Curriculum

Act I

The Math & Forward Pass

How a model processes raw inputs to produce a single next-token probability distribution (Logits). Handled in mathematical foundations.

Explore Area 03 →
Act II

Autoregressive Decoding

How a model strings generated outputs together sequentially, controlling creativity with temperature, Top-K, and nucleus sampling.

Explore Area 04 →
Act III

Systems Optimization

How we scale the generation loop using KV Caching, Continuous Batching, and Quantization to run fast and cheap in production.

Explore Area 07 →
← Back to Prioritized Roadmap