Few-shot Low-resource Knowledge Graph Completion with Reinforced Task Generation
Year: 2023

Abstract:
Despite becoming a prevailing paradigm for organizing knowledge, most knowledge graphs (KGs) suffer from the low-resource issue due to the deficiency of data sources. The enrichment of KGs by automatic knowledge graph completion is impeded by the intrinsic long-tail property of KGs. In spite of their prosperity, existing few-shot learning-based models have difficulty alleviating the impact of the longtail issue on low-resource KGs because of the lack of training tasks. To tackle the challenging long-tail issue on low-resource KG completion, in this paper, we propose a novel fewshot low-resource knowledge graph completion framework, which is composed of three components, i.e., few-shot learner, task generator, and task selector. The key idea is to generate and then select the beneficial few-shot tasks that complement the current tasks and enable the optimization of the few-shot learner using the selected few-shot tasks. Extensive experiments conducted on several real-world knowledge graphs validate the effectiveness of our proposed method.

heading: 1 Introduction
text: Recent years have witnessed a rapidly increasing amount of research attention and industry demand on knowledge graphs (KGs), which organize knowledge in the form of triples and have been playing a crucial role in many knowledge-intensive applications, such as question answering (Zhang et al., 2018), recommendation systems (Guo et al., 2020), and dialogue systems (Yang et al., 2020).
Despite the fact that several large-scale KGs, such as NELL (Mitchell et al., 2018) and Freebase (Bollacker et al., 2008), have been well-developed for organizing general knowledge, most of the existing KGs are built for domain-specific knowledge using domain-specific data sources. These KGs inevitably suffer from the low-resource issue, i.e.,
*Equal contribution.
the incompleteness in terms of entities, relations, and triples that exist in the real world but are absent in KGs, caused by the deficiency of data sources, especially those in non-global languages. For example, the number of articles in Norwegian Wikipedia is 10 times less than that in English Wikipedia1. A KG built using Norwegian Wikipedia would have a severer incompleteness issue compared with the KG extracted from English Wikipedia.
Although automatic KG completion (KGC) (Zhang et al., 2020c; Kazemi and Poole, 2018; Bordes et al., 2013; Tang et al., 2022) has empowered the discovery of more triples to enrich KGs, it is far from perfect to enrich low-resource KGs due to the difficulty in the discovery that stems from the relations associated with missing triples and varies with the change of relation frequency. Since most KGs generally follow long-tail distribution (Xiong et al., 2018; Zhang et al., 2020a; Nguyen et al., 2018), where a large fraction of relations have only a few triples, the existence of rare relations on low-resource KGs leads to dramatic performance degradation on the discovery of missing triples and impede the development of an effective completion model. A line of efforts (Xiong et al., 2018; Zhang et al., 2020a; Chen et al., 2019; Lv et al., 2019) attempt to improve the capability of inference on rare relations by formulating the KG completion problem into a few-shot learning framework and exploiting inference models for frequent relations to facilitate inference on rare relations. Such kind of methods require abundant training tasks to ease the effect of memorization and improve the generalization (Rajendran et al., 2020). However, low-resource KGs do not always have adequate training tasks for mimicking the few-shot learning scenarios of rare relations. For example, the Greek KG (Chen et al., 2020) used in experiments only contains 21 training tasks, as many relations are unknown or cannot offer triples for
1https://en.wikipedia.org/wiki/List_of_Wikipedias
7252
training task construction. Therefore, the few-shot KG completion models tend to overfit on the scarce tasks and engender unsatisfactory results.
Motivated by the above-discussed limitation on low-resource KGs, we propose to generate new few-shot tasks to augment current tasks for easing the impact of memorization and improving the generalization. Although straightforward, the materialization of this idea is non-trivial due to two crucial challenges. The first challenge (C1) is to design an effective strategy to generate new few-shot tasks. A few-shot task is formed as a set of pairs corresponding to the same relation, each of which includes two entities, i.e., head entity and tail entity. On the one hand, the discrete nature of tasks to generate hinders the harness of prevailing generative models. On the other hand, the generation of few-shot tasks with novel relations is arduous due to the lack of related data samples. If possible to generate, the second challenge (C2) is to ensure the authenticity of generated few-shot tasks. The generated tasks ineluctably consist of noisy tasks which cannot represent the designated relation and would be detrimental to few-shot learning. Thus, how to select beneficial tasks is an essential problem.
In this paper, we propose a novel few-shot low-resource KG completion framework with reinforced task generation, named FLow-KGC, to promote the KG completion on rare relations in low-resource KGs. Specifically, we formulate KG completion into a few-shot learning framework and train a simple yet effective few-shot learner to learn representations for rare relations with a small support set. The learned representation can be further used for inference. To address challenge C1, we represent few-shot tasks in a latent continuous space and then build a task generator in this latent space, rather than generating original discrete structure samples. Then the generated tasks can be utilized to update the few-shot learner. To select beneficial synthetic few-shot tasks and tackle challenge (C2), we design an adaptive task selector, which makes decisions on keeping or discarding generated tasks and receives feedback from the few-shot learner and conducts optimization using reinforcement learning. The task generator and task selector collaboratively complete the process of task generation. These three components, i.e., few-shot learner, task generator, and task selector, constitute our proposed method FLow-KGC and can be updated in an alternative optimization way.
Overall, our contributions in this work include: (1) We study the crucial few-shot KG completion on low-resource KGs and propose a novel model called FLow-KGC to mitigate the impact of the long-tail problem on completion tasks. (2) We design a task generator to create synthetic few-shot tasks and a task selector to achieve adaptive beneficial task selection, in order to improve the generalization of the few-shot learner. (3) We perform extensive experiments on several real-world low-resource KGs. The experimental results show the superior performance of FLow-KGC over the state-of-the-art with significant improvement in few-shot low-resource KG completion.

