← AI glossary

AI glossary · Basic · Language models · Speech & audio

RNN

An RNN (recurrent neural network) is an artificial neural network that reads ordered data such as sentences or speech one piece at a time, carrying what it has seen so far forward as 'memory' for the next decision.

About this term
Level
Basic · Technical terms you often meet in AI news
Added
2026-10-08
In plain words It is similar to reading a book word by word while continually updating the plot in your head. However, an RNN's memory is much shorter than a person's, so things read long ago fade easily.

How it works

An RNN receives input one item at a time (for example, one word at a time). At each step, it combines the current input with the memory so far to create a new memory, called the hidden state. Because this memory keeps being passed on to the next step, it is called 'recurrent'. Based on the memory at the final step, it produces a result, such as predicting the next word or classifying the sentiment of a sentence.

How an RNN reads a sentenceWord 1 → Memory 1; Word 2 → Memory 2; Word 3 → Memory 3; Memory 1 → Memory 2(Pass memory); Memory 2 → Memory 3(Pass memory); Memory 3 → OutputWord 1IWord 2a mealWord 3ateMemory 1Hidden StateMemory 2Hidden StateMemory 3Hidden StateOutputNext-word prediction,etc.Pass memoryPass memory
How an RNN reads a sentence Words in the top row come in one at a time, and the memory (hidden state) in the bottom row is passed to the right and updated. The sentence is an example.

Why it matters

Ordinary neural networks have a fixed input length and do not specifically account for order. RNNs can process sentences or sounds of varying lengths in order, so they were once the basic tool for translation, speech recognition and text generation. Improved variants such as LSTM and GRU were developed to reduce the problem of memory fading quickly, and became widely used. As the starting point for handling sequential data with neural networks, RNNs are still taught as a foundational concept.

Things to know

RNNs have the weakness that information from the beginning of a sentence is poorly carried forward as the sentence gets longer. They also have to process words one at a time in order, which makes parallel computation on GPUs difficult and training slow. Because of these limits, most of today's LLMs use transformers. However, architectures that efficiently revive the idea of 'processing in order while carrying memory forward', such as recent state space models, are drawing attention again.

Example

RNN-family models (especially LSTM) were widely used for next-word suggestions in early smartphone keyboards, speech recognition in voice assistants, online translators and more. Many have since been replaced by transformers, but they are still used for lightweight analysis of time-ordered data such as sensor data or stock prices.

Related terms