RulE: Neural-Symbolic Knowledge Graph Reasoning with Rule Embedding
Authors: Xiaojuan Tang
Song-Chun Zhu
Yitao Liang
Muhan Zhang
Venue: Submitted to ICLR 2023 (2023)

Abstract: Knowledge graph (KG) reasoning is an important problem for knowledge graphs. It predicts missing links by reasoning on existing facts. Knowledge graph embedding (KGE) is one of the most popular methods to address this problem. It embeds entities and relations into low-dimensional vectors and uses the learned entity/relation embeddings to predict missing facts. However, KGE only uses zeroth-order (propositional) logic to encode existing triplets (e.g., ``Alice is Bob's wife."); it is unable to leverage first-order (predicate) logic to represent generally applicable logical \textbf{rules} (e.g., ``$\forall x,y \colon x ~\text{is}~ y\text{'s wife} \rightarrow y ~\text{is}~ x\text{'s husband}$''). On the other hand, traditional rule-based KG reasoning methods usually rely on hard logical rule inference, making it brittle and hardly competitive with KGE. In this paper, we propose RulE, a novel and principled framework to represent and model logical rules and triplets. RulE jointly represents entities, relations and logical rules in a unified embedding space. By learning an embedding for each logical rule, RulE can perform logical rule inference in a soft way and give a confidence score to each grounded rule, similar to how KGE gives each triplet a confidence score. Compared to KGE alone, RulE allows injecting prior logical rule information into the embedding space, which improves the generalization of knowledge graph embedding. Besides, the learned confidence scores of rules improve the logical rule inference process by softly controlling the contribution of each rule, which alleviates the brittleness of logic. We evaluate our method with link prediction tasks. Experimental results on multiple benchmark KGs demonstrate the effectiveness of RulE.

Under review as a conference paper at ICLR 2023
KNOWLEDGE REASONING WITH RULE EMBEDDING
RULE:
GRAPH
Anonymous authors Paper under double-blind review
ABSTRACT
Knowledge graph (KG) reasoning an important problem for knowledge graphs. It predicts missing links by reasoning on existing facts. Knowledge graph em- bedding (KGE) is one of the most popular methods to address this problem. It embeds entities and relations into low-dimensional vectors and uses the learned entity/relation embeddings to predict missing facts. However, KGE only uses zeroth-order (propositional) logic to encode existing triplets (e.g.. "Alice is Bob's s wife."); ) it is unable to leverage first-order (predicate) logic to represent generally applicable logical rules (e.g., "dxx, y: is y's wife y is x's husband"). On the other hand, traditional rule-based KG reasoning methods usually rely on hard logical rule inference, making it brittle and hardly competitive with KGE. In this paper, we propose RulE, a novel and principled framework to represent and model logical rules and triplets. RulE jointly represents entities, relations and logical rules in a unified embedding space. By learning an embedding for each logical rule, RulE can perform logical rule inference in soft way and give confidence score to each grounded rule, similar to how KGE gives each triplet confidence score. Compared to KGE alone, RulE allows injecting prior logical rule informa- tion into the embedding space, which improves the generalization of knowledge graph embedding. Besides, the learned confidence scores of rules improve the logical rule inference process by softly controlling the contribution of each rule, which alleviates the brittleness of logic. We evaluate our method with link pre- diction tasks. Experimental results on multiple benchmark KGs demonstrate the effectiveness of RulE,
com X hlt.aa/bcccoooaaaaaaaaaaanaaa/a
INTRODUCTION
Knowledge graphs (KGs) usually store millions of real-world facts and are used in a variety of ap- plications, such as recommender systems (Wang al.] 2018), question answering (Bordes et al.] 2014) and information retrieval (Xiong et 2011)) Examples of knowledge graphs include Free- base (Bollacker et al., 2008), WordNet(MMlllr) 1995) and YAGO (Suchanek et al., (007). They represent entities as nodes and relations among the entities as edges. Fach edge encodes fact in the form of a triplet (head entity, relation, tail entity). However, KGs are usually highly incomplete due to the limitedness of human knowledge and web corpora, well as imperfect extraction algorithms. Knowledge graph reasoning, which predicts missing facts by reasoning on existing facts, has thus become a popular research area in Artificial Intelligence. There two prominent lines of work in this area: knowledge graph embedding (KGE), which embeds all entities and relations into vectors, and ruse- KG reasoning, which uses logical rules infer new facts.
Knowledge graph embedding (KGE) methods such as TransE (Bordes et al., 2013). Com- plEx (Trouillon al., (016)) and RotatE (Sun et al. 2019) have received significant attention due to their effectiveness and scalability. They embed entities and relations into low-dimensional vectors or matrices, preserving the inherent structure and latent semantic information. By computing the score of each triplet in the continuous space, KGE effectively estimates the plausibility of unobserved triplets so that reasoning of missing facts becomes feasible. However, KGE only uses zeroth-order order (propositional) logic to encode existing facts (e.g., "Alice is Bob's wife."). It cannot leverage first- order (predicate) logic, which uses the universal quantifier to represent generally applicable logical
Cooresponning authors.

---

Under review as a conference paper at ICLR 2023
Triplcts
Jointly training
Logicall rules
Fa
(Ri ArG mn)
(R2sT, A
(%, R2)
R1
(R = Tia)
62
Figure 1: Given KG containing set of triplets and logical rules, RulE represents every entity, relation and logical rule as an embedding, i.e., e,r. R. It further defines respective mathematical operations between entities and relations as well as between relations and logical rules. The target is to jointly maximize the plausibility of existing triplets and logical rules, similar to how KGE maximizes the plausibility of observed triplets. In this way, we can optimize all embeddings e, r, R in the same space to enhance each other, which improves the generalization of KGE and allows performing logical rule inference in a soft way.
rules. For instance, "Vx, y: z is y's wife - is I's husband" encodes one logical rule. Those rules are not specific to particular entities (e.g., Alice and Bob) but are generally applicable all entities. Another limitation of current KGE is that it can only be applied to transductive scenarios, which means is unable to answer queries (h, t)s if is not contained in KG during the training.
The other line of work, rule-based KG reasoning, in contrast, can be applied to both inductive and transductive settings, because rules are generally applicable to even unseen entities. Further- more, unlike embedding-baseed methods, logical rules can achieve interpretable reasoning. How- ever, the brittleness of logical rules greatly harms prediction performance. Consider the logical rule (a, work in, y) + (x,, live in, y) as example. It is mostly correct. Yet. if somebody works in New York but lives in New Jersey, the rule will surely infer the wrong fact that he/she lives in New York.
Considering that the aforementioned two lines of work can complement each other, addressing each other's weaknesses with their own forte, it becomes imperative to study how to robustly integrate logical rules with KGE methods. If we view this integration against broader backdrop, embedding- based reasoning can be seen as type of neural method, while rule-based reasoning can be seen as a type of symbolic method. Neural-symbolic synthesis has also been a focus of Artificial Intelligence
research in recent years (Parisotto et al., [017]] Yi et al. 2018]] Manhaeve et al., 2018 Xu et al., 2018 Hitzler 2022). Specifically, most of the existing work combining logical rules and KGE either uses logical rules to infer new facts as additional training data for KGE or directly converts some rules into regularization terms for specific KGE models (Guo et al. 2016 RRockäscchll al. 2015 Demeester et al. 2016). For example, KALE (Guo et al. 2016) and RUGE. (Guo et al.) 2018 8018)
apply t-norm fuzzy logic to grounded rules to give a truth score for each inferred triplet and generate additional triplets for KGE training. On the other hand, some other efforts do not ground rules to infer new triplets for training but rather inject logical rules via regularization terms on entity/relation embeddings during KGE training (Ding et al.] [018 Guo et al., 2020). They leverage logical rules merely to enhance KGE training without actually using logical rules to perform reasoning. In other words, they still restricted the transductive setting and might lose the important information contained in explicit rules, leading to empirically worse performance than state-of-the-a methods.
To address the aforementioned limitations, we propose RulE, a novel and principled framework to combine KGE and logical rules in a unified scheme. RulE stands for Rule Embedding. We choose it our method's name highlight that we are the first to jointly represent every entity, relation and logical rule in unified embedding, as illustrated in Figure | Given KG and a set of logical rules, RulE assigns an embedding vector to each entity, relation, and logical rule, and defines respec- tive mathematical operators between entities and relations as well as between relations and logical rules. By jointly optimizing embeddings in the same space, RulE allows injecting prior logical rule information into the embedding space, which improves the generalization of KGE. Additionally, by learning an embedding for each logical rule, RulE is able to perform logical rule inference in a soft way as well as give a confidence score to each grounded rule, similar to how KGE gives each triplet a confidence score. The learned confidence scores can further improve the rule-based reasoning process by softly controlling the contribution of each rule, which alleviates the brittleness of logic.
We evaluate RulE on link prediction tasks and show superior performance. It performs competitively with strong baselines on knowledge graph completion benchmarks WN18RR (Dettmers al. 2018
2

---

Under review as a conference paper at ICLR 2023
and FB15K-233 (Toutanova & Chen 2013). and obtains ofate-of-the-arr performance on Kinship and UMLS Kok & Domingos] 2007), two benchmark KGs for statistical relational learning.
To summarize, our main contributions in this work are the following. (1) We design novel paradigm of nyural-symbolic KG reasoning models to combine logical rules with KG embedding. To our best knowledge, this is the first attempt to embed entities, relations and logical rules into a unified space to perform KG reasoning.
(2) Our framework is quite generic and flexible. It can adopt any KGE method, such as RotatE and TransE, and can use flexible ways to model the relationship between the embeddings of logical rules and their participating relations. (3) We empirically evaluate RulE on several benchmark KGs, showing superior performance to prior works.
RELATED WORK
A popular approach for knowledge graph reasoning is knowledge graph embedding (KGE), which embeds entities and relations into continuous space and uses scoring function to compute score
for each triplet based on the entity and relation embeddings (Bordes et al.] [013]] Yang et al.] [014
Trouillon al., 2016 Cai & Wang 2017; Sun et al. 2019 Balažević et al. 2019] Vashishth al.
2019 Zhang et al. 2020; Abboud et al. 2020). Much prior work in this regard views a relation as some operation mapping function between entities. Most notably, TransE (Bordes et al., 2013)
defines a relation as a translation operation between some head entity and tail entity. It is effective in modelling inverse and composition rules. DistMult (Yang et al., 2014) uses bilinear mapping function to model symmetric patterns. RotatE (Sun et al. 2019) uses rotation operation in complex space to capture symmmety/antiyymmerry inversion and composition rules. [BoxE (Abboud et al.) 2020) models relations as boxes and entities as points to capture symmetry/antisyymmeryy inversion, hierarchy and intersection patterns but not composition rules] Still, the relations well modelled by prior work are quite simple. and embeddings are learned solely based on triplets (ccroth-order logic) contained in the given KG. In contrast, our approach is able to embody more complex first-order logical rules in the embedding space by jointly modeling entities, relations and logical rules in a unified framework.
Besides embedding based methods, logical rules have been widely applied in knowledge graph rea- soning as well because of their interpretability and generalizability. As one of the early efforts, Quinlan (990)) uses Inductive Logic Programming (ILP) to derive logical rules (hypothesis) from all the training samples in a KG. Some later work leverages Markov Logic Networks (MINs)) to define the joint distribution over given (obscrved) and hidden variables (missing facts) (Kok & Domingos, 2005 Brocheler et al. 2012: Beltagy & Mooney| 2014).. Using maximum likelihood estimation, MLNs learn the weights of logical rules, which can be further used to infer missing facts (hidden variables) in the probabilistic graph framework. However, this approach requires enumerating all possible facts and thus is not tractable. AMIE (Galárraga et al.] (003)) and AMIE+ (Galárraga et al, 2015) first enumerate possible rules and then learn a scalar weight for each rule to encode the qual- ity. Neural-LP (Yang et al. 2017) and DRUM (Sadeghian et al. 2019) mine rules by simultaneously
learning logic rules and their weights based on TensorLog (Cohen et al. 2017). RNNLogic (Qu ctt al.] 2020) simultancously trains a rule generator as well as reasoning predictor to generate high- quality logical rules. Except for RNNLogic, the above methods solely the learned logical rules for reasoning, which suffer from brittleness and are hardly competitive with embedding- -based rea- soning in most benchmarks. Although RNNLogic considers the effect of KGE during inference, it only linearly combines the rule inference score and KGE score as the final prediction score, and pretrains KGE separately from logical rule learning without jointly modeling KGE and logical rules in the same space. In contrast, our RulE assigns an embedding to each logical rule and trains KGE together with rule embedding, so that they are modelled in the same embedding space to comple- ment each other. In addition, during rule inference, RulE further employs the learned confidence scores of rules as soft molti-hot encoding of the activated rules instead of hard multi-hot encoding of RNNLogic to further promote rule-based reasoning.
Moreover, some recent work tries to incorporate logical rules into KGE models to improve the generalization and performance of KGE reasoning. KALE (Guo et al. 2016) applies t-norm fuzzy logic to grounded rules to give a truth score to each inferred triplet and generate additional triplets for KGE training. RUGE (Guo et al.) 2018) additionally focuses soft rules and uses logical rules to enhance KGE in an iterative manner. These models both use logical rules to infer new facts as additional training data for KGE. Besides the above ones, several other prior work injects
3

