首个模块化框架,系统评估大模型驱动的自然语言转SQL效果与效率。
NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL Solutions

- 拆解NL2SQL为模式选择、候选生成、查询修正三模块,精准定位瓶颈。
- 在两个数据集上测试十种开源方法,发现准确率和计算效率双重短板。
- 提供可配置评估框架,适合研究者优化模型或设计新评测标准。
自然语言转SQL(NL2SQL)技术使非专业用户无需掌握SQL即可查询关系型数据库。尽管大语言模型(LLMs)显著提升了NL2SQL算法性能,但其快速发展远超系统性评估,导致对实际效能、效率与局限性的理解严重滞后。为此,我们提出NL2SQLBench,首个面向大模型驱动的NL2SQL方案的模块化评估与基准测试框架。具体地,我们将NL2SQL系统分解为三个核心模块:模式选择、候选生成与查询修正。针对每个模块,我们全面回顾现有策略,并提出细粒度的新指标,系统量化各模块的有效性与效率。我们进一步在灵活的多智能体框架中实现这些指标,支持跨多种NL2SQL方法的可配置评估。基于NL2SQLBench,我们在BIRD开发集与ScienceBenchmark开发集上,使用DeepSeek-V3与GPT-4o mini两种LLM,严谨评估了十种代表性开源方法,系统分析其在三个核心模块中的表现,并覆盖多个关键性能维度。评估揭示现有方法存在显著差距,不仅准确率提升空间巨大,且计算效率低下,严重制约实际应用。此外,分析还指出当前基准数据集与评估规则的关键缺陷,如黄金SQL标注不准确及评估规则局限。通过整合这些洞见,本研究建立统一基准,为公平比较提供参照,也为未来针对性创新提供关键指引。
原文摘要 · Abstract (English)
Natural Language to SQL (NL2SQL) technology empowers non-expert users to query relational databases without requiring SQL expertise. While large language models (LLMs) have greatly improved NL2SQL algorithms, their rapid development outpaces systematic evaluation, leaving a critical gap in understanding their effectiveness, efficiency, and limitations. To this end, we present NL2SQLBench, the first modular evaluation and benchmarking framework for LLM-enabled NL2SQL approaches. Specifically, we dissect NL2SQL systems into three core modules: Schema Selection, Candidate Generation, and Query Revision. For each module, we comprehensively review existing strategies and propose novel fine-grained metrics that systematically quantify module-level effectiveness and efficiency. We further implement these metrics in a flexible multi-agent framework, allowing configurable benchmarking across diverse NL2SQL approaches. Leveraging NL2SQLBench, we rigorously evaluate ten representative open-source methods on two datasets, the BIRD development set and the ScienceBenchmark development set, using two LLMs, DeepSeek-V3 and GPT-4o mini. We systematically assess each approach across the three core modules and evaluate multiple critical performance dimensions. Our evaluation reveals significant gaps in existing NL2SQL methods, highlighting not only substantial room for accuracy improvements but also the significant computational inefficiency, which severely hampers real-world adoption. Furthermore, our analysis identifies critical shortcomings in current benchmark datasets and evaluation rules, emphasizing issues such as inaccurate gold SQL annotations and limitations in existing evaluation rules. By synthesizing these insights into a unified benchmarking, our study establishes a clear reference point for fair comparison and serves as essential guidance for future targeted innovation in NL2SQL technology.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。