Improving Offline Reinforcement Learning with Inaccurate Simulators

Yiwen Hou, Haoyuan Sun, Jinming Ma, Feng Wu

Introduction

Offline Reinforcement Learning (RL) has emerged as a promising paradigm for training robotic systems without the inherent risks and costs associated with real-world trial-and-error. By leveraging pre-collected datasets, agents can learn complex behaviors safely. However, this approach faces a significant "catch-22": high-quality, diverse datasets are expensive to collect, yet sparse or narrow data often leads to poor generalization.

While simulators offer a potential solution by providing an infinite source of data, they are rarely perfect "digital twins" of reality. This discrepancy, known as the "dynamics gap," means that training on simulated data can often degrade a policy's real-world performance. A new framework, ORIS (Offline Reinforcement learning with Inaccurate Simulator), addresses this challenge by treating the inaccurate simulator not as a liability, but as a strategic tool for exploration.

The ORIS Framework

ORIS bridges the gap between limited real-world data and flawed simulations using a Generative Adversarial Network (GAN). The framework employs the GAN in two distinct ways to optimize the learning process.

1. Smart Restarts via the Generator

Traditional simulation-based exploration often suffers from "aimless exploration," where the agent spends excessive time in irrelevant states far from the high-reward regions of the task. ORIS mitigates this by pre-training a GAN on the available offline dataset. During the simulation phase, the Generator ($G$) provides "smart restarts" by sampling states from the distribution of the real-world data. By initializing trajectories in the "neighborhood" of successful real-world examples, ORIS ensures the simulator focuses on refining behaviors in critical regions, effectively balancing exploration and exploitation.

2. Adaptive Trust via the Discriminator

The second component of the framework is the Discriminator ($D$), which is trained to distinguish between real offline states and those generated by the simulator. ORIS uses the discriminator’s output to dynamically reweight simulated data within the RL loss function:

  • In-Distribution Data: When a simulated state closely matches the real-world data, ORIS down-weights its contribution. Since high-quality real data is already available for these states, relying on an inaccurate simulator would only introduce bias.
  • Out-of-Distribution (OOD) Data: When the simulator explores states not covered by the offline dataset, ORIS up-weights this data. In these regions, the simulator’s "best guess" is significantly more valuable than having no data at all, providing the structural support necessary for the policy to remain robust in unfamiliar territory.

Experimental Evaluation

The researchers evaluated ORIS across three distinct environments to test its resilience to physics discrepancies and data scarcity:

  1. Modified D4RL Benchmarks: Standard locomotion tasks (Hopper, Walker2d, HalfCheetah) were modified to simulate inaccuracy by doubling gravity, reducing friction to 30%, and adding action noise.
  2. Data Scarcity Tests: The team reduced the D4RL datasets to just 5% of their original size to observe how well the simulator could compensate for missing information.
  3. Real-World Manipulation: A pick-and-place task was conducted using a 7-DoF Kinova Gen3 robotic arm. The agent was trained using a standard MuJoCo Metaworld simulator as the "inaccurate" source before being deployed on the physical hardware.

Key Results and Insights

ORIS demonstrated superior performance compared to state-of-the-art offline RL methods (such as CQL and IQL) and existing hybrid methods (like H2O).

  • Robustness to Scarcity: One of the most significant findings was ORIS's data efficiency. When the offline dataset was slashed to 5%, ORIS experienced only an 8% drop in performance. In contrast, competing methods saw their performance collapse, highlighting ORIS's ability to use simulators to fill critical data gaps.
  • Real-World Transfer: In the Kinova arm experiments, ORIS achieved a 98.7% success rate in the "Place" sub-task. Other methods, such as SAC, struggled significantly with the dynamics gap, achieving only a 27.6% success rate.
  • Structural Support: The results suggest that simulators do not need to be perfect to be useful. By providing "structural support" in OOD regions, even a flawed simulator can prevent the extrapolation errors that typically plague offline RL.

Limitations and Future Directions

While ORIS represents a significant step forward, it is not without limitations. The stability of GAN training remains a concern; if the generator fails to accurately capture the offline distribution, the "smart restarts" may lose their effectiveness. Furthermore, the current study focused on fundamental physics gaps like gravity and friction. Future research could explore more complex discrepancies, such as sensor latency, visual domain shifts, or the dynamics of deformable objects.

Conclusion

ORIS redefines the relationship between offline data and simulation. By using a GAN to intelligently sample and weight simulated experiences, the framework allows researchers to leverage inaccurate simulators to build more robust, data-efficient robotic policies. This "trust but verify" approach paves the way for more practical applications of RL in real-world settings where data is scarce and simulators are imperfect.

Summary updated

BibTeX
@inproceedings{hou2024improving,
  author = {Yiwen Hou and Haoyuan Sun and Jinming Ma and Feng Wu},
  title = {{Improving Offline Reinforcement Learning with Inaccurate Simulators}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2024},
  url = {https://openreview.net/forum?id=TEfr3kE2GO},
}
Figure