Explaining Reinforcement Learning Agents via Inductive Logic Programming

Celeste Veronese, Edoardo Zorzi, Daniele Meli, Alessandro FarinelliarXiv 2026

TL;DR

This paper introduces a novel framework that leverages Inductive Logic Programming (ILP) to extract human-readable, symbolic rules from deep Reinforcement Learning (RL) policies. By defining four objective, user-independent metrics—activation rate, feature coverage, syntactic distance, and semantic distance—the authors provide a rigorous way to evaluate, debug, and track policy evolution in both single- and multi-agent environments.

What Problem Does This Paper Address?

While deep Reinforcement Learning (RL) excels at solving complex sequential decision tasks, its deep neural network policies function as "black boxes." Explainable RL (XRL) aims to make these policies transparent, but existing methods suffer from two major flaws: they rely heavily on subjective, non-scalable user studies, and they lack standardized, quantitative metrics.

Furthermore, standard RL evaluation relies almost entirely on global return (reward) curves. These curves fail to explain why an agent makes specific decisions or how its sub-policies for individual actions mature over time. This lack of structural verification is a major roadblock for deploying RL in safety-critical, human-centric, or multi-agent settings where coordination and predictability are paramount.

Methods

The authors bridge the gap between deep RL and formal logic using a neuro-symbolic approach. First, they record execution traces (state-action pairs) from an RL agent and map continuous environmental states into discrete, symbolic predicates using Answer Set Programming (ASP). They then apply Inductive Logic Programming (ILP)—specifically the ILASP system—to learn the most compact set of logical rules that accurately explain the agent's behavior.

To systematically evaluate these logical rules without relying on human subjects, the paper introduces four novel, objective metrics:

  1. Activation Rate: Measures how frequently a specific logical rule correctly aligns with the agent's actual behavior for a given action.
  2. Feature Coverage: Quantifies the impact of specific environmental features across the entire learned rule set, acting as a proxy for feature importance.
  3. Syntactic Distance: Measures the structural dissimilarity between two rule sets (e.g., across different training checkpoints) using a Jaccard index over rule bodies.
  4. Semantic Distance: Evaluates behavioral divergence by checking whether two rule sets yield different actions under identical environmental contexts.

Datasets

The framework was evaluated across three distinct simulation environments representing different paradigms:

  • Intersection: A single-agent autonomous driving benchmark from highway-env where an ego-vehicle must safely navigate a busy intersection.
  • Robot Warehouse (RWARE): A cooperative multi-agent environment where robots must coordinate to locate and deliver specific shelves to goal locations.
  • Simple Adversary: A competitive multi-agent particle environment where "good" agents must cooperate to defend a landmark from an adversary.
Fig. 1. Visualization of the Intersection domain and corresponding training dynamics.

Key Insights and Ideas

  • Beyond Global Return: A flat reward curve doesn't mean learning has stopped. The proposed metrics reveal that even after the global return plateaus, an agent's underlying policy often continues to semantically refine and stabilize its action-specific choices.
  • Action-Specific Specialization: The activation rate highlights that specialized actions (like load in a warehouse) are mastered via highly precise, stable logical rules early in training, whereas general movement actions exhibit much higher behavioral variability.
  • Unmasking Multi-Agent Coordination: In cooperative settings, agents trained on the exact same global reward curve can diverge semantically. The semantic distance metric successfully captures how agents develop complementary strategies (e.g., specializing in covering different landmarks) to achieve a shared goal.

Key Results

  • Policy Stabilization: In the Intersection domain, while small structural (syntactic) variations in the rules persisted throughout training, the semantic distance steadily decreased, proving that the agent's decision logic converged to a robust strategy.
  • Feature Selection: Feature coverage analysis successfully isolated critical features (such as good_shelf in RWARE) from redundant ones (such as agent-to-agent proximity), providing a principled, automated way to streamline the agent's state space.
  • Generalization and Transfer: Out-of-distribution testing demonstrated that rules with high activation rates generalize robustly when transferred to larger grid sizes or harder environments, offering a clear signal for which symbolic skills are safe to transfer.

Limitations and Future Work

  • Lack of Temporal Logic: The current framework evaluates static state-action pairs. It cannot capture complex temporal or sequential dependencies (e.g., "if X happened three steps ago, do Y"), which are vital for long-horizon planning tasks.
  • Post-Hoc Constraints: Currently, the rules are extracted after training. The authors note that a crucial next step is closing the loop—using these objective metrics to actively guide, debug, or constrain the deep RL agent during the learning process.
  • Human-in-the-Loop Validation: While the metrics are intentionally user-agnostic, future work must investigate how well these objective logical distances correlate with actual human trust and comprehension in user studies.

Summary updated

BibTeX
@misc{veronese2026explaining,
  author = {Celeste Veronese and Edoardo Zorzi and Daniele Meli and Alessandro Farinelli},
  title = {{Explaining Reinforcement Learning Agents via Inductive Logic Programming}},
  year = {2026},
  eprint = {2607.13655},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.13655},
}
Figure