        Self-supervised Adversarial Purification for Graph Neural Networks


                                              Woohyun Lee 1 Hogun Park 1


                        Abstract                                    on the underlying graph structure, even small perturbations
     Defending Graph Neural Networks (GNNs)                         can drastically degrade their performance, making them
     against adversarial attacks requires balancing ac-             highly vulnerable to adversarial attacks (Xu et al. 2019a;
     curacy and robustness, a trade-off often mishan-               Geisler et al. 2021). Defending against such attacks requires
     dled by traditional methods like adversarial train-            balancing accuracy and robustness. Accuracy measures per-
     ing that intertwine these conflicting objectives               formance on clean data, while robustness reflects resilience
     within a single classifier. To overcome this limi-             to adversarial attacks. Focusing on accuracy can make a
     tation, we propose a self-supervised adversarial               model rely on adversarially vulnerable features, while prior-
     purification framework. We separate robustness                 itizing robustness may reduce this reliance but harm clean
     from the classifier by introducing a dedicated pu-             data performance.
     rifier, which cleanses the input data before clas-             Adversarial training (Goodfellow et al. 2015; Madry et al.
     sification. In contrast to prior adversarial purifi-           2018), one of the earliest defense methods in the image
     cation methods, we propose GPR-GAE, a novel                    domain, has been adapted into GNNs (Xu et al. 2019a; Feng
     graph auto-encoder (GAE), as a specialized puri-               et al. 2019; Li et al. 2022; Zhang et al. 2022; Gosch et al.
     fier trained with a self-supervised strategy, adapt-           2023) to enhance robustness under adversarial settings in
     ing to diverse graph structures in a data-driven               graphs. However, it inherently intertwines the two conflict-
     manner. Utilizing multiple Generalized PageRank                ing objectives in a single learning framework. This limits the
     (GPR) filters, GPR-GAE captures diverse struc-                 achievable robustness, as pursuing higher robustness often
     tural representations for robust and effective pu-             comes at the expense of significant accuracy loss. Moreover,
     rification. Our multi-step purification process fur-           adversarial training often falls short in broad applicability,
     ther facilitates GPR-GAE to achieve precise graph              showing efficiency in a narrow set of GNNs.
     recovery and robust defense against structural per-
     turbations. Experiments across diverse datasets                On the other hand, adversarial purification (Wu et al., 2019;
     and attack scenarios demonstrate the state-of-the-             Entezari et al., 2020; Li et al., 2024) provides a viable frame-
     art robustness of GPR-GAE, showcasing it as                    work by introducing a separate module—a purifier—that
     an independent plug-and-play purifier for GNN                  preprocesses the input data to defend against attacks. It
     classifiers. Our code can be found in https:                   focuses on removing adversarial components and purifying
     //github.com/woodavid31/GPR-GAE.                               the input data, allowing each module to specialize in its
                                                                    own role: the purifier enhances robustness, while the clas-
                                                                    sifier focuses solely on accuracy. This separation provides
1. Introduction                                                     clear pathways for each module to leverage its strengths in-
                                                                    dependently, avoiding interference between the conflicting
Graph Neural Networks (GNNs) have become a powerful                 objectives of accuracy and robustness. However, existing
tool for learning on graph-structured data, with applications       purification methods do not fully capitalize on this potential,
in social networks (Fan et al. 2019), biological networks           often relying on predefined heuristics without a dedicated
(Zhang et al. 2021), and recommender systems (Wu et al.             training process (Wu et al. 2019; Entezari et al. 2020) or a
2022). Moreover, they have been expanded to domains such            simple edge detection method (Li et al. 2024). Heuristic-
as self-supervised learning (Jung & Park 2025) and explain-         based approaches lack adaptivity and leave defenses highly
ability (Kang et al. 2024). However, due to their reliance          vulnerable to carefully crafted attacks (Mujkanovic et al.
    1
     Department of Computer Science and Engineering,                2022), while classifier-derived edge representations do not
Sungkyunkwan University, Suwon, South Korea. Correspondence         capture intricate structural differences between clean and
to: Hogun Park <hogunpark@skku.edu>.                                adversarial edges, resulting in suboptimal performance.
Proceedings of the 42 nd International Conference on Machine        Based on these observations, our work makes several key
Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025         contributions to adversarial purification in GNNs. First, we
by the author(s).

                                                                1
                             Self-supervised Adversarial Purification for Graph Neural Networks

analyze and decouple the conflicting objectives of accuracy           2. Preliminary
and robustness in adversarial training into two components:
a classifier for accuracy and a purifier trained independently        2.1. Problem Formulation and Notation
to restore graph structures. Under the adversarial purifica-          We represent a graph G as G = (V, E), where V is the set
tion framework, we design a self-supervised training strat-           of N nodes and E is the set of edges, or equivalently as
egy, ensuring the purifier’s independence from the classifi-          (A, X), with A ∈ RN ×N as the adjacency matrix and X ∈
cation task and mitigating trade-offs. Second, as the purifier,       RN ×F as the feature matrix, where F denotes the feature
we introduce GPR-GAE, a novel graph auto-encoder ar-                  dimension. While a normalized adjacency matrix with self-
chitecture that leverages multiple Generalized PageRank               loops, Ãs = Ds
                                                                                     −1/2
                                                                                          (A + I) Ds
                                                                                                    −1/2
                                                                                                         is commonly used, our
(GPR) filters to capture diverse and unique neighborhood              approach adopts Ãns = D−1/2 AD−1/2 , excluding self-
representations. This allows effective distinction between            loops. Here, Ds and D are the respective degree matrices.
clean and adversarial graph regions by modeling complex
structural differences, while enabling accurate encoding              This work addresses adversarial attacks on Graph Neural
and reconstruction of a cleaner graph structure. Third, we            Networks (GNNs) through structural perturbations, where
adopt a multi-step purification process that iteratively re-          attackers manipulate edges (insertions or deletions) to de-
fines the graph with a convergent nature, yielding more               grade performance. We denote the perturbed graph as
precise and effective purification. Finally, through extensive        G′ = (A′ , X) and seek to recover a structure closer to
experiments across diverse datasets and attack scenarios,             the clean graph G = (A, X). Unlike poisoning attacks tar-
we demonstrate that GPR-GAE excels as a specialized pu-               geting the training phase, we focus on evasion attacks, the
rifier, achieving state-of-the-art performance while serving          same problem setting as adversarial training, which occurs
as a plug-and-play defense module that is compatible with             at the test phase. Following Gosch et al. (2023), we employ
various GNNs.                                                         an inductive setting, excluding validation and test nodes
                                                                      during training to prevent information leakage (memorizing
1.1. Related Work                                                     the graph for defense) and ensure fair evaluation.

Adversarial Training: Gosch et al. (2023) emphasizes that             2.2. Learning Objective of Adversarial Training
flexible GNN architectures (Chien et al. 2021; He et al.
2022) excel in adversarial training settings due to their abil-       Adversarial training (Xu et al. 2019a; Li et al. 2022; Gosch
ity to learn robust propagation pathways by dynamically               et al. 2023) enhances the robustness of a GNN classifier fψ
weighting different powers of the adjacency matrix.                   against evasion attacks by iteratively generating adversarial
                                                                      examples and training the classifier on them. The overall
Robust GNNs: Some methods forgo adversarial training                  objective can be formulated as:
and focus on designing a robust GNN architecture as a
defense. For example, EvenNet (Lei et al. 2022) ignores                       L(ψ) =      max        Ev∈V [ℓ(fψ (G′ , v), yv )].   (1)
                                                                                        G′ ∈B(G,ϵ)
odd-hop neighbors and uses an even-polynomial graph fil-
ter, while SoftMedianGDC (Geisler et al. 2021) uses soft-             Here, G′ is an adversarially perturbed graph sampled from
median aggregation with GDC to mitigate the influence                 B(G, ϵ), the set of graphs obtained from G via a bounded
of outliers. However, robust GNNs share the same limita-              number of edge or feature modifications and constrained
tions as adversarial training, where accuracy and robustness          by the perturbation budget ϵ. Each node v ∈ V has a true
goals are tightly coupled within the architectural designs,           label yv , and ℓ denotes the loss function. Training alternates
constrained by inherent trade-offs.                                   between generating the worst-case G′ , which maximizes the
                                                                      loss, and updating classifier parameters ψ to minimize the
Adversarial Purification: Jaccard-GCN (Wu et al. 2019)
                                                                      expected loss over G′ .
prunes edges between nodes that have Jaccard similarity
below a threshold. SVD-GCN (Entezari et al. 2020) finds
                                                                      2.3. Generalized PageRank Filter
that attacks tend to affect high-rank components of the graph
and perform a low-rank approximation to purify the graph.             The Generalized PageRank (GPR) filter, introduced in
GOOD-AT (Li et al. 2024) integrates adversarial training              GPRGNN (Chien et al., 2021), provides a flexible mech-
and purification by generating adversarial samples using a            anism for dynamically adjusting the contribution of each
PGD attack (Xu et al. 2019a) on a pre-trained GCN (Kipf               propagation step during message passing. This is achieved
& Welling 2017) classifier. It encodes edges with features            through learnable coefficients γk , which weigh the k-th
and classifier logit embeddings, training an ensemble of              power of the normalized adjacency matrix Ãks. The prop-
                                                                                                                             
MLP detectors to distinguish between clean (in-distribution)          agation rule is expressed as H =
                                                                                                          PK
                                                                                                                γ    Ãk (0)
                                                                                                                         H     ,
                                                                                                            k=0 k      s
and adversarial (out-of-distribution) edges. During testing,
edges flagged as OOD by any detector are pruned.                      where in GPRGNN, H(0) is the initial feature-driven logit
                                                                      embeddings. By learning the coefficients γ = [γ0 , . . . , γK ],

                                                                  2
                               Self-supervised Adversarial Purification for Graph Neural Networks

