Baconian: A Unified Opensource Framework for Model-Based Reinforcement Learning

Linsen Dong, Guanyu Gao, Yuanlong Li, Yonggang WenarXiv 2019

Abstract

Model-Based Reinforcement Learning (MBRL) is one category of Reinforcement Learning (RL) algorithms which can improve sampling efficiency by modeling and approximating system dynamics. It has been widely adopted in the research of robotics, autonomous driving, etc. Despite its popularity, there still lacks some sophisticated and reusable open-source frameworks to facilitate MBRL research and experiments. To fill this gap, we develop a flexible and modularized framework, Baconian, which allows researchers to easily implement a MBRL testbed by customizing or building upon our provided modules and algorithms. Our framework can free users from re-implementing popular MBRL algorithms from scratch thus greatly save users' efforts on MBRL experiments.

Introduction

Reinforcement Learning (RL) has achieved significant milestones, yet traditional "model-free" methods often suffer from extreme sample inefficiency, requiring millions of interactions to master relatively simple tasks. Model-Based Reinforcement Learning (MBRL) addresses this by learning a "world model"—an approximation of system dynamics—to simulate experiences and improve efficiency.

Despite the advantages of MBRL, the research community has lacked a unified, reusable framework similar to OpenAI Baselines for model-free RL. Existing MBRL implementations are frequently fragmented, tied to specific research papers, or hard-coded for narrow use cases. Baconian was developed to bridge this gap, providing a modular architecture that decouples dynamics modeling, policy optimization, and experiment orchestration.

System Architecture

Baconian is designed around three core pillars to maximize flexibility and maintainability:

  1. Experiment Manager: Serves as the central control unit, managing global settings, initializing modules, and synchronizing status information (e.g., learning rates, exploration schedules) across the system.
  2. Training Engine: The core of the framework, which introduces a "Control Flow" abstraction. By breaking the training process into independent tasks—such as environment sampling, dynamics model optimization, and policy testing—users can customize the logic of the MBRL loop without modifying the underlying algorithm code.
  3. Monitor: A dedicated layer for real-time logging and visualization. It integrates with tools like TensorFlow and custom plotters to track performance metrics such as loss and cumulative rewards.
The modular architecture of Baconian, illustrating the interaction between the Experiment Manager, Training Engine, and Monitor.

Framework Capabilities

Baconian is built to be a comprehensive testbed for the RL community. It is compatible with industry-standard benchmarks, including OpenAI Gym, PyBullet, RoboSchool, and the DeepMind Control Suite. This allows researchers to evaluate their models across a wide variety of physics simulations, from simple control tasks to complex robotic locomotion.

Overview of the algorithms, environments, and utilities supported by the Baconian framework.

As shown in the table above, the framework supports a diverse range of algorithms. This includes classic MBRL approaches like Dyna and Model Predictive Control (MPC), as well as model-free algorithms like DQN and PPO, which often serve as components in hybrid model-based systems.

Design Philosophy

The framework's utility stems from several key design insights:

  • Control Flow Abstraction: MBRL algorithms primarily differ in how they schedule data collection versus model training. By abstracting this into a Control Flow module, Baconian allows users to switch between different experimental logics (e.g., background planning vs. online planning) with minimal code changes.
  • Hybrid Support: Recognizing that MBRL and model-free RL are complementary, Baconian enables the creation of hybrid systems where model-free agents are enhanced by learned dynamics models.
  • Modular Decoupling: By separating the "Agent" (policy) from the "Dynamic Model" (world model), researchers can mix and match architectures—for instance, pairing a Gaussian Process model with a Neural Network policy—without code entanglement.

Conclusion and Future Work

Baconian provides a strong foundation for MBRL research by offering an easy-to-use, modular, and open-access library. While it currently covers major state-of-the-art algorithms, the authors plan to expand the library as the field evolves. Future efforts will focus on improving scalability for high-dimensional data (such as video-based world models) and providing more extensive benchmark comparisons across all supported environments. The codebase remains fully open-sourced on GitHub to serve as a centralized testbed for the community.

Summary updated

BibTeX
@misc{dong2019baconian,
  author = {Linsen Dong and Guanyu Gao and Yuanlong Li and Yonggang Wen},
  title = {{Baconian: A Unified Opensource Framework for Model-Based Reinforcement Learning}},
  year = {2019},
  eprint = {1904.10762},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.10762},
}
Figure