Source-linked AI summary
Few-Shot Knowledge Graph Completion
Chuxu Zhang, Huaxiu Yao, Chao Huang, Meng Jiang, Zhenhui Li, Nitesh V. Chawla
TL;DR
Few-shot KG completion is needed because many relations have too few entity pairs for conventional methods, while prior one-shot approaches do not fully exploit few-shot supervision. FSRL combines heterogeneous-neighbor encoding, reference aggregation, and matching to infer facts for new relations. Across two public datasets, it outperforms state-of-the-art baselines, though its setting excludes evaluation relations from the background KG and prior components have identified limitations.
Problem
Many relations have few entity pairs, making conventional KG completion methods that assume sufficient training instances unsuitable for this practical setting.
Method
FSRL uses a relation-aware heterogeneous neighbor encoder, recurrent autoencoder aggregation network, and matching network to infer true pairs from few-shot references.
Results
FSRL achieves the best performances in all cases, with average relative improvement over the best baseline of up to 34% on NELL and 15% on Wiki data.
Takeaways & Limitations
FSRL provides a few-shot relation learning approach for completing KGs involving long-tail or newly added relations with limited reference instances.
Takeaways & Limitations
The evaluation setting uses a background KG that excludes all relations in the meta-training, meta-testing, and meta-validation sets.
Abstract
from arXiv · showhide
Knowledge graphs (KGs) serve as useful resources for various natural language processing applications. Previous KG completion approaches require a large number of training instances (i.e., head-tail entity pairs) for every relation. The real case is that for most of the relations, very few entity pairs are available. Existing work of one-shot learning limits method generalizability for few-shot scenarios and does not fully use the supervisory information; however, few-shot KG completion has not been well studied yet. In this work, we propose a novel few-shot relation learning model (FSRL) that aims at discovering facts of new relations with few-shot references. FSRL can effectively capture knowledge from heterogeneous graph structure, aggregate representations of few-shot references, and match similar entity pairs of reference set for every relation. Extensive experiments on two public datasets demonstrate that FSRL outperforms the state-of-the-art.
Introduction
Knowledge graphs support important applications but are incomplete, while long-tailed relations often provide too few entity pairs for conventional completion methods. FSRL addresses this few-shot setting by modeling heterogeneous graph structure, aggregating reference pairs, and matching similar entity pairs.
- Motivation: Few-shot relations are challenging because many real-world relations have only a small number of available entity pairs.Previous models assume sufficient training instances for every relation, making them infeasible in this setting.
- Motivation: GMatching improves one-shot relation inference but treats heterogeneous neighbors equally and does not model interactions among few-shot references.These limitations reduce graph-structure and reference-set representation capability.
- FSRL: FSRL learns a matching function for inferring true entity pairs from a relation’s few-shot reference pairs.Its design targets new relations with limited reference entity pairs.
- FSRL: FSRL encodes heterogeneous neighbors with relation-aware attention, aggregates reference pairs using a recurrent autoencoder, and matches similar entity pairs.The encoder captures relation types and differing neighbor impacts, while the aggregation network models interactions among reference instances.
- FSRL: FSRL can infer true entity pairs for new relations without fine-tuning after meta-training.The learned model is optimized through a meta-training-based gradient-descent approach.
- Evaluation: Experiments on two public datasets show that FSRL outperforms state-of-the-art baselines.The paper presents few-shot KG completion as a problem intended to better reflect practical scenarios.
Related Work
Prior work includes metric-based and meta-optimizer-based few-shot learning, along with diverse relational models for KG completion. FSRL targets the practical case of long-tail or newly added relations with few-shot references, unlike methods assuming sufficient training data.
- Few-Shot Learning: Few-shot learning methods are commonly divided into metric-based and meta-optimizer-based approaches.Metric-based methods learn matching functions, whereas meta-optimizer methods rapidly adapt model parameters using few-shot gradients.
- Few-Shot Learning: Metric-based methods compare inputs with few-shot support sets or prototype representations to make predictions.Matching networks and prototypical networks exemplify these strategies.
- Relation Learning for KGs: KG relation-learning research includes tensor factorization, translation-based embeddings, neural tensor networks, and deep neural models.Examples include RESCAL, TransE, NTN, R-GCG, and ConvE.
- Relation Learning for KGs: GMatching introduced one-shot relation learning for KGs, while FSRL studies long-tail or newly added relations with few-shot reference instances.Earlier KG completion models generally assume sufficient training instances for each relation.
Preliminaries
The paper formulates few-shot KG completion as ranking true tail entities for new heads using a relation’s few-shot reference pairs. It defines meta-training, validation, and testing tasks and evaluates ranking over constrained candidate entities.
- Problem Definition: A knowledge graph is represented as triples (h, r, t) drawn from entities and relations.The completion task can predict a tail entity or an unseen relation; this work focuses on tail prediction.
- Problem Definition: Few-shot KG completion ranks true tail entities above false candidates for each new head using a relation’s few-shot reference pairs.Candidate entities are constructed under an entity-type constraint.
- Few-Shot Learning Settings: The learning framework uses relation-specific training and testing entity-pair data across a set of training tasks.Each training task corresponds to a KG relation and imitates few-shot relation prediction during evaluation.
- Objective: Testing ranks all candidate entities for each query using the true tail, remaining candidates, and the few-shot reference set.The model’s ranking loss is defined over test tuples and depends on the model parameters and candidate set.
- Objective: The ranking objective is averaged over the testing tuples for each relation before optimization.The following section details how this objective is formulated and optimized.
- Few-Shot Learning Settings: Meta-testing evaluates relations unseen during meta-training, with each relation having few-shot training data and testing data.The meta-testing relation set is disjoint from the meta-training relation set.
- Few-Shot Learning Settings: A background KG excludes relations assigned to meta-training, meta-testing, and meta-validation sets.This defines the graph information available alongside the task-specific data.
Model
FSRL completes knowledge graphs in few-shot settings by encoding heterogeneous neighbors, aggregating reference pairs, and matching query pairs against relation-specific reference sets. It trains these modules jointly through relation-based meta-training.
- Architecture: FSRL has three stages: heterogeneous-neighbor encoding, few-shot reference-set aggregation, and query-to-reference matching for relation prediction.The framework generates entity embeddings, constructs a reference-set embedding, and computes a similarity score between each query pair and reference set.
- Encoding Heterogeneous Neighbors: The relation-aware neighbor encoder uses attention to capture different impacts of heterogeneous relational neighbors and incorporates both neighbor entities and relations.Attention weights model neighbor importance, while entity and relation embeddings contribute to the encoder representation.
- Aggregating Few-Shot Reference Set: A recurrent autoencoder aggregates entity-pair representations in each few-shot reference set while modeling interactions among pairs.Pair embeddings are sequentially passed through recurrent encoder and decoder states, whose representations are combined with residual connections and attention weights.
- Matching Query and Reference Set: A recurrent matching processor repeatedly compares a query-pair embedding with the reference-set embedding and uses the final hidden state as the refined query representation.The inner product between the refined query embedding and reference-set embedding provides the similarity score used for ranking.
- Objective and Model Training: Training samples few-shot positive pairs as references, uses remaining positives and tail-corrupted negatives as queries, and accumulates the joint loss.The procedure is organized as relation-based meta-training, uses the objective from Eq. 10, and updates parameters with Adam.
Experiments
The experiments evaluate FSRL's performance and component effectiveness, including the impact of few-shot size and embedding visualization, on two public datasets.
- Experimental Scope: Experiments evaluate the proposed model, verify each component's effectiveness, analyze few-shot size impact, and visualize embeddings.The evaluation is conducted on two public datasets.
Experimental Design
Experiments use NELL- and Wikidata-based few-shot tasks, compare relational embedding and graph-neighbor encoder baselines, and evaluate with ranking metrics under fixed reference size K=3.
- Datasets: The NELL and Wikidata datasets provide 67 and 183 few-shot tasks, respectively, using relations with 50–500 triples.NELL splits its tasks into 51/5/11 training, validation, and testing relations; Wikidata uses 133/16/34.
- Baselines: Comparisons include relational embedding methods RESCAL, TransE, DistMul, and ComplEx, alongside graph-neighbor encoder methods.Relational methods model KG relational structure, while graph-neighbor methods combine local-neighbor encoding with matching.
- Implementation: ComplEx pre-training is used for GMatching and FSRL, with embedding dimensions of 100 for NELL and 50 for Wikidata.The heterogeneous neighbor encoder uses at most 30 local neighbors, and LSTM is used for reference-set aggregation and matching.
- Reporting: Table 2 reports overall results for all methods, with GMatching identified as the best baseline and FSRL as the best-performing model.The table distinguishes validation and test scores.
- Evaluation: Performance is evaluated with Hits@1, Hits@5, Hits@10, and mean reciprocal rank (MRR), using K=3 in the main experiments.Validation relations tune models, while test relations evaluate them; an additional experiment analyzes the impact of K.
Results Comparison
Graph-neighbor encoding outperforms relational embeddings, while FSRL achieves the strongest overall and most per-relation results against the best baseline, GMatching.
- Overall comparison: Graph-neighbor encoder methods outperform relational embedding methods, supporting local graph structure and matching for new-relation fact prediction.GMatching is the graph-neighbor encoder compared against relational embedding baselines.
- Overall comparison: 34% and 15% are the average relative improvements of FSRL over the best baseline in NELL and Wikidata, respectively.FSRL achieves the best performance in all reported overall cases, and the paper attributes benefits to its heterogeneous neighbor encoder and recurrent autoencoder aggregation network.
- Per-relation comparison: Results across NELL test relations have high variance because candidate-set sizes differ across relations.Relations with smaller or easier candidate sets receive relatively larger scores, affecting comparisons between models.
- Per-relation comparison: FSRL outperforms GMatching in most NELL test relations, indicating robustness across relations.Table 3 reports the per-relation comparison between the two models.
Ablation Study
Ablation studies replace or remove FSRL components to assess the heterogeneous neighbor encoder, aggregation network, and matching network.
- AS 1: Neighbor encoder: Replacing the relation-aware heterogeneous neighbor encoder with mean pooling substantially worsens performance, indicating its large benefit.This comparison is labeled AS 1 and uses NELL results.
- AS 2: Aggregation network: FSRL outperforms aggregation variants using mean pooling, mean attention, or no decoder in most cases.AS 2a–AS 2c test recurrent autoencoder aggregation components on NELL data.
- AS 3: Matching network: Removing the recurrent matching network largely reduces performance, showing its capability to compute relevance between query and reference.The model comparison is reported in the ablation results for NELL data.
Analysis
Additional analyses examine how reference-set size affects performance and how FSRL separates positive from negative candidate embeddings across selected relations.
- Impact of few-shot size: Increasing few-shot size K improves the performance of both FSRL and GMatching.The analysis uses NELL test data and interprets larger reference sets as producing better relation reference-set embeddings.
- Impact of few-shot size: FSRL consistently outperforms GMatching across different K values, demonstrating stability for few-shot relation completion.Figure 2 reports this comparison using GMatching (MaxP).
- Embedding visualization: For the selected relations “produced by” and “team coach,” FSRL more clearly discriminates positive and negative candidate embeddings than GMatching.The visualization covers two NELL test relations differing in semantic meaning and candidate-set size.
Conclusion
FSRL addresses the new few-shot KG completion problem through joint optimization of three components and outperforms state-of-the-art baselines on two public datasets. Ablation studies verify the effectiveness of each component, while future work may improve training and entity representations.
- FSRL jointly optimizes a relation-aware heterogeneous neighbor encoder, recurrent autoencoder aggregation network, and matching network.
- FSRL outperforms state-of-the-art baseline methods on two public datasets.
- Ablation studies verify the effectiveness of each FSRL component.
- Future work may consider model-agnostic meta-learning and contextual information such as entity attributes or text descriptions.