Hierarchical Relational Learning for Few-Shot Knowledge Graph Completion
Authors: Han Wu
Jie Yin
Bala Rajaratnam
Jianyuan Guo
Venue: ICLR 2023 poster (2023)
Keywords: few-shot learning
knowledge graph completion

Abstract: Knowledge graphs (KGs) are powerful in terms of their inference abilities, but are also notorious for their incompleteness and long-tail distribution of relations. To address these challenges and expand the coverage of KGs, few-shot KG completion aims to make predictions for triplets involving novel relations when only a few training triplets are provided as reference. Previous methods have focused on designing local neighbor aggregators to learn entity-level information and/or imposing sequential dependency assumption at the triplet level to learn meta relation information. However, pairwise triplet-level interactions and context-level relational information have been largely overlooked for learning meta representations of few-shot relations. In this paper, we propose a hierarchical relational learning method (HiRe) for few-shot KG completion. By jointly capturing three levels of relational information (entity-level, triplet-level and context-level), HiRe can effectively learn and refine the meta representation of few-shot relations, and consequently generalize well to new unseen relations. Extensive experiments on two benchmark datasets validate the superiority of HiRe over state-of-the-art methods. The code of HiRe can be found in supplementary material and will be released after acceptance.

Published as a conference paper at ICLR 2023
HIERARCHICAL RELATIONAL LEARNING FOR FEW- SHOT KNOWLEDGE GRAPH COMPLETION
Han Wu', Jie Yin", Bala Rajaratnam & Jianyuan Guo² The University of Sydney, UUniversity of California, Davis (han. wu, jie. yin, bala. wala.rajjratan.. najarat jguc51722 edu.. au
ABSTRACT
Knowledge graphs (KGs) powerful in terms of their inference abilities, but are also notorious for their incompleteness and long-tail distribution of relations. To address these challenges and expand the coverage of KGs, few-shot KG comple- tion aims to make predictions for triplets involving novel relations when only a few training triplets are provided reference. Previous methods have focused designing local neighbor aggregators to learn entity-level information and/or im- posing potentially invalid sequential dependency assumption at the triplet level to learn meta relation information. However, pairwise triplet-level interactions and context-level relational information have been largely overlooked for learning meta representations of few-shot relations. In this paper, we propose hierarchical relational learning method (HiRe) for few-shot KG completion. By jointly cap- turing three levels of relational information (entity- triplet-level and context- level), HiRe can effectively learn and refine meta representations of few-shot rela- tions, and thus generalize well to new unseen relations. Extensive experiments on benchmark datasets validate the superiority of HiRe over state-of-the- methods. The code can be found in https://github.ee wwtph//ww..oo/a..w...//./////.ee www.////ewww///ie......... 15/HiRe.git.
INTRODUCTION
Knowledge graphs (KGs) comprise collection of factual triplets, (h, r)), where each triplet ex- presses the relationship between head entity h and a tail entity t. Large-scale KGs (Vrandečic & Krötzsch, 2014; Mitchell al., 2018; Suchanek et al., 2007; Bollacker et al., 2008) can provide powerful inference capabilities for many intelligent applications, including question answering (Yao Van Durme, 2014), web search (Eder, 2012) and recommendation systems (Wang et al., 2019).
As KGs are often built semi-automatically from unstructured data, real-world KGs are far from com- plete and suffer from the notorious long-tail problem - a considerable proportion of relations are associated with only very few triplets. As a result, the performance of current KG completion meth- ods significantly degrades when predicting relations with a limited number (few-shot) of training triplets. To tackle this challenge, few-shot KG completion methods have been proposed including GMatching (Xiong et al., 2018), MetaM (Chen et al., 2019), FSRL(Zhang et al., 2020), FAAN (Sheng al., 2020) and GANA (Niu al., 2021). These methods focus predicting the missing tail entity t for query triplets by learning from only K. reference triplets about target relation r.
Given a target relation r and IC reference triplets, KC-shot KG completion aims to correctly predict the tail entity & for each query triplet (h, r,?) using the generalizable knowledge learned from refer- ence triplets. Thus, the crucial aspect of few-shot KG completion is to learn the meta representation of each few-shot relation from limited amount of reference triplets that can generalize to novel relations. To facilitate the learning of meta relation representations, we identify three levels of rela- tional information (see Figure 1). (1) At the context level, each reference triplet is closely related to its wider contexts, providing crucial evidence for enriching entity and relation embeddings. the triplet level, capturing the commonality among limited reference triplets is essential for learn- ing meta relation representations. (3) At the entity level, the learned meta relation representations should well generalize unseen query triplets.
(2) At
Current few-shot KG methods have, however, focused on designing local neighbor aggregators to leam entity-level information, and/or imposing sequential assumption at the triplet level to learn meta relation information (See Table 1). The potential of leveraging pairwise triplet-level interac- tions and context-level relational information has been largely unexplored.

---

Published as a conference paper at ICLR 2023
Entity-level Triplet-levl Context-level
Methods
f,
R
Seq.
Pair.
GMatching
x
Contect-lovel relational Information
ft
Entiyyievel relational Information
MetaR
X
x
FSRL
X
FAAN
X
GANA
/
X
R2
Triplet-evel relotional information
fg
HiRe (ours)
f2
context
triplet
(a)
(b)
(c)
Table I:
Summary of few-shot KG comple- tion methods based on different levels of rela- tional information used.
Figure I: Three levels of relational information: (a) Context-level, (b) Triplet-level, (c) Entity-level.
In this paper, we propose a Hierarchical Relational learning framework (HiRe) for few-shot KG completion. HiRe jointly models three levels of relational information (entity-level, triplet-level, and context-level) within each few-shot task as mutually reinforcing sources of information to generalize to few-shot relations. Here, "hierarchical" references relational learning performed at three different levels of granularity. Specifically, we make the following contributions:
We propose a contrastive learning based context-level relational learning method to learn ex- pressive entity/relation embeddings by modeling correlations between the target triplet and its true/false contexts. We argue that a triplet itself has a close relationship with its true context. Thus, we take a contrastive approach- - a given triplet should be pulled close to its true context, but pushed apart from its false contexts - to learn better entity embeddings.
We propose a transformer based meta relation learner (MRL) to learn generalizable meta relation representations. Our proposed MRL is capable of capturing pairwise interactions among reference triplets, while preserving the commutation-invariann property and being insensitive to the size of the reference set.
We devise a meta representation based embedding learner named MTransD that constrains the learned meta relation representations to hold between unseen query triplets, enabling better generalization to novel relations.
Lastly, we adopt a model agnostic meta learning (MAML) based training strategy (Finn et al., 2017) to optimize HiRe on each meta task within unified framework. By performing relational learning at three granular levels, HiRe offers significant advantages for extracting expressive meta relation representations and improving model generalizability for few-shot KG completion. Extensive ex- periments two benchmark datasets validate the superiority of HiRe over state-of-the-art methods.
RELATED WORK
2.1 RELATIONAL LEARNING IN KNOWLEDGE GRAPII
KG completion methods utilize relational information available in KGs to learn a unified low- dimensional embedding space for the input triplets. TransE (Bordes al., 2013) is the first to use relation r as a translation for learning an embedding space, i.e., h + Rs t for triplet (h, r, L). A scoring function then used measure the quality of the translation and learn unified embed- ding space. TransH (Wang et al., 2014) and TransR (Lin et al., 2015) further model relation-specine information for learning an embedding space. ComplEx (Trouillon et al., 2016), RotatE (Sun al., 2019b), and ComplEx-N3 (Lacroix et al., 2018 8) improve the modeling of relation patterns in vec- tor/complex space. ConvE (Dettmers et al., 2018) and ConvKB (Nguyen et al., 2018) employ con- volution operators to enhance entity/relation embedding learning. However, these methods require large number of triplets for each relation to learn a unified embedding space. Their performance sig- nificantly degrades at few-shot settings, where only very few triplets available for each relation.
2.2 FEW-SHIO KG COMPLETION
Existing few-shot KG completion methods can be grouped into two main categories: (1) Metric learning based methods: GMatching (Xiong et al., 2018) the first work to formulate few-shot (one-shot) KG completion. GMatching consists of two parts: neighbor encoder that aggregates one-hop neighbors of any given entity, and a matching processor that compares similarity between query and reference entity pairs. FSRL (Zhang et al., 2020) relaxes the setting to more shots and explores how to integrate the information learned from multiple reference triplets. FAAN (Sheng et al., 2020) proposes dynamic attention mechanism for designing one-hop neighbor aggregators.
2

