Policy Fusion for Adaptive and Customizable Reinforcement Learning Agents

Alessandro Sestini, Alexander Kuhnle, Andrew D. Bagdanov

Abstract

Deep Reinforcement Learning (DRL) is a powerful tool for creating high-performing game AI, yet it remains computationally expensive and difficult to iterate upon. Traditional methods like re-training from scratch or fine-tuning often lead to long development cycles or catastrophic forgetting. This paper introduces Policy Fusion, a modular framework that allows designers to combine a general "main policy" with specialized "sub-policies" trained via Inverse Reinforcement Learning (IRL). Our results demonstrate that Entropy-Weighted (EW) fusion achieves performance comparable to or better than re-training while offering a 10x speedup in the design iteration loop.

Introduction

The development of Non-Player Characters (NPCs) using DRL often faces a "brittleness" problem. Minor changes to game mechanics or desired behaviors typically require massive re-training efforts. Policy Fusion aims to bridge the gap between technical DRL complexity and the iterative needs of game designers by allowing new behaviors to be "plugged in" as modular components without compromising the agent's existing capabilities.

Methodology

The core of the proposed approach is the modularization of behaviors. Designers can train specific "micro-behaviors" (sub-policies) using human demonstrations through IRL, which avoids the need for complex reward engineering. These sub-policies are then integrated with a pre-existing main policy using mathematical fusion methods that combine action probability distributions.

The Policy Fusion architecture integrates a main policy with designer-controlled sub-policies to produce a new, adapted policy.

The study evaluates four fusion techniques:

  • Mixture Policy (MP): A simple average of policy distributions.
  • Product Policy (PP): Multiplies probabilities, emphasizing actions where policies agree.
  • Entropy-Threshold Policy (ET): Switches to the sub-policy when its certainty exceeds a threshold.
  • Entropy-Weighted Mixture Policy (EW): Dynamically weights the sub-policy based on its internal confidence (entropy). This allows the agent to adopt new behaviors only in relevant states, preserving the main policy's performance elsewhere.

Experimental Results

The framework was tested in the MiniWorld 3D simulator and DeepCrawl, a procedurally generated Roguelike. The experiments focused on performance enhancement, stylistic changes, and adaptation to new game features.

Performance metrics across different scenarios (a, b, c) showing normalized rewards and win rates for various fusion methods compared to baselines.

Efficiency and Performance

Training a sub-policy took approximately 6 hours, a significant reduction from the 66 hours required for a full re-train. Despite this 10x speedup, the EW fusion method consistently outperformed or matched traditional re-training. In performance-enhancement tasks, the EW method achieved win rates exceeding 70% against the original base agent, demonstrating its ability to effectively integrate new strategic behaviors.

Conclusion

Policy Fusion provides a scalable and efficient way to customize DRL agents. By leveraging entropy to manage policy transitions, the method avoids the pitfalls of fine-tuning while drastically reducing training time. Future work will explore applications in continuous action spaces and the management of larger sets of simultaneous sub-policies.

Summary updated

Abstract

In this article we study the problem of training intelligent agents using Reinforcement Learning for the purpose of game development. Unlike systems built to replace human players and to achieve super-human performance, our agents aim to produce meaningful interactions with the player, and at the same time demonstrate behavioral traits as desired by game designers. We show how to combine distinct behavioral policies to obtain a meaningful “fusion” policy which comprises all these behaviors. To this end, we propose four different policy fusion methods for combining pre-trained policies. We further demonstrate how these methods can be used in combination with Inverse Reinforcement Learning in order to create intelligent agents with specific behavioral styles as chosen by game designers, without having to define many and possibly poorly-designed reward functions. Experiments on two different environments indicate that entropy-weighted policy fusion significantly outperforms all others. We provide several practical examples and use-cases for how these methods are indeed useful for video game production and designers.
BibTeX
@inproceedings{sestini2021policy,
  author = {Alessandro Sestini and Alexander Kuhnle and Andrew D. Bagdanov},
  title = {{Policy Fusion for Adaptive and Customizable Reinforcement Learning Agents}},
  booktitle = {CoG},
  year = {2021},
  url = {https://openreview.net/forum?id=2jdttNZRjR},
}
Figure