LSTM by Hand: A 15-step walkthrough of calculation

ProfTomYeh · x · 2026-08-26

Tom Yeh provided a step-by-step, hand-calculated demonstration of running an LSTM cell over a sequence of three inputs. The tutorial covers initialization, linear transformation, gating mechanisms (forget, input, output gates), memory cell updates, and hidden state output. The author notes that LSTMs were the most effective method for long sequences until Transformers, and recurrence is now back in fashion (e.g., Mamba) as attention doesn't scale well to hundreds of thousands of tokens.

Original post →

More from Research

Research channel →