TL;DR
SafeAPT is a novel sim-to-real robot learning framework that safely and efficiently transfers skills from simulation to physical robots. By combining a diverse repertoire of pre-trained simulation policies with online Gaussian Process models and a new "Expected Safe Improvement" acquisition function, SafeAPT adapts to new goals in the real world within minutes while strictly minimizing safety violations during exploration.
What Problem Does This Paper Address?
Training reinforcement learning (RL) policies directly on physical robots is notoriously data-inefficient and dangerous. While training in simulation (sim-to-real) solves the data efficiency problem, it introduces the reality gap—discrepancies in physics, friction, or mass between the simulator and the real world.
A policy that is perfectly safe in simulation might cause a physical robot to thrash, damage itself, or harm its surroundings during real-world execution. Existing safe RL methods often require extensive real-world trial-and-error to learn safety constraints, which defeats the purpose. Repertoire-based methods (which pre-compute a diverse set of policies in simulation) help bridge the reality gap but typically fail to handle changing goals and safety constraints simultaneously. SafeAPT addresses this gap by ensuring the robot remains safe during the online adaptation phase, even when facing unknown real-world dynamics and novel goals.
Methods
SafeAPT splits the learning process into an offline simulation phase and an online real-world adaptation phase:
- Offline Repertoire Generation: The authors use MAP-Elites, a quality-diversity algorithm, to generate a large collection (repertoire) of policies in simulation. Crucially, these policies are optimized to maximize safety across a wide distribution of randomized dynamics conditions (e.g., varying mass, friction, or joint damage). Each policy is mapped to a unique coordinate in a low-dimensional "goal-space."
- Online Transformation Modeling: When deployed on the real robot, SafeAPT initializes two Gaussian Process (GP) regression models to capture how rewards and safety scores transform from simulation to reality. The simulation data serves as a prior mean function for these GPs, allowing them to learn incredibly fast with minimal real-world data.
- Expected Safe Improvement (ESI): To select which policy to try next on the physical robot, the authors introduce a novel Bayesian Optimization acquisition function called ESI. ESI modifies standard Expected Improvement by multiplying it by an indicator function. This function drops to zero if the Lower Confidence Bound (LCB) of the predicted safety score falls below a user-defined safety threshold ($\lambda$).
Datasets
The algorithm was evaluated on three distinct experimental setups:
- Asteroid Landing Task (Simulated): An 8D policy space problem where a lander must descend to a specific altitude and hover, without ever dropping below a critical safety altitude under unknown gravity conditions.
- Planar-Arm Goal Reaching Task (Simulated): A 4-DoF kinematic arm controlled by a neural network (204 parameters) that must reach a 2D target while avoiding four unsafe obstacles.
- Kuka-Arm Hockey Task (Simulated & Real-World): A Kuka LWR 4+ robot arm equipped with a floorball stick must hit a hockey puck to a target location on a low-friction surface. The safety constraint dictates that the puck must not fly off the edges of the table.
Key Insights and Ideas
- Diversity as a Safety Net: Instead of trying to find one "perfect" robust policy, SafeAPT curates a diverse library of policies. If the reality gap breaks one policy, another behavior in the repertoire (e.g., a different striking angle or gait) is likely to succeed safely.
- Simulation as a GP Prior: Learning a safety model from scratch in the real world is inherently unsafe. By treating simulation results as prior knowledge for the Gaussian Processes, the robot starts with a reasonable guess of what is safe, drastically reducing risky exploration.
- Cautious Optimization: As shown in the asteroid landing visualization below, the ESI acquisition function forces the robot to explore conservatively at first, gathering data around known safe zones before gradually expanding its search to maximize rewards.
Key Results
SafeAPT was benchmarked against Constrained Bayesian Optimization (CBO) and two ablation variants (one without online safety learning and one trained on only a single simulation dynamic).
- Zero Real-World Violations: In the physical Kuka hockey task, SafeAPT achieved a maximum reward of $0.97 \pm 0.04$ with exactly $0.0 \pm 0.0$ safety violations across all experimental runs.
- Baseline Failures: The ablation baseline without online GP-safety achieved a lower reward ($0.89 \pm 0.15$) and suffered an average of 4.4 safety violations per experiment, proving that simulation priors alone are insufficient to guarantee real-world safety.
- Data Efficiency: SafeAPT successfully identified high-performance, safe policies within less than a minute of real-world interaction (under 15-20 episodes across all tasks).
Limitations and Future Work
The primary limitation of SafeAPT stems from its inheritance of repertoire-based learning constraints: the pre-computed policy library is bounded by the discretization density of the goal-space. If the discretization is too coarse, the final policy may be sub-optimal.
To address this, the authors suggest that SafeAPT should be used as a rapid, safe initialization method. Once SafeAPT safely locates the best-performing policy from the repertoire, local optimization algorithms (like Safe-Opt) can be deployed directly in the high-dimensional parameter space to fine-tune the behavior to perfection.
Summary updated