heading: 2 Related Work

heading: 2.1 Knowledge Graph Completion
text: Early efforts address KGC by designing algorithms based on rule learning (Galárraga et al., 2015) to discover logical rules from KGs for facilitating inductive link prediction. Nowadays, the prevailing learning paradigm for KG completion tasks (Zhang et al., 2020c) is to learn the distributed representation of entities and relations in KGs. These methods roughly fall into three categories (Bonner et al., 2021): 1) Tensor decomposition methods, such as SimplE (Kazemi and Poole, 2018), RESCAL (Nickel et al., 2012), and ComplEx (Trouillon et al., 2017). 2) Geometric methods, such as TransE (Bordes et al., 2013), RotatE (Sun et al., 2018b), and CrossE (Zhang et al., 2019). 3) Deep learning methods (Nguyen et al., 2018; Dettmers et al., 2018; Vashishth et al., 2020). However, these methods fail to handle the long-tail problem of KG completion and suffer from performance degradation of prediction on rare relations. A recent approach (Zhang et al., 2020b) attempts to alleviate this issue, but it requires a relatively large set of triples for rare relations and is incapable of handling the few-shot scenario. Recently, a few works (Chen et al., 2020; Zhou et al., 2021) design strategies to assist the KG completion by leveraging complementary knowledge from other related KGs in different languages (Chen et al., 2020; Conneau et al., 2020; Zhou et al., 2021). Although effective, they only rely on cross-lingual links (Chen et al., 2017; Sun et al., 2018a; Pei et al., 2019a; Cao et al., 2019; Pei et al., 2019b, 2020) and cannot handle new relations or rare relations with few triples.

heading: 2.2 Few-shot Knowledge Graph Completion
text: With the goal to overcome the shortcoming of canonical KG completion methods (Kazemi and Poole, 2018; Bordes et al., 2013; Nguyen et al., 2018) on inferring the missing triples associated with rare relations, several few-shot KG completion (FSKGC) algorithms have been developed for improving completion performance on rare relations. Recent attempts (Xiong et al., 2018; Zhang et al., 2020a; Chen et al., 2019; Lv et al., 2019) on fewshot KG completion formulate the problem into a few-shot learning framework and propose metricbased approaches (Xiong et al., 2018; Zhang et al., 2020a; Sheng et al., 2020; Niu et al., 2021) and meta-learning-based approaches (Chen et al., 2019; Lv et al., 2019). Yet these few-shot KG completion models require plenty of training tasks to train a few-shot learner and cannot generalize well to rare relations in low-resource KGs due to the deficiency of relations and corresponding tasks.

