Can Directed Graph Neural Networks be Adversarially Robust?
The existing research on robust Graph Neural Networks (GNNs) fails to
acknowledge the significance of directed graphs in providing rich information
about networks' inherent structure. This work presents the first investigation
into the robustness of GNNs in the context of directed graphs, aiming to
harness the profound trust implications offered by directed graphs to bolster
the robustness and resilience of GNNs. Our study reveals that existing directed
GNNs are not adversarially robust. In pursuit of our goal, we introduce a new
and realistic directed graph attack setting and propose an innovative,
universal, and efficient message-passing framework as a plug-in layer to
significantly enhance the robustness of GNNs. Combined with existing defense
strategies, this framework achieves outstanding clean accuracy and
state-of-the-art robust performance, offering superior defense against both
transfer and adaptive attacks. The findings in this study reveal a novel and
promising direction for this crucial research area. The code will be made
publicly available upon the acceptance of this work.
Zhichao Hou, Xitong Zhang, Wei Wang, Charu C. Aggarwal, Xiaorui Liu
# Can Directed Graph Neural Networks be

###### Abstract

The existing research on robust Graph Neural Networks (GNNs) fails to acknowledge the significance of directed graphs in providing rich information about networks' inherent structure. This work presents the first investigation into the robustness of GNNs in the context of directed graphs, aiming to harness the profound trust implications offered by directed graphs to bolster the robustness and resilience of GNNs. Our study reveals that existing directed GNNs are not adversarially robust. In pursuit of our goal, we introduce a new and realistic directed graph attack setting and propose an innovative, universal, and efficient message-passing framework as a plug-in layer to significantly enhance the robustness of GNNs. Combined with existing defense strategies, this framework achieves outstanding clean accuracy and state-of-the-art robust performance, offering superior defense against both transfer and adaptive attacks. The findings in this study reveal a novel and promising direction for this crucial research area. The code will be made publicly available upon the acceptance of this work.

## 1 Introduction

Graph neural networks (GNNs) have emerged to be a promising approach for learning feature representations from graph data, owing to their ability to capture node features and graph topology information through message-passing frameworks [1; 2]. However, extensive research has revealed that GNNs are vulnerable to adversarial attacks [3; 4; 5; 6; 7]. Even slight perturbations in the graph structure can lead to significant performance deterioration. Despite the existence of numerous defense strategies, their effectiveness has been questioned due to a potential false sense of robustness against transfer attacks [8]. In particular, a recent study [8] demonstrated that existing robust GNNs are much less robust when facing stronger adaptive attacks. In many cases, these models even underperform simple multi-layer perceptions (MLPs) that disregard graph topology information, indicating the failure of GNNs in the presence of adversarial attacks. As existing research fails to deliver satisfying robustness, new strategies are needed to effectively enhance the robustness of GNNs.

It is worth noting that existing research on robust GNNs largely overlooks the significance of directed graphs in providing rich information about the networks' inherent structure. Directed graphs allow one to encode pairwise relations between entities with many relations being directed [9]. Examples of such directed graphs include citation networks [10], social networks [11], and web networks [12] where edges represent paper citations, user following relationships, or website hyperlinks, respectively. Despite many datasets being naturally modeled as directed graphs, most existing GNNs, particularly those designed for robustness, primarily focus on undirected graphs. Consequently, directed graphs
and adversarial attacks are often converted to undirected graphs through symmetrization, leading to the loss of valuable directional information.

We highlight that the link directions in graphs have inherent implications for trustworthiness [13; 14; 15]: (1) out-links are usually more reliable than in-links; and (2) it is practically more challenging to attack out-links than in-links of target nodes. For instance, in social media platforms as shown in Figure 1, it is relatively straightforward to create fake users and orchestrate large-scale link spam (i.e., in-links) targeting specific users [16]. However, hacking into the accounts of those target users and manipulating their following behaviors (i.e., out-links) are considerably more difficult [17]. Due to these valuable implications, directed graphs have played a crucial role in trust computing and spam detection in link analysis algorithms such as TrustRank [15] and EigenTrust [14] over the last two decades. However, to the best of our knowledge, the potential of directed graphs remains unexplored in the robustness and trustworthiness of GNNs.

To address this research gap, we provide the first investigation into the robustness of GNNs in the context of directed graphs and explore the potential of leveraging directed graphs to enhance the robustness of GNNs. In pursuit of this goal, our contributions can be summarized as follows:

* We analyze the limitations of existing research on attacks and defenses of GNNs. To overcome these limitations, we introduce Restricted Directed Graph Attack (RDGA), a new and realistic adversarial graph attack setting that differentiates between in-link and out-link attacks on target nodes while restricting the adversary's capability to execute out-link attacks on target nodes.
* Our performance evaluation of popular directed GNNs reveals that they suffer from lower clean accuracy and notably inadequate robustness, indicating their inability to effectively leverage the rich directed link information offered by directed graphs.
* We propose an innovative, universal, and efficient Biased Bidirectional Random Walk (BBRW) message-passing framework that effectively leverages directional information in directed graphs to enhance both the clean and robust performance of GNNs. Our solution provides a plug-in layer that substantially enhances the robustness of various GNN backbones.
* Our comprehensive comparison showcases that BBRW achieves outstanding clean accuracy and state-of-the-art robustness against both transfer and adaptive attacks. We provide detailed ablation studies to further understand the working mechanism of the proposed approach.

## 2 Preliminary: Are Directed GNNs Robust?

In this section, we first discuss the limitations of existing adversarial graph attack settings, and we introduce a new and realistic adversarial graph attack setting to overcome these limitations. We then present an insightful performance analysis of existing directed GNNs against adversarial attacks.

