Abstract
Large Language Models (LLMs) contain vast amounts of latent factual knowledge, yet traditional probing methods often suffer from availability bias. This paper introduces a methodology to "materialize" this knowledge into a structured Knowledge Base (KB). By recursively querying GPT-4o-mini, the authors construct GPTKB, a massive resource containing 101 million relational triples for 2.9 million entities. This persistent, queryable database allows for a comprehensive analysis of an LLM's internal world model, revealing its scale, consistency, and inherent biases.
Introduction
Traditionally, researchers analyze LLM knowledge using a "prompt-and-discard" approach, asking specific questions and recording accuracy. However, this method only explores topics researchers think to ask about, leaving the "long tail" of the model's internalized facts unmapped. We propose moving toward extensive materialization—transforming model weights into a persistent database to understand the full scope and structure of what an LLM "believes."
Methodology: The GPTKB Pipeline
The construction of GPTKB involves a scalable two-stage pipeline: Knowledge Elicitation and Knowledge Consolidation.
- Knowledge Elicitation: Starting from a seed entity, the system prompts the LLM for facts in (subject, predicate, object) format. It then performs Named-Entity Recognition (NER) on the objects to identify new entities, which are enqueued for subsequent Breadth-First Search (BFS) rounds.
- Knowledge Consolidation: To handle the diversity of LLM outputs, the pipeline uses SentenceTransformers to cluster synonymous relations and classes. It also constructs a taxonomy and deduplicates entities (e.g., "JFK" vs. "John F. Kennedy") using fact-based cosine similarity.
The GPTKB Dataset
GPTKB represents a significant contribution to open knowledge resources. Extracted from GPT-4o-mini, it contains 101M triples and 2.9M entities, making it comparable in scale to major academic KBs like Yago. Remarkably, the construction cost was approximately $3,500 in API fees, or roughly $0.0001 per correct triple—over 100 times cheaper than traditional semi-automated methods.
Analysis and Key Insights
The materialization of GPT-4o-mini's knowledge reveals several critical properties of the model's internal representation:
The Precision Gradient: Evaluation using Llama 3.1-70B as an automated judge (verified against web search results) shows that while precision is highest for common entities, it remains surprisingly robust in the long tail.
As shown in the figure, approximately 74% of entities are verifiable. While precision drops as the BFS depth increases, it remains around 70% even at layer 10, suggesting the model maintains coherence far beyond its most frequent training concepts.
Structural and Temporal Characteristics:
* Consistency Issues: LLMs struggle with inverse relations. For instance, only about 10% of parent_company triples were mirrored by subsidiary triples, indicating a lack of global relational consistency.
* Biases: The KB reflects a strong English-centric bias, with Western nationalities significantly overrepresented compared to Chinese or Indian entities.
* Knowledge Cutoff: Analysis of temporal properties shows a sharp decline in facts after 2023, aligning with the model's self-declared training cutoff.
Conclusion and Future Work
Extensive materialization provides a concrete "map" of LLM knowledge, revealing both its impressive breadth and its structural weaknesses. Future work could leverage these materialized KBs to perform "selective updates," identifying outdated or hallucinated segments of a model's knowledge to target for RAG (Retrieval-Augmented Generation) or fine-tuning interventions.
Summary updated