A table learns every state on its own, so a state you've never visited knows nothing, even when you've seen its neighbors many times. Function approximation fixes that by letting states share a few adjustable numbers. Sharing is the whole idea, and it cuts both ways: one example can teach many states, and one update can also move values you didn't mean to touch, including the target you're chasing.
Part 3. Previously: bootstrapping.
The table grows
A Q table stores one number per state and action. With continuous sensors you first cut each reading into bins, so sensors with bins each and actions give entries. Take an illustrative cart-balancing task with four sensors (position, speed, pole angle, angular speed). Six bins per sensor give 1,296 rows, or 2,592 entries with two actions. Twelve bins give 20,736 rows and 41,472 entries. Doubling the resolution multiplied the rows by sixteen, and every new row needs its own data, because the table learns each row separately.
One update shares learning
So let's store a few weights instead and predict a state's value as , where lists the state's features. State A has features (1, 1) and state B has (1, 2), and both weights start at 0. Now train only A, toward a target of 2 with a step size of 0.1:
The error is 2, so both weights become 0.2. A now predicts 0.4, and B, which you never trained, predicts 0.6. B moved because it uses the same weights. If B's true value is 3, that's a step in the right direction, but whether sharing helps a state you didn't train always depends on its features and its target.
Sharing can erase distinctions
Sharing has a limit. Say states C and D have true values 0 and 2, but both have the same features (1, 0). Then every weight setting gives them the same prediction. If you see both equally often, the best shared prediction is their average, 1, which is off by 1 for each. That's aliasing, and more training can't fix it, because the difference isn't in the input. Coarse sensor bins can do this when two states share every bin but their angular speeds imply very different futures.
Hold the target still
Now let the model build its own target, as bootstrapping does. A predicts 0.4, its successor B predicts 0.6, the reward is 0 and the discount is 0.9, so the target is . Semi-gradient TD treats 0.54 as a fixed number and nudges only A's prediction toward it. It ignores the fact that 0.54 came from the same weights it's about to change.
The target moves next time
Holding the target still for one update doesn't keep it still afterward. The error is , so each weight grows by , to 0.214. A now predicts 0.428, but B rose too, to 0.642. Replay the same transition and the target is instead of 0.54. With a table, updating A would have left B alone.
This coupling doesn't prove anything diverges. Linear TD with on-policy sampling has convergence results under technical conditions, and other sampling distributions can break that stability (Sutton and Barto, Sections 9.4 and 11.2).
Networks need steadier targets
A neural network learns its own features, but it still shares parameters across inputs, so it has the same coupling. DQN (Mnih et al., 2015) adds two fixes. Replay memory reuses saved transitions and breaks up runs of consecutive, similar samples. A target network, a frozen copy refreshed only now and then, builds the targets so they don't shift after every update. Both help in practice, but neither gives a general convergence guarantee for neural Q-learning.
Which policy produced those transitions, and which policy does their target evaluate? Part 4: on-policy and off-policy learning explains the distinction, and Part 5 comes back to stability.
The exact updates, notation and sources
Table size. With sensor dimensions, bins per dimension and actions, the Q table has entries, because counts all combinations of binned readings. With function approximation, one observation can update predictions across several states without waiting for each to get its own data: the generalization problem of Sutton and Barto, Part II and Section 9.1.
Linear prediction. is a fixed vector of numerical features and a weight vector of the same length. multiplies matching coordinates and adds them, and the hat in marks an estimate. Given a target at state , the squared-error update is . It moves in a direction that locally reduces that state's squared error, and every state that uses the same features moves with it (Sections 9.3 and 9.4).
Aliasing. If C and D share features , then for the first weight . Sampling both equally and fitting squared error gives . If one state were sampled more often, the shared estimate would move toward its value (Sections 9.1 to 9.3). Giving the states different features allows different predictions, and adding parameters helps only if the inputs still carry the relevant information.
Semi-gradient TD. counts transitions, is the current state, the reward after the action and the current weights. The one-step target, with terminal value zero, is held fixed while differentiating:
With linear features the gradient is . Differentiating through the target as well would give a different update. Because later targets are recomputed with the new weights, this is not the same as minimizing one fixed loss throughout training (Sections 9.3 and 9.4).
DQN target. is the network's estimate for action in state , and are the target-network parameters, held fixed between scheduled refreshes:
When the transition terminates, the target is just the reward. The live network fits on batches sampled from replay memory, and its parameters are copied to the target network periodically (Mnih et al., 2015).
The worked numbers in tables, and what sharing buys and costs
Training only A once, with , target 2 and step size 0.1:
| After training only A once | A: features (1, 1) | B: features (1, 2) |
|---|---|---|
| Before | 0 | 0 |
| After | 0.4 | 0.6 |
| Supplied comparison target | 2 | 3 |
Then one semi-gradient update on the transition A to B, with weights , reward 0, discount 0.9 and step size 0.1: .
| Same replayed A → B transition | Before | After one update |
|---|---|---|
| Prediction at A | 0.4 | 0.428 |
| Prediction at B | 0.6 | 0.642 |
| Target from B | 0.54 | 0.5778 |
Sharing buys: compact storage, because parameters replace an entry for every input; transfer, because one example can improve related states; and, with networks, features learned from observations.
Sharing costs: representation error, because identical features force identical predictions; interference, because an update can worsen predictions elsewhere; and stability, because replay and target copies help but give no general convergence guarantee for neural Q-learning.