**Notations.** In this paper, we consider a directed graph \(\mathcal{G}=(\mathcal{V},\mathcal{E})\) with \(|\mathcal{V}|=n\) nodes and \(|\mathcal{E}|=m\) edges. The adjacency matrix of \(\mathcal{G}\) is denoted as \(\mathbf{A}\in\{0,1\}^{n\times n}\). The feature matrix of \(n\) nodes is denoted as \(\mathbf{X}\in\mathbb{R}^{n\times d}\). The label matrix is denoted as \(\mathbf{Y}\in\mathbb{R}^{n}\). The out-degree matrix of \(\mathbf{A}\) is \(\mathbf{D}_{\text{out}}=\text{diag}\left(d_{1}^{+},d_{2}^{+},...,d_{n}^{+}\right)\), where \(d_{i}^{+}=\sum_{j}\mathbf{A}_{ij}\) is the out-degree of node \(i\). The in-degree matrix of \(\mathbf{A}\) is \(\mathbf{D}_{\text{in}}=\text{diag}\left(d_{1}^{-},d_{2}^{-},...,d_{n}^{-}\right)\), where \(d_{i}^{-}=\sum_{j}\mathbf{A}_{ji}\) is the in-degree of node \(i\). \(f_{\theta}(\mathbf{A},\mathbf{X})\) denotes the GNN encoder that extract features from \(\mathbf{A}\) and \(\mathbf{X}\) with network parameters \(\theta\).

### Limitations of Existing Adversarial Graph Attack

The existing research on the attacks and defenses of GNNs focuses on undirected graphs where the original graphs and adversarial attacks are eventually converted to undirected graphs, which disregards the link direction information. As a result, existing adversarial graph attacks mostly conduct undirected graph attacks that flip both directions (in-link and out-link) of an adversarial edge once being selected [18; 19; 6; 20]. However, this common practice has some critical limitations:

Figure 1: Large-scale link spam.
* First, it is often impractical to attack both directions of an edge in graphs. For instance, flipping the out-links of users in social media platforms or financial systems usually requires hacking into their accounts to change their following or transaction behaviors, which can be easily detected by security countermeasures such as Intrusion Detection Systems [21];
* Second, the undirected graph attack setting does not distinguish the different roles of in-links and out-links, which fundamentally undermines the resilience of networks. For instance, a large-scale link spam attack targeting a user does not imply the targeted user fully trusts these in-links. But the link spam attack can destroy the feature of target nodes if being made undirected.

Due to these limitations, existing graph attacks are not practical in many real-world applications, and existing defenses can not effectively leverage useful information from directed graphs.

### Restricted Directed Graph Attack

To overcome the limitations of existing attack and defense research on GNNs, we propose Restricted Directed Graph Attack (RDGA), a new and realistic graph attack setting that differentiates between in-link and out-link attacks on target nodes while restricting the adversary's capability to execute out-link attacks on target nodes.

**Remark 1**.: _While the directed attack performs the same as the undirected attack on undirected GNNs due to the symmetrization operation, this offers unprecedented opportunities to distinguish different roles between in-links and out-links in directed graphs for directed GNNs._

**Restricted Directed Graph Attack.** Mathematically, we denote the directed adversarial attack on the directed graph \(\mathbf{A}\in\{0,1\}^{n\times n}\) as an asymmetric perturbation matrix \(\mathbf{P}\in\{0,1\}^{n\times n}\). The adjacency matrix being attacked is given by \(\tilde{\mathbf{A}}=\mathbf{A}+(\mathbf{1}\mathbf{1}^{\top}-2\mathbf{A})\odot \mathbf{P}\) where \(\mathbf{1}=[1,1,\ldots,1]^{\top}\in\mathbb{R}^{n}\) and \(\odot\) denotes element-wise product. \(\mathbf{P}_{ij}=1\) means flipping the edge \((i,j)\) (i.e., \(\tilde{\mathbf{A}}_{ij}=0\) if \(\mathbf{A}_{ij}=1\) or \(\tilde{\mathbf{A}}_{ij}=1\) if \(\mathbf{A}_{ij}=0\)) while \(\mathbf{P}_{ij}=0\) means keeping the edge \((i,j)\) unchanged (i.e., \(\tilde{\mathbf{A}}_{ij}=\mathbf{A}_{ij}\)). The asymmetric nature of this perturbation matrix indicates the adversarial edges have directions so that one direction will not necessarily imply the attack from the opposite direction.

Given the practical difficulty to attack the out-links on the target nodes, we impose restrictions on the adversary's capacity for executing out-link attacks on target nodes. The Restricted Directed Graph Attack (RDGA) is given by \(\tilde{\mathbf{A}}=\mathbf{A}+(\mathbf{1}\mathbf{1}^{\top}-2\mathbf{A})\odot \mathbf{(P}\odot\mathbf{M})\), where \(\tilde{\mathbf{P}}=\mathbf{P}\odot\mathbf{M}\) denotes the restricted perturbation. When restricting the out-link of nodes \(\mathcal{T}\) (e.g., the target nodes), the mask matrix is defined as \(\mathbf{M}_{ij}=0\)\(\forall i\in\mathcal{T},j\in\mathcal{N}\) and \(\mathbf{M}_{ij}=1\) otherwise. The attacking process closely follows existing undirected graph attacks such as PGD attack [18] or Nettack [22] but it additionally considers different attacking budgets for in-links and out-links when selecting the edges. In Section 4.3, we also study a more general RDGA that allows some portion of the attack budgets on targets' out-links where the masking matrix is partially masked.

### Performance Analysis

