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

Recurrent Neural Networks

Graduate Depth 117 in the knowledge graph ☐ I know this ☆ Set as goal
6topics build on this
849prerequisites 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 → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → 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 → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Regular Language Recognition Algorithms → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Context-Free Grammar Properties and Ambiguity → Parse Trees, Derivations, and Ambiguity in CFGs → Context-Free Grammars in Compiler Design → Abstract Syntax Trees (ASTs) → Symbol Tables and Scope Resolution → Semantic Analysis Phase → Scope and Binding Resolution → Scope, Shadowing, and Variable Lifetime → Parameter Passing: Value vs. Reference → Two-Dimensional Arrays → Graph Representations: Adjacency List vs. Adjacency Matrix → Depth-First Search (DFS) → Depth-First Search: Implementation and Applications → Topological Sort → Dynamic Programming → 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: 118 steps · 849 total prerequisite topics

Prerequisites (8)

Leads To (3)