NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Model-Based Transfer Learning for Contextual Reinforcement Learning

Jung-Hoon Cho, Vindula Jayawardana, Sirui Li, Cathy Wu

Introduction

Deep Reinforcement Learning (DRL) has demonstrated remarkable success in controlled environments, yet it remains notoriously brittle when faced with even minor variations in task parameters. In a traffic control scenario, for instance, a policy optimized for a specific four-way intersection may fail catastrophically if the vehicle flow density changes or an additional lane is introduced. These variations are formally addressed within Contextual Reinforcement Learning (CRL), where the environment is defined by a "context" parameter—such as gravity, friction, or road geometry.

To handle diverse contexts, researchers typically rely on two extremes: training a separate model for every possible context (independent training), which is computationally prohibitive, or training a single universal model on all contexts (multi-task training), which often leads to "negative transfer" where the model fails to master any specific task effectively. This paper introduces Model-Based Transfer Learning (MBTL), a strategic middle ground that uses Bayesian Optimization to select a minimal, high-impact set of training tasks to maximize zero-shot generalization across the entire context space.

The MBTL Framework

MBTL reframes task selection as a search problem. Instead of training on arbitrary or exhaustive contexts, the algorithm identifies which "source" tasks will provide the most information about the rest of the environment. This is achieved through two primary models:

  1. The Performance Model: Utilizing Gaussian Processes (GP), this model estimates the expected performance of a policy on its specific training context.
  2. The Generalization Gap Model: This model quantifies how performance degrades as a policy is transferred from a source context to a target context. The authors operate on the insight that this "gap" typically scales linearly with the contextual distance between tasks.

By combining these models into a Bayesian Optimization (BO) framework, MBTL employs an acquisition function to iteratively select the next training task. In each step, the algorithm asks: "Which new training task will most effectively fill the gaps in the current knowledge base?" This approach allows the agent to "solve" neighborhoods of the context space, progressively eliminating the need for further training in those regions.

Theoretical and Empirical Validation

The authors provide a theoretical proof that MBTL exhibits sublinear regret, ensuring that the selection strategy converges toward the optimal set of training tasks over time. To test the practical utility of the framework, MBTL was evaluated across two distinct domains:

  • Urban Traffic Benchmarks: Real-world inspired scenarios using the SUMO simulator, including Traffic Signal Control, Eco-driving, and Advisory Autonomy.
  • Continuous Control Benchmarks: Context-extended versions of classic RL tasks from the CARL library, such as Cartpole, Pendulum, BipedalWalker, and HalfCheetah, where physical parameters like mass and friction were varied.

Key Results

  • Sample Efficiency: MBTL achieved up to a 43x improvement in sample efficiency compared to independent training and standard multi-task RL in continuous control environments.
  • Rapid Convergence: In complex traffic simulations, the method approached "Oracle" performance—the theoretical maximum achieved by training on every context—within only 10 to 15 transfer steps.
  • Algorithm Agnosticism: MBTL functions as a meta-strategy. Experiments demonstrated that it successfully enhances various underlying RL algorithms, including DQN, PPO, and A2C.

Discussion and Insights

A core takeaway of this research is that generalization is predictable. The finding that the generalization gap can be modeled as a linear function of contextual distance suggests that intelligent task selection is often more valuable than raw computational power. By focusing the training budget on "unsolved" regions of the context space, MBTL avoids the redundancies of brute-force training.

However, the current framework has limitations. The study primarily focused on single-dimensional context variations (e.g., varying only mass). Real-world applications often involve multi-dimensional changes, such as simultaneous variations in friction, gravity, and geometry. Additionally, while the linear generalization gap held true for the tested benchmarks, highly non-linear environments may require more sophisticated gap models.

Conclusion

Model-Based Transfer Learning offers a principled approach to the challenge of generalization in RL. By treating task selection as an informed search rather than a random or exhaustive process, MBTL significantly reduces the data requirements for deploying robust agents in varying environments. Future work will focus on extending this framework to high-dimensional context spaces and refining measures of task similarity beyond Euclidean distance.

Summary updated

BibTeX
@inproceedings{cho2024model,
  author = {Jung-Hoon Cho and Vindula Jayawardana and Sirui Li and Cathy Wu},
  title = {{Model-Based Transfer Learning for Contextual Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=KLv1VLuMo8},
}
Figure