Logical rule-based methods offer an interpretable approach to knowledge graph completion (KGC) by capturing compositional relationships in the form of human-readable inference rules. While existing logical rule-based methods learn rule confidence scores, they typically assign a global weight to each rule schema, applied uniformly across the graph. This is a significant limitation, as a rule's importance often varies depending on the specific query instance. To address this, we introduce SLogic (Subgraph-Informed Logical Rule learning), a novel framework that assigns query-dependent scores to logical rules. The core of SLogic is a context-aware scoring function. This framework is in line with the specificity principle in commonsense reasoning. This function determines the importance of a rule by analyzing the subgraph locally defined by the query's head entity, thereby enabling a differentiated weighting of rules specific to their local query contexts. Extensive experiments on benchmark datasets show that SLogic achieves competitive performance among rule-based methods. It also generates query-dependent, human-readable logical rules that serve as explicit explanations for its inferences.
Figures & tables
Figure 1: Steps to generate instances enriched by context aware rules and to train SLogic model
Table 2: SLogic vs. Baselines in KG completion task ( Bold / Underlined numbers: best among all methods/best among all rule learning methods; ‘–’: could not be run on our machine). NCRL † reports the original results from Cheng et al. (2023) using a different tie-breaking protocol (rank = m + 1); NCRL * is our re-run of the same model using the expected-rank protocol ( m + ( n + 1)/2) adopted for all other methods and consistent with RNNLogic. SLogic results are reported as the mean over 5 random seeds with low standard deviation (WN18RR: 0.49±0.0007 , FB15k-237: 0.3±0.0006 , YAGO3-10: 0.50±0.0007 , NATIONS: 0.75±0.004 ). Results for NCRL † and RLogic are excluded as they are neither reported in the original paper nor reproducible via their public code bases.
WN18RR
FB15k-237
YAGO3-10
kpos
kneg=10
kneg=20
kneg=40
kneg=10
kneg=20
kneg=40
kneg=10
kneg=20
kneg=40
1
0.4849
0.4827
0.4845
0.2937
0.2941
0.2945
0.4865
0.4835
0.4975
5
0.4852
0.4871
0.4841
0.2974
0.2994
-
0.4986
0.5031
0.5011
10
0.4856
0.4880
0.4850
0.2979
0.2988
-
0.5036
0.5031
-
Table 3: Sensitivity test on the effect of sampling ratio ( kpos vs. kneg ) on MRR. Darker cells indicate higher MRR. Certain configurations for FB15k-237 and YAGO3-10 (marked with -) were omitted due to excessive memory requirements.
Rule Coverage ( ntails )
Avg SLogic Score
Low (1-4 tails)
-1.12
Medium-Low (4-19 tails)
-1.02
Medium (19-73 tails)
-0.28
Medium-High (73-339 tails)
0.11
High (339-4123 tails)
0.57
Table 4: Relationship between rule coverage and model scores on FB15k-237.
Figure 3: Sensitivity analysis. (Higher number of hops could not be run for FB15k-237 and YAGO3-10 on our machine.)
Figure 4: Impact of dynamic scoring (a) and component importance (b). SLogic achieves +17.6% to +33.8% gain over static baselines, and all neural components are essential.
Case 1
Case 2
Query
Old_Shatterhand _(film), isL,?
U._of_Alaska_System, isL,?
Context
Dominated by film entities: e.g., Lex Barker (actor)
Dominated by geo entities: e.g., Fairbanks (city)
Score (A)
-0.35 (Correct)
-1.64
Score (B)
-2.48
0.02 (Correct)
Table 5: Case study of contextual scoring. (A) and (B) represent two candidate rules for the query.
Method
Sub-component time
WN18RR
FB15k-237
YAGO3-10
SLogic
Preprocessing
7
25
28
Training (Default)
152
195
86
Total (Default)
159
220
114
Training (Efficient)
18
18
8
Total (Efficient)
25
43
36
RNNLogic
Mining
88
279
87
Table 6: Running time (minutes) across methods (“–”: out of memory). Default : kpos=5,kneg=20 ; Efficient : kpos=1,kneg=10 .
Figure 5: MRR performance as training samples scale.
Logical rules constitute a cornerstone of knowledge graph (KG) reasoning, valued for their interpretability and ability to model relational patterns. However, existing rule mining methods predominantly focus on simple chain-like rules and therefore neglect the richer relational information encoded in graph-like structures, such as cycles and branches. This limitation is further exacerbated by computational bottlenecks caused by the combinatorial explosion of the search space, which is especially challenging for graph-like rules. Meanwhile, generative approaches such as diffusion models, despite their success in other domains, cannot be directly applied to rule mining because their training objectives are not aligned with the goal of learning high-quality rules, and non-differentiable KG rule quality metrics cannot directly guide model optimization. To address these limitations, we propose GRiD, a framework that reformulates graph-like rule discovery as a discrete generative process conditioned on the target relation. GRiD employs a two-phase training strategy. First, supervised pre-training enables GRiD to capture structural priors from subgraphs sampled from the KG meta-graph. Subsequently, reinforcement learning is applied to fine-tune GRiD through policy gradient optimization guided directly by non-differentiable rule-quality metrics. Experiments on six benchmark datasets show that GRiD achieves competitive performance on KG completion tasks. Ablation studies confirm the efficiency and robustness of GRiD and further show that graph-like rules complement chain-like rules in KG completion. Our code and datasets are available in https://github.com/Haoxiang-Cheng/GRiD.
Haoxiang Cheng, Yunfei Wang, Chao Chen +5
Laboratory for Big Data and Decision, National University of Defense Technology · National Key Laboratory of Information Systems Engineering, National University of Defense Technology · Microsoft Corporation +2
Knowledge Graph Completion (KGC) aims at predicting missing triplets from incomplete knowledge graphs, which is crucial for downstream applications. Recently, Graph Neural Network (GNN)-based methods have achieved remarkable success by performing message passing over a local subgraph centered on the query entity. In these methods, the query relation conditions message computation and aggregation, whereas the query entity serves only as a structural anchor for subgraph extraction. The query relation thus constitutes the sole explicit signal for evidence selection, even though the relevant evidence for the same relation can differ substantially across query entities. We propose Q-GNN, which incorporates the query entity as an explicit conditioning signal. Q-GNN characterizes the query entity by its local structural context and semantic type, and thus remains applicable in the inductive setting. The structural context, encoded by a dedicated encoder, modulates each message through feature-wise linear modulation, while the semantic type guides neighborhood attention and candidate scoring. Experiments in both transductive and inductive settings demonstrate the effectiveness of the proposed method.
Dongxiao He, Ruqiong Zhang, Zhizhi Yu +4
College of Intelligence and Computing, Tianjin University
Knowledge Graphs (KGs) are widely used to represent structured knowledge, yet their automatic construction, especially with Large Language Models (LLMs), often results in incomplete or noisy outputs. Knowledge Graph Completion (KGC) aims to infer and add missing triples, but most existing methods either rely on structural embeddings that overlook semantics or language models that ignore the graph's structure and depend on external sources. In this work, we present OMNIA, a two-stage approach that bridges structural and semantic reasoning for KGC. It first generates candidate triples by clustering semantically related entities and relations within the KG, then validates them through lightweight embedding filtering followed by LLM-based semantic validation. OMNIA performs on the internal KG, without external sources, and specifically targets implicit semantics that are most frequent in LLM-generated graphs. Extensive experiments on multiple datasets demonstrate that OMNIA significantly improves F1-score compared to traditional embedding-based models. These results highlight OMNIA's effectiveness and efficiency, as its clustering and filtering stages reduce both search space and validation cost while maintaining high-quality completion.
Frédéric Ieng, Soror Sahri, Mourad Ouzzani +5
LIPADE, Université Paris Cité, Paris, France · Qatar Computing Research Institute, HBKU, Doha, Qatar · Universität zu Lübeck, Germany +3