heading: 3 Problem Formulation
text: A knowledge graph G can be denoted as G = (E ,R, T P), where E refers to the set of entities andR denotes the set of relations, and T P is represented as a set of triples {(h, r, t)} ⊆ E ×R×E , each of which includes a head entity h, a relation r, and a tail entity t. The KG completion problem is to infer the most plausible missing triples from the candidate set {(h, r, t)|t ∈ E ∧ (h, r, t) /∈ T P} for each incomplete triple (h, r, ?) (or inferring from {(h, r, t)|h ∈ E ∧ (h, r, t) /∈ T P} for (?, r, t)).
In our few-shot low-resource KGC problem, the majority of relations have a few training triples. Formally, for a rare relation ri, there are a support set Si = {(h, t)|(h, ri, t) ∈ T P} including only |S| training triples. The task is to predict the tail entity for a query triple (h, ri, ?), i.e., ranking all tail entity candidates such that the true tail entity t is ranked higher than other candidates in Ch,ri , which is defined as Ch,ri = {tc|tc ∈ E ∧ (h, ri, tc) /∈ T P}. Following the notations in meta-learning, a few-shot task with K = |S| triples is called K-shot KG completion. Since this K for a rare relation ri is often small (e.g., less than 10), the learning problem is organized by working on meta-tasks Ti = {Si,Qi}, where a query set Qi = {(h, t, Ch,ri)|(h, ri, t) ∈ T P}.
In the meta-training stage, there are a set of fewshot tasks Ttrain = {Ti}Mi=1, where each task Ti represents a relation ri ∈ Rtrain. A few-shot learn-
ing model can be optimized using meta-training tasks following the meta-learning principle (Finn et al., 2017). In the meta-testing stage, with a set of testing tasks Ttest = {Tj}Jj=1, the model should make inferences on new relation rj ∈ Rtest corresponding to task Tj . Note that all relations that appear in the meta-testing tasks are unseen during meta-training, i.e.,Rtrain ∩Rtest = ϕ.
Low-resource KGs suffer from severer incompleteness issue and consist of fewer relations. Due to the long-tail distribution of these relations, there are only a small number of relations with a high frequency qualified to offer triples for task construction, leading to insufficient Ttrain. Our proposed solution enriches Ttrain by generating and selecting beneficial new tasks for virtual relations which are undiscovered and not present in KGs.

heading: 4 The Proposed Method
text: In this section, we introduce the proposed method FLow-KGC, describe each component in detail, and elaborate on the optimization and inference, following the overview shown in Figure 1.

heading: 4.1 Few-shot Learner
text: A few-shot learner is a basic yet essential component in few-shot learning for generalizing a inference model over rare relations with only a few triples. In particular, the few-shot learner should be able to learn accurate representation for rare relations using a small support set, then the learned representation will be applied for subsequent inference. We adopt a simple few-shot learner based on metalearning (Chen et al., 2019) to learn representation for relations. Specifically, given a meta-training task Ti with support set Si and its corresponding relation ri ∈ Rtrain, a few-shot learner FS(·) aims to generate a representation for ri by taking entities in associated triples as input. The representation of ri can be obtained by the following:
rTi =
∑|Si| k=1 FS(ehk ⊕ etk)
|Si| , (1)
where (hk, tk) denotes the k-th pair in Si, ehk and etk are embeddings for entity hk and tk, and rTi refers to the learned representation of relation ri. x⊕y denotes the concatenation of the embedding x and y. The few-shot learner FS(·) is implemented by an L-layers fully connected neural network.
After obtaining the representation rTi of relation ri, we measure if rTi can well represent relation
ri by a score function fs(·) and define the metatraining loss on support set Si as follow:
LSi = |Si|∑
k=1
[γ + f s(hk, ri, tk)− fs(hk, ri, tn)]+,
(2) where fs(·) is based on TransE (Bordes et al., 2013) algorithm and measures the plausibility of triple (hk, ri, tk) by fs(hk, ri, tk) = ||ehk + rTi − etk ||. fs(hk, ri, tn) is the score for negative sample (hk, tn) sampled from {(hk, t′)|t′ ∈ E ∪ (hk, ri, t′) /∈ T P}. And γ is a predefined margin parameter. Then a fast update on rTi can be conducted to obtain a more accurate representation of relations and works as follows:
r̂Ti = rTi − β∇rTiLSi , (3)
where β is the step size of the gradient updates. Next, the updated relation representation r̂Ti is exploited to measure the plausibility of triples in the query set Qi with a score function f q(·) defined by f q(hz, ri, tz) = ||ehz + r̂Ti −etz ||, where (hz, tz) denotes the z-th pair in Qi. Then the loss function for updating few-shot learner FS(·) on the query set Qi is defined as follows:
LQi = |Qi|∑
z=1
[γ + f q(hz, ri, tz)− f q(hz, ri, tc)]+,
(4) where tc ∈ Chz ,ri is a tail entity candidate.
Lastly, the few-shot learner is optimized on all
meta-training tasks as follows:
LFS = |Ttrain|∑
i=1
LQi . (5)

