All topics

GPT

Every post tagged “GPT”, newest first.

7 posts
GPT 10 min

GPT Math Explained: The Full Forward Pass Beyond Attention

How does GPT math actually work end to end? Follow one training step from token IDs through Q/K/V, multi-head attention, MLP, logits, cross-entropy loss, backprop, and AdamW — past O = Attention(Q,K,V).

Deep Learning 9 min

Cross-Entropy Loss Explained: From Logits to Language Model Training

What is cross-entropy loss? Derive softmax + negative log-likelihood step by step, work a 3-class numeric example, see why MSE fails for classification, and build the loss GPT training actually uses.

Deep Learning 11 min

Adam and AdamW Explained: How Modern LLMs Actually Update Their Weights

How does the Adam optimizer work? Derive momentum, RMSprop, and bias correction, see why AdamW decouples weight decay, and walk a one-parameter numeric update step by step.

Embeddings 15 min

Token Embeddings Explained: How LLMs Turn Token IDs Into Meaning Vectors

What is a token embedding? How LLMs map token IDs to learned vectors — the embedding matrix, gather lookup vs one-hot matmul, parameter counts, and a from-scratch NumPy implementation.

Positional Encoding 12 min

Positional Encoding Explained: How Transformers Learn Word Order

What is positional encoding in transformers? Why attention is order-blind, learned vs sinusoidal position embeddings, why we add instead of concatenate, and a from-scratch NumPy implementation.

Tokenization 21 min

Byte Pair Encoding (BPE) Explained: How GPT Tokenizers Turn Text Into Numbers

What is byte pair encoding (BPE)? Learn how GPT tokenizers split text into IDs — pretokenization, merge rules, byte-level vocab, and a from-scratch implementation you can actually debug.

Transformers 11 min

How GPT Actually Works: A Visual Guide to Transformers

How does a GPT actually work? A plain-English, visual walkthrough of transformers — tokens, word embeddings, why directions in vector space mean something, dot products, softmax and temperature — with the real GPT-3 numbers worked out.