LSTM
Long short-term memory networks are gated RNNs designed to carry information over longer sequences. They maintain a hidden state and a cell state .
The standard update is:
The forget gate controls retained memory, the input gate controls new content, and the output gate controls exposed state.
Key Ideas
- LSTMs reduce the vanishing-gradient problem by giving memory an additive path through .
- They are sequential at inference and training unless special approximations are used.
- They remain useful baselines for streaming, low-latency, and smaller sequence tasks.
- In modern papers, they often appear as historical baselines against Transformers or state-space models.
Gate Interpretation
| Gate | Formula | Role |
|---|---|---|
| input gate | how much candidate content enters memory | |
| forget gate | how much previous memory is retained | |
| output gate | how much cell state is exposed as hidden state | |
| candidate | new content proposed from input and previous hidden state |
The additive memory path:
helps gradients move through time when stays near one.
Variants and Boundaries
| Variant | Difference | Check |
|---|---|---|
| bidirectional LSTM | reads past and future | invalid for causal generation |
| stacked LSTM | multiple recurrent layers | depth and dropout policy |
| peephole LSTM | gates also see cell state | compare parameter count |
| projected LSTM | lower-dimensional exposed hidden state | projection bottleneck |
When used as a baseline, record whether the baseline is tuned comparably to the proposed model.
Protein and Sequence Use
LSTMs can be used for residue sequence modeling:
or for sequence representation:
For protein claims, sequence identity split and family leakage matter more than the recurrent cell name.
Practical Checks
- Check whether the model is unidirectional or bidirectional.
- Track whether the output uses , pooled states, or token-level hidden states.
- Inspect truncation length for backpropagation through time.
- Compare against GRU when parameter count and speed matter.
- Is the cell state initialized, reset, or carried between chunks?
- Are long-sequence claims tested beyond the training truncation length?