多智能体协作生成SQL,保护数据隐私且性能顶尖
Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents
- 分角色智能体协同,通过信息交互完成SQL生成
- 在Spider和Bird数据集上达到顶尖性能,准确率超基线
- 适合需要数据隔离的场景,如跨机构数据库查询
文本转SQL任务旨在根据用户问题自动生成SQL查询。为此,我们提出基于多功能智能体的协作式SQL生成框架(CSMA),通过拥有部分数据库模式的大型语言模型(LLM)智能体之间的信息交互实现。受人类团队协作启发,CSMA包含三个阶段:1)相关模式收集,2)对应SQL生成,3)查询正确性检查。第一阶段,各智能体分析自身模式并互相通信,提取与问题相关的模式信息;第二阶段,利用收集的信息生成相应SQL;第三阶段,基于已知信息验证生成的SQL是否正确。该交互机制使各智能体持有的部分模式信息被用于生成与校验。在Spider和Bird基准上的实验表明,CSMA性能接近当前最优水平,同时保证各智能体私有数据不外泄。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。