Abstract
Knowledge Graph (KG) reasoning models typically rely on the assumption that training and testing data are Independent and Identically Distributed (I.I.D.). However, real-world KGs often exhibit significant distribution shifts, leading to poor generalization. This paper introduces StableRule, an end-to-end framework designed to learn robust logical rules by decorrelating features to eliminate spurious correlations. By focusing on invariant logical patterns, StableRule maintains high performance across diverse, unseen environments and query patterns.
The Challenge of Agnostic Distribution Shift
Knowledge Graph reasoning involves predicting missing facts, such as identifying the tail entity in a query like (Einstein, BornIn, ?). Standard models—including Knowledge Graph Embeddings (KGE) and Graph Neural Networks (GNNs)—often fail when the test environment differs from the training set. The authors identify two primary types of "Agnostic Distribution Shifts" that undermine these models:
- Density Shift: Models trained on information-rich entities (e.g., celebrities with many connections) struggle when applied to "sparse" entities (e.g., the general public) where connectivity is lower.
- Pathway Shift: The logical paths required to reach an answer may change between environments. A model might learn that "writing for a newspaper" implies a "WorksFor" relation in a journalism dataset, but this path is irrelevant when querying about professional athletes.
Existing methods often latch onto "spurious correlations"—patterns that appear predictive in training but do not hold up in new scenarios. StableRule addresses this by seeking invariant rules that remain valid regardless of the specific data distribution.
The StableRule Framework
StableRule is built on three architectural pillars designed to ensure "Stable Learning" and robust rule induction:
1. Rule Learning Network (Encoder-Decoder)
Rather than simply memorizing paths, StableRule utilizes a sliding-window LSTM encoder to capture the hierarchical deductive structure of logical rules. A decoder then maps these rule body embeddings to a predicted "head" (the target relation). This structure allows the model to treat rule composition as a tree-like hierarchy rather than a flat sequence.
2. Feature Decorrelation Regularizer
The core innovation of StableRule is its decorrelation mechanism. The model calculates re-sampling weights for training instances to ensure that different dimensions of the rule embeddings are statistically independent. By decorrelating these features, the model is forced to ignore coincidental, spurious patterns and focus on causal, invariant logical rules.
3. Backtracking-enhanced Rule Sampling
To manage the computational complexity of large graphs, the framework employs an efficient random walk strategy. A backtracking mechanism ensures the discovery of valid "closed-path" rule instances, providing high-quality training data for the encoder.
Experimental Evaluation
The researchers evaluated StableRule against 12 state-of-the-art baselines (including TransE, RotatE, and NBFNet) across seven benchmark Knowledge Graphs, including large-scale networks like YAGO3-10 and DBLP. To simulate real-world conditions, they used clustering-based partitioning to create Out-of-Distribution (OOD) test sets and tested "Natural Shifts" using country affiliations in the DBLP dataset.
Key Results
- Superior Stability: StableRule consistently outperformed baselines in OOD scenarios. On the DBLP dataset, it maintained high accuracy across different country subgroups where other models' performance fluctuated significantly.
- Inductive Generalization: In "Inductive Link Prediction" tasks—where test entities are entirely unseen during training—StableRule achieved state-of-the-art results, demonstrating that its learned rules are truly generalizable.
- Ablation Insights: Removing the feature decorrelation module resulted in an average 5.18% drop in Mean Reciprocal Rank (MRR), confirming that feature independence is critical for robustness against distribution shift.
Conclusion and Future Work
StableRule demonstrates that by re-weighting samples to simulate a balanced environment where features are independent, models can "purify" their learned rules. While highly effective, the authors note that future iterations could tackle more complex, non-linear statistical dependencies using techniques like Random Fourier Features. Additionally, exploring hybrid models that combine the representational power of KGEs with the stability of rule-based learning remains a promising avenue for future research.
Summary updated