SPARQL is a powerful but complex language for querying knowledge graphs, motivating research into natural language-to-SPARQL generation using large language models (LLMs). While large, proprietary LLMs excel at this task, their resource requirements can limit practical deployment. This paper evaluates smaller, open-source LLMs (0.5B–9B parameters) with quantization methods (8-bit and 4-bit compression) to balance computational efficiency and query generation performance. Our findings demonstrate that 8-bit quantization can maintain or enhance performance in smaller models, whereas 4-bit quantization leads to notable degradation, especially for larger models. This highlights the potential of quantized, smaller LLMs for SPARQL generation in resource-constrained scenarios and provides insights for optimizing specialized NLP tasks.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

How Low Can We Go? Quantization Effects on LLM SPARQL Generation

  • Matt Murtagh-White,
  • P. J. Wall,
  • Declan O’Sullivan

摘要

SPARQL is a powerful but complex language for querying knowledge graphs, motivating research into natural language-to-SPARQL generation using large language models (LLMs). While large, proprietary LLMs excel at this task, their resource requirements can limit practical deployment. This paper evaluates smaller, open-source LLMs (0.5B–9B parameters) with quantization methods (8-bit and 4-bit compression) to balance computational efficiency and query generation performance. Our findings demonstrate that 8-bit quantization can maintain or enhance performance in smaller models, whereas 4-bit quantization leads to notable degradation, especially for larger models. This highlights the potential of quantized, smaller LLMs for SPARQL generation in resource-constrained scenarios and provides insights for optimizing specialized NLP tasks.