Skip to main content
QUICK REVIEW

[论文解读] SyntheT2C: Generating Synthetic Data for Fine-Tuning Large Language Models on the Text2Cypher Task

Ziije Zhong, Linqing Zhong|arXiv (Cornell University)|Jun 15, 2024
Topic Modeling被引用 5
一句话总结

SyntheT2C 创建两个合成数据管道,用于为 Neo4j 生成 Query-Cypher 对,从而在 Text2Cypher 上实现对 LLMs 的有效微调。它对数据进行验证并实现规模化,从而提升 Cypher 的编写性能。

ABSTRACT

Integrating Large Language Models (LLMs) with existing Knowledge Graph (KG) databases presents a promising avenue for enhancing LLMs' efficacy and mitigating their "hallucinations". Given that most KGs reside in graph databases accessible solely through specialized query languages (e.g., Cypher), it is critical to connect LLMs with KG databases by automating the translation of natural language into Cypher queries (termed as "Text2Cypher" task). Prior efforts tried to bolster LLMs' proficiency in Cypher generation through Supervised Fine-Tuning (SFT). However, these explorations are hindered by the lack of annotated datasets of Query-Cypher pairs, resulting from the labor-intensive and domain-specific nature of such annotation. In this study, we propose SyntheT2C, a methodology for constructing a synthetic Query-Cypher pair dataset, comprising two distinct pipelines: (1) LLM-based prompting and (2) template-filling. SyntheT2C is applied to two medical KG databases, culminating in the creation of a synthetic dataset, MedT2C. Comprehensive experiments demonstrate that the MedT2C dataset effectively enhances the performance of backbone LLMs on Text2Cypher task via SFT. Both the SyntheT2C codebase and the MedT2C dataset are released in https://github.com/ZGChung/SyntheT2C.

研究动机与目标

  • 弥合自然语言与 Neo4j 数据库中的 Cypher 查询之间的差距。
  • 在无需人工标注的情况下生成高质量的合成 Question-Cypher 对。
  • 实现对骨干 LLMs 的有效微调,以撰写可执行的 Cypher 查询。
  • 提供验证工具和数据集以支持 Text2Cypher 研究。

提出的方法

  • 两条互补的管道生成合成的 QCy 对:(i) 基于 LLM 的提示,以创建语义多样的 Cypher;(ii) 模板填充,以产生句法上复杂的 Cypher。
  • 提取数据库元数据和模式锚定,以确保可执行 Cypher 的生成。
  • 自动验证器(Grammatical、Semantic、Entity、Schema、Coherence)在人工验证前筛选 Cypher。
  • 通过共识投票的人工验证,以确保高质量的地面实证数据。
  • 使用 LoRA 对 MedT2C,在两个 Neo4j 医学数据库(LHY 和 Hetionet)上对骨干 LLMs 进行微调。

实验结果

研究问题

  • RQ1SyntheT2C 生成的合成 Query-Cypher 对能否有效训练 LLMs 以生成可执行的 Cypher 查询?
  • RQ2这两条合成数据管道如何互补以提升 Cypher 的编写性能?
  • RQ3数据验证(自动与人工)对生成的 Cypher 的质量和执行准确性有何影响?
  • RQ4扩展合成数据集规模如何影响 Cypher 的质量和执行准确性?
  • RQ5MedT2C 数据集在对 Text2Cypher 进行微调时,对不同的 LLM 家族(开放与封闭)是否有效?

主要发现

  • 在微调后,MedT2C 提升了若干骨干 LLM 的 Cypher 写作质量。
  • 将两条管道结合比仅使用单一管道获得的综合性能更好。
  • 在消融研究中,五种验证器共同提供对 Cypher 质量和执行准确性的最强提升。
  • 扩展结果显示,性能提升一直到接近 MedT2C 数据集大小时最显著,但超过该规模后的收益递减。
  • 仅模板数据若不结合来自 prompting 的语义数据将可能阻碍性能。
  • MedT2C 数据集(由 LHY 和 Hetionet 生成的合成数据)使 LLMs 的 Cypher 质量接近甚至超过人工注释的 Cyphers。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

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