Skip to main content
QUICK REVIEW

[Paper Review] Benchmarking the Abilities of Large Language Models for RDF Knowledge Graph Creation and Comprehension: How Well Do LLMs Speak Turtle?

Johannes Frey, Lars‐Peter Meyer|arXiv (Cornell University)|Sep 29, 2023
Topic ModelingComputer Science4 citations
TL;DR

This paper introduces LLM-KG-Bench, an automated framework to evaluate large language models (LLMs) on RDF knowledge graph tasks using Turtle syntax. It benchmarks five tasks—parsing, generating, and reasoning over knowledge graphs—across eight LLMs, revealing that while GPT-4 and Claude 1.3 perform best, all models frequently violate output formatting constraints, undermining practical usability despite strong comprehension abilities.

ABSTRACT

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.

Motivation & Objective

  • To assess the proficiency of large language models (LLMs) in understanding, creating, and manipulating RDF knowledge graphs using Turtle syntax.
  • To identify the strengths and weaknesses of both commercial and open-source LLMs in formal knowledge graph engineering workflows.
  • To develop and validate an automated benchmarking framework (LLM-KG-Bench) capable of scaling with problem size and supporting diverse LLMs.
  • To investigate the gap between semantic understanding and syntactic correctness in LLM-generated Turtle output.
  • To explore the feasibility of using LLMs as assistants in knowledge graph engineering pipelines, particularly in parsing and generating valid RDF data.

Proposed method

  • The authors designed five automated benchmark tasks: T1 (connection explanation), T2 (error detection), T3 (sample generation), T4 (friend count reasoning), and T5 (fact extraction) to evaluate LLMs on Turtle syntax.
  • The LLM-KG-Bench framework integrates these tasks with a failure-tolerant parser to detect and score syntactically invalid Turtle output, enabling robust evaluation despite formatting errors.
  • The evaluation includes four commercial LLMs (GPT-3.5, GPT-4, Claude 1.3, Claude 2.0) and two open-source offline models (GPT4All Vicuna, GPT4All Falcon 13B) across varying input sizes.
  • Tasks are designed to scale in complexity, allowing analysis of model behavior under increasing structural and semantic demands.
  • A parsing failure heuristic identifies unparseable outputs, while F1 scores and correctness metrics assess semantic accuracy and syntactic validity.
  • The framework supports integration with multiple LLM APIs and enables reproducible, automated evaluation of LLM capabilities in knowledge graph engineering.
(a) T1 - Connected Path
(a) T1 - Connected Path

Experimental results

Research questions

  • RQ1How well do LLMs comprehend and generate valid Turtle syntax for RDF knowledge graphs?
  • RQ2To what extent do LLMs adhere to syntactic constraints when generating Turtle, despite explicit instructions?
  • RQ3How do performance and reliability vary across different LLM architectures and sizes, especially under increasing input complexity?
  • RQ4What is the impact of model origin (commercial vs. open-source) on correctness and formatting consistency in knowledge graph tasks?
  • RQ5Can automated benchmarking frameworks like LLM-KG-Bench effectively measure and compare LLM capabilities in formal knowledge representation tasks?

Key findings

  • GPT-4 and Claude 1.3 demonstrated the strongest overall performance across tasks, particularly in fact extraction (T5) and reasoning (T4), though both frequently violated output formatting constraints.
  • Claude 2.0 outperformed others in the friend count task (T4) for small and medium sizes but failed on larger inputs, often using ellipses or incorrect reasoning.
  • GPT-3.5 and GPT-4 showed similar performance in T5 (fact extraction), but GPT-4 produced more unparseable outputs, reducing its effective utility despite higher median F1 scores.
  • Vicuna and Falcon 13B performed poorly: Vicuna omitted essential rdf:type statements and used ellipses, while Falcon generated repetitive gibberish and failed to continue valid Turtle documents.
  • All models, especially newer ones like GPT-4 and Claude 1.3, violated output formatting constraints more frequently than expected, even when explicitly instructed to output only Turtle.
  • The study confirms that while LLMs understand knowledge graph semantics well, their syntactic reliability remains a major bottleneck for direct integration into RDF pipelines.
(b) T2 - Turtle Fixing
(b) T2 - Turtle Fixing

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.