Personalized Layer Selection for Graph Neural Networks

Kartik Sharma, Vineeth Rakesh, Yingtong Dou, Srijan Kumar, Mahashweta Das

Standard Graph Neural Networks (GNNs) typically follow a rigid architectural pattern: information is aggregated across a fixed number of layers, and the final node representations are used for downstream tasks. While effective for many applications, this "one size fits all" approach assumes that the same neighborhood depth is optimal for every node in a graph.

A recent study, "Personalized Layer Selection for Graph Neural Networks," published in Transactions on Machine Learning Research, challenges this assumption. The authors identify a "fixed granularity" problem in GNNs and propose MetSelect, a plug-and-play algorithm that enables each node to adaptively select its own optimal representation layer. This approach leads to significant improvements in accuracy, particularly on heterophilic datasets, and allows GNNs to scale to unprecedented depths without suffering from oversmoothing.

Overview of MetSelect: Architecture comparison and performance benefits across heterophily, depth, and robustness.

The Problem: Fixed Granularity and Oversmoothing

GNNs operate by aggregating features from a node's local neighborhood. A $k$-layer GNN considers information from $k$-hop neighbors. However, different nodes require different levels of context depending on their position in the graph:

  • Homophilic Nodes: In regions where nodes share similar labels (e.g., a citation network where similar papers cite each other), deeper aggregation often helps by smoothing out local noise.
  • Heterophilic Nodes: In graphs where neighbors often belong to different classes (e.g., a dating network or a protein-protein interaction graph), excessive aggregation can lead to "oversmoothing," where distinct node signals are washed out into indistinguishable "gray mush."

By forcing every node to use the final layer's representation, standard GNNs fail to capture the nuances of diverse graph structures, often leading to poor performance on heterophilic graphs and preventing the effective use of deep architectures.

Methodology: The MetSelect Algorithm

MetSelect treats layer selection as a metric learning problem. Instead of relying solely on the final layer $L$, it evaluates representations from every layer $l \in \{0, \dots, L\}$. The process involves four key steps:

  1. Class Prototypes: For each layer, the algorithm computes a "prototype" (mean embedding) for every class using the training data.
  2. Normalized Distance Calculation: It measures the distance between a node's representation at a specific layer and these class prototypes. MetSelect utilizes the Mahalanobis distance, which normalizes distances by the variance of embeddings within that layer, ensuring comparability across different depths.
  3. Optimal Layer Selection: During inference, a node is classified using the layer where its representation is closest to a class prototype.
  4. Personalized Training: The model is optimized using a personalized Cross-Entropy loss, encouraging nodes to align closely with their true class prototypes at their selected layers.

MetSelect is designed to be plug-and-play, meaning it can be integrated with existing architectures like GCN, GAT, or GIN without altering their core message-passing mechanisms.

Experimental Results

The authors evaluated MetSelect across 10 datasets, ranging from highly homophilic (e.g., Cora, Pubmed) to highly heterophilic (e.g., Texas, Wisconsin).

Performance on Heterophilic Graphs

MetSelect demonstrates its greatest utility on heterophilic datasets, where the graph structure can be misleading. By allowing nodes to "reach back" to shallower layers—sometimes even the 0-hop layer containing only the node's own features—MetSelect achieved accuracy gains of up to 20% on datasets like Texas and Wisconsin.

Depth Stability and Scalability

Standard GNNs often fail beyond 3–5 layers due to oversmoothing. MetSelect effectively solves this "depth crisis." Because it can select sharper, earlier representations when needed, the authors successfully trained GCNs up to 128 layers deep with minimal performance degradation.

Robustness to Adversarial Attacks

In scenarios where graph edges are "poisoned" (e.g., Mettack with 50% link perturbation), MetSelect acts as a natural filter. If a node's neighborhood becomes too noisy due to an attack, the algorithm adaptively selects a shallower, uncorrupted layer, maintaining significantly higher accuracy than vanilla GNNs.

Conclusion

MetSelect addresses a fundamental limitation in GNN design by replacing fixed-depth aggregation with personalized layer selection. By leveraging metric learning to find the optimal granularity for each node, the framework enhances performance on heterophilic graphs, enables the training of very deep networks, and provides inherent robustness against structural noise. While it introduces a modest computational overhead, its plug-and-play nature makes it a versatile tool for modern graph learning tasks.

Paper Citation: Sharma, K., Rakesh, V., Dou, Y., Kumar, S., & Das, M. (2025). Personalized Layer Selection for Graph Neural Networks. Transactions on Machine Learning Research.

Summary updated

BibTeX
@article{sharma2025personalized,
  author = {Kartik Sharma and Vineeth Rakesh and Yingtong Dou and Srijan Kumar and Mahashweta Das},
  title = {{Personalized Layer Selection for Graph Neural Networks}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
}
Figure