Skip to main content
QUICK REVIEW

[论文解读] SPARQL Generation: an analysis on fine-tuning OpenLLaMA for Question Answering over a Life Science Knowledge Graph

Julio C. Rangel, Tarcisio Mendes de Farias|arXiv (Cornell University)|Feb 7, 2024
Biomedical Text Mining and OntologiesBiochemistry, Genetics and Molecular Biology被引用 3
一句话总结

本文提出一种数据增强框架,用于微调 OpenLLaMA 以在生命科学知识图谱上实现准确的 SPARQL 查询生成,利用有意义的变量名称和内联注释等语义线索。与随机变量和无注释相比,该方法可将模型性能提升高达 33%。最佳效果在直接在领域特定的增强数据上进行微调时实现,而非通过开放领域数据集的知识迁移。

ABSTRACT

The recent success of Large Language Models (LLM) in a wide range of Natural Language Processing applications opens the path towards novel Question Answering Systems over Knowledge Graphs leveraging LLMs. However, one of the main obstacles preventing their implementation is the scarcity of training data for the task of translating questions into corresponding SPARQL queries, particularly in the case of domain-specific KGs. To overcome this challenge, in this study, we evaluate several strategies for fine-tuning the OpenLlama LLM for question answering over life science knowledge graphs. In particular, we propose an end-to-end data augmentation approach for extending a set of existing queries over a given knowledge graph towards a larger dataset of semantically enriched question-to-SPARQL query pairs, enabling fine-tuning even for datasets where these pairs are scarce. In this context, we also investigate the role of semantic "clues" in the queries, such as meaningful variable names and inline comments. Finally, we evaluate our approach over the real-world Bgee gene expression knowledge graph and we show that semantic clues can improve model performance by up to 33% compared to a baseline with random variable names and no comments included.

研究动机与目标

  • 为解决生命科学知识图谱中问题-SPARQL 查询对稀缺的问题,该问题阻碍了 LLM 在问答任务中的有效微调。
  • 开发一种端到端的数据增强策略,从少量初始数据集中生成语义丰富的问答-SPARQL 对。
  • 评估语义线索(如有意义的变量名称和内联注释)对 SPARQL 查询生成性能的影响。
  • 研究是否从开放领域数据集(如 KQA_Pro)进行知识迁移能提升在领域特定的生命科学 KB(如 Bgee)上的性能。
  • 建立一个包含 2,500 多个问答-SPARQL 对的高质量、开放获取数据集,用于在 Bgee 基因表达知识图谱上的科学问答任务。

提出的方法

  • 端到端的数据增强流水线通过改写现有查询并修改 SPARQL 语法,在保持语义一致性的前提下生成新的问答-SPARQL 对。
  • 通过将随机变量名称替换为有意义的名称(如用 'gene' 替代 'var1')并添加解释属性标签的内联注释,引入语义线索。
  • 从 15 个原始 Bgee 查询中生成五个不同的增强数据集,每个数据集包含 513 个查询,总计超过 2,500 对。
  • 在这些增强数据集上对 OpenLLaMA_7b_v2 模型进行微调,并通过消融研究比较包含和不包含语义线索的设置。
  • 通过先在 KQA_Pro 数据集(Wikidata)上微调 OpenLLaMA,再在 Bgee 数据集上进一步微调,评估知识迁移效果。
  • 使用标准 NLP 指标(BLEU、SP-BLEU、METEOR 和 ROUGE-L)在多种配置下评估性能。
Figure 1: System Architecture. We augment an existing catalog of representative questions over a given knowledge graph and fine-tune OpenLlama in two steps: We first fine-tune the base model using the KQA Pro dataset over Wikidata. Next, we further fine-tune the resulting model using the extended se
Figure 1: System Architecture. We augment an existing catalog of representative questions over a given knowledge graph and fine-tune OpenLlama in two steps: We first fine-tune the base model using the KQA Pro dataset over Wikidata. Next, we further fine-tune the resulting model using the extended se

实验结果

研究问题

  • RQ1数据增强是否能显著提升 LLM 在生成生命科学知识图谱中语义正确的 SPARQL 查询方面的性能?
  • RQ2有意义的变量名称和内联注释等语义线索在多大程度上提升了 SPARQL 查询生成的准确性?
  • RQ3从通用领域数据集(如 KQA_Pro)进行知识迁移是否能提升在领域特定的生命科学 KB(如 Bgee)上的微调性能?
  • RQ4增强训练数据集的大小在多大程度上影响模型生成正确 SPARQL 查询的能力?
  • RQ5直接在领域特定数据上进行微调是否比涉及开放领域预训练的多阶段微调更有效?

主要发现

  • 与随机变量名称和无注释相比,引入语义线索(有意义的变量名称和内联注释)可使 ROUGE-L 分数最高提升 33%。
  • 直接在增强后的 Bgee 数据集上进行微调优于涉及在 KQA_Pro 上预训练的多阶段微调,后者未见性能提升甚至出现性能下降。
  • 在 'Bgee 有意义变量和注释' 数据集上微调的最佳模型,其 BLEU、SP-BLEU 和 METEOR 分数相比基线(随机变量和无注释)提升了超过 80%。
  • 随着训练数据规模的增加,性能持续提升,表现为从增强数据集的 25% 到 100% 的 '有意义变量和注释' 数据集,性能呈逐步提升趋势。
  • 最终数据集包含超过 2,500 个语义丰富的问答-SPARQL 对,为科学 KGQA 研究提供了宝贵资源。
  • 本研究证明,对 SPARQL 查询进行语义增强是一种高效且低成本的策略,可显著提升 LLM 在特定领域知识图谱查询中的泛化能力。
Figure 2: Enhancement in the SPARQL query generation performance (y-axis) with partitions in increments of 25% of the “Bgee meaningful vars comments" training set (x-axis).
Figure 2: Enhancement in the SPARQL query generation performance (y-axis) with partitions in increments of 25% of the “Bgee meaningful vars comments" training set (x-axis).

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。