the GPR filter flexibly adapts the contribution of information             performance on clean data. As a result, most adversarial
from different neighborhood ranges, up to K-hops. This                     training methods keep the attack budget during training rel-
adaptability allows GPR filters to dynamically capture and                 atively low to preserve the clean accuracy. Consequently, it
aggregate neighborhood information, being suitable for both                inherently limits the level of robustness that can be achieved
homophilic and more complex heterophilic graphs.                           through training, leaving the classifier vulnerable to stronger
                                                                           attacks that exceed the restricted budget.
3. Motivations                                                             The limitations in adversarial training motivates a fundamen-
                                                                           tal redesign: can we decouple the objectives of accuracy
3.1. Self-supervised Adversarial Purification
                                                                           and robustness, assigning them to specialized modules that
We discuss the motivations behind our use of a self-                       address each goal more effectively?
supervised adversarial purification framework for defending
                                                                           Therefore, we propose a self-supervised adversarial purifi-
against adversarial attacks. We first analyze the learning
                                                                           cation framework with clear efforts to fully decouple the
objective of adversarial training and highlight the inherent
                                                                           accuracy and robustness objectives. The two are explic-
trade-off between accuracy and robustness. The adversarial
                                                                           itly handled and learned in separate modules with distinct
training objective can be decomposed as follows:
                                                                           specializations. This contrasts with previous adversarial
Theorem 3.1 (Decomposition of Adversarial Training).                       purification approaches, which either replace the purifier
Given disjoint sets of nodes Vunaffected ⊆ V and Vaffected ⊆ V,            with predefined heuristics or make the purifier dependent
representing those unaffected and affected by adversar-                    on the classifier’s samples and representations.
ial perturbations in G’, respectively, such that Vunaffected ∪
                       |V         |                                        The accuracy objective is assigned to a standard GNN
Vaffected = V, let λ = unaffected
                           |V|      , where λ ∈ [0, 1], denote the
                                                                           classifier, fψ , which focuses solely on learning accurate
proportion of unaffected nodes. The adversarial training
                                                                           representations from the clean graph G. This is reflected in
objective for a GNN classifier fψ can be decomposed as
                                                                           the following typical supervised learning objective:
follows:
                                                                                                                    
                                                                                        L(ψ) = Ev∈V ℓ(fψ (G, v), yv ) .
                                             
 L(ψ) = λ · Ev∈Vunaffected ℓ(fψ (G, v), yv )                                                                                          (2)
              |              {z               }
                        Accuracy Term
                                                                           The robustness objective, in turn, is assigned to a separate
                                  Ev∈Vaffected ℓ(fψ (G′ , v), yv ) .
                                                                 
       + (1 − λ) ·     max                                                 purifier model, fθ , which does not learn to predict node
                     G′ ∈B(G,ϵ)   |              {z               }
                                           Robustness Term                 labels. Instead, it focuses on reconstructing the clean graph
                                                                           G from perturbed inputs G′ , which naturally aligns with the
Proof. Provided in Appendix A.1.                                           following self-supervised objective:

In particular, a node v is considered affected by an adver-                          L(θ) = ℓ(fθ (G′ ), G),    G′ ∼ B(G, ϵ).          (3)
sarial perturbation if a modification exists within its local
propagation boundary. For instance, in a 2-layer GCN (Kipf                 In our self-supervised approach, unlike adversarial train-
& Welling, 2017), a node v is affected if there are perturba-              ing’s worst case samples, we randomly choose G′ from the
tions within its two-hop neighborhood.                                     sample space B, with a relatively large training budget ϵ.
                                                                           This allows the purifier fθ to learn general purification di-
The decomposition separates the adversarial training objec-                rections across a broader range of perturbations around G,
tive into two distinct terms: accuracy and robustness. Given               enabling more robust and adaptive purifications.
that the local structure of node v is denoted as Sv and the
perturbed local structure as Sv′ , the accuracy term focuses on
                                                                           3.2. Convergent Multi-Step Purification Framework
learning the mapping from (v, Sv ) to the true label yv , while
the robustness term focuses on learning the mapping from                   Traditional purification methods often use a single-step pro-
(v, Sv′ ) to yv . Meanwhile, within the decomposition, the                 cess, modifying the perturbed graph G′ by pruning or retain-
attack budget ϵ indirectly determines |Vunaffected |, controlling          ing edges based on fixed criteria. Although simple, these
the value of λ and emphasis on each term.                                  methods make abrupt changes with rough discretization of
                                                                           the graph, limiting their ability to precisely recover clean
However, excessive emphasis on the robustness term can
                                                                           graph structures under complex or heavy perturbations.
introduce perturbations that drastically alter the nodes’ se-
mantics, rendering the mapping from (v, Sv′ ) to yv mean-                  The proposed multi-step purification framework addresses
ingless for learning useful representations. The coexistence               these limitations by iteratively refining the graph through
of such potentially detrimental learning within the overall                a dynamic, data-driven approach. Instead of abrupt correc-
objective can hinder the learning of meaningful representa-                tions, the purifier model fθ progressively adjusts the graph
tions from the clean graph structure, ultimately constraining              structure using the learned purification directions, adapting

                                                                       3
                              Self-supervised Adversarial Purification for Graph Neural Networks

to the graph’s current state at each step. This gradual refine-
ment not only enhances recovery accuracy but also enables
the method to handle severe perturbations more effectively.
Moreover, a convergent nature is crucial in multi-step purifi-
cation in order to ensure stability and prevent oscillatory or
divergent behavior during iterative refinement. The follow-
ing theoretical analyses formalize the convergent behavior
of our self-supervised multi-step purification framework:
Assumption 3.2. Under optimal self-supervised training                 Figure 1. Conceptual Comparison: Node v’s receptive fields (dot-
over a sufficiently large and continuous perturbation space            ted lines) when adversarially linked to node v ′ (from a different
B(G, ϵ) around the clean graph G, the purification model               community). Left: Two-layer static GNN. Right: Five GPR fil-
fθ behaves as a locally Lipschitz continuous function with             ters, each with unique coefficients γ = [γ0 , . . . , γK ] of varying
Lipschitz constant L ∈ [0, 1).                                         scales. γm controls neighbors m-hop away from node v. In GPR-2,
                                                                       self-suppression (γ0 < 0) and two-hop neighborhood emphasis
The local Lipschitz behavior of fθ arises from the self-               (γ2 > 0) form a boundary around nodes {2,3,4,5}. GPR-3 further
supervised training objective, which minimizes the recon-              suppresses one-hop neighborhood (γ1 < 0), excluding nodes 2
struction error ∥fθ (G′ ) − G∥ for perturbed inputs within             and 3, to form a boundary with nodes {4,5}.
B(G, ϵ) while enforcing fθ (G) = G for the clean graph.
Under optimal training, the model is encouraged to satisfy
∥fθ (G′ ) − fθ (G)∥ ≤ p∥G′ − G∥ for some small constant                ods must well leverage structural properties such as neigh-
p ∈ [0, 1), implying that fθ approximates a locally Lips-              borhood relationships or higher-order dependencies. Graph
chitz continuous mapping with Lipschitz constant L ∈ [0, 1)            auto-encoders (GAEs) are naturally suited for this task, as
around G. In the inductive setting, the test graph is semanti-         they encode and reconstruct graph structures, modeling both
cally similar to G, and thus the locally Lipschitz property of         node and edge relationships. However, traditional GAEs
fθ extends naturally to perturbation neighborhoods around              face two key challenges in adversarial settings:
the test graph. Empirical verification of the assumption
under various dataset is shown in Section 6.2.                         Adversarial Smoothing: Perturbations in the graph can
                                                                       propagate through the structure, blurring distinctions be-
Theorem 3.3 (Convergence of Multi-Step Purification). Let              tween clean and attacked regions. Traditional GAEs rely
G(0) = G′ be an adversarially perturbed graph, and let                 on static GNN layers (Kipf & Welling 2017; Hamilton et al.
fθ be a purification model trained and applied in a self-              2017; Xu et al. 2019b) for neighbor aggregation, which inad-
supervised manner. At each step t, define the purification             vertently smooth local variations. This causes adversarially
direction as ∆G(t) = fθ (G(t) )−G(t) , and update the graph            connected nodes to become similar in representation, reduc-
iteratively as G(t+1) = G(t) +α·∆G(t) , where α ∈ (0, 1] is            ing the model’s ability to differentiate clean and attacked
the step size. Given Assumption 3.2, the sequence (G(t) )t≥0           regions. Moreover, standard GAE decoders (Pan et al. 2018;
converges linearly to a stationary point G∗ .                          Li et al. 2023) often use proximity-based measures such as
                                                                       inner or element-wise products, further exacerbating this
Proof. Provided in Appendix A.2.                                       issue by reconstructing spurious connections.

The theorem guarantees that, under the local Lipschitz con-            Difficulties in Higher-Order Representations: Captur-
dition induced by the self-supervised training objective, the          ing higher-order structural information in GAEs typically
iterative purification process converges to a stable graph             requires stacking multiple GNN layers. However, as the
structure regardless of the step size. Importantly, this con-          number of layers increases, oversmoothing occurs (Rusch
vergence is governed by the behavior of the purification               et al. 2023), where node representations across the graph
model in isolation. In contrast, incorporating external sig-           become indistinguishable. This limits traditional GAEs to
nals, such as arbitrary classifier outputs, may interfere with         low-order structural properties, further reducing their effi-
the stability of the refinement process. The proposed decou-           cacy in purifying attacked graphs.
pling of the purifier from the classifier is therefore essential       Motivated by these limitations, we propose GPR-GAE, a
for ensuring both theoretical convergence and robustness               novel graph auto-encoder architecture that utilizes diverse
against adversarial attacks.                                           representations from multiple GPR filters, addressing the
                                                                       challenges of traditional GAEs while enhancing the struc-
3.3. Designing the Purifier                                            tural capabilities. The key intuitions are as follows:
To effectively differentiate clean from attacked graph re-             i) Flexible Neighborhood Aggregation: GPR filters em-
gions while adapting to diverse structures, purification meth-         ploy learnable coefficients γ to selectively aggregate neigh-

                                                                   4
                               Self-supervised Adversarial Purification for Graph Neural Networks

