Source-linked AI summary
One-Shot Relational Learning for Knowledge Graphs
Wenhan Xiong, Mo Yu, Shiyu Chang, Xiaoxiao Guo, William Yang Wang
TL;DR
Knowledge graph completion typically needs many examples per relation, although long-tail and newly added relations often provide only a few. The paper learns a matching metric from entity embeddings and local graph structure to predict unseen relations from one example, improving over embedding methods without retraining for each new relation.
Problem
Long-tail and newly added knowledge-graph relations often lack the many training triples and well-trained relation representations assumed by existing completion methods.
Method
The framework learns a differentiable matching metric from entity embeddings and one-hop local graph structures, using a permutation-invariant network and recurrent matching processor.
Results
The model achieves consistent improvement over various embedding models on one-shot link prediction across two newly constructed datasets.
Takeaways & Limitations
After training, the model can predict any unseen relation directly, without fine-tuning or retraining embedding models for newly added relations.
Takeaways & Limitations
ConvE cannot scale to real-world knowledge graphs with millions of entities under its whole-entity-set training paradigm.
Abstract
from arXiv · showhide
Knowledge graphs (KGs) are the key components of various natural language processing applications. To further expand KGs' coverage, previous studies on knowledge graph completion usually require a large number of training instances for each relation. However, we observe that long-tail relations are actually more common in KGs and those newly added relations often do not have many known triples for training. In this work, we aim at predicting new facts under a challenging setting where only one training instance is available. We propose a one-shot relational learning framework, which utilizes the knowledge extracted by embedding models and learns a matching metric by considering both the learned embeddings and one-hop graph structures. Empirically, our model yields considerable performance improvements over existing embedding models, and also eliminates the need of re-training the embedding models when dealing with newly added relations.
1 Introduction
Knowledge graph completion commonly assumes many examples per relation, but real-world graphs contain many sparse and newly added relations. The paper formulates one-shot relational learning and proposes a framework that improves completion without retraining relation representations.
- Knowledge graphs encode information as binary entity relationships and support applications including Question Answering and the Semantic Web.
- Existing benchmarks mostly cover common relations and assume sufficient training triples, limiting their usefulness for sparse long-tail relations.
- New relations in evolving knowledge graphs have insufficiently trained representations, limiting existing methods’ ability to adapt from few examples.
- The model learns a matching metric using entity embeddings and one-hop graph structures, achieving consistent improvement over embedding models on one-shot link prediction.
- The paper formulates long-tail link prediction as few-shot relational learning and introduces a one-shot framework for relational data.
- Two newly constructed datasets support evaluation of one-shot knowledge graph completion.
2 Related Work
Prior relational learning methods model knowledge graphs in continuous vector spaces, while few-shot learning has developed metric-based and meta-learner-based approaches. This work positions one-shot knowledge graph learning as a distinct application of few-shot learning focused on sparse relations.
- Embedding models such as RESCAL, TransE, DistMult, ComplEx, and ConvE infer missing links by modeling relations in continuous vector spaces.
- These embedding-based models generally assume enough training instances for all relations and entities and overlook sparse symbols.
- Few-shot learning approaches include metric-based methods that learn matching functions and meta-learners that optimize model parameters from few-shot examples.
- The paper identifies its task as the first few-shot learning research application for knowledge graphs.
3 Background
The task predicts tail entities for relation queries from a single labeled triple, using meta-training tasks and a background graph. Evaluation ranks candidate entities for unseen relations under the one-shot constraint.
- Knowledge graph completion predicts either unseen relations between existing entities or a tail entity for a query (h, r, ?); this work focuses on the latter.
- Each meta-training task corresponds to a relation with its own training and testing triples.
- One-shot training provides exactly one triple, (h0, r, t0), for each relation during evaluation.
- For each test query, the model ranks candidate tails against the ground-truth entity using the labeled training triple.
- Meta-testing relations are unseen during meta-training but receive their own one-shot training and testing data.
- The one-shot assumption excludes validation sets for meta-testing relations because additional labeled data would violate the setting.
- A background graph contains triples from none of the meta-training, meta-validation, or meta-testing relations.
4 Model
The model learns similarity between a one-reference triple and candidate query triples by encoding one-hop neighborhoods and performing recurrent multi-step matching.
- Overall Model: The model uses a similarity function to rank candidate tails by comparing each query entity pair with a single reference entity pair.For relation r, the reference triple is (h0, r, t0), and candidates are ranked through matching scores.
- Neighbor Encoder: The neighbor encoder represents each entity from its one-hop relation-entity neighborhood using a permutation-invariant, size-insensitive aggregation.It encodes each neighbor tuple from relation and entity embeddings, then applies a shared feed-forward transformation before aggregation.
- Neighbor Encoder: The encoder uses local graph structure rather than whole-graph propagation, enabling application to large-scale knowledge graphs.Unlike multi-step graph convolution over the whole graph, it performs one-step propagation over each entity’s local graph.
- Matching Processor: The matching processor concatenates reference and query pair representations and uses an LSTM-based recurrent block for multi-step matching.A simple cosine metric was insufficient, so the recurrent processor increases model capacity and produces the final similarity score after K steps.
- Loss Function and Training: Training samples one relation task, one reference triple, positive query triples, and corrupted-tail negatives, then optimizes the matching model with a hinge loss.The margin γ and the number of processing steps K are tunable hyperparameters.
5 Experiments
The experiments evaluate one-shot KG completion on newly constructed sparse-relation datasets and compare GMatching with embedding baselines. GMatching consistently improves performance, supports prediction for newly added relations without fine-tuning, and benefits from carefully chosen neighborhood encoding.
- Datasets: NELL-One and Wiki-One select relations with limited triples as one-shot tasks, with Wiki-One scaling to far more entities and triples than prior benchmarks.NELL-One uses 51/5/11 task relations for training/validation/testing, while Wiki-One uses a 133:16:34 division.
- Implementation Details: ConvE is excluded from experiments because its whole-entity-set training procedure does not scale to Wiki-One’s millions of entities.The authors report failing to run ConvE on Wiki-One with batch size 1 using a GPU with 12GB memory.
- Results: GMatching consistently improves over embedding baselines on one-shot relations, with larger gains on the larger Wiki-One dataset.The evaluation uses MRR and Hits@K on validation and test relations.
- Results: Once trained, GMatching predicts newly added relations without fine-tuning, avoiding the retraining that existing methods generally require.The paper notes that retraining on large real-world graphs can be slow and computationally expensive.
- Results: Under model selection, the metric approach reaches 17.1% and 20.0% MRR on NELL-One and Wiki-One, versus 9.3% and 7.2% for KG embeddings.The corresponding improvements are 7.8 and 12.8 percentage points.
- Analysis on Neighbor-Encoder: Encoding more neighbors generally improves validation Hits@10, but 40 neighbors performs worse than 30, suggesting irrelevant local connections can add noise.Figure 4 reports Hits@10 on all validation relations; the neighbor limit is varied across runs.
- Analysis on Neighbor-Encoder: Both the matching processor and neighbor encoder are important, while removing the neighbor encoder’s 1/N_e scaling makes it worse than simple embedding-based matching.The ablation uses the model with the best NELL-One validation Hits@10.
- Performance on Different Relations: Performance varies substantially across relations: smaller candidate sets are generally easier, while relations with sparse connectivity or more than 3,000 candidates remain challenging.Even embedding models trained with more triples show limited performance on some relations.
6 Conclusion
The paper concludes that one-shot relational learning can predict facts for long-tail and unseen KG relations by matching entity pairs using local graph structure. The trained model directly handles unseen relations and performs better in the one-shot setting, while future work targets external text and multiple examples.
- Conclusion: The framework predicts new facts for long-tail relations by learning a differentiable metric over entity pairs and their local graph structures.The conclusion contrasts this approach with methods that usually require fine-tuning for new relations.
- Conclusion: The trained model can directly predict unseen relations and achieves better performance in the one-shot setting.Future work includes incorporating external text and improving use of multiple training examples.
A Hyperparameters
The paper uses dataset-specific embedding sizes and matching settings, trains embeddings for 1,000 epochs, and tunes other hyperparameters using validation Hits@10.
- Hyperparameters: Embedding size is 100 for NELL and 50 for Wikidata, with the smaller Wikidata size chosen for faster training on millions of triples.The embeddings are trained for 1,000 epochs.
- Hyperparameters: The optimal number of matching steps is 2 for NELL-One and 4 for Wiki-One, while the maximum neighbor limit is 50 for both datasets.Other hyperparameters are tuned using Hits@10 on validation tasks, and Adam is used for parameter updates.
B Few-Shot Experiments
The 5-shot NELL-One experiment evaluates aggregating predictions from five support examples. With more training triples, embedding models improve substantially, whereas this model improves only modestly.
- The model can extend to k-shot settings by aggregating hidden states or scores from all k support examples.This provides a direct way to apply the one-shot architecture beyond a single support example.
- 5-shot experiments on NELL-One rank candidates using the maximum score across five support entity-pairs.The five support examples are aggregated by selecting the maximum of their scores.
- With more training triples, the KG embedding model improves substantially, while this model shows limited improvement.The authors attribute this gap to processing examples independently and not training on meta-testing relations.
- The evaluation reports the percentage of correct answer ranks within the top 10.