GenAI by Hand — 5 Week Visual Study Plan
Inspired by and crediting Professor Tom Yeh’s "AI By Hand" series, this 5-week study plan helps engineers internalize modern generative AI architectures through small, hand-calculable numerical examples. Rather than treating attention heads, RoPE rotations, LoRA low-rank updates, or autoencoders as black boxes, you trace matrix dimensions and weights step by step across five structured weeks—making it ideal preparation for technical AI interviews.
Full Illustrated Walkthroughs (13)
Batch Normalization
Batch Normalization stabilizes and accelerates deep network training by normalizing each feature dimension across a mini-batch to zero mean and unit variance, then applying learnable scale (gamma) and shift (beta) parameters. During inference, it replaces mini-batch statistics with exponential moving averages of the population mean and variance accumulated during training.
SVM
A Support Vector Machine (SVM) finds the maximum-margin hyperplane separating classes, relying solely on critical boundary points called support vectors. While a linear SVM scores samples via direct inner products in input space, an RBF (Gaussian) kernel SVM measures similarity as exp(-||x - x_c||^2 / (2 sigma^2)), implicitly mapping data into an infinite-dimensional feature space for non-linear decision boundaries.
Autoencoder
An autoencoder is a self-supervised neural network made of an encoder that compresses inputs into a lower-dimensional latent bottleneck and a decoder that reconstructs the original input from that representation. Because the input itself acts as the training target, this self-supervised paradigm also underpins masked representation learning and contrastive multimodal pretraining.
Dropout
Dropout regularizes neural networks by randomly zeroing neuron activations with probability p during each training forward pass, preventing co-adaptation and acting as implicit model averaging across thinned subnetworks. With modern inverted dropout, surviving activations are scaled by 1 / (1 - p) during training so their expected value matches inference without requiring scaling at test time.
Generative Adversarial Network
A Generative Adversarial Network (GAN) trains a generator and a discriminator in an adversarial game where the discriminator distinguishes real samples from synthetic fakes and the generator learns to fool it. With binary cross-entropy loss and a sigmoid output p = sigma(z), the gradient with respect to the pre-sigmoid logit simplifies cleanly to p - y, while the generator typically minimizes a non-saturating objective with target y = 1.
Variational Auto Encoder (VAE)
A Variational Autoencoder (VAE) maps each input to a probabilistic latent distribution parameterized by mean mu and standard deviation sigma, sampling latent codes z = mu + sigma * epsilon via the reparameterization trick so gradients remain differentiable. Training optimizes the Evidence Lower Bound (ELBO), balancing a reconstruction loss (updating both decoder and encoder) against a KL-divergence term that regularizes the latent space toward N(0, I).
Reinforcement Learning with Human Feedback (RLHF)
Reinforcement Learning with Human Feedback (RLHF) aligns a language model with human preferences by training a Bradley-Terry reward model on pairwise human rankings and then optimizing the LLM policy to maximize predicted reward. Because discrete token sampling is non-differentiable, practical RLHF uses policy-gradient reinforcement learning such as PPO with a KL-divergence penalty to prevent drifting too far from the base SFT model.
Self Attention
Self-attention enables every token in a sequence to aggregate contextual information from all other tokens in parallel. Each token projects into Query (Q), Key (K), and Value (V) vectors, and softmax-normalized scaled dot products between Q and K weight the V vectors into updated token representations.
Transformer
A Transformer block alternates between two complementary operations: self-attention mixes information horizontally across token positions using learned attention weights, while a position-wise Feed-Forward Network (FFN) transforms feature dimensions vertically at each token independently. Simplified examples like X_1 + X_2 illustrate token mixing conceptually; in real Transformers, each output is a softmax-weighted sum of Value vectors followed by residual connections and layer normalization.
Vector Database
A vector database indexes high-dimensional embeddings of text, images, or other unstructured data using Approximate Nearest Neighbor (ANN) structures such as HNSW or IVF so semantic queries execute in milliseconds. At query time, the input is embedded into the same vector space and compared against stored entries via dot product, cosine similarity, or L2 distance to retrieve top-k context for RAG and search.
CLIP
CLIP (Contrastive Language-Image Pre-training) aligns images and text in a shared embedding space by maximizing cosine similarity for matched pairs and minimizing it for mismatched pairs in a mini-batch via symmetric InfoNCE cross-entropy loss. Under softmax and cross-entropy against an identity-matrix target, the gradient with respect to similarity logits simplifies cleanly to p_i - y_i.
OpenAI Strawberry (RLHF + CoT)
OpenAI o1 (codenamed Strawberry) combines reinforcement learning with internal Chain-of-Thought (CoT) reasoning so the model generates hidden reasoning tokens before emitting a final answer. Unlike traditional RLHF that optimizes single-pass response preferences, o1 uses large-scale reinforcement learning—largely driven by verifiable outcome rewards—to refine multi-step reasoning and trade extra test-time compute for higher accuracy.
Sora's Diffusion Transformer
Sora's Diffusion Transformer (DiT) generates video by replacing convolutional U-Nets with a Transformer operating directly on spacetime patches in a compressed latent space. Adaptive layer normalization (adaLN) conditions each block on the diffusion timestep and text prompt embeddings so the model iteratively denoises random Gaussian noise into clean video latents before decoding to pixels.
Complete 5-Week Syllabus (27 Topics)
| Week 1 | Backpropagation | Fundamentals | Visit |
| Week 1 | Batch Normalization | Fundamentals | Visit |
| Week 1 | Gradient | Fundamentals | Visit |
| Week 1 | Matrix Multiplication | Fundamentals | Visit |
| Week 1 | Multi-Layer Perceptron (MLP) | Fundamentals | Visit |
| Week 1 | Softmax | Fundamentals | Visit |
| Week 1 | SVM | Fundamentals | Visit |
| Week 2 | Autoencoder | Autoencoders | Visit |
| Week 2 | Dropout | Fundamentals | Visit |
| Week 2 | Generative Adversarial Network | GANs | Visit |
| Week 2 | LSTM | Fundamentals | Visit |
| Week 2 | Mixture of Experts (MoE) | Fundamentals | Visit |
| Week 2 | Recurrent Neural Network | Fundamentals | Visit |
| Week 2 | Variational Auto Encoder (VAE) | Autoencoders | Visit |
| Week 3 | Reinforcement Learning with Human Feedback (RLHF) | LLM | Visit |
| Week 3 | Self Attention | Transformer | Visit |
| Week 3 | Transformer | Transformer | Visit |
| Week 4 | Beginner's Guide to Multi-Agents | Agent | Visit |
| Week 4 | Beginner's Guide to RAG | RAG | Visit |
| Week 4 | Beginner's Guide to RAG Agents | RAG | Visit |
| Week 4 | Beginner's Guide to RAG Evaluation | RAG | Visit |
| Week 4 | Query Rewriting RAG | RAG | Visit |
| Week 4 | Vector Database | RAG | Visit |
| Week 5 | AlphaFold | Generative Models | Visit |
| Week 5 | CLIP | Multimodal Models | Visit |
| Week 5 | OpenAI Strawberry (RLHF + CoT) | LLM | Visit |
| Week 5 | Sora's Diffusion Transformer | Multimodal Models | Visit |
No matching entries found. Try clearing a filter.
Frequently Asked Questions
Who is the GenAI by Hand 5-week study plan designed for?
It works best for learners who already know basic Python or ML fundamentals and want concrete, pencil-and-paper intuition for Transformers, LLMs, RAG, and diffusion models before technical interviews.
How is the 5-week GenAI curriculum organized?
Week 1 covers core neural building blocks (dot products, softmax, backpropagation); Week 2 covers classic architectures; Week 3 dives into Transformers and attention; Week 4 explores LLMs, LoRA, and agents; and Week 5 covers diffusion and generative vision models.