TL;DR
This paper introduces NSPGNN (Neighbor Similarity Preserving Graph Neural Network), a robust framework designed to defend Graph Neural Networks (GNNs) against adversarial attacks without relying on the restrictive "homophily assumption." By theoretically linking attack preferences to neighbor feature similarity, the authors develop a dual-kNN graph construction and adaptive propagation strategy that achieves state-of-the-art robustness on both homophilic and heterophilic graphs.
What Problem Does This Paper Address?
Graph Neural Networks are notoriously fragile to adversarial structural attacks—malicious additions or deletions of links designed to tank model performance. Most existing defenses rely on homophily, the principle that "like connects to like." These models attempt to restore robustness by pruning links between dissimilar nodes.
However, many real-world graphs are heterophilic, meaning connected nodes naturally have different labels or features (e.g., fraud networks where fraudsters mimic benign users). In these scenarios, homophily-based defenses fail because they can't distinguish between a legitimate heterophilic link and a malicious attack link. As shown in Figure 1, adversarial attacks on heterophilic graphs can significantly degrade accuracy even when the overall homophily ratio remains stable, rendering traditional "homophily-restoring" models ineffective.
Methods
The authors propose a novel framework called NSPGNN that shifts the focus from "ego" features (the node's own attributes) to neighbor similarity.
- Theoretical Foundation: The authors prove that the update of negative classification loss is negatively correlated with the pairwise similarities of aggregated neighbor features ($A^\tau X$). Essentially, attackers prefer to connect nodes that have very different "neighborhood contexts."
- Dual-kNN Graph Construction: Instead of relying solely on the potentially poisoned raw adjacency matrix, NSPGNN constructs two auxiliary structures:
- Positive kNN Graphs: Connect nodes with the highest neighbor similarity to capture reliable local structures.
- Negative kNN Graphs: Connect nodes with the lowest neighbor similarity to serve as contrastive signals.
- Neighbor-Similarity-Preserved Propagation: The model uses an adaptive message-passing mechanism:
- A low-pass filter on the positive graph smooths features among similar neighbors.
- A high-pass filter on the negative graph discriminates features among dissimilar neighbors.
- An adaptive fusion layer combines these signals with the original ego-embeddings to produce the final node representation.
Datasets
The researchers evaluated their model against two major types of attacks (Mettack and Minmax) across seven datasets:
- Heterophilic Graphs: Chameleon, Squirrel, Crocodile, and Tolokers.
- Homophilic Graphs: Cora, CiteSeer, and Photo.
Key Insights and Ideas
- The Inefficacy of Ego Features: A major "aha moment" is that while ego-feature similarity ($X$) fails to separate malicious links from benign ones in heterophilic graphs, neighbor-aggregated similarity ($AX$ or $A^2X$) provides a clear signal for detection. This is visually demonstrated in Figure 2, where the red (malicious) and green (benign) distributions overlap significantly for ego features but separate for neighbor features.
- Universal Robustness: Because the theoretical link between attack loss and neighbor similarity is independent of the graph's homophily ratio, NSPGNN works as a "universal" defense. It outperforms specialized robust models on homophilic graphs while being the first to effectively tackle heterophilic ones.
- Structural Refinement as Augmentation: Interestingly, the positive kNN construction acts as a powerful graph data augmentation technique. Even on clean (unattacked) graphs, NSPGNN often outperforms standard GNNs by refining the topology to favor high-quality, similar neighbors.
Key Results
NSPGNN demonstrated significant performance gains over state-of-the-art baselines:
- Superior Robustness: On the Squirrel dataset under a 25% Mettack attack, NSPGNN achieved 49.98% accuracy, while the next best baseline (ACMGNN) trailed at 37.45%.
- Consistent Gains: Across all attack scenarios (1% to 25% perturbation), NSPGNN maintained a large margin over both robust GNNs (like ProGNN) and heterophilic GNNs (like GPRGNN).
- Clean Graph Performance: NSPGNN isn't just for defense; it also improved performance on clean heterophilic graphs, outperforming the second-best model on Chameleon by nearly 3%.
Limitations and Future Work
- Computational Complexity: The construction of kNN graphs has a baseline complexity of $O(N^2)$. While the authors suggest approximation methods like Recursive Lanczos Bisection to reduce this to $O(N^{1.14})$, scaling to massive graphs with millions of nodes remains a challenge.
- Hyperparameter Sensitivity: The model relies on choosing the right number of hops ($\tau$) and neighbors ($k$). The authors found that $\tau=1$ or $2$ is generally optimal; higher values lead to "over-smoothing," where node features become indistinguishable.
- Future Directions: The authors suggest exploring more efficient ways to construct these similarity-based topologies and extending the framework to other graph tasks like link prediction or community detection.
Summary updated