Source-linked AI summary
Position-aware Graph Neural Networks
Jiaxuan You, Rex Ying, Jure Leskovec
TL;DR
Existing GNNs have limited ability to capture nodes’ positions within the broader graph, despite positional information being important for graph prediction. P-GNNs address this by aggregating distance-weighted information from sampled anchor-sets while retaining inductive and feature-aware capabilities, and they consistently outperform existing GNNs across varied tasks and datasets.
Problem
Existing GNN embeddings may fail to recover shortest-path distances and therefore cannot reliably capture global node position when local neighborhoods are structurally equivalent.
Source: §3.2 · p. 3Method
P-GNNs sample anchor-sets, compute target-to-anchor-set distances, and learn nonlinear distance-weighted aggregation of information from those sets.
Source: §1 · pp. 1–2Results
Takeaways & Limitations
P-GNNs provide position-aware node embeddings while retaining inductive capability and the ability to use node features.
Source: §1 · p. 1Structure-aware embeddings may not generalize to new graphs when their mapping memorizes shortest-path distances for nodes with unique local neighborhoods.
Source: §3.2 · p. 3
Abstract
from arXiv · showhide
Learning node embeddings that capture a node's position within the broader graph structure is crucial for many prediction tasks on graphs. However, existing Graph Neural Network (GNN) architectures have limited power in capturing the position/location of a given node with respect to all other nodes of the graph. Here we propose Position-aware Graph Neural Networks (P-GNNs), a new class of GNNs for computing position-aware node embeddings. P-GNN first samples sets of anchor nodes, computes the distance of a given target node to each anchor-set,and then learns a non-linear distance-weighted aggregation scheme over the anchor-sets. This way P-GNNs can capture positions/locations of nodes with respect to the anchor nodes. P-GNNs have several advantages: they are inductive, scalable,and can incorporate node feature information. We apply P-GNNs to multiple prediction tasks including link prediction and community detection. We show that P-GNNs consistently outperform state of the art GNNs, with up to 66% improvement in terms of the ROC AUC score.
1. Introduction
Existing GNNs capture local structure but can miss a node’s broader graph position, motivating P-GNNs, which use anchor-set distances for position-aware embeddings. Across eight datasets and multiple tasks, P-GNNs consistently outperform state-of-the-art GNN variants, with up to 66% AUC improvement.
Motivation
- GNNs aggregate neighborhood information efficiently and inductively, but their local focus can assign identical embeddings to nodes in different graph regions.Nodes with isomorphic neighborhoods remain indistinguishable without node features.Source: §1 · p. 1
Contribution
- P-GNNs compute node embeddings that incorporate positional information relative to all other nodes while retaining inductive capability and node features.The approach extends GNNs with position-aware aggregation rather than relying only on local neighborhoods.Source: §1 · p. 1
Method
- P-GNN samples k anchor-sets and learns nonlinear aggregation of node features weighted by distances from the target node to those sets.Bourgain’s theorem indicates that k = O(log2 n) anchor-sets can preserve graph distances with low distortion.Source: §1 · p. 2
Scalability
- P-GNNs support inductive computation across node orderings and graphs, and P-GNN-Fast retains P-GNN benefits with traditional GNN computational complexity.Approximate node-distance computation addresses the cost of distances in large-scale applications.Source: §1 · p. 2
Empirical results
- 66% AUC score improvement is achieved at most as P-GNNs consistently outperform state-of-the-art GNN variants across eight datasets and several prediction tasks.Evaluated tasks include link prediction and community detection.Source: §1 · p. 2
2. Related Work
Prior node-embedding methods include GNN, matrix-factorization, random-walk, and graph-kernel approaches. GNNs are efficient and inductive, whereas common positional heuristics may sacrifice scalability or generalization to unseen graphs.
Approaches
- Node-embedding approaches include GNNs, matrix factorization, random walks, and graph kernels.Source: §2 · p. 2
Positional heuristics
- Unique-node-identifier heuristics are not scalable and cannot generalize to unseen graphs without a canonical node ordering.P-GNNs are presented as capturing positional information without sacrificing GNN advantages.Source: §2 · p. 2
Graph kernels
- Graph kernels capture structural properties or shortest-path relationships by mapping graphs or shared walks into kernel spaces.Source: §2 · pp. 2–3
3. Preliminaries
The paper distinguishes structure-aware embeddings, derived from local neighborhoods, from position-aware embeddings, which preserve shortest-path information. Structure-aware embeddings cannot generally recover position unless local neighborhoods uniquely identify all nodes, a condition often violated in real-world graphs.
Notation
- A graph is represented as G = (V, E), optionally augmented with node features X = {x1, ..., xn}.Source: §3.1 · p. 3
- Node embedding models map nodes to low-dimensional vectors that can be supplied to a classifier for graph prediction.Source: §3.1 · p. 3
Position-aware embeddings
- Position-aware embeddings allow a function to recover shortest-path distance dsp(vi, vj) from embeddings zi and zj.Source: §3.2 · p. 3
Structure-aware embeddings
- Structure-aware embeddings depend on a node’s q-hop neighborhood, as in message-passing GNNs that aggregate local information.Source: §3.2 · p. 3
Limitation
- Structure-aware embeddings are insufficient for positional tasks because they cannot generally be mapped to embeddings that recover node positions.Such tasks include link prediction and community detection.Source: §3.2 · p. 3
- A mapping from structure-aware to position-aware embeddings exists if and only if no pair of nodes has isomorphic local q-hop neighborhood graphs.Source: §3.2 · p. 3
- In real-world graphs, common structural equivalences make node identification difficult, and a learned mapping may fail to generalize to new graphs.Source: §3.2 · p. 3
4. Proposed Approach
P-GNNs extend GNNs by aggregating feature-aware messages from shared, randomly sampled anchor-sets, using node-to-anchor distances to produce position-aware embeddings. The framework uses stacked layers, permutation-invariant aggregation, and Bourgain-theorem-guided anchor selection to preserve graph distances with low distortion.
Framework
- P-GNNs aggregate messages from randomly chosen anchor-sets rather than only a node’s local neighborhood, coupling aggregation across nodes through shared anchors.Anchor-sets are resampled on each forward pass.Source: §4.1 · p. 3, §4 · p. 3
- Each anchor-set message combines two nodes’ feature information with their network distance, then aggregation functions transform messages within and across anchor-sets.The framework defines AGGM for within-anchor-set aggregation and AGGS for aggregation across anchor-sets.Source: §4.1 · p. 3, §4.3 · p. 5
- P-GNN layers compute one embedding dimension per anchor-set by applying F, AGGM, a learned projection vector w, and a non-linear transformation.The resulting structure-aware message hv is passed to the next P-GNN layer, while zv is the position-aware output.Source: §4.1 · p. 4, Figure 2 · p. 4
Position-aware embeddings
- P-GNN embeddings encode positional information relative to anchor-sets, allowing structurally equivalent nodes in different graph locations to be distinguished.Embedding dimensions may be permuted globally without changing the positional information they carry.Source: §4.1 · p. 4
Anchor-set selection
- Bourgain-theorem-based selection uses k = O(log2 n) anchor-sets to obtain low-distortion distance representations.The constructive strategy uses random anchor-sets and generalizes the distance metric through F and AGGM to incorporate node features.Source: §4.2 · pp. 4–5
Design decisions
- P-GNNs use q-hop shortest-path distance to reduce the cost of position computation, transforming distance with s(v, u) = 1/(d_sp(v,u)+1).One-hop distance can be obtained directly from the adjacency matrix; feature information can be combined with position information through F.Source: §4.3 · p. 5
5. Theoretical Analysis of P-GNNs
The theoretical analysis places P-GNNs in a more general inductive framework than traditional GNNs by coupling node representations through distances to shared anchors. This supports greater expressive power for learning both structure-aware and position-aware embeddings, while incurring higher communication complexity.
Generalization
- P-GNNs generalize existing GNNs by using shared random anchor-sets, whereas traditional GNNs rely on local-neighborhood aggregation or independently sampled size-1 anchor-sets.Deterministic GNNs correspond to individual-node anchor-sets with q-hop aggregation, and GraphSAGE corresponds to independently sampled size-1 anchor-sets.Source: §5.1 · p. 6, §5.2 · p. 6
Expressive power
- P-GNNs provide a more general inductive bias for learning both structure-aware and position-aware node embeddings.The framework is motivated by pairwise relation prediction, including links and community membership as possible target similarities.Source: §5.2 · p. 6
- P-GNNs learn node embeddings from the joint distribution of distances to common anchors, yielding greater expressive power than existing GNNs.The analysis states I(Y; X_joint) ≥ I(Y; X_marginal) for the target pairwise relation variable Y.Source: §5.2 · pp. 6–7
Complexity
- P-GNN communication requires O(mn log2 n) messages when anchor-sets average m nodes, compared with O(n + e) for existing GNNs.Following exact anchor-set selection gives O(n2 log2 n) complexity.Source: §5.3 · p. 7
6. Experiments
Experiments evaluate P-GNNs against GNN baselines across link prediction and pairwise node classification in transductive and inductive settings. P-GNNs generally achieve stronger performance, especially when positional information is important.
Datasets and tasks
- Experiments use synthetic and real datasets for link prediction, community detection, and role-equivalence prediction.The datasets include Grid, Communities, PPI, Emails, and Protein graphs.Source: §6.1 · p. 7
Evaluation settings
- P-GNNs are evaluated in both transductive and inductive learning settings, with order-invariant attributes used for inductive evaluation.Inductive experiments use separate graphs for training and testing when multiple graphs are available.Source: §6.2 · p. 7
Baseline models
- P-GNN variants are compared fairly with GCN, GraphSAGE, GAT, and GIN using similar parameter counts, training epochs, and fixed configurations.The P-GNN variants differ by layer count and by truncated versus exact shortest-path distances.Source: §6.3 · pp. 7–8
Link prediction
- 66% AUC improvement is achieved by P-GNNs over the best GNN on inductive link prediction in the Grid dataset.Across link-prediction datasets and variants, P-GNNs significantly outperform GNNs; transductive performance is comparable.Source: §6.4 · p. 8
Results
- P-GNN-F, which truncates shortest-distance computation at 2 hops, achieves comparable results in many datasets.This provides a faster variant while retaining similar empirical performance in many settings.Source: §6.4 · p. 8
Pairwise node classification
- 56% relative ROC AUC improvement is achieved on Communities, where P-GNN variants nearly perfectly detect memberships while the best GNN reaches 0.620 ROC AUC.Improvements are also reported on Email and Protein, at 18% and 39%, respectively.Source: §6.4 · p. 8
7. Conclusion
The paper proposes P-GNNs for position-aware node embeddings while retaining inductive capability and using node features. Across varied tasks and datasets, P-GNNs consistently outperform existing GNNs.
Related papers
This paper cites
- Semi-Supervised Classification with Graph Convolutional Networks2016
- Neural Message Passing for Quantum Chemistry2017
- How Powerful are Graph Neural Networks?2018
- node2vec: Scalable Feature Learning for Networks2016
- Relational inductive biases, deep learning, and graph networks2018
- Graph Convolutional Neural Networks for Web-Scale Recommender Systems2018
Cited by
- Topology-induced Operators Reveal Complementary Graph Representations without Training2026
- Refining Heuristic-Based Bitcoin Address Clustering with Graph Neural Networks2026
- Converse and Collision-Based Achievability for Node Localization with Hybrid Distance-Spectral Graph Positional Encodings2026
- Graph Information Bottleneck2020
- Graph Clustering with Graph Neural Networks2020
- Open Graph Benchmark: Datasets for Machine Learning on Graphs2020