Efficient Probabilistic Logic Reasoning with Graph Neural Networks

Yuyu Zhang, Xinshi Chen, Yuan Yang, Arun Ramamurthy, Bo Li, Yuan Qi, Le Song

TL;DR

This paper introduces ExpressGNN, a framework that marries the formal rigor of Markov Logic Networks (MLNs) with the efficiency of Graph Neural Networks (GNNs). By using a variational Expectation-Maximization (EM) approach, the authors enable efficient, scalable probabilistic logic reasoning that outperforms traditional logic solvers in speed and beats deep learning baselines in data-scarce "long-tail" scenarios.

The Challenge of Knowledge Graph Reasoning

Reasoning over Knowledge Graphs (KGs) typically falls into two distinct camps, each with its own strengths and weaknesses:

  1. Statistical Relational Learning (e.g., MLNs): These models use hard logic rules and probabilistic graphical models. They are excellent at incorporating human prior knowledge and work well with very little data. However, they are notoriously slow—inference is often NP-complete and scales exponentially with the number of entities in the graph.
  2. Deep Learning (e.g., GNNs and KG Embeddings): These models are fast, scalable, and highly capable of capturing complex patterns from large datasets. Unfortunately, they act as "black boxes" that struggle with "long-tail" relations (where only a few examples exist) and cannot easily incorporate explicit, hard logic rules.

The authors aim to bridge this gap, creating a method that is data-driven yet exploits prior logic knowledge, all while remaining computationally efficient enough for large-scale graphs.

Methods: The ExpressGNN Framework

At the heart of the paper is a Variational EM (Expectation-Maximization) framework designed to optimize MLNs efficiently.

The ExpressGNN framework uses Variational EM to bridge Markov Logic Networks (MLNs) for likelihood decoding and Graph Neural Networks (GNNs) for posterior encoding over a Knowledge Graph.
  • The E-Step (Inference): Instead of using slow traditional solvers like Markov Chain Monte Carlo (MCMC), the authors use a GNN as an "inference network" to approximate the posterior distribution of latent variables.
  • The M-Step (Learning): The weights of the logic rules (representing how much we "trust" each rule) are optimized based on the evidence gathered.
  • ExpressGNN Architecture: The authors identified that "vanilla" GNNs are not expressive enough to represent the complex distributions found in MLNs. To fix this, ExpressGNN uses a two-level encoding:
  • Compact GNN Embeddings: Shared across the graph to capture broad structural information.
  • Tunable Entity Embeddings: Specific to each entity to capture individual nuances that structural GNNs might miss (solving the "isomorphic nodes" problem).
  • Stochastic Training: To handle the combinatorial explosion of logic rules, the framework uses a mini-batch sampling scheme for ground formulae. This makes the training process constant-time relative to the number of entities.

Key Insights

  • The Expressiveness Gap: A key theoretical insight is that standard GNNs produce the exact same embeddings for "isomorphic" nodes (nodes with identical local structures). However, in logic reasoning, two structurally identical nodes might have different labels due to specific logic constraints. The addition of tunable entity embeddings is the "secret sauce" that allows ExpressGNN to distinguish these cases.
  • Logic as a Regularizer: In zero-shot scenarios (0% training data), ExpressGNN can still make accurate predictions simply by following the provided logic rules. Purely data-driven models, like TransE or RotatE, fail completely in these environments.
  • Scalability via GNNs: By treating the GNN as a variational posterior, the authors successfully turn a discrete, combinatorial search problem into a continuous optimization problem that can be efficiently solved on a GPU.

Experimental Results

The model was evaluated on four benchmark datasets: UW-CSE (social network), Cora (citation entity resolution), Kinship (synthetic family relationships), and FB15K-237 (large-scale knowledge graph completion).

  • Efficiency: On the Kinship dataset, traditional MLN solvers saw their runtimes grow exponentially as the graph grew. In contrast, ExpressGNN maintained a nearly constant, low inference time.
  • Accuracy & Scalability: On the Cora dataset, all traditional baseline methods failed to scale to the "open-world" setting, while ExpressGNN achieved high precision-recall (AUC-PR of 0.64).
  • Knowledge Graph Completion: On FB15K-237, ExpressGNN-EM outperformed state-of-the-art embedding models like RotatE and pLogicNet, particularly when training data was severely limited (e.g., at 5% or 10% training size).
  • Zero-Shot Learning: ExpressGNN achieved an MRR of 0.185 in a zero-shot setting where all other supervised baselines dropped to near zero.

Limitations and Future Work

While powerful, ExpressGNN has a few limitations. First, it relies on rule dependency; while it learns the weights of rules, it still requires a set of initial logic rules to be provided (though tools like Neural LP can help generate these automatically). Second, due to the inherent randomness in its sampling-based optimization, it introduces slight stochastic noise—scoring 0.99 instead of a perfect 1.00 on perfectly noise-free synthetic data. Finally, the current implementation focuses on predicates with two arguments. Extending this framework to higher-order relations or more complex recursive logic structures remains an exciting challenge for future work.

Summary updated

BibTeX
@inproceedings{zhang2020efficient,
  author = {Yuyu Zhang and Xinshi Chen and Yuan Yang and Arun Ramamurthy and Bo Li and Yuan Qi and Le Song},
  title = {{Efficient Probabilistic Logic Reasoning with Graph Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure