Extract, Define, Canonicalize: An LLM-based Framework for Knowledge Graph Construction

Bowen Zhang, Harold Soh

Abstract

Knowledge Graph Construction (KGC) is essential for structured AI memory, yet Large Language Models (LLMs) often struggle with massive schemas that exceed their context windows. This paper introduces Extract-Define-Canonicalize (EDC), a three-phase framework that decouples extraction from schema alignment. By extracting information freely and using natural language definitions to map results back to a schema, EDC outperforms state-of-the-art models and scales effectively to complex, real-world datasets.

The Challenge of Scaling Knowledge Graphs

Turning raw text into structured "triplets" (Subject, Relation, Object) is a fundamental task in AI. However, existing LLM-based methods face a "scaling wall." Most approaches require the entire schema—the list of all allowed entity and relation types—to be included in the prompt. For comprehensive datasets like Wikidata, these schemas contain thousands of types, far exceeding standard context windows. Furthermore, without a pre-defined schema, models often produce redundant or inconsistent relations, such as using "job," "profession," and "occupation" interchangeably.

The EDC Framework

The proposed EDC framework addresses these limitations through a modular three-phase workflow:

  1. Open Information Extraction (OIE): The LLM extracts triplets from the text freely, without the constraints of a specific schema. This ensures the model captures all relevant information without being overwhelmed by a long prompt.
  2. Schema Definition: For every relation extracted in the first phase, the LLM generates a natural language definition based on the specific context (e.g., defining 'participatedIn' as "The subject took part in a specific mission").
  3. Schema Canonicalization:
    • Target Alignment: If a target schema exists, the system uses vector similarity to find potential matches and then asks the LLM to verify if the extracted relation can be replaced by the schema's version.
  4. Self-Canonicalization: If no schema exists, the system groups semantically similar relations to create a new, succinct schema.
The three-phase EDC framework: Open Information Extraction, Schema Definition, and Schema Canonicalization.

To further enhance performance, the authors introduced EDC+R (Refinement). This version utilizes a "Schema Retriever"—a fine-tuned embedding model—to identify relevant schema elements for a piece of text and provide them as "hints" for a second, more precise extraction pass.

Key Insights

  • Definitions as a Bridge: LLMs are significantly more accurate at mapping extractions to a schema when they first articulate what they believe the extraction means. This step bridges the gap between raw text and formal labels.
  • LLM as a Reasoning Filter: While vector similarity (embedding search) often groups distinct categories that share similar keywords (e.g., "place of birth" vs. "place of death"), using the LLM as a final verifier in the canonicalization phase prevents these clustering errors.
  • Retrieval-Augmented Extraction: The Schema Retriever allows the model to identify obscure relations that might be ignored during a blind extraction pass.

Experimental Results

The framework was evaluated on three major benchmarks: WebNLG, REBEL, and Wiki-NRE. EDC and EDC+R consistently outperformed specialized, trained models across various LLM backbones, including GPT-4, GPT-3.5, and Mistral-7b.

Performance comparison (F1 Scores) of EDC and EDC+R against baselines across WebNLG, REBEL, and Wiki-NRE datasets.

On the REBEL dataset, EDC+R achieved an F1 score of 0.601, nearly doubling the performance of the previous state-of-the-art model, GenIE (0.385). Notably, EDC maintained high performance even as schema sizes grew, as it never attempts to process the entire schema simultaneously. In "Self-Canonicalization" tests without a provided schema, human evaluators rated EDC's precision between 86% and 95%, significantly higher than traditional clustering methods.

Limitations and Future Work

While EDC represents a significant step forward, several areas for improvement remain:

  • Entity Resolution: The current study focused primarily on relations. Future iterations must handle "entity resolution" to recognize that different strings (e.g., "A. Shepard" and "Alan Shepard") refer to the same entity.
  • Cost and Latency: The multi-phase approach requires multiple LLM calls per sentence, making it more expensive and slower than single-pass models.
  • Small Model Optimization: While GPT-4 yielded the best results, future research will explore optimizing smaller, open-source models like Mistral-7b for the definition and canonicalization steps to reduce operational costs.

Summary updated

BibTeX
@inproceedings{zhang2024extract,
  author = {Bowen Zhang and Harold Soh},
  title = {{Extract, Define, Canonicalize: An LLM-based Framework for Knowledge Graph Construction}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.548},
}
Figure