Abstract
Deep Q-Networks algorithm (DQN) was the first reinforcement learning algorithm using deep neural network to successfully surpass human level performance in a number of Atari learning environments. However, divergent and unstable behaviour have been long standing issues in DQNs. The unstable behaviour is often characterised by overestimation in the $Q$-values, commonly referred to as the overestimation bias. To address the overestimation bias and the divergent behaviour, a number of heuristic extensions have been proposed. Notably, multi-step updates have been shown to drastically reduce unstable behaviour while improving agent's training performance. However, agents are often highly sensitive to the selection of the multi-step update horizon ($n$), and our empirical experiments show that a poorly chosen static value for $n$ can in many cases lead to worse performance than single-step DQN. Inspired by the success of $n$-step DQN and the effects that multi-step updates have on overestimation bias, this paper proposes a new algorithm that we call 'Elastic Step DQN' (ES-DQN). It dynamically varies the step size horizon in multi-step updates based on the similarity of states visited. Our empirical evaluation shows that ES-DQN out-performs $n$-step with fixed $n$ updates, Double DQN and Average DQN in several OpenAI Gym environments while at the same time alleviating the overestimation bias.
Introduction
Deep Q-Networks (DQN) are powerful but notoriously unstable. Two major culprits are overestimation bias—where the "max" operator in the Bellman equation leads the agent to believe certain actions are much better than they actually are—and divergent behavior during training. Researchers often use $n$-step updates to mitigate this, where the agent looks $n$ steps ahead to calculate rewards. However, $n$ is a sensitive hyperparameter; if poorly chosen, the agent may perform worse than a basic single-step DQN. This paper introduces Elastic Step DQN (ES-DQN), which allows the environment's structure to dictate the step size dynamically.
Methods
The core innovation of ES-DQN is the Elastic Step mechanism. Instead of a static $n$, the algorithm decides when to "cut off" a multi-step sequence based on whether the agent has moved into a meaningfully different part of the state space.
The process involves:
- State Representation: Extracting features from the hidden layers of the primary DQN rather than using raw input.
- Unsupervised Clustering: Using HDBSCAN to group these latent representations.
- Dynamic Horizon: If the current state ($s_t$) and the next state ($s_{t+1}$) fall into the same cluster, the agent considers them part of the same "macro-state," accumulates the reward, and increments a step counter. If they fall into different clusters, the agent "closes" the step, stores the transition, and resets the counter.
This approach treats clusters of similar states as "landmarks," mimicking spatial information theory where agents reason in units of experience rather than rigid time steps.
Results
ES-DQN was evaluated on three OpenAI Gym benchmarks: Cartpole, Mountain Car, and Acrobot. The results demonstrate superior performance and stability compared to standard $n$-step and Double DQN variants.
Key findings include:
- Performance: In Cartpole, ES-DQN achieved an average reward of 413.4, significantly higher than single-step DQN (100.7) and Double DQN (225.7).
- Overestimation Control: In Mountain Car, ES-DQN kept $|Q|$-values near the theoretical limit (~102.5), while standard DQN and Double DQN values diverged to over 10,000.
- Adaptability: The "elastic" $n$ varied by environment (e.g., ~1.05 in Cartpole vs. ~8.59 in Acrobot), proving that static horizons are suboptimal for diverse tasks.
Conclusion
ES-DQN successfully automates the selection of the multi-step horizon, improving stability and performance while mitigating overestimation bias. While it shows early-stage slowness due to clustering requirements and adds some computational overhead, its ability to adapt to environment structure is a significant advancement. Future work will explore its scalability to high-dimensional, pixel-based environments.
Summary updated