---

Under review as a conference paper at ICLR 2023
rules via regularization terms for KGE during training. Notably, Wang et al. (2015) formulates inference as an integer linear programming (ILP) problem with the objective function generated from embedding models and the constraints translated from rules. Ding al. (0118) impose non- negativity constraints on entity representations by restricting each element of entity embedding to [0, 1]. and inject subrelation rules (e.g../) Tp - rg)) over relation representations, regularizing the score computed by KGE of the latter to be higher than that of the former. Based on onnDin et al. (2018) Guo al. (2020) go beyond simple rules (i.e., subrelation) and can handle more complex logical rules encoded by Horn clauses. In summary, these methods leverage logical rules only to enhance KGE training and do not really perform reasoning with logical rules. [Besides, there are some other works that adopt graph neural networks framework. They usually aggregate local neighbor information to perform link prediction (Schlichtkrull et al.] [011:] Teru et al.) 2020: Zhu et al., 2021). Although they probably achieve better performance than our method in FB15k-237 and WN18RR, it does not explicitly apply logic rules and lack explainability. However, our method is more applicable paradigm such that we can exploit human domain knowledge.] simultaneously train KG embedding and rule embedding, and combine them together to infer missing facts, which mutually enhance each other.
3 PRELIMINARIES
A KG consists of set of triplets or atoms KC = ((h,r,t) & E R} C R E, where denotes the set of entities and R the set of relations. For testing triplet (h, r, r),, we define query as q = (h, r, ?). The knowledge graph reasoning (link prediction) task is to infer the missing entity t based on the existing facts (and rules).
3.1 EMBEDDING-BASHI REASONING
Knowledge graph embedding (KGE) represents entities and relations in a continuous space called embeddings. It calculates score for each triplet based on these embeddings via scoring function. The embeddings are trained so that facts observed in the KG have higher scores than those not observed. The learning goal here is maximize the scores of positive facts (existing facts) and minimize those of generated negative samples.
RotatE (Sun et al. 2019) a representative KGE method with competitive performance on common benchmark datasets. It maps entities in a complex space and defines relations as element-wise rotations in a -io-dimensional complex plane. Each entity and each relation is associated with complex vector, i.e., h((), p(e), ((0) C where the modulus of each element in (-() equals (multiplying a complex number with a unitary complex number is equivalent to a 2D rotation). The k-dimensional complex vector h. can be expressed in the form (()) = h, + h&g, where ha and h& are k-dimensional real vectors. Based on it, RotateE represents each head entity as 2i-dimensional real vector h := [ha, las] E 122 where ha are the real parts and hs are the imaginary parts (the same for the tail embedding t). Additionally, as rotations are associated with unitary complex 1.j 1,2,.. ... k), RotateE only parameterizes relation embeddings with k-dimensional real vectors (angles) r. Here the real parts are cos(r) and imaginary parts are sin(r), where both sin and cos are element-wise operations.
numbers (i.e., [[r(")],|
If a triplet (h, t) holds, it is expected that g(s) ~ ((() o (c)) in the complex space, where denotes the Hadamard (element-wise) product. This is equivalent to t z Concat (h, o cos(r) - h, sin(r), ho sin(r) + hss cos(r)) in the real space, where (ha cos(r) hs sin(r)) is the real part of and (ha o sin(r) ha cos(r)) is the imaginary part. The distance function of RotatE is defined as:
d(h, t) =|| Concat (h, o cos(r) - hb o sin(r), ha o sin(r) + h2 o cos(r)) -t
(1)
By defining relations as rotations in complex space, RotatE can model symmettylantisymmeetty inversion and composition rules simultaneously.
3.2 RULE-BASED REASONING
Logical rules are usually expressed as first-order logic formulae, e.g., Vz. 2: (æ, ni y) A
(y. 2) - r3, or ri (2, v) A =2( > r2(2r,2) for brevity. The left-hand side of the
4

---

Under review as a conference paper at ICLR 2023
Triple loss
Initialized embedding
(u, o.
Pre-training
Optimized embedding
$000
0000
0000
6a
KGE Inference
Triples existing
0000
Rule loss (rule ei
Jointly training
h
(e. 92)
1000
(g ((s))))
Frdle N. 62) i Frule ta 1
0000
0000
Final
Logic rules
Grounding
(Rç BAG r.) (Rgt v AA + (R2; Ar,
Activated confidence
Weighted
P 0
MLP
Sule grounding
sum
(
Grounding rule score
Obc
Figure 2: The overall architecture of our model. RulE consists of three components. Given a KG containing set of triplets and logical rules extracted from the same or some other (external) knowl- edge source, we represent each entity, relation and logical rule as an embedding. 1) During the pre-training stage, we model the relationship between entities and relations as well the relation- ship between relations and logical rules in the same continuous space to jointly learn entity, relation and rule embeddings. With the learned rule embeddings (r) and relation embeddings (R), RulE can output a weight (w) for each rule. 2) In the grounding stage, we further associate each rule with a learnable grounding-star embeddings with which is further used to output grounding rule score.
embedding (Ris)), For all activated rules, we compute the weighted sum
of their grounding- 3) Finally, RulE integrates the KGE score obtained from the pre- pre-training stage and the grounding rule score for inference.
implication "->" is called rule body or premise, and the right-hand side is rule head or conclusion. Logical rules are often restricted be closed, forming chains. For chain rule, successive relations share intermediate entities (e.g., y), and the conclusion's 's and premise's 's head/tail entity are the same. The length of rule is the number of atoms (relations) that exist in its rule body. One example of length-2 rule is:
live in(x; y) A city of(y, =) - nationality(r;; =),
of which live_in five_in() A cityy_of(- ) is the rule body and nationality()) is the rule head. A grounding of rule is obtained by substituting all variables æ, y, z with specific entities. For example, if replace x, y. z with Bill Gates, Seattle, US respectively, we get grounding:
live_in Bill Gates, Seattle) A city (Seattee,, US) + nationality .Bill Gates, US)
(3)
If all triplets in the rule body of a grounding exist in the KG, we get a support of this rule. Those rules that have nonzero support are called activated rules. When inferring query (h, ?),, rule- based reasoning enumerates relation paths between head h and each candidate tail. and uses activated logic rules to infer the answer. For example, if we want to infer nationality Gates, ?), given the logical rule (2) as well as the existing triplets live in Inliill Gates, Seattle) and city of(Sttte US), the answer US can be inferred by traversing the KG.
4 METHOD
This section introduces our proposed model RulE. RulE uses novel paradigm to combine KG embedding with logical rules by learning rule embeddings. As illustrated Figure RulE consists of three key components. Consider KG containing triplets and a set of logical rules extracted from the same or some other (external) knowledge source. 1) Pretraining. We model the relationship between entities and relations well as the relationship between relations and logical rules to jointly train entity embedding, relation embedding and rule embedding in a continuous space, as illustrated in Figure [ 2) Grounding. With the rule and relation embeddings, we calculate confidence score for each rule which is used as the weight of activated rules to output a grounding rule score 3) Inference. Finally, we integrate the KGE score obtained from the pre-training stage and the grounding rule score obtainable from the grounding stage to reason unknown triplets.
5

