Viqus Logo Viqus Logo
Home
Categories
Language Models Generative Imagery Hardware & Chips Business & Funding Ethics & Society Science & Robotics
Resources
AI Glossary Academy CLI Tool Labs
About Contact
Back to Glossary
Deep Learning Intermediate Also: RNN

Recurrent Neural Network (RNN)

Definition

A neural network architecture designed for sequential data that maintains a hidden state — a form of memory — allowing it to incorporate context from previous inputs when processing each new element.

In Depth

Standard neural networks process each input independently — they have no memory. A Recurrent Neural Network breaks this limitation by maintaining a hidden state: an internal vector that summarizes information from all previous inputs in the sequence. At each time step, the network receives the current input and the previous hidden state, combines them, and produces a new hidden state. This feedback loop gives RNNs a form of short-term memory that makes them natural for sequential tasks.

RNNs were the dominant architecture for Natural Language Processing tasks in the 2010s — language translation, text generation, sentiment analysis — precisely because language is sequential. Each word's meaning depends on the words before it. RNNs capture this dependency by threading the hidden state through every word in the sentence. However, they suffer from the vanishing gradient problem: as sequences grow longer, gradients shrink exponentially during backpropagation, making it hard to learn dependencies spanning many time steps.

LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Unit) networks were developed to address this limitation, using gating mechanisms to selectively retain or forget information over long sequences. However, even LSTMs are largely superseded in NLP by the Transformer architecture, which processes entire sequences in parallel using attention mechanisms and scales far more efficiently on modern hardware. RNNs and LSTMs still see use in embedded systems, audio processing, and applications requiring low latency sequential inference.

Key Takeaway

RNNs gave neural networks memory — the ability to use context from the past when interpreting the present — unlocking sequential tasks like language, audio, and time series modeling.

Real-World Applications

01 Language modeling: early neural language models using RNNs to predict the next word in a sequence for text generation.
02 Machine translation: sequence-to-sequence RNN models that encode a sentence in one language and decode it in another.
03 Speech recognition: RNNs processing audio frames sequentially to transcribe speech to text in real time.
04 Music generation: RNNs trained on MIDI data to generate melodically consistent musical sequences.
05 Time series forecasting: predicting stock prices, energy demand, or sensor readings from historical sequential data.

Frequently Asked Questions

Why were RNNs important for NLP?

Language is inherently sequential — the meaning of a word depends on the words before it. RNNs were the first neural architecture to maintain a memory (hidden state) of previous inputs, making them natural for language tasks like translation, generation, and sentiment analysis. They dominated NLP from roughly 2013 to 2017, before Transformers took over.

What is the vanishing gradient problem in RNNs?

When backpropagating through many time steps, gradients are multiplied repeatedly and can shrink exponentially to near zero. This means RNNs struggle to learn long-range dependencies — the influence of a word at the beginning of a long sentence may vanish by the time the network processes the end. LSTMs and GRUs were designed to solve this with gating mechanisms.

Are RNNs still used in 2025?

Rarely for NLP, where Transformers have largely replaced them. However, RNNs (especially LSTMs) remain used in real-time time series applications, edge devices with memory constraints, and some speech processing tasks. Recent architectures like Mamba (state-space models) revive RNN-like sequential processing with better scaling properties.