On the Temperature of Bayesian Graph Neural Networks for Conformal Prediction

Seohyeon Cha, Honggu Kang, Joonhyuk Kang

Abstract

Accurate uncertainty quantification in graph neural networks (GNNs) is essential, especially in high-stakes domains where GNNs are frequently employed. Conformal prediction (CP) offers a promising framework for quantifying uncertainty by providing $\textit{valid}$ prediction sets for any black-box model. CP ensures formal probabilistic guarantees that a prediction set contains a true label with a desired probability. However, the size of prediction sets, known as $\textit{inefficiency}$, is influenced by the underlying model and data generating process. On the other hand, Bayesian learning also provides a credible region based on the estimated posterior distribution, but this region is $\textit{well-calibrated}$ only when the model is correctly specified. Building on a recent work that introduced a scaling parameter for constructing valid credible regions from posterior estimate, our study explores the advantages of incorporating a temperature parameter into Bayesian GNNs within CP framework. We empirically demonstrate the existence of temperatures that result in more efficient prediction sets. Furthermore, we conduct an analysis to identify the factors contributing to inefficiency and offer valuable insights into the relationship between CP performance and model calibration.

Introduction

In high-stakes applications such as medical diagnosis or autonomous navigation, a Graph Neural Network (GNN) must do more than provide a point prediction; it must reliably quantify its uncertainty. Conformal Prediction (CP) has emerged as a robust framework for this task. By using a calibration dataset, CP generates prediction sets that are mathematically guaranteed to contain the true label with a user-defined probability (e.g., 90%).

While CP ensures "validity," it often suffers from inefficiency. If a model is poorly calibrated or over-cautious, the resulting prediction sets may become excessively large, containing so many candidate labels that they lose practical utility. This challenge is particularly acute in GNNs, where graph-structured data often violates the independent and identically distributed (i.i.d.) assumptions central to many uncertainty quantification methods.

Methodology: Tempered Bayesian GNNs

This research bridges the gap between Bayesian learning and Conformal Prediction by introducing a temperature parameter ($\beta$) into the posterior distribution of Bayesian GNNs. The authors utilize Graph DropConnect (GDC) to treat model weights as random variables, capturing epistemic uncertainty.

Comprehensive workflow: Graph input to GNN training, posterior tempering, and conformal prediction output.

The core innovation lies in the "tempering" of the posterior distribution. By adjusting $\beta$, the model's confidence can be tuned:

  • High $\beta$ ($\beta \gg 1$): The model relies more on its prior, leading to a flatter, more spread-out distribution.
  • Low $\beta$ ($\beta \ll 1$): The model becomes "sharper" and more confident based on the observed data.

The negative log-likelihood of this tempered posterior serves as the "non-conformity score" within the CP framework. This allows the temperature to act as a control knob for the "spread" of predictions before the final conformal boundaries are drawn.

The "Goldilocks" Temperature and Efficiency

The study evaluates this approach across node classification (Cora, Citeseer) and graph classification (CIFAR10-superpixel, ENZYMES) tasks. A key finding is the existence of an optimal temperature, $\beta^*$, that minimizes the size of the prediction sets while strictly maintaining the required coverage probability.

Effect of temperature $\beta$ on conformal prediction metrics: coverage remains stable while inefficiency exhibits a clear minimum at $\beta^*$.

As illustrated above, while the Coverage remains constant at the target $1-\alpha$ level regardless of temperature, the Inefficiency (set size) follows a U-shaped curve. If $\beta$ is too low, the model is overconfident and "spiky," forcing the CP algorithm to include more labels to account for errors. If $\beta$ is too high, the model is too vague. The "sweet spot" at $\beta^*$ yields the most informative, compact prediction sets.

Key Insights and Results

  • Bayesian Superiority: Bayesian GNNs consistently outperformed frequentist baselines, producing smaller prediction sets across all tested datasets.
  • Calibration as a Driver: There is a deep link between model calibration and CP efficiency. The authors found that a model's Maximum Calibration Error (MCE) divided by its Accuracy is a strong predictor of how efficient its prediction sets will be. Interestingly, a slightly less accurate but better-calibrated model can produce more useful (smaller) prediction sets than a highly accurate but poorly calibrated one.
  • Empirical Gains: On the Citeseer dataset, a Bayesian GCN with an optimized temperature ($\beta = 4 \cdot 10^{-3}$) achieved significantly lower inefficiency than standard Bayesian or frequentist models.

Conclusion and Future Work

Incorporating temperature scaling into Bayesian GNNs provides a powerful mechanism for enhancing the efficiency of Conformal Prediction. While this study demonstrates clear benefits in transductive settings, future work is needed to automate the tuning of $\beta$ through "CP-aware" loss functions and to extend these benefits to inductive settings where graph structures change. Despite the higher computational cost of Bayesian sampling, the resulting gains in prediction set utility represent a significant step forward for reliable GNN deployment in sensitive domains.

Summary updated

Abstract

Accurate uncertainty quantification in graph neural networks (GNNs) is essential, especially in high-stakes domains where GNNs are frequently employed. Conformal prediction (CP) offers a promising framework for quantifying uncertainty by providing $\textit{valid}$ prediction sets for any black-box model. CP ensures formal probabilistic guarantees that a prediction set contains a true label with a desired probability. However, the size of prediction sets, known as $\textit{inefficiency}$, is influenced by the underlying model and data generating process. On the other hand, Bayesian learning also provides a credible region based on the estimated posterior distribution, but this region is $\textit{well-calibrated}$ only when the model is correctly specified. Building on a recent work that introduced a scaling parameter for constructing valid credible regions from posterior estimate, our study explores the advantages of incorporating a temperature parameter into Bayesian GNNs within CP framework. We empirically demonstrate the existence of temperatures that result in more efficient prediction sets. Furthermore, we conduct an analysis to identify the factors contributing to inefficiency and offer valuable insights into the relationship between CP performance and model calibration.
BibTeX
@inproceedings{cha2023temperature,
  author = {Seohyeon Cha and Honggu Kang and Joonhyuk Kang},
  title = {{On the Temperature of Bayesian Graph Neural Networks for Conformal Prediction}},
  booktitle = {GLFrontiers @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=Nrs8BA84br},
}
Figure