This Reinforcement Learning concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Reinforcement Learning
Deep Q-Learning
Deep Q-learning turns Q-learning into neural value learning by training on replay-buffer samples, bootstrapping from a frozen target network, and watching for max-target overestimation.
Concept Structure
Deep Q-Learning
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
2 prerequisites listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Tabular Q-learning had one number for every state-action pair. Function approximation let nearby pairs share credit. Deep Q-learning takes the next step: replace the table with a neural network that receives a state and outputs one estimated value for each discrete action.
That change is necessary for images, long observations, and large state spaces, but it also makes the old Q-learning update more fragile. The target contains a value estimate from the same kind of model that is being trained. Consecutive experience is highly correlated. The max over next actions can prefer whichever action is accidentally overestimated.
DQN is the classic stabilization recipe:
- Put transitions into a replay buffer instead of learning only from the newest step.
- Sample minibatches from that buffer so updates mix many past behaviors.
- Use an online network for the value being updated.
- Use a separate target network for the bootstrap value, copying online weights into it only every so often.
So the learner's mental picture should not be "a bigger Q-table." It should be a small training circuit:
sampled transition -> target network target -> online network loss -> occasional target copy
The target network does not make the target true. It makes the target less rapidly moving. Replay does not make data independent. It reduces the worst correlation by training from older and newer transitions together. These are engineering stabilizers wrapped around the same Bellman idea you already know.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let be the online neural action-value function with parameters . In many DQN implementations the network receives and outputs a vector
one value per discrete action. A replay buffer stores transitions
where means the sampled transition ended an episode. DQN samples a minibatch from this buffer and builds a target for each transition.
The target network has parameters , held fixed for several gradient steps. The one-step DQN target is
The online network is trained to make the value of the sampled action match this target:
A gradient step changes to reduce this squared TD error, while stays fixed during that step. Periodically, DQN copies
This is still off-policy Q-learning. The replay buffer can contain transitions produced by older behavior policies, while the target uses a greedy max over the target network. That max is useful, but it also creates a bias risk: when action values are noisy, tends to select positive errors. Double DQN addresses that by using the online network to choose the next action and the target network to evaluate it, but plain DQN is the concept to understand first.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import torch
gamma = 0.90
# A minibatch of three replay-buffer transitions.
actions = torch.tensor([1, 0, 2])
rewards = torch.tensor([0.40, -0.10, 1.20])
dones = torch.tensor([0.0, 0.0, 1.0])
# Values from the online network for the sampled states.
q_online = torch.tensor([
[0.70, 1.12, 0.20],
[0.30, 0.10, 0.05],
[0.40, 0.80, 1.60],
], requires_grad=True)
# Values from the frozen target network for the next states.
q_target_next = torch.tensor([
[1.10, 1.55, 0.20],
[0.40, 0.90, 0.30],
[2.00, 1.30, 0.70],
])
q_taken = q_online.gather(1, actions[:, None]).squeeze(1)
next_best = q_target_next.max(dim=1).values
target = rewards + (1.0 - dones) * gamma * next_best
loss = ((target.detach() - q_taken) ** 2).mean()
loss.backward()
print("targets:", target.round(decimals=3).tolist())
print("q taken:", q_taken.detach().round(decimals=3).tolist())
print("loss:", round(loss.item(), 3))
print("gradient on q_online:", q_online.grad.round(decimals=3))
The terminal transition ignores the bootstrap term. The nonterminal transitions bootstrap from the target network, not from the changing online network. In a real DQN, the tensors come from neural network forward passes and an optimizer updates the online network weights.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the Deep Q-Learning Replay Target Lab to predict which stabilizer matters in a sampled update.
Choose a case, inspect the replay-buffer sample, compare online and target-network next-action values, then commit before reveal. The lab unlocks the target calculation, TD error, approximate scalar update, and the caveat attached to the sampled transition.
Live Concept Demo
Explore Deep Q-Learning
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Deep Q-Learning should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Deep Q-learning turns Q-learning into neural value learning by training on replay-buffer samples, bootstrapping from a frozen target network, and watching for max-target overestimation.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Deep Q-Learning should make visible.
Visual Inquiry
Make the image answer a mathematical question
Deep Q-learning turns Q-learning into neural value learning by training on replay-buffer samples, bootstrapping from a frozen target network, and watching for max-target overestimation.
Which visible object should carry the first intuition?
Pick the cue that should make Deep Q-Learning easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Introduces the DQN training recipe with a neural action-value function, experience replay, minibatch TD targets, and Atari evidence.
Open sourceCanonical DQN paper for replay memory, a separate target network, convolutional action-value learning from pixels, and the broader Atari evaluation.
Open sourceGraduate RL source for DQN instability causes, experience replay, fixed Q-targets, and target-network pseudocode.
Open sourceSource for the max-over-actions overestimation caveat and the Double DQN bridge.
Open sourceClaim Review
Deep Q-learning turns Q-learning into neural value learning by training on replay-buffer samples, bootstrapping from a frozen target network, and watching for max-target overestimation.
Claims without a substantive review badge still need exact source-support review.
mnih-2013-playing-atari-dqn, mnih-2015-human-level-control-dqn, stanford-cs234-dqn-2026, van-hasselt-2015-double-dqn
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support the DQN target y = r for terminal transitions and y = r + gamma max_a Q(s',a;theta-) otherwise, replay-buffer minibatch sampling, periodic target-network copies, and the overestimation risk from using a max over noisy value estimates.
Sources: Playing Atari with Deep Reinforcement Learning, Human-level control through deep reinforcement learning, Stanford CS234: Lecture 4, Model-Free Control and Function Approximation, Deep Reinforcement Learning with Double Q-learningTeaching lab only; excludes Atari preprocessing details, convolutional architecture tuning, reward clipping as a main topic, prioritized replay, dueling networks, distributional RL, Rainbow, and formal convergence proofs.A bounded review summary is present; still check caveats and exact reference scope.Checked Mnih 2013 for replay memory, minibatch targets, the Q-network loss, and the experience-replay algorithm; checked Mnih 2015/Nature source material for replay memory and target-network DQN stabilization; checked Stanford CS234 Lecture 4 for the two instability causes and the fixed-target/replay pseudocode; checked van Hasselt et al. 2015 for DQN overestimation and the Double DQN decoupling caveat. GPT Pro critique remains pending because 127.0.0.1:51672 is unavailable.
Reviewer: codex-local-source-review; reviewed 2026-07-03Source support candidates
paper 2013Playing Atari with Deep Reinforcement LearningIntroduces the DQN training recipe with a neural action-value function, experience replay, minibatch TD targets, and Atari evidence.
paper 2015Human-level control through deep reinforcement learningCanonical DQN paper for replay memory, a separate target network, convolutional action-value learning from pixels, and the broader Atari evaluation.
course-notes 2026Stanford CS234: Lecture 4, Model-Free Control and Function ApproximationGraduate RL source for DQN instability causes, experience replay, fixed Q-targets, and target-network pseudocode.
paper 2015Deep Reinforcement Learning with Double Q-learningSource for the max-over-actions overestimation caveat and the Double DQN bridge.
Practice Loop
Try the idea before it explains itself
Deep Q-learning turns Q-learning into neural value learning by training on replay-buffer samples, bootstrapping from a frozen target network, and watching for max-target overestimation.
Before touching the demo, predict one visible change that should happen in Deep Q-Learning.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
Deep Q-Learning
What is the smallest example that makes Deep Q-Learning click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Deep Q-Learning Selected item key: recorded for copy. Context: Reinforcement Learning Page anchor: recorded for copy. Open question: What is the smallest example that makes Deep Q-Learning click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/reinforcement-learning/deep-q-learning
concept:reinforcement-learning/deep-q-learning