To answer the question of whether existing directed GNNs are robust against adversarial attacks, we evaluate the performance of directed GNNs under the common Undirected Graph Attack (UGA) setting and the proposed Restricted Directed Graph Attack (RDGA) setting. We choose the state-of-the-art directed GNNs designed for directed graphs including DGCN [23], DiGCN [24], and MagNet [25]. DGCN [23] combines a normalized first-order proximity matrix \(\hat{\mathbf{A}}_{\mathbf{F}}\) and two normalized second-order proximity matrices (\(\hat{\mathbf{A}}_{\mathbf{S}_{m}}\) and \(\hat{\mathbf{A}}_{\mathbf{S}_{m}}\)) together to construct a directed graph convolution. DiGCN [24] defines digraph Laplacian in the symmetrically normalized form as \(\mathbf{I}-\frac{1}{2}\left(\mathbf{\Pi}_{pr}^{\frac{1}{2}}\mathbf{P}_{pr} \mathbf{\Pi}_{pr}^{-\frac{1}{2}}+\mathbf{\Pi}_{pr}^{-\frac{1}{2}}\mathbf{P}_{ pr}^{T}\mathbf{\Pi}_{pr}^{\frac{1}{2}}\right)\), where \(\mathbf{P}_{pr}=(1-\alpha)\mathbf{D}_{out}^{-1}\mathbf{A}+\alpha+\frac{ \alpha}{n}\mathbf{1}^{n\times n}\) is the PageRank transition matrix and \(\mathbf{\Pi}_{pr}\) is the diagonal matrix of stationary distribution of \(\mathbf{P}_{pr}\). MagNet [25] leverages a complex Hermitian matrix to encode undirected and directed information in the magnitude and the phase of the matrix's entries, respectively. Note that we test two versions of MagNet according to the setting of its hyperparameter \(q\). Undirected-MagNet sets \(q=0\) while Directed-MagNet sets \(q>0\). Additionally, we compare their performance with simple baselines such as MLP and GCN (as an example of undirected GNNs) [26].

We test their node classification performance under different in-link attack budgets on the Cora-ML dataset following the experimental setting described in Section 4.1. We use PGD [18] for the local evasion attack. For simplicity, we transfer the attack from the surrogate model GCN. From the
results in Table 1, we can make the following observations: **(1)** Undirected GNNs (e.g., GCN and Undirected MagNet) perform the same under UGA and RDGA, which confirms the conclusion in Remark 1. It also indicates that undirected GNNs can not benefit from directed links; **(2)** In terms of clean accuracy, directed GNNs (e.g., DGCN, DiGCN, and Directed-MagNet) perform worse than undirected GNNs (e.g., GCN and Undirected-MagNet) by significant margins; **(3)** In terms of robust accuracy, directed GNNs can perform better under directed attacks (RDGA) than under undirected attacks (UGA) in some cases, but the improvements are not stable. Overall, directed GNNs are still vulnerable to adversarial attacks. They often underperform simple graph-agnostic MLP which does not use graph information even if they are tested under weak attacks transferred from the surrogate model. These observations demonstrate that existing directed GNNs are not strong in either clean or adversarial settings and they can not effectively leverage the rich information in directed links.

## 3 Methodology: Robust Directed GNNs

The preliminary study in Section 2 indicates the incapability of existing directed GNNs [23; 24; 25], which calls for novel message passing solutions that effectively leverage the rich information in directed links. In this section, we first investigate the performance of directed random walk message passing. The discovery of catastrophic failures and the false sense of robustness due to indirect attacks motivates the design of a novel biased bidirectional random walk message passing framework.

### Motivation: Directed Random Walk Message Passing

In order to differentiate the roles of in-links and out-links, we propose to explore two variants of random walk message passing: (1) \(\mathbf{RW_{out}}\): aggregates node features following out-links: \(\mathbf{X}^{l+1}=\mathbf{D}_{\text{out}}^{-1}\mathbf{AX}^{l}\); and (2) \(\mathbf{RW_{in}}\): inversely aggregates node features following in-links: \(\mathbf{X}^{l+1}=\mathbf{D}_{\text{in}}^{-1}\mathbf{A}^{\top}\mathbf{X}^{l}\). We select two popular GNNs including GCN [26] and APPNP [27] as the backbone models and substitute their symmetric aggregation matrix \(\mathbf{D}^{-\frac{1}{2}}\mathbf{A}_{\text{sys}}\mathbf{D}^{-\frac{1}{2}}\) as \(\mathbf{RW_{out}}\) and \(\mathbf{RW_{in}}\) respectively, which leads to four variants GCN-\(\mathbf{RW_{out}}\), GCN-\(\mathbf{RW_{in}}\), APPNP-\(\mathbf{RW_{out}}\), and APPNP-\(\mathbf{RW_{in}}\).

We evaluate the clean and robust node classification accuracy of these variants on the Cora-ML dataset under RDGA, following the experimental setting detailed in Section 4. It is worth emphasizing that while we transfer attacks from the surrogate model GCN as usual, we additionally test the robust performance of adaptive attacks which directly attack the victim model to avoid a potential false sense of robustness. The results in Table 2 provide the following insightful observations:

\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{Method} & \multirow{2}{*}{Clean (total)} & \multirow{2}{*}{0\% (target)} & \multicolumn{2}{c}{25\%} & \multicolumn{2}{c}{50\%} & \multicolumn{2}{c}{100\%} \\ \cline{5-10}  & & & UGA & RDGA & UGA & RDGA & UGA & RDGA \\ \hline MLP & 64.6±2.2 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 \\ \hline GCN & 81.8±1.5 & 89.5±4.1 & 66.0±49.7 & 66.0±49.7 & 40.5±48.5 & 40.5±48.5 & 12.0±6.4 & 12.0±6.4 \\ \hline  & 79.6±2.1 & 88.5±3.2 & 70.5±10.6 & 70.5±10.6 & 55.5±6.9 & 55.5±6.9 & 35.5±6.1 & 35.5±6.1 \\ \hline  & 75.0±3.1 & 89.5±7.6 & 49.0±8.0 & 76.5±13.0 & 39.5±49.6 & 54.5±7.9 & 33.5±9.5 & 38.0±1±4.2 \\ \cline{2-10}  & 75.5±2.2 & 85.0±7.4 & 49.0±8.0 & 50.0±67.3 & 33.5±49.5 & 40.5±49.1 & 16.5±6.7 & 29.0±6.2 \\ \cline{2-10}  & 57.1±5.2 & 69.5±10.4 & 65.0±10.0 & 65.0±49.7 & 63.5±7.1 & 59.5±10.6 & 53.0±7.5 & 54.0±7.0 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Classification accuracy (%) under targeted transfer attacks (Cora-ML).

