How do you implement Double Q-learning, and what problem does it solve?
Instruction: Explain the Double Q-learning algorithm and the specific issue it addresses in Q-learning.
Updated
Example Answer
Double Q-learning separates action selection from action evaluation to reduce the overestimation that can arise when one noisy value estimate does both. In the tabular version, I maintain two tables and choose one to update on each transition.
If I update table A, I select the best next action using A but evaluate that action using B. I reverse the roles when updating B. A common behavior policy uses the combined estimates from both tables. For a terminal transition, the target contains no continuation value.
This reduces a source of maximization bias; it does not promise zero bias, and it can underestimate values. Double DQN uses a related separation with online and target networks, but I would not confuse that implementation with two independently updated tabular estimators.
Worked Example
qa_next = [5.0, 4.0]
qb_next = [1.0, 6.0]
best = max(range(len(qa_next)), key=qa_next.__getitem__)
target = 2.0 + 0.9 * qb_next[best]
print(round(target, 2)) # 2.9; action 0 selected by A, evaluated by B
A single-table Q-learning target using A would be 2 + 0.9 × 5 = 6.5. B's own maximum is deliberately not used in this update.