TL;DR
DELTA (Differential Testing for DRL Agents) is a novel framework that identifies "optimality bugs"—safe but inefficient decisions—in Deep Reinforcement Learning agents. By repurposing data from standard safety testing to train a "challenger" agent via offline RL, DELTA creates a self-referential oracle that uncovers 50% more bugs than state-of-the-art baselines.
What Problem Does This Paper Address?
Testing Deep Reinforcement Learning (DRL) agents is notoriously difficult. Most current research focuses on safety-critical failures (e.g., a robot crashing into a wall). However, an agent can be perfectly safe but highly suboptimal—like a delivery robot that always takes the longest, most congested route. These "optimality bugs" lead to economic loss and user distrust.
The core challenge is the oracle problem: in complex, dynamic environments, we often don't know what the "perfect" theoretical path is. Without a ground-truth optimal policy to compare against, how do we know if an agent's decision was the best one? Furthermore, training multiple high-performing agents from scratch to perform differential testing is computationally prohibitive.
Methods
DELTA introduces a two-phase, "self-referential" approach to solve the oracle problem efficiently:
- Safety Testing & Data Logging: The framework first runs a standard safety test (using tools like CureFuzz) to find catastrophic failures. Crucially, it logs every interaction trajectory—both the agent's successes and its failures.
- Challenger Training via Offline RL: Instead of interacting with the environment again, DELTA uses the logged data to train a "challenger" agent using Offline Reinforcement Learning (specifically algorithms like BCQ or CQL). This challenger learns to "stitch together" the best parts of the observed trajectories to potentially outperform the original agent.
- Differential Fuzzing: DELTA then uses this challenger as a testing oracle. It employs an energy-guided fuzzing loop to mutate initial states (seeds) and compare the performance of the original agent against the challenger.
The fuzzing process is guided by an "energy" function composed of three metrics:
- Diversity: Novelty of the state space explored.
- Regret: The performance gap where the challenger outperforms the original agent.
- Inconsistency: How much the two agents' behaviors diverge, measured via Locality Sensitive Hashing (LSH).
Datasets
The authors evaluated DELTA across five diverse, standard DRL benchmarks:
- Classic Control: CartPole, MountainCar, and Acrobot.
- MuJoCo Locomotion: Hopper and Walker2D.
- Non-Deterministic Extension: They also tested a noisy variant, Hopper-Noise, to validate the framework's effectiveness in stochastic environments.
Key Insights and Ideas
- Waste Not, Want Not: The most elegant insight is that safety testing logs—often discarded after bugs are found—are a "vibrant and underutilized resource." They contain a mixture of high-quality successful decisions and critical negative examples (failures) that are perfect for jump-starting a challenger agent.
- Offline RL as a Testing Tool: The paper demonstrates that offline RL algorithms, typically used for training agents when environment interaction is expensive, are excellent for creating comparative benchmarks for software testing.
- Regret as a Search Signal: The ablation study revealed that Regret is the most crucial factor for finding a high volume of bugs. Prioritizing scenarios where the challenger shows a clear advantage effectively guides the fuzzer toward the agent's weaknesses.
- Closing the Loop: The "optimality bugs" found aren't just for reporting; they can be used to fine-tune the original agent, significantly improving its performance and, surprisingly, its safety robustness.
Key Results
- Bug Detection: DELTA identified an average of 2,518 optimality issues per environment, outperforming baselines like MDPFuzz and GMT by an average of 50.2%.
- Algorithm Selection: Among offline RL methods, BCQ (Batch-Constrained deep Q-learning) proved the most effective for generating competent challengers.
- Performance Gains: Fine-tuning agents on the bugs found by DELTA led to significant improvements. For example, the CartPole agent reached the theoretical maximum score of 500, and the Walker2D agent's performance increased by over 12%.
- Robustness: Improving optimality also improved safety. In CartPole and MountainCar, the fine-tuned "Improved-AUT" repaired 100% of previously known safety failures.
Limitations and Future Work
- Deterministic Assumption: The primary framework assumes deterministic environments and policies. While the authors proposed a statistical extension for non-deterministic settings, more work is needed to scale this to highly stochastic real-world scenarios.
- Reliance on Safety Testing: DELTA's effectiveness is capped by the quality of the initial safety testing phase. If the safety tester fails to explore a region of the state space, the challenger will be "blind" to optimality issues in that region.
- Future Directions: The authors plan to evaluate DELTA on more complex domains like autonomous driving and explore newer, more powerful offline RL algorithms to create even stronger challengers.
Summary updated