heading: 4.2 Task Generator
text: The few-shot learner on low-resource KGs suffering from the deficiency of training tasks tends to overfit and memorize the given tasks and lacks generalization ability. We thus target to generate few-shot tasks to complement the meta-training set. In particular, We design a task generator in a task representation space, rather than generating new tasks in the original discrete format.

heading: 4.2.1 Task Representation
text: We build the representation of a task based on the entities involved in the task. Specifically, for a task Ti with a support set Si and a query set Qi, we denote the representations of Si and Qi as Si ∈ RK×2d and Qi ∈ RZ×2d, which are obtained by:
Si = SHi ⊕ STi Qi = QHi ⊕QTi,
(6)
where SHi ∈ RK×d denotes the representation matrix of head entities in support set Si and is obtained by SHi = eh1 ⊕ ...⊕ ehK . d is the dimension of embeddings. Similarly, STi ∈ RK×d refers to the representation matrix of tail entities in support set Si and is obtained by STi = et1 ⊕ ... ⊕ etK . K denotes the size of the support set. The representation of Qi can be acquired in the same way. QHi
and QTi represent the head entities and tail entities in Qi, respectively. Z denotes the size of the query set. With obtained Si and Qi, a task Ti can be represented by Ti ∈ R(K+Z)×2d as follow:
Ti = Si ⊕Qi. (7)

heading: 4.2.2 Conditional Variational Autoencoder
text: With learned task representations and the aim to generate meta-tasks, we expect to estimate the underlying posterior distribution p(·|T, r) of metatasks with given relations for task generation by sampling. Due to the intractability of this posterior distribution, we employ a conditional variational autoencoder (CVAE) (Sohn et al., 2015) to circumvent the direct posterior estimation and generate meta-tasks with relations as a conditional variable.
Encoder. The encoder takes the representation T of a task T with its corresponding relation r as input data and aims to construct a latent distribution qϕ(z|T, r) to describe the distribution of meta tasks related to relation r, which is represented by the mean µ and standard deviation σ, and z is a sample drawn from the distribution. µ and σ are learned by two separate linear function fµ and fσ as follows:
µ = fµ(MLPenc(Concat(T, r))) (8)
σ = fσ(MLPenc(Concat(T, r))), (9)
where fµ(x) = Wµx+ bµ and fσ(x) = Wσx+ bσ, MLPenc(·) is an L-layer fully connected neural network, Concat(, ) is a concatenation operator, which first squeezes T to a vector T′ ∈ R2(K+Z)·d then concatenates T′ and a one-hot vector or (representing the ID of relation r). Here we assume there are V virtual relations representing undiscovered but existent relations in the real world. These virtual relations will have generated meta-tasks. A relation r then can be represented as a one-hot vector or ∈ R(|Rtrain|+V ) to denote its ID. Decoder. The decoder is to reconstruct the input representation T with the learned µ and σ, which defines the latent distribution of the given relation r. Given µ and σ, we can sample a latent variable z from the constructed space N (µ, σ). Yet the sampling operator makes the model non-differentiable and unable to calculate the gradient. Therefore, we adopt the reparameterization trick (Kingma and Welling, 2014) to solve this issue, which works by z = µ + σ ⊙ ϵ, where ϵ ∼ N (0, I) and ⊙ denotes the element-wise multiplication. The reconstruction should involve the relation information
because the reconstructed task representation is a relation-specific representation. With the sampled z, the decoder can be denoted as pθ(T|z, r) and the reconstruction process is defined as follow:
T̃′ = MLPdec(z⊕ or), (10)
where MLPdec(·) is an L-layer fully connected neural network and T̃′ ∈ R2(K+Z)·d denotes the reconstructed representation of task T .
With the encoder and decoder, we can define the reconstruction loss to minimize the variational lower bound by:
LCVAE = −KL(qϕ(z|T, r)||pθ(z|r))+ E[log pθ(T|z, r)], (11)
where the first term is a KL-divergence loss which can be rewritten as −KL(qϕ(z|T, r)||pθ(z|r)) = −12 ∑M i=1(−σi + exp(σi) + µ2i − 1) by letting the prior distribution pθ(z|r) be N (0, I), and the second term is the reconstruction loss defined as E[log pθ(T|z, r)] = ∑M i=1 ||T̃′ −T′||22.

