Introduction
Standard Pretrained Language Models (PLMs) like BERT have revolutionized natural language processing by capturing deep semantic relationships within text. However, these models are often "graph-blind," failing to leverage the structural information inherent in real-world data. Most data exists in Text-Attributed Heterogeneous Graphs (TAHGs)—complex networks where nodes represent different entities (e.g., papers, authors, venues) and edges represent various relationships (e.g., citations, authorship).
The researchers introduce THLM (Topological and Heterogeneous information in LMs), a pretraining framework designed to bridge the gap between textual understanding and structural awareness.
The Challenge: Graph-Blind Language Models
Existing PLMs face two primary hurdles when dealing with TAHGs:
- Topological Blindness: Standard models ignore the multi-hop connections between texts. While some "graph-aware" models exist, they typically only consider immediate neighbors, missing the rich context found in higher-order relationships.
- Textual Imbalance: In a heterogeneous graph, some nodes are "text-rich" (like a research paper with a title and abstract), while others are "textless" (like an author node containing only a name). This imbalance makes it difficult for LMs to learn meaningful representations for sparse entities.
The THLM Framework
To address these challenges, THLM introduces two core innovations during the pretraining phase: Context Graph Prediction (CGP) and a Text Augmentation Strategy.
Context Graph Prediction (CGP)
Instead of relying solely on Masked Language Modeling (MLM), THLM incorporates CGP. This task requires the model to predict which other nodes belong in a target node's "context graph"—defined as its neighbors within $K$ hops. As shown in the architecture diagram below, this is achieved by jointly optimizing the Language Model with an auxiliary Heterogeneous Graph Neural Network (HGNN). This process effectively "injects" structural knowledge from the GNN into the LM's parameters.
Text Augmentation Strategy
To solve the "textless node" problem, THLM uses a smart augmentation strategy. For nodes with minimal text, the model concatenates the text of their neighbors. For example, an author node's representation is enriched with the titles and abstracts of the papers they have written. This provides the LM with the necessary semantic context to generate high-quality embeddings for otherwise sparse nodes.
Key Results and Insights
The researchers evaluated THLM across several diverse datasets, including OAG-Venue (academic), GoodReads (books), and Patents (legal).
- Superior Performance: THLM consistently outperformed strong baselines such as BERT, RoBERTa, and even graph-specific models like LinkBERT and GIANT.
- Link Prediction & Node Classification: On the OAG-Venue dataset, THLM achieved significantly lower error rates in link prediction. In node classification tasks on the Patents dataset, it showed a marked improvement in precision over the second-best baseline.
- The Power of High-Order Neighbors: A key insight from the study is that looking beyond immediate connections (setting $K \ge 2$) significantly improves the model's understanding of graph topology.
- Ablation Studies: Experiments confirmed that both the CGP task and the text augmentation strategy are vital. Removing CGP led to a noticeable performance drop, proving its effectiveness in teaching the LM about graph structure.
Conclusion and Future Directions
THLM demonstrates that pretraining LMs with an explicit awareness of graph topology and heterogeneity leads to significantly better performance on graph-based downstream tasks. While the current work focuses on encoder-only models like BERT, future research could extend these techniques to decoder-only (GPT-style) or encoder-decoder (T5-style) architectures. Additionally, scaling these methods to web-scale graphs with billions of nodes remains an exciting challenge for the field.
Summary updated