CRED-SQL:通过聚类检索和执行描述增强真实世界大规模数据库文本转SQL解析
CRED-SQL: Enhancing Real-world Large Scale Database Text-to-SQL Parsing through Cluster Retrieval and Execution Description
AI总结:
针对大规模数据库中文本转SQL任务存在的语义不匹配问题,提出集成聚类检索和执行描述的CRED-SQL框架,通过聚类模式检索和EDL中间表示提升性能,在SpiderUnion和BirdUnion上实现SOTA。
摘要:
大型语言模型(LLMs)的最新进展显著提高了文本转SQL系统的准确性。然而,一个关键挑战仍然存在:自然语言问题(NLQs)与其对应的SQL查询之间存在语义不匹配。这一问题在大规模数据库中更为严重,其中语义相似的属性会阻碍模式链接,且SQL生成过程中的语义漂移最终会降低模型准确性。为应对这些挑战,我们引入CRED-SQL,一个专为大规模数据库设计的框架,集成了聚类检索和执行描述。CRED-SQL首先执行基于聚类的大规模模式检索,以精确定位与给定NLQ相关的表和列,缓解模式不匹配问题;然后引入一种中间自然语言表示——执行描述语言(EDL),以弥合NLQ与SQL之间的差距。这种重构将任务分解为两个阶段:文本转EDL和EDL转SQL,既利用了LLMs强大的通用推理能力,又减少了语义偏差。在两个大规模跨域基准数据集SpiderUnion和BirdUnion上的大量实验表明,CRED-SQL实现了新的最先进(SOTA)性能,验证了其有效性和可扩展性。我们的代码可在https://github.com/smduan/CRED-SQL.git获取。
英文摘要:
Recent advances in large language models (LLMs) have significantly improved the accuracy of Text-to-SQL systems. However, a critical challenge remains: the semantic mismatch between natural language questions (NLQs) and their corresponding SQL queries. This issue is exacerbated in large-scale databases, where semantically similar attributes hinder schema linking and semantic drift during SQL generation, ultimately reducing model accuracy. To address these challenges, we introduce CRED-SQL, a framework designed for large-scale databases that integrates Cluster Retrieval and Execution Description. CRED-SQL first performs cluster-based large-scale schema retrieval to pinpoint the tables and columns most relevant to a given NLQ, alleviating schema mismatch. It then introduces an intermediate natural language representation-Execution Description Language (EDL)-to bridge the gap between NLQs and SQL. This reformulation decomposes the task into two stages: Text-to-EDL and EDL-to-SQL, leveraging LLMs' strong general reasoning capabilities while reducing semantic deviation. Extensive experiments on two large-scale, cross-domain benchmarks-SpiderUnion and BirdUnion-demonstrate that CRED-SQL achieves new state-of-the-art (SOTA) performance, validating its effectiveness and scalability. Our code is available at https://github.com/smduan/CRED-SQL.git
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。