heading: 4.2.3 Task Generation
text: With the designed CVAE, we can generate metatasks that are related to a relation. We generate tasks for virtual relations that refer to undiscovered relations, which would improve the diversity of tasks and enhance the generalization of the fewshot learner. Note that we do not generate tasks for known relations, because the key issue in lowresource KGC is the absence of representative tasks for a large portion of unknown relations, and those known relations without sufficient triples for metatask construction. Specifically, given a virtual relation rv, its one-hot vector representation can be obtained, which is denoted as ov. Then we can sample a latent variable zv from the prior distribution pθ(z|r) ∼ N (0, I). With the sampled zv and one-hot vector ov, according to Eq.(10), the well-trained decoder can be employed to generate the representation T̃′v for the task corresponding to relation rv. Then the vector T̃′v can be unsqueezed as T̃v ∈ R(K+Z)×2d, which is further decomposed as four matrices S̃Hv ∈ RK×d, S̃Tv ∈ RK×d, Q̃Hv ∈ RZ×d, and Q̃Tv ∈ RZ×d standing for the generated representations of head and tail entities in a support set and a query set. And the four matrices form a task T̃v = { S̃Hv, S̃Tv, Q̃Hv, Q̃Tv } . The generation process can be repeated multiple times to obtain a set of tasks for a relation, which will be further exploited in the meta-training.

heading: 4.3 Task Selector
text: The generated meta-tasks are leveraged in the metatraining stage with the desire to ease overfitting and improve generalization. However, these tasks inevitably comprise noisy meta-tasks, which cannot represent the corresponding relation well, and would mislead learning of the few-shot learner. To alleviate the adverse impact of noisy tasks, we design a task selector to select beneficial meta-tasks to promote the training of the few-shot learner. Specifically, given a set of generated meta-tasks TGEN = { T̃1, ..., T̃N } , where N denotes the number of tasks, the task selector learns to generate a score to measure the authenticity of a task and decide the beneficial tasks used for meta-training. For a task T̃i, the score is calculated as follows:
s(T̃i) = 1
K
K∑
j=1
MLPrs(ehj + rT̃i − etj ), (12)
where MLPrs(·|ψ) is an L-layer fully connected neural network with an output dimension as 1 and parameterized by ψ. Here rT̃i is obtained using S̃Hi and S̃Ti following Eq.(1), ehj denotes the embedding of i-th head entity in S̃Hi and etj is the embedding of i-th tail entity in S̃Ti. For better exploration, the task selector adopts a stochastic policy π to make the choice on meta-tasks under the categorical distribution p = Cat(·|TGEN ). The probability p(T̃i) of selecting task T̃i is calculated by p(T̃i) = s(T̃i)/ ∑N i=1 s(T̃i).
With the obtained sampling probabilities, we can select B meta-tasks from TGEN . Then metatraining of few-shot learner FS(·) can be conducted following Eq.(1) to Eq.(4) using the selected B meta-tasks. Hence the few-shot learner is optimized on B generated meta-tasks as follows:
L F̃S
= B∑
i=1
LQ̃i , (13)
where LQ̃i denotes the loss on generated query set. To motivate the task selector towards the selection of precise meta-tasks, we evaluate the task selector with feedback signals from the few-shot learner, which reflect the effectiveness of metatasks for training the few-shot learner. Specifically, we denote ΦOLD as the parameters of the current few-shot learner and ΦNEW as the parameters after the few-shot learner undertakes a temporary update with Eq.(13). Leveraging FS(·|ΦOLD) and
FS(·|ΦNEW) and following Eq.(1) to Eq.(4), the reward R is defined as follows:
R = tanh( 1
|Tval|
|Tval|∑
i=1
LOLDQi − LNEWQi ), (14)
where LOLDQi and LNEWQi are loss functions, defined in Eq.(5) with meta-validation tasks and obtained with FS(·|ΦOLD) and FS(·|ΦNEW) respectively.
Thereby performance improvement with ΦNEW against ΦOLD will reward the task selector and reinforce it to choose corresponding meta-tasks. To optimize the selector, we adopt the policy gradient algorithm REINFORCE (Williams, 1992) to overcome the issue of non-differentiability of the sampling process. The optimization works by:
ψ ← ψ − α▽ψ log πψ(R− b), (15)
where we use π with a slight abuse of notation to denote the task selector parameterized by ψ and α is the learning rate. Besides, b denotes a baseline function, e.g., the moving average of the reward, for reducing computational variance.