---

Under review as a conference paper at ICLR 2023
4.1 PRE-TRAINING
Given triplet (h,r,t) t) E K and rule R E C. we use h, T, t, R E 12t to represent their embeddings, respectively, where is the dimension of the complex space (following RotatE), Similar KGE, which encodes the plausibility of each triplet with a scoring function, RulE additionally defines scoring function for logical rules. Based on the two scoring functions, it jointly learns entity, relation and rule embeddings in same space by maximizing the plausibility of existing triplets K. (zeroth- order logic) and logical rules L (first-order logic). The following describes in detail how to model the triplets and logical rules together.
To model triplets, we take RotatE (Sun er al. 2019) due to its simplicity and competitive performance. Specifically, given triplet (h, r,t), its score is formulated as:
Modeling the relationship between entities and relations
8y (e, r,
-dh,, r, (),
where % is fixed triplet margin and d(ftr r.t) is defined in Eq. [T. A triplet with small distance will have higher score, indicating its higher probability to be true. Note that our model is not restricted to RotatE. The distance function can also be replaced with other KGE models, such as TransE (Bordes et al., 2013) and ComplEx (Trouillon et al., 2016). Based on the scoring function, we define the loss function with negative sampling as:
L(h. r. - log (s: (h,
Σ
rr,'))
(5)
|N|
(b'rre0)
where (2x) = 1/(1+++e) exp(=))) denotes the sigmoid function and N is the set of negative samples constructed by replacing either the head entity or the tail entity with random entity (but not both at the same time). Following RotatE (Sun et al. 2019). we use a self-adversarial negative sampling approach to sample negative triplets from the current embedding model.
A universal first-order logical rule is some rule that universally holds for all entities. Therefore, cannot relate such rule with specific entities. Instead, it is a higher-level concept related to the relations of which it is composed. Motivated by RotatE, natural idea is model the relationship between relations and logical rule as element-wise rotations from the rule body to the rule head, i.e., for a logical rule r (c) R( where (r!")) )
Modeling the relationship between relations and logical rules
(c) (r(() o
(c) (c)
R: A12 A... An f1+1, we expect that ri+1
and R( are in the k-dimensional complex space. However, 2D rotations are commutative- they cannot model the non-commutative property of composition rules, which is crucial for correctly expressing the relation order of rule. Take sister_of(xx y) A mother-of(ju example. If permute the relations in rule body, e.g., change (sister_of mother to (mother of A sister the rule is no longer correct. However, the above model will output the same score since (r(() r (r(a) (c) c()))
+ aunt_of(ar, 2)
Therefore, to respect the relation order of logical rules, we propose to use RNN (Graves) 2012). Given the sequence of all relations in rule body, e.g., [r1 I,...., 17), we use RNN generate the rule head r1+1. Specifically, we first concatenate each relation embedding т; in the rule body with RNN, whose output is
the rule embedding R. We further pass the concatenated embedding expected to be close to the rule head embedding 11 Given so, the distance function is formulated as:
d(R, r1, T2. r141) =|| RNN((R, rı), RR [2) R, r:)) T1+1
We also employ negative sampling, the same when modeling triplets. At this time, it replaces relation (either rule body or rule head) with a random relation. The loss function for logical rules is defined
L(R, T1, T2. r(41) log o(r d(R, T1, T1, T2.... r(+1))
Σ
log a (d R, rh,... r/41) 7r), (7)
M
RR. ( P2e.. r/ JEM EM
where 7, is a fixed rule margin and M is the set of negative rule samples.

---

Under review as a conference paper at ICLR 2023
Jointly training Given a KG containing set of triplets I and logical rules L, we jointly optimize the entity, relation, and rule embeddings with the loss:
Σ (h.T,))EK
L(h, r, b) + E
L(R, 11, P(t1),
where is positive hyperparameter weighting the importance of rules.
4.2 GROUNDING
During grounding, we use the parameters optimized by the pre-training process to compute the confidence score of each rule. Similar how KGE gives triplet the score, the confidence score of a logical rule R;; Fl A Fig A... A Ar, + Fic+1 is calculated by:
w1 = 7r d( R4; Th1 P'g.
where d(R;, Fi1 "', I) is defined in Eq. (6). Each logical rule is further associated with grounding-sten rule embedding R(s) ε TRP. Note that this embedding is trained separately from the rule embedding R in the pre-training stage, and is only used for the grounding stage rule-based reasoning. Specifically, when answering a query rh, ?), we apply logical rules to find different grounding paths on the KG, yielding different candidate answers. For each candidate answer t', we sum over the grounding- stage embeddings of those activated rules, each weighted by its rule confidence score w; and the number of paths activating this rule (# supports). Finally, we apply an MLP to calculate the grounding rule score:
Sy sy,hr,t) = MLP (LN( Σ w.) ())
(10)
R:EC!
where LN the layer normalization operation, P(h, t') is the set of supports of the rule R; which starts from h and ends at t'. More implemen- tation details of the grounding process are included in Appendix A Once we have the grounding rule score for each candidate answer, of the true answer. Finally, we train the ML. and grounding-stage rule embeddings by maximizing the log likelihood of the true answers in the training triplets.
the set of activated rules for (h, r, r,,),, and
further
softmax function compute the probability
4.3 INFERENCE
After pre-training and grounding, we predict any missing fact jointly with the KGE score (Eq. (4) and the grounding rule score (Eq. )I0). Specifically, for query (h,r, ?), substitute the tail entity with all candidate entities (h, r, and compute their KGE scores st, r, t'). In addition, perform a BFS search from h find all candidates whose paths from h can activate rule with the rule head grounded by tt). For these candidates, we compute their grounding rule scores defined in Eq. (IO) (those activating no rules have zero grounding rule scores). Then the final scores of all candidate answers are computed by weighted sum of s; sh, r,t') and (g,
s(h, r') = st (h,
s,,,,r,tt))
(11)
9 is a hyperparameter balancing the importance of embedding- and rule-based reasoning.
EXPERIMENTS
In this section, we experimentally evaluate RulE on several benchmark KGs and demonstrate the effectiveness of RulE knowledge graph reasoning tasks.
5.1 EXPERIMENT SETTINGS
Datasets. We choose four datasets for evaluation: FB 15k-237 (Toutanova & Chen 2015).
WN18RR (Dettmers et al.) 2018). UMLS and Kinship (Kok & Domingos) 2007). FB 15k- 237 and
WN18RR are subsets of two large-scale knowledge graphs, FreeBase (Bollacker et al. 2008) and
WordNet (Miller) 1995). UMLS and Kinship are two benchmark datasets for statistical relational
learning. ensure a fair comparison, we use the same splits as RNNLogic (Qu et al.
2020 More
details of dataset statisties summarized in Appendix
7

---

Under review as a conference paper at ICLR 2023
Table I: Results of reasoning UMLS and Kinship. H@k is in %. [*] means the numbers taken
from the IRNNLogic paper]. ['] means we rerun the methods with the same evaluation process.
UMLS
Kinship
MRR
H@1
H@3
H@
MRR
H@1
H@3
H@
TransE
0.629
36.4
88.4
96.1
0.251
1.62
37.8
72.8
DistMult
0.391
25.6
44.5
66.9
0.354
18.9
40.0
75.5
ComplEx
0.411
27.3
46.8
70.0
0.418
24.2
49.9
81.2
TuckER*
0.732
62.5
81.2
90.9
0.603
46.2
69.8
86.3
RotatE
0.744
63.6
82.2
93.9
0.651
50.4
75.5
93.2
MLN'
0.688
58.7
75.5
86.9
0.351
18.9
40.8
70.7
PathRank
0.197
14.8
21.4
25.2
0.369
27.2
41.6
67.3
Neural-LP"
0.483
33.2
56.3
77.5
0.302
16.7
33.9
59.6
DRUM
0.548
35.8
69.9
85.4
0.334
18.3
37.8
67.5
RNNLogic+ (rule.)*
0,800
70.4
87.8
94.3
0.655
50.4
76.0
94.7
RNNLogic+ (emb. rrul.)
0.847
76.7
91.6
96.9
0.714
58.1
81.8
95.4
RulE (emb.)
0.801
70.0
88.2
96.0
0.674
53.6
76.6
93.7
RulE (rude.)
0.827
74.6
88.9
95.7
0.682
53.5
78.9
95.1
RulE (emb.+rule) +rule.)
0.866
79.5
92.7
97.4
0.740
62.0
82.9
95.7
Results of reasoning on FB15k-237 and WN18RR. H@k is in %. [$] means the numbers are Table 2:
taken from the original papers. ['] means we rerun the methods with the same evaluation process.
FB15k-237
WNISRR
MRR
H@1 H@3
H@
MRR
H@1
H@3
H@ 10
TransE*
0.294
46.5
0.226
50.1
DistMult'
0.241
15.5
26.3
41.9
0.43
39
44
49
ComplEx"
0.247
15.8
27.5
42.8
0.44
41
46
51
ComplEx-N33
0.37
56
0.48
57
ConvE"
0.325
23.7
35.6
50.1
0.43
40
44
52
TuckER*
0.358
26.6
39.4
54.4
0.470
44.3
48.2
52.6
RotatE
0.338
24.1
37.5
53.3
0.476
42.8
49.2
57.1
PathRank"
0.087
7.4
9.2
11.2
0.189
17.1
20.0
22.5
Neural-L.P*
0.237
17.3
25.9
36.1
0.381
36.8
38.6
40.8
DRUM
0.238
17.4
26.
36.4
0.382
36.9
38.8
41.0
Logio (rule.)*
0.299
21.5
32.8
46.4
0.489
45.3
50.6
56.3
RNNN.gicc+ (emb. rrlee)
0,349
25.8
38.5
53.3
0.502
46.0
51.8
58.1
RulE (emb.)
0.338
24.1
37.6
53.3
0.480
43.7
49.6
56.1
RulE (rule.)
0,311
22.9
34.1
47.6
0.491
45.4
50.7
56.1
RulB (emb. +rule.)
0.354
26.1
39.1
54.3
0.506
46.6
52.2
58.9
Baselines. We compare with a comprehensive suite of baselines. (1) Embedding
models:
include TransE (Bordes et al.) (2013), ComplEx (Trouillon et al. 2016), RotatE (Sun et al.) 2019)
and TuckER (Balaževic et al. 2019). (2) Rule-based models: we consider popular rule-mining models Neural-L.P (Yang et al. 2017). DRUM (Sadeghian et al. 2019), and two RNNLogic+ vari- ants (Qu et al. 2020). RNNLogic+ (rule.) is pure sale-based reasoning method while RNNLogic+ uses both logical rules and knowledge graph embeddings. See more introductions to RNNLogic in Appendix B Besides, we also compare with two early works: MIN (Richardson & Domingos 2006) and PathRank (Lao & Cohen 2010). (3) RulE; For our model RulE, we present results of embedding based reasoning, rule-based reasoning and joint reasoning. The first one only uses KGE scores obtained from the pre-training stage to reason unknown triplets. denoted (emb.), The second one uses the grounding score calculated from the grounding stage to infer missing facts, and we denote it as (rule.). The last combines both of them, denoted (emb. +rule.). By default, we use the same rules mined by RNNLogict.
Evaluation protocols. For each test triplet (h, t), substitute the tail entity with all entities, calculate a score for each candidate, and sort all candidates descending order to get the rank of the true tail entity. During ranking, corrupted triplets that already exist either the training, validation or test set. We report the standard evaluation metries for these datasets, Mean Reciprocal Rank (MRR) and Hits at N (H@N).
the filtered setting (Bordes et al. (2033) by removing
8

---

Under review as a conference paper at ICLR 2023
Table 3: Results of reasoning on FB15k and WN18. H@k is in %.
FB15k
WN18
MRR
H@1 1
H@3
H@ 10
MRR
H@1
H@3
H@ 10
TransE"
0.730
64.6
79.2
86.4
0.772
70.5
80.8
92.2
KALE
0.523
38.3
61.6
76.2
0.662
85.5
93.0
RulE (emb. TransE)
0.734
65.0
79.9
86.9
0.775
67.2
86.2
95.0
ComplEx!
0.766
69.7
81.3
88.3
0.898
85.4
92.6
95.2
RUGE
0.768
70.3
81.5
86.5
0.943
94.4
ComplEx-NNE+AIE
0.803
76,1
83.1
87.4
0.943
94.0
94.5
94.8
RulE (emb. ComplEx)
0.788
72.4
83.3
89.6
0.928
91.9
93.5
94.4
Hyperparameter settings. By default, we use RotatE (Sun et al. 2019) as our KGE model. We optimize our model parameters with Adam (Kingma & Ba 2014) and tune the hyperparameters by grid search on the validation dataset. See more details in Appendix
5.2 RESULTS
As shown in Table T and 2 RulE outperforms all baselines on UMLS, Kinship, and WN18RR. is competitive on FB15k-257 well. Especially for UMLS and Kinship, obtain 1.9% and 2.6% higher absolute MRR than the best baselines, respectively. A detailed analysis follows.
Embedding logical rules helps KGE, We first compare RulE (emb.) with RotatE. Compared to RotatE, RulE (emb.) only adds an additional rule embedding loss to the KGE training and still uses and
KGE scores only for prediction. As presented in Table I and Table 2 RulE (emb.) achieves higher performance than RotatE, indicating that embedding entities, relations and logical rules in the same space beneficial for learning more compact representations for KG. Specifically, Kinship, RulE (emb.) outperforms RotatE with 5.7% and 2.3% improvement in MRR, which is more signifieant than on FB15k-237 and WNISRR. The reason probably that UMLS and Kinship contain more rule-sensitive facts while WN18RR and FB 55-2737 consist of more general facts (like the publication year of an album, which is hard to infer via rules). This phenomenon is observed in previous works too (Qu et al. 2020). In Table 3 we further experiment with variants of RulE (emb.) using TransE and ComplEx as the KGE models. They both obtain superior performance to the corresponding KGE models. More results are shown in Appendix E
UMLS and
Rule confidence improves rule-based reasoning. One significant difference between RulE (rule.) and RNNLogiC+ (rule.) is that the former weights the grounding-stage rule embeddings (Eq. (9) when performing rule-based reasoning, while the latter only uses hard 1/0 to select acti- vated rules. RulE (rule.) achieves better performance than RNNLogict (rule.). This demonstrates that the confidence scores of logical rules, which are learned through jointly embedding KG and logical rules, help rule-based reasoning. See Appendix E.2 for more discussion.
Comparison with other joint reasoning and rule-enhanced KGE models. Compared with RNNLogic+ temb.+ruee). RulE rulb.)rule) achieves better results on all datasets, demonstrating the benefits of pretraining KGE with rule embeddings together. We further compare RulE (emb.) with KALE (Guo et al.) 2016), RUGE (Guo et al. 2018) and ComplEX-NNE+AER (Ding et al., 2018 in Table These models inject logical rules to enhance KGE training. KALE is based on use ComplEx. For fair comparison, we replace RotatE in RulE with TransE and ComplEx, respectively. As these baselines only have code for old datasets, we compare all models on FB15k and WN18. From Table 3 we can see that RulE (emb. TransE) yields more accurate results than KALE. For RulE (emb. ComplExx, although does not outperform ConplEx-NNE++ER (probably because it additional injects the regularization terms on entities but RulE does not), compared to RUGE, RulE (emb. ComplEx) also obtains 2% improvement in MRR on 15k well as comparable results on WN18.
TransE, whereas RUGE and ComplEx-NNE++AE
DISCUSSION AND CONCLUSION
We propose a novel and principled framework RulE to jointly represent entities, relations and logical rules in unified embedding space. It improves the generalization capability of KGE and improves logical rule reasoning through absorbing the best of both. However, similar to prior work using logical rules, RulE needs to enumerate all paths between entity pairs, making it difficult to scale. In the future, we plan to explore more efficient and effective algorithms. e.g., replace logical rules completely with rule embeddings during inference, and consider complex rules.

---

Under review as a conference paper at ICLR 2023
REFERENCES
Ralph Abboud, Ismail Ceylan, Thomas I Lukasiewicz, and Tommaso Salvatori. Boxe: A box embed- ding model for knowledge base completion. Advances in Neural Information Processing Systems, 33:9649-9661, 2020.
Ivana Balažević, Carl Allen, and Timothy M Hospedales. Tucker: Tensor factorization for knowl- edge graph completion. arXiv preprint arXiv: 10Xiv:900100950000 2019.
Islam Beltagy and Raymond Mooney. Efficient markov logic inference for natural language mantics. In Workshops at the Eventy-Eightt AAAI Conference on Artificial Intelligence, 2014.
Kurt D. Bollacker, Colin Evans, Praveen K. Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a col- laboratively created graph database for structuring human knowledge. In SIGMOD Conference, 2008.
Antoine Bordes, Nicolas Usumier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. Advances in neural information pro- cessing systems, 26, 2013.
Antoine Bordes, Sumit Chopra, and Jason Weston. Question answering with subgraph embeddings. arXiv preprint arXiv:1466.3e0 1406.3666, 2014.
Matthias Brocheler, Lilyana Mihalkova, and Lise Getoor. Probabilistic similarity logic. arXiv preprint 1rXivv1203.3460 2012.
Liwei Cai and William Yang Wang. Kbgan: Adversarial learning for knowledge graph embeddings. arXiv preprint arXiv: 17Xi::7711.00777 2017.
William W Cohen, Fan Yang, and Kathryn Rivard Mazaitis. Tensorlog: Deep learning meets prob- abilistic dbs. arXiv preprint arXiv:1707.05538 2017.
Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Veličković. Principal neighbourhood aggregation for graph nets. Advances in Neural Information Processing Systems, 33:13260 13213260-13271, 2020.
Thomas Demeester, Tim Rocktäschel, and Sebastian Riedel. Lifted rule injection for relation em- beddings. arXiv preprint 1mXiv:1606.08333 2016.
Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2d knowledge graph embeddings. In Proceedings of the AAAI conference on artificial intelligence, volume 32, 2018.
Boyang Ding, Quan Wang, Bin Wang, and Li Guo. Improving knowledge graph embedding using simple constraints. arXiv preprint arXiv:1805.02444 2018.
Luis Galárraga, Christina Teftioudi, Katja Hose, and Fabian M Suchanek. Fast rule mining in onto- logical knowledge bases with amie
+. The VLDB Journal, 24(6))70 2015.
Luis Antonio Galárraga, Christina Teflioudi, Katja Hose, and Fabian Suchanek. Amie: association rule mining under incomplete evidence in ontological knowledge bases. In Proceedings of the 22nd international conference on World Wide Web, pp. 413-422, 2013.
Alex Graves. Long short-term memory. Supervised sequence labelling with recurrent neural net- works, pp. 37-45, 2012.
Shu Guo, Quan Wang, Lihong Wang, Bin Wang, and Li Guo. Jointly embedding knowledge graphs and logical rules. In Proceedings of the 2016 conference on empirical methods in natural lan- guage processing, pp. 192-202, 2016.
Shu Guo, Quan Wang, Lihong Wang. Bin Wang, and Li Guo. Knowledge graph embedding with it- erative guidance from soft rules. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018
10

---

Under review as a conference paper at ICLR 2023
Shu Guo, Lin Li, Zhen Hui, Lingshuai Meng, Bingnan Ma, Wei Liu, Lihong Wang, Haibin Zhai, and Hong Zhang. Knowledge graph embedding preserving soft logical regularity. In Proceedings of the 29th ACM International Conference Information & Knowledge Management, pp. 425-434, 2020.
Pascal Hitzler. Neuro-symbolic artificial intelligence: The state of the art. 2022.
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.69880 2014.
Stanley Kok and Pedro Domingos. Learning the structure of markov logic networks. In Proceedings of the 22nd international conference on Machine learning, pp. 441-448, 2005.
Stanley Kok and Pedro Domingos. Statistical predicate invention. In Proceedings of the 24th inter- national conference on Machine learning, pp. 433 440, 2007.
Ni Lao and William W Cohen, Relational retrieval using combination of path-constrained random walks. Machine learning, 81(1):53-67,20 2010.
Robin Manhaeve, Sebastijan Dumancie, Angelika Kimmig, Thomas Demeester, and Lue De Raedt. Deepproblog: Neural probabilistic logic programming. Advances Neural Information Process- ing Systems, 31, 2018.
George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11): 39 1995.
Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Push- meet Kohli. Neuro-symbolic program synthesis. In ICLR, 2017.
Meng Qu, Junkun Chen, Louis-Pasca Xhonneux, Yoshua Bengio, and Jian Tang. Rnnlogic: Learn- ing logic rules for reasoning on knowledge graphs. arXiv preprint arXiv:2010.04029 2020.
J. Ross Quinlan. Learning logical definitions from relations. Machine learning, 5(3):239-2)))) 1990.
Matthew Richardson and Pedro Domingos. Markov logic networks. Machine learning, 62(1):107~ 136, 2006.
Tim Rocktäschel, Sameer Singh, and Sehastian Riedel. Injecting logical background knowledge into embeddings for relation extraction. In Proceedings the 2015 conference of the north American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2015.
Ali Sadeghian, Mohammadreza Armandpour, Patrick Ding, and Daisy Zhe Wang. Drum: End-to- end differentiable rule mining knowledge graphs. Advances in Neural Information Processing Systems, 32, 2019.
Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In European semantic web conference, pp. 593-607, Springer, 2018.
Fabian M Suchanek, Gjergji Kasneci, and Gerhard Weikum. Yago: core of semantic knowledge. In Proceedings of the 16th international conference on World Wide Web, pp. 697-706, 2007.
Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. arXiv preprint
2019.
Komal Teru, Etienne Denis, and Will Hamilton. Inductive relation prediction by subgraph reasoning. In International Conference on Machine Learning, pp. 9448-9457 PMLR, 2020.
Kristina Toutanova and Danqi Chen. Observed versus latent features for knowledge base and text inference. In Proceedings of the 3rd workshop on continuous vector space models and their compositionality pp. 57-66, 2015.
11

---

Under review as a conference paper at ICLR 2023
Théo Trouillon, Johannes Welbi, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Com- plex embeddings for simple link prediction. In International conference on machine learning, pp- 2071-2080. PMLR. 2016.
Shikhar Vashishth, Soumya Sanyal, Vikram Nitin, and Partha Talukdar. Composition-based multi- relational graph convolutional networks. arXiv preprint arXiv: 191 1.030000222 2019.
Hongwei Wang, Fuzheng Zhang, Jialin Wang, Miao Zhao, Wenjie Li, Xing Xie, and Minyi Guo. Ripplenet: Propagating user preferences on the knowledge graph for recommender systems. In Proceedings of the 27th ACM international conference information and knowledge manage- ment, pp. 417-426, 2018.
Quan Wang, Bin Wang, and Li Guo. Knowledge base completion using embeddings and rules. In Twenty-fourth international joint conference artificial intelligence, 2015.
Chenyan Xiong, Russell Power, and Jamie Callan. Explicit semantic ranking for academic search via knowledge graph embedding. In Proceedings of the 26th international conference on world wide web, pp. 1271-1279 2017.
Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Broeck. semantic loss function for deep learning with symbolic knowledge. In International conference machine learning, 2018.
Bishan Yang. Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. arXiv preprint (rxXiv:1412.6575 2014.
Fan Yang, Zhilin Yang, and William W Cohen. Differentiable learning of logical rules for knowledge base reasoning. Advances in neural information processing systems, 30, 2017.
Kexin Yi, Jiajun Wu, Chuang Gan, Antonio Torralba, Pushmeet Kohli, and Josh Tenenbaum. Neural- symbolic vqa: Disentangling reasoning from vision and language understanding. Advances in neural information processing systems, 31, 2018.
Yongqi Zhang, Quamming Yao, and Lei Chen. Interstellar: searching recurrent architecture for knowledge graph embedding. Advances in Neural Information Processing Systems, 33:10030- 10040, 2020.
Zhaocheng Zhu, Zuobai Zhang, Louis-Pascal Xhonneux, and Jian Tang. Neural bellman-ford net- works: general graph neural network framework for link prediction. Advances Neural Infor- mation Processing Systems, 0122946--24999 2021.
12

---

Under review as a conference paper at ICLR 2023
A MORE DETAILS OF IMPLEMENTING THE GROUNDING PROCESS
This section introduces how to implement the grounding process. It is slightly different from our proposed framework but can empirically achieve better results. Recall that R and r are the embed- dings of logical rules and relations, respectively, whose dimensions are k. In practice, we do not need to restrict the dimension R as k. With the relation embeddings and rule embeddings opti- mized in the pre-training process, can compute the confidence score of each rule. Specifically, given a logical rule R Iú, A Iig A... A Fi - Ta the learned RNN outputs a derived embedding:
P RNN([ [R, rill.... [Ra, r;,)),
(12)
where the dimension of r is k. the same as the rule head embedding ray The distance between Phe and F2 measures the uncertainty of the logical rule, thus the confidence function of R; is formulated as:
Tr - (F rra4))? k
=
(13)
where "Ir is the fixed rule margin defined in the pre-training process, and C; is a k-dimensional vector. Each element of e; represents a way of weighting the rule R; Instead of the scalar w; defined in Eq. ( we use a more fine-grained way to represent the confidence of each logical rule. When answering a query (h, r, ?), we ground logical rules on the KG and yield different candidate answers. For each candidate answer t', we can define the following function:
0, = LN ( Σ Ci. ()),
1.,,...,k
(14)
RIEC'
where LN is the layer normalization operation, L' the set of logical rules activated by (h, r, t'), R2()) is the grounding-stage rule embedding of R, and P(h, Rú, is the set of supports of the rule R; which starts from h and ends at r'. Eq. (14) encodes way to activate the grounding-stage rule embedding with rule confidence. There ways in total; thus, the grounding score, i.c.,
aggregate them to calculate
Sage (h, r,t = MLP(AGG(M) 02 r,t),,, on (h,r,,
(15)
Here, AGG is aggregator, which aggregate all vy r') by sum, mean, max min. In experiments, we adopt the sum in WN18RR and FB15k-237 as well as the mean in UMLS and Kinship. Once have the grounding rule score Sage r,, for each candidate answer, we further compute the probability of the true answer by softmax function. Finally, we optimize the MLP and grounding-stage rule embedding by maximizing the log likelihood of the true answers based these training triplets.
In fact, if aggregate Uy by sum and remove the layer normalization operation, Eq. 15 can be reduce to Eq. (10). The proof is shown as follows:
Proof: We remove the layer normalization and rewrite Eq. 14 and Eq.
(h, Σ
c.s
PP(.
(16)
R.ER
$ (h,,,,, MLP
Σ
w. Wr,[P(h, R,, (())
(17)
R,EC
By aggregating by by and combining Eq. (14) and Eq. 15) we obtain:
13

---

Under review as a conference paper at ICLR 2023
(h, MLP Σ
by (y,,,r,
agg
j=1
MLP Σ
j=l REE
(18)
= MLP Σ
R=
h Σ
MLP Σ
PP(h, R R
REEL
==1
Based on Eq. 9 we imply that:
k
Yr
(T/ T(et))
j=1
j=1
Thess Tol41 ||
(19)
7/-
--r-
(NRNN[ R2; rirl. righ....... [Ri, rzr)) Titt1 ||
Thus we continue to simplify Eq.
18
& R(0)
(,, )) = MLP
Σ R,)
ca.))
agg
RGEC'
J=1 (,, wc
= MMLP Σ
(20)
REEL
(h, r,t)
This completes the proof.
B INTRODUCTION OF RNNLOGIC+
RNNL RNNLogic (Qu et al. 2020) aims to learn logical rules from knowledge graphs, which simultane- ously trains rule generator well reasoning predictor. The former is used to generate rules while the latter learns the confidence of generated rules. RulE applies pre-defined logical rules to perform knowledge graph reasoning. To compare with it, we only focus on the reasoning predictor RNNLogic+, which is also a more powerful model than RNNLogic for exploiting logical rules. Its details are described in this section.
Given a KG containing a set of triplets and logical rules, RNNlogic+ associates each logical rule with grounding-stap rule embedding R(9) (following the grounding process of RulE), for query (h, ?). grounds logical rules into the KG, finding different candidate answers. For each candidate answer 1', RNNLogiC+ aggregates all the rule embeddings of those activated rules, each weighted by the number of paths activating this rule (# supports). This different point from RulE that RulE additionally employs the confidence scores of rules as soft multi-hot encoding instead of the hard multi-hot encoding of RNNLogic. Then an MLP further used to project the aggregated embedding to the grounding rule score:
sy rh, 1') MLP (LN(AGG((RR)) (9) Phh, R, (')
(21)
where LN is the layer normalization operation, AGG is the PNA aggregator (Corso al. 2020), L the set of activated rules for (h, t'), and P(h, R,, t') is the set of supports of the rule R; which starts from h and ends at Once RNNLogic+ has the score of each candidate answer, it can use a softmax function compute the probability of the true answer. Finally, it trains the MLP and rule embeddings by maximizing the log likelihood of the true answers based on training triplets.
During inference, there are variants of models:
14

---

Under review as a conference paper at ICLR 2023
RNNLogic+ (rule.): This variant only uses the logical rules för knowledge graph reasoning. Specifically, we calculate the score of each candidate answer only defined in Eq. 21 (i.e.,
s,,,,r,t')
RNNLogic+ (emb.+rule) It uses RotatE (Sun al. 2019) to pretrain knowledge graph embeddings models, which is another difference from RulE that RulE jointly models KGE and logical rules in the same space learn entity, relation and logical rule embeddings. In the inference process, the same as RulE, it linearly combines the grounding rule score and KGE score the final prediction score, i.e.
sh, r') s, (h,r,t')
(G,((,rrtt),
(22)
where KGE(h, is the KGE score calculated with entity and relation embeddings op- timized by RotatE and is a positive hyperparameter weighting the importance of the knowledge graph embedding score.
C EXPERIMENT SETUP
C.I DATA STATISTICS
[We the same splits RNNLogic and mine logic rules by RNNLogic. Each relation has about 100 or 200 logic rules, and the length of rules is no more than 3.] More statistics of datasets are shown in Table
Table 4: Statistics of four datasets
Dataset
#Entities
#Relations
#Train
#Validation
#Test
#Rules
FB 15k-237
14,541
237
272,115
17,535
20,466
47,362
WN18RR
40,943
11
86,835
3,034
3,134
6,676
UMLS
135
46
1,959
1,306
3,264
18,400
Kinship
104
25
3,206
2,137
5,343
10,000
C.2
DATA PROCESS
Most rules mined by rule mining systems are not chain rules. They usually need to be trans- formed into chain rules by inversing some relations. Considering (x, 3) A I2(21, 2) rs ra(y, 2) example, with replacing ri (x,z)) y) with r (v, the rule can be converted into chain rule ri (g. = (2(x, 2) + Ty(y 2). Based on the above, for data processing, we need to add a inverse version triplet rt,r=) .)) for each triplet (h, r,,t) t). representing the inverse relationship r- between entity and entity h.
C.3 HYPERPARAMETERS SETTING
For the pre- pre-training of RulE, the ranges of the hyperparameters for the grid search are: embedding
dimension & {100, 200, 500, 1000). learning rate Ir {0.00001, 0.00005, 0.0001). batch size of triplets and rules E (256, 512, 1024), negative sample size b,, E (128, 256, 512]. self-adversarial sampling temperature
{0.5, 1.0) and fixed margin Nt. 7 E {6, 12, 24, 32). During the ground- ing process. We tune the learning rate (r, E {0.0005, 0.001, 0.05). the dimension of grounding-stann state rule embedding {100, 200, 500). For inference. we combine embedding-
reasoning and
rule-based reasoning with the hyperparameter a E (0.5, 1.0, 5.0..
D A VARIANT OF MODELING RULES
Besides using RNN Graves 2012 to model logical rules, propose another variant to model the relationship between logical rules and relations, which is called ADD. Recall that we are given the sequence of all relations in the rule body, e.g., [r,, ADD aims to generate the rule
15

---

Under review as a conference paper at ICLR 2023
head. To respect the relation order of logical rules, we associate each rule with rule embedding, R R= [R| ...... R¹ , E IRM,, where is the dimension relation embedding and is the length of the logical rule. Based these definitions, can formulate the distance between the rule body and rule head as:
d(ri, 72,
11 R)
(ra R²)
T
(23)
1=11
where o is an element-wis product. Then we use Eq. to further define loss function of logical rules.
E ABLATION STUDY
E. EMBEDDING LOGICAL RULES BASED ON TRANSE
We first compare RulE (emb.) with KGE models. As shown in Table 3 the variants using TransE (Bordes et al. 2013) and ComplEx (Trouillon et al. 2016) as KGE models are called RulE (emb. TransE) and RulE (emb. ComplEx.) respectively. They both obtain superior performance to the pure corresponding KGE models. We also further compare with other rule-enhance KGE models. In experiment setup, RulE (emb. TransE) uses same logical rules as KALE (Guo 2016); RulE (emb. ComplEx) uses the same logical rules ComplEx-NNEE-AFR (Ding al. 2018). From the comparison, RulE (emb. TransE) and RulE (emb. ComplEx) both achieve better performance than KALE and RUGE, respectively. From Table 5 also that RulE (emb. ComplEx) is slightly worse than ComplEX-NNE-AA
et al.
The reason probably that ComplEx-NNE: AER additionally injects the regularization terms entity representations but RulE does not, and Nonp-Ex-NNE-AER is based on origin ComplEx, which performs better than ComplEx we use.
We further study the effect made by logical rules embedding based models with more datasets (i.e., UMLS and Kinship). We rerun KALE (Guo et al., 2016) on UMLS and Kinship datasets. They both the same splits and logical rules RulE, However, KALE uses pairwise ranking loss function while TransE and RulE use logistic loss function. Many experiments indicate that logistic loss usually performs better than pairwise ranking loss. Thus the results of KALE are worse than TransE in Table It is not easy to refactor due to their old coding. So we focus more on TransE, RulE (emb. TransE RNnN)_R RulE (emb. ADDD) From the results shown Table 5 we can see that whatever RNN or ADD, RulE (emb.) achieves better results than TransE. Especially for ADD, RulE (emb. FransE_ADDr obtained 13.9% and 14.2% MRR improvements on UMLS and Kinship respectively.
Table 5: Results of reasoning on UMLS and Kinship. H@k in %. TransE is the the KGE model.
UMLS
Kinship H@]
MRR
H@1
H@3
H@
MRR
H@3
H@
TransE
0.629
36.4
88.4
96.1
0.251
1.62
37.8
72.8
KALE
0.462
31.1
55
74.2
0.284
19.2
30.2
45.6
RulE (emb. TransE-ADD)
0.768
66.8
85.0
93.2
0.393
23,9
45.1
72.9
RulE (emb. RNNN)E
0.658
43.2
86.3
95.5
0.282
8.3
37.1
69.0
Table 6: Results of reasoning on UMLS and Kinship. H@k is in %.
UMLS
Kinship
MRR
H@1
H@3
H@
MRR
H@1
H@3
H@ 10
RulE (w/o confidence)
0.798
70.5
87.2
94.5
0.653
50.5
75.6
93.0
RulE (with confidence)
0.824
74.3
88.8
95.3
0.682
53.5
78.9
95.1
E.2 RULE CONFIDENCE IMPROVE RULE-BASED REASONING
To fully verify our conclusion that rule confidence can promote rule-based reasoning, we focus on the grounding stage and remove the rule confidence, (i.e. assignment each w; with Eq.
16

---

Under review as a conference paper at ICLR 2023
which denoted it as RulE (w/o confidence). Both RulE (w/o confidence) and RulE (with confidence) use the same hyperparameters and tune them based on the validation sets. From Table 6 we can see that RulE (with confidence) produce more accurate results than RulE (w/o confidence), which demonstrates our the effectiveness of soft multi-hot encoding for grounding-stage rule embeddings.
17


Reviews:
[{"review_id": "akSe0nv7OT", "reviewer": "Reviewer_w9mu", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "This paper proposes a new knowledge graph reasoning (KGR) model that combines embedding-based and rule-based methods. The authors claim that this is the first attempt to embed entities, relations, and logical rules into a unified space for KGR.", "summary_of_the_review": "This paper proposes an interesting idea, but the significance of experiments should be greatly improved before it can be accepted.", "strength_and_weaknesses": "## Strength\n1. The idea of embedding both knowledge graphs and logical rules in a unified space and learning them simultaneously is reasonable.\n2. The preliminaries are well introduced and related works are fully discussed.\n3. Detailed experimental settings and codes are provided for reproducibility.\n\n## Weakness\n1. **Motivation**     \nAt the top of Page 2, the authors say that one of the limitations of current KGE is that they can only be used in transductive scenarios, and rule-based methods do not have this shortcoming. However, it seems that the proposed RulE does not resolve this limitation and is still transductive.\n2. **Method**    \nThe authors may want to analyze the complexity of RulE. Using RNNs to encode paths is time-consuming, especially when there are a lot of rules in a knowledge graph.\n3. **Experiments**    \nMy major concern is about the experimental results.     \n3.1 Note that the authors claim that RulE is proposed for better knowledge graph completion (KGC). However, RulE does not show clear performance improvements on the commonly-used KGC datasets (WN18RR and FB15k-237), which demonstrates the poor applicability of RulE. I agree with the authors' analyses that this is because WN18RR and FB15k-237 consist of more general facts and the phenomenon is also observed in previous works. However, the aim of the previous works is to learn logical rules instead of improving KGC performance with logical rules.    \n3.2 In the caption of Table 1, the authors claim that [*] means the numbers are taken from the original papers. However, I cannot find the corresponding results in these papers (e.g., TuckER and RotatE). In my experience, KGE models such as RotatE perform very well on UMLS and Kinship, which is far greater than the reported results.", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "Sl9YRvKNt3", "reviewer": "Reviewer_fam7", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "The paper proposes RulE, a model for link prediction on knowledge graphs that jointly learns representations for entities, relations and rules in the embedding space. More specifically, RulE applies on top of the RotatE KGE model, and additionally includes a component for learning compositional rule embeddings: Given a composition rule r1(x_1, x_2) ^ r2(x_2, x_3) ... ^ r_k(x_k,+1) -> r_k+1(x_1, x_k+1), RulE applies an RNN over the relational representations of r_1, r_k to produce an order-specific representation for the rule.  This rule representation is then compared to r_k+1 as part of pre-training in the loss function as a separate term. Beyond pre-training, RulE uses grounding to establish weights for the rules provided to the model and compute a score for a fact based on the rules. This score then acts as a complementary measure to support the embedding-based score at inference time. Empirically, the model is evaluated on standard knowledge graph completion baselines and is shown to achieve competitive performance. Finally, the model is run on reasoning baselines UMLS and kinship and achieves state-of-the-art results.", "summary_of_the_review": "Overall, the unification of entity, relation and rule embeddings in a single embedding is a desirable property. However, in RulE, this is done in a problematic fashion, using black-box components that introduce i) inconsistent and incompatible objects between fact-level and rule-level uses of relational embeddings, ii) sacrifice the interpretability of the input KGE model (if already interpretable) particularly with respect to the study of inference patterns, iii) can only enforce a limited type of rules (compositions), and provides no soundness guarantees, e.g., capturing deductive closures of rules, and iv) substantially increase the parametrization and complexity of KGE models for minimal empirical gain. The contributions of RulE are also not completely well-placed in their context, as other works such as BoxE inject richer rule languages with provable guarantees. Therefore, I currently lean toward rejecting the paper. However, I am happy to change my verdict should the authors address my above concerns.", "strength_and_weaknesses": "# Strengths: \n- The empirical performance of RulE is good. \n- The intuition for representing rules in the same space as relations and entities is well-placed and a good inductive bias, though I have some concerns about the way it is done in this paper (see weaknesses below).\n\n# Weaknesses: \n- The paper claims that the way it includes rules is principled, in that all representations are in the same embedding space. This is technically correct, but is problematic in practice for many reasons. First, the semantics of the rule component are not compatible with those on the KGE side. That is, relation embeddings act as rotations in RotatE, but are used as RNN tokens without any observable semantics on the rule side, with no connection to their functional role in RotatE. Hence, this unity between representations does not provide any meaningful insights or constraints aside from the technical parameter sharing. \n\n- Second, the rule incorporation conducted in this work is not interpretable, and offers no means to study the inductive capacity of the model. Indeed, the scoring of rule satisfaction depends on a black-box RNN model, which makes studying combinations of rules or the set of rules captured by RulE virtually impossible. As a model trying to inject the symbolic structure of rule embedding, the lack of interpretable semantics on the rule embedding side severely undermines the contribution of the work. To illustrate this point, the rules in RulE all pass through the RNN, but there is no means to assess which potentially hidden inference patterns can be/are captured in the resulting model, whereas this can be done (albeit to a limited extent) in plain RotatE. Hence, using RulE effectively costs KGE models their interpretability on the inference patterns side. \n\n- Third, the set of rules being injected by RulE is restricted only to composition rules, and does not present a viable means to represent more general rules: Effectively, new components, e.g., other RNNs, must be introduced for different types of rules, which also loses the structure and semantics of said rules. In fact, it is not even clear how RulE can handle multiple sets of composition rules in a sound way, for instance by respecting potential deductive closures. For example, the rules r_1(x, y) ^ r2(y, z) -> r3(x, z) and r3(x, y) ^ r4(y, z) -> r5(x, z) imply a longer chain rule r_1(x, y) ^ r2(y, z) ^ r4(z, w) -> r5(x, w), but such a deduction cannot be guaranteed to hold, let alone read through the RNN representations of the rules. \n\n- Fourth, the approach is based on a more sophisticated neural network architecture (an RNN) and introduces additional hyper-parameters to its base model. Moreover, it introduces a potentially very costly grounding step prior to inference. As a result, the RulE model appears problematic not only from a scalability perspective, and this is acknowledged by the authors, but also from a parametrization and tuning perspective. Indeed, RulE achieves slightly improved results, but at the cost of interpretability, respecting the semantics of logical rules, and a larger parametrization. This unfortunately makes this setup less convincing overall.\n\n- On a different point, the paper presents its hybrid use of rule and entity/relation representation in the same space as a main contribution, and mentions related work along two categories: KGE models with potential rule regularization, and reasoning systems without embedding structure. However, it fails to mention the BoxE model (Abboud et al., 2020), which can inject a set of rules from a rule language naturally as part of its relation representations and enforce them interpretably and with guarantees. Granted, RulE allows for softer rule injection, where a rule can technically fail, whereas BoxE does not. However, RulE in return does not provide any guarantees, supports far less rules, does not study its own inductive capacity despite emphasizing the importance of encoding rules, and proposes a less unified treatment of relation representations that differs between the fact and rule levels. \n\n[1] Ralph Abboud et al. BoxE: A Box Embedding Model for Knowledge Base Completion. NeurIPS 2020.", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "4: All of the claims and statements are well-supported and correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "O4Ims_l4_9d", "reviewer": "Reviewer_E2oH", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "This paper proposes to address the knowledge graph reason where, besides entity and relation representation, first order logic is also considered. In doing so the authors propose to enrich RotatE with a RNN for embedding score and a separate grounding embedding for scores.Two scores are shallowly composed in the inference time. The authors demonstrate the performance of the proposed method with the link prediction tasks\n", "summary_of_the_review": "Based on strengths and weaknesses, I would recommend 5: marginally below the acceptance threshold.", "strength_and_weaknesses": "# Strength\nThe paper tackles an interesting task in knowledge graph embedding .The paper is generally well-written (but with some issues in clarity, see below).\n\n# Weakness\n\nThere are some issues in the current format as detailed below:\n\n1. There are several important aspects missing regarding logic and grounding, which are the core contribution of this work over previous ones. The exact training schema for grounding, including the training objects, are quite unclear in the paper. This makes it hard to judge the contribution of this paper.\n\n2. There are some unclarity on the contribution of each part in the proposed method. The pre-training part, which is largely resembling RNNLogic (Qu et al.,), is pretty loosely composed with the grounding technique (a major contribution in this manuscript) in the inference. I'm afraid this only constitutes a limited contribution. Furthermore, it's not mentioned how $\\beta$, the hyper-parameter to balance two parts, is selected.\n\n3. This is some unclarity regarding the dataset. It's unclear what the distribution of first-order logic looks like (e.g. number of terms). This is important as such statistics would determine whether the proposed use of RNN is justified or there are better alternatives.\n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "0LT4jL455bO", "reviewer": "Reviewer_VpTQ", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "Combines rule-based and embedding-based reasoning methods for link prediction in knowledge graphs. Key idea is to learn an embedding of chain rules via an RNN during KGE training. During inference, combines KGE score of target triple and rule-embedding score of rules that fire on it.", "summary_of_the_review": "Provides improvements over baselines, but does not outperform simpler methods and is far from SOTA (both not cited/discussed).", "strength_and_weaknesses": "Strengths:\n\nS1. Relatively simple approach (but see W1)\n\nS2. Some improvements over baselines (but see W1)\n\nWeaknesses:\n\nW1. Does not outperform simpler methods / falls behind SOTA. The paper, in its essence, combines the score of a KGE model with a score obtained from fired rules. This is done in a more direct fashion in [A], with similar or better results than presented in this paper. Also, the results are from from SOTA [B]. Both papers are not discussed; related work is not covered well.\n\nW2. Approach not well justified. The paper presents its method clearly, but doesn't justify it. Personally, I am not convinced of the approach, perhaps for this reason. One point of concern is that the RNN, which produces the rule embeddings, is trained in a complete data-independent fashion (Eq. 7). Why such an approach would work better than augmenting the training process as done in prior work is unclear to me.\n\nW3. Only chain rules supported.\n\nW4. Study not insightful. The experimental study shows some results, but does not provide any additional insight. Where is it, exactly, that the proposed method can outperform alternatives?\n\nOther points:\n\nD1. The experimental study is silent on where the rules come from.\n\nD2. The weight w_i of Eq. 9 doesn't appear to be a \"confidence\" in that it does not have a probabilistic interpretation.\n\nD3. How is $R^(g)$ trained (Sec. 4.2)? Is it the output of the RNN? Or trained directly?\n\nD4. The main paper describes a method for grounding, pointing to details in the appendix. The appendix describes a completely different method, however. This is highly confusing.\n\nReferences:\n\n[A] Meilicke et al., Why a Naive Way to Combine Symbolic and Latent Knowledge Base Completion Works Surprisingly Well. AKBC 2021\n\n[B] Zhu et al., Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction. NeurIPS 2021\n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}]

Author rebuttal:

Decision: Reject