borhood information from different ranges. Unlike stacking               4.2. Edge Encoding
static GNN layers, this approach prevents oversmoothing,
                                                                         The edge representation Ei,j ∈ RZ2 , where Z2 is the edge
preserving node-level distinctions while effectively captur-
                                                                         embedding dimension, is computed as:
ing higher-order structural dependencies.
ii) Diverse Structural Aspects: As illustrated in Figure 1,                          Ei,j = ϕ(HGPRGAE
                                                                                               i      ||HGPRGAE
                                                                                                         j      ) · We ,               (6)
each GPR filter captures unique structural neighboring as-
                                                                         where the concatenation of encoded node embeddings of
pects of nodes through learnable continuous coefficients,
                                                                         i and j are transformed by an activation function ϕ and a
with their sign and magnitude enabling fine-grained empha-
                                                                         multiplication by a learnable weight matrix We .
sis or suppression of the corresponding neighborhoods. By
leveraging multiple unique GPR filters with varying sizes,
GPR-GAE can utilize diverse, multi-scale structural rep-                 4.3. Edge Decoding
resentations. This allows modeling of complex structures                 The encoded edge embeddings are order-variant, where
while mitigating adversarial smoothing by avoiding reliance              Ei,j and Ej,i are two different representations. So we first
on single representations derived from fixed aggregations.               compute the directed link prediction score:
We further extend our motivations in Appendix G, empir-
                                                                                          Âi→j = σ(ϕ(Ei,j ) · Wd ),                   (7)
ically showing how GPR-GAE moves beyond the simple
proximity focus of traditional GAEs to capture complex                   where Wd ∈ RZ2 ×1 is a learnable weight vector and σ
structural properties. The appendix demonstrates GPR-                    is the sigmoid function. Given that our work focuses on
GAE’s ability to leverage higher-order information and                   undirected graphs, the final link prediction score Âij is
distinguish between proximal connections, highlighting its               obtained by averaging the bidirectional predictions:
advanced structural encoding capabilities and forming a
foundation for its application in adversarial purification.                                          Âi→j + Âj→i
                                                                                            Âij =                 .                   (8)
                                                                                                           2
4. GPR-GAE                                                               The resulting Âij values form the predicted adjacency ma-
4.1. Node Encoding                                                       trix Â, where each entry represents the probability of an
                                                                         edge existing between the corresponding nodes.
We employ K + 1 distinct GPR filters to capture multi-scale
structural information across varying neighborhood sizes.
The output of the k-th GPR filter, Hθk (k = 0, . . . , K), is:           5. Adversarial Purification
                                                                         5.1. Perturbed Graph Sampling for Training
            k
                                                                         To sample perturbed graphs for training, we define the sam-
            X
   Hθk =          γk,m (Ãm
                          ns H
                              (0)
                                  ),   H(0) = X · Wn .        (4)
            m=0                                                          ple space B(G, (p, q, η)), where we apply three random
                                                                         perturbation methods sequentially to G. The parameters
                                                                         p, q, η represent the budgets for each perturbation method.
Here, γk = [γk,0 , γk,1 , . . . , γk,k ] are the learnable coeffi-
cients for the k-th GPR filter, where γk,m weighs the contri-            i) Edge Injection. We begin by injecting new edges into the
bution of the m-hop neighborhood. H(0) ∈ RN ×Z1 denotes                  graph G = (V, E). Specifically, we uniformly sample a set
the initial linearly transformed node embeddings, where Z1               of edges Einject ⊆ E C , where E C denotes the set of edges not
is the embedding dimension. Note that Hθ0 = H(0) is fixed                present in E. The number of injected edges is determined by
as the initial node embeddings. We use a normalized adja-                the injection ratio p, such that |Einject | = p · |E|. These edges
cency matrix without self-loops (Ãns ) to reduce potential              are added to the graph, resulting in edge set E ′ = E ∪ Einject .
excessive self-influence, promoting aggregation from dis-
                                                                         ii) Edge Masking. Next, we mask a subset of edges from
tinct neighborhoods for more discriminative representations.
                                                                         the modified graph. The masked edge set is defined as
The final encoded node embedding, denoted as HGPRGAE ∈                   Emask = Emask orig ∪ Emask inj , where:
RN ×(K+1)·Z1 , is formed by concatenating the representa-
tions from all K+1 GPR filters:                                             • Emask orig ⊆ E consists of original edges uniformly
                                                                              sampled from E, with |Emask orig | = q · |E|,
                                   K
                    HGPRGAE =         H .
                                   k=0 θk
                                                              (5)           • Emask inj ⊆ Einject consists of injected edges uniformly
                                                                              sampled from Einject , with |Emask inj | = q · |Einject |.
This concatenation creates a rich, multi-scale representation
for downstream tasks to effectively utilize.                             Edge masking results in an edge set E ′ = E ′ \ Emask .

                                                                     5
                                Self-supervised Adversarial Purification for Graph Neural Networks

iii) Edge Reweighting. Finally, we reweight the remaining
edges in E ′ . For each edge in E ′ , originally weighted as 1,
we assign a new weight randomly sampled from the range
[β, β · η], where η is a scaling factor. Note that the specific
value of β is inconsequential, as it is normalized during
adjacency matrix processing.
Resulting Perturbed Graph. The perturbed graph sam-
pled from B(G, (p, q, η)) is defined as G′ = (V, E ′ ), where
E ′ incorporates the effects of edge injection, masking,                      Figure 2. GCN classifier performance on attacked Cora. Node clas-
and reweighting. Equivalently, G′ can be represented as                       sification accuracy over purification steps using GPR-GAE multi-
(A′ , X), where A′ is a modified adjacency matrix with the                    step purification with τ = 1/1000, and α ∈ {0.3, 0.5, 0.7, 1}.
continuous edge weights. While edge injection and edge
masking define discrete boundaries for the sample space,
edge reweighting smooths these boundaries into continuous                     weights in Atest are iteratively updated as:
space. This enables the learning of more generalized ∆G,
                                                                                A(t+1) = A(t) + α · ∆A(t) ,
or more specifically, ∆A = A − A′ , providing directions                                                                                   (12)
for purifying the graph structure toward its clean state.                        ∆A(t) = Â(t) − A(t) ,      Â(t) = fθ (A(t) , Xtest ).

5.2. Learning Objective                                                       Here, A(0) = Atest , and ∆A(t) adjusts the graph structure
The learning objective of GPR-GAE is to purify the per-                       based on Â(t) . The step size α ∈ (0, 1] balances retaining
turbed graph G′ by restoring its adjacency matrix A′ to                       the current state and incorporating updates. The process
                                                                                                     (t)
approximate the original A. The model takes G′ as input                       terminates when ∥∆A∥A(t) ∥
                                                                                                         ∥
                                                                                                           ≤ τ . The final refined adjacency
and outputs link score predictions Â, representing edge                                 ∗
                                                                              matrix, A , is passed to the GNN classifier fψ without dis-
likelihoods in Eall = E ∪ Einject . These predictions are                     cretization, producing the final classification fψ (A∗ , Xtest ).
optimized with the following two losses:
                                                                              Figure 2 illustrates the accuracy across purification steps
(i) Restoration Loss. The restoration loss quantifies the                     using GPR-GAE as the purifier. The classification accuracy
model’s ability to recover the structure of the original graph.               improves with each step, demonstrating the effectiveness of
It optimizes the link prediction scores Â for positive edges                 the multi-step purification process. The results also show
in E and negative edges in Einject . The loss is defined as:                  consistent convergence across all α values under the termi-
                                                                              nal condition. For practical use, we set α = 1, τ = 1/1000,
                    1 X
       Lrestore =              log(1 − Âij )                                 and limit the maximum purification steps to 5.
                   |E|
                        {i,j}∈E
                            1            X                                    5.4. Computational Complexity
                    +                                log(Âij ).    (9)
                        |Einject |                                            In real-world graphs, where the number of nodes is N , the
                                     {i,j}∈Einject
                                                                              number of edges is |E|, the feature and the hidden dimen-
(ii) Symmetry Loss. The symmetry loss ensures consis-                         sion is Z, the complexity of node encoding in GPR-GAE is
tency in link prediction scores for edges in Eall regardless                  O(K · |E| · Z), the same as GCN with K-layers. For multi-
of node ordering. It is defined as:                                           step purification process with the number of maximum pu-
                                                                              rification steps fixed as 5, the complexity is O(K · |E| · Z 2 ).
                 1       X                     2
      Lsym =                     Âi→j − Âj→i .        (10)                  We provide detailed derivations in Appendix B.
               |Eall |
                        {i,j}∈Eall

                                                                              6. Experiments
The total loss function combines these objectives:
                                                                              We conducted experiments on various datasets including
                L(θ) = Lrestore + δ · Lsym ,                       (11)       Cora, Cora ML, Citeseer (Bojchevski & Günnemann 2018),
where δ > 0 balances restoration and symmetry losses,                         Pubmed (Sen et al. 2008), OGB-arXiv (Hu et al. 2020), and
ensuring consistency throughout the predictions.                              Chameleon with removed duplicates (Platonov et al. 2023).
                                                                              We use an inductive split with 20 labeled nodes per class
                                                                              for train and validation, a stratified test set of 10% of nodes,
5.3. Multi-step Purification Process
                                                                              and the remaining nodes as unlabeled training data. For
During the test stage, the purification process is applied to                 Chameleon and OGB-arXiv, we use their provided splits
the test graph Gtest = (Atest , Xtest ). At each step t, the edge             with fully labeled training sets.

                                                                          6
                                    Self-supervised Adversarial Purification for Graph Neural Networks


