RecoveryDAgger: Query-Efficient Online Imitation Learning Through Recovery Policy

Dec 23, 2025
Course Research Project — Reinforcement Learning, Fall 2025
Wen-Ai Ho*, Aaron Wu*, Sheng-Yu Cheng*, and Sheng-Hsun Chang*
Department of Electrical Engineering, National Taiwan University
* All authors contributed equally.

Report (PDF) · Code · Slides

RecoveryDAgger framework

Figure 1: Overview of the proposed framework. An expert policy first generates an offline demonstration dataset, which is used to pretrain the imitation learning (BC) policy. During online training, the agent interacts with the environment using the IL policy. When a state is detected as risky, a recovery policy optimizes an action via gradient ascent on the Q-network; when a state is identified as novel, the agent queries the expert policy. All executed state-action pairs are stored in the replay buffer and are subsequently used to update both the Q-network and the IL policy.

Abstract

Interactive imitation learning methods such as DAgger address the covariate shift problem of behavior cloning by collecting corrective demonstrations on states visited by the learner. However, frequent expert intervention introduces substantial annotation costs.

We propose RecoveryDAgger, a query-efficient interactive imitation learning framework that distinguishes between novelty and risk. When the agent encounters a familiar but risky state, a gradient-based recovery policy locally corrects its behavior using a learned Success Q-function. Expert supervision is reserved for states identified as novel.

Experiments on PointMaze demonstrate that RecoveryDAgger substantially reduces expert queries while maintaining strong task performance. Our Ensemble-Q variant achieves 88% task success with approximately 87% fewer expert queries than ThriftyDAgger at their respective best-performing checkpoints.

Method

RecoveryDAgger Framework

RecoveryDAgger introduces three possible sources of action during online training:

  • Expert policy: Provides corrective demonstrations in states identified as novel.
  • Recovery policy: Corrects actions in familiar but risky states using the learned Success Q-function.
  • Imitation policy: Executes learned actions in familiar, low-risk states.

By distinguishing novelty from risk, RecoveryDAgger allows the agent to reuse knowledge acquired through previous interactions before requesting additional expert supervision.

Gradient-Based Recovery

The Success Q-function estimates the likelihood of eventual task completion given a state-action pair.

Starting from the action proposed by the imitation policy, the recovery policy performs iterative gradient ascent on Success Q to identify an action with higher predicted success. Each update is projected back into the valid action space.

Ensemble Success Q

We further investigate an ensemble of independently trained Success Q networks to improve recovery and uncertainty estimation.

The ensemble mean estimates task success, while the variance provides a measure of epistemic uncertainty.

The recovery objective combines success maximization with an uncertainty penalty:

$$ J(s,a) = \overline{Q}(s,a) - \lambda \operatorname{Var}[Q(s,a)] $$

This encourages recovery actions that lead toward higher predicted success while avoiding poorly understood transitions.

Experimental Results

Experimental Setup

We evaluate RecoveryDAgger on a four-room PointMaze navigation task with narrow corridors and sparse rewards.

All online methods are initialized from the same behavior-cloned policy trained on 100 trajectories collected from a rule-based expert.

An episode is considered successful if the agent reaches the goal within the time limit without colliding with walls.

Performance Comparison

MethodExpert QueriesRecovery ActionsEnvironment StepsSuccess Rate
Behavior Cloning———26%
ThriftyDAgger20,048—58,02981%
Single-Q Recovery (Ours)2,5049,23254,02786%
Ensemble-Q Recovery (Ours)2,6939,29650,02588%

Results are reported at the checkpoint with the highest test success rate for each method over 30 online training iterations.

Success rate versus cumulative expert queries
(a) Success rate vs. total expert queries
Test success rate versus environment interaction steps
(b) Success rate vs. time steps

Figure 3: In our experiments on the PointMaze environment, we compare Single-Q recovery and Ensemble-Q recovery against the baseline ThriftyDAgger.

Our results suggest that a substantial portion of expert interventions can be replaced by recovery actions derived from learned value gradients.

Mechanism Analysis

To better understand the behavior of RecoveryDAgger, we visualize the learned Success Q-function and representative trajectories collected during online training.

Heatmap of the learned Success Q-function over the two-dimensional maze
(a) Learned Success Q heatmap
Online training trajectories with expert interventions in red and recovery actions in green
(b) Online training trajectories

Figure 4: Visualization of the learned Success Q function and its effect on online training deployment. Figure 4a shows the learned Success Q function over the 2D state space. Figure 4b depicts the online training trajectories, where black trajectories correspond to the IL agent’s executed paths during training, where red segments indicate novel states queried to the expert and green segments denote recovery actions.

The learned Success Q-function captures task-relevant regions and provides local guidance for correcting risky behaviors. Expert intervention remains necessary in novel regions where the learned value estimates are unreliable.

Limitations

The effectiveness of RecoveryDAgger depends on the accuracy of the learned Success Q-function and the local recoverability of risky states.

Gradient-based recovery also introduces additional computational overhead, potentially limiting its applicability to high-dimensional action spaces and real-time robotic systems.

Our current evaluation is limited to simulated navigation. Extending RecoveryDAgger to real-world robotic systems and more complex tasks remains an important direction for future work.

Self-correcting agent: Recovering from danger

IEEE Potentials, 2026.