Abstract
Offline-to-online reinforcement learning (RL) aims to integrate the complementary strengths of offline and online RL by pre-training an agent offline and subsequently fine-tuning it through online interactions. However, recent studies reveal that offline pre-trained agents often underperform during online fine-tuning due to inaccurate value estimation caused by distribution shift, with random initialization proving more effective in certain cases. In this work, we propose a novel method, Online Pre-Training for Offline-to-Online RL (OPT), explicitly designed to address the issue of inaccurate value estimation in offline pre-trained agents. OPT introduces a new learning phase, Online Pre-Training, which allows the training of a new value function tailored specifically for effective online fine-tuning. Implementation of OPT on TD3 and SPOT demonstrates an average 30% improvement in performance across a wide range of D4RL environments, including MuJoCo, Antmaze, and Adroit.
Introduction: The Challenge of Distribution Shift
In the ideal pipeline of "offline-to-online" RL, agents are first trained on static, safe, and inexpensive datasets before being fine-tuned through real-world interaction. While this approach promises the best of both worlds, researchers have identified a persistent "performance dip" during the transition. The moment an offline-trained agent begins online interaction, its performance often collapses, sometimes falling below that of an agent trained from scratch.
This phenomenon is primarily driven by distribution shift. The value function (critic), having been trained exclusively on offline data, provides wildly inaccurate estimates for "out-of-distribution" actions encountered during early online exploration. These erroneous estimates lead to poor policy updates, effectively sabotaging the pre-trained knowledge.
The OPT Framework
To address this, we introduce Online Pre-Training (OPT), a three-stage framework that inserts a dedicated "warm-up" phase between offline training and online fine-tuning.
- Offline Pre-Training: The agent trains a policy ($\pi$) and an initial value function ($Q^{off-pt}$) on the static offline dataset using standard conservative methods.
- Online Pre-Training (The "Secret Sauce"): Before full fine-tuning begins, the agent collects a small amount of online data to initialize and train a second value function ($Q^{on-pt}$). This critic is trained using a meta-adaptation objective, ensuring it is highly adaptable to new online data while respecting the underlying dynamics learned offline.
- Online Fine-Tuning: The policy is updated using a weighted combination of both critics. A scheduling coefficient ($\kappa$) gradually shifts the agent's reliance from the stable, conservative offline critic to the more agile and accurate online-specific critic.
OPT is designed as a modular "plug-and-play" component, compatible with various RL backbones such as TD3+BC, SPOT, and IQL.
Experimental Evaluation
We evaluated OPT on the D4RL benchmark across three diverse domains:
- MuJoCo: Locomotion tasks (HalfCheetah, Hopper, Walker2d) with varying data quality.
- Antmaze: Navigation tasks requiring sparse reward processing.
- Adroit: Complex robotic hand manipulation using human demonstration data.
Key Results and Discussion
OPT achieves an average 30% improvement in normalized scores across D4RL environments compared to base algorithms like TD3 and SPOT. Most importantly, it effectively mitigates the initial performance collapse.
As illustrated in Figure 1 above, standard fine-tuning (yellow) often lags behind training from scratch (green) in the early stages of the online phase. In contrast, OPT (purple) maintains high performance from the onset and reaches significantly higher peaks. This is particularly evident in challenging tasks like walker2d-random, where OPT extracts substantial value even from low-quality initial data.
By maintaining a dual-critic strategy, the agent retains a "safety net" of offline knowledge while the new critic learns to overcome the conservatism inherent in offline methods. Empirical analysis confirms that this approach significantly reduces value estimation bias, leading to more stable and effective policy updates.
Limitations and Future Work
While effective, OPT introduces additional computational overhead, increasing training time by approximately 50% due to the extra pre-training phase and the second value function. Additionally, the current implementation relies on a scheduled weighting coefficient ($\kappa$), which may require tuning for new environments. Future research could explore automated balancing mechanisms, such as uncertainty estimation, to further enhance the framework's robustness.
Summary updated