Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. Deep Learning /
  4. What is an RNN (Recurrent Neural Network)?
Deep Learning

What is an RNN (Recurrent Neural Network)?

Updated September 20, 2026 Read 4 min

A recurrent neural network (RNN) is a type of neural network designed for sequences such as text, speech and time series. It processes one step at a time and carries a hidden state, a kind of short-term memory, from each step to the next.

Contents 14
  1. 01Key takeaways
  2. 02An RNN explained in simple terms
  3. 03Why sequences need special networks
  4. 04How does an RNN work?
  5. 05A worked example: watching memory fade
  6. 06Types of RNN setups
  7. 07Training an RNN and the vanishing gradient problem
  8. 08How it was solved: LSTM and GRU
  9. 09RNNs vs transformers
  10. 10Where RNNs are still used
  11. 11Limitations
  12. 12Common Use Cases
  13. 13Frequently Asked Questions
  14. 14Related Terms

A recurrent neural network (RNN) is a type of neural network designed to process sequences, such as sentences, speech or time series, one step at a time. At each step it combines the new input with a hidden state carried over from the previous step, giving the network a form of memory. RNNs were the leading approach for language and speech before transformers arrived, and their ideas still shape modern sequence models.

Key takeaways

  • RNNs handle ordered data where earlier steps affect later ones.
  • The hidden state carries information forward through the sequence.
  • The same weights are reused at every time step.
  • Plain RNNs struggle with long sequences because of vanishing gradients; LSTMs and GRUs were designed to fix this.
  • Transformers replaced RNNs for most language tasks after 2017.

An RNN explained in simple terms

When you read a sentence, you do not start fresh at every word. By the time you reach “it” in “The dog chased the ball because it was fast”, you remember what came before and work out what “it” refers to. An RNN reads the same way: word by word, updating a running summary of what it has seen so far. That running summary is the hidden state.

Why sequences need special networks

A regular feedforward neural network takes a fixed-size input and has no sense of order or memory. But in many problems, order matters. “Dog bites man” and “man bites dog” contain the same words with different meanings. Tomorrow’s sales depend on the last few weeks. RNNs were built to capture this kind of dependence on earlier steps, and to handle sequences of any length.

How does an RNN work?

  1. Start with an initial hidden state, usually zeros.
  2. At step 1, combine input x₁ with the hidden state to produce a new hidden state h₁.
  3. Optionally, produce an output from h₁.
  4. At step 2, combine x₂ with h₁ to produce h₂, and so on.
  5. Repeat until the end of the sequence.

The core update is: hₜ = tanh(Wₓ·xₜ + Wₕ·hₜ₋₁ + b). The same weights Wₓ and Wₕ are used at every step. Drawn step by step, the network looks like a chain of identical copies, called “unrolling” the RNN.

A worked example: watching memory fade

Take a tiny RNN with a single number as its hidden state, input weight 0.5 and recurrent weight 0.8. Feed it the sequence 1, 0, 0.

  • Step 1: h₁ = tanh(0.5 × 1 + 0.8 × 0) = tanh(0.5) ≈ 0.46
  • Step 2: h₂ = tanh(0.5 × 0 + 0.8 × 0.46) = tanh(0.37) ≈ 0.35
  • Step 3: h₃ = tanh(0.8 × 0.35) = tanh(0.28) ≈ 0.28

The network still “remembers” the first input at step 3, but the signal is shrinking each step. Over dozens or hundreds of steps, the influence of early inputs can fade almost to nothing. That is the heart of the RNN’s biggest weakness.

Types of RNN setups

PatternInput → outputExample
One-to-manyOne input, a sequence outGenerating a caption from an image
Many-to-oneA sequence in, one outputSentiment of a review
Many-to-many (aligned)Output at every stepTagging each word’s part of speech
Many-to-many (encoder-decoder)Sequence in, different-length sequence outTranslating a sentence
BidirectionalReads forwards and backwardsUnderstanding a word using context on both sides

Training an RNN and the vanishing gradient problem

RNNs are trained with backpropagation through time (BPTT): the network is unrolled across the sequence, the error is calculated, and gradients flow backwards through every step. Because the same weights multiply the signal again and again, gradients tend to shrink towards zero (vanishing) or grow out of control (exploding). Vanishing gradients mean the network cannot learn links between events far apart, such as a subject at the start of a long paragraph and a verb at the end. Researchers including Sepp Hochreiter (1991) and Yoshua Bengio and colleagues (1994) analysed this problem in detail.