\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{Method} & \multirow{2}{*}{Clean (total)} & \multirow{2}{*}{0\%} & \multicolumn{2}{c}{25\%} & \multicolumn{2}{c}{50\%} & \multicolumn{2}{c}{100\%} \\ \cline{5-10}  & & Target & Transfer & Adaptive & Transfer & Adaptive & Transfer & Adaptive \\ \hline MLP & 64.6±2.2 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 & 73.5±7.4 \\ \hline GCN & 81.8±1.5 & 89.5±46.1 & 66.0±49.7 & 66.0±49.7 & 40.5±48.5 & 40.5±48.5 & 12.0±6.4 & 12.0±6.4 \\ \cline{2-10} GCN-\(\mathbf{RW_{out}}\) & 75.9±1.7 & 86.5±46.3 & 86.5±46.3 & 52.0±8.1 & 86.5±46.3 & 28.0±4.6 & 86.5±46.3 & 10.5±5.7 \\ \cline{2-10} GCN-\(\mathbf{RW_{in}}\) & 70.8±2.8 & 78.0±45.1 & 27.0±5.1 & 19.0±7.7 & 12.0±7.8 & 0.0±0.0 & 3.0±3.3 & 0.0±0.0 \\ \hline APPNP & 82.5±1.6 & 90.5±4.7 & 81.5±49.5 & 80.5±10.4 & 66.5±48.7 & 68.0±12.1 & 44.0±9.2 & 46.0±7.3 \\ \cline{2-10} APPNP-\(\mathbf{RW_{out}}\) & 75.0±1.6 & 85.5±46.5 & 85.5±6.5 & 30.0±7.7 & 85.5±46.5 & 15.0±3.9 & 85.0±6.3 & 11.5±3.2 \\ \cline{2-10} APPNP-\(\mathbf{RW_{in}}\) & 72.2±2.4 & 78.5±5.9 & 30.0±7.4 & 18.5±5.0 & 17.5±46.8 & 2.0±2.4 & 9.5±5.2 & 0.0±0.0 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Classification accuracy (%) of GNNs under transfer and adaptive attacks (Cora-ML)
* In terms of clean accuracy, we have GCN > GCN-\(\text{RW}_{\text{out}}\) > GCN-\(\text{RW}_{\text{in}}\) > MLP and APPNP > APPNP-\(\text{RW}_{\text{out}}\) > APPNP-\(\text{RW}_{\text{in}}\) > MLP. This indicates that both out-links and in-links in the clean directed graph provide useful graph topology information and out-links are indeed more reliable than in-links. Moreover, undirected GNNs (GCN and APPNP) achieve the best clean performance since both in-links and out-links are utilized through the symmetrization operation.
* Under transfer attack, we have GCN-\(\text{RW}_{\text{out}}\) > GCN > GCN-\(\text{RW}_{\text{in}}\) and APPNP-\(\text{RW}_{\text{out}}\) > APPNP > APPNP-\(\text{RW}_{\text{in}}\). In particular, the transfer attack barely impacts GCN-\(\text{RW}_{\text{out}}\) and APPNP-\(\text{RW}_{\text{out}}\) since no out-link attack on target nodes is allowed under the RDGA setting. It indicates that \(\text{RW}_{\text{out}}\) is free from the impact of adversarial in-links. However, the adversarial in-links in the transfer attack hurt GCN and APPNP badly and completely destroy GCN-\(\text{RW}_{\text{in}}\) and APPNP-\(\text{RW}_{\text{in}}\) that only reply on in-links.
* Although \(\text{RW}_{\text{out}}\) performs extremely well under transfer attacks, we surprisingly find that GCN-\(\text{RW}_{\text{out}}\) and APPNP-\(\text{RW}_{\text{out}}\) suffer from _catastrophic failures_ under stronger adaptive attacks and they significantly underperform simple MLP, which uncovers a severe _false sense of robustness_.

### New Approach: Biased Bidirectional Random Walk Message Passing (BBRW)

The studies on existing directed GNNs (Section 2.3) and the directed random walk message passing (Section 3.1) indicate that it is highly non-trivial to robustify GNNs using directed graphs. But these studies provide insightful motivations to develop a better approach. In this section, we start with a discussion on the catastrophic failures of \(\text{RW}_{\text{out}}\) and propose an innovative and effective approach.

Catastrophic Failures due to Indirect Attacks.The catastrophic failures of \(\text{RW}_{\text{out}}\) (GCN-\(\text{RW}_{\text{out}}\) and APPNP-\(\text{RW}_{\text{out}}\)) under adaptive attacks indicate their false sense of robustness.

In order to understand this phenomenon and gain deeper insights, we perform statistical analyses on the adversary behaviors when attacking different victim models such as GCN, GCN-\(\text{RW}_{\text{out}}\) and GCN-\(\text{RW}_{\text{in}}\) using attack budget \(50\%\). Note that similar observations can be made under other attack budgets as shown in Appendix A.2. In particular, we separate adversarial links into different groups according to whether they directly connect target nodes or targets' neighbors. The distributions of adversarial links shown in Figure 2 indicate:

* When attacking GCN and GCN-\(\text{RW}_{\text{in}}\), the adversary majorly attacks the in-links of target nodes directly using 96.32% and 80.34% perturbation budgets respectively, which badly hurts their performance since both GCN and GCN-\(\text{RW}_{\text{in}}\) reply on in-links. However, the attack transferred from these two victim models barely impact GCN-\(\text{RW}_{\text{out}}\) that only trusts out-links.
* When attacking GCN-\(\text{RW}_{\text{out}}\), the adversary can not manipulate the out-links of target nodes under the restricted setting (RDGA). Therefore, they do not focus on attacking the target nodes directly since in-links of target nodes can not influence GCN-\(\text{RW}_{\text{out}}\) either. Instead, the adversary actfully identifies the targets' neighbors and conducts indirect out-link attacks on these neighbors using 65.55% budgets. As a result, it catastrophically destroys the predictions of target nodes indirectly through their out-linking neighbors that have mostly been attacked.

The systematic studies and analyses in Section 2.3 and Section 3.1 offer two valuable lessons: **(1)** Both in-links and out-links provide useful graph topology information; **(2)** While out-links are more reliable than in-links, full trust in out-links can cause catastrophic failures and a false sense of robustness under adaptive attacks due to the existence of indirect attacks. These lessons motivate us to develop a novel message-passing framework that not only fully utilizes the out-links and in-links information but also differentiates their roles. Importantly, it also needs to avoid a false sense of robustness under adaptive attacks.

