Introduction
Graph Neural Networks (GNNs) are powerful tools for node classification on graph-structured data, such as categorizing users in a social network or papers in a citation graph. However, they are notoriously data-hungry, operating under the assumption that abundant, high-quality ground-truth labels are available for training. In the real world, human annotation is expensive, slow, and prone to bias.
Conversely, Large Language Models (LLMs) exhibit incredible zero-shot capabilities. For Text-Attributed Graphs (TAGs), an LLM can often guess a node's class simply by reading its text. Yet, LLMs struggle to understand graph topology and are prohibitively expensive to run on massive graphs with millions of nodes. This paper bridges that gap by asking: Can we use LLMs as cheap, zero-shot annotators for a small subset of nodes, and then use those annotations to train a fast, structure-aware GNN for the rest of the graph?
The result is LLM-GNN, a pipeline that achieves high accuracy without any human-provided labels—hitting 74.9% accuracy on the massive OGBN-PRODUCTS dataset for under a single dollar.
The LLM-GNN Pipeline
The authors propose a four-step pipeline that combines active learning, LLM prompting, and GNN training:
- Difficulty-Aware Active Node Selection: Standard active learning picks the most "diverse" or "representative" nodes to label. Because LLMs can hallucinate, the authors introduce a heuristic called C-Density (distance to k-means cluster centers in the node feature space). Nodes closer to cluster centers are "easier" for LLMs to annotate correctly. They blend this difficulty metric with traditional active learning scores to select an optimal candidate set.
- Confidence-Aware Annotations: They prompt GPT-3.5-turbo to classify the selected nodes and simultaneously output a confidence score (0-100) for its prediction, utilizing a "zero-shot hybrid" prompting strategy.
- Post-Filtering: To clean up the LLM's noisy labels, low-confidence annotations are filtered out. To prevent this from destroying the training set's diversity, they balance the confidence score with a "Change of Entropy" (COE) metric, ensuring a healthy mix of different labels.
- GNN Training: Finally, a standard Graph Convolutional Network (GCN) is trained on these LLM-annotated nodes. Because the labels may still contain noise, the LLM's confidence scores are used as weights in a weighted cross-entropy loss function.
Key Insights
- LLM accuracy correlates with feature density: The authors discovered that nodes sitting closer to the center of a cluster in the feature space are consistently annotated more accurately by LLMs. This indicates that "typical" nodes are easier for LLMs to classify using their pre-trained commonsense knowledge.
- LLM noise is "benign": Unlike synthetic random noise often used to test model robustness, LLM errors are structured (e.g., confusing "distributed computing" with "web technology"). Consequently, GNNs do not overfit to LLM-generated noise nearly as badly as they do to random noise.
- Structure-free prompts work best (for now): Counterintuitively, feeding the LLM information about a node's neighbors did not improve annotation quality. Because current LLMs struggle with structural reasoning, it is more effective to let the LLM look only at the text to generate labels, leaving the structural message-passing to the GNN.
Performance and Cost Efficiency
The authors evaluated their pipeline on several standard TAG benchmarks, ranging from small datasets like CORA and CITESEER to large-scale graphs like OGBN-PRODUCTS (~2.4 million nodes).
- Massive Cost Savings: On OGBN-PRODUCTS, using an LLM to predict every single node would cost an estimated $1,572. The LLM-GNN pipeline achieved 74.9% accuracy while spending only $0.74 on LLM API calls.
- Beats Zero-Shot Baselines: LLM-GNN significantly outperformed other label-free and zero-shot classification methods, including SES, TAG-Z, and BART-large-MNLI.
- Effective Synergy: The combination of FeatProp (a standard active learning technique) with the authors' post-filtering and weighted loss consistently yielded the best trade-off between accuracy and computational scalability across all datasets.
Limitations and Future Work
The study primarily relied on zero-shot hybrid prompts. Exploring more complex prompting strategies (like Chain-of-Thought) was deferred because they frequently failed to output the strict JSON formats required for automated parsing and drastically increased API costs. Furthermore, because current LLMs are poor at graph reasoning, the pipeline uses structure-free prompts. Designing effective structure-aware prompts—perhaps via multi-round autonomous agents—remains a highly valuable future direction. Finally, the authors opted for GPT-3.5-turbo over GPT-4, noting that GPT-4 did not offer a significant enough performance bump on this specific task to justify its vastly higher cost.
Summary updated