Adaptive Behavior Cloning Regularization for Stable Offline-to-Online Reinforcement Learning

Yi Zhao, Rinu Boney, Alexander Ilin, Juho Kannala, Joni Pajarinen

Abstract

Transitioning reinforcement learning (RL) agents from static offline datasets to online fine-tuning frequently results in a catastrophic performance collapse. This phenomenon is primarily driven by distribution shifts and inaccurate value estimation when the agent encounters out-of-distribution states. This paper presents REDQ+AdaptiveBC, a framework that stabilizes this transition by employing a Proportional-Derivative (PD) control mechanism to dynamically adjust behavior cloning (BC) constraints. By balancing reward maximization with data-driven regularization and utilizing randomized ensembles (REDQ) for efficient value estimation, the proposed method achieves state-of-the-art performance across the D4RL benchmark suite, particularly in complex dexterous manipulation tasks.

1. Introduction

Offline Reinforcement Learning provides a paradigm for training agents on fixed datasets, mitigating the risks and costs associated with real-world exploration. However, offline datasets are inherently limited, and agents often require online fine-tuning to achieve optimal performance. This transition is fraught with challenges. When an agent begins interacting with the environment, it encounters states and actions not represented in the offline data. This leads to "extrapolation error," where the agent's Q-functions produce wildly inaccurate value estimates, causing a sudden and severe drop in performance known as "performance collapse."

To mitigate this, researchers typically employ Behavior Cloning (BC) losses to constrain the agent's policy to stay near the offline data distribution. However, determining the optimal weight ($\alpha$) for this constraint is difficult. A weight that is too high prevents the agent from learning new, better behaviors, while a weight that is too low fails to prevent the collapse. This paper addresses the "constraint dilemma" by introducing an adaptive mechanism that automatically tunes the BC weight based on the agent's real-time performance.

2. Methodology

The REDQ+AdaptiveBC framework consists of three primary components designed to stabilize the offline-to-online pipeline.

2.1 Adaptive BC Weighting ($\alpha$)

Rather than treating the BC weight as a static hyperparameter, the authors propose a dynamic adjustment mechanism inspired by Proportional-Derivative (PD) control theory. The weight $\alpha$ is updated based on the agent's episodic return relative to a target performance level:

  • Proportional Term ($K_p$): This term decreases the BC constraint as the agent’s performance approaches a target "expert" return. As the agent proves it can achieve high rewards, the constraint is relaxed to allow for further optimization.
  • Derivative Term ($K_d$): This term monitors the rate of change in performance. If the agent's return begins to drop sharply—signaling an impending collapse—the derivative term quickly increases the BC weight, acting as a "safety brake" to force the agent back toward the stable offline distribution.

While the ideal target return is the expert performance level, the authors demonstrate that using the maximum possible theoretical reward ($r_{max} \times T$) serves as a robust and practical proxy.

2.2 Randomized Ensembles (REDQ)

To improve sample efficiency and combat overestimation bias during the online phase, the method integrates Randomized Ensembled Double Q-learning (REDQ). By maintaining an ensemble of 10 Q-functions and randomly sampling a subset to calculate target values, the agent can perform more frequent updates per environment interaction. This allows the agent to extract maximum information from the limited online data available during the early stages of fine-tuning.

2.3 Replay Buffer Downsampling

A common issue in offline-to-online RL is the "data drowning" effect, where a massive offline dataset overshadows the relatively small amount of new online data. To ensure the agent prioritizes recent experiences, the authors implement a simple but effective downsampling strategy: 95% of the offline samples are randomly removed from the replay buffer once online fine-tuning commences. This ensures that the high-quality online interactions have a significant impact on the gradient updates.

3. Experimental Setup

The proposed method was evaluated on the D4RL benchmark, focusing on two distinct categories:

  1. Locomotion Tasks: HalfCheetah, Hopper, and Walker2d across various data quality levels (Random, Medium, Medium-Replay, and Medium-Expert).
  2. Dexterous Manipulation: High-dimensional control tasks including Hammer, Pen, Relocate, and Door. These tasks are significantly more challenging for fine-tuning due to their sparse rewards and complex state spaces.

4. Results and Discussion

4.1 Stability and Performance

REDQ+AdaptiveBC demonstrated superior stability compared to standard baselines. In "Medium-Expert" tasks, where agents often "unlearn" expert behavior during the initial online phase, the adaptive mechanism successfully maintained performance levels. In contrast, baselines like TD3-ft frequently experienced total collapse. The method achieved state-of-the-art (SOTA) results across the locomotion suite, outperforming established algorithms such as AWAC and Balanced Replay.

4.2 Success in Complex Manipulation

The impact of the adaptive mechanism was most pronounced in dexterous manipulation tasks. Without the PD-controlled BC weight, REDQ agents failed almost immediately upon entering the online phase, with performance dropping to near zero. The adaptive mechanism allowed the agents to navigate the high-dimensional space safely, leading to successful fine-tuning where other methods failed.

4.3 Memory and Efficiency

By utilizing the 95% downsampling strategy, the method proved to be significantly more memory-efficient than previous SOTA approaches like Balanced Replay, which require maintaining multiple complex buffers. REDQ+AdaptiveBC reduced memory usage by 65–95% while simultaneously delivering better performance.

5. Limitations and Future Work

Despite its success, the method introduces new hyperparameters in the form of the controller gains ($K_p$ and $K_d$). While a single set of values worked for most tasks, the most difficult environments still required some manual tuning. Additionally, the derivative term's effectiveness is tied to the quality of the episodic return signal; in environments with extremely noisy or sparse rewards, the controller may trigger erratically. Future research could explore more sophisticated weighting schemes, such as exponential weights or meta-learning, to further automate the balance between exploration and regularization.

Summary updated

BibTeX
@inproceedings{zhao2022adaptive,
  author = {Yi Zhao and Rinu Boney and Alexander Ilin and Juho Kannala and Joni Pajarinen},
  title = {{Adaptive Behavior Cloning Regularization for Stable Offline-to-Online Reinforcement Learning}},
  booktitle = {ESANN},
  year = {2022},
  doi = {10.14428/esann/2022.es2022-110},
}
Figure