Abstract
As Large Language Models (LLMs) continue to grow in size and capability, the "bigger is better" paradigm is often taken for granted. However, the application of these scaling laws to specialized domains like Knowledge Graph Engineering (KGE) remains under-explored. This study evaluates 26 open-source LLMs across a variety of KGE tasks—including RDF syntax fixing, SPARQL generation, and pathfinding—to determine how performance scales with parameter count. Our findings reveal that while larger models generally outperform smaller ones, significant "ceiling effects" and "reasoning plateaus" exist. These results suggest that for many practical KGE applications, smaller, optimized models may offer a more cost-effective solution than massive, general-purpose LLMs.
Introduction
Knowledge Graph Engineering (KGE) involves the creation, maintenance, and querying of structured data, typically represented in formats like RDF and queried via SPARQL. These tasks are traditionally labor-intensive and require high precision. While LLMs have demonstrated remarkable potential in automating parts of the KGE lifecycle, practitioners often face a resource allocation dilemma: is the performance gain from a 70B parameter model worth the significantly higher computational cost compared to an 8B model?
General scaling laws suggest that model performance improves predictably with increases in parameters, data, and compute. However, KGE tasks require a unique combination of natural language understanding and strict adherence to formal logic and syntax. This paper investigates whether these general scaling laws hold for KGE or if the structured nature of the domain introduces new dynamics.
Methodology
The researchers utilized the LLM-KG-Bench 3.0 framework to evaluate 26 open-source LLMs. The selection included models from three prominent families: Qwen, Meta-Llama, and Microsoft-Phi. To facilitate a structured analysis of scaling, the models were categorized into four size groups based on parameter count: Tiny (0–3B), Small (3–8B), Medium (8–33B), and Large (33–72B).
The evaluation involved 50 repetitions per task to account for the stochastic nature of LLM outputs. Statistical significance was determined using Kruskal-Wallis and post-hoc Dunn tests to identify meaningful performance jumps between size categories.
Experimental Setup and Datasets
The study employed the LLM-KG-Bench 3.0 dataset, covering 26 variations of RDF- and SPARQL-related tasks. Key tasks included:
- RdfConnectionExplain: Determining the shortest path between nodes in a graph.
- RdfFriendCount: Identifying nodes with the highest degree of connectivity.
- RdfSyntaxFixing: Identifying and correcting errors in RDF code.
- Sparql2Answer & Text2Sparql: Translating between natural language questions and SPARQL queries or direct answers.
Results and Discussion
The empirical results highlight several nuances in how LLMs scale for KGE tasks.
The Ceiling Effect and Reasoning Plateaus
For relatively straightforward tasks, such as RdfSyntaxFixing, a "ceiling effect" was observed. "Medium" models (8-33B) frequently achieved performance levels indistinguishable from "Large" models (70B+). In these scenarios, the additional parameters of larger models do not translate into functional improvements, making smaller models the more efficient choice.
Conversely, complex reasoning tasks like Text2Sparql exhibited a "reasoning plateau." Despite increases in model size, performance remained relatively low across the open-source ecosystem. For instance, while proprietary models like GPT-4o can achieve near-perfect scores on certain connectivity tasks, the best open-source models in this study plateaued significantly lower.
Specialized Architectures
The study also found that architectural specialization can outweigh raw parameter count. Code-specialized models, such as Qwen2.5-Coder, demonstrated superior performance in tasks involving SPARQL generation and RDF syntax handling, often outperforming larger general-purpose models. Furthermore, Mixture-of-Experts (MoE) models performed similarly to dense models of their total parameter size, indicating that while they offer inference speed advantages, they still follow the general scaling trends of their full parameter count.
Conclusion
While scaling laws generally apply to KGE—with a consistent performance jump observed from "Tiny" to "Small" models—the benefits of scaling diminish for both very simple and very complex tasks. For practitioners, this suggests that "Medium" sized models (8-33B) or specialized code models often provide the best balance of performance and resource efficiency. Future research will explore whether even larger open-source models (e.g., 400B+) can break through the current reasoning plateaus or if improvements must come from higher-quality training data and multi-step reasoning architectures.
This paper is set to appear at the ESWC 2025 workshops.
Summary updated