Probability Calibration for Knowledge Graph Embedding Models

Pedro Tabacof, Luca CostabelloICLR 2020

Introduction

Knowledge Graph Embedding (KGE) models, such as TransE or ComplEx, represent entities and relations as high-dimensional vectors to predict missing links in a network. While they are highly effective at ranking facts, their raw output scores are mathematically arbitrary and notoriously "uncalibrated." This means their confidence scores do not reflect the actual probability of a fact being true.

In a perfectly calibrated model, if the system predicts a fact is true with 80% confidence, that fact should actually be correct 80% of the time. Current KGE models fail this standard miserably. For example, TransE tends to be "shy" (under-forecasting probabilities), while other models may be overly confident.

Reliability diagram showing uncalibrated TransE scores on WordNet11.

This lack of calibration is a major hurdle for high-stakes applications like drug discovery or automated reasoning, where users need to know if a prediction is genuinely trustworthy. Furthermore, because these models are uncalibrated, researchers usually have to manually tune a different "decision threshold" for every single relation type in a graph to turn scores into True/False classifications—a process that is both tedious and computationally awkward. This paper introduces a framework to calibrate these models, making their probabilistic outputs reliable and actionable.

Calibration Methods

The authors adapt two classic calibration techniques to the KGE domain:

  1. Platt Scaling: A parametric approach that fits a logistic regression model to the KGE scores, mapping them smoothly into the [0, 1] probability range.
  2. Isotonic Regression: A non-parametric approach that fits a non-decreasing piecewise constant function to the scores. It is more flexible than Platt scaling but generally requires more data to prevent overfitting.

The "Synthetic Negatives" Heuristic

The most significant challenge in calibrating Knowledge Graphs is the Open World Assumption: we know which facts are true (positives), but facts not present in the graph aren't necessarily false—they might just be unknown. Standard calibration requires negative examples.

To solve this, the authors propose generating "synthetic negatives" by corrupting existing triples (e.g., swapping the subject or object of a known fact). They introduce a specific weighting scheme to ensure the calibration process respects a user-defined "base rate" (the expected proportion of true facts in the domain). This prevents the model from being biased by the arbitrary volume of synthetic negatives generated.

Datasets and Key Insights

The study evaluates these methods across several standard benchmarks, including Triple Classification datasets (WN11, FB13, and YAGO39K) and Link Prediction datasets (WN18RR and FB15K-237).

Several key insights emerged from the experiments:

  • Calibration simplifies deployment: Once a model is calibrated, the need for a library of relation-specific thresholds vanishes. A simple, "natural" threshold of 0.5 works across the board, reaching state-of-the-art accuracy.
  • Accuracy does not equal Calibration: A model that is very good at ranking (high Mean Reciprocal Rank) isn't necessarily well-calibrated. The authors found no strong correlation between a model's predictive power and how easy it is to calibrate.
  • Synthetic data is "good enough": Calibrating with synthetically generated negatives performs nearly as well as using expensive, human-verified ground truth negatives. This is a massive advantage for real-world datasets where true negatives are rarely labeled.
  • Isotonic is King (mostly): Isotonic regression generally provided the best calibration performance, though it is more computationally expensive than Platt scaling.

Key Results and Visual Proof

Calibration drastically improved the probabilistic accuracy of the models, measured by the Brier score (where lower is better). For instance, on the WN11 dataset using TransE, the Brier score dropped from 0.443 (uncalibrated) to 0.087 (calibrated).

When using a fixed 0.5 threshold, calibrated models matched or exceeded the classification accuracy of uncalibrated models that relied on heavily optimized, per-relation thresholds. On WN11, calibrated TransE achieved 88.9% accuracy, exactly matching the literature standard that requires much more complex threshold tuning.

Reliability diagrams across three datasets demonstrating how calibration techniques align predictions with the ideal diagonal.

Reliability diagrams visually confirm this success. While raw models produced erratic curves far from the ideal distribution, the calibrated models (using both synthetic and ground truth negatives) followed the ideal 45-degree diagonal almost perfectly.

Limitations and Future Work

While highly effective, the proposed framework has a few limitations:

  • Non-Differentiability: Isotonic regression is not a convex or differentiable function, making it difficult to integrate directly into the training loop of a neural network as a loss component.
  • Base Rate Sensitivity: The synthetic calibration method requires the user to provide an expected "base rate" of true facts. If this estimate is wildly inaccurate, the resulting calibration will also be skewed.

For future work, the authors suggest exploring Beta calibration or Bayesian binning to further refine results. Additionally, they propose investigating how calibration can improve the performance of model ensembles, as calibration effectively puts all disparate KGE models onto the same standardized probabilistic scale.

Summary updated

BibTeX
@inproceedings{tabacof2020probability,
  author = {Pedro Tabacof and Luca Costabello},
  title = {{Probability Calibration for Knowledge Graph Embedding Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure