Abstract
Link prediction in heterogeneous networks is challenging due to over-smoothing in Graph Neural Networks (GNNs) and the heavy reliance on manually defined meta-paths. We present CHAT (Contrastive Heterogeneous grAph Transformer), a framework that utilizes concentrated graph sampling and a connection-aware transformer to capture long-distance relationships without domain-specific templates. By treating edge sequences as primary features and employing a dual-faceted loss function, CHAT achieves state-of-the-art performance on drug-target interaction (DTI) and general heterogeneous benchmarks.
Introduction
Heterogeneous networks, which contain diverse node and edge types (e.g., drugs, proteins, and diseases), are vital for modeling complex real-world systems. However, predicting missing links in these networks faces two primary hurdles. First, traditional GNNs suffer from over-smoothing: as they aggregate information from distant neighbors, node features become indistinguishable, losing critical structural details. Second, most models depend on meta-paths—human-defined sequences of node types—which require extensive domain expertise and may overlook non-obvious patterns.
As illustrated in Figure 1, while GNNs are often restricted to local "reachable" regions, Transformers can effectively explore long-distance neighbors without feature degradation. CHAT addresses these limitations by automating path discovery and maintaining structural context through a transformer-based architecture.
Methodology
The CHAT framework introduces several key innovations to streamline link prediction in heterogeneous environments.
Concentrated Graph Sampling and Connection Encoding
Instead of standard random walks, CHAT employs concentrated graph sampling. This technique retains only "nodes of interest" and compresses intermediate nodes into connection encodings (tuples of edge types). This transformation effectively turns long paths into rich edge features, allowing the model to learn from complex connectivity patterns without explicit meta-path definitions.
Connection-Aware Transformer
The model utilizes a transformer architecture that is explicitly aware of node interconnections. By using shortest-path distances as position encodings, CHAT preserves the network's structural topology. This ensures that the transformer treats the sequence of nodes not just as independent tokens, but as a coherent part of the graph structure.
Training and Prediction
CHAT is trained using a dual-faceted loss function:
- Supervised Contrastive Loss: Enhances the model's ability to distinguish between linked (positive) and unlinked (negative) node pairs.
- Observation Probability Loss: An attentive loss mechanism that reinforces the likelihood of observing specific network neighborhoods.
Finally, an Ensemble Link Predictor synthesizes results from multiple random-walk samplings to ensure robust predictions and reduce variance.
Experimental Evaluation
The authors evaluated CHAT across several Drug-Target Interaction (DTI) datasets: DTI-315 (small/imbalanced), DTI-708 (medium/balanced), and DTI-258K (large-scale). The model was also tested on general benchmarks like ACM, DBLP, and IMDB.
Key Results
CHAT consistently outperformed both general graph models (e.g., HAN, Metapath2vec) and specialized DTI models (e.g., EEG-DTI).
- High Performance: On the DTI-258K dataset, CHAT achieved an AUC of 96.92% and an AUPR of 91.32%.
- Robustness: The model maintained high precision even on the heavily imbalanced DTI-315 dataset (1:29 ratio).
- Interpretability: Analysis of transformer attention weights revealed that the model could identify influential connection types (e.g., Target-Drug-Target), providing insights into its decision-making process.
Conclusion and Future Work
CHAT demonstrates that automating meta-path discovery through concentrated sampling and transformer architectures significantly improves link prediction. While the model is scalable, future work could address the sensitivity to sampling size and explore more sophisticated projection networks for the link predictor. Additionally, optimizing the quadratic complexity of self-attention for extremely dense sequences remains an area for further development.
Summary updated