Test-Time Graph Recalibration: Enhancing Robust Zero-Shot Inference for Graph Foundation Models
Abstract
This work investigates the challenge of robust graph learning within the framework of graph foundation models. Prior studies primarily rely on data-centric structural purification or adversarial augmentation during training to achieve adversarial robustness. However, in practical zero-shot inference scenarios, such methods exhibit significant vulnerability to unseen adversarial structures owing to the static nature of their defense mechanisms and the prohibitive computational cost associated with retraining. In this paper, we propose a novel framework termed Test-time gRaph recAlibration for enhancing robust zero-shot inferenCE (TRACE). The core mechanism of TRACE involves the selective learning of a structural anti-attack directly on noisy graphs during the inference phase, which neutralizes adversarial perturbations while maintaining performance on clean graphs. Specifically, TRACE introduces a non-parametric diagnostic metric based on smoothed spectral entropy to quantify the structural-semantic misalignment induced by adversarial attacks, thereby serving as an adaptive trigger for recalibration. Furthermore, a uniformity-guided optimization objective is formalized to leverage semantic anchors from pretrained text encoders, guiding the distorted graph back to the clean manifold. To ensure computational efficiency for sparse graph encoders, a first-order gradient-based edge flipping strategy is employed to reconstruct the optimal graph structure directly within the discrete domain. Extensive experiments conducted across various benchmark datasets and graph attacks demonstrate the superiority of TRACE over existing state-of-the-art baselines.