Table 1. Adaptive attack: Test accuracy (%) on Cora for models with different methods: Vanilla (standard training), Self-training
(pseudo-labeling), Adversarial training (PRBCD or LRBCD with training ϵ = 0.2), and GPR-GAEGNN paired with either vanilla or
self-trained classifiers. Robust GNNs (EvenNet, SoftMedianGDC) are compared alongside GCN variants. Results are evaluated under
clean conditions and adversarial attacks (LRBCD and PRBCD) with varying budget ϵ. Bold values indicate the best performance within
each category, while curly underlined values highlight the second-best performance.

                             Adv.     Pseu.   (Adv.eval) →
                                                         −              LRBCD         PRBCD      LRBCD       PRBCD       LRBCD      PRBCD
           Model             Pur.     Lab.      (Adv.tr) ↓    Clean         ϵ = 0.1    ϵ = 0.1    ϵ = 0.25    ϵ = 0.25    ϵ = 0.5    ϵ = 0.5
         EvenNet             ✗         ✗           ✗         81.4±2.0   65.2±2.3      65.7±1.4   54.9±1.1    51.7±3.3    45.7±0.5   35.6±0.9
     SoftMedianGDC           ✗         ✗           ✗         77.4±1.8   69.1±1.9      67.3±1.9   64.1±1.4    60.0±1.4    59.1±1.2   48.2±1.1
                Vanilla      ✗         ✗           ✗         79.4±0.7   64.2±2.3      60.1±1.0   51.2±0.6    46.9±1.5    40.5±2.2   29.3±2.3
              Self-trained   ✗         ✓           ✗         82.5±0.9   70.7±1.6      65.0±0.9   60.7±1.7    52.7±1.2    48.4±1.1   37.2±2.1
   GCN
             Adv.-trained    ✗         ✓       LRBCD         80.5±1.8   70.4±3.2      63.8±1.5   62.8±2.7    51.1±1.4    52.6±2.8   33.4±1.6
             Adv.-trained    ✗         ✓       PRBCD         80.3±1.7   69.5±1.5      64.0±1.7   61.6±2.0    51.7±2.4    51.7±1.8   34.6±1.9
   GPR-GAEGCN Vanilla        ✓         ✗           ✗         79.4±0.3   75.9±2.0      75.6±2.1   74.1±1.4    69.7±2.9    72.5±1.7   61.3±3.6
                                                                        ::::::        ::::::     ::::::                  ::::::
    GPR-GAEGCN Self          ✓         ✓           ✗         81.6±0.7   78.5±1.6      77.3±0.9   76.6±1.8    69.0±1.2    75.0±1.6   60.8±1.4
                                                             ::::::                                          ::::::                 ::::::
                Vanilla      ✗         ✗           ✗         76.4±1.3   50.2±2.4      50.5±4.0   29.5±3.1    36.2±4.2    19.8±2.4   21.4±1.5
              Self-trained   ✗         ✓           ✗         79.4±2.3   53.5±6.1      53.0±4.6   34.9±6.1    36.5±5.8    24.1±6.7   24.8±5.0
    GAT
              Adv.-trained   ✗         ✓       LRBCD         80.7±0.8   67.4±0.7      62.0±0.8   59.4±2.4    48.4±0.5    50.5±2.7   32.2±1.3
              Adv.-trained   ✗         ✓       PRBCD         78.8±1.7   65.2±4.2      62.1±3.5   50.6±3.8    51.2±4.6    38.1±6.9   39.0±7.3
    GPR-GAEGAT Vanilla       ✓         ✗           ✗         76.0±1.6   71.3±2.1
                                                                        ::::::
                                                                                      71.8±2.4
                                                                                      ::::::
                                                                                                 69.0±1.6
                                                                                                 ::::::
                                                                                                             65.1±1.1
                                                                                                             ::::::
                                                                                                                         67.1±1.3
                                                                                                                         ::::::
                                                                                                                                    59.9±3.0
                                                                                                                                    ::::::
     GPR-GAEGAT Self         ✓         ✓           ✗         79.4±2.2   74.9±2.8      74.0±3.6   72.8±3.9    69.3±5.4    71.7±4.5   60.5±5.3
                                                             ::::::
                Vanilla      ✗         ✗           ✗         81.4±1.2
                                                             ::::::
                                                                        65.6±0.7      63.0±1.4   55.6±0.9    49.4±1.9    44.2±2.7   33.1±3.2
  GPRGNN      Self-trained   ✗         ✓           ✗         81.1±1.8   68.5±1.3      65.5±2.2   60.2±2.3    51.8±1.3    51.9±2.0   36.8±1.9
              Adv.-trained   ✗         ✓       LRBCD         80.0±1.0   71.2±3.0      65.4±1.1   64.8±2.6    54.0±1.2    57.7±4.4   38.2±2.7
              Adv.-trained   ✗         ✓       PRBCD         79.5±2.0   73.2±2.8      68.0±2.4   68.5±3.1    61.1±4.4    62.8±5.6   48.5±5.3
  GPR-GAEGPRGNN Vanilla      ✓         ✗           ✗         81.6±1.1   77.4±1.4      77.0±0.8   76.4±0.9    70.6±2.3    75.6±1.9   64.2±1.0
   GPR-GAEGPRGNN Self        ✓         ✓           ✗         80.7±1.6   77.2±1.0      75.9±1.2   75.5±1.1    70.2±1.6    74.7±1.3   61.6±1.0
                                                                        ::::::        ::::::     ::::::      ::::::      ::::::     ::::::
                Vanilla      ✗         ✗           ✗         82.1±1.2   66.2±1.3      64.5±0.8   56.4±1.3    50.9±1.2    46.0±2.5   32.6±2.6
              Self-trained   ✗         ✓           ✗         82.3±1.8   70.6±1.0      68.2±1.1   62.1±2.8    54.7±1.0    51.1±3.2   37.7±2.0
   APPNP
              Adv.-trained   ✗         ✓       LRBCD         82.4±1.5
                                                             ::::::
                                                                        71.5±1.3      66.8±0.6   63.4±2.8    54.0±1.4    54.4±1.8   35.6±2.3
              Adv.-trained   ✗         ✓       PRBCD         81.2±1.5   71.2±1.4      67.6±0.6   64.1±1.3    55.3±1.3    54.1±0.7   37.8±3.2
   GPR-GAEAPPNP Vanilla      ✓         ✗           ✗         81.6±1.4   77.6±1.8      77.1±1.5   77.3±1.7    72.4±1.9    76.4±1.8   64.3±2.7
                                                                        ::::::        ::::::     ::::::                  ::::::     ::::::
    GPR-GAEAPPNP Self        ✓         ✓           ✗         82.5±1.7   79.6±2.3      77.3±2.9   77.9±2.2    71.4±2.3    76.5±2.7   65.2±2.0
                                                                                                             ::::::




GPR-GAE. We set K = 7, symmetry loss factor δ = 0.2,                         LRBCD to create adversarial training samples. Additionally
and the training sample budget to (p, q, η) = (1.5, 0.2, 3),                 the non-adversarial counterpart, self-training, uses pseudo-
with q = 0.5 tuned for OGB-arXiv. We provide abla-                           labeling without adversarial training, and the expansion of
tion studies of GPR-GAE in Appendix F. Additionally,                         the training set typically increases the robustness of both
GPR-GAEGNN denotes a GNN classifier performing infer-                        adversarial and self-training through generalization.
ence on the purified graph produced by GPR-GAE.
Attacks. PRBCD (Geisler et al. 2021) is a gradient-based                     6.1. Experimental Results
topology attack that perturbs graph structures by optimizing                 Adaptive attack. We evaluate robustness under adaptive at-
an attack objective over randomized edge blocks, adhering                    tacks, where the attacker has full knowledge of the model’s
to a defined perturbation budget. Its local constraint variant,              architecture and parameters, crafting model-specific worst-
LRBCD (Gosch et al. 2023), applies restrictions to perturba-                 case perturbations. Our adversarial purification method,
tions within a node’s local neighborhood, simulating more                    GPR-GAE, is tested in two configurations—attached to
realistic attack scenarios.PThe ϵ for attacks parametrizes the               either vanilla or self-trained classifiers—and compared
global budget ∆ = ϵ · v∈Vt dv /2 relative to the degree                      against vanilla, self-training, adversarial training, and robust
dv for the set of targeted nodes Vt .                                        GNNs (EvenNet, SoftMedianGDC). For the baseline classi-
Adversarial Training. For adversarial training, we follow                    fier, we employ four GNN models: GCN, GAT (Veličković
the pseudo-labeling framework proposed by Gosch et al.                       et al. 2018), GPRGNN, and APPNP (Gasteiger et al. 2019).
(2023). For datasets with unlabeled training nodes, a sep-                   Note that GPRGNN demonstrated state-of-the-art robust-
arate classifier is pre-trained on labeled nodes to assign                   ness under adversarial training in the prior work, flexibly
previously unlabeled nodes with pseudo-labels, expanding                     learning robust propagation pathways in adversarial settings.
the labeled training set. The final model is then trained on                 Table 1 highlights that, on the Cora dataset, GPR-GAE
the expanded labeled training set, using either PRBCD or                     achieves significantly higher robustness compared to all


                                                                        7
                             Self-supervised Adversarial Purification for Graph Neural Networks




         (a) Citeseer                     (b) Cora ML                            (c) Pubmed                                    (d) Chameleon

Figure 3. Adaptive Attack: Comparison of test accuracy (%) for Vanilla, Adversarial Training (PRBCD with ϵ = 0.2), and
GPR-GAEGNN Vanilla under PRBCD attacks with perturbation budgets ϵ = 0.1, 0.25, 0.5 on various datasets and GNN classifiers.



other GNN model variants, including robust GNNs, under               Table 2. Non-adaptive attack: Average test accuracy (%) in ad-
adaptive attacks. For example, while adversarially trained           versarial purification methods and robust GNNs under clean con-
GPRGNN (PRBCD)—the most robust method aside from                     ditions and transfer attacks (PRBCD) from vanilla GCN. “OOM”
GPR-GAE—achieves 48.5% test accuracy against PRBCD                   indicates “Out-Of-Memory.”
attacks with ϵ = 0.5, GPR-GAEGPRGNN Vanilla improves this                                  Citeseer (small)     Pubmed (medium)       OGB-arXiv (large)
by 15.7 percentage points through its multi-step refinements,               Model          Clean / 0.25 / 0.5    Clean / 0.25 / 0.5    Clean / 0.25 / 0.5
demonstrating its robustness under severe perturbations.                 GCN (Vanilla)     71.5 / 40.0 / 25.3    75.1 / 37.1 / 24.1    70.8 / 43.1 / 33.1
Against LRBCD attacks, which restrict local edge modi-                     EvenNet         72.9 / 57.0 / 48.0    75.0 / 64.5 / 57.3    66.2 / 46.7 / 39.0
                                                                                                                  ::                           :: ::
