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

Deep Q-Networks (DQN)

Research Depth 103 in the knowledge graph ☐ I know this ☆ Set as goal
17topics build on this
773prerequisites beneath it
See this on the map →
Convolutional Neural NetworksQ-Learning Algorithm→→Generative Adversarial NetworksRecurrent Neural Networks+1 more
reinforcement-learning deep-learning value-based-methods atari-games

Core Idea

Deep Q-Networks use neural networks to approximate Q-value functions in high-dimensional state spaces like images, enabling learning of complex control policies. Key innovations include experience replay (a memory buffer that breaks correlation between samples) and target networks (separate network that stabilizes training by reducing moving target problem), making deep RL practical.

How It's Best Learned

Implement DQN with experience replay and train it on an Atari game or simple environment to understand how the algorithm handles high-dimensional states and long-term credit assignment.

Explainer

From Q-learning, you know the core idea: maintain a table Q(s, a) estimating the expected future reward for taking action a in state s, and update it using the Bellman equation as you interact with the environment. This works well when the state space is small enough to visit every state repeatedly — a grid world, a simple game. But consider an Atari game where the state is a 210×160 pixel image with 128 possible colors per pixel. The number of possible states is astronomically large, and you will never visit the same exact screen twice. A Q-table is hopeless here, which is why Deep Q-Networks (DQN) replace the table with a neural network that takes a state (raw pixels) as input and outputs Q-values for every possible action.

The idea of function approximation for Q-values is natural, but early attempts at combining neural networks with Q-learning were notoriously unstable. DQN introduced two innovations that made it work. The first is experience replay: instead of learning from each transition (s, a, r, s') immediately and then discarding it, DQN stores transitions in a large memory buffer and samples random minibatches for training. This breaks the temporal correlation between consecutive samples — without replay, the network sees a stream of highly correlated states (consecutive game frames), which causes it to overfit to recent experience and forget earlier lessons. Random sampling from the buffer produces a more i.i.d.-like training distribution, which is what gradient descent expects.

The second innovation is the target network. In standard Q-learning, the same Q-function is used both to select actions and to compute the target value (r + γ max Q(s', a')). When Q is a neural network, updating the weights to better match today's targets immediately changes tomorrow's targets, creating a moving-target problem that can cause oscillation or divergence. DQN solves this by maintaining a separate copy of the network — the target network — whose weights are frozen and only updated periodically (every few thousand steps) by copying from the main network. This makes the targets temporarily stationary, giving the main network a stable objective to learn against.

With these two techniques, DQN achieved human-level performance on dozens of Atari games, learning directly from raw pixel inputs with no game-specific engineering. The agent receives only the screen image and the score, and it must discover through trial and error which sequences of joystick actions lead to high scores. The convolutional layers (from your CNN prerequisite) extract spatial features from the game frames, and the fully connected layers map those features to Q-values for each possible action. The significance of DQN extends beyond game-playing — it demonstrated that deep reinforcement learning could scale to high-dimensional perception problems, launching the modern era of deep RL and inspiring subsequent algorithms like Double DQN, Dueling DQN, and Prioritized Experience Replay that addressed remaining limitations.

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)

Longest path: 104 steps · 773 total prerequisite topics

Prerequisites (2)

Leads To (3)