Abstract
Data augmentation helps neural networks generalize better by enlarging the training set, but it remains an open question how to effectively augment graph data to enhance the performance of GNNs (Graph Neural Networks). While most existing graph regularizers focus on manipulating graph topological structures by adding/removing edges, we offer a method to augment node features for better performance. We propose FLAG (Free Large-scale Adversarial Augmentation on Graphs), which iteratively augments node features with gradient-based adversarial perturbations during training. By making the model invariant to small fluctuations in input data, our method helps models generalize to out-of-distribution samples and boosts model performance at test time. FLAG is a general-purpose approach for graph data, which universally works in node classification, link prediction, and graph classification tasks. FLAG is also highly flexible and scalable, and is deployable with arbitrary GNN backbones and large-scale datasets. We demonstrate the efficacy and stability of our method through extensive experiments and ablation studies. We also provide intuitive observations for a deeper understanding of our method.
Introduction
Deep learning models, particularly Graph Neural Networks (GNNs), face significant challenges with generalization when trained on large-scale datasets. While data augmentation is a staple in domains like Computer Vision, applying it to graphs is non-trivial due to their discrete structure and feature sparsity. Existing methods often focus on topological changes, such as adding or removing edges, which can be computationally expensive and risk altering the graph's underlying semantic meaning.
We introduce FLAG (Free Large-scale Adversarial Augmentation on Graphs), a task-agnostic and highly scalable method that leverages adversarial perturbations in the feature space to improve GNN performance. By treating adversarial training as a form of "free" data augmentation, FLAG makes models more robust and accurate across diverse graph-based tasks.
The FLAG Framework
FLAG treats adversarial training not just as a defense mechanism, but as a potent data augmentation strategy. Instead of changing the graph's edges, FLAG adds a small amount of calculated noise ($\delta$) to the node features. This noise is derived from the gradient of the loss function, effectively pushing the model to be invariant to small fluctuations in the input space.
To maintain scalability on massive graphs, FLAG adopts a "free" training approach. It updates model weights at the same time it calculates noise gradients, allowing the model to see multiple scales of augmented data for roughly the price of one standard training epoch. This accumulation of gradients over several steps exposes the model to a diverse range of perturbation magnitudes.
Experimental Evaluation
We evaluated FLAG across a wide array of tasks using the Open Graph Benchmark (OGB), including node classification (ogbn-products), link prediction (ogbl-ddi), and graph classification (ogbg-molhiv). The results demonstrate consistent performance boosts across all domains. For instance, FLAG improved GAT accuracy on ogbn-products by an absolute 2.31% and significantly enhanced link prediction on ogbl-ddi, raising Hits@20 from 37.07% to 51.41%.
Key Insights and Discussion
A key finding is that adversarial training is particularly effective for the sparse, discrete input distributions typical in graph data. By introducing continuous noise to discrete features, FLAG "fills in" the gaps in the feature space, forcing the model to learn smoother decision boundaries. Loss landscape visualizations confirm that FLAG results in a flatter and smoother loss surface compared to vanilla training, which is strongly correlated with better generalization to unseen data.
While FLAG is model-agnostic and highly efficient, its benefits can diminish on datasets where node features are missing or poorly constructed. Additionally, the perturbation step size remains a heuristic hyperparameter that requires tuning for specific datasets.
Conclusion
FLAG provides a simple yet effective "plug-and-play" regularizer for GNNs. By shifting the focus from topological manipulation to feature-based adversarial augmentation, it achieves significant performance gains on large-scale benchmarks with minimal computational overhead. Its ability to work across different tasks and backbones makes it a versatile tool for the graph machine learning community.
Summary updated