Papers › Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddings

Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddings

14 Jan 2022arXiv:2201.05575archive 2025-07-28

Peng Wang, Xin Xie, Xiaohan Wang, Ningyu Zhang

Previous knowledge graph embedding approaches usually map entities to representations and utilize score functions to predict the target entities, yet they typically struggle to reason rare or emerging unseen entities. In this paper, we propose kNN-KGE, a new knowledge graph embedding approach with pre-trained language models, by linearly interpolating its entity distribution with k-nearest neighbors. We compute the nearest neighbors based on the distance in the entity embedding space from the knowledge store. Our approach can allow rare or emerging entities to be memorized explicitly rather than implicitly in model parameters. Experimental results demonstrate that our approach can improve inductive and transductive link prediction results and yield better performance for low-resource settings with only a few triples, which might be easier to reason via explicit memory. Code is available at https://github.com/zjunlp/KNN-KG.

PaperPDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

zjunlp/knn-kg officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Graph EmbeddingKnowledge Graph EmbeddingKnowledge Graph EmbeddingsLink PredictionMemorization

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Link Prediction FB15k-237 kNN-KGE Hits@1 0.280 #9 of 75 Archive leaderboard report
Link Prediction FB15k-237 kNN-KGE Hits@10 0.550 #9 of 75 Archive leaderboard report
Link Prediction FB15k-237 kNN-KGE Hits@3 0.404 #9 of 75 Archive leaderboard report
Link Prediction FB15k-237 kNN-KGE MR 185 #9 of 75 Archive leaderboard report
Link Prediction FB15k-237 kNN-KGE MRR 0.370 #9 of 75 Archive leaderboard report
Link Prediction FB15k-237-ind kNN-KGE Hits@1 0.223 #1 of 1 Archive leaderboard report
Link Prediction FB15k-237-ind kNN-KGE Hits@10 0.431 #1 of 1 Archive leaderboard report
Link Prediction FB15k-237-ind kNN-KGE Hits@3 0.32 #1 of 1 Archive leaderboard report
Link Prediction FB15k-237-ind kNN-KGE MRR 0.294 #1 of 1 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections