Long short-term memory (LSTM)
A model that reads a sequence while controlling which information to keep or replace.
The fuller definition
A recurrent neural network architecture with gates that control what information is retained, updated, and exposed as a sequence is processed.
- Read
Process a token
- Gate
Update retained information
- Continue
Carry state forward
A simplified relationship, not a screenshot or a complete design.
A concrete example
An LSTM processes a sentence token by token while updating its state.
The distinction that matters
LSTMs were designed to preserve information across longer sequences; transformers offer different attention and parallel-training mechanisms.
Related terms
Neural network
A model made of linked layers of maths. Training adjusts its numbers so it can learn patterns from data.
FoundationsTransformer
The design most modern language models use. Its trick is letting every word in a passage look at every other word to work out what matters.
FoundationsToken
A piece of text, often part of a word, that the model actually works with. Models read and write tokens, not whole words.
Where it is taught
What actually happens when you ask AI a question?Source and further reading
Hochreiter & Schmidhuber · Long Short-Term Memory (Neural Computation, 1997)The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.