Figure 2: Adversary behaviors: the yellow portion represents attacks on the target (direct in-link attacks); the red portion represents attacks on the targets’ neighbors (indirect out-link attacks); and the blue portion represents other attacks.
To this end, we propose a Biased Bidirectional Random Walk (BBRW) Message Passing framework represented by the propagation matrix that balances the trust on out-links and in-links:

\[\tilde{\mathbf{A}}_{\beta}=\mathbf{D}_{\beta,\text{out}}^{-1}\mathbf{A}_{\beta} \ \ \text{where}\ \ \mathbf{D}_{\beta,\text{out}}=\mathbf{A}_{\beta}\mathbf{1},\ \ \mathbf{A}_{\beta}=\beta\mathbf{A}+(1-\beta)\mathbf{A}^{\top}.\]

\(\mathbf{A}_{\beta}\) is the weighted sum of \(\mathbf{A}\) and \(\mathbf{A}^{\top}\) that combines the out-links (directed random walk) and in-links (inversely directed random walk), i.e., \(\{\mathbf{A}_{\beta}\}_{ij}=\beta\mathbf{A}_{ij}+(1-\beta)\mathbf{A}_{ji}\). \(\mathbf{D}_{\beta,\text{out}}\) is the out-degree matrix of \(\mathbf{A}_{\beta}\). \(\tilde{\mathbf{A}}_{\beta}\) denotes the random walk normalized propagation matrix that aggregates node features from both out-linking and in-linking neighbors. The bias weight \(\beta\in[0,1]\) controls the relative trustworthiness of out-links compared with in-links. When \(\beta=0\), it reduces to RW\({}_{\text{in}}\) that fully trusts in-links. But RW\({}_{\text{in}}\) suffers from adversarial attacks, and even a weak transfer attack destroys it. When \(\beta=1\), it reduces to RW\({}_{\text{out}}\) that fully trusts out-links. But RW\({}_{\text{out}}\) suffers from catastrophic failures under adaptive attacks as shown in Section 3.1. Therefore, \(\beta\) is typically recommended to be selected in the range \((0.5,1)\) to reflect the reasonable assumption that out-links are more reliable than in-links but out-links are not fully trustworthy due to the existence of indirect in-link attacks on the neighbors.

**Advantages.** The proposed BBRW enjoys the following advantages: (1) **Effectiveness**: BBRW is able to leverage both in-link and out-link graph topology information in directed graphs, which leads to excellent clean accuracy. (2) **Trustworthiness**: the hyperparameter \(\beta\) provides the flexibility to adjust the trust between out-links and in-links, which helps avoid the catastrophic failures and false sense of robustness caused by the unconditional trust on out-links as discussed in the case of RW\({}_{\text{out}}\). (3) **Simplicity**: BBRW is simple due to its clear motivation and easy implementation. It is easy to tune with only one hyperparameter; (4) **Universality**: It is universal so that it can be readily used as a plug-in layer to improve the robustness of various GNN backbones. It is also compatible with existing defense strategies developed for undirected GNNs. (5) **Efficiency**: BBRW shares the same computational and memory complexities and costs as vanilla GNNs such as GCN and APPNP.

## 4 Experiment

In this section, we provide comprehensive experiments to verify the advantages of the proposed BBRW. Further ablation studies are presented to illustrate the working mechanism of BBRW.

### Experimental Setting

**Datasets.** For the attack setting, we use the two most widely used datasets in the literature, namely Cora ML [28] and Citeseer [29] We use the directed graphs downloaded from the work [25] and follow their data splits (10% training, 10% validation, and 80% testing). We repeat the experiments for 10 random data splits and report the mean and variance of the node classification accuracy.

**Baselines.** We compare our models with seven undirected GNNs: GCN [26], APPNP [27], Jaccard-GCN [5], RGCN [30], GRAND [31], GCN-Soft-Median [32], and ElasticGNN [33], most of which are designed as robust GNNs. Additionally, we also select three state-of-the-art directed GNNs including DGCN [23], DiGCN [24] and MagNet [25] as well as the graph-agnostic MLP.

**Hyperparameter settings.** For all methods, hyperparameters are tuned from the following search space: 1) learning rate: {0.05, 0.01, 0.005}; 2) weight decay: {5e-4, 5e-5, 5e-6}; 3) dropout rate: {0.0, 0.5, 0.8}. For APPNP, we use the teleport probability \(\alpha=0.1\) and propagation step \(K=10\) as [27]. For BBRW-based methods, we tune \(\beta\) from 0 to 1 with the interval 0.1. For a fair comparison, the proposed BBRW-based methods share the same architectures and hyperparameters with the backbone models except for the plugged-in BBRW layer. For all models, we use 2 layer neural networks with 64 hidden units. Other hyperparameters follow the settings in their original papers.

**Adversary attacks & evaluations.** We conduct evasion target attacks using PGD topology attack algorithm [18] under the proposed RDGA setting. The details of the attacking algorithm are presented in Appendix A.1. We randomly select 20 target nodes per split for robustness evaluation and run the experiments for multiple link budgets \(\Delta\in\{0\%,25\%,50\%,100\%\}\) of the target node's total degree. _Transfer_ and _Adaptive_ refer to transfer and adaptive attacks, respectively. For transfer attacks, we choose a 2-layer GCN as the surrogate model following existing works [8; 6]. For adaptive attacks, the victim models are the same as the surrogate models, avoiding a false sense of robustness in transfer attacks. _Clean (total)_ and _Target_ denote the accuracy on the entire set of test nodes and the subset of 20 target nodes, respectively. "\(\backslash\)" means we do not find a trivial solution for adaptive attack since it is non-trivial to compute the gradient of the adjacency matrix for those victim models.
### Robust Performance

To demonstrate the effectiveness, robustness, and universality of the proposed BBRW message-passing framework, we develop multiple variants of it by plugging BBRW into classic GNN backbones: GCN [26], APPNP [27] and GCN-Soft-Median [32]. The clean and robust performance are compared with plenty of representative GNN baselines on Cora-ML and Citeseer datasets as summarized in Table 3 and Table 4, respectively. From these results, we can observe the following:

