# Structured prompt interrogation and recursive extraction of semantics (SPIRES): A method for populating knowledge bases using zero-shot learning

arXiv: https://arxiv.org/abs/2304.02711 · HTML: https://mlsanity.com/paper/2304.02711/

## Key facts

- Cited by 50 papers in the map (data through 14 Oct 2026).
- Builds on 17 of its 73 references that are in the map.
- First posted on arXiv 5 Apr 2023.

## Builds on (most cited first, 17 of 17)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://mlsanity.com/paper/1810.04805/) (2018)
- [Language Models are Few-Shot Learners](https://mlsanity.com/paper/2005.14165/) (2020)
- [LLaMA: Open and Efficient Foundation Language Models](https://mlsanity.com/paper/2302.13971/) (2023)
- [Survey of Hallucination in Natural Language Generation](https://mlsanity.com/paper/2202.03629/) (2022)
- [Language Models as Knowledge Bases?](https://mlsanity.com/paper/1909.01066/) (2019)
- [LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention](https://mlsanity.com/paper/2303.16199/) (2023)
- [BioGPT: Generative Pre-trained Transformer for Biomedical Text Generation and Mining](https://mlsanity.com/paper/2210.10341/) (2022)
- [What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models](https://mlsanity.com/paper/1907.13528/) (2019)
- [Incorporating Domain Knowledge into Deep Neural Networks](https://mlsanity.com/paper/2103.00180/) (2021)
- [Structured information extraction from complex scientific text with fine-tuned large language models](https://mlsanity.com/paper/2212.05238/) (2022)
- [Combining pre-trained language models and structured knowledge](https://mlsanity.com/paper/2101.12294/) (2021)
- [A Comparative Study of Transformer-Based Language Models on Extractive Question Answering](https://mlsanity.com/paper/2110.03142/) (2021)
- [Biolink Model: A Universal Schema for Knowledge Graphs in Clinical, Biomedical, and Translational Science](https://mlsanity.com/paper/2203.13906/) (2022)
- [A Review of SHACL: From Data Validation to Schema Reasoning for RDF Graphs](https://mlsanity.com/paper/2112.01441/) (2021)
- [Quantification of BERT Diagnosis Generalizability Across Medical Specialties Using Semantic Dataset Distance](https://mlsanity.com/paper/2008.06606/) (2020)
- [Generating Ontologies from Templates: A Rule-Based Approach for Capturing Regularity](https://mlsanity.com/paper/1809.10436/) (2018)

## Built on by (most cited first, 30 of 50)

- [A Survey of Large Language Models in Medicine: Progress, Application, and Challenge](https://mlsanity.com/paper/2311.05112/) (2023)
- [Opportunities and Challenges for ChatGPT and Large Language Models in Biomedicine and Health](https://mlsanity.com/paper/2306.10070/) (2023)
- [Large Language Models and Knowledge Graphs: Opportunities and Challenges](https://mlsanity.com/paper/2308.06374/) (2023)
- [Are large language models superhuman chemists?](https://mlsanity.com/paper/2404.01475/) (2024)
- [Probing the limitations of multimodal language models for chemistry and materials research](https://mlsanity.com/paper/2411.16955/) (2024)
- [DeepOnto: A Python Package for Ontology Engineering with Deep Learning](https://mlsanity.com/paper/2307.03067/) (2023)
- [Ontology engineering with Large Language Models](https://mlsanity.com/paper/2307.16699/) (2023)
- [Research Trends for the Interplay between Large Language Models and Knowledge Graphs](https://mlsanity.com/paper/2406.08223/) (2024)
- [Evaluation of large language models for discovery of gene set function](https://mlsanity.com/paper/2309.04019/) (2023)
- [Dynamic Retrieval Augmented Generation of Ontologies using Artificial Intelligence (DRAGON-AI)](https://mlsanity.com/paper/2312.10904/) (2023)
- [Gene Set Summarization using Large Language Models](https://mlsanity.com/paper/2305.13338/) (2023)
- [Synergistic Integration of Large Language Models and Cognitive Architectures for Robust AI: An Exploratory Analysis](https://mlsanity.com/paper/2308.09830/) (2023)
- [Knowledge Graphs for the Life Sciences: Recent Developments, Challenges and Opportunities](https://mlsanity.com/paper/2309.17255/) (2023)
- [Towards Next-Generation Urban Decision Support Systems through AI-Powered Construction of Scientific Ontology using Large Language Models -- A Case in Optimizing Intermodal Freight Transportation](https://mlsanity.com/paper/2405.19255/) (2024)
- [Ontology Enrichment from Texts: A Biomedical Dataset for Concept Discovery and Placement](https://mlsanity.com/paper/2306.14704/) (2023)
- [Advancing the Scientific Method with Large Language Models: From Hypothesis to Discovery](https://mlsanity.com/paper/2505.16477/) (2025)
- [Decompose, Enrich, and Extract! Schema-aware Event Extraction using LLMs](https://mlsanity.com/paper/2406.01045/) (2024)
- [RNA-KG: An ontology-based knowledge graph for representing interactions involving RNA molecules](https://mlsanity.com/paper/2312.00183/) (2023)
- [Exploring the Reversal Curse and Other Deductive Logical Reasoning in BERT and GPT-Based Large Language Models](https://mlsanity.com/paper/2312.03633/) (2023)
- [The Artificial Intelligence Ontology: LLM-assisted construction of AI concept hierarchies](https://mlsanity.com/paper/2404.03044/) (2024)
- [Ontology Population using LLMs](https://mlsanity.com/paper/2411.01612/) (2024)
- [Retrieval-Augmented Generation of Ontologies from Relational Databases](https://mlsanity.com/paper/2506.01232/) (2025)
- [CurateGPT: A flexible language-model assisted biocuration tool](https://mlsanity.com/paper/2411.00046/) (2024)
- [OntoLearner: A Modular Python Library for Ontology Learning with Large Language Models](https://mlsanity.com/paper/2607.01977/) (2026)
- [MapperGPT: Large Language Models for Linking and Mapping Entities](https://mlsanity.com/paper/2310.03666/) (2023)
- [Exploring Large Language Models as a Source of Common-Sense Knowledge for Robots](https://mlsanity.com/paper/2311.08412/) (2023)
- [Document-Level Event Extraction with Definition-Driven ICL](https://mlsanity.com/paper/2408.05566/) (2024)
- [Open Ontologies: Tool-Augmented Ontology Engineering with Stable Matching Alignment](https://mlsanity.com/paper/2605.09184/) (2026)
- [Document Automation Architectures: Updated Survey in Light of Large Language Models](https://mlsanity.com/paper/2308.09341/) (2023)
- [Enhancing Knowledge Graph Construction: Evaluating with Emphasis on Hallucination, Omission, and Graph Similarity Metrics](https://mlsanity.com/paper/2502.05239/) (2025)

## Abstract (arXiv)

Creating knowledge bases and ontologies is a time consuming task that relies on a manual curation. AI/NLP approaches can assist expert curators in populating these knowledge bases, but current approaches rely on extensive training data, and are not able to populate arbitrary complex nested knowledge schemas. Here we present Structured Prompt Interrogation and Recursive Extraction of Semantics (SPIRES), a Knowledge Extraction approach that relies on the ability of Large Language Models (LLMs) to perform zero-shot learning (ZSL) and general-purpose query answering from flexible prompts and return information conforming to a specified schema. Given a detailed, user-defined knowledge schema and an input text, SPIRES recursively performs prompt interrogation against GPT-3+ to obtain a set of responses matching the provided schema. SPIRES uses existing ontologies and vocabularies to provide identifiers for all matched elements. We present examples of use of SPIRES in different domains, including extraction of food recipes, multi-species cellular signaling pathways, disease treatments, multi-step drug mechanisms, and chemical to disease causation graphs. Current SPIRES accuracy is comparable to the mid-range of existing Relation Extraction (RE) methods, but has the advantage of easy customization, flexibility, and, crucially, the ability to perform new tasks in the absence of any training data. This method supports a general strategy of leveraging the language interpreting capabilities of LLMs to assemble knowledge bases, assisting manual knowledge curation and acquisition while supporting validation with publicly-available databases and ontologies external to the LLM. SPIRES is available as part of the open source OntoGPT package: https://github.com/ monarch-initiative/ontogpt.
