Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wu, Zhiguang, Zhu, Fengbin, Shang, Xuequn, Zhang, Yupei, Zhou, Pan
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915053347799040
author Wu, Zhiguang
Zhu, Fengbin
Shang, Xuequn
Zhang, Yupei
Zhou, Pan
author_facet Wu, Zhiguang
Zhu, Fengbin
Shang, Xuequn
Zhang, Yupei
Zhou, Pan
contents Text-to-SQL task aims to automatically yield SQL queries according to user text questions. To address this problem, we propose a Cooperative SQL Generation framework based on Multi-functional Agents (CSMA) through information interaction among large language model (LLM) based agents who own part of the database schema seperately. Inspired by the collaboration in human teamwork, CSMA consists of three stages: 1) Question-related schema collection, 2) Question-corresponding SQL query generation, and 3) SQL query correctness check. In the first stage, agents analyze their respective schema and communicate with each other to collect the schema information relevant to the question. In the second stage, agents try to generate the corresponding SQL query for the question using the collected information. In the third stage, agents check if the SQL query is created correctly according to their known information. This interaction-based method makes the question-relevant part of database schema from each agent to be used for SQL generation and check. Experiments on the Spider and Bird benckmark demonstrate that CSMA achieves a high performance level comparable to the state-of-the-arts, meanwhile holding the private data in these individual agents.
format Preprint
id arxiv_https___arxiv_org_abs_2412_05850
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents
Wu, Zhiguang
Zhu, Fengbin
Shang, Xuequn
Zhang, Yupei
Zhou, Pan
Computation and Language
Text-to-SQL task aims to automatically yield SQL queries according to user text questions. To address this problem, we propose a Cooperative SQL Generation framework based on Multi-functional Agents (CSMA) through information interaction among large language model (LLM) based agents who own part of the database schema seperately. Inspired by the collaboration in human teamwork, CSMA consists of three stages: 1) Question-related schema collection, 2) Question-corresponding SQL query generation, and 3) SQL query correctness check. In the first stage, agents analyze their respective schema and communicate with each other to collect the schema information relevant to the question. In the second stage, agents try to generate the corresponding SQL query for the question using the collected information. In the third stage, agents check if the SQL query is created correctly according to their known information. This interaction-based method makes the question-relevant part of database schema from each agent to be used for SQL generation and check. Experiments on the Spider and Bird benckmark demonstrate that CSMA achieves a high performance level comparable to the state-of-the-arts, meanwhile holding the private data in these individual agents.
title Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents
topic Computation and Language
url https://arxiv.org/abs/2412.05850