Introduction
In the realm of robotic control, reinforcement learning (RL) agents often struggle with complex tasks characterized by sparse rewards. This paper introduces Self-Paced Contextual Reinforcement Learning (SPRL), an algorithm that enables an agent to control its own training curriculum. By dynamically adjusting the distribution of tasks it encounters—starting with "easy" versions and gradually shifting toward the true target distribution—SPRL significantly improves sample efficiency and helps agents avoid the local optima that plague standard RL approaches.
The Challenge of Fixed Task Distributions
Standard contextual reinforcement learning typically assumes that the distribution of tasks (contexts) is fixed and outside the agent's control. In real-world robotics, this assumption is often counterproductive. Forcing an untrained agent to immediately tackle a random sampling of difficult tasks frequently results in uninformative gradients and stalled learning progress.
While "curriculum learning"—training on progressively harder tasks—is a known remedy, manually designing these curricula is tedious and often suboptimal. Finding the mathematically optimal sequence of tasks is an intractable problem, creating a need for an automated, principled way to pace an agent's learning.
Self-Paced Contextual Reinforcement Learning (SPRL)
SPRL builds upon Contextual Relative Entropy Policy Search (C-REPS), an information-theoretic RL algorithm. The core innovation is a "self-paced" mechanism where the agent actively optimizes an intermediate context distribution alongside its policy.
Instead of passively accepting tasks, the agent solves a constrained optimization problem that balances two competing objectives:
- Reward Maximization (Local): Encourages the agent to sample tasks it can already perform well (typically easier tasks).
- Target Alignment (Global): Minimizes the Kullback-Leibler (KL) divergence between the current training distribution and the final target distribution.
A hyperparameter $\alpha$ controls this trade-off. Initially, $\alpha$ is low, allowing the agent to focus on high-reward, easy tasks (e.g., steering through a very wide gate). As training progresses, $\alpha$ increases, forcing the intermediate distribution to morph into the target distribution. This process is solved using a Lagrangian dual formulation, ensuring stable updates to both the policy and the task distribution.
Experimental Evaluation
The authors evaluated SPRL across three simulated continuous control environments against several baselines, including C-REPS, GoalGAN, and PPO:
- Gate Environment: A 2D point-mass must steer through a gate where position and width vary. SPRL successfully avoided catastrophic local optima that trapped other algorithms when dealing with narrow target distributions.
- Reacher Environment: A robotic arm must reach a goal while avoiding obstacles of varying sizes. SPRL found superior global optima and exhibited faster, lower-variance convergence compared to curriculum-generation baselines like GoalGAN.
- Sparse Ball-in-a-Cup: A simulated Barrett WAM robot must catch a ball in a cup with a strictly sparse reward (success or failure). SPRL autonomously started with artificially large cups and progressively shrunk them, vastly outperforming all baselines.
Key Insights and Findings
- Automated Curriculum Discovery: The dual variable in the SPRL formulation naturally emerges as a "context-value function." This function shifts sampling density toward areas of the context space with higher expected rewards, effectively automating the discovery of what constitutes an "easy" task.
- Avoiding Local Optima: By allowing the agent to gravitate toward high-reward contexts early on, SPRL prevents it from getting trapped in suboptimal behaviors. For example, in the Gate task, standard algorithms often fail on narrow gates, whereas SPRL learns the general motion on wide gates first and then refines it.
- Real-World Transfer: The policy learned for the difficult Ball-in-a-Cup task was successfully transferred to a physical Barrett WAM robot with only minor fine-tuning, demonstrating the robustness of the learned behaviors.
Future Directions
While SPRL shows great promise, the authors identify several areas for future work. The parameter $\alpha$, which dictates the pace of the curriculum, is currently chosen using a heuristic; a more rigorous, automated method for optimizing this pacing could further maximize learning speed. Additionally, extending SPRL from episodic frameworks to step-based policy search algorithms (like TRPO or PPO) could improve sample efficiency by leveraging transition-level information.
Summary updated