---

Published as a conference paper at ICLR 2023
(2) Meta learning based methods: MetaR (Chen et al., 2019) learns to transfer relation -eriinn--spiiiice meta information, but it simply generates meta relation representations by averaging the representations of all reference triplets. GANA (Niu ct al., 2021) puts more emphasis on neighboring information and accordingly proposes a gated and attentive neighbor aggregator.
Despite excellent empirical performance, the aforementioned methods suffer from major limi- tations. First, they focus on designing local neighbor aggregators to learn entity-level information. Second, they impose potentially invalid sequential dependency assumption and utilize recurrent processors (i.e. LSTMs (Hochreiter & Schmidhuber, 1996)) to learn meta relation representations. Thus, current methods fail to capture pairwise triplet-level interactions and context-level relational information. Our work is proposed to fill this important research gap in the literature.
2.3 CONTRASTIVE LEARNING ON GRAPHS
As a self-supervised learning scheme, contrastive learning follows the instance discrimination prin- ciple that pairs instances according whether they are derived from the same instance (i.e., positive pairs) or not (i.e., negative pairs) (Hadsell et al., 2006; Dosovitskiy et al., 2014).
Contrastive methods have been recently proposed to learn expressive node embeddings graphs. In general, these methods train graph encoder that produces node embeddings and a discriminator that distinguishes similar node embedding pairs from those dissimilar ones. DGI (Velickovic al., 2019) trains a node encoder to maximize mutual information between patch representations and high-level graph summaries. InfoGraph (Sun et al., 2019a) contrasts a global graph representation with substructure representations. (Hassani & Khasahmadi, 2020) propose to contrast encodings from one-hop neighbors and a graph diffusion. GCC (Qiu et al., 2020) is a pre-training framework that leverages contrastive learning to capture structural properties across multiple networks.
In KGs, we note that positive and negative pairs naturally exist in the few-shot KG completion problem. However, the potential of contrastive learning in this task is under-explored. In our work, we adopt the idea of contrastive learning at the context level to capture correlations between a target triplet and its wider context. This enables enriching the expressiveness of entity embeddings and improving model generalization for few-shot KG completion. To the best of our knowledge, we are the first to integrate contrastive learning with KG embedding learning for few-shot KG completion.
PROBLEM FORMULATION
In this section, we formally define the few-shot KG completion task and problem setting. The notations used in the paper can be found in Appendix A.
Definition 1 Knowledge Graph g. A knowledge graph (KG) can be denoted as g = (E, R, TP). E and R are the entity set and the relation set, respectively. TP {(h, E & x R x E) denotes the set of all triplets in the knowledge graph.
Definition 2 Few-shot KG Completion. Given (i) KG g (E (ii) reference set S, = [(hs, f4) E E x Br, s.t. (h;, r. 14) E TTP} that corresponds to a given relation r E R, where |S,| K., and (iii) a query set C, {(hy, ?) that also corresponds to relation r, the KC-shot KG completion task aims to predict the true tail entity for each triplet from 2, based on the knowledge learned from G and S,. For each query triplet (hy.r, ?) E 2,- given a set of candidates Cia,, for the missing tail entity, the goal is to rank the true tail entity highest among Cr
As the definition states, few-shot KG completion is a relation-specific task. The goal of a few-shot KG completion model is to correctly make predictions for new triplets involving relation when only a few triplets associated with r are available. Therefore, the training process is based on the unit of tasks, where each task is to predict for new triplets associated with given relation r, denoted as T,. Each meta training task T, corresponds to a given relation r and is composed of a reference set S, and a query set 2,,, i.e. T, = (S,, 2r}: S, = {(h2, (h2, t2),.., (hx, tk]].
Q = [(h1,, r), (hr,, (h2.Cig, Ci........ Cis.)))
where M is the size of query set Q,.. Mathematically, the training set can be denoted Tiaain (TH)-- The test set Trest = ) can be similarly denoted. Note that all triplets corresponding to the relations in test set unseen during training, Le., Terain O Trest Ø.
3

---

Published as a conference paper at ICLR 2023
Argertiru's National Team
Argintin'' National Tear
Gormar
Faris Serteernah RC
Sacalora
Iuk Salve
Loodl Moxsl
Senge Agaana
Hardito
Du Salve
Saigl Aggern
Pars
Farelino
Para
Bacabra
Figure 2: Enrity neighborhoods v.s. Triplct context. Our method jointly considers the context of the target triplet to enable the identification of crucial information, highlighted in the right figure.
4 THE PROPOSED METHOD
In this section, we present our proposed learning framework in details. As discussed earlier, identify the research gap in KC-shot KG completion, where learning only entity-lovel relational in- formation and capturing sequential dependencies between reference triplets prevent the model from capturing a more stereoscopic and generalizable representation for the target relation. To fill this gap, we propose perform three hierarchical levels of relational learning within each meta task (context-level, triplet-level and entity-level) for few-shot KG completion. An overview of our pro- posed hierarchical relational learning (HiRe) framework can be found in Appendix C.
4.1 CONTRASTIVE LEARNING BASED CONTEXT-LEVEL RELATIONAL LEARNING
Given a reference set S, with I. training triplets, existing works (e.g. (Xiong et al., 2018; Niu et al., 2021)) seek to learn better head/tail entity embeddings by aggregating information from its respective local neighbors, and then concatenate them as triplet representation. Although treating the neighborhoods of head/tail entity separately is a common practice in homogeneous graphs, we argue that this approach is sub-optimal for few-shot KG completion due to the loss of critical information.
example, jointly considering the wider context shared by head/tail entity would reveal crucial information both "Lionel Messi" and "Sergio Agüero" playFor "Argentina's National Team" for determining whether the relation With holds between the given entity pair ("Lionel Messi", "Sergio Agüero""). Notably, our statistical analysis further affirms that the triplets on KGs indeed share a significant amount of context information (see Appendix B).
Taking Figure 2
Motivated by this important observation, we propose the idea of jointly considering the neighbor- hoods of head/tail entity as the context of a given triplet to exploit more meticulous relational infor- mation. To imbue the embedding of the target triplet with such contextual information, a contrastive loss is employed by contrasting the triplet with its true context against false ones.
Formally. given target triplet (h, t). we denote its wider context as C(hyrat) = Nn U.,, where NA (rr, (h, ti) E TP} and N₁ {(ry,,)) ty) (t, ty) TP). Our goal is to capture context-level relational information
the correlation between the given triplet (h, r, t) and its true context C(.,r.))- We further propose multi-head self-attention (MSA) based context encoder, which models the interactions among the given context C(p,r.)) and assigns larger weights to more impor- tant relation-entity tuples within the context shared by head entity h and tail entity t.
Specifically, given target triplet (h, r, I) and its context C.). each relation-entity tuple (ri; 44) E Cih.r.)) is first encoded as re; = r; @ t. where r, E Rd and t; E R2 are the relation and entity embedding, respectively, and r, indicates the concatenation of two vectors r; and t, An MSA block is then employed to uncover the underlying relationships within the context and generate context embedding c:
Co [ree: re:: re
K (Cn,rs))s
(3)
c
a re;
= MSA(Co),
(4)
where Co is the concatenation of the embeddings of all relation-entity tuples and |o| is the size of set x. The self-attention scores among all relation-entity tuples from C(h,r:t) can be computed by Eq. 4. Tuples with higher correlations would be given larger weights and contribute more towards the embedding of C(..r.)- The detailed implementation of MSA is given in Appendix D.I.
Additionally, we synthesize group of false contexts (Crnn by randomly corrupting the relation or entity of each relation-entity tuple (ri, 4,) C(h.r.)- The embedding of each false context C(
4

---

Published as a conference paper at ICLR 2023
can be learned via the context encoder as c. Then, use contrastive loss to pull close the embedding of the target triplet with its true context and to push away from its false contexts. The contrastive loss function is defined as follows:
exp(sim(h + t, c.T/))
Le = - log
(5)
Ei exp(sim(h t,,,))r)*
where N is the number of false contexts for (h, r, t), denotes the temperature parameter, @ indi- cates the triplet embedding represented as the concatenation of its head and tail entity embeddings, sim(x, y) measures the cosine similarity between x and y. As such, we can inject context-leve knowledge into entity embeddings attending to key elements within the context of the given triplet.
4.2 TRANSFORMER BASED TRIPLET-LEVEL RELATIONAL LEARNING
After obtaining the embeddings of all reference triplets, the next focus is to learn meta representation for the target relation r. offte-of-the-ar models (e.g., FSRL (Zhang et al., 2020) and GANA (Niu al., 2021)) utilize LSTMs for this purpose, which inevitably imposes an unrealistic sequential dependency assumption on reference triplets since LSTMs are designed to model sequence data. However, reference triplets associated with the same relation are not sequentially dependent on each other; the occurrence of one reference triplet does not necessarily lead to other triplets in the reference set. Consequently, these LSTM based models violate two important properties. First, the model should be insensitive to the size of reference set (i.e., few-shot size K.). Second, the triplets in the reference set should be permutation-invarian To address these issues, we resort to modeling complex interactions among reference triplets for learning generalizable meta relational knowledge.
To this end, we propose a transformer based meta relation learner (MRL) that effectively models pairwise interactions among reference triplets to learn meta relation representations that generalize well to new unseen relations. There are two main considerations in our model design. (1) Refer- ence triplets are permutation-invarian given larger weights when learning meta relation representation. Inspired by Set Transformer (Lee et al., 2019), we design our MRL based on the idea of set attention block (SAB), which takes a set of objects as input and performs self-attention mechanism between the elements. Therefore, our proposed MRL can model pairwise triplet-triplet interactions within S, so as to cultivate the ability to learn generalizable meta representation of the target relation.
(2) Reference triplets that are more representative should be
Mathematically, given a meta training task T, targeting at relation r, our proposed MRL takes the head/tail entity pairs from its reference set as input, i.e., {(h,, S. Each reference triplet is encoded as x, = h, @ t,, where h; E IRd and t; E IRd are the embeddings of entity h; and tail entity with dimension d. Note that the same entity embeddings h, and t; are used here in Eq. 5.
For all reference triplets associated with the same relation r, our proposed MRL aims to capture the commonality among these reference triplets and obtain the meta representation for relation r. To comprehensively incorporate triplet-level relational information in the reference set, we leverage an SAB on the embeddings of all reference triplets from S, (see the details of SAB in Appendix D.2):
X = Noo X1; xk],
X; E 2d
0SiSK,
(6)
= SAB(X) E 1x2d
(7)
where x; denotes the i-th reference triplet. The output of SAB has the same size of the input X, but contains pairwise triplet-triplet interactions among triplets, X', are then fed into two-layer MI.P to obtain the meta representation RT.,, given by
X. The transformed embeddings of reference
RT, - E K MLP(X'),
where the meta representation Ry, is generated by averaging the transformed embeddings of all ref- erence triplets. This ensures that Rr, contains the fused pairwise triplet-tripeet interactions among the reference set in permutation-innarian manner.
4.3 META REPRESENTATION BASED ENTITY- LEVVEL RELATIONAL LEARNING
A crucial aspect of few-shot KG completion is to warrant the generalizability of the learned meta representation. The leamed meta representation R,, should hold between (h;, t, if hy and i, are
5

---

Published as a conference paper at ICLR 2023
associated with This motivates us to refine Ry, under the constraints of true/false entity pairs. Translational models provide an intuitive solution by using the relation as a translation, enabling to explicitly model and constrain the learning of generalizable meta knowledge at the entity level. Following KG translational models (Bordes et al., 30 Ji et al., 2015), we design a score function that accounts for the diversity of entities and relations to satisfy such constraints. Our method is referred to as MTransD that effectively captures meta translational relationships at the entity level.
Given a target relation and its corresponding reference set S,,, after obtaining its meta represen- tation RT,, we can now calculate a score for each entity pair (N2, (4) E S, by projecting the em- beddings of head/tail entity into a latent space determined by its corresponding entities and relation simultaneously. Mathematically, the projection process and the score function can be formulated as:
hps rp:h + Inx"h,
(9)
lpi Tpit pi 1ax"t; t;
(10)
score(ht, t,) = Ilpps + RT, - lpill2.
(11)
where ||x||2 represents the l2 norm of vector x, h,/t, are the head/tail entity embeddings, hps/tpi are their corresponding projection vectors. Tpi is the projection vector of Ry,,, and mm=x is an identity matrix (Ji et al., 2015). In this way. the projection matrices of each head/tail entity are determined by both the entity itself and its associated relation. As result, the projected tail entity embedding should be closest to the projected head entity embedding after being translated by RT, That is to say, for these triplets associated with relation the corresponding meta representation Rr, should hold between has and lpi at the entity level in the projection space. Considering the entire reference set, we can further define loss function as follows:
((S.)) E E(h,,AeEs max(0, score (4) + - score(hu, ()),
(12)
where y is a hyper-pannee Spper-parameter that determines the margin to separate positive pairs from negative pairs. score(h;; f,) calculates the score of a negative pair (h,, (2) which results from negative sam- pling of the positive pair (hg, t4) S,, i.e. (he, r, t & G. Till now, we have obtained meta relation representation Ry, for each sew-shot relation r, along with a loss function on the reference set.
4.4 MAML BASED TRAINING STRATEGY
Noting that (S,,) in Eq. 12 is task-specific and should be minimized on the target task T,, we adopt a MAML based training strategy (Finn et al., 2017) to optimize the parameters on each task T,. The obtained loss on reference set L(S,) is not used to train the whole model but to update intermediate parameters. Please refer to Appendix E for the detailed training scheme of MAML. Specifically, the learned meta representation R,, can be further refined based on the gradient of C(S,):
R7. RT. 1, V RT, ((S,),
(13)
where I, indicates the learning rate. Furthermore, for each target relation T,, the projection vectors hps pp and tpi can also be optimized in the same manner of MAML so that the model can generalize and adapt to new target relation. Following MAMI., the projection vectors are updated as follows:
h' hpi - 1, 1h L(S,),
(14)
r' Ppi L F. C(S,).
(15)
tyx tpi 4, Vt, L(S.).
(16)
With the updated parameters, we can project and score each entity pair (hy, from the query set O following the same scheme reference set and obtain the entity-level loss function L(Q.):
hpj = r "h; + 1mx"h,, h,
(17)
tnj t It + 1
(18)
score h t2) =1 hps + Rly.- tps l12.
(19)
((2)==
-
Q,) max (0, score(hi, (4) +
- sccre(h(h) 4)},
(20)
where (hy. t)) is also negative triplet generated in the same way as (h,, +). The optimization objective for training the whole model is to minimize L(Q.) and L. together, given by:
L C(2,) + XC.,
(21)
where À is a trade-off hyper-parameter that balances the contributions of ((2.) and La.

---

Published as a conference paper at ICLR 2023
5 EXPERIMENTS
5.1 DATASETS AND EVALUATION METRICS
We conduct experiments two widely used few-shot KG completion datasets, Nell-One and Wiki-One, which are constructed by (Xiong et al., 2018), For fair comparison, we follow the ex- perimental setup of GMatching (Xiong et al., 2018), where relations associated with more than 50 but less than 500 triplets are chosen for few-shot completion tasks. For each target rela- tion, the candidate entity set provided by GMatching is used. The statistics of both datasets are provided in Table 2. We use 51/5/11 and 133/16/34 tasks for training/vaiddaiionnestigg on Nell-One and Wiki-One, respectively, following the common setting in the literature. We report both MRR (mean reciprocal rank) and Hits@n (n 1,5, 10) on both datasets for the evaluation of per- formance. MRR is the mean reciprocal rank of the correct entities, and Hits @n the ratio of correct entities that rank in top We compare the proposed method against other bascline methods in 1-shot and 5-shot settings, which are the most common settings in the literature.
Table 2: Statistics of datasets.
Dataset Nell-One Wiki-One
# Relations
Entities
# Trriplets
# Tasks
358
68,545 4,838,244
181,109
67 183
822
5,859,240
5.2 BASELINES
For evaluation, we compare our proposed method against two groups of state-of-the-art baselines: Conventional KG completion methods: TransE (Bordes et al., 2013), TransH (Wang et al., 2014), DistMult (Yang et al., 2015), ComplEx (Trouillon et al., 2016) and ComplEx-N3 (Lacroix et al,, 2018). We use OpenKE (Han et al., 2018) to reproduce the results of these models with hyper- parameters reported in the original papers. The models are trained using all triplets from background relations (Xiong et al., 2018) and training relations, as well as relations from all reference sets.
State-of-the-art few-shot KG completion methods: GMatching (Xiong et al., 2018), MetaR (Chen et al., 2019), FAAN (Sheng et al., 2020) and FSRL (Zhang et al., 2020). For MetaR (both In- Train and Pre-Train) and FAAN, we directly report results obtained from the original papers. For GMatching, we report the results provided by (Chen et al., 2019) for both 1-shot and 5-shot. As FSRL was initially reported in different settings, where the candidate set is much smaller, we report the results re-implemented by (Sheng et al., 2020) under the same setting with other methods. Due to the fact that the reproduced results of GANA (Niu et al., 2021) is less competitive, we leave GANA out in our comparison. All reported results are produced based the same experimental setting.
5.3 EXPERIMENTAL SETUP
For fair comparison, we use the entity and relation embeddings pretrained by TransH (Bordes et al., 2013) on both datasets, released by GMatching (Xiong et al., 2018), for the initialization of our proposed HiRe. Following the literature, the embedding dimension is set to 100 and 50 for Nell- One and Wiki-One, respectively. On both datasets, we set the number of SAB to I and each SAB contains self-attention head. We apply drop path to avoid overfitting with drop rate of 0.2. The maximum number of neighbors for a given entity is set to 50, the same as in prior works. For all experiments except for the sensitivity test on the trade-off parameter À in Eq. 21, À is set 0.05 and the number of false contexts for each reference triplet is set to 1. The margin 7 in Eq. 12 is set 1. We apply mini-batch gradient descent train the model with a batch size of 1, 020 for both datasets. Adam optimizer is used with learning rate of 0.001. We evaluate HiRe on validation set every 1, 000 steps and choose the best model within 30, 000 steps based on MRR. All models are implemented by Py'oorc and trained on 1 Tesla P100 GPU.
5.4 COMPARISON WITH THAT--OF-THE-ARE METHODS
Table compares HiRe against baselines on Nell-One and Wiki-One under 1-shot and 5-shot set- tings. In general, conventional KG completion methods are inferior to few-shot KG completion methods, especially udner 1-shot setting. This is expected because conventional KG completion methods designed for scenarios with sufficient training data. Overall, our HiRe method out- performs all baseline methods under two settings on both datasets, which validates its efficacy for few-shot KG completion. Especially, the number of reference triplets increases, HiRe achieves
7

---

Published as a conference paper at ICLR 2023
Table 3: Comparison against state-of-the-art methods on Nell-One and Wiki-One. MetaR-I and MetaR-P indicate the In-train and Pre-train of MetaR (Chen et al., 2019), respectively. OOM indicates out of memory.
Nell-One
Wiki-One
Methods
MRR
10
Hisces
Hits@
MRR
10
Hirees
Hits@
I-shot
5.chol]
I-shot
5-shot
I-shot
5-sho|
I-shot
5-shot
1-shot
5.shoi
I-shot
5-shot
I-shot
5-shor
I-shot
5-shot
TrandE
0.105
0.168
0.226
0.345
0.111
0.186
0.041
0.082
0.036
0.052
0.059
0.090
0.024
0.057
0.011
0.042
TransH
0.168
0.279
0.233
0.434
0.160
0.317
0.127
0.162
0.068
0.095
0.133
0.177
0.060
0.092
0.027
0.047
DistMalt
0.165
0.214
0.285
0.319
0.174
0.246
0.106
0.140
0.046
0.077
0.087
0.134
0.034
0.078
0.014
0.035
ComplEx
0.179
0.239
0.299
0.364
0.212
0,253
0.112
0.176
0.055
0,070
0.100
0.124
0.044
0,063
0,021
0.030
ComplEx-N3
0.335
0.475
0.140
0.205
00M
00M
0OM
00M
00M
0OM
GMatching
0.313
0.311
0.119
0.143
0.200
0.336
0.120
Meta-11
0.250
0.261
0.401
0.437
0.336
0,350
0.170
0.168
0.193
0.221
0.280
0.302
0.233
0.264
0.152
0.178
MetaR-P
0.209
0.331
0.355
0.280
0.093
0.141
0.404
0.418
0.385
0.266
0.270
FSRL
0.184
0.272
0.234
0.136
0.158
0.287
0.206
0.097
FAAN
0.279
0.428
0.364
0.200
0.341
0.436
0.395
0.281
HiRe
0.288
0.306
0.472
0.520
0.403
0.439
0.184
0.207
0.322
0.371
0.433
0.469
0.383
0.419
0.271
0.319
Table 4: Ablation study of our proposed HiRe under 3-shot and 5-shot settings on Wiki-One.
Components
3-shot
5-shot
Ablation on 4
MTransD MRI. Context
MRR
Hits@ 10
@
Hits@1
MRR
Hits@ 10
Hits@ @its@ 1
HiRe
/
0.355
0.467
0.412
0.298
|0.371
0.469
0.419
0.319
w/o MTrrnsD-MTranee
/
0.340
0.433
0.391
0.288
0.342
0.454
0.408
0.289
w/o MTransD-MTram
x
/
0.342
0.456
0.415
0.272
0.347
0.457
0.411
0.281
w/o MAML
X
/
<
0.255
0.375
0.331
0.190
0.286
0.388
0.334
0.238
w/o MRI-AVG
X
0.315
0.430
0.365
0.255
0.317
0.433
0.371
0.258
w/o MRI-LSTM
x
0.314
0.409
0.354
0.266
0.320
0.436
0.385
0.261
w/o Context
V 0.334
0.449
0.402
0.263
0.335
0.470
0.409
0.279
larger performance gains because our transformer based MRL can capture more complex triplet- level interactions. This further reinforces HiRe's multi-level relational learning process in return.
As for performance gains in terms of MRR, Hits@ 10, Hits@5, and Hits@ 1, HiRe surpasses the sec- ond best performer by +3.8%, +7.1%, +6.7%, and +1.4% in 1-shot setting, and by +2.7%, +8.3%, +7.5% and +0.7% in 5-shot setting on Nell-One. For performance gains on Wiki-One, HiRe out- performs the second best method by +0.8%, +2.9%, +0.8%, and +0.5% in 1-shot setting, and by +3.0%, +3.3%, +2.4%, and +3.8% in 5-shot setting. HiRe achieves large performance improve- ments in terms of all metrics, proving that leveraging hierarchical relational information enhances the model's generalizability and leads to an overall improvement in performance.
5.5 ABLATION STUDY
Our proposed HiRe framework is composed of three key components. To investigate the contribu- tions of each component to the overall performance, we conduct thorough ablation study on both datasets under 3-shot and 5-ohot settings. The detailed results on Wiki-One are reported in Table 4.
w/o MTransD-MTTransE and w/o MTTranD--TTransHt To study the effectiveness of MTransDD, we substitute MTranss with TransE and TransH respectively, retaining the MAMI based training strategy. Substituting MTransD leads to performance drops at a significant level under both set- tings, indicating the necessity of constraining entity and relation embeddings while simultancously considering the diversity of entities and relations.
w/o MAML: To demonstrate the efficacy of MAML based training strategy, we remove MAML based training strategy from MTransD and replace with TransD. In this ablated variant, TransD is applied on the query set after the meta relation representation is learned from the reference set. The significant performance drop suggests that MAML based training strategy is essential for the model to learn generalizable meta knowledge for predicting unseen relations in few-shot settings. This conclusion has also been affirmed by the ablation study in MetaR (Chen et al., 2019).
w/o MRL-AVG: To study the impact of transformer based MRL, we replace MRL by simply av- eraging the embeddings of all reference triplets to generate meta relation representations. This has a profoundly negative effect, resulting in a performance drop of 4% in terms of MRR under 3-shot setting and 5.4% under 5-shot setting. The performance under 3-shot and 5-shot settings are similar, indicating that simplistic averaging fails to take advantage of more training triplets. This validates the importance of MRL to capture triplet-level interactions in learning meta relation representations.
w/o MRL-LSTM: To further validate the advantages of leveraging pairwise relational information over sequential information, we replace transformer based MRL with an LSTM to generate meta
8

---

Published as a conference paper at ICLR 2023
Impoect of MRR (W Ki-Onel
Impact
N on Hite10 IW On-el
Imppact of on Hinp (W Onni-Onel
Impact of Hhahl IWM
Wing
Ri-2
Min
Bind
30-
27
25-
1-shot
3-shot
Sishet
1ihht
3-shet
S-shet
1-hhet
3-shat
S-shot
L-shot
3-shot
5-shot
Figure 3: Hyper-parameter scnsitivity study with respect the number of false contexts N on Wiki-One.
MRR (WIM Wwi)-One)
HIGG10 (Wik)-One)
Inpost of 10M85 (Wisd-On One))
Impact Hh661 (WildiOno)
27
32-
31
42
60
33
34
23
25
32
27
31
37
23
142
G:tket
1-2be
3:4
3-dbo
-8h
3-2be
5-4
1-2.42
5-1ae
0.22
0.25
0.2
0.5
0.01
0.00
0.1
0.5
36-
500
602
0.1
0.51
0.55
0.2
55
Figure 4: The impact of different À values Eq. 21 on Wiki-One. 0 means that we remove the contrastive learning based context-level relational learning.
relation representations. The resultant performance drop is significant; the MRR drops by 4.3% and 5.1% respectively under 3-shot and 5-shot settings. Although the use of LSTM brings some improvements over simplistic averaging through capturing triplet-level relational information, the imposed unrealistic sequential dependency assumption results in limited performance gains. This demonstrates the necessity and superiority of our proposed transformer based MRL in capturing pairwise triplet-level relational information to learn meta representations of few-shot relations.
w/o Context: By ablating C. from Eq. 21, we remove contrastive learning based context- level rela- tional learning but retain triplet-level and entity-level relational information. As compared to jointly considering the context of the target triplet, the resultant performance drop verifies our assumption that the semantic contextual information plays crucial role in few-shot KG completion.
Similar conclusions can also drawn from the ablation results on Nell-One (See Appendix F).
5.6 HYPER-PARAMERT SENTITIVITY
We conduct two sensitivity tests for the number of false contexts N and the trade-off parameter À in Eq. 21 on both datasets under 1/3/5-shot settings. See Appendix G for detailed results on Nell-One.
For hyper-yppaeeee parameter N, we set N 1, 2. 4, and 6. As Figure 3 shows, HiRe performs the best when N = on all settings, and its performance slightly drops when = 2. As continues to increase, the performance of HiRe drops accordingly. One main reason is that, many false contexts would dominate model training, causing the model to quickly converge to a sub-optimal state.
For hyper-parameeee X, since the value of contrastive loss is significantly larger than that of the margin loss, À should be small to ensure effective supervision from the margin loss. Thus, we study the impact of different values of between 0 and 0.5. As Figure 4 shows, HiRe achieves the best performance when À 0.05. With the contrastive loss (i.e., À > 0), HiRe consistently yields better performance, proving the efficacy of our contrastive learning based context-leved relational learning.
6 CONCLUSION
This paper presents hierarchical relational learning framework (HiRe) for few-shot KG comple- tion. We investigate the limitations of current few-shot KG completion methods and identify that jointly capturing three levels of relational information is crucial for enriching entity and relation embeddings, which ultimately leads to better meta representation learning for the target relation and model generalizability. Experimental results on two commonly used benchmark datasets show that HiRe consistently outperforms current ofte--of-the-ate methods, demonstrating its superiority and efficacy for few-shot KG completion. The ablation analysis and papper- sensitivity study verify the significance of the key components of HiRe.

---

Published as a conference paper at ICLR 2023
REFERENCES
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv: 1607. 060700 2016. 14
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collabo- ratively created graph database for structuring human knowledge. In SIGMOD, pp. 1247-1250, 2008.
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NIPS, pp. 2787-2795, 2013. 2, 6,
Mingyang Chen, Wen Zhang, Wei Zhang, Qiang Chen, and Huajun Chen. Meta relational learning for few-shot link prediction in knowledge graphs. In EMNLP-IJCNIPP, pp. 4217-4226, 2019. 1, 3. 8
Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2d knowledge graph embeddings. In AAAI, volume 32, pp. 1811-1818, 2018.
Alexey Dosovitskiy, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with convolutional neural networks. In NIPS, volume 27, pp. 766- 774, 2014.3 3
Jeffrey Scott Eder. Knowledge graph based search system, June 21 2012. US Patent App- 13/404,109,
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, pp. 1126- 1135, 2017. 2,
Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, volume 2, pp. 1735-1742, 2006. 3
Xu Han, Shulin Cao, Xin Lv, Yankai Lin, Zhiyuan Liu, Maosong Sun, and Juanzi Li. Openke: An open toolkit for knowledge embedding. In EMNLP, pp. 139-144, 2018. 7
Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive multi-view representation learning graphs. ICMI, pp. 41 411644 2020. 3
Sepp Hochreiter and Jürgen Schmidhuber. LSTM can solve hard long time lag problems. In NIPS, volume 9, pp. 473-479 1996. 3
Guoliang Ji, Shizhu He, Liheng Xu, Kang Liu, and Jun Zhao. Knowledge graph embedding via dynamic mapping matrix. In ACL., pp. 687-696, 2015.
Timothée Lacroix. Nicolas Usunier, and Guillaume Obozinski. Canonical tensor decomposition for knowledge base completion. In ICML, pp. 2863-2872, 2018. 2, 7
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation sermutation-nvvariant neural networks. ICML, pp. 17444-775. 2019. 5, 14
Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In AAAI, volume 29, pp. 2181-2187 2015.
T. Mitchell, W. Cohen, E. Hruschka. P. Talukdar, B. Yang, J. Betteridge, A. Carlson, B. Dalvi, M. Gardner, B. Kisiel, Krishnamurthy. N. Lao, K. Mazaitis, T. Mohamed, N. Nakashole, E. Pla- tanios, A. Ritter, M. Samadi, B. Settles, R. Wang, D. Wijaya, A. Gupta, X. Chen, A. Saparov, M. Greaves, and J. Welling. Never-ending learning. Communications the ACM, 6155::003-115, Apr 2018. ISSN 0001-0782.
Tu Dinh Nguyen, Dat Quoc Nguyen, Dinh Phung, et al. A novel embedding model for knowledge base completion based convolutional neural network. In NAACI-HILT, pp. 327-333, 2018. 2
10

---

Published as a conference paper at ICLR 2023
Guanglin Niu, Yang Li, Chengguang Tang. Ruiying Geng, Jian Dai, Qiao Liu, Hao Wang, Jian Sun, Fei Huang, and Luo Si. Relational learning with gated and attentive neighbor aggregator for few-shot knowledge graph completion. In SIGIR, pp. 213-222, 2021. 1, 5,
Jiezhong Qiu, Qibin Chen, Yuxiao Dong, Jing Zhang, Hongxia Yang, Ming Ding, Kuansan Wang, and Jie Tang. Gce: Graph contrastive coding for graph neural network pre-training. In SIGKDD, pp. 1150-1160, 2020. 3
Jiawei Sheng, Shu Guo, Zhenyu Chen, Juwei Yue, Lihong Wang. Tingwen Liu, and Hongbo Xu. Adaptive attentional network for few-shot knowledge graph completion. In EMNLP, pp. 1681- 1691, 2020. 1, 2,
Fabian M Suchanek, Gjergji Kasneci, and Gerhard Weikum. Yago: a core of semantic knowledge. In wwW, pp. 697-706, 2007.
Fan-Yur Yun Sun, Jordan Hoffman, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi- supervised graph-level representation learning via mutual information maximization. In ICLR, 2019a. 3
Zhiqing Sun, Zhi-Hong Deng, Jian-Yur Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. In ICLR, 2019b.
Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Com- plex embeddings for simple link prediction. In ICML, pp. 2071-20800 2016. 2,
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, łukasz Kaiser, and Illia Polosukhin. Attention all you need. NewrlPS, 30, 2017. 13, 14
Petar Velickovic, William Fedus, William L Hamilton, Pietro Liò, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. volume 2, pp. 2019.
Denny Vrandečić and Markus Krötzsch. Wikidata: a free collaborative knowledgebase. Communi- cations of the ACM, 57(10):78 2014.
Hongwei Wang, Fuzheng Zhang. Mengdi Zhang, Jure Leskovec, Miao Zhao, Wenjie Li, and Zhongyuan Wang. Knowledge-aware graph neural networks with label smoothness regulariza- tion for recommender systems. In SIGKDD, pp. 968-977, 2019.
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by trans- lating on hyperplanes. In AAAI, volume 28, pp. 1112-1119, 2014. 2,7
Wenhan Xiong, Mo Yu, Shiyu Chang, Xiaoxiao Guo, and William Yang Wang. One-shot relational learning for knowledge graphs. In EMNLP, pp. 1980-1990, 2018. 1, 4,
Bishan Yang. Scott Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. In ICLR, 2015. 7
Xuchen Yao and Benjamin Van Durme. Information extraction over structured data: Question an- swering with freebase. In ACL, pp. 956-966, 2014.
Chuxu Zhang, Huaxiu Yao, Chao Huang, Meng Jiang, Zhenhui Li, and Nitesh V Chawla. Few-shot knowledge graph completion. AAAI, volume 34, pp. 3041-3048, 2020. 1, 2, 5,
11

---

Published as a conference paper at ICLR 2023
APPENDIX
A NOTATIONS
The notations and symbols used in this paper are summarized in Table 5.
Table Notations and Symbols.
Symbol E, R. TP h, t
Description
knowledge graph
entity, relation and triplet sets of a knowledge graph head entity, tail entity relation
(h, r,)
factual triplet embeddings of h, and few-shot task corresponding to relation reference set corresponding to relation r query set corresponding to relation r candidate set for the potential tail entity of (hj, r, ?) set of neighboring relation-entity tuples of entity e context of triplet (h,r,, M,,r,4
h,r, r,t
Tr
S,
Charrr) Ne
C(h..))
B MOTIVATION: SHARED CONTEXT STATISTICS
One of our key motivations is that jointly considering the wider context shared by head/tail entity would reveal crucial information for learning expressive entity embeddings. To justify our mo- tivation, we perform statistical analysis on Nell-One and Wiki-One dataset and the results are summarized in Table 6.
Overall, out of the 189,635 triplets in Nell-One dataset, to 39,234 triplets share entities in their contexts. That means, there exists least one entity that is connected to both the head entity and the tail entity of the given triplet. These 39,234 triplets share 1 117,366 entities in all, making each triplet have almost three shared entities by average. Triplets that share entities in their contexts constitute more than 20.68% and 9.2% of the total triplets, respectively. More strictly, the triplets that share relation-entity tuples their contexts (i.e., meaning that the head and tail entity are connected to the same entity by the same relation in the context) constitute 13.77% on Nell-One and 4.6% Wiki-One, respectively.
Our analysis affirms that the triplets KGs indeed share significant amount of context informa- tion. Our method thus designed to leverage such crucial information for learning more expressive entity embeddings.
# Tr.
Tr. w/ shared Ent. # shared Ent.
Nell-One 189,635 WiKi-One 61,498
39,234 5,665
117,368 7,753
e T1
# Tr.
Tr. w/ shared Tup. shared Tup.
Nell-One 189,635
26,
105, 113.
h
h
t
WiKi-One 61,498
2,843
3,817
w/ shared entity (e;) w/ shared tuple (r,, eq)
(b) Top: triplets (Tr.) that share entities (Ent.) their contexts; Bottom: triplets (Tr.) that share (relation, entity) tuples (Tup.).
(a) Left: triplets that share entity ex: Right: triplets that share relation-entity tuple (ri.et).
Table 6: Statistical results on Nell-One and WiKi-One. We show the number of triplcts that share entities or relation-entity tuples in their contexts. "Shared tuples" means that the head entity and tail entity are connected the entity by the same relation in the context, and "shared entities" means that the head entity and tail entity are connected to the same entity by any relation, illustrated the left figure. Numbers are calculated on the training set.
12

---

Published as a conference paper at ICLR 2023
C OVERVIEW OF THE PROPOSED HIRE FRAMEWORK
Figure shows an overview of our proposed hierarchical relational learning (HiRe) framework.
MAML-based Training Strategy
Context level Inaaiionn leaning
Trensformer-
MTTranDD
-
(5,)
Oontrr kee fouten and
gradient
Rg.
Va, (8,))
X' = Rr, Veg,((s)) ((S.)
corlve
MTransD (updated]
False Context
Trnsformes based MRL
MiTrance
(S,))
Rey
Sy
entity
relation
entity within context
corrupted entity
corrupted relation
feature embedding
Figure 5: An overview of HiRe framework composed of three key components. (1) Contrastive
learning based context-level relational learning; (2) Transformer based triplet-level relational learn- ing; (3) Meta representation based entity-level relational learning. Given target relation and its corresponding reference set S, and query set 2,., we employ contrastive loss Le between the true/false contexts and the anchor triplct (take (f1,r, as example) via our proposed contrastive learning based context-level relational learning method. The meta representation of the target re- lation Ry, is learned by our Transformer based meta relation learner (MRL), capturing pairwise triplet-level relational information. Lastly, MTransD refines the learned meta relation representation the entity level constrained by ((S.). The whole learning framework is optimized by MAML based training strategy.
D DETAILS: MULTI-HEAD SELF-ATTENTION AND SET ATTENTION BLOCK
D.1 DETAILS OF MULTI-HEAY SELF ATTENTION
For context-level relational learning, we employ a Multi-Head Self-Attention (MSA) block (Vaswani al., 2017) to uncover the underlying relationships within the context C(r,n.) of given triplet rh, and generate the context embedding
Specifically, take a context that contains k relation-entity tuples as an example, the context embed- ding is initialized as kxd. (dg 100 and de 200 for WiKi-One and Nell-One, respectively). This input is first transformed into three different matrices: the query matrix Q E &xx, the key matrix K &xd, and the value matrix V kxd, with dimension d,=d;=d,=dd Subsequently, the attention function is calculated as follows:
Step 1:
Compute the scores between different input matrices as S = Q KT;
Step 2:
Normalize the scores for the stability of gradient as S,, S//
Step 3:
Translate the scores into probabilities with softmax function A softmax(S.))
Step 4:
Obtain the weighted value matrix A-
The above process can be unified into single function:
Attention( Q K. V) softmax Q.K K
V.
(22)
dd
The logic behind Eq. 22 is straightforward. Step 1 computes relation-entity tuples from the context. Step 2 normalizes the scores to enhance gradient stability for improved training, and Step 3 translates the scores into probabilities. Finally, each relation-entity
between each pair of different
13

---

Published as a conference paper at ICLR 2023
tuple is updated by the weighted sum based on the probabilities. Overall, Eq. 3 and Eq. 4 in the main paper can be re-formulated as:
Q.K K vdz
Attention(eo) Attention QQ A V..V softmax
V,
(23)
where [4i 02g ox). Instead of performing single attention function with de-dimensional queries, keys and values, it would be beneficial to linearly project the queries, keys and values h times with different linear projections (called "multi-head") (Vaswani al., 2017). On each of these
projected versions of queries, keys and values, the attention function is executed in parallel.
MultiHead (Q, K, V) Concat(headı, ..... h..d,))))))))))) Wo:
(24)
where head; Attention QW? KW. VW!),
(25)
where the projections are parameter matrices w E Rddd, W Rddd, wy E Raxdi and W Rhi, In each paralleled attention layer, d₃ = d. = d/h.
D.2 DETAILS SET ATTENTION BLOCK
To comprehensively incorporate triplet-level relational information in the reference set Sr, we design a transformer based MRL using a set attention block (SAB) (Lee et al., 2019) to model interactions among all reference triplcts in S,..
SAB built upon multi-head attention, defined as:
SAB(X) == LayerNorm +FF(H))
(26)
where H = LayerNorm( X + MultiHead(X, X, X)), rFF is any row-wise feedforward layer and LayerNorm is layer normalization (Ba al., 2016).
E MAML BASED TRAINING STRATEGY
The detailed MAML based training framework can be described as follows:
Algorithm 1: MAML based training framework of HiRe.
Input: Tirain: Training tasks
Gs: Background graph
while not converged do
Sample task T, (S,, 2 from Traani
Construct context C(h,r.t) for each reference triplet (h, r,,)) in S, based on Go:
Encode C(h.r.t) and produce context embedding by Eq. 3-Eq.
Learn context-level relational information based on contrastive learning by Eq. 5;
Learn triplet-level meta representation for relation via transformer based MRL by Eq. 6-Eq. 8:
Learn entity-level relational information via MTransD by Eq. 9-Eq. 11;
Calculate the loss on reference L(S,) by Eq. 12:
Update the parameters based on L(S,) by Eq. 13-Eq. 16;
10
Calculate the loss on query set ((2,) by Eq. 17-Eq. 20;
Update the model parameters based on the overall loss function Eq. 21
ABLATION STUDY ON NELL--NE
As discussed Section 5.5, each component in our proposed HiRe framework plays an important role in few-shot KG completion. Here, we provide further ablation results Nell-One in Table 7. These results support our findings reported in the main paper and confirm that the removal any component leads to performance drops in terms of all evaluation metrics.
14

---

Published as a conference paper at ICLR 2023
Table Ablation study of HiRe under 3-shot and 5-shot settings on Nell-One.
Components
3-shot
S-shot
Ablation on
MTransD MRL Context
MRR
Hits @ 10
Hits@s
Hits@1 I
MRR
Hits@ 10
Hits@
Hits@!
HiRe w/o MTransD-MTI B w/o TTTranD--TTrann w/o MAMI.
V
0.300
0.499
0.425
0.199
0.306
0.520
0.439
0.207
/
0.295
0.491
0.420
0.193
0.302
0.515
0.428
0.202
/
0.293
0.494
0.418
0.191
0,303
0.513
0,430
0.203
/
0.177
0.305
0.251
0.105
0.198
0.334
0.271
0.123
w/o MRL-AVG
0.282
0.467
0.382
0.185
0,286
0.466
0.394
0.188
w/o MRL-LSTM
0.280
0.490
0,410
0.168
0.285
0.459
0.390
0.185
w/o Context
0.290
0.482
0,401
0.186
0.295
0.489
0.418
0.197
G HYPER-PARAMETE SENSITIVITY STUDY ON NELL-ONE
Figure 6 and Figure 7 report further sensitivity test results on Nell-One for the number of false contexts N and the trade-off parameter X. As shown in Figure 6, as the number of false contexts increases, the performance of HiRe drops slightly because its model training would converge to sub-optimal state. Moreover, the best X value also 0.05 on Nell-One, as shown in Figure 7. The overall findings are consistent with those draw from the results on Wiki- One in Section 5.6.
Oni)
Impact Hiss MNel--Onet
Impact
(NeliOOnel
Hhip]
27
12
37-
3-shot
3-shot
5-shot
1-shot
3-shot
5-shot
1-5hot
3-shot
5-shot
1-thot
3-shot
5-shot
Figure 6: Hyper-parameter sensitivity study with respect the number false contexts on Nell-One.
Import of on Milk (Nel)-One)
Imppcct of A mn Higg (Nell-DDw))
Impurt of on Higg (Nell-One)
Impect of on Hugel (Nell-Dne))
23
42
41
13
17
45-
30
Figure 7: The impact of different À values in Eq. 21 on Nell-One. = 0 means that we remove the contrastive learning based context-level relational learning.
H COMPLEXITY ANALYSIS
Table 8 lists the complexity of all the hierarchical relational learn- ing modules, where denotes the dimension of entity embed- dings, h denotes the number of relation-entity tuples in the con- text, and denotes the number of reference triplets in each task. As can be seen, our proposed HiRe quadratically scales with the number of reference triplets in each task. Nevertheless, given the number of reference triplets is often very small (i.e., 1, 3, 5), our proposed HiRe framework scales reasonably well.
Table 8: Complexity analysis of three hicrarchical relational lcarning modules with respect to the number of parameters and the number of multiplication operations in each epach.
Parameters
# Operations
Context level Triplet level
(nhd nk?) O(nd n²) (dd)
Onkkd + nkkdd) Ond + n²d) ((d)
Entity level
Total
Onkk + nd? + n²)
(nked + n d n²d)
15


