LLMs at the gate: extraction with closed-world checking

LLMs at the gate: extraction with closed-world checking
Figure 11. Design an LLM-to-graph pipeline where every generated claim faces a vocabulary and rule gate.

Large Language Models (LLMs) generate text with remarkable fluency but are prone to producing novel terms or inconsistent claims. When used in safety-critical domains, this introduces risks from uncontrolled semantic expansion. A structured approach is needed to integrate LLM outputs into formal knowledge graphs without introducing invalid vocabulary or logical inconsistencies.

LLMs in structured knowledge work

The neural half of neurosymbolic systems excels at interpreting unstructured text. It processes information from sources like launch announcements, operator filings, anomaly reports and mission descriptions, documents that are text-based and often lack formal structure. The question is not whether to use LLMs, but where their outputs are permitted to integrate into structured systems. This distinction is essential for maintaining data integrity in safety-critical applications.

The gate pattern for LLM outputs

A staged approach ensures controlled integration of LLM outputs. In this pattern, generated content first enters a staging graph. From there, a closed-world vocabulary check filters out any term not defined in the established ontology or lift. Alignment rules then type-check the claims. Extensional checks validate whether instances align with known facts. Only claims that pass all checks are merged into the main knowledge graph. All rejected outputs are placed in a labelled review queue for further scrutiny.

Why closed-world checking is essential

Open-world validation allows unknown terms to pass through, which is problematic when the goal is to maintain semantic consistency. In experiments detailed in the instructor’s open-ontologies work, fabricated vocabulary slipped through shape validation but was successfully caught using a closed-world gate. This demonstrates that closed-world checking is more robust for identifying invalid or invented terms than traditional open-world validators.

Measuring neural performance with benchmarks

Recent benchmarks directly evaluate how well LLMs perform in structured knowledge work. The LLMs4OL challenge series assesses LLMs on term typing, taxonomy discovery, and relation extraction. The LLM-based matchers from the LLMs4OM lineage produce candidate sets with high recall and plausibility weighting. These matchers are particularly useful for identifying failure modes in earlier stages of the pipeline, as measured in lessons 8 and 9.

Stable matching and agent verification

The instructor’s stable-matching alignment method, described in arXiv:2605.09184, achieves an F1 score of 0.832 on the OAEI Anatomy track. This method is used to select neural candidates before they are passed to the closed-world gate. When the neural component is an acting agent rather than just a text reader, causal intervention (CIVeX, arXiv:2605.09168) is used to verify agent actions. This ensures that both the selection and validation stages are robust.

Efficiency in neurosymbolic systems

In this course’s implementation, the entire symbolic side of the pipeline runs efficiently on a standard laptop. The computational expense does not lie in symbolic operations themselves but in the need to avoid skipping the symbolic validation steps. The key is to maintain a balance between performance and correctness. The symbolic layer must not be treated as an afterthought, even though it is computationally lightweight.

What to take away

LLMs are powerful tools for processing unstructured text, but without strict validation, they introduce semantic noise into structured systems. A closed-world gate ensures that only terms from a defined vocabulary are accepted. Benchmarks like LLMs4OL and methods like stable matching support reliable neural integration. The symbolic side of the pipeline is efficient and must be fully utilised to maintain system safety and consistency.

Reference

Lesson 11 of 15
Outcome Design an LLM-to-graph pipeline where every generated claim faces a vocabulary and rule gate.
Worked repository neurosymbolic-space-kg on GitHub
Domain ontology Space Situational Awareness Ontology (Rovetto)

Sources and further reading

Update: the model this course’s method produced

Since this course was written, the method here was used to train and publish an open language model for the Space Situational Awareness Ontology: fabsssss/qwen3-coder-30b-a3b-space, with its training dataset and evaluation traces. It is, as far as we know, the first openly published language model targeting a space-domain ontology.

The measurement matters more than the model. Asked for SSAO Turtle, the untuned base model invents 13.81 non-existent ontology terms per output, and what it invents looks exactly right: ssao:SpaceObject, ssao:launchDate, ssao:OrbitalElements. None of those exist. After training on data derived correct-by-construction from the catalogue, hallucinated terms fall to 0.06 per output and term conformance rises from 0 percent to 97.2 percent. This is the gate pattern of this lesson, made measurable.

One honest limitation, recorded because it teaches the lesson better than the success does: the model will fill in fields you did not give it. Asked about the ISS with no COSPAR number supplied, it produced the correct designator from memory. Correct here, a fabrication risk for an obscure object, and invisible to a vocabulary gate because the term is real and only the value is invented. Check literal values against your own records, not just ontology terms.

Apply it to your work