Can LLMs substitute SQL? Comparing Resource Utilization of Querying LLMs versus Traditional Relational Databases

Xiang Zhang, Khatoon Khedri, Reza Rawassizadeh
4/12/2024
cs.DBcs.AIcs.CL

No official code found. Best implementation: XiangZhang-zx/LLM-StockQuery-Dataset (1 star, last commit 2024-08-28).

Abstract

Large Language Models (LLMs) can automate or substitute different types of tasks in the software engineering process. This study evaluates the resource utilization and accuracy of LLM in interpreting and executing natural language queries against traditional SQL within relational database management systems. We empirically examine the resource utilization and accuracy of nine LLMs varying from 7 to 34 Billion parameters, including Llama2 7B, Llama2 13B, Mistral, Mixtral, Optimus-7B, SUS-chat-34B, platypus-yi-34b, NeuralHermes-2.5-Mistral-7B and Starling-LM-7B-alpha, using a small transaction dataset. Our findings indicate that using LLMs for database queries incurs significant energy overhead (even small and quantized models), making it an environmentally unfriendly approach. Therefore, we advise against replacing relational databases with LLMs due to their substantial resource utilization.

View on arXivView PDF

Code Implementations(1)

10Jupyter NotebookMar 14, 20242 years ago

Similar Papers

Cite this paper

@article{zhang2024llms,
  title  = {Can LLMs substitute SQL? Comparing Resource Utilization of Querying LLMs versus Traditional Relational Databases},
  author = {Xiang Zhang and Khatoon Khedri and Reza Rawassizadeh},
  year   = {2024},
  eprint = {2404.08727},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.08727v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.08727.svg)](https://codeofpaper.com/paper/2404.08727)

Discussion