Graph Parsing Networks

Yunchong Song, Siyuan Huang, Xinbing Wang, Chenghu Zhou, Zhouhan Lin

Abstract

Graph Neural Networks (GNNs) rely on graph pooling to compress complex structures into compact representations for downstream tasks. However, existing hierarchical pooling methods often suffer from a trade-off between information loss (node dropping) and computational inefficiency (dense clustering). We present Graph Parsing Networks (GPN), a novel framework that treats graph pooling as a bottom-up grammar induction process. By adaptively learning a personalized pooling tree for every individual graph, GPN achieves high memory efficiency while preserving total node information and structural topology.

Introduction

In the domain of Graph Neural Networks, hierarchical pooling is the process of downsampling a graph into a coarser representation, analogous to pooling layers in Computer Vision. Despite its importance, current methods face a "Goldilocks" problem. Node-dropping methods are memory-efficient but suffer from irreversible information loss and broken connectivity. Conversely, node-clustering methods preserve information by grouping nodes but typically rely on dense assignment matrices with quadratic memory requirements, limiting their scalability. Furthermore, most models utilize a fixed pooling ratio, ignoring the fact that different graphs possess varying degrees of compressibility.

Graph Parsing Networks (GPN) address these limitations by introducing a sparse, clustering-based pooling mechanism that is personalized to the unique structure of each graph. By treating pooling as a parsing problem, GPN avoids the pitfalls of fixed-ratio downsampling and achieves $O(n)$ time complexity.

Methodology

The core innovation of GPN is the Graph Parsing Algorithm ($\mathcal{A}$), which conceptualizes graph pooling as the construction of a hierarchical tree structure. The architecture consists of three primary modules:

1. Graph Information Encoding

A GNN-based encoder calculates "edge scores," which represent the learnable likelihood that two connected nodes should be merged into a single cluster. These scores guide the subsequent structural transformation.

2. Structural Transformation (The Parsing Algorithm)

Instead of applying a global reduction ratio, the algorithm uses three discrete operators to build clusters iteratively:

  • DOM (Dominant): Identifies the strongest edge for every node based on the encoded scores.
  • EXP (Expand): Iteratively grows these edges into clusters, similar to how words are parsed into phrases in natural language processing.
  • GEN (Generate): Creates a sparse assignment matrix where each node is assigned to exactly one cluster.

This process repeats until the graph is fully parsed into a single representation. The height and shape of the resulting "pooling tree" are determined dynamically by the data itself rather than by pre-defined hyperparameters.

3. Multiset Computation

Once clusters are formed, GPN uses a DeepSets-based approach to aggregate node features into the next hierarchical level. To ensure the system remains end-to-end learnable despite the discrete nature of the parsing steps, the authors employ a masking technique that allows gradients to flow back through the edge-scoring module.

Experimental Evaluation

The authors evaluated GPN across a diverse range of benchmarks to test classification accuracy, scalability, and structural preservation:

  • Graph Classification: Five TUDatasets (DD, PROTEINS, NCI1, NCI109, FRANKENSTEIN) and the large-scale ogbg-molpcba dataset, which contains over 400,000 graphs.
  • Node Classification: Standard benchmarks including Cora, CiteSeer, PubMed, and Film.
  • Synthetic Reconstruction: Ring and grid graphs were used to visualize the model's ability to preserve spatial structure after multiple pooling and un-pooling steps.

Key Results and Insights

State-of-the-Art Performance

GPN outperformed existing hierarchical pooling methods on four out of five TUDatasets. Its performance on the massive ogbg-molpcba dataset was particularly notable, achieving an accuracy of 26.65%, a significant improvement over the next best baseline (~23.9%).

Efficiency and Scalability

By utilizing sparse assignments, GPN maintains a linear time complexity relative to the number of nodes. In memory stress tests, GPN remained stable as graph size increased, whereas clustering baselines like MinCutPool frequently encountered "Out of Memory" (OOM) errors. Additionally, GPN demonstrated faster execution times compared to other edge-scoring methods like EdgePool.

Personalized Compression and Structural Integrity

The "personalized" nature of GPN allows it to apply deep compression to simple graphs while maintaining high-fidelity detail in complex ones. In synthetic reconstruction tasks, GPN was the only model capable of perfectly recovering the interior structure of grid graphs and the circularity of ring graphs, proving its superior ability to maintain underlying topology.

Discussion and Future Work

While GPN offers significant advantages, it introduces new challenges. The varying depth of pooling trees across different graphs can create bottlenecks during batch processing, as hardware may sit idle while waiting for the deepest tree in a batch to finish computation. Furthermore, for extremely large graphs resulting in very deep trees, there is a potential risk of over-smoothing node features, though residual connections currently mitigate this effect.

Future research may explore the application of this grammar-based parsing approach to more complex data structures, such as hypergraphs, and further optimize batching strategies for heterogeneous tree depths.

Summary updated

BibTeX
@inproceedings{song2024graph,
  author = {Yunchong Song and Siyuan Huang and Xinbing Wang and Chenghu Zhou and Zhouhan Lin},
  title = {{Graph Parsing Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=hv3SklibkL},
}
Figure