Negative sampling makes graph link-prediction training practical by evaluating sampled false relationships instead of every possible node pair. It addresses both the computational cost of dense pairwise comparison and the severe class imbalance created by sparse graphs. section 11.4.1
A typical negative-sampling loss pipeline:
- Score observed edges with a decoder and convert scores into probabilities with a sigmoid function. section 11.4.1
- Sample candidate false relationships from a negative-example distribution rather than enumerating all nonedges. section 11.4.1
- Combine positive and negative cross-entropy terms, using a balancing parameter to control the influence of negatives. section 11.4.1
Biomedical knowledge graph
For the fact “aspirin treats headache,” training rewards a high decoder score for the observed relationship while penalizing sampled alternatives such as “COX-2 treats headache.” section 11.4.1

