How do Scaling Laws Apply to Knowledge Graph Engineering Tasks? The Impact of Model Size on Large Language Model Performance

Desiree Heim, Lars-Peter Meyer, Markus Schröder, Johannes Frey, Andreas Dengel

Introduction

Knowledge Graph Engineering (KGE)—the process of creating, maintaining, and querying structured data—is a notoriously labor-intensive field. While Large Language Models (LLMs) have shown significant promise in automating these tasks, practitioners face a critical dilemma: larger models generally perform better but come with exponentially higher computational costs and latency. While general NLP "Scaling Laws" suggest performance improves predictably with model size, it remains unclear if these laws apply linearly to the highly structured, syntactically rigid world of RDF and SPARQL. This study evaluates 26 open-source models to map the relationship between parameter count and KGE capability.

Methodology and Experimental Setup

The researchers utilized the LLM-KG-Bench framework to conduct a systematic evaluation across 23 task variations. Models were categorized into four size groups: Tiny (0–3B), Small (3B–8B), Medium (8B–33B), and Large (33B–72B). The evaluation included diverse model families such as Qwen, Llama, and Microsoft Phi, alongside proprietary high-water mark benchmarks like GPT-4o and Claude 3.5 Sonnet.

Overview of evaluated model families and their respective parameter sizes.

Statistical significance was determined using Kruskal-Wallis tests and post-hoc Dunn tests to identify where performance jumps between size categories were most meaningful. Tasks ranged from simple RDF syntax correction to complex natural-language-to-query translation (Text2Sparql).

Key Insights: The Non-Linearity of Scaling

The "Good Enough" Threshold

For relatively straightforward tasks like RdfSyntaxFixing, medium-sized models (8B–33B) often perform nearly as well as 70B+ models. A "ceiling effect" is observed where the marginal performance gain of the largest models does not justify the added resource cost.

Family-Specific Performance Dips

Performance does not always move in a straight line within a single model family. The researchers observed "local drops" where a slightly larger version of a model might underperform its smaller sibling on specific tasks, suggesting that training data composition or architectural nuances can occasionally outweigh raw parameter count.

The Advantage of Code Specialization

Models fine-tuned for code, such as Qwen2.5-Coder, significantly outperform general-purpose models of similar size on KGE tasks. This is likely because the structured syntax of RDF and SPARQL shares more commonalities with programming languages than with natural language prose.

Performance Results and the Reasoning Gap

The study confirmed that while scaling is real, it is non-linear. The most dramatic gains occur when moving from "Tiny" to "Small/Medium" models. Large open models have achieved near-mastery of syntax; for instance, SparqlSyntaxFixing scores rose from ~0.25 in Tiny models to ~0.95 in Large models.

Detailed performance metrics (mean, std, min, max) across various Knowledge Graph Engineering tasks and variations.

However, a significant "reasoning gap" persists. On complex logic tasks like RdfFriendCount or Text2Sparql, open-source models hit a performance wall. While proprietary models achieved near-perfect scores (~1.0), the best open models plateaued around 0.55. This suggests that simply increasing parameters is insufficient to bridge the gap in complex logical reasoning required for advanced KGE.

Conclusion and Future Work

The research demonstrates that while larger models generally provide better results, the "sweet spot" for many KGE tasks lies in the medium-sized (8B-33B) range, especially when using code-specialized variants. Future work will focus on testing "ultra-large" open models (e.g., Llama 3.1 405B) and investigating architectural changes that might overcome the reasoning plateau currently seen in open-weights models.

Summary updated

BibTeX
@inproceedings{heim2025how,
  author = {Desiree Heim and Lars-Peter Meyer and Markus Schröder and Johannes Frey and Andreas Dengel},
  title = {{How do Scaling Laws Apply to Knowledge Graph Engineering Tasks? The Impact of Model Size on Large Language Model Performance}},
  booktitle = {ESWC-JP},
  year = {2025},
}
Figure