Abstract
Behavior cloning of expert demonstrations can speed up learning optimal policies in a more sample-efficient way over reinforcement learning. However, the policy cannot extrapolate well to unseen states outside of the demonstration data, creating covariate shift (agent drifting away from demonstrations) and compounding errors. In this work, we tackle this issue by extending the region of attraction around the demonstrations so that the agent can learn how to get back onto the demonstrated trajectories if it veers off-course. We train a generative backwards dynamics model and generate short imagined trajectories from states in the demonstrations. By imitating both demonstrations and these model rollouts, the agent learns the demonstrated paths and how to get back onto these paths. With optimal or near-optimal demonstrations, the learned policy will be both optimal and robust to deviations, with a wider region of attraction. On continuous control domains, we evaluate the robustness when starting from different initial states unseen in the demonstration data. While both our method and other imitation learning baselines can successfully solve the tasks for initial states in the training distribution, our method exhibits considerably more robustness to different initial states.
Introduction
In Imitation Learning (IL), specifically Behavior Cloning (BC), an agent learns to map states to actions based on expert demonstrations. While efficient, BC suffers from a fundamental flaw known as covariate shift. Because expert data typically covers only a narrow "tube" of the state space, the agent never learns how to recover if it makes a small mistake and veers off-course. Once the agent enters a state outside the training distribution, errors compound rapidly, leading to total task failure.
Existing solutions often rely on interactive experts (e.g., DAgger) to provide real-time corrections, but such feedback is frequently unavailable or expensive in real-world robotics. This paper introduces Backwards Model-based Imitation Learning (BMIL), a method designed to make agents robust to deviations using only a small set of offline demonstrations by widening the policy's "region of attraction."
Methodology: The BMIL Framework
The core innovation of BMIL is the use of a Generative Backwards Dynamics Model to teach the agent recovery behaviors. The process consists of four primary stages:
- Backwards Model Training: Instead of a standard forward model, the authors train a model $B$ to predict the previous state and action given a current state: $p(s_t, a_t | s_{t+1})$. This model is trained exclusively on the provided expert transitions.
- Imagined Rollouts: Starting from states within the expert demonstrations, the agent uses the backwards model to generate short, synthetic "imagined" traces. Because these traces are generated backwards from the expert path, they represent potential trajectories that lead into successful expert states.
- Action Perturbation: To ensure the agent learns a wide "funnel" leading to the goal, the authors perturb the first action in these backwards traces using entropy-based scaling. This forces the model to explore and learn from states slightly further away from the expert path, effectively thickening the "tube" of successful states.
- Policy Training: The final policy is trained via supervised learning (log-likelihood) on a combined dataset of the original expert demonstrations and the synthetic backwards-generated traces.
By imitating these backwards paths, the agent implicitly learns a recovery policy: "If I find myself in this off-track state, this is the action required to return to the expert's successful trajectory."
Experimental Setup
The researchers evaluated BMIL against standard BC and VINS (a baseline for robust value functions) across several continuous control benchmarks in the MuJoCo simulator:
- Fetch Robotics: "Push" (5 demonstrations) and "PickAndPlace" (10 demonstrations) tasks.
- Maze Navigation: Three layouts (UMaze, Room, Corridor) using a Point mass agent and a complex 29-DoF Ant robot (20 demonstrations each).
- Adroit Hand Manipulation: The "Relocate" task, which requires a 24-DoF robotic hand to move a ball (20 demonstrations).
Key Results and Discussion
BMIL significantly outperformed baselines in terms of Robustness, defined as the success rate when starting from initial positions not seen in the training data.
- Enhanced Robustness: In the Fetch PickAndPlace task, BMIL achieved a 17.5% success rate compared to just 4.1% for BC—a 4.31x improvement. In the Adroit Relocate task, BMIL improved robustness by 68% over BC (13.3% vs 7.9%).
- The Advantage of Backwards Modeling: The authors found that backwards models are superior to forward models for this purpose. Forward models often predict where an agent will go, which can compound errors, whereas backwards models naturally anchor synthetic data to known-good expert states.
- Sample Efficiency: BMIL proves highly effective with as few as 5–20 demonstrations. It does not necessarily solve tasks faster than BC, but it solves them far more reliably from varied starting positions.
- Computational Trade-offs: While BMIL requires approximately 5x more gradient updates than BC due to the dynamics model training, the authors demonstrated that simply increasing the training time for standard BC does not yield similar robustness gains.
Limitations and Future Work
While BMIL offers a robust solution for offline IL, it has certain limitations. The method assumes reversibility in state transitions; it may struggle in environments with "traps" or one-way physics (e.g., falling off a ledge). Additionally, the current implementation uses low-dimensional state vectors. Future work will explore extending BMIL to high-dimensional visual inputs (pixels), which may require latent space modeling. Finally, incorporating safety constraints into the backwards model could ensure that imagined recovery traces do not pass through irrecoverable or dangerous states.
Summary updated