learning ai from scratch, in order.
the resources that actually helped, laid out in the order i'm going through them — from "what is a neural net" all the way to building a transformer block.
how to use this: go watch → read → build. papers are the last pass, not the first; read only the sections named here, then return to them after the implementation works.
foundation · already covered
1 · intuition
see what a neural net actually is before writing a line of code.
2 · build one from scratch
write a neural net by hand — no framework, just numpy and math.
3 · pytorch
learn tensors, autograd, modules, optimizers, and the training loop.
4 · cnn checkpoint
finish the image-model chapter before changing from spatial structure to ordered sequences.
you understand this when: you can calculate a convolution's output shape and explain what weight sharing buys you.
bridge · recurrence
5 · sequence data & language modeling
images arrive all at once; sequences have order, variable length, and a prediction target at each or every time step.
you understand this when: you can distinguish many-to-one, one-to-many, and many-to-many sequence tasks and define perplexity.
6 · vanilla rnns
one recurrent cell, shared across time, turns the previous hidden state and current token into the next state.
you understand this when: you can write ht = tanh(Wxhxt + Whhht−1 + b) and trace batch, time, input, and hidden shapes.
7 · bptt & the gradient problem
unrolling makes an RNN a deep network with shared weights; repeated Jacobians make long-range learning unstable.
you understand this when: you can explain why gradients vanish or explode, what truncation forgets, and what clipping does and does not fix.
8 · lstm & gru
gates create easier paths for information and gradients, allowing the model to keep or overwrite memory deliberately.
you understand this when: you can explain every gate, compare LSTM with GRU, and say why the cell state helps long-range gradients.
9 · bidirectional rnns & sequence classification
stack layers for capacity, read both directions when the whole input is available, then turn a sequence into one prediction.
you understand this when: you can choose the right final representation for classification and explain when bidirectionality leaks future information.
bridge · from recurrence to attention
10 · encoder-decoder & seq2seq
an encoder compresses an input sequence; an autoregressive decoder turns that representation into a different-length output.
you understand this when: you can trace encoder state into decoder steps and explain teacher forcing, inference, and the fixed-context bottleneck.
11 · attention over recurrent states
instead of one fixed context vector, each decoder step scores every encoder state and mixes the relevant ones.
you understand this when: you can calculate alignment scores, normalize them, form a context vector, and explain what bottleneck disappeared.
current chapter · self-attention and transformers
12 · self-attention & q/k/v
tokens now attend directly to other tokens: a query asks, keys advertise, and values carry the information to mix.
you understand this when: you can explain Q, K, and V without analogy, calculate one attention row by hand, and trace every matrix shape.
13 · masks & multi-head attention
scaling stabilizes logits, masks control which tokens are visible, and parallel heads learn different representation subspaces. you are here.
you understand this when: you can implement split → attend → concatenate, distinguish padding from causal masks, and explain the √dk scale.
14 · position & the transformer block
self-attention has no built-in order; positional information, residual paths, normalization, and a token-wise MLP complete the block.
you understand this when: you can draw the entire block, place both residual paths correctly, and explain why position must be injected.
15 · the full encoder-decoder transformer
encoder self-attention builds contextual source states; decoder masked self-attention generates; cross-attention connects the two.
you understand this when: you can identify Q/K/V in all three attention sites and compare recurrence with attention on parallelism and path length.
16 · build one transformer block
finish by implementing the architecture yourself and proving that every tensor and mask does what you think it does.
you are done with this path when: given (batch, time, dmodel), you can implement one decoder-only block and narrate every reshape, matrix multiply, mask, residual, and output.
following the same path? — @arhamamiin