Abstract
Generative Adversarial Imitation Learning (GAIL) faces a significant performance-stability trade-off. While Stochastic GAIL (ST-GAIL) is stable but data-inefficient, Deterministic GAIL (DE-GAIL) is efficient but prone to catastrophic "gradient explosion." This paper investigates the theoretical roots of this instability, establishing a probabilistic lower bound for gradients in DE-GAIL. We demonstrate that early training instability is an inherent risk of the standard reward structure and introduce CREDO (Clipping REward of Discriminator Outlier), a simple reward-clipping strategy that stabilizes training without sacrificing data efficiency. Experimental results on MuJoCo benchmarks show that CREDO-stabilized DE-GAIL achieves expert-level performance with high reliability.
Introduction
Imitation Learning (IL) enables agents to acquire complex behaviors by mimicking expert demonstrations. Within this domain, Generative Adversarial Imitation Learning (GAIL) is a leading approach, utilizing a discriminator to distinguish between expert and agent actions. However, practitioners often face a dilemma: choosing between the reliable but slow Stochastic GAIL (ST-GAIL) and the fast but volatile Deterministic GAIL (DE-GAIL). In empirical tests, vanilla DE-GAIL algorithms failed to converge in over 36% of cases due to sudden training divergence.
The GAIL Paradox: Stability vs. Efficiency
The fundamental difference between ST-GAIL and DE-GAIL lies in their policy representation. ST-GAIL uses stochastic policies, which provide a natural smoothing effect. In contrast, DE-GAIL utilizes deterministic policies that can achieve expert-level performance up to 10x faster but are notoriously unstable.
As illustrated in the overview diagram, while ST-GAIL converges slowly but consistently, DE-GAIL exhibits rapid progress but frequently suffers from "gradient explosion" leading to total failure. This paper explains why this divergence occurs and how to mitigate it.
Theoretical Analysis of Gradient Explosion
The researchers analyzed DE-GAIL by treating deterministic policies as the zero-variance limit of stochastic Gaussian policies. Their core theoretical contribution is the derivation of a probabilistic lower bound for policy gradients. They proved that when a significant "policy disparity" exists—where the agent's action differs markedly from the expert's—the gradient of the policy loss tends toward infinity as the policy becomes more deterministic.
This is driven by the standard GAIL reward function, $r(s, a) = -\log(1 - D(s, a))$. As the discriminator becomes certain ($D \to 1$), the reward signal grows exponentially, leading to the infinite gradients that destabilize the neural network.
The empirical validation above shows how gradients in failing DE-GAIL experiments dwarf those in successful runs.
The CREDO Solution
Based on the insight that near-zero rewards trigger explosion, the authors propose CREDO (Clipping REward of Discriminator Outlier). CREDO modifies the reward function by introducing a clipping threshold $c$:
$$r(s, a) = \min(-\log(1 - D(s, a)), c)$$
By capping the maximum reward signal, CREDO prevents the infinite gradients that occur during early training stages. This provides a safety net similar to the inherent randomness of ST-GAIL while maintaining the speed of DE-GAIL.
Experimental Evaluation
The effectiveness of CREDO was evaluated using the MuJoCo physics engine on benchmarks including Hopper-v2, HalfCheetah-v2, and Walker2d-v2. Key findings include:
- Elimination of Failures: Integrating CREDO into SD3-GAIL virtually eliminated the 36% failure rate observed in vanilla implementations.
- Efficiency Retention: CREDO-DE-GAIL reached expert performance levels an order of magnitude faster than PPO-GAIL (ST-GAIL).
- Stability: The stability gains were consistent across multiple random seeds and diverse environments.
Conclusion
This research identifies the theoretical cause of instability in deterministic GAIL: the interaction between deterministic policies and the unbounded adversarial reward. The proposed CREDO algorithm offers a practical solution that allows researchers to leverage the efficiency of DE-GAIL with the reliability of ST-GAIL. Future work will focus on adaptive clipping mechanisms and higher-dimensional real-world tasks.
Summary updated