A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Recurrent Neural Networks

Graduate Depth 104 in the knowledge graph ☐ I know this ☆ Set as goal
6topics build on this
774prerequisites beneath it
See this on the map →
Backpropagation AlgorithmActivation Functions in Neural Networks+6 more→→Gated Recurrent Units (GRU)LSTM and Gated Recurrent Units+1 more
deep-learning sequence-models neural-networks

Core Idea

RNNs process sequences maintaining hidden states updated at each time step. Information propagates temporally enabling sequence modeling. Backpropagation through time (BPTT) unfolds the network across time but suffers from vanishing/exploding gradients.

Explainer

Standard feedforward neural networks process fixed-size inputs — give them a vector, get an output. But many real-world problems involve sequences: words in a sentence, stock prices over time, notes in a melody. The length varies, and the order matters. Recurrent neural networks solve this by introducing a loop: the network maintains a hidden state that gets updated at each time step, carrying information forward through the sequence. Think of it as the network having a form of memory — at each step, it sees the current input *and* a summary of everything it has seen so far.

At each time step *t*, the RNN computes a new hidden state h(t) = f(W_h · h(t-1) + W_x · x(t) + b), where x(t) is the current input, h(t-1) is the previous hidden state, and W_h and W_x are weight matrices shared across all time steps. This weight sharing is crucial — the same parameters process every position in the sequence, which means the network can generalize across positions and handle sequences of any length. If you are comfortable with matrix operations and how backpropagation computes gradients, you already have the tools to understand this computation: it is just a sequence of matrix multiplies and nonlinear activations, chained together through time.

Training an RNN requires backpropagation through time (BPTT): you "unroll" the recurrent loop into a deep feedforward network with one layer per time step, then apply standard backpropagation. The catch is that for a sequence of length T, the gradient must flow backward through T matrix multiplications. This is where the vanishing gradient problem strikes — if the weight matrix W_h has eigenvalues less than 1, the gradient shrinks exponentially, making it nearly impossible to learn long-range dependencies. Conversely, eigenvalues greater than 1 cause exploding gradients, which can be managed with gradient clipping but still make training unstable. From your study of partial derivatives, you can see why: the chain rule applied across many time steps multiplies many Jacobian terms together, and repeated multiplication drives values toward zero or infinity.

These gradient problems motivated the development of gated architectures like Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRU), which use learned gates to control information flow and maintain gradients over longer sequences. While transformers have largely superseded RNNs for many tasks, understanding the recurrent paradigm — how hidden states carry temporal information, why gradient flow through time is challenging, and how gating mechanisms address it — provides essential context for understanding why modern sequence architectures are designed the way they are.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Weak Law of Large Numbers → Probability Axioms and Rules → Conditional Probability → Conditional Distributions → Conditional Expectation → Markov Chains → Markov Decision Processes → Introduction to Reinforcement Learning → Policy Gradient Methods → Policy Networks and Policy Gradients → Actor-Critic Methods → Temporal Difference Learning → Q-Learning Algorithm → Deep Q-Networks (DQN) → Recurrent Neural Networks

Longest path: 105 steps · 774 total prerequisite topics

Prerequisites (8)

Leads To (3)