What it is
A recurrent neural network (RNN) reads a sequence one item at a time and keeps a hidden state, a kind of memory of what it has seen so far. LSTM is a version designed to keep information over longer stretches.
What it is for
Data where order matters: text, speech, sensor readings, music. Transformers now handle most language tasks, but RNN and LSTM ideas explain why sequences are hard, and they can still be a light choice for small streams of data.
How to do it
- Turn each item into numbers (words become vectors, see Word embeddings).
- Feed the sequence step by step: at each step the network mixes the new item with its memory.
- Read the output you need: one answer at the end (for example the sentiment of a review) or one per step (for example a tag for every word).
- Train with backpropagation through the steps in time.
- For long sequences prefer an LSTM or a transformer: a plain RNN has trouble remembering the beginning.