GALOIS: Boosting Deep Reinforcement Learning via Generalizable Logic Synthesis

Yushi Cao, Zhiming Li, Tianpei Yang, Hao Zhang, Yan Zheng, Yi Li, Jianye Hao, Yang Liu

Deep Reinforcement Learning (DRL) has conquered everything from Go to complex robotics, but it still has a "common sense" problem. While a human can learn to open a drawer and immediately understand that the same logic applies to opening a box, DRL agents often struggle to generalize. They are "black boxes" that memorize patterns rather than learning the underlying logic.

In their NeurIPS 2022 paper, researchers propose a way to bridge the gap between neural networks and symbolic reasoning with GALOIS (Generalizable Logic Synthesis).

The Problem: Brittleness and Opacity in DRL

Standard DRL models lack "high-order intelligence"—specifically, the ability to perform logical deduction and reuse knowledge. This leads to two major issues:

  1. Brittleness: An agent trained to find a key inside a box might fail completely if the key is moved outside the box. It learned a rigid sequence of actions rather than the reason for those actions.
  2. Opacity: It is nearly impossible to look at the weights of a neural network and understand the "logic" it uses to solve a task.

Previous attempts to solve this used Program Synthesis to generate readable policies, but they usually fell into two camps:

  • Imperative Synthesis: Good at hierarchy (Step A $\rightarrow$ Step B) but ignores "cause-effect." If Step A becomes unnecessary, the agent does it anyway.
  • Declarative Synthesis: Good at cause-effect (If X, then Y) but struggles with complex, multi-step hierarchies.

The GALOIS Framework

GALOIS synthesizes hierarchical, "white-box" logic programs to serve as DRL policies. By combining the structure of imperative programming with the reasoning of declarative logic, it creates agents that are not only more interpretable but also significantly better at generalizing to new, unseen environments.

The GALOIS framework architecture, illustrating the pipeline from environment interaction to sketch-based logic program synthesis.

1. The $\mathcal{L}_{hybrid}$ Language and Program Sketches

To get the best of both imperative and declarative worlds, the authors designed a new Domain-Specific Language (DSL) that uses program sketches. Think of a sketch as a template with "holes" (denoted as ??). The framework doesn't have to invent a program from scratch; it just has to fill in the logic for three specific "hole functions":

  • ??WHERE: Which sub-goal should I target next? (e.g., the key, the door).
  • ??HOW: How do I move toward that sub-goal?
  • ??WHAT: What action do I take once I get there? (e.g., pick up, toggle).
The Interprocedural Control Flow Graph (ICFG) demonstrating how the program sketch holes (WHERE, HOW, WHAT) map to specific logic rules.

2. Differentiable Logic Synthesis

To fill these holes, GALOIS uses an extension of differentiable Inductive Logic Programming ($\partial$ILP). Instead of rigid "True/False" logic, it uses "fuzzy" logic where truth values are probabilities between 0 and 1. This allows the entire logic program to be trained using standard RL techniques like Policy Gradients.

3. White-Box Policy

The result is a "white-box" policy. Instead of a matrix of numbers, the policy is a readable logic program that humans can inspect, verify, and even manually tune.

Experiments and Key Insights

The framework was evaluated using the MiniGrid environment, a standard benchmark for RL agents requiring navigation and logical reasoning. They tested on four increasingly difficult tasks: DoorKey, BoxKey, UnlockPickup, and MultiRoom.

Crucially, they created "sem-mod" (semantic modification) versions of these tasks. For example, in the modified BoxKey, the key is placed outside the box. This tests if the agent actually understands the logic of "I need a key" versus just "I must open the box."

Key Results

  • Robust Generalization: In the "sem-mod" tests, standard DRL and imperative synthesis (MPPS) saw their success rates plummet to near zero. GALOIS maintained near-perfect performance, proving it understood the underlying task logic. Because GALOIS learns that "opening the box" is a cause for "getting the key," it can skip the box entirely if the key is already visible.
  • Superior Performance: GALOIS outperformed mainstream baselines (DQN, PPO, SAC, and h-DQN) in asymptotic performance, especially on the complex MultiRoom task. Hierarchy simplifies learning by breaking the problem into WHERE, HOW, and WHAT, making the search space much smaller.
  • Knowledge Reusability: Logic is abstract. A "WHERE" sub-program that learns how to identify a goal can be plucked out of a "DoorKey" agent and dropped into a "MultiRoom" agent. When "warm-started" with logic learned from simpler tasks, GALOIS reached optimal performance significantly faster than learning from scratch.

Limitations and Future Work

While GALOIS represents a significant step forward, challenges remain:

  • The Symbolic Gap: Currently, the input (images) must be pre-processed into a "Herbrand base" (a set of facts like at(agent, x, y)). Automating this symbol extraction directly from raw pixels is a vital next step.
  • Domain Specificity: The program sketch is currently designed for navigation/interaction tasks. Applying this to entirely different domains would require designing new sketches.
  • Multi-Agent Scaling: Applying GALOIS to competitive or cooperative multi-agent scenarios is a promising future direction.

Summary updated

BibTeX
@inproceedings{cao2022galois,
  author = {Yushi Cao and Zhiming Li and Tianpei Yang and Hao Zhang and YAN ZHENG and Yi Li and Jianye HAO and Yang Liu},
  title = {{GALOIS: Boosting Deep Reinforcement Learning via Generalizable Logic Synthesis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=XSV1T9jMuz9},
}
Figure