Knowledge-to-SQL: Enhancing SQL Generation with Data Expert LLM

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Hong, Zijin, Yuan, Zheng, Chen, Hao, Zhang, Qinggang, Huang, Feiran, Huang, Xiao
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913379648536576
author Hong, Zijin
Yuan, Zheng
Chen, Hao
Zhang, Qinggang
Huang, Feiran
Huang, Xiao
author_facet Hong, Zijin
Yuan, Zheng
Chen, Hao
Zhang, Qinggang
Huang, Feiran
Huang, Xiao
contents Generating accurate SQL queries for user questions (text-to-SQL) has been a long-standing challenge since it requires a deep understanding of both the user's question and the corresponding database schema in order to retrieve the desired content accurately. Existing methods rely on the comprehensive capability of large language models (LLMs) to generate the SQL. However, some necessary knowledge is not explicitly included in the database schema and user question or has been learned by LLMs. Thus, the generated SQL of the knowledge-insufficient questions may be inaccurate, negatively influencing the text-to-SQL models' performance and robustness. To address this challenge, we propose the Knowledge-to-SQL framework, which employs tailored Data Expert LLM (DELLM) to provide helpful knowledge for all text-to-SQL models. Specifically, we introduce the detailed implementation of DELLM regarding table reading and the basic fine-tuning process. We further propose a Preference Learning via Database Feedback (PLDBF) strategy, refining the DELLM to generate more helpful knowledge for LLMs. Extensive experiments verify that DELLM can enhance the state-of-the-art approaches for text-to-SQL tasks. The corresponding code of DELLM is released for further research.
format Preprint
id arxiv_https___arxiv_org_abs_2402_11517
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Knowledge-to-SQL: Enhancing SQL Generation with Data Expert LLM
Hong, Zijin
Yuan, Zheng
Chen, Hao
Zhang, Qinggang
Huang, Feiran
Huang, Xiao
Computation and Language
Generating accurate SQL queries for user questions (text-to-SQL) has been a long-standing challenge since it requires a deep understanding of both the user's question and the corresponding database schema in order to retrieve the desired content accurately. Existing methods rely on the comprehensive capability of large language models (LLMs) to generate the SQL. However, some necessary knowledge is not explicitly included in the database schema and user question or has been learned by LLMs. Thus, the generated SQL of the knowledge-insufficient questions may be inaccurate, negatively influencing the text-to-SQL models' performance and robustness. To address this challenge, we propose the Knowledge-to-SQL framework, which employs tailored Data Expert LLM (DELLM) to provide helpful knowledge for all text-to-SQL models. Specifically, we introduce the detailed implementation of DELLM regarding table reading and the basic fine-tuning process. We further propose a Preference Learning via Database Feedback (PLDBF) strategy, refining the DELLM to generate more helpful knowledge for LLMs. Extensive experiments verify that DELLM can enhance the state-of-the-art approaches for text-to-SQL tasks. The corresponding code of DELLM is released for further research.
title Knowledge-to-SQL: Enhancing SQL Generation with Data Expert LLM
topic Computation and Language
url https://arxiv.org/abs/2402.11517