HyperAIHyperAI

Command Palette

Search for a command to run...

4 months ago

NSCaching: Simple and Efficient Negative Sampling for Knowledge Graph Embedding

Yongqi Zhang; Quanming Yao; Yingxia Shao; Lei Chen

NSCaching: Simple and Efficient Negative Sampling for Knowledge Graph Embedding

Abstract

Knowledge Graph (KG) embedding is a fundamental problem in data mining research with many real-world applications. It aims to encode the entities and relations in the graph into low dimensional vector space, which can be used for subsequent algorithms. Negative sampling, which samples negative triplets from non-observed ones in the training data, is an important step in KG embedding. Recently, generative adversarial network (GAN), has been introduced in negative sampling. By sampling negative triplets with large scores, these methods avoid the problem of vanishing gradient and thus obtain better performance. However, using GAN makes the original model more complex and hard to train, where reinforcement learning must be used. In this paper, motivated by the observation that negative triplets with large scores are important but rare, we propose to directly keep track of them with the cache. However, how to sample from and update the cache are two important questions. We carefully design the solutions, which are not only efficient but also achieve a good balance between exploration and exploitation. In this way, our method acts as a "distilled" version of previous GA-based methods, which does not waste training time on additional parameters to fit the full distribution of negative triplets. The extensive experiments show that our method can gain significant improvement in various KG embedding models, and outperform the state-of-the-art negative sampling methods based on GAN.

Code Repositories

AutoML-4Paradigm/ERAS
pytorch
Mentioned in GitHub
AutoML-4Paradigm/S2S
pytorch
Mentioned in GitHub
automl-research/nscaching
pytorch
Mentioned in GitHub
AutoML-Research/S2S
pytorch
Mentioned in GitHub
yzhangee/NSCaching
pytorch
Mentioned in GitHub
AutoML-4Paradigm/NSCaching
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
link-prediction-on-fb15kComplEx NSCaching
MRR: 0.7721
link-prediction-on-fb15k-1ComplEx NSCaching
Hits@10: 0.8682
MR: 82
MRR: 0.7721
link-prediction-on-fb15k-237ComplEx NSCaching
Hits@10: 0.4805
MR: 221
MRR: 0.3021
link-prediction-on-wn18ComplEx NSCaching
Hits@10: 0.9398
MR: 1072
MRR: 0.9355
link-prediction-on-wn18rrComplEx NSCaching
Hits@10: 0.5089
MR: 5365
MRR: 0.4463

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
NSCaching: Simple and Efficient Negative Sampling for Knowledge Graph Embedding | Papers | HyperAI