heading: 4.4 Optimization and Inference
text: We employ the iterative optimization strategy to optimize three components in the proposed method, i.e., few-shot learner, task generator, and task selector. With the pre-trained representation for entities, the task generator is first optimized to generate meta-tasks TGEN , then the task selector is applied to conduct selection on TGEN , next the few-shot learner can be optimized using selected meta-tasks and given meta-tasks Ttrain. With the obtained reward R, we can update the task selector according to Eq.(15). The whole process is repeated with enough iterations until all components converge.
In the inference stage, we use the optimized fewshot learner to make inferences on new relations in meta-testing set Ttest. Similar to the meta-training stage, FS(·) can learn relation representation using the support set in Ttest for a new relation. Then the generated representation is leveraged to evaluate
the test triples in the query set. Note that FS(·) is not updated by using the query set anymore in the meta-testing stage.

heading: 5 Experiments

heading: 5.1 Experimental Settings
text: Dataset. We adopt a multilingual KG dataset (Chen et al., 2020) for evaluation. Specifically, we select four different language-specific KGs extracted from French (FR), Spanish (ES), Japanese (JA) and Greek (EL) DBpedia (Lehmann et al., 2015) as low-resource KGs, as they only have a small number of frequent relations that can offer triples for training task construction. Table 1 shows the statistics of used datasets.
Baselines. To validate the effectiveness of our method, we compare our method with two groups of baseline methods. The first group consists of canonical KG completion models including TransE (Bordes et al., 2013), DistMult (Yang et al., 2015), ComplEx (Trouillon et al., 2017), SimplE (Kazemi and Poole, 2018), and WRAN (Zhang et al., 2020b). The second group is the few-shot KG completion models, including GMatching (Xiong et al., 2018), FSRL (Zhang et al., 2020a), MetaR (Chen et al., 2019), and GANA (Niu et al., 2021).
Implementation. We implement the proposed method using the Python library Pytorch and conduct all the experiments on an NVIDIA GeForce RTX 3090Ti. Following the popular setting (Zhang et al., 2020a; Xiong et al., 2018), we remove all the relations in Ttrain and Ttest from KG G and obtain a background knowledge graph for pre-training the KG embedding leveraging DistMult (Yang et al., 2015) as the KG encoder. After that, the pre-trained embeddings of entities and relations can be used in the proposed method. Following the popular procedure and the setting in the related works (Zhang et al., 2020a; Xiong et al., 2018), we extract the few-shot learning tasks and divide them into the meta-training, meta-validation, and meta-testing tasks. Specifically, we select the relations with less than 500 but more than 50 triples for preparing the few-shot learning tasks following the popular setting (Zhang et al., 2020a; Xiong et al., 2018). Note that even though the meta-testing tasks include relations with more than 50 triples, we only sample K = 1 or K = 3 triples as the support set during the meta-testing phase and adopt the rest for evaluation to imitate the real few-shot scenario.
For the few-shot learner, we use three-layer MLP to implement FS(·) with LeakyReLU as the activation function. The hidden units of each layer in FS(·) are set as 500, 200, and 100, respectively. And we set the margin parameter γ as 1.0 and set the step size β as 5.0. For the task generator, we use two-layer MLP to implement MLPenc(·) and MLPdec(·) with ReLU as the activation function. The hidden units of each layer in MLPenc(·) are set as 512, and 256, respectively. And the hidden units of each layer in MLPdec(·) are set as 256, and 512, respectively. Besides, we use a linear layer to implement fµ(·) and fσ(·) with the layer size as 256. For the task selector, we use two-layer MLP to implement MLPrs(·) with LeakyReLU as the activation function. The hidden units of each layer in MLPrs(·) are set as 100, and 50, respectively. The dimension of entity embedding is set as 100 for all methods. Besides, we also find the optimal parameters or follow the original paper to achieve the best performance for baseline methods. Note that all triples in the background KGs and the meta-training tasks, as well as all triples corresponding to entity pairs in the support set of metavalidation and meta-testing tasks, should be used to train the canonical KG completion models. For optimization, we employ Adam optimizer to optimize all loss functions with a learning rate of 0.001. The model trained on the meta-training tasks can be used for the meta-validation tasks every 1000 epochs, and the model parameters and corresponding performance will be recorded. Then the model with the best performance on MRR can be used as the final model for meta-testing. Besides, we use early stopping with 30 patient epochs during metatraining. Following the previous work, we report the Hits@1, Hits@5, Hits@10, and MRR (mean reciprocal rank) results to evaluate the performance of few-shot KG completion. Each evaluation is repeated 3 times and averaged results are reported.

