Skip to content

Baselines vs Stable Baselines3

Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.

Baselines

Open source · MIT

Reference implementations of reinforcement learning algorithms in Python, for research comparison.

Stable Baselines3

Open source · MIT

A Python library of reliable reinforcement learning algorithms built on PyTorch.

The short answer

Choose Baselines if you need…

  • Researchers who want a trusted baseline to compare a new reinforcement learning method against
  • Students learning how classic RL algorithms are implemented
  • Developers who want to train an RL agent on MuJoCo or Atari environments with existing code
  • People reproducing published reinforcement learning benchmark results

Choose Stable Baselines3 if you need…

  • Researchers who want a reliable baseline to compare a new method against
  • Engineers prototyping an RL agent for a task with a Gymnasium-style environment
  • Students with some RL background who want readable, tested implementations
  • Users who want to train PPO on a simple environment such as CartPole with a few lines of code

Side-by-side

BaselinesStable Baselines3
TypeLibraryLibrary
PriceFree and open sourceFree and open source
LicenceMITMIT
GitHub stars16.8k14k
Setup difficultyIntermediateIntermediate
How you get itClone and build from sourceInstall with a package manager
Main languagePythonPython
Last code update2 years ago11 days ago

What each one is

Baselines

OpenAI Baselines is a collection of reinforcement learning algorithms (such as DQN, PPO and A2C) implemented in Python. Researchers use it to reproduce published results, test new ideas on top of a known starting point, and compare new methods against established ones. The README says the status is maintenance, meaning only bug fixes and minor updates are expected.

Stable Baselines3

Stable Baselines3 (SB3) is a Python library that provides tested implementations of common reinforcement learning algorithms, which are methods for training software agents to make decisions by trial and reward. It is written in PyTorch and offers a consistent interface so researchers and engineers can train, compare, and build on these algorithms without writing them from scratch. The README notes that it assumes some prior knowledge of reinforcement learning.

Best for

Baselines

  • Researchers who want a trusted baseline to compare a new reinforcement learning method against
  • Students learning how classic RL algorithms are implemented
  • Developers who want to train an RL agent on MuJoCo or Atari environments with existing code
  • People reproducing published reinforcement learning benchmark results

Stable Baselines3

  • Researchers who want a reliable baseline to compare a new method against
  • Engineers prototyping an RL agent for a task with a Gymnasium-style environment
  • Students with some RL background who want readable, tested implementations
  • Users who want to train PPO on a simple environment such as CartPole with a few lines of code

Strengths

Baselines

  • Implementations are described as roughly on par with published paper scores for DQN and its variants
  • Provides several standard algorithms in one consistent codebase with a single command-line entry point
  • Includes a benchmarks page for MuJoCo and Atari results

Stable Baselines3

  • Provides a common, consistent interface across algorithms, as described in the feature table
  • Includes documentation, custom environment and policy support, TensorBoard support, and type hints per the README
  • Has an active CI pipeline and is documented as a successor to Stable Baselines

Not ideal for

Baselines

  • Anyone needing current TensorFlow 2 support, since the master branch supports TensorFlow 1.4 to 1.14 and the README points to a tf2 branch for 2.0 instead
  • Projects that need actively developed code, since the README says the project is in maintenance mode
  • Users who need MuJoCo out of the box, since MuJoCo is proprietary and requires a license for some examples

Stable Baselines3

  • Complete beginners with no reinforcement learning background, since the README says the library assumes some RL knowledge
  • Projects that need the newest experimental algorithms, which the README says are placed in the separate SB3-Contrib repository
  • Users who need the fastest possible training, since the README mentions the separate SBX (JAX) variant as faster but with fewer features

Trade-offs

Baselines

  • Built for older TensorFlow 1.x versions, so setup on modern Python and TensorFlow environments may be difficult
  • The README says the model saving and loading API is not yet unified across algorithms

Stable Baselines3

  • The README says development is now focused on bug fixes and maintenance, with no major changes planned
  • Requires some reinforcement learning knowledge to use effectively
  • Newer or experimental features live in separate repositories, so a full toolset means installing several projects

Getting started

Baselines

Install system packages on Ubuntu

sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev

Clone the repository

git clone https://github.com/openai/baselines.git
Step-by-step guide: how to use Baselines

Stable Baselines3

Install with optional extras (Tensorboard, OpenCV, ale-py, pandas, matplotlib)

pip install 'stable-baselines3[extra]'

Install core package without extras

pip install stable-baselines3
Step-by-step guide: how to use Stable Baselines3

Frequently asked questions

What is the difference between Baselines and Stable Baselines3?

Baselines: Reference implementations of reinforcement learning algorithms in Python, for research comparison. Stable Baselines3: A Python library of reliable reinforcement learning algorithms built on PyTorch. Baselines suits researchers who want a trusted baseline to compare a new reinforcement learning method against, while Stable Baselines3 suits researchers who want a reliable baseline to compare a new method against.

Are Baselines and Stable Baselines3 free?

Baselines: Free and open source. Stable Baselines3: Free and open source.

Is Baselines or Stable Baselines3 more popular?

Baselines has more GitHub stars (16.8k) than Stable Baselines3 (14k). Popularity isn't the same as fit — check which one matches your use case above.

What are other alternatives to Baselines and Stable Baselines3?

Other options people compare them with include Tianshou, Gymnasium, Weights & Biases, ONNX Runtime, Petals.

Keep comparing

Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.