Skip to content
#small language model Open access

Large Language Model-Based Text-to-Cypher Generation for Question-Answering on Biomedical Knowledge Graphs.

Sep 2026 · Studies in Health Technology and Informatics · Vol 340, pp. 179-186 · 0 citations
Medicine

TL;DR

Few-shot prompting heavily improves query generation quality and enables effective use of smaller models, supporting the practical deployment of locally hosted LLMs for knowledge graph question answering.

Abstract

INTRODUCTION Knowledge graphs are widely adopted due to their flexible structure and ability to represent large-scale, heterogeneous data. However, as these graphs grow, the queries used to retrieve information become more complex, making efficient information retrieval and question answering more challenging.

Objective

This work investigates (1) the impact of few-shot versus zero-shot prompting on Cypher query generation, and (2) performance differences between small (∼7B) and mid-size (∼32B) large language models (LLMs) on both of these approaches.

Methods

We propose a system that translates natural language questions into Cypher queries for execution on a Neo4j knowledge graph and evaluates answer quality on the PrimeKG and BioHopR datasets. To address data protection and cost constraints, we focus on locally deployable LLMs that require no additional training, using zero-shot and few-shot prompting strategies.

Results

32B models generate syntactically valid Cypher queries using only the knowledge graph schema information. Few-shot prompting with four examples improves F1 score by 35.7 percentage points (∼62% relative improvement) compared to zero-shot prompting. While 7B models struggle to generate syntactically valid queries in the zero-shot setting, few-shot prompting substantially improves their performance, enabling high query syntax validity and F1 scores above 80%.

Conclusion

Few-shot prompting heavily improves query generation quality and enables effective use of smaller models, supporting the practical deployment of locally hosted LLMs for knowledge graph question answering.

Read PDF

Similar papers

2026

Integrating Knowledge Graph with Large Language Models for Multi-hop Question Generation

This work proposes Knowledge Graph for Question Generation (KG4QG), a novel framework that integrates knowledge graphs with large language models to address the challenges of MHQG, and demonstrates the effectiveness of combining structured knowledge and pre-trained language models for complex question generation tasks.

Yllias Chali, Al Hasib Mahamud · 0 citations
Open access Sep 2026

Diabetes question answering method based on knowledge graph and large language model

Conventional medical Question Answering (QA) systems often suffer from insufficient domain-specific knowledge grounding, limited semantic understanding, and weak answer traceability. To address these issues, this study proposes a decision-support QA framework that integrates structured retrieval over a diabetes knowled...

Yue-Long Zhang, Song-Pu Li, Tianrui Lyu et al. · 0 citations
Book Open access Aug 2026

PYTHIA: Universal Question Answering over Knowledge Graphs

PYTHIA is presented, a training-free, plug-and-play solution for KGQA over any RDF KG which consists of an LLM agent guided by a relation-centric conceptual model of the KGQA task which is acted upon through a suite of tools for entity linking, graph exploration and query execution.

Sergios-Anestis Kefalidis, Konstantinos Plas, Manolis Koubarakis · 1 citation

Restrictive Training (QuAART): Question Answering for the Rapid Development of New Knowledge Extraction Pipelines

This work hypothesizes that using models trained only on generic question answering data (e.g. SQuAD) is a good starting point for domain specific entity extraction, and explores whether the addition of small amounts of training data can help lift model performance.

Corey A. Harper, R. Daniel, Paul Groth · 0 citations
#artificial intelligence Preprint Sep 2026

Enabling Knowledge Graph Understanding at Scale with the EXplore Your Graphs ENgine (EXYGEN)

We present EXYGEN (EXplore Your Graphs ENgine), a framework for knowledge graph (KG) understanding that enables conversational access to KGs at scale. We address two questions in sequence. First, how effectively can LLMs perform text-to-SPARQL generation given only automatically derived structured metadata and small gr...

Harshdeep Singh, Yu-Rui Zhu, Giovanni Colavizza et al. · 0 citations
#artificial intelligence Preprint Sep 2026

Can We Do Interpretable NLI with Graphs Based on Atomic Propositions?

While Large Language Model (LLM)-based Natural Language Inference (NLI) systems achieve high accuracy, their decision-making processes lack auditable structures. This paper explores whether NLI can be performed using only interpretable, graph-based representations of evidence. We introduce a fully graph-based pipeline...

Younes Boufouss, Luc Pommeret, Thomas Gerald et al. · 0 citations

Related blog posts

Microsoft Research Blog Oct 12, 2026

Simulating student learning for better AI tutoring

StudentSim is a research system for evaluating and improving AI tutoring tools before they are tested with learners. It models how individuals may engage with tutors, giving feedback to improve tutor performance across subjects like chess, writing, and mathematics. The post Simulating student learning for better AI tutoring appeared first on Microsoft Research.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.