fications proportionally to node degrees, GPR-GAE main-                 SoftMedianGDC      71.7 / 52.1 / 37.5
                                                                                           ::
                                                                                                                 73.9 / 53.5 / 40.2    70.5 / 44.4 / 35.7
tains strong performance, with its largest accuracy drop                 Jaccard-GCN       69.8 / 50.4 / 40.6    74.3 / 46.4 / 36.0    67.6 / 43.9 / 35.0
                                                                          SVD-GCN          66.7 / 59.8 / 46.7    70.7 / 68.0 / 61.4          OOM
relative to clean data being only 8.9 percentage points for               GOOD-AT          68.1 / 60.8 / 56.6    73.0 / 70.5 / 68.9          OOM
                                                                                                  :: ::                  :: ::
GPR-GAEGAT Vanilla . This underscores GPR-GAE’s signifi-              GPR-GAEGCN Vanilla   71.2 / 68.7 / 66.4    75.1 / 73.5 / 72.0    69.1 / 49.2 / 42.3
                                                                                                                                        ::
cance in defending against more realistic attack scenarios.
In terms of clean accuracy, adversarially trained (PRBCD)
GPRGNN sacrifices 1.6 percentage points compared to its
non-adversarial counterpart, self-trained GPRGNN. In con-            GAE consistently achieves superior defense performance
trast, GPR-GAE shows minimal trade-offs, with the largest            across all four GNN models and datasets, demonstrating
drop being 0.9 points when paired with self-trained GCN.             both its effectiveness and broad applicability.
These results demonstrate that GPR-GAE successfully miti-
                                                                     Non-adaptive attack. Unlike GPR-GAE, prior adversar-
gates the trade-off by decoupling accuracy and robustness
                                                                     ial purification methods such as SVD-GCN, Jaccard-GCN,
into separate modules with different specialties, achieving
                                                                     and GOOD-AT rely on discrete, non-differentiable purifica-
strong robustness against adaptive attacks while preserv-
                                                                     tion, preventing direct gradient-based adaptive attacks and
ing clean accuracy. Notably, for GPR-GAE, overall per-
                                                                     each requiring different attack strategies. For general eval-
formance against attacks tends to correlate with the initial
                                                                     uation of adversarial purification methods, we conduct ex-
clean accuracy of the base classifier, rather than the type of
                                                                     periments under non-adaptive settings, transferring attacks
GNN or whether it was self-trained or not.
                                                                     from adaptively attacked vanilla GCNs using PRBCD. In
In Figure 3, we further compare the robustness of                    Table 2, we compare GPR-GAEGCN Vanilla with prior adver-
GPR-GAEGNN Vanilla against Vanilla and Adversarial Train-            sarial purification methods and robust GNNs across datasets
ing (PRBCD) across various datasets, including three ho-             of varying scales: Citeseer (N = 2, 110, |E| = 3, 668),
mophilic datasets (Citeseer, Cora ML, Pubmed) and a het-             Pubmed (N = 19, 717, |E| = 44, 324), and OGB-arXiv
erophilic dataset (Chameleon). The results show that GPR-            (N = 169, 343, |E| = 1, 157, 799).


                                                                 8
                                 Self-supervised Adversarial Purification for Graph Neural Networks




                               (a) Cora                                                        (b) Chameleon
Figure 4. Visualization of the learned coefficients for each GPR filter in GPR-GAE. For the coefficient value γi,j , i indicates the GPR
Filter Index (i-th GPR Filter) and j indicates the Coefficient Index (for j-th hop). We adjust the sign of the values so that the last
coefficient values of each GPR filter are positive.


             Table 3. Empirical Lipschitz constant L̂.                 0.5. For each pair, we compute:

   Cora     Cora ML   Citeseer   Pubmed    OGB-arXiv   Chameleon                    ∥fθ (A1 , Xtest ) − fθ (A2 , Xtest )∥F
                                                                                                                           ,
   0.3988    0.4587   0.2788      0.4473     0.4214      0.3238                                ∥A1 − A2 ∥F
                                                                       and report the maximum value across the 100 sampled pairs
                                                                       as the empirical Lipschitz constant L̂. As shown in Table 3,
Heuristic-based approaches such as Jaccard-GCN and SVD-                all values remain strictly below 1, supporting the convergent
GCN exhibit either a significant drop in clean accuracy                nature of our multi-step purification framework.
or limited robustness, making them less adaptable across               Unique learned filters. In Figure 4, we visualize the learned
datasets. GOOD-AT, which detects adversarial edges using               coefficients of GPR-GAE under a homophilic graph (Cora)
classifier-based embeddings, provides improved robustness              and a heterophilic graph (Chameleon). Under supervised set-
over heuristics but does not fully utilize structural informa-         tings, as discussed in Chien et al. (2021), GPRGNN tends to
tion, falling short in overall compared to GPR-GAE. More-              learn a single GPR filter, with coefficients exhibiting consis-
over, training of GOOD-AT relies on iterative dense matrix             tent signs on homophilic graphs and fluctuating patterns on
optimization for adversarial sample generation, making it              heterophilic ones. In contrast, GPR-GAE, trained in our self-
impractical for large graphs like OGB-arXiv, a limitation              supervised framework, learns diverse coefficients regardless
also present in SVD-GCN’s low-rank approximation.                      of the graph’s homophily. This diversity indicates that each
While robust GNNs (EvenNet, SoftMedianGDC) may                         GPR filter selectively includes or suppresses neighborhood
achieve higher clean accuracy, GPR-GAE maintains su-                   information, resulting in distinct multi-scale structural rep-
perior adversarial robustness, generally with larger margins           resentations. We provide visualization for other datasets
under stronger perturbations, while preserving clean accu-             in Appendix D, where the variation in learned coefficients
racy close to its attached classifier, vanilla GCN. Addition-          across datasets further highlights GPR-GAE’s adaptability
ally, it scales efficiently to large datasets like OGB-arXiv           as a data-driven purification model.
by leveraging mini-batch processing, training with 1% of
edges per epoch, and purifying the test stage graphs in                7. Conclusion
batches—ensuring both memory efficiency and robustness.
                                                                       We propose a self-supervised adversarial purification frame-
                                                                       work for GNNs, explicitly decoupling accuracy and robust-
6.2. Empirical Analysis
                                                                       ness to mitigate their trade-off. At its core is GPR-GAE,
Empirical estimation of Lipschitz constant. To support                 a specialized purifier trained in a self-supervised manner,
Theorem 3.3, we empirically estimate the local Lipschitz               leveraging multi-scale neighborhood information for en-
constant of the model on the test stage graph, where the               hanced structural learning. Through multi-step purification,
output after a single step purification is denoted as fθ (A, X).       GPR-GAE demonstrates state-of-the-art robustness across
We randomly sample 100 pairs of perturbed adjacency ma-                diverse datasets and attacks, particularly under high per-
trices (A1 , A2 ), each generated by injecting random edges            turbations, while preserving clean accuracy, making it a
into the test graph with a random perturbation budget under            versatile plug-and-play defense module for GNN classifiers.

                                                                   9
                             Self-supervised Adversarial Purification for Graph Neural Networks

Impact Statement                                                      Gosch, L., Geisler, S., Sturm, D., Charpentier, B., Zügner,
                                                                        D., and Günnemann, S. Adversarial training for graph
This paper presents work whose goal is to advance the field             neural networks: Pitfalls, solutions, and new directions.
of Machine Learning. While our work may have potential                 Advances in Neural Information Processing Systems,
societal implications, none require explicit highlighting in            2023.
this context.
                                                                      Hamilton, W., Ying, Z., and Leskovec, J. Inductive repre-
Acknowledgements                                                        sentation learning on large graphs. Advances in Neural
                                                                        Information Processing Systems, 2017.
This work was supported by the Institute of Information
& Communications Technology Planning & evaluation                     He, M., Wei, Z., and Wen, J.-R. Convolutional neural
(IITP) grant and the National Research Foundation of Korea              networks on graphs with chebyshev approximation, revis-
(NRF) grant funded by the Korean government (MSIT) (RS-                 ited. Advances in Neural Information Processing Systems,
2019-II190421, IITP-2025-RS-2020-II201821, RS-2024-                     2022.
00438686, RS-2024-00436936, RS-2023-00225441, RS-
2024-00448809, IITP-2025-RS-2024-00360227, RS-2025-                   Hu, W., Fey, M., Zitnik, M., Dong, Y., Ren, H., Liu, B.,
02218768, RS-2025-25443718, RS-2025-25442569, RS-                       Catasta, M., and Leskovec, J. Open graph benchmark:
2025-02653113).                                                         Datasets for machine learning on graphs. Advances in
                                                                       Neural Information Processing Systems, 2020.

References                                                            Jung, H. and Park, H. Balancing graph embedding smooth-
                                                                        ness in self-supervised learning via information-theoretic
Bojchevski, A. and Günnemann, S. Deep gaussian em-
                                                                        decomposition. In The Web Conference, 2025.
  bedding of graphs: Unsupervised inductive learning via
  ranking. In International Conference on Learning Repre-             Kang, H., Han, G., and Park, H. Unr-explainer: Counterfac-
  sentations, 2018.                                                     tual explanations for unsupervised node representation
Chien, E., Peng, J., Li, P., and Milenkovic, O. Adaptive                learning models. In International Conference on Learn-
  universal generalized pagerank graph neural network. In               ing Representations, 2024.
  International Conference on Learning Representations,
                                                                      Kipf, T. N. and Welling, M. Semi-supervised classifica-
  2021.
                                                                        tion with graph convolutional networks. In International
