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

GateFormulaRole
input gatehow much candidate content enters memory
forget gatehow much previous memory is retained
output gatehow much cell state is exposed as hidden state
candidatenew content proposed from input and previous hidden state

The additive memory path:

helps gradients move through time when stays near one.

Variants and Boundaries

VariantDifferenceCheck
bidirectional LSTMreads past and futureinvalid for causal generation
stacked LSTMmultiple recurrent layersdepth and dropout policy
peephole LSTMgates also see cell statecompare parameter count
projected LSTMlower-dimensional exposed hidden stateprojection 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?