NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Incorporating Relational Background Knowledge into Reinforcement Learning via Differentiable Inductive Logic Programming

Ali Payani, Faramarz FekriarXiv 2020

Abstract

Standard Deep Reinforcement Learning (DRL) has achieved remarkable success in complex environments, yet it remains plagued by data inefficiency, a lack of interpretability, and poor generalization to novel configurations. This paper introduces a novel framework that integrates the visual processing power of Deep Learning with the symbolic reasoning capabilities of Inductive Logic Programming (ILP). By utilizing a differentiable logic engine, the authors create Reinforcement Learning (RL) agents that learn directly from raw pixels while incorporating human-provided "background knowledge." The resulting policies are not only human-interpretable but also generalize significantly better than standard "black-box" neural networks.

Introduction

The current paradigm of DRL typically treats the environment as a high-dimensional vector space, requiring millions of trials to learn even basic spatial concepts. Furthermore, the learned policies are often opaque matrices of weights, making them difficult to verify or trust in critical applications. Relational Reinforcement Learning (RRL) was proposed decades ago to address these issues by describing the world in terms of objects and their relationships (e.g., "the key is inside the box"). However, traditional RRL systems were non-differentiable and struggled with raw visual inputs. This research bridges this gap by proposing a Deep RRL framework powered by a differentiable logic solver.

Methodology

The architecture operates in three distinct stages: visual perception, differentiable deduction, and policy learning.

Visual Perception and Relational Representation

A standard Convolutional Neural Network (CNN) first processes the input image to extract low-level "atoms" or facts, such as the (x,y) coordinates of various objects. These are then mapped to high-level relational predicates. For example, in a blocks-world scenario, the spatial arrangement is represented symbolically.

Relational representation of a blocks world scene using predicates like on(a, floor).

Differentiable Deduction via Neural-Logical Networks

The extracted facts are fed into a Neural-Logical Network (NLN). Unlike standard neurons that perform weighted sums, NLNs utilize "multiplicative neurons" to represent Boolean logic operations like AND and OR. Because these operations are formulated as continuous, differentiable functions, the entire system can be trained using standard backpropagation.

A key innovation is the inclusion of an interpretability penalty. By regularizing the logic weights toward 0 or 1 during training, the model is forced to converge on crisp, symbolic rules. This prevents the network from relying on "fuzzy" logic and ensures the final policy can be translated back into human-readable First-Order Logic.

Policy Learning and Action Selection

The agent's actions are defined as logical predicates. The system optimizes the probability of these actions using policy gradient methods. This allows the agent to reason about which object to move and where, based on the learned logical rules.

An illustration of a logical action 'move(c, b)' transforming the environment state.

Key Insights: The Power of Background Knowledge

One of the paper's most significant findings is that "Background Knowledge is a Cheat Code." By providing the agent with basic logical concepts—such as what it means for an object to be "covered"—the authors demonstrate that agents can learn in thousands of episodes what standard DRL fails to learn in hundreds of millions. This prior knowledge acts as a strong inductive bias, drastically narrowing the search space for the optimal policy.

Furthermore, because the policy is learned as a set of symbolic rules, the agent's "thought process" is transparent. In the BoxWorld task, for instance, the agent learns a rule such as: Move X to Y if X is not covered and Y is blue. This level of transparency is virtually impossible to achieve with standard deep neural networks.

Experimental Results

The framework was evaluated on several benchmarks designed to test relational reasoning, including BoxWorld, GridWorld, and Sort-of-CLEVR.

  • Massive Sample Efficiency: In the GridWorld navigation task, the proposed RRL model converged in just 700 to 4,500 episodes. In stark contrast, a standard Advantage Actor-Critic (A2C) agent failed to converge even after 100 million ($10^8$) episodes.
  • Superior Scaling and Generalization: In BoxWorld, as the number of boxes increased, the RRL model continued to converge efficiently (approx. 20k episodes), while A2C required over 130k episodes and often failed to reach a comparable success rate.
  • State-of-the-Art Reasoning: On the Sort-of-CLEVR dataset, the model achieved 99% accuracy, outperforming previous non-local relational networks which peaked at 94%.
  • Semi-Supervised Learning in Atari: In the game Asterix, the agent achieved high scores (30k-40k) using only a few thousand training scenes by leveraging a semi-supervised approach with just 50 labeled frames.

Limitations and Future Work

Despite its success, the framework has limitations. Currently, a human expert must define the "language" or signatures of the predicates the agent uses. While the agent learns the rules, it does not yet "invent" the basic concepts from scratch. Additionally, logic-based systems can face a "combinatorial explosion" when grounding predicates across hundreds or thousands of objects. Future research will explore automatic predicate discovery and methods to scale these symbolic systems to even more high-dimensional, entity-rich environments.

Summary updated

BibTeX
@misc{payani2020incorporating,
  author = {Ali Payani and Faramarz Fekri},
  title = {{Incorporating Relational Background Knowledge into Reinforcement Learning via Differentiable Inductive Logic Programming}},
  year = {2020},
  eprint = {2003.10386},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2003.10386},
}
Figure