Abstract
Graph Machine Learning often faces the "feature misalignment" problem, where models trained on one dataset cannot easily generalize to others with different feature dimensions. This paper introduces TANS (Topology-Aware Node description Synthesis), a framework that leverages Large Language Models (LLMs) to generate textual descriptions for nodes based solely on their structural properties. By converting graph topology into a universal natural language format, TANS enables the creation of Text-Attributed Graphs (TAGs) from any dataset, facilitating cross-graph learning and improving performance on both text-free and text-rich graphs.
Introduction
Graph Neural Networks (GNNs) are essential for analyzing complex relational data. However, a significant limitation is their sensitivity to input feature dimensions. A GNN designed for a citation network with specific word-count features cannot be directly applied to a social network with different attributes. This lack of interoperability hinders the development of foundation models for graphs.
Text-Attributed Graphs (TAGs) have emerged as a solution. By using text as a common denominator, researchers can use pre-trained text encoders (like BERT) to map diverse datasets into a shared vector space. The primary bottleneck is that many real-world graphs lack textual descriptions. TANS addresses this by asking: Can LLMs automatically synthesize meaningful text descriptions based solely on a node's position in the graph?
Methodology: The TANS Framework
TANS (Topology-Aware Node description Synthesis) utilizes a four-step pipeline to bridge the gap between structural topology and natural language:
- Structural Feature Extraction: For every node, five key metrics are calculated: Degree Centrality, Betweenness Centrality, Closeness Centrality, Clustering Coefficient, and Square Clustering Coefficient.
- Rank-Based Description Generation: Rather than providing raw numerical values, TANS converts these metrics into relative rankings (e.g., "This node is in the top 5% for connectivity"). This contextualizes the data for the LLM.
- LLM Reasoning and Prompting: The structural data is fed into an LLM (specifically GPT-4o-mini). The model is prompted to predict a potential category for the node and, crucially, to explain its reasoning based on the provided topology.
- Feature Synthesis: The LLM’s explanation becomes the node's new "text attribute." This text is then processed by a standard text encoder to create a unified, aligned feature space for subsequent GNN tasks.
Experimental Evaluation
The researchers evaluated TANS across three distinct scenarios:
- Text-Free Networks: Airport networks (USA, Europe, Brazil) where nodes represent airports and edges represent flights. These originally contained zero textual information.
- Text-Rich/Limited Networks: Citation networks (Cora, Pubmed) which already possess titles and abstracts.
Key Results
- Superiority on Text-Free Data: On the Brazil airport dataset, TANS-generated descriptions achieved 80.61% accuracy, significantly outperforming traditional structural features (71.82%).
- Enhancing Existing Text: Even in citation networks where text was already present, adding TANS-generated topological descriptions improved classification accuracy by 1.5% to 2%, suggesting that structural "explanations" capture information missed by raw text.
- Cross-Graph Generalization: TANS enabled successful domain adaptation. A model trained on US airport data and tested on Brazilian data achieved 58.40% accuracy, vastly outperforming standard alignment techniques like SVD (39.72%).
Discussion and Insights
The success of TANS stems from the "common sense" LLMs possess regarding network structure. An LLM can infer that a node with high "Betweenness Centrality" likely acts as a hub or bridge, allowing it to generate semantically meaningful descriptions even without domain-specific labels. Furthermore, the use of relative rankings rather than raw values provides the necessary context for the LLM to understand a node's importance within its specific graph.
Conclusion and Future Work
TANS demonstrates that LLMs can effectively "textualize" graph topology, solving the feature misalignment problem and enabling cross-graph learning. While currently limited by the cost and latency of LLM APIs for massive graphs, future work will explore more efficient models and the application of this technique to link prediction and graph-level classification tasks.
Summary updated