Entezari, N., Al-Sayouri, S. A., Darvishzadeh, A., and Pa-              Conference on Learning Representations, 2017.
  palexakis, E. E. All you need is low (rank) defending
  against adversarial attacks on graphs. In International             Lei, R., Wang, Z., Li, Y., Ding, B., and Wei, Z. Even-
  Conference on Web Search and Data Mining, 2020.                       net: Ignoring odd-hop neighbors improves robustness of
                                                                        graph neural networks. Advances in Neural Information
Fan, W., Ma, Y., Li, Q., He, Y., Zhao, E., Tang, J., and Yin,           Processing Systems, 2022.
  D. Graph neural networks for social recommendation. In
  The Web Conference, 2019.                                           Li, J., Peng, J., Chen, L., Zheng, Z., Liang, T., and Ling,
                                                                        Q. Spectral adversarial training for robust graph neural
Feng, F., He, X., Tang, J., and Chua, T.-S. Graph adver-                network. IEEE Transactions on Knowledge and Data
  sarial training: Dynamically regularizing based on graph              Engineering, 2022.
  structure. IEEE Transactions on Knowledge and Data
  Engineering, 2019.                                                  Li, J., Wu, R., Sun, W., Chen, L., Tian, S., Zhu, L., Meng,
                                                                        C., Zheng, Z., and Wang, W. What’s behind the mask:
Gasteiger, J., Bojchevski, A., and Günnemann, S. Com-
                                                                        Understanding masked graph modeling for graph autoen-
  bining neural networks with personalized pagerank for
                                                                        coders. In ACM SIGKDD Conference on Knowledge
  classification on graphs. In International Conference on
                                                                        Discovery and Data Mining, 2023.
  Learning Representations, 2019.
Geisler, S., Schmidt, T., Şirin, H., Zügner, D., Bojchevski,        Li, K., Chen, Y., Liu, Y., Wang, J., He, Q., Cheng, M.,
  A., and Günnemann, S. Robustness of graph neural net-                and Ao, X. Boosting the adversarial robustness of graph
  works at scale. Advances in Neural Information Process-               neural networks: An ood perspective. In International
  ing Systems, 2021.                                                    Conference on Learning Representations, 2024.

Goodfellow, I. J., Shlens, J., and Szegedy, C. Explaining             Li, Y., Jin, W., Xu, H., and Tang, J. Deeprobust: a platform
  and harnessing adversarial examples. International Con-               for adversarial attacks and defenses. AAAI Conference
  ference on Learning Representations, 2015.                            on Artificial Intelligence, 2021.

                                                                 10
                            Self-supervised Adversarial Purification for Graph Neural Networks

Madry, A., Makelov, A., Schmidt, L., Tsipras, D., and
 Vladu, A. Towards deep learning models resistant to
 adversarial attacks. In International Conference on Learn-
 ing Representations, 2018.
Mujkanovic, F., Geisler, S., Günnemann, S., and Bojchevski,
 A. Are defenses for graph neural networks robust? Ad-
 vances in Neural Information Processing Systems, 2022.
Pan, S., Hu, R., Long, G., Jiang, J., Yao, L., and Zhang, C.
  Adversarially regularized graph autoencoder for graph
  embedding. In International Joint Conference on Artifi-
  cial Intelligence, 2018.
Platonov, O., Kuznedelev, D., Diskin, M., Babenko, A., and
  Prokhorenkova, L. A critical look at the evaluation of
  GNNs under heterophily: Are we really making progress?
  In International Conference on Learning Representations,
  2023.
Rusch, T. K., Bronstein, M. M., and Mishra, S. A survey on
  oversmoothing in graph neural networks. arXiv preprint
  arXiv:2303.10993, 2023.
Sen, P., Namata, G., Bilgic, M., Getoor, L., Galligher, B.,
  and Eliassi-Rad, T. Collective classification in network
  data. AI Magazine, 2008.
Veličković, P., Cucurull, G., Casanova, A., Romero, A.,
  Liò, P., and Bengio, Y. Graph attention networks. In
  International Conference on Learning Representations,
  2018.
Wu, H., Wang, C., Tyshetskiy, Y., Docherty, A., Lu, K.,
 and Zhu, L. Adversarial examples for graph data: Deep
 insights into attack and defense. In International Joint
 Conference on Artificial Intelligence, 2019.
Wu, S., Sun, F., Zhang, W., Xie, X., and Cui, B. Graph
 neural networks in recommender systems: a survey. ACM
 Computing Surveys, 2022.
Xu, K., Chen, H., Liu, S., Chen, P.-Y., Weng, T.-W., Hong,
  M., and Lin, X. Topology attack and defense for graph
  neural networks: An optimization perspective. In In-
  ternational Joint Conference on Artificial Intelligence,
  2019a.
Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful
  are graph neural networks? In International Conference
  on Learning Representations, 2019b.
Zhang, C., Tian, Y., Ju, M., Liu, Z., Ye, Y., Chawla, N., and
  Zhang, C. Chasing all-round graph representation robust-
  ness: Model, training, and optimization. In International
  Conference on Learning Representations, 2022.
Zhang, X.-M., Liang, L., Liu, L., and Tang, M.-J. Graph
  neural networks and their current applications in bioinfor-
  matics. Frontiers in Genetics, 2021.

                                                                11
                                  Self-supervised Adversarial Purification for Graph Neural Networks

A. Theoretical Proofs
A.1. Proof of Theorem 3.1: Decomposition of Adversarial Training
We prove the decomposition of the adversarial training objective into accuracy and robustness terms.

Proof. The learning objective of adversarial training is:

                                                                               Ev∈V ℓ(fψ (G′ , v), yv )
                                                                                                      
                                                     L(ψ) =           max                                                                                          (1)
                                                                  G′ ∈B(G,ϵ)

                                                                         1 X
                                                         =       max         ℓ(fψ (G′ , v), yv ).                                                                  (2)
                                                              G ∈B(G,ϵ) |V|
                                                               ′
                                                                                v∈V


We partition V into disjoint sets Vunaffected and Vaffected , representing nodes unaffected and affected by perturbations,
respectively. Then:
                     X                           X                             X
                         ℓ(fψ (G′ , v), yv ) =           ℓ(fψ (G′ , v), yv ) +      ℓ(fψ (G′ , v), yv ).               (3)
                          v∈V                                  v∈Vunaffected                          v∈Vaffected


For all Vunaffected , the predictions remain unchanged under perturbation, and thus the corresponding losses are identical:
                                         X                           X
                                               ℓ(fψ (G′ , v), yv ) =       ℓ(fψ (G, v), yv ).                               (4)
                                             v∈Vunaffected                            v∈Vunaffected


For Vaffected , adversarial perturbations maximize the loss:
                                   X                                                           X
                                          ℓ(fψ (G′ , v), yv ) =                 ′
                                                                                  max                     ℓ(fψ (G′ , v), yv ).                                     (5)
                                                                               G ∈B(G,ϵ)
                                    v∈Vaffected                                             v∈Vaffected


Substituting back:

           |Vunaffected |        1               X                                    |Vaffected |       1                         X
 L(ψ) =                   ·                                  ℓ(fψ (G, v), yv ) +                   ·                 max                       ℓ(fψ (G′ , v), yv ). (6)
               |V|          |Vunaffected |                                               |V|         |Vaffected | G′ ∈B(G,ϵ)
                                             v∈Vunaffected                                                                       v∈Vaffected



Let λ = |Vunaffected
           |V|
                     |
                       . Finally, rewriting as expectations:

                                                                                                             Ev∈Vaffected ℓ(fψ (G′ , v), yv ) .
                                                                                                                                          
                 L(ψ) = λ · Ev∈Vunaffected ℓ(fψ (G, v), yv ) + (1 − λ) ·                         max                                                               (7)
                                                                                              G′ ∈B(G,ϵ)




A.2. Proof of Theorem 3.3: Convergence of Multi-Step Purification
Proof. Building on the locally Lipschitz continuity of fθ around G(0) with constant L ∈ [0, 1), we consider two cases based
on the choice of α.
When α = 1, the update reduces to direct application of fθ :

                                                                      G(t+1) = fθ (G(t) ).                                                                         (8)

Since fθ is locally Lipschitz continuous with constant L ∈ [0, 1), it is a contraction mapping.
When 0 < α < 1, we can define the update operator hθ as:

                                                              hθ (G) = (1 − α)G + αfθ (G).                                                                         (9)

                                                                                 12
                            Self-supervised Adversarial Purification for Graph Neural Networks

For any G1 , G2 in the neighborhood, we have

                        ∥hθ (G1 ) − hθ (G2 )∥ = ∥(1 − α)(G1 − G2 ) + α(fθ (G1 ) − fθ (G2 ))∥
                                                ≤ ∥(1 − α)(G1 − G2 )∥ + ∥α(fθ (G1 ) − fθ (G2 ))∥
                                                                                                                      (10)
                                                ≤ (1 − α)∥G1 − G2 ∥ + αL∥G1 − G2 ∥
                                                = (1 − α(1 − L)) ∥G1 − G2 ∥.

Since L < 1 and α > 0, the contraction factor 1 − α(1 − L) lies in [0, 1), so hθ is also a contraction mapping.
In both cases, the purification update defines a contraction mapping. Thus, by Banach’s Fixed-Point Theorem, the sequence
(G(t) )t≥0 converges linearly to a unique fixed point G∗ .



B. Derivation of Computational Complexity
B.1. Node Encoding in GPR-GAE
The computational complexity of node encoding in GPR-GAE is derived as follows:

   • Initial Node Representation: Computing the initial node embedding H(0) through linear transformation requires:

                                                            O(N · Z 2 ).

   • Hop Representations: The k-th hop representation is computed iteratively using:

                                                        H(k) = Ãns H(k−1) ,

     where Ãns is the normalized adjacency matrix. Each sparse matrix multiplication costs O(|E| · Z). Since this process
     is repeated for all K hops (from H(1) to H(K) ), the total cost for computing all hop representations is:

                                                          O(K · |E| · Z).

   • GPR Filter Representations: For each of the k-th GPR filter, the representation Hθk is computed as:

                                                              k
                                                              X
                                                     Hθk =           γk,m H(m) ,
                                                              m=0


     where H(m) ∈ RN ×Z . Summing all k hop representations for k-th GPR filter costs:

                                                           O(k · N · Z).

     Summing over all K + 1 filters, the total cost becomes:
                                                  K
                                                                 !
                                                  X
                                            O           k·N ·Z       ≈ O(K 2 · N · Z).
                                                  k=0


