QUICK REVIEW
[论文解读] LLM-based SPARQL Query Generation from Natural Language over Federated Knowledge Graphs
Vincent Emonet, Jerven Bolleman|arXiv (Cornell University)|Oct 8, 2024
一句话总结
该论文提出一个 Retrieval-Augmented Generation (RAG) 系统,将自然语言问题翻译为对生物信息学知识图谱的联邦 SPARQL 查询,利用端点元数据和验证步骤来减少幻觉。
ABSTRACT
We introduce a Retrieval-Augmented Generation (RAG) system for translating user questions into accurate federated SPARQL queries over bioinformatics knowledge graphs (KGs) leveraging Large Language Models (LLMs). To enhance accuracy and reduce hallucinations in query generation, our system utilises metadata from the KGs, including query examples and schema information, and incorporates a validation step to correct generated queries. The system is available online at chat.expasy.org.
研究动机与目标
- Aim to enable accurate natural-language to SPARQL query generation over federated bioinformatics KGs (e.g., UniProt, Bgee, OMA).
- Leverage LLMs with endpoint metadata and contextual information to reduce hallucinations and improve query correctness.
- Provide a scalable, deployment-friendly solution that adapts to evolving KGs without retraining.
- Offer an accessible online demo and reusable modules for others to adopt the approach.
提出的方法
- Retrieve and index endpoint metadata (examples, VoID, shapes) to build a context-aware prompt.
- Generate embeddings for user questions and similar class labels and examples from a vector store to inform prompt construction.
- Construct prompts that combine the user question with retrieved examples and schema information for SPARQL generation.
- Validate generated federated SPARQL queries against endpoint VoID schemas to detect and correct invalid predicates or classes.
- Return corrected queries along with the supporting context and similarity information to the user.

实验结果
研究问题
- RQ1How effectively can LLMs translate natural language questions into federated SPARQL queries using retrieval-augmented context from KG endpoints?
- RQ2Does validation against endpoint schemas improve correctness and reduce hallucinations, especially for smaller LLMs?
- RQ3What is the impact of including example queries and class shapes (ShEx derived from VoID) on query accuracy?
- RQ4How does system performance vary across different LLMs and RAG configurations?
主要发现
- Larger LLMs outperform smaller models in overall query accuracy when used with RAG.
- Query validation notably improves accuracy for smaller LLMs by correcting invalid predicates and suggesting valid alternatives.
- The RAG+validation setup achieves higher F1 scores and more successful results compared to baselines without validation.
- The system remains open-source with online demo and reusable components for deployment across other bioinformatics KGs.
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。