* In most cases, all baseline GNNs underperform the graph-agnostic MLP under adaptive attacks, which indicates their incapability to robustly leverage graph topology information. However, most of BBRW variants outperform MLP. Taking Cora-ML as an instance, the best BBRW variant (BBRW-GCN-Soft-Median) significantly outperforms MLP by \(\{18\%,16\%,13.5\%\}\) (transfer attack) and \(\{18.5\%,14.5\%,11\%\}\) (adaptive attack) under \(\{25\%,50\%,100\%\}\) attack budgets. Even under 100% perturbation, BBRW-GCN-Soft-Median still achieves 84.5% robust accuracy under strong adaptive attacks, which indicates the powerful values of trusting out-links.
* The proposed BBRW is a highly effective plug-in layer that significantly and consistently enhances the robustness of GNN backbones in both transfer and adaptive attack settings. Taking Cora-ML as an instance, under increasing attack budgets \(\{25\%,50\%,100\%\}\): (1) BBRW-GCN outperforms GCN by \(\{23.5\%,45.5\%,73\%\}\) (transfer attack) and \(\{23\%,44.5\%,63\%\}\) (adaptive attack); (2) BBRW-APPNP outperforms APPNP by \(\{7.5\%,18.5\%,39.5\%\}\) (transfer attack) and \(\{7\%,15\%,23\%\}\) (adaptive attack); (3) BBRW-GCN-Soft-Median outperforms GCN-Soft-Median by \(\{5.5\%,14.5\%,38.5\%\}\) (transfer attack) and \(\{9\%,15\%,37\%\}\) (adaptive attack). The improvements are stronger under larger attack budgets.
* The proposed BBRW not only significantly outperforms existing directed GNNs such as DGCN, DiGCN, and MagNet in terms of robustness but also exhibits consistently better clean accuracy. BBRW also overwhelmingly outperforms existing robust GNNs under attacks. Compared with undirected GNN backbones such as GCN, APPNP, and GCN-Soft-Median, BBRW maintains the same or comparable clean accuracy.

### Ablation Study

In this section, we conduct further ablation studies on the attacking patterns, hyperparameter setting, and adversary capacity in RDGA to understand the working mechanisms of the proposed BBRW.

**Attacking patterns.** In Table 3, we observe that BBRW-GCN-Soft-Median overwhelmingly outperform all baselines in terms of robustness. To investigate the reason, we show the adversarial attack patterns of transfer and adaptive attacks on BBRW-GCN-Soft-Median (\(\beta=0.7\)) in Figure 3. In the transfer attack, the adversary spends 96.32% budget on in-links attacks on the

\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{Method} & \multirow{2}{*}{Clean (total)} & \multicolumn{2}{c}{0\%} & \multicolumn{2}{c}{25\%} & \multicolumn{2}{c}{50\%} & \multicolumn{2}{c}{100\%} \\  & & Target & Transfer & Adaptive & Transfer & Adaptive & Transfer & Adaptive \\ \hline MLP & 64.6\(\pm\)2.2 & 73.5\(\pm\)7.4 & 73.5\(\pm\)7.4 & 73.5\(\pm\)7.4 & 73.5\(\pm\)7.4 & 73.5\(\pm\)7.4 & 73.5\(\pm\)7.4 & 73.5\(\pm\)7.4 \\ \hline DGCN & 75.0\(\pm\)3.1 & 89.5\(\pm\)7.6 & 76.5\(\pm\)13.0 & \(\backslash\) & 54.5\(\pm\)7.9 & \(\backslash\) & 38.0\(\pm\)14.2 & \(\backslash\) \\ DiGCN & 75.5\(\pm\)2.2 & 85.0\(\pm\)7.4 & 50.046.7 & \(\backslash\) & 40.5\(\pm\)9.1 & \(\backslash\) & 29.0\(\pm\)6.2 & \(\backslash\) \\ \cline{2-8} Directed-MagNet & 57.1\(\pm\)5.2 & 69.5\(\pm\)10.4 & 65.0\(\pm\)49.7 & \(\backslash\) & 59.5\(\pm\)10.6 & \(\backslash\) & 54.0\(\pm\)7.0 & \(\backslash\) \\ \cline{2-8} Undirected-MagNet & 79.6\(\pm\)2.1 & 88.5\(\pm\)3.2 & 70.5\(\pm\)10.6 & \(\backslash\) & 55.5\(\pm\)6.9 & \(\backslash\) & 35.5\(\pm\)6.1 & \(\backslash\) \\ \hline Jaccard-GCN & 81.0\(\pm\)6.6 & 90.5\(\pm\)6.5 & 69.5\(\pm\)57.9 & 65.5\(\pm\)7.9 & 44.0\(\pm\)6.2 & 34.0\(\pm\)7.0 & 21.0\(\pm\)67.0 & 8.0\(\pm\)4.6 \\ \cline{2-8} RGCN & 81.4\(\pm\)1.5 & 88.0\(\pm\)6.0 & 72.5\(\pm\)8.4 & 66.0\(\pm\)7.7 & 44.0\(\pm\)8.9 & 36.0\(\pm\)5.4 & 17.5\(\pm\)48.7 & 7.0\(\pm\)4.6 \\ \cline{2-8} GRAND & 81.2\(\pm\)0.9 & 85.5\(\pm\)6.1 & 74.0\(\pm\)7.0 & 65.0\(\pm\)7.4 & 64.0\(\pm\)9.2 & 51.0\(\pm\)8.6 & 45.0\(\pm\)7.1 & 24.0\(\pm\)7.7 \\ \cline{2-8} ElasticGNN & 79.0\(\pm\)7.0 & 89.0\(\pm\)6.2 & 86.0\(\pm\)5.4 & \(\backslash\) & 74.0\(\pm\)5.8 & \(\backslash\) & 50.0\(\pm\)9.7 & \(\backslash\) \\ \hline GCN & 81.8\(\pm\)1.5 & 89.5\(\pm\)6.1 & 66.0\(\pm\)49.7 & 66.0\(\pm\)9.7 & 30.5\(\pm\)8.5 & 40.5\(\pm\)8.5 & 40.6\(\pm\)4.7 & 12.0\(\pm\)6.4 \\ \cline{2-8} BRW-GCN & 80.5\(\pm\)1.3 & 90.0\(\pm\)5.5 & 89.5\(\pm\)46.1 & 80.0\(\pm\)6.2 & 86.0\(\pm\)5.4 & 85.0\(\pm\)6.3 & 85.0\(\pm\)47.1 & 72.0\(\pm\)10.2 \\ \hline APPNP & **82.5\(\pm\)1.6** & 90.5\(\pm\)4.7 & 81.5\(\pm\)49.5 & 80.5\(\pm\)10.4 & 66.5\(\pm\)8.7 & 68.0\(\pm\)12.1 & 44.0\(\pm\)49.2 & 46.0\(\pm\)47.3 \\ \cline{2-8} BBRW-APPNP & **82.5\(\pm\)1.2** & 91.0\(\pm\)4.9 & 89.0\(\pm\)4.5 & 87.5\(\pm\)5.6 & 85.0\(\pm\)7.1 & 83.0\(\pm\)6.4 & 83.5\(\pm\)6.3 & 69.0\(\pm\)49.7 \\ \hline GCN-Soft-Median & 81.6\(\pm\)1.3 & 91.5\(\pm\)5.5 & 86.0\(\pm\)47.0 & 83.0\(\pm\)7.1 & 75.0\(\pm\)8.4 & 73.0\(\pm\)7.1 & 48.5\(\pm\)11.4 & 47.5\(\pm\)9.3 \\ \cline{2-8} BBRW-GCN-Soft-Median & 82.4\(\pm\)1.3 & **92.0\(\pm\)4.6** & **91.5\(\pm\)5.0** & **92.0\(\pm\)4.6** & **89.5\(\pm\)6.9** & **88.0\(\pm\)5.1** & **87.0\(\pm\)8.4** & **84.5\(\pm\)8.8** \\ \hline \hline \end{tabular}
\end{table}
Table 3: Classification accuracy (%) under different perturbation rates of graph attack. The best results are in **bold**, and the second-best results are underlined. (Cora-ML)
target nodes directly, which causes a minor effect on BBRW-GCN-Soft-Median that trusts out-links more. In the adaptive attack, the adversary is aware of the biased trust of BBRW and realizes that in-links attacks are not sufficient. Therefore, besides direct in-link attacks, it allocates 14.01% and 14.40% budgets to conduct the out-links indirect attacks on targets' neighbors and other attacks. Even though the adversary optimally adjusts the attack strategy, BBRW-GCN-Soft-Median still achieves incredible 87% and 84.5% robust accuracy under 50% and 100% total attack budgets. This verifies BBRW's extraordinary capability to defend against attacks.