Total Node Encoding Complexity: Combining all components:

                                         O(N · Z 2 + K · |E| · Z + K 2 · N · Z).

In real-world graphs, where N ≪ |E|, and given K < 10, the final node encoding complexity can be simplified to the
dominant term:
                                                O(K · |E| · Z).

                                                              13
                             Self-supervised Adversarial Purification for Graph Neural Networks

B.2. Multi-Step Purification Complexity
The multi-step purification process iteratively updates the graph structure and includes three key components:

   • Node Encoding: Each purification step first encodes each node, which costs:

                                                          O(K · |E| · Z).

   • Edge Encoding: Each encoded edge embedding with dimension Z is computed by transforming the concatenation of
     two encoded node embeddings. The combined input dimension is 2(K + 1) · Z, resulting in a complexity of:

                                                      O(2(K + 1) · |E| · Z 2 ).

     Simplifying the constants give:
                                                          O(K · |E| · Z 2 ).

   • Edge Decoding: The edge decoder transforms the edge embeddings from Z dimensions back to a single scalar. This
     costs:
                                                      O(|E| · Z).

Complexity per Step: Summing the costs of node encoding, edge encoding, and edge decoding, the overall complexity for
a single purification step is:
                                     O(K · |E| · Z + K · |E| · Z 2 + |E| · Z).
The complexity simplifies to:
                                                       O(K · |E| · Z 2 ).

Total Multi-step Purification Complexity: Assuming a fixed number of purification steps T , the total complexity for
multi-step purification becomes:
                                              O(T · K · |E| · Z 2 ).
With T treated as a small constant of 5, this simplifies further to:

                                                       O(K · |E| · Z 2 ).


C. Experimental Settings

                                                      Table C.1. Datasets

                      Dataset          Nodes         Edges     Features        Classes   Homophily Rate
                      Cora             2,708         5,278         1,433            7         0.80
                      Cora-ML          2,810         7,981         2,879            7         0.78
                      Citeseer         2,110         3,668         3,703            6         0.73
                      Chameleon          890         8,854         2,325            5         0.23
                      Pubmed          19,717        44,324           500            3         0.80
                      OGB-arXiv      169,343     1,157,799           128           40         0.65

In this section, we summarize the experimental settings, including GPR-GAE, other models, attacks, and adversarial training.
For adversarial training and models other than GPR-GAE, we mostly follow Gosch et al. (2023), the prior work we use
as the baseline for adversarial training. All experiments are conducted on an NVIDIA A100 (80GB) GPU. However, it is
worth noting that GPR-GAE can be trained and applied to datasets, including OGB-arXiv, using an NVIDIA RTX A5000
(24GB). From an attacker’s perspective, however, adaptively attacking classifiers attached to GPR-GAE using gradient-based
methods introduces significant memory constraints. This is because these attacks require storing all edge embeddings from
GPR-GAE for gradient computation, including the blocks of edges sampled at each epoch in PRBCD attack.

                                                              14
                            Self-supervised Adversarial Purification for Graph Neural Networks

While GPR-GAE can be applied to OGB-arXiv by purifying the graph in batches, the gradient-based attacks cannot leverage
the batching strategy in their gradient computations for generating attacks. As a result, adaptive attacks on GPR-GAE
become unscalable (which could be seen as an advantage on our part), and we evaluate robustness on OGB-arXiv only in
transfer attack settings. Furthermore, PGD attacks (Xu et al., 2019a) are particularly unscalable, as they require computing
gradients for all possible edges, making them impractical to attack GPR-GAE even on small-scale graphs like Citeseer.

C.1. Models
   • GCN: Two-layer GCN with 64 hidden units. For OGB-arXiv, a three-layer GCN with 256 hidden units. While training,
     a dropout of 0.5 is applied.
   • GAT: Two-layer GAT with 64 hidden units. Single attention head and 0.5 dropout during training.
   • GPRGNN: Two-layer MLP with 64 hidden units for the initial feature transformation. The GPR coefficients are
     randomly initialized while a total of K = 10 diffusion steps are applied with 0.2 MLP dropout during training.
   • APPNP: Two-layer MLP with 64 hidden units for the initial feature transformation. A total of K = 10 diffusion steps
     are applied with 0.5 MLP dropout during training. For the coefficients, γK = (1 − α)K and γl = α(1 − α)l for l < K,
     with α fixed as 0.1.
   • GPR-GAE: We set K = 7, Z1 = 128, and Z2 = 512, using the ELU activation function. The GPR coefficients are
     initialized randomly. During training, we apply an MLP dropout rate of 0.7 for node encoding, while no dropout
     is used for edge encoding or decoding. For the OGB-arXiv dataset, we use mini-batch training with a batch ratio
     λ = 0.01, sampling 1% of the original and inserted edges for each training epoch. During the test stage, adjacency
     matrix predictions are performed in batches, which does not affect the performance purification process. Full-batch
     training and purification are applied to all other datasets.
   • Jaccard-GCN: The edges are filtered based on Jaccard dissimilarity with a threshold of 0.01. For the model, we use
     the DeepRobust library (Li et al. 2021), with modifications for ogbn-arxiv, where we use a three-layer GCN with 256
     hidden units and prune edges using cosine dissimilarity with a threshold 0.4, as the dataset has non-binary attributes.
   • SVD-GCN: Adversarial perturbations are filtered by using a low-rank approximation. For the model, we use the
     DeepRobust library.
   • GOOD-AT: We follow the settings in https://github.com/likuanppd/GOOD-AT. 20 MLP detectors with 64 hidden units
     are trained with a learning rate of 0.01 and weight decay of 0.0001 using the ADAM optimizer. Each detector is trained
     on different adversarial samples generated through attacking a GCN classifier. A threshold of 0.1 is used, where edges
     with scores that exceed the threshold are detected as Out-Of-Distribution and pruned.
   • EvenNet: Two-layer MLP with 64 hidden units (256 for OGB-arXiv) for initial feature transformation. A total of
     K = 10 is used with PPR initialization α = 0.1. We use a dropout rate of 0.5 during training.
   • SoftMedianGDC: The default configurations of Geisler et al. (2021) are used. Two-layer GDC with 64 hidden units,
     temperature T = 0.2 for the SoftMedian aggregation, Personalized PageRank diffusion coefficent α = 0.15, and
     k = 64 for sparsification. For OGB-arXiv, a three-layer GDC with 256 hidden units is used with T = 5 and α = 0.1.

C.2. Training settings
GPR-GAE is trained using the ADAM optimizer with a learning rate of 0.01 and a weight decay of 0.0001. Training is
conducted for 2000 epochs. We create 10 validation edge sets by randomly inserting negative edges with p = 0.3 · i. Here, i
indicates the i-th validation edge set. We evaluate the model every epoch by computing the mean AUC and mean AP across
the 10 validation edge sets. The model with the best performance is selected based on these metrics. When training the
classifiers, a maximum of 3000 epochs is used for training, using the Adam optimizer with a learning rate of 0.01, weight
decay of 0.001, and tanhMargin loss. An early stop method is used with a patience of 200 epochs. For adversarial training,
the first ten epochs are trained without adversarial examples.
For attack parameters in adversarial training, we use 20 epochs with no early stopping. The block size is 1 million, and the
loss type is tanhMargin. For PRBCD, the learning factor is 100, while for LRBCD, the learning factor is 20 times that of
PRBCD. When training, a budget of ϵ = 0.2 is used.

                                                            15
                             Self-supervised Adversarial Purification for Graph Neural Networks

C.3. Choice of Hyperparameters of Attacks for Evaluation
For attack parameters in the evaluation stage, we use a learning factor of 100 with 400 epochs. In the case of PRBCD, 100
additional epochs are performed with a decaying learning rate and without block resampling.




                        (a) GCN                                                               (b) GAT




                     (c) GPRGNN                                                              (d) APPNP
Figure C.1. The accuracy of GPR-GAE attached to Vanilla (a) GCN, (B) GAT, (c) GPRGNN, (d) APPNP in Cora dataset against adaptive
PRBCD attack for budgets ϵ = 0 (clean), ϵ = 0.1, ϵ = 0.25, ϵ = 0.5 using various attack loss types.


Given the differing mechanisms of adversarial purification and adversarial training methods in defending against attacks, the
optimal hyperparameters for attacks may vary between these approaches. To determine effective attack hyperparameters
for each defense strategy, we conduct a grid search across eight loss types and block sizes of [10K, 50K, 250K], under an
attack budget of ϵ = 0.5. For adversarial purification methods, we select vanilla GPRGNN combined with our GPR-GAE
as the representative model. For non-GPR-GAE methods, we select the adversarially trained (PRBCD) GPRGNN as the
representative model.
Attack Loss Type. Figure C.1 presents the accuracy of four GNN models combined with GPR-GAE’s adversarial
purification method across eight loss types with a block size of 10K on the Cora dataset. In contrast to Gosch et al. (2023),
where the tanhMargin loss type is used for attacks, the Margin loss type consistently delivers the most effective attack
performance across varying attack budgets on GPR-GAE. Consequently, we use the Margin loss for adaptive attacks on
GPR-GAE and the tanhMargin loss for attacks on other methods.

Block Size. For the PRBCD attack, we use a block size of 50K for PubMed and 10K for the other datasets
across all defense methods. For the LRBCD attack on Cora, we use a block size of 10K on GPR-GAE while using a block
size of 250K on the rest of the methods. Additionally, for a large-scale dataset, OGB-arXiv, we exceptionally use a block

                                                              16
                                 Self-supervised Adversarial Purification for Graph Neural Networks

size of 3 million.

D. Visualization of the Learned GPR Coefficients




                           (a) Cora                                                                    (b) Citeseer




                        (c) Cora ML                                                                  (d) Chameleon




                         (e) Pubmed                                                                   (f) OGB-arXiv
