05
From cell to model
Learned weights choose the gates. A separate task readout turns hidden features into a prediction.
The same weights, new decisions
In the standard cell, concatenate the previous hidden state and current input into . The semicolon means stacking the column vectors. Learned weighted sums plus biases produce three gates and the candidate:
Here is sigmoid. These are the standard gate equations written with combined input/hidden matrices. The previous cell state enters the subsequent retain/write update; it does not directly enter these gate equations in our no-peephole variant.
Check the vector sizes
With input width and state width , has coordinates. Each combined matrix has shape , and each bias has coordinates. Thus every gate and candidate has the same width as the cell state.
This is a mathematical convention, not a requirement for a library's physical weight or bias layout. Each coordinate gets its own multipliers; they need not correspond to human-named facts.
The parameters are shared across steps, but and vary, so the resulting gates can vary. An ordinary forward pass changes states, not weights. Training uses a loss, computes gradients through the unrolled computation—backpropagation through time, or BPTT—and updates the shared parameters. See §1.1 and Fig. 2; our lab performs none of that training.
The output gate is not the answer
An LSTM produces hidden-state features. A separate task readout can turn selected features into a prediction—for example, a forecast at each step or a classification from a final hidden state. That design choice is distinct from the internal output gate. The documented LSTM outputs are states; Gers et al., §2.1, Eq. (7) give an example with a separate output layer.
In our cue story, “read” is only an inspection point. No task head interprets the cell as a word, an answer, or a probability. To build a predictive system, we would need an input representation, a readout, a training objective, and evaluation on the actual task.
Try a new update
Leave the lab's fixed sequence. Suppose the previous cell value is , with , , , and . What are the retained contribution, written contribution, new cell state, and hidden state?
Then stipulate one more step with , , and . What becomes visible? The exact endpoints are the same idealization used in the lab.
Work through the answer
The hidden value is zero, but the cell value is not. At the stipulated next step, the entire cell value is retained and no new value is written:
A closed output gate did not erase the current cell. We could read it later because the next gates were stipulated. A learned recurrent model could choose different next gates as a consequence of the changed hidden state.
Keep the mechanism in view
An LSTM is a learned recurrent update with a useful separation: retain old state, write a candidate, expose a transformed view. Cell state and hidden state are related, but not interchangeable.
When reading an LSTM diagram or implementation, trace those two states first. Then ask what computes the gates, where the prediction comes from, and which assumptions support any claim about long-term memory.