**Hyperparameter in BBRW.** BBRW is a simple and efficient approach. The only hyperparameter is the bias weight \(\beta\) that provides the flexibility to differentiate and adjust the trust between out-links and in-links. We study the effect of \(\beta\) by varying \(\beta\) from 0 to 1 with an interval of 0.1 using BBRW-GCN. The accuracy under different attack budgets on Cora-ML is summarized in Figure 4. The accuracy on Citeseer is shown in Figure 5 in Appendix A.2. We can make the following observations:

* In terms of clean accuracy (0% attack budget), BBRW-GCN with \(\beta\) ranging from 0.2 to 0.8 exhibit stable performance while the special cases GCN-RW\({}_{\text{in}}\) (\(\beta=0\)) and GCN-RW\({}_{\text{out}}\) (\(\beta=1\)) perform worse. This suggests that both in-links and out-links provide useful graph information that is beneficial for clean performance, which is consistent with the conclusion in Section 3.1.
* Under transfer attacks, BBRW-GCN becomes more robust with the growth of \(\beta\). It demonstrates that larger \(\beta\) indeed can reduce the trust and impact of in-links on target nodes.
* Under adaptive attacks, BBRW-GCN becomes more robust with the growth of \(\beta\) but when it transits to the range close to \(\beta=1\) (RW\({}_{\text{out}}\) ), it suffers from catastrophic failures due to the indirect out-link attacks on targets' neighbors, which is consistent with the discovery in Section 3.1, This also indicates the false sense of robustness evaluated under transfer attacks.

**Adversary capacity in RDGA.** One of the major reasons BBRW can achieve extraordinary robustness is to differentiate the roles and trust of in-links and out-links. In RDGA, we assume that the adversary can not manipulate the out-links of target nodes by fully masking target nodes' out-links (i.e., masking rate=100%). This reflects the practical constraints in real-world applications as explained in Section 1 and Section 2. However, in reality, it is beneficial to consider more dangerous cases when the adversary may be able to manipulate some proportion of targets' out-links. Therefore, we also provide ablation study on the general RDGA setting by varying the masking rates of targets' out-links

