[论文解读] Benchmarking the Abilities of Large Language Models for RDF Knowledge Graph Creation and Comprehension: How Well Do LLMs Speak Turtle?
本文提出了 LLM-KG-Bench,一个用于使用 Turtle 语法评估大型语言模型(LLMs)在 RDF 知识图谱任务上的自动化框架。该框架在八个 LLM 上对五项任务——解析、生成和知识图谱推理——进行了基准测试,结果显示尽管 GPT-4 和 Claude 1.3 表现最佳,但所有模型在输出格式约束方面频繁出错,尽管其理解能力较强,这严重削弱了实际可用性。
Large Language Models (LLMs) are advancing at a rapid pace, with significant improvements at natural language processing and coding tasks. Yet, their ability to work with formal languages representing data, specifically within the realm of knowledge graph engineering, remains under-investigated. To evaluate the proficiency of various LLMs, we created a set of five tasks that probe their ability to parse, understand, analyze, and create knowledge graphs serialized in Turtle syntax. These tasks, each embodying distinct degrees of complexity and being able to scale with the size of the problem, have been integrated into our automated evaluation system, the LLM-KG-Bench. The evaluation encompassed four commercially available LLMs - GPT-3.5, GPT-4, Claude 1.3, and Claude 2.0, as well as two freely accessible offline models, GPT4All Vicuna and GPT4All Falcon 13B. This analysis offers an in-depth understanding of the strengths and shortcomings of LLMs in relation to their application within RDF knowledge graph engineering workflows utilizing Turtle representation. While our findings show that the latest commercial models outperform their forerunners in terms of proficiency with the Turtle language, they also reveal an apparent weakness. These models fall short when it comes to adhering strictly to the output formatting constraints, a crucial requirement in this context.
研究动机与目标
- 评估大型语言模型(LLMs)在使用 Turtle 语法理解、创建和操作 RDF 知识图谱方面的能力。
- 识别商业和开源 LLM 在正式知识图谱工程工作流中的优势与劣势。
- 开发并验证一个可扩展的自动化基准测试框架(LLM-KG-Bench),能够随问题规模扩展并支持多种 LLM。
- 研究 LLM 生成的 Turtle 输出中语义理解与句法正确性之间的差距。
- 探索将 LLM 作为助手集成到知识图谱工程流水线中的可行性,特别是在解析和生成有效 RDF 数据方面。
提出的方法
- 作者设计了五项自动化基准测试任务:T1(连接解释)、T2(错误检测)、T3(样本生成)、T4(好友数量推理)和 T5(事实提取),以评估 LLM 对 Turtle 语法的表现。
- LLM-KG-Bench 框架将这些任务与容错解析器集成,以检测并评分句法无效的 Turtle 输出,从而在存在格式错误的情况下仍能实现稳健评估。
- 评估涵盖四种商业 LLM(GPT-3.5、GPT-4、Claude 1.3、Claude 2.0)和两种开源离线模型(GPT4All Vicuna、GPT4All Falcon 13B),输入规模各不相同。
- 任务设计具有可扩展的复杂度,允许分析模型在结构和语义需求增加时的行为。
- 采用解析失败启发式方法识别无法解析的输出,同时使用 F1 分数和正确性指标评估语义准确性和句法有效性。
- 该框架支持与多种 LLM API 集成,并支持对 LLM 在知识图谱工程中能力的可复现、自动化评估。

实验结果
研究问题
- RQ1LLM 在理解并生成用于 RDF 知识图谱的合法 Turtle 语法方面表现如何?
- RQ2尽管有明确指令,LLM 在生成 Turtle 时在多大程度上遵守了句法约束?
- RQ3性能和可靠性在不同 LLM 架构和大小之间如何变化,特别是在输入复杂度增加时?
- RQ4模型来源(商业与开源)对知识图谱任务中正确性和格式一致性有何影响?
- RQ5像 LLM-KG-Bench 这样的自动化基准测试框架能否有效衡量并比较 LLM 在正式知识表示任务中的能力?
主要发现
- GPT-4 和 Claude 1.3 在各项任务中整体表现最强,尤其在事实提取(T5)和推理(T4)方面表现突出,但两者频繁违反输出格式约束。
- Claude 2.0 在小规模和中等规模的“好友数量”任务(T4)中表现优于其他模型,但在更大输入上失败,常使用省略号或错误推理。
- GPT-3.5 和 GPT-4 在 T5(事实提取)中表现相似,但 GPT-4 生成了更多无法解析的输出,尽管其中位 F1 分数更高,但实际可用性因此降低。
- Vicuna 和 Falcon 13B 表现较差:Vicuna 遗漏了关键的 rdf:type 声明并使用省略号,而 Falcon 生成重复的无意义内容,且无法继续有效的 Turtle 文档。
- 所有模型,尤其是 GPT-4 和 Claude 1.3 等较新模型,即使明确指示仅输出 Turtle,也比预期更频繁地违反输出格式约束。
- 本研究证实,尽管 LLM 对知识图谱语义理解良好,但其句法可靠性仍是直接集成到 RDF 流水线中的主要瓶颈。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。