Introduction
The pretraining of Graph Neural Networks (GNNs) on large-scale datasets, such as millions of protein structures or chemical compounds, has become a cornerstone of modern graph representation learning. However, the high computational cost and data-intensive nature of this process make the resulting models valuable intellectual property (IP). Unfortunately, these models are susceptible to unauthorized redistribution or theft.
Traditional watermarking techniques often rely on "trigger sets"—specific inputs designed to elicit predefined labels from a classifier. These methods are unsuitable for pretrained encoders because the downstream tasks and labels are unknown during the pretraining phase. Furthermore, adversaries frequently "finetune" stolen models on new tasks, a process that can inadvertently or intentionally remove standard watermarks. To address these challenges, we present PreGIP, a novel framework for watermarking pretrained GNNs.
Methodology
PreGIP shifts the watermarking paradigm from label-based triggers to representation-based triggers. The core idea is to embed "hidden" similarities between pairs of synthetic graphs within the model's embedding space.
Watermarking Pipeline
The framework consists of four primary components:
- Task-Free Watermarking Loss: PreGIP optimizes the GNN encoder to produce nearly identical embeddings for pairs of dissimilar, synthetic "watermark graphs."
- Synthetic Graph Construction: To prevent interference with real-world data distributions, watermark keys are generated using Erdos-Renyi models. These synthetic graphs are designed to be distinct from the pretraining data.
- Finetuning-Resistant Injection: A min-max optimization strategy is employed to ensure the watermark's persistence. By optimizing the watermark to remain strong even when model parameters are perturbed within a radius $\epsilon$, the watermark is effectively "baked" into the model architecture.
- Ownership Verification: Verification involves querying a suspect model with secret watermark pairs. If the model consistently assigns the same prediction to both graphs in a pair across multiple instances, ownership is statistically confirmed.
Experimental Evaluation
The effectiveness of PreGIP was evaluated across semi-supervised learning tasks (PROTEINS, NCI1, FRANKENSTEIN) and transfer learning scenarios (ZINC15 pretraining followed by molecular classification tasks like Tox21 and BBBP).
Key Insights
- The Neighborhood Principle: Theoretically, if an encoder maps two different graphs to the same small neighborhood in the embedding space, any smooth downstream classifier will likely assign them the same label. This principle bridges the gap between pretraining and unknown downstream tasks.
- Utility Preservation: The use of synthetic graphs ensures that the watermark does not degrade the model's performance on legitimate real-world data.
Results and Discussion
PreGIP demonstrates superior performance in both detection accuracy and robustness compared to existing baselines like SSL-WM and RWM-Pre.
As shown in the results, PreGIP achieves an IP ROC of 100% in scenarios where the encoder remains fixed. More importantly, it maintains high resilience to finetuning, sustaining an IP ROC of approximately 94.5% on the PROTEINS dataset, whereas baseline methods often degrade to near-random performance levels.
The utility trade-off is minimal, with downstream task accuracy typically dropping by less than 1%. Additionally, the watermark exhibits robustness against model pruning (up to 50%) and overwriting attacks.
Conclusion
PreGIP provides a robust solution for protecting the IP of pretrained GNNs. By leveraging representation-based triggers and min-max optimization, it ensures watermark persistence even after significant model finetuning. Future research will explore extending this framework to node-level classification and link prediction tasks.
Summary updated