Abstract
This paper presents a novel approach combining inductive logic programming (ILP) with reinforcement learning (RL) to improve training performance and explainability. We exploit inductive learning of answer set programs from noisy examples to learn a set of logical rules representing an explainable approximation of the agent policy at each batch of experience. We then perform answer set reasoning on the learned rules to guide the exploration of the learning agent at the next batch, without requiring inefficient reward shaping and preserving optimality with soft bias. The entire procedure is conducted during the online execution of the reinforcement learning algorithm. We preliminarily validate the efficacy of our approach by integrating it into the Q-learning algorithm for the Pac-Man scenario in two maps of increasing complexity. Our methodology produces a significant boost in the discounted return achieved by the agent, even in the first batches of training. Moreover, inductive learning does not compromise the computational time required by Q-learning and learned rules quickly converge to an explanation of the agent policy.
Introduction
Reinforcement Learning (RL) has demonstrated remarkable success in solving complex decision-making tasks. However, it remains hindered by two primary challenges: sample inefficiency and a lack of interpretability. In many environments, agents must explore vast state spaces with little initial guidance, often leading to slow convergence. Furthermore, the resulting policies—typically represented as deep neural networks—are "black boxes" that offer no human-readable justification for their actions.
To address these issues, we introduce NeuroQ, a neurosymbolic framework that integrates Approximate Q-Learning with Inductive Logic Programming (ILP). By extracting symbolic rules from high-performing experiences in real-time, NeuroQ provides a "soft bias" that guides exploration, accelerating learning while simultaneously generating an explainable model of the agent's strategy.
The NeuroQ Framework
NeuroQ bridges the gap between connectionist RL and symbolic logic by implementing a continuous feedback loop between an RL agent and an inductive learner. The framework utilizes Answer Set Programming (ASP) for reasoning and FastLAS for scalable inductive learning.
The Learning Loop
- Experience Collection: The agent interacts with the environment using standard Q-learning for a set number of episodes (a batch).
- Ranking and Translation: At the end of each batch, the system identifies the highest-performing episodes. These experiences are translated from raw numerical data (e.g., coordinates) into symbolic "atoms," such as
food(north, 1)orwall(south). - Inductive Learning: The FastLAS system analyzes these successful symbolic traces to induce the simplest set of logical rules (ASP axioms) that explain the agent's successful actions.
- Heuristic Guidance (Soft Bias): In subsequent training batches, the agent utilizes these learned rules during exploration. When the agent chooses to explore (rather than exploit), it consults the symbolic rules. If the rules suggest a specific action, the agent follows that suggestion with a high probability (denoted as $\rho$).
Crucially, this guidance is a "soft bias." Because the agent retains a non-zero probability of ignoring the rules, the mathematical guarantees of RL optimality are preserved. This allows the agent to eventually surpass or correct any incomplete or suboptimal rules learned early in the process.
Experimental Evaluation
We evaluated NeuroQ using the Pac-Man domain, a classic benchmark requiring navigation, planning, and risk avoidance. Testing was conducted on two configurations:
- Small Map: An 18 × 9 grid featuring 2 ghosts and 2 power capsules.
- Large Map: A 25 × 26 grid featuring 4 ghosts and 4 power capsules, representing a significantly larger state-space complexity.
Results and Discussion
Performance and Efficiency
In the Large Map scenario, NeuroQ demonstrated a substantial performance advantage, achieving nearly double the average discounted return compared to the standard Approximate Q-Learning baseline. This improvement was evident even in the early stages of training, suggesting that the symbolic guidance effectively prunes the search space during exploration.
Despite the addition of a symbolic reasoning component, the computational overhead remained manageable. In the Large Map tests, NeuroQ required approximately 25% more time per batch than the baseline. Given the significant gains in sample efficiency, this trade-off is highly favorable for complex environments where training time is dominated by environment interaction.
Explainability and Convergence
One of the primary advantages of NeuroQ is the transparency of its learned policy. The system successfully generated intuitive, human-readable rules. For example, the learner quickly converged on rules such as:
move(Dir) :- food_dist_leq(Dir, Dist, 1).
This translates to: "Move in a direction if there is food exactly one step away."
Furthermore, the symbolic rules reached a stable state much faster than the neural weights of the Q-function. In our experiments, the symbolic learner converged in fewer than 70 batches, providing a clear explanation of the agent's emerging strategy long before the RL agent reached peak performance.
Conclusion
NeuroQ demonstrates that integrating inductive logic programming with reinforcement learning can mitigate sample inefficiency while providing much-needed interpretability. By using learned logical rules as a soft bias for exploration, we achieve superior performance without the need for manual reward shaping. Future work will explore the scalability of this approach to more complex predicate sets and its integration with advanced RL algorithms like Double Deep Q-Networks (DDQN).
Summary updated