A Neuro-Symbolic Framework for Knowledge Graph Construction from Text

Gandharva Naveen, Abdulsobur Oyewale, Ronit Banerjee, Aakash Thatte, Ananya Ananya, Ziwei Xu, Diego Moussallem, Yogesh Kulkarni, Tommaso SoruarXiv 2026

TL;DR

Large Language Models (LLMs) are great at reading a sentence and spitting out structured facts, but they tend to hallucinate when forced to follow the strict rules of a real-world Knowledge Graph like DBpedia. The Neural Extraction Framework (NEF) solves this by putting the LLM on a leash: it splits fact extraction into four stages, using deterministic lookup tables and vector search to ground entities and relations, and only letting the LLM select from pre-validated candidates. On the Text2KGBench benchmark, NEF hits a macro $F_1$ of 0.628, beating a matched GPT-4o baseline (0.570) by over 10% relatively—without changing the underlying model.

What Problem Does This Paper Address?

If you want to automatically build or expand a Knowledge Graph (KG) from raw text, you need to extract RDF triples—structured statements in the form of (subject, predicate, object), such as (dbr:Trane, dbo:location, dbr:La_Crosse,_Wisconsin).

Historically, two families of tools have tried to do this:

  1. Rule-based semantic parsers, which break down when sentences get grammatically complex.
  2. Neural sequence-to-sequence models (like REBEL or GENRE), which struggle with pronouns and discourse references (e.g., figuring out who "whose" refers to) and often produce disconnected or type-incorrect triples.

Modern LLMs can extract fluent facts, but they still fail at schema conformance: they invent fake DBpedia URIs, coerce dates into entity links, or pick predicates that sound right but violate the ontology's domain and range rules. NEF tackles this by combining neural reasoning with symbolic guardrails so the LLM never generates a URI directly.

Methods

NEF is a four-stage neuro-symbolic pipeline. Let's trace how it processes a tricky sentence: "Trane, whose products include HVAC, was founded in La Crosse, Wisconsin on 1913-01-01."

Figure 1. The NEF pipeline applied to the running example: an LLM extracts typed tuples, a surface-form index grounds entities while literals pass through, embeddings retrieve predicate candidates, and an ontology-aware LLM selects the final triple.
  1. LLM-based Triple Extraction: An LLM (GPT-4o in the main experiments) extracts typed textual tuples using a structured JSON prompt. The prompt enforces casing preservation, resolves pronouns (turning whose into Trane), keeps predicates concise (1–4 tokens), and tags objects as entity, literal, number, or date. Instead of using static few-shot examples, NEF dynamically retrieves 6 demonstrations per test sentence using BM25 + Maximal Marginal Relevance (MMR) to ensure both relevance and diversity.
  2. Deterministic Entity Linking: Mentions are matched against a Redis-backed surface-form index built from Wikipedia anchor text, with redirect chasing. If an entity mention returns no candidates, NEF triggers one bounded "agentic repair" LLM call to propose a shorter surface form from context and re-runs the lookup. Crucially, NEF uses an asymmetric admission policy: subjects must be grounded to a DBpedia URI, while typed literals (like 1913-01-01) pass through untouched.
  3. Predicate Embedding & Alignment: Rather than exact matching, predicates are matched by meaning. NEF pre-computes gemini-embedding-001 vectors for all 2,889 DBpedia properties (combining their names, rdfs:label, and rdfs:comment) in a FAISS index. At runtime, it retrieves the top-10 candidates via cosine similarity and re-ranks them to top-5 using token overlap and rdfs:range compatibility.
  4. Ontology-aware Disambiguation: A second LLM pass acts as a judge. Given the sentence, the candidate entities, and the top-5 predicates along with their rdfs:domain and rdfs:range, it outputs JSON indices selecting the final valid triple. Symbolic safeguards (a role-swap guard and a collision guard) catch any remaining structural slips.

Datasets

NEF is evaluated on the DBpedia–WebNLG task from Text2KGBench, a standard ontology-constrained benchmark. It spans 19 per-domain ontologies (such as university, building, film, and writtenwork) and includes 2,014 test sentences paired with disjoint training splits.

Key Insights and Ideas

  • Bound the failure mode to selection, not fabrication: By never letting the LLM write a URI, hallucinations are reduced to choosing the wrong item from a short, pre-validated list.
  • Cosine similarity isn't enough for predicates: For "founded in La Crosse, Wisconsin", vector search ranks foundingYear and foundingDate higher than foundationPlace. Only by consulting rdfs:range in Stage 4 does the system reject the date-valued predicates and reach down to rank 4 to pick dbo:foundationPlace.
  • Asymmetric admission saves literals: Requiring every object to be a KG entity silently drops dates, counts, and measurements. Letting typed literals bypass entity linking preserves this vital class of facts.
  • Dynamic few-shot retrieval beats static prompts: Pure BM25 retrieval often pulls near-duplicate training examples about the same subject; adding MMR ($\lambda = 0.5$) diversifies the demonstrations and boosts performance.

Key Results

Across all 19 DBpedia–WebNLG domains, NEF achieves a macro $F_1$ of 0.628 (Precision: 0.628, Recall: 0.630).

  • It outperforms the matched GPT-4o 6-shot baseline (0.570 $F_1$) by +5.8 absolute points (+10.2% relative gain) using the exact same base model and shot count.
  • It also outperforms all other compared systems, including fine-tuned T5-Large (0.389), fine-tuned REBEL (0.390), and GPT-3.5 Turbo 5-shot (0.510).
  • Performance varies by domain: six domains exceed 0.70 $F_1$ (led by 14_writtenwork at 0.768), while small or idiosyncratic domains like 12_monument (0.370, 19 sentences) pull the average down.

Limitations and Future Work

  • KG idiosyncrasies: Many residual errors cannot be solved from text alone—such as DBpedia inconsistently storing country as a literal string ("India") for some universities and a URI (India) for others, or unit-normalisation quirks (e.g., converting "125.8 metres" to 125800.0 millimetres).
  • Latency/Cost: The agentic pipeline can trigger up to three LLM calls per sentence (extraction, optional repair, disambiguation), though parallelisation and caching keep wall-clock time comparable to single-pass baselines.
  • Future directions: Because NEF's architecture is benchmark-agnostic (only the surface-form and property indices are DBpedia-specific), it can be ported to Wikidata-TekGen or other KGs. The authors highlight predicate-aware few-shot retrieval, calibrated abstention, and provenance-aware KG merging as promising next steps.

Summary updated

BibTeX
@misc{naveen2026neuro,
  author = {Gandharva Naveen and Abdulsobur Oyewale and Ronit Banerjee and Aakash Thatte and Ananya Ananya and Ziwei Xu and Diego Moussallem and Yogesh Kulkarni and Tommaso Soru},
  title = {{A Neuro-Symbolic Framework for Knowledge Graph Construction from Text}},
  year = {2026},
  eprint = {2612.04731},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.04731},
}
Figure