Graph Attention Networks with Positional Embeddings

Liheng Ma, Reihaneh Rabbany, Adriana Romero-Soriano

TL;DR

GAT-POS enhances Graph Attention Networks by incorporating learned positional embeddings, allowing the model to capture structural information beyond mere node features. This hybrid approach significantly boosts performance on non-homophilic graphs—where neighboring nodes aren't necessarily similar—while remaining competitive on standard benchmarks.

What Problem Does This Paper Address?

Most Graph Neural Networks (GNNs) operate on the principle of homophily: the assumption that "birds of a feather flock together." In these graphs (like citation networks), connected nodes usually share similar features and labels. However, many real-world graphs are non-homophilic. For example, in a network of actors, an edge might represent a professional interaction rather than a similarity in genre or age.

Standard Graph Attention Networks (GATs) struggle here because their attention mechanism is purely content-based. They look at what a neighbor is, but they are largely blind to where that neighbor sits in the broader graph structure. This paper addresses the need for GNNs that can leverage structural and positional context to navigate graphs where proximity does not imply similarity.

Methods

The authors propose GAT-POS (Graph Attentional Networks with Positional Embeddings), a framework that injects structural "coordinates" into the attention process.

The architecture consists of two main components trained jointly:

  1. Positional Embedding Model: This auxiliary branch uses a series of fully-connected layers to learn node embeddings based on graph context. It uses an unsupervised objective inspired by skip-gram models (predicting first- and second-order proximities) to ensure the embeddings capture the graph's layout.
  2. Enhanced GAT Layer: Unlike a standard GAT layer that only considers node features ($h$), the GAT-POS layer modifies the attention coefficient calculation to include the positional embeddings ($p$).

The attention score between two nodes is calculated by concatenating their transformed features and their transformed positional embeddings. This allows the model to learn, for instance, that a neighbor's information is important because of its specific structural relationship to the center node, even if their raw features are different.

![Fig.

  1. A Demonstration of GAT-POS Architecture showing the flow of features (h) and positional embeddings (p) alongside joint supervised and unsupervised losses.](/figures/art_41db2d81869a49f38a07ce0a13667752)

Datasets

The researchers evaluated GAT-POS on two distinct categories of datasets to test its versatility:

  • Non-homophilic Datasets: Wikipedia page-page networks (Chameleon and Squirrel) and the Actor co-occurrence network. These are characterized by low homophily levels ($\beta$), as shown in the table below.
  • Homophilic Datasets: Standard citation networks (Cora, Citeseer, and Pubmed) used as a "sanity check" to ensure the new features don't degrade performance on traditional tasks.
Table 1. Summary of the datasets, highlighting the stark difference in homophily (β) between the two groups.

Key Insights and Ideas

  • Structure as a Complement to Content: In non-homophilic graphs, node features can be "noisy" or misleading. By providing a positional anchor, the model can learn higher-level structural patterns that content alone misses.
  • The Power of Joint Training: A key "aha moment" in the paper is that training the positional model and the classification model simultaneously (end-to-end) is superior to pre-training embeddings and freezing them. Joint training allows the positional embeddings to adapt specifically to the needs of the supervised classification task.
  • Overcoming GAT's "Set" Limitation: Standard GATs treat a node's neighborhood as an unordered set. GAT-POS effectively breaks this symmetry by giving each node a unique structural identity.

Key Results

GAT-POS showed its greatest strength on non-homophilic data, significantly outperforming both standard GNNs and specialized baselines like Geom-GCN:

  • Squirrel Dataset: GAT-POS achieved 52.90% accuracy, a massive jump from the standard GAT's 41.19%.
  • Actor Dataset: It reached 34.89%, outperforming GCN (28.30%) and various Geom-GCN flavors.
  • Sanity Check: On homophilic datasets like Cora and Citeseer, GAT-POS performed on par with standard GATs, proving that adding positional information doesn't "confuse" the model when homophily is present.

Limitations and Future Work

The authors identify a few areas for growth:

  • Inductive Generalization: The current transductive setup makes it difficult to generalize to entirely new nodes added after training. While methods like GraphSAGE could be integrated, the bottleneck remains the embedding method's ability to handle homogeneous input features.
  • Scalability: Jointly training two branches on super large-scale graphs could become computationally expensive. The authors suggest exploring asynchronous training as a potential solution.
  • Architecture Refinement: While GAT-POS outperformed a "Transformer-style" variant (where positions are added directly to features), the authors believe there is still room to optimize how positional and content information are fused.

Summary updated

BibTeX
@inproceedings{ma2021graph,
  author = {Liheng Ma and Reihaneh Rabbany and Adriana Romero-Soriano},
  title = {{Graph Attention Networks with Positional Embeddings}},
  booktitle = {PAKDD},
  year = {2021},
  url = {https://openreview.net/forum?id=kvg3VcWSkL},
}
Figure