How Many and How Much? Contrastive Learning with Negative Samples for Knowledge Graph Embedding
Organizations: Chung-Ang University Seoul, Korea
Abstract
Knowledge graph embedding (KGE), a fundamental technique for knowledge-centric Web and KG-augmented AI applications, is commonly trained through contrastive learning with negative samples to learn discriminative representations. Despite its empirical success, two crucial questions regarding negative samples remain underexplored: (Q1) how many negative samples should be used for each positive sample and (Q2) how much should each negative sample contribute to learning? To answer these questions, we propose RADAR, a novel contrastive learning framework for KGE models with two effective strategies, respectively: (1) Risk-aware negative budget allocation quantifies false-negative sampling risk by modeling an open-world KG as a stochastic partial observation of its closed-world counterpart and adaptively assigns a negative budget to each positive sample based on its risk; (2) Distribution-calibrated negative weighting assigns negative weights by calibrating the weighting strength for each positive based on two complementary characteristics of the negative-score distribution: dispersion and concentration. Extensive experiments on 3 real-world KGs with 4 KGE models reveal that RADAR achieves the best KGE performance on average across all model--KG combinations and reduces sampled false negatives by over 90% compared with conventional fixed-budget methods.
Figures & tables
| Dataset | Method | RotatE | TransE | ComplEx | DistMult | A.R. | ||||
| MRR | H@10 | MRR | H@10 | MRR | H@10 | MRR | H@10 | |||
| FB15k237 | KBGAN ∗ [NAACL’18] | - | - | 29.4 | 49.7 | 28.2 | 45.4 | 26.7 | 45.3 | - |
| NSCaching ∗ [ICDE’19] | 30.9 | 48.6 | 30.0 | 47.4 | 30.2 | 48.1 | 28.3 | 45.6 | 11.5 | |
| DeMix-Adv ∗ [ISWC’23] | 32.9 | 51.8 | 31.8 | 51.0 | 30.7 | 47.9 | 30.1 | 47.0 | 9.2 | |
| M 2 ixKG ∗ [NN’24] | 33.7 | 53.2 | 33.1 | 52.9 | 32.3 | 51.6 | 31.7 | 50.3 | 4.1 | |
| IF-NS ∗ [KBS’25] | - | - | 31.0 | 48.9 | - | - | - | - | - | |
| Method | TT | Gain | MC | Gain | MRR |
|---|---|---|---|---|---|
| Uniform | 1h 40m | 0.0% | 7.5GB | 0.0% | 29.5 |
| Uniform SANS | 1h 40m | 0.0% | 7.5GB | 0.0% | 29.8 |
| Uniform RW-SANS | 1h 40m | 0.0% | 7.5GB | 0.0% | 29.7 |
| Self-Adv | 1h 40m | 0.0% | 7.5GB | 0.0% | 33.6 |
| Self-Adv SANS | 1h 40m | 0.0% | 7.5GB | 0.0% | 33.6 |
| Self-Adv RW-SANS | 1h 40m | 0.0% | 7.5GB | 0.0% | 31.5 |
| Dataset | Method | RotatE | TransE | ComplEx | DistMult |
|---|---|---|---|---|---|
| FB15k237 | RADAR | 35.1 | 34.7 | 35.7 | 35.4 |
| w/o RA | 34.1 (-2.7%) | 33.7 (-2.7%) | 34.2 (-4.2%) | 32.8 (-7.4%) | |
| w/o DW | 33.1 (-5.5%) | 32.5 (-6.2%) | 31.7 (-11.1%) | 31.0 (-12.4%) | |
| WN18RR | RADAR | 49.0 | 25.9 | 49.4 | 46.0 |
| w/o RA | 47.8 (-2.5%) | 23.8 (-8.4%) | 47.7 (-3.6%) | 44.5 (-3.1%) | |
| w/o DW | 47.8 (-2.5%) | 23.7 (-8.4%) | 47.4 (-4.2%) | 44.2 (-4.1%) |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| FB15k237 | 14,541 | 237 | 272,115 |
| WN18RR | 40,943 | 11 | 86,835 |
| YAGO3-10 | 123,182 | 37 | 1,079,040 |
| Dataset | Statistic | 1-to-1 | 1-to-N | N-to-1 | N-to-N |
|---|---|---|---|---|---|
| FB15k237 | # Relations | 17 | 26 | 86 | 108 |
| # Train triples | 4,278 (1.6%) | 12,536 (4.6%) | 50,635 (18.6%) | 204,666 (75.2%) | |
| # Test triples | 192 (0.9%) | 1,293 (6.3%) | 4,508 (22.0%) | 14,473 (70.7%) | |
| WN18RR | # Relations | 2 | 4 | 3 | 2 |
| # Train triples | 1,218 (1.4%) | 13,770 (15.9%) | 40,833 (47.0%) | 31,014 (35.7%) | |
| # Test triples | 42 (1.3%) | 475 (15.2%) | 1,487 (47.4%) | 1,130 (36.1%) |
KG Embedding
Knowledge graph embedding (KGE) represents entities and relations as vectors or structured geometric objects for prediction and reasoning.
See all 56 papers