Deep Reinforcement Learning (RL) has achieved remarkable success in complex games, yet its "black-box" nature remains a significant barrier for real-world applications like autonomous driving. A primary issue is the lack of logical generalization: an agent may learn to avoid an obstacle in one orientation but fail to apply that same logic when the environment is rotated or mirrored. Current evaluation methods often fail to explain why an agent fails or provide a mechanism to inject domain knowledge without extensive retraining.
This paper introduces LEGIBLE (poLicy Evaluation GuIded By ruLEs), a neuro-symbolic framework that extracts, generalizes, and enforces symbolic rules to evaluate and improve deep RL policies. By leveraging environmental symmetries through metamorphic relations, LEGIBLE identifies policy weaknesses and significantly enhances performance, achieving reward increases of up to 273% in complex environments.
The LEGIBLE Framework
The LEGIBLE framework addresses these challenges through a three-step neuro-symbolic pipeline designed to bridge the gap between high-dimensional neural policies and human-readable symbolic logic.
 Source, p. 3
The pipeline consists of three core phases:
- Rule Mining: Using the RIPPER algorithm, the framework translates neural network behavior into symbolic Horn clauses (e.g.,
avoid(North) :- wall(North)). Feature importance is determined using LIME to ensure the mined rules reflect the actual decision-making drivers of the agent. - Rule Generalization (Metamorphic Relations): To address generalization gaps, the system employs Metamorphic Testing (MT) principles. By defining domain-specific symmetries (metamorphic relations), a single mined rule can be automatically expanded to cover equivalent scenarios (e.g., rotating a "don't hit North wall" rule to South, East, and West).
- Rule-Guided Execution: A runtime monitor intercepts the agent's actions. It blocks actions that violate "negative rules" and enforces actions mandated by "positive rules." This serves both as a diagnostic tool—if the guided agent outperforms the original, a generalization weakness is confirmed—and a performance booster.
Experimental Results
The authors evaluated LEGIBLE on PAC-Man and highway-env benchmarks. The framework's ability to detect weaknesses was compared against Random Testing (RT) and Random Rules (RR) baselines.
Key findings include:
- Weakness Detection: The MT-based approach identified policy weaknesses in 5% to 24% of evaluations, significantly outperforming random testing baselines.
- Performance Enhancement: Rule guidance led to massive gains, such as a 273% increase in average cumulative reward in the
highway-fastenvironment. - Training Efficiency: Rule-guided agents often outperformed models trained for twice as many steps (e.g., $10^6$ vs $5 \cdot 10^5$ steps), demonstrating that symbolic logic is a more efficient way to handle logical constraints than pure data-driven training.
Conclusion and Future Work
LEGIBLE provides a powerful method for making deep RL policies more interpretable and robust. By treating logical failures as detectable "weaknesses" and providing a symbolic "safety rail," the framework moves closer to trustworthy AI. While current metamorphic relations require manual expert definition, future work will focus on automating this process and integrating symbolic rules directly into the training loop via methods like imitation learning.
Summary updated