RLLBC-Lib: An Educational Code Library for Reinforcement Learning and Learning-Based Control

Bernd Frauenknecht, Emma Cramer, Artur Eisele, Paul Kruse, Lukas Kesper, Jonas Hertrampf, Ramil Sabirov, Jyotirmaya Patra, Johannes Berger, Paul Brunzema, Friedrich Solowjow, Sebastian TrimpearXiv 2026

TL;DR

RLLBC-Lib is a new open-source educational library designed to bridge the gap between foundational tabular reinforcement learning (RL), state-of-the-art deep RL, and classical learning-based control (LBC). By utilizing a highly consistent Jupyter notebook structure and integrating automated grading tools, it lowers the entry barrier for both engineering and computer science students.

What Problem Does This Paper Address?

Reinforcement learning is notoriously difficult to master from equations alone because its behavior emerges from complex, iterative feedback loops between data collection, value estimation, and policy improvement. While the research community has access to excellent production-grade deep RL libraries (like Stable-Baselines3 or CleanRL), educational tools that span the entire arc from simple tabular foundations to deep RL are rare.

Furthermore, RL is often taught in isolation from the broader field of Learning-Based Control (LBC). This creates a pedagogical divide: engineering students struggle with complex algorithmic implementations, while computer science students miss out on classical control-theoretic perspectives (like stability and model-predictive control). Without this context, students don't learn when it is sensible to use RL versus traditional control methods.

Methods

The authors introduce RLLBC-Lib, built around the philosophy of self-contained, single-file Python implementations housed within Jupyter notebooks.

Key methodological highlights include:

  • Structural Continuity: To underscore the parallels between simple and advanced methods, every notebook follows an identical four-part building block structure: Agent/Environment Setup, Hyperparameter Setting, Training Loop, and Evaluation.
  • Algorithmic Breadth: It includes custom implementations of classic dynamic programming (policy/value iteration), temporal difference learning (SARSA, Q-learning), and deep RL algorithms (PPO, SAC, TD3) built on PyTorch.
  • Control Theory Integration: The library features dedicated notebooks for classical control topics, including the Linear Quadratic Regulator (LQR), system identification, Bayesian optimization, and Model Predictive Control (MPC).
  • Modern DevOps for Education: The library standardizes environments using pixi-env for clean dependency management, leverages the standard gymnasium interface for agent-environment interaction, and integrates nbgrader for automated assignment grading.
Figure 1: Didactic Concept of RLLBC-Lib. The presented code library lowers the entry barrier for students and other learners of RL. It starts from straightforward tabular settings, depicted on the left, to build a solid understanding of theoretical foundations. From there, it gradually guides towards state-of-the-art deep RL approaches, depicted on the right. This learning process is represented by the stylized return curve in red. The library builds on Jupyter notebooks with extensive explanations of theoretical concepts and their implementation. The notebook structure is consistent between tabular and deep RL approaches to underscore their similarities.

Datasets

Rather than static datasets, the library utilizes interactive gymnasium environments to demonstrate learning dynamics:

  • Classic Toy Problems: The "Recycling Robot" (a stochastic, state-dependent MDP from the Sutton & Barto textbook) and an adapted "FrozenLake" grid world are used to build early intuition.
  • Control Benchmarks: Standard continuous environments like CartPole are used to contrast RL with LQR and MPC.
  • The Racing Challenge: A custom, open-ended car racing environment based on highway-env is provided as a competitive programming assignment.

Key Insights and Ideas

  • Function Approximation as an Extension, Not a Paradigm Shift: By maintaining the exact same code structure between tabular Q-learning and a Deep Q-Network (DQN), students can visually map how neural networks simply act as function approximators for the underlying state-action values.
  • The Fluid Boundary of LBC: By presenting RL alongside MPC, the library highlights how modern control engineering sits at the intersection of data-driven machine learning and physics-based modeling.
  • Gamification Drives Engagement: Transitioning students from rigidly structured code-completion tasks to an open-ended racing challenge with a live leaderboard closely mimics real-world industrial R&D workflows and significantly boosts motivation.
Figure 2: Examples of Illustrative Tabular Implementations. (a) Custom implementation of the recycling robot example in [34] to explain MDP dynamics and value functions. (b) Each state of the grid world is separated into triangles representing the action space A = {←, ↑, →, ↓}. Plotting the state action values via color coding then illustrates learning dynamics.

Key Results

The library has been successfully validated in the field, serving as the core infrastructure for university classrooms and Massive Open Online Courses (MOOCs) at RWTH Aachen University, reaching hundreds of students.

Qualitatively, the authors compared RLLBC-Lib against 16 other popular educational RL repositories. They found that while other libraries excel in isolated areas (e.g., Hugging Face for deep RL or ShangtongZhang's repository for textbook tabular methods), RLLBC-Lib is uniquely comprehensive—simultaneously offering Jupyter support, dynamic programming, tabular RL, deep RL, and control-theoretic examples in a unified framework.

Limitations and Future Work

To maintain academic integrity for ongoing university courses, the authors keep the automated grading upload page and specific assignment solutions unpublished. In terms of future development, the paper does not deeply explore multi-agent reinforcement learning (MARL) or safe RL constraints, which represent natural next steps for expanding the library's learning-based control curriculum.

Summary updated

BibTeX
@misc{frauenknecht2026rllbc,
  author = {Bernd Frauenknecht and Emma Cramer and Artur Eisele and Paul Kruse and Lukas Kesper and Jonas Hertrampf and Ramil Sabirov and Jyotirmaya Patra and Johannes Berger and Paul Brunzema and Friedrich Solowjow and Sebastian Trimpe},
  title = {{RLLBC-Lib: An Educational Code Library for Reinforcement Learning and Learning-Based Control}},
  year = {2026},
  eprint = {2609.19074},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.19074},
}
Figure