Rule-Guided Reinforcement Learning Policy Evaluation and Improvement

Martin Tappler, Ignacio D. Lopez-Miguel, Sebastian Tschiatschek, Ezio Bartocci · DOI

Introduction

Deep reinforcement learning (RL) has demonstrated the potential for superhuman performance in complex tasks ranging from strategic games to autonomous navigation. However, these agents often remain "black boxes," lacking both interpretability and the ability to generalize basic common-sense concepts. For instance, an agent might learn to avoid an obstacle to its left but fail to apply that same logic when an identical obstacle appears on its right. This paper introduces LEGIBLE (poLicy Evaluation GuIded By ruLEs), a neuro-symbolic framework designed to extract, generalize, and enforce decision-making rules to improve RL policy performance and transparency.

The Problem: Generalization and Interpretability

Despite their success, deep RL agents are notoriously difficult to trust because their decision-making processes are opaque. This opacity makes it challenging to understand why an agent fails in seemingly obvious scenarios. Furthermore, injecting human domain knowledge—such as spatial symmetries or physical invariants—into a neural network is a non-trivial task. Standard training often fails to capture these relational invariants, leading to policies that are brittle when faced with state-space permutations that should, logically, be handled identically.

The LEGIBLE Framework

LEGIBLE addresses these challenges through a three-step process that bridges the gap between connectionist neural networks and symbolic logic.

1. Rule Mining

The process begins by observing a pre-trained Q-learning agent as it interacts with its environment. To translate the neural network's weights into understandable logic, the framework employs LIME (Local Interpretable Model-agnostic Explanations) to identify the most influential state features for specific decisions. These observations are then processed by RIPPER, a rule-learning algorithm, to generate symbolic "positive" rules (actions the agent prefers) and "negative" rules (actions the agent avoids).

2. Rule Generalization

To overcome the agent's inherent generalization gaps, LEGIBLE utilizes Metamorphic Testing, a concept borrowed from software engineering. By defining Metamorphic Relations (MRs), the framework encodes domain knowledge such as rotational or reflectional symmetry. For example, if a mined rule states "do not move North if a wall is present to the North," an MR encoding 90-degree rotation automatically generates a corresponding rule: "do not move East if a wall is present to the East." This allows the system to synthesize logic that the agent should have known but failed to learn during training.

3. Rule-Guided Execution and Improvement

During deployment, the agent’s actions are filtered through these generalized rules. If a rule is triggered, it can either block a dangerous action or force a beneficial one. By monitoring whether these interventions lead to higher rewards, the system identifies specific weaknesses in the original policy. Finally, the framework greedily aggregates the most successful rules to create a permanently improved execution strategy.

Experimental Evaluation

The authors evaluated LEGIBLE across two distinct domains:

  • PAC-Man: Six grid-world levels of varying complexity and size.
  • Highway-env: Five continuous driving scenarios, including highway merging, intersections, and roundabouts, where an ego-vehicle must navigate safely around traffic.

Key Results and Insights

The experiments yielded three primary findings:

  1. Effective Weakness Detection: Rule-guided execution successfully identified blind spots in all 11 tested policies, significantly outperforming standard random testing baselines in finding policy failures.
  2. Significant Performance Gains: Applying generalized rules led to substantial improvements in cumulative rewards. Notably, in the highway-fast environment, the framework achieved a 273% improvement over the base policy.
  3. Efficiency Over Retraining: In nearly every scenario, applying LEGIBLE to an existing policy resulted in better performance than simply training the original agent for twice as many iterations. This suggests that symbolic guidance is a more efficient way to handle edge cases and symmetries than brute-force data collection.

Discussion and Limitations

While LEGIBLE provides a powerful tool for policy improvement, it currently faces some constraints. The rule-mining phase requires discrete action spaces and the discretization of continuous state features. Additionally, the framework is most effective with off-policy algorithms like DQN. On-policy algorithms like PPO can sometimes exhibit "reckless" behavior when their trajectories are artificially altered by external rules, as the underlying policy expects to follow its own learned distribution.

Conclusion

LEGIBLE demonstrates that explainability can be more than just a diagnostic tool; it can be an active component in the RL optimization loop. By using symbolic rules to patch the generalization gaps of neural networks, the framework provides a path toward RL agents that are not only more performant but also more aligned with human logic and domain expertise. Future work will focus on integrating these rules directly into the training loop and expanding the framework to handle temporal dependencies across multiple time steps.

Summary updated

BibTeX
@inproceedings{tappler2025rule,
  author = {Martin Tappler and Ignacio D. Lopez-Miguel and Sebastian Tschiatschek and Ezio Bartocci},
  title = {{Rule-Guided Reinforcement Learning Policy Evaluation and Improvement}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/696},
}
Figure