5.2.3 · D1Deep & Advanced RL

Foundations — Target networks

2,123 words10 min readBack to topic

This page assumes you know nothing. Before you read the parent note we will earn every symbol it throws at you — , , , , , , , , — one at a time, each tied to a picture.


0. The world we are learning in

Reinforcement learning is about an agent (a decision-maker) living in an environment. At each moment it sees where it is, does something, and gets a numeric score. That is all.

Figure — Target networks

Look at the figure: state (blue), an action-arrow (orange) carrying a reward (green coin), landing in next state (blue). This four-piece unit is called a transition — the atom of everything below.


1. Scoring the future: and

We do not just want the immediate reward — a move that scores now but leads to disaster is bad. We want the total future score. Two symbols make that precise.

Figure — Target networks

2. The self-referential target: the Bellman idea

Here is the elegant trick (the Bellman Equation, covered fully there): the value of now equals the reward now plus the discounted value of the best next step.


3. From a lookup table to a network:

For tiny games we could store in a spreadsheet. Real games have billions of states, so we use a neural network to approximate — a function with tunable knobs.

Figure — Target networks

The figure shows the two panels: the live online network (updated every step, orange) and the frozen target network (blue). Targets are computed from the blue panel.


4. Measuring wrongness and fixing it: loss, , learning rate


5. The soft-update knob:


Prerequisite map

State s and action a

Reward r

Discount gamma

Action value Q of s a

Greedy max over next actions

Bellman target y

Parameters theta

Q network Q with theta

Squared loss L

Gradient nabla and step alpha

Frozen copy theta-minus

Polyak factor tau

Target networks


Equipment checklist

Test yourself — reveal only after answering.

What does a transition mean in plain words?
From situation , took choice , got score , landed in situation .
Why multiply future rewards by each step?
To value the future less than now AND keep the total finite; a reward steps away counts of its face value.
What does predict?
The total discounted future reward from taking in and then playing well.
What does compute and why is it there?
The best next-action value in ; it encodes the assumption that we play optimally after landing.
What is , and what is ?
= the live tunable knobs of the online network; = a slowly-updated frozen snapshot used only to build targets.
Why square the error in the loss ?
Makes errors positive, penalises big mistakes more, and gives a smooth bowl to descend.
What does the gradient tell us?
The direction (per knob) that increases loss fastest; we step opposite to shrink it.
Does gradient flow through ?
No — it is treated as a constant, so the target is a fixed label.
What does control in the soft update?
Tracking speed; small = slow drift (memory ), = always copy, = frozen forever.
Why does using the same for target and prediction cause trouble?
The target contains , so updating moves the target you aim at — a feedback loop that can oscillate or diverge.

Connections

  • Hinglish version of the parent
  • Bellman Equation — supplies the self-referential target .
  • Deep Q-Networks (DQN) — where these symbols all come together.
  • Experience Replay — the sibling stabiliser.
  • Double DQN — reuses and for a different fix.
  • DDPG / TD3 / SAC — soft-update () users.
  • Deadly Triad — the divergence this all fights.
  • Two-Timescale Stochastic Approximation — the theory behind slow .