Introduction
Pretraining Graph Neural Networks (GNNs) on massive datasets is computationally expensive, making the resulting models valuable intellectual property (IP). PreGIP is a new framework that "watermarks" these pretrained encoders by forcing pairs of dissimilar synthetic graphs to have nearly identical embeddings. This ensures that any downstream classifier built on the stolen model will produce matching predictions for those pairs—even after the model has been finetuned by an adversary.
Problem Statement
In deep learning, the "pretrain then finetune" paradigm is standard. For GNNs, pretraining on millions of molecules or protein structures can take days on high-end GPUs, turning pretrained encoders into high-value assets. However, these models are vulnerable to IP theft: an adversary can "steal" the encoder and finetune it for their own specific task without permission.
Existing watermarking techniques usually rely on "trigger sets" that force a supervised classifier to output a specific label. But pretraining is self-supervised and task-agnostic. At this stage, the owner doesn't know the downstream tasks or labels, making traditional methods inapplicable. The challenge is to embed a verifiable mark into the representation space without degrading embedding quality for legitimate users.
Methodology
PreGIP introduces two primary innovations to solve the task-free watermarking problem:
- Task-Free Watermarking Loss: Instead of labels, PreGIP uses pairs of synthetic "watermark graphs" (generated via Erdos-Renyi models). The loss function minimizes the distance between the embeddings of paired watermark graphs while enforcing a "margin" between these synthetic embeddings and real-world training data. This prevents model collapse and preserves the encoder's representational power.
- Finetuning-Resistant Injection: To counter adversaries who finetune stolen models to "wash out" watermarks, PreGIP uses a minimax optimization strategy. During training, it searches for the "worst-case" parameter update within a small radius (simulating finetuning) and ensures the watermark remains detectable even under those modified parameters.
Verification is black-box: the owner queries the suspect model with secret watermark graph pairs. If the model consistently gives the same prediction for both graphs in a pair across various tasks, it is flagged as pirated.
Key Insights
- The Smoothness Assumption: The authors prove that if two embeddings are sufficiently close in the representation space, any Lipschitz-continuous downstream classifier will likely assign them the same label. This enables task-independent watermarking.
- Synthetic Data Isolation: Using synthetic graphs avoids "poisoning" real-world data representations, as synthetic graphs occupy a distinct region of the embedding space.
- Robustness via Adversarial Training: By explicitly training the model to keep embeddings stable even when weights shift (the minimax approach), the watermark becomes "sticky" and survives downstream modification.
Evaluation and Results
The authors evaluated PreGIP across semi-supervised learning (PROTEINS, NCI1, FRANKENSTEIN) and transfer learning (ZINC15 pretraining with evaluation on Tox21, BBBP, etc.).
- High Detection Accuracy: PreGIP achieved an IP ROC of 100% (or near it) in almost all tests, perfectly distinguishing pirated models from independently trained ones.
- Minimal Utility Trade-off: Watermarking had negligible impact on downstream accuracy. For example, on PROTEINS, accuracy only shifted from 70.5% to 70.3%.
- Resilience to Attacks: The watermark remained detectable after model pruning (up to 50%) and watermark overwriting.
- Finetuning Survival: While baseline methods saw IP detection scores plummet after 100 epochs of finetuning, PreGIP remained robust.
Limitations
While PreGIP is resistant to standard finetuning, extremely long finetuning (e.g., 300+ epochs) can eventually degrade the watermark. However, such extensive finetuning often leads to overfitting on the downstream task, reducing the incentive for an adversary to use the stolen model. Future work may explore more sophisticated watermark removal attacks and extending the framework to node-level or edge-level tasks.
Summary updated