The Confidence Trap: Calibration Attacks for Graph Neural Networks

Cuong Dang, Jiahao Zhang, Hieu Ta Quang, Dung Le, Lu Cheng, Suhang WangarXiv 2026 · arXiv

TL;DR

Graph Neural Networks (GNNs) can be deceptively manipulated to provide wildly inaccurate confidence scores—either making them overconfident in errors or underconfident in correct predictions—without changing their classification accuracy. The authors introduce the Unified Graph Calibration Attack (UGCA), a framework that exposes this "confidence trap," revealing that more accurate models and complex datasets are actually more vulnerable to these stealthy adversarial perturbations.

What Problem Does This Paper Address?

In safety-critical fields like medical diagnosis or fraud detection, it isn't enough for a model to be right; it must also be "calibrated." A calibrated model’s confidence score should reflect the actual probability of being correct. If a GNN predicts a 90% chance of fraud, that prediction should be right 90% of the time.

While researchers have spent years studying how to calibrate GNNs and how to attack their accuracy, the robustness of calibration itself has been ignored. The authors identify a "Confidence Trap": an attacker can strategically modify a few edges in a graph to distort confidence scores while leaving the final label unchanged. This is dangerous because the model appears healthy (high accuracy) but becomes unreliable for decision-making, potentially leading to missed diagnoses or expensive manual reviews.

Figure 1: Illustration of calibration attack scenarios on GNN. Attackers strategically manipulate graph structure to distort model confidence scores without altering predicted labels. As a result, confidence values become unreliable, either excessively inflated or diminished, necessitating manual intervention and undermining the model’s trustworthiness.

Methods

Attacking GNN calibration is difficult because graph structures are discrete (you can't easily use gradients on edges) and GNNs are highly sensitive—a single edge change might flip the label, violating the "stealth" requirement of the attack. To solve this, the authors propose UGCA, which includes:

  • KL-Divergence Loss: Instead of just pushing the top two class probabilities together, this loss pushes the entire output distribution toward a uniform distribution (maximum uncertainty) for underconfidence attacks.
  • Reranking Mechanism: A mathematical filter that predicts which edge changes are likely to flip the label. It prioritizes edges that maximize confidence distortion while minimizing the risk of changing the prediction.
  • Hybrid Loss: An adaptive mechanism that switches to a "recovery" loss if a label accidentally flips, forcing the model to return to its original prediction.
  • Beam Search: Unlike standard "greedy" attacks that get stuck in local optima, UGCA explores multiple candidate graph structures simultaneously to find the most effective perturbation.
Overview of the UGCA framework, showing the iterative process of loss selection, reranking, and beam search.

Datasets

The authors evaluated their attack on eight diverse datasets:

  • Citation Networks: PubMed, Citeseer, Cora, and CoraML.
  • Large-scale/Other: Amazon Photo, Coauthor Physics, OGBN-Arxiv, and Reddit.

These datasets represent a wide range of graph sizes and class complexities, allowing the authors to test how these factors influence vulnerability.

Key Insights and Ideas

  • The Accuracy Paradox: Counter-intuitively, the paper proves (Theorem 4.1) that as a model's accuracy increases, its vulnerability to calibration attacks also increases. A highly accurate model has "more to lose" in terms of confidence alignment.
  • Complexity Breeds Vulnerability: Datasets with more classes are significantly easier to attack. In high-class regimes, the Expected Calibration Error (ECE) can be pushed to nearly match the model's accuracy, rendering the confidence scores almost meaningless.
  • Stealth is the Goal: By maintaining accuracy, these attacks evade standard performance monitoring. A system administrator might see 95% accuracy and assume everything is fine, while the model is actually providing random-guess levels of confidence.
  • Data-Centric Robustness: The study found that "data-centric" calibration methods (like DCGC) are more resilient to these attacks than simple post-processing methods (like Temperature Scaling), because they leverage the underlying graph topology more effectively.

Key Results

The experiments demonstrate that UGCA is highly effective across all tested calibration methods:

  • 100% Attack Success Rate: UGCA consistently distorted confidence scores while maintaining the original predicted labels.
  • Massive ECE Spikes: On the PubMed dataset, the Expected Calibration Error (ECE) for a calibrated GNN jumped from a baseline of ~0.07 to over 0.13 under attack.
  • Efficiency: Despite using beam search, UGCA remains computationally practical, with runtimes comparable to simpler, less effective gradient-based attacks.
ECE plots showing how UGCA successfully shifts the confidence distribution away from the "perfect calibration" line.

Limitations and Future Work

  • White-Box Assumption: The current framework assumes the attacker has full access to the model's gradients and confidence scores. Real-world "black-box" scenarios might be harder to execute.
  • Local Perturbations: The attack is constrained to modifying edges directly connected to the target node. While realistic for some scenarios (like a fraudster creating fake transactions), it doesn't explore global graph poisoning.
  • Defense Gap: The paper focuses on the attack; developing robust calibration methods that can withstand such structural perturbations remains an open and urgent challenge for the GNN community.

Summary updated

Abstract

While confidence calibration is essential for trustworthy decision-making in safety-critical applications, the robustness of calibrated GNNs to adversarial structural perturbations remains largely unexplored. However, studying calibration attacks on graphs presents unique technical challenges: (1) the discrete nature of graph structures complicates gradient-based optimization, (2) existing underconfidence objectives fail to drive predictions toward uniform distributions, and (3) GNNs are highly sensitive to edge perturbations, often causing unintended label changes that violate attack constraints. To address these challenges, we propose a \textbf{Unified Graph Calibration Attack (UGCA)} framework designed for \textbf{worst-case (white-box) analysis} of GNN calibration robustness. UGCA introduces a KL-divergence loss to encourage uniform predictive distributions, a reranking mechanism to reduce label flipping, a hybrid loss to recover labels when violations occur, and beam search to explore a broader adversarial search space. We further provide theoretical insights linking model generalization, dataset complexity, and calibration vulnerability, showing that models with higher accuracy or trained on datasets with more classes are more susceptible under this threat model. Extensive experiments demonstrate that UGCA substantially increases Expected Calibration Error while preserving classification accuracy. Our code is publicly available at https://github.com/CaptainCuong/Graph-Calibration-Attack.git.
BibTeX
@misc{dang2026confidence,
  author = {Cuong Dang and Jiahao Zhang and Hieu Ta Quang and Dung Le and Lu Cheng and Suhang Wang},
  title = {{The Confidence Trap: Calibration Attacks for Graph Neural Networks}},
  year = {2026},
  eprint = {2606.08467},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.08467},
}

Loading related content...

Figure