Abstract
A long-standing challenge in artificial intelligence is lifelong reinforcement learning, where learners are given many tasks in sequence and must transfer knowledge between tasks while avoiding catastrophic forgetting. Policy reuse and other multi-policy reinforcement learning techniques can learn multiple tasks but may generate many policies. This paper presents two novel contributions, namely 1) Lifetime Policy Reuse, a model-agnostic policy reuse algorithm that avoids generating many policies by optimising a fixed number of near-optimal policies through a combination of policy optimisation and adaptive policy selection; and 2) the task capacity, a measure for the maximal number of tasks that a policy can accurately solve. Comparing two state-of-the-art base-learners, the results demonstrate the importance of Lifetime Policy Reuse and task capacity based pre-selection on an 18-task partially observable Pacman domain and a Cartpole domain of up to 125 tasks.
Introduction
In Lifelong Reinforcement Learning (LRL), an agent encounters a sequence of diverse tasks over its operational lifetime. The primary objective is to facilitate knowledge transfer from previously encountered tasks to novel ones while mitigating the risk of catastrophic forgetting—the phenomenon where learning new information leads to the degradation of previously acquired skills.
Existing methodologies generally fall into two categories: single-policy methods, which often suffer from interference when representing disparate tasks in a single network, and multi-policy methods, which tend to scale poorly in terms of memory as they instantiate new policies for every new task. This paper addresses the "Goldilocks" problem of LRL: how to maintain high performance across a large task space while adhering to strict memory constraints by using a limited, fixed number of policies.
Methodology
The authors propose two major innovations to address these challenges: Lifetime Policy Reuse (LPR) and the concept of task capacity.
Lifetime Policy Reuse (LPR)
Unlike traditional multi-policy methods that grow a library indefinitely, LPR utilizes a fixed-size library of policies.
As illustrated in Figure 1, the LPR architecture employs an $\epsilon$-greedy bandit selector to determine which policy from the library should be applied to the current task, based on its "lifetime average reward." This selection mechanism allows the system to adaptively switch between policies, providing an "escape hatch" if a specific policy becomes trapped in a suboptimal region of the parameter space. Crucially, LPR is model-agnostic and can be integrated with various base learners such as DQN or PPO.
Task Capacity Metrics
To provide a principled way to size the policy library, the authors define task capacity—a measure of how many tasks a single policy can effectively manage. They introduce two variants:
- Theoretical Task Capacity: Derived from the representational limits of the neural network architecture.
- Empirical Task Capacity: Based on actual learning performance relative to a "one-policy-per-task" baseline.
Experimental Evaluation
The proposed methods were evaluated across three distinct domains designed to test different aspects of the LRL problem. Notably, the experiments utilized an "anti-curriculum" approach, where tasks are presented in a random, rapid sequence. This prevents agents from fully converging on one task before moving to the next, significantly increasing the difficulty of avoiding catastrophic forgetting.
- 27-task Cartpole (MDP): Tasks vary by physical parameters like pole length and mass, representing a high-similarity domain.
- 125-task Cartpole (MDP): An expanded version to test the scalability of task capacity pre-selection in larger task spaces.
- 18-task POcman (POMDP): A partially observable version of Pacman where tasks involve conflicting goals (e.g., "touch the ghost" vs. "avoid the ghost"). This represents a low-similarity domain with high potential for negative transfer.
Results and Discussion
The experiments revealed several key insights into the behavior of LRL agents:
- Efficiency and Memory Savings: In the Cartpole domain, LPR with just 9 policies achieved performance comparable to a baseline using 27 policies. This fixed-library approach prevents linear memory growth, offering a 3x to 5x reduction in RAM usage in long-term scenarios.
- Base Learner Dynamics: The study found that DQN learns faster but forgets more aggressively than PPO. PPO’s "clipped" objective acts as a natural stabilizer, making it more robust to interference when one policy is forced to learn multiple tasks.
- Overcoming Negative Transfer: In the complex POcman domain, LPR significantly outperformed single-policy baselines. Single-policy methods suffered from negative transfer because they attempted to learn opposite behaviors within the same network weights, whereas LPR could isolate these behaviors into different policies in the library.
- Predictive Power of Capacity: By calculating the task capacity on a small subset of tasks, the authors could accurately predict the number of policies needed for the 125-task sequence, maintaining high performance while optimizing resource usage.
Conclusion
Lifetime Policy Reuse and the concept of task capacity provide a robust framework for lifelong reinforcement learning under resource constraints. While the current implementation relies on a task index, the authors suggest this could be replaced by automated task identification modules in future work. Additionally, exploring how these capacity metrics apply to even more complex, high-dimensional visual inputs remains a promising avenue for further research.
Summary updated