AI by Hand ✍️

AI by Hand ✍️

Depth

RNNs by Hand, in Excel

Prof. Tom Yeh's avatar
Prof. Tom Yeh
Sep 27, 2026
∙ Paid

Library › RNNs by Hand, in Excel

  1. Recurrence

  2. Size

  3. Outputs

  4. Depth

  5. Seq2Seq

  6. Tokens

  7. Autoregressive

  8. Loss

  9. Small Language Model

In the last three articles, our network had one hidden layer. How do we make it deeper? We can stack layers, each reading the hidden state of the layer below. Or we can read the sequence in both directions at once. Each example builds on one we have already seen, so we keep an eye on what stays the same.

d=1, h=1, h′=1, seq=5

We stack a second layer on top of the first. We mark it with a prime. Its hidden state is h′, and its weights are W′x, W′h and b′. At each step, layer 2 reads the hidden state hₜ from layer 1. It also reads its own state from the step before, h′ₜ₋₁. The output now comes from layer 2. Why does the h row match the last example of the first article? Because layer 1 is exactly that network.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Tom Yeh · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture