Cycle Representation Learning for Inductive Relation Prediction

Zuoyu Yan, Tengfei Ma, Liangcai Gao, Zhi Tang, Chao Chen

Knowledge Graphs (KGs)—like those powering Google Search or Alexa—are massive networks of entities (nodes) and their relationships (edges). However, they are almost always incomplete. Inductive relation prediction is the task of predicting missing links even when the entities involved weren't seen during the model's training.

Traditionally, models solve this by searching for "logical rules." For example, if $X$ lives in $Y$ and $Y$ is located in $Z$, we can induce that $X$ is located in $Z$. Most existing methods treat these rules as paths. The problem? The number of possible paths grows exponentially with the size of the graph. To stay efficient, previous models had to use "coarse" approximations or artificial pruning, which often led to poor accuracy or high computational costs.

Researchers have developed a novel way to predict missing links by treating logical rules as cycles rather than paths. By leveraging the linear structure of "cycle spaces" from algebraic topology, their model, CBGNN, achieves state-of-the-art accuracy while being significantly faster than previous methods.

Knowledge graph cycles and cycle basis representation

The Core Insight: Cycles over Paths

The most profound insight of this work is that while the space of paths is messy and exponential, the space of cycles is a vector space. This allows the model to use linear algebra to explore rules much more efficiently.

A logical rule is essentially a path that connects two entities, plus the direct link (the target) you are trying to predict. Together, these form a closed loop—a cycle. By looking at the cycle space of the graph, any cycle can be represented as a combination of a smaller set of "basis" cycles. This transforms an exponential search problem into a linear one.

The CBGNN Framework

The authors introduce the Cycle Basis Graph Neural Network (CBGNN) to operationalize this concept.

The CBGNN architecture pipeline

The framework operates through several key steps:

  1. Shortest-Path-Tree (SPT) Bases: To ensure the rules are manageable and meaningful, the model uses SPTs to generate cycle bases. These bases naturally favor shorter cycles, which usually represent more reliable logical rules.
  2. Root Sampling: Since one cycle basis might not cover the whole graph well, spectral clustering is used to pick $k$ diverse "root" nodes. This generates a family of cycle bases, achieving both "locality" (finding rules near specific entities) and "coverage" (ensuring no part of the graph is ignored).
  3. Bi-Relational LSTM (BR-LSTM): To turn a sequence of relations in a cycle into a mathematical feature, a specialized LSTM reads the cycle in both directions. This ensures the model understands the context and directionality of the relationships.
  4. The Cycle Graph: A new graph is built where each node is a cycle from the basis. A Graph Neural Network (GNN) then runs on this "graph of cycles" to learn which cycles represent strong logical rules.

Key Results and Performance

The model was evaluated on three standard inductive benchmark datasets derived from well-known KGs: WN18RR (WordNet), FB15k-237 (Freebase), and NELL-995. Each dataset includes four versions with increasing sizes to test robustness.

  • State-of-the-Art Accuracy: CBGNN outperformed existing SOTA models (like GraIL and CoMPILE) on nearly all benchmarks, particularly in Hits@10 (the probability that the correct answer is in the top 10 results). It showed a significant advantage on semantically complex datasets like FB15k-237, which has over 200 different relation types.
  • Dramatic Speedup: Because CBGNN doesn't need to extract subgraphs for every single query, it is vastly more efficient. On the NELL-995 dataset, CBGNN’s inference was roughly 10x faster than GraIL and 8x faster than CoMPILE.

Limitations and Future Work

While highly effective, the authors note a few areas for future exploration:

  • Rule Sophistication: Currently, the method primarily focuses on "AND" operations (chains of relations). Expanding this to more sophisticated logical structures is a future goal.
  • Large-Scale Root Selection: While spectral clustering works well for sampling roots, truly massive graphs (billions of edges) may require even more efficient ways to select and manage multiple cycle bases.
  • Directed Cycle Spaces: The current mathematical formulation focuses on cycles in undirected graphs (handling relation directionality via the LSTM). Extending the core algebraic topology framework to directed cycle spaces could yield even richer representations.

Summary updated

BibTeX
@inproceedings{yan2022cycle,
  author = {Zuoyu Yan and Tengfei Ma and Liangcai Gao and Zhi Tang and Chao Chen},
  title = {{Cycle Representation Learning for Inductive Relation Prediction}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=Zi7r5Ak6si},
}
Figure