A Graph Is More Than Its Nodes: Towards Structured Uncertainty-Aware Learning on Graphs

Hans Hao-Hsun Hsu, Yuesong Shen, Daniel Cremers

TL;DR

Standard graph neural networks (GNNs) evaluate confidence calibration using nodewise metrics that ignore the graph's relational structure. This paper introduces edgewise Expected Calibration Error (ECE) along with agree/disagree ECEs to evaluate uncertainty across connected pairs of nodes. Evaluating these structured metrics reveals that models explicitly accounting for joint label distributions achieve significantly better calibration, while standard GNNs suffer from severe miscalibration—especially along edges connecting different classes.

What Problem Does This Paper Address?

In node classification, node predictions are rarely independent: labels correlate across edges due to network homophily and relational structure. Despite this, uncertainty estimation for GNNs has borrowed metrics directly from independent and identically distributed (i.i.d.) classification literature—namely, nodewise Expected Calibration Error (ECE).

Nodewise calibration is blind to graph topology. Two graphs with identical marginal probabilities at every node will yield identical nodewise ECEs, even if their joint predictions across edges are completely different (e.g., a simple 3-node chain vs. a 3-node cycle). To truly trust GNN predictions in safety-critical domains, practitioners need metrics that evaluate joint and relational uncertainty, not just isolated node marginals.

Methods

To bridge the gap between marginal and joint uncertainty estimation, the authors introduce structured calibration metrics:

  1. Edgewise ECE ($\text{ECE}^e$): Measures the calibration of predicted pairwise marginal distributions $\hat{p}(y_i = l, y_j = m \mid x, y_L)$ across test edges $(i, j) \in \mathcal{E}_U$. Edgewise predictions are binned by confidence, and the gap between pairwise accuracy and pairwise confidence is evaluated.
  2. Agree and Disagree ECE ($\text{ECE}^a$ / $\text{ECE}^d$): Real-world networks contain both homophilous edges (where neighbors share labels, $y_i^* = y_j^*$) and heterophilous edges (where labels differ, $y_i^* \ne y_j^*$). Agree ECE ($\text{ECE}^a$) and Disagree ECE ($\text{ECE}^d$) isolate these subsets to diagnose whether errors stem from label agreements or disagreements.
  3. Structured vs. Nodewise Modeling: The authors compare models that produce isolated nodewise scores under a naive mean-field assumption (e.g., GCN, GAT) against models explicitly formulated for structured prediction (e.g., GMNN, which uses a Conditional Random Field, and EPFGNN, which relies on a Markov Random Field).

Datasets

The authors benchmark these metrics on three standard citation network datasets:

  • Cora (2,708 nodes, 10,556 edges, 7 classes)
  • Citeseer (3,327 nodes, 9,104 edges, 6 classes)
  • Pubmed (19,717 nodes, 88,648 edges, 3 classes)

All three datasets exhibit high homophily ($\sim 72\%$ to $80\%$). The experimental setup uses a 15% observed (10% train, 5% val) and 85% unobserved test split, averaged across 75 runs (5 random splits $\times$ 3 folds $\times$ 5 seeds).

Key Insights and Ideas

  • Nodewise metrics hide structural overconfidence: A model can appear well-calibrated nodewise while failing dramatically at pairwise predictions. Evaluating edgewise marginals provides a more stringent, structure-dependent reality check.
  • Structured prediction pays off: Formulating node classification with probabilistic graphical models (GMNN and EPFGNN) generally leads to lower nodewise and edgewise calibration errors than simple classification backbones (GCN and GAT).
  • The "agree vs. disagree" split reveals systematic bias:
  • Predictions on agreeing edges are typically under-confident (accuracy exceeds confidence).
  • Predictions on disagreeing edges are severely over-confident (confidence far exceeds accuracy), as homophily-biased GNNs struggle to output confident, correct predictions when neighbors belong to different classes.
  • GAT shines on heterophily: GAT consistently achieved the lowest disagree ECE ($\text{ECE}^d$). The authors hypothesize that its attention mechanism lets it assign distinct edge weights, helping it handle class boundaries better than uniform aggregation.

Key Results

  • Overall Calibration: On Cora, the structured model GMNN achieved an edgewise ECE of $4.07 \pm 1.86$, vastly outperforming GCN ($16.64 \pm 5.53$) and GAT ($25.37 \pm 5.34$).
  • Disagree Calibration: On Cora's disagreeing edges, standard GAT achieved the lowest calibration error ($13.60 \pm 2.51$), while GMNN struggled with an $\text{ECE}^d$ of $30.78 \pm 3.37$ and Pubmed's GMNN reached $62.34 \pm 1.36$.
  • Metric Discrepancies: On Pubmed, the nodewise and edgewise metrics gave conflicting model rankings: while GMNN achieved better nodewise ECE than GCN ($4.24$ vs. $7.16$), GCN scored better edgewise ECE ($3.34$ vs. $10.78$), proving that nodewise metrics alone can misrepresent calibration.

Limitations and Future Work

  • Assortative Benchmark Bias: Experiments were conducted exclusively on citation networks with high homophily ($>70\%$). Benchmarking on naturally heterophilous graphs remains an open and crucial direction.
  • Pairwise Focus: The proposed framework calibrates up to edge-level (pairwise) marginals. While motivated by Bethe approximations and tractability, it does not explicitly calibrate higher-order motifs or subgraphs (triangles, cliques).
  • Inference Mismatches: For models like EPFGNN, using Loopy Belief Propagation during test inference improved calibration error but lowered raw accuracy relative to naive mean-field inference, highlighting a tension between calibration and predictive performance.

Summary updated

BibTeX
@inproceedings{hsu2022graph,
  author = {Hans Hao-Hsun Hsu and Yuesong Shen and Daniel Cremers},
  title = {{A Graph Is More Than Its Nodes: Towards Structured Uncertainty-Aware Learning on Graphs}},
  booktitle = {GLFrontiers @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=_4f6IaxMJeC},
}
Figure