heading: 5.2 Experimental Results
text: Performance comparison. The results of all evaluated KG completion models on four different low-resource KGs with K = 1 and K = 3 are shown in Table 2. We can observe that (1) the proposed method FLow-KGC has superior performance over canonical KG completion models and few-shot KG completion models by Hits@1, Hits@5, Hits@10, and MRR; (2) The long-tail problem of low-resource KGs has a significant im-
pact on canonical KG completion models, such as TransE, DisMult, ComplEx, and SimplE, which have dramatic performance degradation when inferring the missing triples associated with rare relations; (3) Few-shot KG completion models make progress in improving the inference by pre-training on similar tasks to learn better initialization for rare relations. However, their performance is confined by the deficiency of training tasks; (4) The superior results of FLow-KGC show the effectiveness of leveraging generated meta-tasks to mitigate the influence of the long-tail problem on low-resource KG completion and improve the generalization.
Ablation study. To gain deeper insight into the effectiveness of each component in the proposed model, we conduct ablation studies by comparing the following variants with FLow-KGC: (1) FLowKGC-FSL that only keeps a few-shot learner and does not adopt the task generator and task selector. (2) FLow-KGC-w/o-S that adopts the few-shot learner to learn representation and task generator to generate tasks, without the adaptive selection enabled by the task selector. The results on French (FR) and Greek (EL) KG are summarized in Ta-
ble 3, we see that the performance of FLow-KGCFSL is interior to that of others because the variant is a basic few-shot learner and easy to overfit the small set of training tasks. FLow-KGC-w/oS outperforms FLow-KGC-FSL, because the task generator can generate useful synthetic meta-tasks which complement the existing tasks and mitigate the overfitting of the few-shot learner to some extent. FLow-KGC combining the task generator and task selector achieves the best performance among these variants because the task selector distinguish beneficial tasks from noisy tasks and utilizes the
1 3 5 7 9 ES
0.00
0.05
0.10
0.15
0.20 0.25 H it s @ 1
1 3 5 7 9 EL
0.00
0.05
0.10
0.15
0.20
0.25
H it s @ 1
MetaR GANA FLow-KGC
Figure 2: Results on Spanish (ES) and Greek (EL) KGs when varying few-shot size K.
1 5 10 15 20 V
0.22 0.23 0.24 0.25 0.26 0.27 M RR
Fr ES
10 15 20 25 30 Nv
0.24
0.25
0.26
0.27
M RR FRES
Figure 3: Results on French (FR) and Spanish (ES) KGs when varying the # virtual relations (Left) and # generated tasks for each virtual relation (Right).
selected tasks to learn a better few-shot learner.
Impact of few-shot sizeK. To investigate the impact of few-shot size K on the performance of fewshot KG completion, we test MetaR, GANA, and FLow-KGC with size K = 1, 3, 5, 7, 9 on Spanish (ES) and Greek (EL) KGs. Figure 2 shows Hits@1 results of three methods with different K. We see that FLow-KGC consistently outperforms the other two baseline methods with different sizes K, demonstrating the effectiveness of the proposed method. And the performance of all methods gains improvement with K increasing because the larger support set provides more entity pairs to optimize the few-shot learner and learn more accurate representations for rare relations.
Impact of the number of synthetic tasks. The number of virtual relations V and the number of generated tasks Nv for each virtual relation are hyper-parameters to decide the number of synthetic tasks. Figure 3 shows MRR results of FLow-KGC with different V and Nv on French (FR) and Spanish (ES) KGs. First, with a fixed Nv = 20 for French KG and a fixed Nv = 25 for Spanish KG, we find that FLow-KGC has superior performance when V = 10. Second, with a fixed V = 10, FLow-KGC with Nv = 20 and Nv = 25 performs best for French KG and Spanish KG, respectively. We think the reasons behind the observations are similar. A small V or Nv cannot effectively complement the current tasks, and a larger V or Nv,
might introduce more noisy tasks and damage the performance of the few-shot learner.
Impact of the proportion of task selection. FLow-KGC selects B beneficial tasks from the generated tasks to achieve the adaptive selection. Here we denote the selection proportion as BV×Nv . To evaluate the impact of the proportion of task selection, we evaluate FLow-KGC with selection proportion 10%, 30%, 50%, 70%, 90%. Figure 4 shows the results on two KGs (ES and JA). We find that FLow-KGC with a selection proportion of 50% achieves the best performance. We think that a larger proportion unavoidably introduces more noisy tasks into the meta-training phase and a smaller proportion discards extra beneficial tasks, which hurts the effectiveness of FLow-KGC.

