[Paper Review] SPAGAN: Shortest Path Graph Attention Network
SPAGAN introduces a novel graph attention network that replaces traditional node-based attention with path-based attention using shortest paths to capture global graph topology in a single layer. By computing shortest paths from a center node to higher-order neighbors and applying learnable attention over these paths, SPAGAN achieves state-of-the-art performance on node classification benchmarks with improved feature aggregation and convergence stability.
Graph convolutional networks (GCN) have recently demonstrated their potential in analyzing non-grid structure data that can be represented as graphs. The core idea is to encode the local topology of a graph, via convolutions, into the feature of a center node. In this paper, we propose a novel GCN model, which we term as Shortest Path Graph Attention Network (SPAGAN). Unlike conventional GCN models that carry out node-based attentions within each layer, the proposed SPAGAN conducts path-based attention that explicitly accounts for the influence of a sequence of nodes yielding the minimum cost, or shortest path, between the center node and its higher-order neighbors. SPAGAN therefore allows for a more informative and intact exploration of the graph structure and further {a} more effective aggregation of information from distant neighbors into the center node, as compared to node-based GCN methods. We test SPAGAN on the downstream classification task on several standard datasets, and achieve performances superior to the state of the art. Code is publicly available at https://github.com/ihollywhy/SPAGAN.
Motivation & Objective
- To address the limitation of conventional GCNs and GATs that rely on stacking layers to reach distant neighbors, which often causes performance degradation and convergence issues.
- To enable effective and stable information aggregation from high-order neighbors in a single layer by leveraging shortest paths.
- To model the global graph structure more robustly by explicitly exploring minimum-cost paths between nodes, rather than relying on sequential neighborhood propagation.
- To improve node classification accuracy on benchmark graph datasets by capturing more informative structural context through path-based attention.
Proposed method
- SPAGAN computes all shortest paths of varying lengths from a center node to its higher-order neighbors using Dijkstra’s algorithm, forming a path matrix 𝒫.
- It extracts features from each path in 𝒫 and applies a path-to-node attention mechanism that computes attention coefficients based on path features and node representations.
- The model iteratively updates node embeddings and path attention coefficients using a differentiable path attention layer, enabling end-to-end training.
- A hierarchical path attention mechanism is introduced, allowing learnable attention weights over paths of different lengths, which enhances feature aggregation.
- The method uses sparse tensor operations to efficiently compute path attention on GPU, maintaining low memory overhead despite path expansion.
- The model is trained end-to-end by minimizing a cross-entropy loss, with path matrices regenerated at each iteration using updated attention coefficients.
Experimental results
Research questions
- RQ1Can path-based attention using shortest paths improve node representation learning compared to conventional node-based attention in GCNs?
- RQ2Does a single-layer graph network using shortest-path paths achieve better performance than deep-stacked GCN models on node classification tasks?
- RQ3How does the hierarchical attention mechanism over paths of varying lengths affect model performance and generalization?
- RQ4What is the impact of key hyperparameters—path sampling rate, maximum path depth, and number of iterations—on model convergence and accuracy?
Key findings
- SPAGAN achieves state-of-the-art performance on node classification, with 83.6% accuracy on Cora, outperforming GAT (83.0%) and SPAGAN_Fix (83.2%).
- On Citeseer, SPAGAN achieves 73.0% accuracy, surpassing GAT (72.5%) and SPAGAN_Fix (72.4%).
- On PubMed, SPAGAN reaches 79.6% accuracy, exceeding GAT (79.0%) and SPAGAN_Fix (79.2%).
- The ablation study confirms that the hierarchical path attention mechanism significantly improves performance, as SPAGAN outperforms SPAGAN_Fix across all datasets.
- Sensitivity analysis shows that a sampling ratio of 1.0 (using all paths per node) yields the best performance, with two iterations being sufficient for convergence.
- The model maintains low memory overhead—only ~200MB additional GPU memory on PubMEd—making it practical for large sparse graphs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.