KGMark: A Diffusion Watermark for Knowledge Graphs

Hongrui Peng, Haolang Lu, Yuanlong Yu, WeiYe Fu, Kun Wang, Guoshun Nan

Knowledge Graphs (KGs)—structured networks of real-world entities and their relationships—are the backbone of modern search engines, recommendation systems, and AI reasoning. As generative AI begins to produce high-quality synthetic KGs, new risks are emerging, including intellectual property theft, the spread of "hallucinated" information, and the potential for malicious data poisoning.

To combat these risks, researchers have introduced KGMark, the first watermarking framework specifically designed for Knowledge Graph Embeddings (KGE) using diffusion models. By embedding "fingerprints" into the latent noise of a graph's representation, KGMark provides a robust way to protect intellectual property and track the provenance of synthetic data without sacrificing the graph's actual utility.

The Challenge of Watermarking Graphs

Traditional watermarking techniques, like those used for images or text, fail when applied to graphs because graphs are uniquely "slippery." They suffer from two major types of variations:

  • Spatial Variations: Graph isomorphism means the exact same graph can be represented with entirely different node orderings.
  • Temporal Variations: KGs are dynamic; nodes and edges are constantly added, updated, or deleted over time.

If you simply "stamp" a graph with a traditional watermark, an attacker can easily wipe the mark by reordering nodes or slightly tweaking the topology. KGMark aims to create a watermark that is invisible to users but "sticky" enough to survive these transformations.

Overview of KGMark's three main objectives: Transparency, Detectability, and Robustness.

Methodology: How KGMark Works

The researchers built KGMark on the foundation of Latent Diffusion Models (LDMs). The process follows a sophisticated pipeline designed to embed the watermark deeply into the graph's structural DNA.

The KGMark pipeline, illustrating community detection, subgraph alignment, and noise vector embedding.
  1. Latent Mapping: First, the graph is encoded into a latent space using a Variational Autoencoder (VAE) equipped with Relational Graph Attention (RGAT) layers. This captures the complex semantics and relationships within the graph.
  2. Deterministic Inversion: Using DDIM (Denoising Diffusion Implicit Models), the team performs a "deterministic inversion" to find the specific noise vector that would generate that graph's embedding.
  3. Frequency Domain Embedding: Instead of altering the raw data directly, the framework applies a Fourier Transform to this noise vector and embeds the watermark signature into specific frequency components. This makes the mark significantly harder to detect and remove.
  4. Learnable Adaptive Watermark Mask Matrix (LAWMM): Rather than using a static mask, KGMark trains a learnable matrix to decide where to hide the watermark. This ensures the fingerprint doesn't interfere with the graph's most critical structural features, preserving the graph's usability (transparency).
  5. Graph Alignment & Redundancy: To fight reordering attacks, the system uses a clustering-based alignment method that sorts nodes by structural importance (like degree and clustering coefficient). It also embeds the watermark redundantly across different "communities" within the graph. Even if a large portion of the graph is deleted, the mark remains detectable in the surviving communities.

Key Insights and Innovations

  • The "Sample-then-Embed" Strategy: The authors found that simply adding noise drifts the latent space too much, damaging the graph. By using a "sample-then-embed" strategy with a correction term, they keep the watermarked graph's distribution almost identical to the original.
  • Hierarchical Protection: The watermark is embedded at two levels: the Community Layer (global spectral profile) and the Vertex Layer (local edge weight distributions). This "dual encoding" makes the system incredibly resilient; an attacker would have to destroy both the graph's local and global structure simultaneously to remove the mark.
  • Latent Space Equilibrium: The paper introduces a principle that balances the inherent noise of the diffusion process against the distortion introduced by the watermark. This balance allows for high detectability without ruining the graph's performance on downstream tasks.

Performance and Results

The authors evaluated KGMark on three diverse, public benchmark datasets: Alibaba-iFashion (e-commerce), MIND (news recommendation), and Last-FM (music).

  • High Detectability: In "clean" (unattacked) scenarios, KGMark achieved a watermark detection AUC (Area Under the Curve) of nearly 0.99 across all datasets.
  • Minimal Utility Loss: The "transparency" of the watermark proved highly effective. The drop in performance for downstream tasks, such as link prediction, was restricted to a negligible range of 0.02% to 9.7%.
  • Robustness Against Attacks: Even under aggressive "post-editing" attacks—such as deleting 50% of triples or reordering the entire graph—the system maintained a robust detection AUC of around 0.95. It significantly outperformed classical baselines and newer image-centric methods.

Limitations and Future Work

While KGMark represents a major step forward for graph security, the authors acknowledge a few hurdles. The current method relies heavily on DDIM inversion, and its compatibility with other, more advanced diffusion samplers remains an open question. Additionally, while utility loss is low, there is still a slight gap between the original and watermarked graph embeddings; future work will explore conditional sampling to further improve reconstruction fidelity. Finally, training the learnable mask (LAWMM) and performing community detection adds computational overhead that might be challenging to scale for extremely massive, billion-node graphs.

Summary updated

BibTeX
@inproceedings{peng2025kgmark,
  author = {Hongrui Peng and Haolang Lu and Yuanlong Yu and WeiYe Fu and Kun Wang and Guoshun Nan},
  title = {{KGMark: A Diffusion Watermark for Knowledge Graphs}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=GKZySvM2t9},
}
Figure