Abstract
Large Language Models (LLMs) serve as extensive repositories of factual knowledge, yet the structural organization of this information remains poorly understood. This paper investigates whether LLM knowledge follows topological patterns within a graph structure. By mapping knowledgeability scores onto knowledge graphs, we identify significant "knowledge homophily"—where connected entities are known with similar accuracy—and a strong correlation between node degree and model performance. Leveraging these patterns, we demonstrate that Graph Neural Networks (GNNs) can accurately predict model ignorance. Furthermore, we introduce "Graph-FT," a targeted fine-tuning strategy that prioritizes these structural blind spots, achieving a significant performance boost (69.04% avg.) over random data selection (62.09% avg.) across multiple models and domains.
Introduction
While LLMs are often treated as black-box knowledge bases, cognitive science suggests that human knowledge is organized in structured semantic networks. This research explores if LLMs exhibit similar structural organization. By treating the model's internal knowledge as a field over a Knowledge Graph (KG), we can analyze its topological properties. Understanding these "knowledge neighborhoods" is crucial for improving retrieval-augmented generation (RAG), detecting hallucinations, and optimizing fine-tuning processes.
Methodology: Probing the Knowledge Base
The authors propose a multi-step framework to map and predict LLM knowledge:
- Knowledgeability Measurement: Triplet knowledge is assessed by converting KG facts into True/False prompts. Entity knowledgeability is then derived by averaging the scores of adjacent triplets.
- Topological Mapping: These scores are projected onto the KG to analyze structural properties like node degree and centrality.
- Knowledge Homophily: A key metric measuring the tendency of connected nodes to share similar knowledgeability levels.
- GNN-based Prediction: Using a small labeled subset (20%), a Graph Neural Network (e.g., GraphSAGE) is trained to regress the knowledgeability of the remaining 80% of the graph.
- Graph-Targeted Fine-Tuning (Graph-FT): The GNN's predictions identify "ignorant" regions, which are then prioritized for fine-tuning.
Datasets
The study utilizes five diverse datasets to capture both general and domain-specific performance:
- General Knowledge: T-Rex and WD50K (Wikipedia/Wikidata).
- Specialized Domains: PharmKG8K (Biomedical) and MVPKG (Political Science).
- Complex Relations: CoDEx-S (Occupation-focused Wikidata), which is challenging due to one-to-many mappings.
Structural Patterns of LLM Knowledge
Analysis reveals several consistent patterns across different models:
- Clustered Knowledge (Homophily): Knowledge is not randomly distributed; it exhibits high homophily. If an LLM knows a specific entity, it is highly likely to know its immediate neighbors.
- Degree Correlation: There is a strong positive correlation between an entity's connectivity (node degree) and its knowledgeability. "Hub" entities, more frequent in pre-training data, are better remembered than peripheral ones.
- Domain Sensitivity: General knowledge is widely distributed (right-skewed), while specialized knowledge is sparse (left-skewed).
- Temporal Decay: Adding temporal constraints to facts reduces both knowledgeability and homophily, indicating that LLMs struggle with time-sensitive information.
Experimental Results
The GNN models (T-SAGE, T-GCN) significantly outperformed standard MLPs in predicting entity knowledgeability, achieving low absolute errors. The most significant application of this structural insight is in fine-tuning.
As shown in the results, Graph-FT consistently outperforms random selection (Random-FT). Across Llama3 8B, Mistral 7B, and Qwen2.5 7B, targeting the model's "ignorant" regions led to an average performance of 69.04%. The effect was most pronounced in specialized domains like PharmKG8K, where random selection can actually degrade performance due to redundancy, whereas Graph-FT provided a substantial gain (e.g., 41.30% vs 60.70% for Mistral 7B).
Conclusion
This work demonstrates that LLM knowledge is structurally organized according to graph-topological principles. By identifying knowledge homophily and degree correlations, we can efficiently map a model's strengths and weaknesses. The proposed Graph-FT method offers a more data-efficient path for domain-specific fine-tuning, moving beyond random data selection toward a more surgical, structure-aware approach to model improvement.
Summary updated