Table of Contents
Fetching ...

Efficient Link Prediction via GNN Layers Induced by Negative Sampling

Yuxin Wang, Xiannian Hu, Quan Gan, Xuanjing Huang, Xipeng Qiu, David Wipf

TL;DR

This work introduces YinYanGNN, a novel node-wise GNN for link prediction that brings negative sampling into the forward pass by optimizing an energy function balancing positive and negative edges. The model computes end-to-end trainable node embeddings via energy minimization, preserving node-wise efficiency while achieving accuracy competitive with edge-wise methods. Key contributions include an energy-based formulation with normalization and multiple negative graphs, convergence guarantees, and extensive experiments demonstrating strong performance and favorable inference times on standard benchmarks. The approach offers a practical middle ground between expressive edge-wise models and fast node-wise predictors, with potential for further acceleration via specialized decoding tech like Flashlight.

Abstract

Graph neural networks (GNNs) for link prediction can loosely be divided into two broad categories. First, \emph{node-wise} architectures pre-compute individual embeddings for each node that are later combined by a simple decoder to make predictions. While extremely efficient at inference time, model expressiveness is limited such that isomorphic nodes contributing to candidate edges may not be distinguishable, compromising accuracy. In contrast, \emph{edge-wise} methods rely on the formation of edge-specific subgraph embeddings to enrich the representation of pair-wise relationships, disambiguating isomorphic nodes to improve accuracy, but with increased model complexity. To better navigate this trade-off, we propose a novel GNN architecture whereby the \emph{forward pass} explicitly depends on \emph{both} positive (as is typical) and negative (unique to our approach) edges to inform more flexible, yet still cheap node-wise embeddings. This is achieved by recasting the embeddings themselves as minimizers of a forward-pass-specific energy function that favors separation of positive and negative samples. Notably, this energy is distinct from the actual training loss shared by most existing link prediction models, where contrastive pairs only influence the \textit{backward pass}. As demonstrated by extensive empirical evaluations, the resulting architecture retains the inference speed of node-wise models, while producing competitive accuracy with edge-wise alternatives. We released our code at https://github.com/yxzwang/SubmissionverOfYinYanGNN.

Efficient Link Prediction via GNN Layers Induced by Negative Sampling

TL;DR

This work introduces YinYanGNN, a novel node-wise GNN for link prediction that brings negative sampling into the forward pass by optimizing an energy function balancing positive and negative edges. The model computes end-to-end trainable node embeddings via energy minimization, preserving node-wise efficiency while achieving accuracy competitive with edge-wise methods. Key contributions include an energy-based formulation with normalization and multiple negative graphs, convergence guarantees, and extensive experiments demonstrating strong performance and favorable inference times on standard benchmarks. The approach offers a practical middle ground between expressive edge-wise models and fast node-wise predictors, with potential for further acceleration via specialized decoding tech like Flashlight.

Abstract

Graph neural networks (GNNs) for link prediction can loosely be divided into two broad categories. First, \emph{node-wise} architectures pre-compute individual embeddings for each node that are later combined by a simple decoder to make predictions. While extremely efficient at inference time, model expressiveness is limited such that isomorphic nodes contributing to candidate edges may not be distinguishable, compromising accuracy. In contrast, \emph{edge-wise} methods rely on the formation of edge-specific subgraph embeddings to enrich the representation of pair-wise relationships, disambiguating isomorphic nodes to improve accuracy, but with increased model complexity. To better navigate this trade-off, we propose a novel GNN architecture whereby the \emph{forward pass} explicitly depends on \emph{both} positive (as is typical) and negative (unique to our approach) edges to inform more flexible, yet still cheap node-wise embeddings. This is achieved by recasting the embeddings themselves as minimizers of a forward-pass-specific energy function that favors separation of positive and negative samples. Notably, this energy is distinct from the actual training loss shared by most existing link prediction models, where contrastive pairs only influence the \textit{backward pass}. As demonstrated by extensive empirical evaluations, the resulting architecture retains the inference speed of node-wise models, while producing competitive accuracy with edge-wise alternatives. We released our code at https://github.com/yxzwang/SubmissionverOfYinYanGNN.
Paper Structure (42 sections, 4 theorems, 22 equations, 5 figures, 18 tables, 1 algorithm)

This paper contains 42 sections, 4 theorems, 22 equations, 5 figures, 18 tables, 1 algorithm.

Key Result

Proposition 5.1

If $\lambda_K< K \cdot \delta_{max}$, where $\delta_{max}$ is the largest eigenvalue of $L^{-}$, then (eq:energywithnegative-matrix) has a unique global minimum. Moreover, if the step-size parameter satisfies $\alpha< \left\|I+\lambda \tilde{L} -\frac{\lambda_K}{K}\tilde{L}^{-} \right\|_{F}^{-1}$, t

Figures (5)

  • Figure 1: YinYanGNN model illustration. On the left side we show the YinYanGNN forward pass explicitly depending on negative samples, with layers computing embeddings that descend a lower-level energy $\ell_{node}$ defined by (\ref{['eq:energywithnegative-final']}). On the right side we show the more traditional backward pass for optimizing meta-loss (\ref{['eq:link-pred-loss']}) and one-step optimization of it over parameters $W$ (which define the lower-level energy) and $\theta$ (specific to the meta-loss). Supporting details and derivations will be presented in Section \ref{['sec:incorporatingnegative']}.
  • Figure 2: Modified from zhang2022labeling. Solid lines represent the original edges and dashed lines represent negative edges sampled in our model architecture (for simplicity we do not draw all negative edges).
  • Figure 3: Log-scale inference time. Citation2, PPA are the two largest OGB link prediction graphs.
  • Figure 4: Learnable or Fixed $\{ \lambda_K^k \}$ performances on Cora, standard deviation shown by backgrounds.
  • Figure 5: Learnable or Fixed $\{ \lambda_K^k \}$ performances on Pubmed, standard deviation shown by backgrounds.

Theorems & Definitions (6)

  • Proposition 5.1
  • Proposition 5.2
  • Proposition 10.1
  • proof
  • Proposition 10.2
  • proof