How it was solved: LSTM and GRU

  • LSTM (long short-term memory), introduced by Hochreiter and Jürgen Schmidhuber in 1997, adds a separate memory cell and gates that decide what to keep, forget and output.
  • GRU (gated recurrent unit), introduced in 2014, is a simpler gated design with fewer parameters that often performs similarly.

Exploding gradients are usually handled with gradient clipping, which caps gradient size during training.

RNNs vs transformers

AspectRNN / LSTMTransformer
ProcessingOne step at a timeAll positions at once
Training speedSlow; hard to paralleliseFast on GPUs
Long-range linksWeakens over distanceAttention links any two positions directly
Memory use per step at inferenceConstantGrows with context length

After the transformer architecture was introduced in 2017, it replaced RNNs for most language tasks, including large language models. However, recurrence has made a comeback in newer designs such as state space models, which aim to combine transformer-level quality with the RNN’s efficient, constant memory per step.

Where RNNs are still used

RNNs, LSTMs and GRUs remain useful for smaller time-series problems, streaming sensor data, on-device speech and keyboard prediction, and cases where memory and compute are tight.

Limitations

  • Struggle with long-range dependencies (plain RNNs especially).
  • Slow to train because steps must be processed in order.
  • Can suffer from vanishing or exploding gradients.
  • Generally outperformed by transformers on large language tasks.

Common Use Cases

01

Time-series forecasting

Predict demand, energy use or sensor readings from recent history.

02

Speech recognition on devices

Process audio streams step by step with low memory use.

03

Keyboard next-word prediction

Suggest the next word as a user types on a phone.

04

Sensor and IoT monitoring

Detect unusual patterns in continuous machine or health sensor data.

05

Sentiment analysis

Read a review word by word and classify its overall tone.

06

Music and sequence generation

Generate melodies or sequences one note or step at a time.

Frequently Asked Questions

A neural network that reads data one step at a time and carries a memory, called a hidden state, from each step to the next.

A set of numbers summarising what the network has seen so far in the sequence. It is updated at every step.

During training, gradients shrink as they flow back through many steps, so the network struggles to learn links between distant parts of a sequence.

An RNN is the basic recurrent design. LSTMs and GRUs add gates that control memory, helping them handle much longer sequences.

For most large language tasks, yes. RNNs are still used for smaller time-series and on-device tasks, and recurrence is returning in newer state space models.

Related Terms

  • LSTM
  • GRU
  • Transformer
  • Neural Network
  • Backpropagation Through Time
  • Time-Series Forecasting

Related AI Terms

What is a Variational Autoencoder (VAE)?A variational autoencoder (VAE) is a generative model that encodes data into a probability distribution rather than a…What is a GAN (Generative Adversarial Network)?A GAN (generative adversarial network) is a generative model made of two competing neural networks: a generator that…What is Backpropagation?Backpropagation is the algorithm neural networks use to learn. After a prediction, it works backwards from the error…What is a Diffusion Model?A diffusion model is a generative AI model that learns to create data by reversing a noising process:…What is an Autoencoder?An autoencoder is a neural network trained to compress its input into a small representation and then reconstruct…What is an Encoder in Deep Learning?An encoder is the part of a neural network that converts raw input, such as text, images or…

Contents

  1. 01Key takeaways
  2. 02An RNN explained in simple terms
  3. 03Why sequences need special networks
  4. 04How does an RNN work?
  5. 05A worked example: watching memory fade
  6. 06Types of RNN setups
  7. 07Training an RNN and the vanishing gradient problem
  8. 08How it was solved: LSTM and GRU
  9. 09RNNs vs transformers
  10. 10Where RNNs are still used
  11. 11Limitations
  12. 12Common Use Cases
  13. 13Frequently Asked Questions
  14. 14Related Terms

AI Topic

  • Deep Learning

Related Terms

  • What is a Variational Autoencoder (VAE)?
  • What is a GAN (Generative Adversarial Network)?
  • What is Backpropagation?
  • What is a Diffusion Model?
  • What is an Autoencoder?
  • What is an Encoder in Deep Learning?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
September 20, 2026
Read
4 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}