\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{Method} & \multirow{2}{*}{Clean (total)} & \multirow{2}{*}{0\%} & \multicolumn{2}{c}{25\%} & \multicolumn{2}{c}{50\%} & \multicolumn{2}{c}{100\%} \\  & & Target & Transfer & Adaptive & Transfer & Adaptive & Transfer & Adaptive \\ \hline MLP & 55.4a2.2 & 49.04a.4 & 49.04a.4 & 49.04a.4 & 49.04a.4 & 49.04a.4 & 49.04a.4 & 49.04a.4 \\ \hline DGCN & 62.54a2.3 & 64.047.0 & 54.04a8.3 & \(\backslash\) & 34.54a10.6 & \(\backslash\) & 27.0410.1 & \(\backslash\) \\ \cline{2-7} DiGCN & 60.74a2.4 & 66.04a8.6 & 41.54a10.5 & \(\backslash\) & 29.54a8.2 & \(\backslash\) & 21.545.9 & \(\backslash\) \\ \cline{2-7} Directed-MagNet & 45.34e5.5 & 42.54a.3 & 42.54a11.5 & \(\backslash\) & 35.04a12.0 & \(\backslash\) & 35.04a7.7 & \(\backslash\) \\ \cline{2-7} Undirected-MagNet & 66.94a1.6 & 68.04e6.0 & 51.54a11.2 & \(\backslash\) & 29.04a10.2 & \(\backslash\) & 17.047.1 & \(\backslash\) \\ \hline Jaccard-GCN & 66.24a1.4 & 57.047.1 & 45.54f.9 & 38.54g.5 & 23.047.8 & 11.545.5 & 20.0410.2 & 6.545.0 \\ \cline{2-7} RGCN & 64.24a2.0 & 61.54f.7 & 34.54g.1 & 34.04a10.2 & 9.54a2.4 & 7.045.6 & 6.545.4 & 4.543.5 \\ \cline{2-7} GRAND & 68.14a1.2 & 67.54e6.0 & 56.54e3.6 & 56.048.9 & 43.045.1 & 42.549.0 & 37.548.1 & 27.546.8 \\ \cline{2-7} ElasticGNN & 60.04a2.6 & 59.048.6 & 54.04e6.6 & \(\backslash\) & 27.54e6.8 & \(\backslash\) & 13.549.0 & \(\backslash\) \\ \hline GCN & 66.24a1.4 & 59.045.4 & 36.54g.5 & 36.54g.5 & 10.545.7 & 10.545.7 & 4.544.2 & 4.544.2 \\ \cline{2-7} BBRW-GCN & 65.34a1.4 & 61.54f.4 & 50.047.7 & 43.04a10.3 & 31.54g.3 & 27.0414.4 & 26.048.0 & 20.549.6 \\ \hline APPNP & **68.54a1.4** & **72.04e6.0** & 53.54g.5 & 51.04e6.2 & 16.0410.7 & 13.549.8 & 9.044.4 & 8.549.0 \\ \cline{2-7} BBBW-APPNP & 68.34a1.8 & 69.04e4.4 & **66.04a8.3** & **59.04a9.7** & **55.04a8.1** & 26.548.4 & 43.546.3 & 14.546.1 \\ \hline GCN-Soft-Median & 66.64a1.7 & 61.54e5.9 & 56.048.3 & 56.048.3 & 34.54a10.8 & 35.0410.7 & 26.549.8 & 26.049.0 \\ \cline{2-7} BBRW-GCN-Soft-Median & 65.74a2.0 & 59.54f.2 & 58.54f.8 & 55.54f.8 & 53.047.5 & 48.047.0 & **49.02.77** & 48.048.1 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Classification accuracy (%) under different perturbation rates of graph attack. The best results are in **bold**, and the second-best results are underlined. (Citeseer)

Figure 3: Distributions of adversarial links.
from 50% to 100%. The total attack budget including in-links and out-links is set as 50% of the degree of the target node. The results in Table 5 offer the following observations: (1) The robustness of undirected backbone GNNs is not affected by constraints on the out-link attacks of the target node, as they can't differentiate the out-links and in-links; (2) BBRW can significantly enhance the robustness of backbones models (e.g., GCN-Soft-Median) under varying masking rates. The improvements are stronger when out-links are better protected (higher mask rate).

## 5 Related Work

The existing research on the attacks and defenses of GNNs focuses on undirected GNNs that convert the graphs into undirected graphs [19; 20; 6; 18; 30; 34; 31; 35; 36; 32]. Therefore, these works can not fully leverage the rich directed link information in directed graphs. A recent study [8] categorized 49 defenses published at major conferences/journals and evaluated 7 of them covering the spectrum of all defense techniques under adaptive attacks. Their systematic evaluations show that while some defenses are effective, their robustness is much lower than claimed in their original papers under stronger adaptive attacks. This not only reveals the pitfall of the false sense of robustness but also calls for new effective solutions. Our work differs from existing works by studying robust GNNs in the context of directed graphs, which provides unprecedented opportunities for improvements orthogonal to existing efforts.

There exist multiple directed GNNs specifically designed for directed graphs although robustness is not considered. The work [37] proposed a spectral-based GCN for directed graphs by constructing a directed Laplacian matrix using the random walk matrix and its stationary distribution. DGCN [23] extended spectral-based graph convolution to directed graphs by utilizing first-order and second-order proximity, which can retain the connection properties of the directed graph and expand the receptive field of the convolution operation. MotifNet [38] used convolution-like anisotropic graph filters based on local sub-graph structures called motifs. DiGCN [24] proposed a directed Laplacian matrix with a PageRank matrix rather than the random-walk matrix. MagNet [25] utilized a complex Hermitian matrix called the magnetic Laplacian to encode undirected geometric structures in the magnitudes and directional information in the phases. The BBRW proposed in this work is a general framework that can equip various GNNs with the superior capability to handle directed graphs more effectively.

## 6 Conclusion

This work conducts the first investigation into the robustness and trustworthiness of GNNs in the context of directed graphs. To achieve this objective, we introduce a new and realistic graph attack setting for directed graphs. Additionally, we propose an innovative and universal message-passing approach as a plug-in layer to significantly enhance the robustness of various GNN backbones, tremendously surpassing the performance of existing methods. Although the primary focus of this

Figure 4: Ablation study on \(\beta\) (Cora-ML). Colors denote the accuracy under different attack budgets.

\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline Model \(\backslash\) Masking Rate & 50\% & 60\% & 70\% & 80\% & 90\% & 100\% \\ \hline GCN-Soft-Median & 73.047.1 & 73.047.1 & 73.047.1 & 73.047.1 & 73.047.1 & 73.047.1 \\ BBRW-GCN-Soft-Median & 86.545.9 & 87.045.1 & 87.545.6 & 87.545.6 & 87.544.6 & 89.044.9 \\ Best \(\beta\) & 0.7 & 0.7 & 0.7 & 0.7 & 0.7 & 0.8 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Ablation study on masking rates of target nodes’ out-links under adaptive attack (Cora-ML).
study is evasion targeted attack, the valuable findings suggest a promising direction for future research: enhancing the robustness of GNNs against adversarial attacks by leveraging the inherent network structure in directed graphs. Moving forward, further exploration of this potential will encompass various attack settings such as poison attack and global attack in this crucial research area.