heading: 6 Conclusion
text: In this paper, we proposed a novel few-shot KG completion model to ease the adverse impact of the long-tail issue on low-resource KG completion. Specifically, we designed a task generator based on a conditional variational autoencoder to generate synthetic meta-tasks and proposed a task selector to adaptively select beneficial meta-tasks for optimizing a few-shot learner, which further provides the feedback to update the task selector following the principle of reinforcement learning. These three components constitute our method FLow-KGC. Extensive experimental results demonstrate the rationality and effectiveness of our proposed method.
Limitations
Despite achieving superior performance, our proposed method requires manual selection for hyperparameters to decide the number of tasks, i.e., the number of virtual relations V and the number of synthetic tasks Nv for each virtual relation. In future work, we target developing the method with automatic adjustment to add/remove virtual rela-
tions and the corresponding tasks according to the status of the few-shot learner with the training going on by curriculum learning. Besides, although we adopt a task selector to adaptively select beneficial tasks, it is still inevitable to bring noisy tasks in the meta-training stage. We will explore the strategy to achieve better denoising.

heading: A For every submission:
text: 3 A1. Did you describe the limitations of your work?
Section of limitations
7 A2. Did you discuss any potential risks of your work? No potential risks.
3 A3. Do the abstract and introduction summarize the paper’s main claims? Left blank.
7 A4. Have you used AI writing assistants when working on this paper? Left blank.
B 7 Did you use or create scientific artifacts? Left blank.
B1. Did you cite the creators of artifacts you used? Not applicable. Left blank.
B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank.
B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank.
B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank.
B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank.
3 B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank.
C 3 Did you run computational experiments? Section 5
3 C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section 5
The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance.
3 C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 5
3 C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5
3 C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 5
D 7 Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank.
D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response.
D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants’ demographic (e.g., country of residence)? No response.
D3. Did you discuss whether and how consent was obtained from people whose data you’re using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response.
D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response.
D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response.

heading: Future Work
text: In future work, we target developing the method with automatic adjustment to add/remove virtual rela-
tions and the corresponding tasks according to the status of the few-shot learner with the training going on by curriculum learning. Besides, although we adopt a task selector to adaptively select beneficial tasks, it is still inevitable to bring noisy tasks in the meta-training stage. We will explore the strategy to achieve better denoising