Reviews:
[{"review_id": "njBG88-OAz", "reviewer": "Reviewer_Pexb", "summary": "", "questions": "", "limitations": "", "rating": 6, "confidence": 3, "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 novel methods for few-shot KG completion. They identify two issues with existing methods for this task -- (a) They learn entity-level information from local nbr aggregators. (the paper jointly takes into account the nbr of head and tail entity for triple context) (b) They learn relation-level information using a sequential model (while the sequentiality assumption is invalid -- the paper use transformers instead). The authors proposed HiRe, which takes into account triplet-level interactions, context-level interactions, and entity-level information for query (h,r,?). MAML based training strategy used to train the model. The model shows improved performance on 2 benchmark datasets - Nell-One and Wiki-One. The ablation study demonstrates the importance of the key components of the model, where transformer-based MRL outshined.", "summary_of_the_review": "I feel the paper has interesting contribution but I believe the quality of paper writing needs to be improved.", "strength_and_weaknesses": "The paper address an important problem in KBC. It identifies valid issues in existing methods. However:\n1. Paper writing can be improved. Certain sections are hard to understand (especially sections 4.2/4.3/4.4). Since these sections form the core of the paper it is imperative to write them very clearly. \nAdding details of MAML training startegy, MSA and SAB in appendix should be helpful.\n2. \\bigoplus used before definition\n3. Some comments on the scalability of the model will be insightful.\n4. Why did the authors not look at (?, r, t_j) queries along with (h_j, r, ?) and report the mean (the standard way of evaluation in KBC).\n5. Definition 2: Consider adding an \\exist r.\n6. Some understanding of how the models perform on conventional KG completion datasets (where relations are associated with many more triples) is also important.\n7. Authors should use a more competitive version of ComplEx (ComplEx-N3) for comparison. (See Lacroix, Timothée, Nicolas Usunier, and Guillaume Obozinski. \"Canonical tensor decomposition for knowledge base completion.\" International Conference on Machine Learning. PMLR, 2018.)\nAlso why did the authors choose a translation model (sec 4.3) in place of more competitive KBC models like ComplEx?", "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": "Ue83y3aTZ0v", "reviewer": "Reviewer_HQvj", "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 a hierarchical relational learning framework for few-shot KG completion. The authors proposes jointly capturing three levels of relational information for enriching entity and relation embeddings, i.e., entity-level, triplet-level and context-level. Experiments on two benchmark datasets demonstrate the effectiveness of the proposed model.", "summary_of_the_review": "This paper studied an interesting problem in KG representation learning. The paper is basically well-written and the experimental results are promising. However, the technical novelty is limited, and some of the technical details are not clearly presented. Overall, I think this paper is marginally below the acceptance threshold of ICLR.", "strength_and_weaknesses": "Strength:\n\n1. The idea of using multiple different levels of information for relational learning on KGs is interesting;\n\n2. The paper is well-written and the technical details are basically presented clearly;\n\n3. The experimental results demonstrate significant improvements over baseline methods.\n\nWeaknesses:\n\n1. The novelty of this work is limited;\n\n2. The term \"hierarchical\" in the title is confusing;\n\n3. Some of the technical details are not clearly presented;\n\nSee below for details of weaknesses.", "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": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "TkMmnUv68jI", "reviewer": "Reviewer_8oAh", "summary": "", "questions": "", "limitations": "", "rating": 5, "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 studies the few-shot KG completion problem and proposes a hierarchical relation learning method for this task. The authors propose three levels of relational information to learn and refine the meta-representation of few-shot relations. Specifically, a contrastive learning-based context-level relation learning is proposed to update the entity embeddings, and a transformer-based triplet-level relation learning is proposed to learn the meta-relation representation, and an MTransD is proposed as the score function. The authors conduct experiments on widely used datasets.", "summary_of_the_review": "The paper proposes an incremental solution for the few-shot KG completion and lacks novelty to some extent. And some claims and motivations are not clear and need further explanations. Thus I think the quality of this paper is below the standard bar of ICLR and would not like to accept it.", "strength_and_weaknesses": "Strengths:\n1. The paper is well-organized and the proposed method is easy to follow.\n2. The studied problem is an important research problem for KG completion.\n\nWeaknesses:\n1. The proposed method is based on previous works and uses different components to replace the existing ones. The incremental improvement shows the lack of novelty in this work.\n2. The motivation for the proposed method is not clear and hard to understand why the proposed design is necessary.\n3. The lack of an ablation study to demonstrate the superiority of the MTransD.\n", "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": "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": "N61sE5n3ZKg", "reviewer": "Reviewer_b64W", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 3, "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": "- Real-world KGs are incomplete and suffer from the long-tail distribution over the relations.\n- Thus the performance (on completion tasks) on the low-frequency relations is poor.\n- Prediction of the tail entity given the (head, relation, ?), is considered a few-shot completion problem, in which one could try to learn meta representation for these relations from the limited amount of reference (head, relation, tail) observed.\n- In order to learn the meta-relation representation, the authors try to jointly capture three levels of relational information:\n  a. Context level b. Triplet level c. Entity level.\n- Finally, they propose a meta-learning-based optimization approach to obtain an effective embedding for the tail relation that achieves a few-shot generalization", "summary_of_the_review": "The proper correctly identifies the problem with the existing approaches and addresses them with noble techniques. For that reason I feel the paper is a suitable candidate for acceptance.", "strength_and_weaknesses": "Strength:\n1. The authors very succinctly point out the gap in the existing few-shot paradigm, viz, inconsistent sequential assumption, and lack of context awareness. \n2. Their extensive ablation study indicates the necessity of each component of the model, e.g., the set-based transformer used in triplet-level relation capture was justified by introducing simple sum and LSTMs.\n\nWeakness:\n A few places where complicated model choices were not motivated properly. For example, why authors picked the TransE or distance-based framework for entity-level generalization? The pairwise interaction of the triples could have been done using any sort of permutation invariant operation, why SAB was picked?", "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": "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": {}}]

Author rebuttal:

Decision: Accept: poster