Figure D.2. Visualization of the learned coefficients for each GPR filter in GPR-GAE when trained for adversarial purification. For the
coefficient value γi,j , i indicates the GPR Filter Index (i-th GPR Filter) and j indicates the Coefficient Index (for j-th hop). We adjust the
sign of the values so that the last coefficient values of each GPR filter are positive.


In Figure D.2, we present the learned GPR coefficients for each of the GPR filters in GPR-GAE throughout the experiments
when K = 7. The coefficient γi,j controls the propagation of neighborhood information j-hops away for the i-th GPR
filter, allowing for fine-grained adjustment of neighborhood contributions. In Chien et al. (2021), the GPR coefficients
in GPRGNN exhibit consistent signs in homophilic graphs, while fluctuating in heterophilic graphs like Chameleon,
which have more complex graph structures. In contrast, the learned GPR coefficients in GPR-GAE generally display
greater diversity regardless of their homophilic or heterophilic nature, efficiently regulating the inclusion or exclusion of
neighborhood information. This enables the model to form distinct and unique neighborhood representations for each GPR
filter with different neighborhood sizes. Furthermore, the coefficients demonstrate clear distinctions across various datasets,
highlighting GPR-GAE’s ability to adaptively learn appropriate neighborhood representations for each dataset, making it a

                                                                     17
                            Self-supervised Adversarial Purification for Graph Neural Networks

powerful data-driven approach.

E. Algorithms

Algorithm 1 Training of GPR-GAE
 1: Input: Graph G = (A, X), perturbation budget (p, q, η), model parameters θ, maximum epochs, validation data {Gval }
 2: Output: Trained GPR-GAE purifier fθ
 3: Initialize parameters θ
 4: Set best val metric = −∞
 5: for epoch = 1 to maximum epochs do
 6:    Sample perturbed graph G′ = (A′ , X) from B(G, (p, q, η))
 7:    Predict adjacency matrix Â = fθ (G′ )
 8:    Compute total loss L
 9:    Update parameters θ using gradient descent:
                                                           θ ← θ − ∇θ L
10:   Evaluate validation metric val metric on {Gval }
11:   if val metric > best val metric then
12:      Update best val metric ← val metric
13:      Save model parameters θ∗ ← θ
14:   end if
15: end for
16: Return: Best trained purifier fθ with parameters θ ∗


Algorithm 2 Multi-Step Purification with GPR-GAE
 1: Input: Perturbed graph G′ = (A′ , X), trained purifier fθ , step size α, terminal threshold τ , GNN classifier fψ
 2: Output: Node predictions from classifier fψ
 3: Initialize A(0) = A′
 4: for t = 0 to max steps−1 do
 5:    Predict purified adjacency matrix Â(t) = fθ (A(t) , X)
 6:    Compute purification direction:
                                                      ∆A(t) = Â(t) − A(t)
 7:   Update adjacency matrix:
                                                   A(t+1) = A(t) + α · ∆A(t)
         ∥∆A(t) ∥
 8:   if ∥A(t) ∥ ≤ τ then
 9:       Break
10:   end if
11: end for
12: Set final purified adjacency matrix A∗ as the last updated adjacency matrix
13: Pass A∗ to the GNN classifier fψ
14: Return: Node predictions Ŷ = fψ (A∗ , X)




                                                             18
                              Self-supervised Adversarial Purification for Graph Neural Networks

F. Ablation Studies

                                      Table F.2. Variations of GPR-GAE and their explanations

   Variation                              Explanation

   GPR-GAE                                The original version of the model we use throughout the experiments.
   w/o multi-step purification            Single-step adjacency matrix prediction, with discretization of edges using threshold 0.1.
   w/o GPR filters                        We use a 2-layered GCN for the node encoder.
   with self-loops                        Instead of Ãns , we use Ãs , the normalized adjacency matrix with self-loops.
   w/o edge reweight                      Among the three perturbation methods in training, we remove the edge reweight process.
   smaller training perturbation budget   reduced edge injection ratio p = 1.5 to 0.5, smaller training perturbation sample space.
   w/o higher order dependencies          Reduced K = 7 to K = 2, with smaller neighborhood boundary coverage.




Figure F.3. Comparison of test accuracy for variations of GPR-GAE on Citeseer. The left figure shows accuracy under clean conditions,
while the right figure illustrates accuracy under the non-adaptive PRBCD attack on a vanilla GCN.

In this section, we conduct ablation studies regarding GPR-GAE. We use vanilla GCN as the classifier, attached with the
variations of GPR-GAE in Table F.2, and compare accuracy under clean and transfer attacks (PRBCD, ϵ = 0.5) from vanilla
GCN. Figure F.3 shows that, in general, the original variation of GPR-GAE that we use throughout the experiments achieves
the best overall results. Exceptionally for the variation with no multi-step purification, it achieves a better clean accuracy
compared to the original. However, under adversarial scenarios, it experiences a relatively large drop of accuracy compared
to the original variation with multi-step purification, showcasing the effectiveness of the continuous and gradual graph
refinements against severe perturbations.
In the case of the variation without GPR filter, which indicates replacing the node encoder with a two-layer GCN, it
performs poorly, especially under adversarial attacks. This shows that the inevitable smoothing effect coming from the static
neighborhood propagation scheme makes it highly ineffective under attacks, falling short in distinguishing between the clean
and the adversaries. The original variation shows better performance compared to the rest of the other variations, benefiting
from the non-self looped normalized adjacency matrix with more precise and distinctive control over each neighborhood
propagation, learning more generalized purification directions with the edge reweight method, learning purification directions
over a broader sample space using a relatively large perturbation budget, and the higher order dependencies from the larger
neighborhood boundary coverage.

G. Empirical Validation of Structural Encoding
To further extend the motivation presented in Section 3.3 and validate GPR-GAE’s structural encoding capabilities, we
conducted experiments to identify existent 1-hop and 2-hop connections in inductive settings. This evaluation compares the

                                                                 19
                              Self-supervised Adversarial Purification for Graph Neural Networks

GPR-GAE node encoder against three baseline node encoders: GCN, GraphSAGE, and GIN. For each node encoder, two
separate edge encoders and decoders are assigned, focusing respectively on either 1-hop connections or 2-hop connections.
In 1-hop prediction, positive samples are direct connections, while negatives are random non-connections. This task
primarily evaluates the model’s ability to capture proximity between node pairs. In 2-hop prediction, positives are two-hop
paths, and negatives are direct connections without two-hop paths. This task goes beyond simple proximity, requiring the
model to distinguish between the two types of relationships that are both proximal.

Task Definitions
  • 1-Hop Prediction: Distinguish between C1+ and C1−
        – Positive Samples (C1+ ): Direct connections in the graph.
        – Negative Samples (C1− ): Randomly selected non-connections of the same size as the positives.

  • 2-Hop Prediction: Distinguish between C2+ and C2−,dir
        – Positive Samples (C2+ ): Connections formed by two-hop paths in the graph.
        – Negative Samples (C2−,dir ): Direct connections that are not two-hop.
        – Negative Samples 2 (C2− ): Randomly selected non-two-hop connections of the same size as the positives.

Setup
  • Inductive Split: Nodes were split into 80% for training, 10% for validation, and 10% for testing. Connections in
    validation (Cval ) and testing (Ctest ) included at least one validation or test node, ensuring these connections were not
    exposed during training.

  • Training: The node encoder and both edge encoder-decoder pairs are trained jointly as part of a unified model. We use
    ADAM optimizer with a learning rate of 0.01 and a weight decay of 0.00005.
        – First Edge Encoder/Decoder:
           * Positive train connections (C1+ ): Direct connections in the training graph.
           * Negative train connections (C1− ): Random non-connections in the training graph.
           * Loss: Binary Cross-Entropy (BCE) loss on C1+ and C1− .
        – Second Edge Encoder/Decoder:
           * Positive train connections (C2+ ): Two-hop connections in the training graph.
           * Negative train connections (C2−,dir ): Direct connections that are not two-hop.
           * Negative train connections 2 (C2− ): Random non-two-hop connections.
           * Loss: Combined BCE loss on C2+ , C2−,dir , and C2− .
  • Validation:
        – Validation connections (C1+,val , C1−,val , C2+,val , C2−,dir, val ) are similarly defined but included at least one valida-
          tion node in each connection.
        – Performance was evaluated by summing the AUC across both 1-hop: (C1+,val , C1−,val ) and 2-hop:
          (C2+,val , C2−,dir, val ).
        – The model with the highest combined score was selected.

  • Testing:
        – Test connections (C1+,test , C1−,test , C2+,test , C2−,dir, test ) followed the same definitions, with at least one test node
          in each connection.
        – Performance was evaluated by the AUC across both 1-hop: (C1+,test , C1−,test ) and 2-hop: (C2+,test , C2−,dir, test ).
          In particular, for the 2-hop prediction task, the objective is to evaluate the model’s ability to differentiate between
          two types of connections, both of which are considered proximal, as they connect nodes within a relatively short
          range of 2-hops.

                                                                 20
                            Self-supervised Adversarial Purification for Graph Neural Networks




                       (a) Cora                                                              (b) Citeseer
                  Figure G.4. AUC for existent 1-hop and 2-hop link identification using different GAE models


Results
Results in Figure G.4 demonstrate that GPR-GAE achieves the highest AUC scores in both 1-hop and 2-hop prediction tasks
for K = 2 and K = 7. Unlike traditional GAE architectures, GPR-GAE exhibits a consistent performance improvement as
K increases, showcasing its ability to fully leverage higher-order dependencies while mitigating oversmoothing. Moreover,
GPR-GAE significantly outperforms traditional GAEs in the 2-hop prediction task. This highlights the advantage of its
unique multiscale neighborhood representations, which are derived from distinctively stored outputs of GPR filters. These
representations enable GPR-GAE to better model complex relationships, such as C2+,test and C2−,dir, test , moving beyond
simply encoding proximal connections. Consequently, the demonstrated results form a robust foundation for tasks such as
adversarial purification that require advanced structural capabilities.




                                                              21
