SimKGC
SimKGC completes knowledge graphs from entity text with a contrastively trained pre-trained language model.
Language · 942 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Language
- Parameters
- 219M
- Operations
- 942
- Framework
- PyTorch
- Recurrent
- No
- Published
- ACL 2022
- Cited by
- 280 (as of 23 October 2026)
- Authors
- Liang Wang, Wei Zhao, Zhuoyu Wei, Jingming Liu
- Source
- GitHub: intfloat/SimKGC
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m2843
- Graph hash
- 6f97266e376a1f02c3bc97dc55e321305dc33d5a24d44e67d516eee6ca0eefbb
- Skeleton hash
- 3bfa79cc11cbde370fdf78eac035777d828182a22e03cb99df55e94304a84f41
- Architecture hash
- 31c6f5905f61541fa8f823532ae796516aab277ff95b1a2bf46602c1fd10a799
- Diagram SHA-256
- 1abe182983d70ce54158103772baa10fb3751afd25533bcbebf0daaf7ab2e8eb
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
SimKGC is a text-based model for knowledge graph completion (KGC), the task of reasoning over known facts to infer the missing links. Text-based methods learn entity representations from natural language descriptions, which gives them the potential to handle the inductive setting. The paper notes that, when it was written, such methods still largely lagged behind graph embedding-based methods like TransE and RotatE.
The paper identifies efficient contrastive learning as the key issue. To improve learning efficiency it introduces three types of negatives: in-batch negatives, pre-batch negatives, and self-negatives, which act as a simple form of hard negatives. These are combined with an InfoNCE loss. In mean reciprocal rank (MRR), the paper reports gains over the best earlier results of +19% on WN18RR, +6.8% on the Wikidata5M transductive setting, and +22% on the Wikidata5M inductive setting. The official code repository states that all experiments were run with 4 V100(32GB) GPUs.
Key idea. SimKGC combines in-batch, pre-batch and self-negatives with an InfoNCE loss, and its paper reports it substantially outperforming embedding-based methods on several benchmark datasets.
- simkgc
- knowledge graph completion
- kgc
- text-based knowledge graph completion
- contrastive learning
- infonce
- in-batch negatives
- link prediction
- pre-trained language model
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{wang2022simkgcsimplecontrastiveknowledge,
title={SimKGC: Simple Contrastive Knowledge Graph Completion with Pre-trained Language Models},
author={Liang Wang and Wei Zhao and Zhuoyu Wei and Jingming Liu},
year={2022},
eprint={2203.02167},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2203.02167},
}