arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.18018cs.CLcs.DB
收藏

一种基于模式的代理系统用于自然语言到SQL生成

An Agentic System for Schema Aware NL2SQL Generation

Project Path;Minnesota State University Mankato(明尼苏达州立大学曼科托分校)

David Onyango, Naseef Mansoor

AI总结:

本文提出一种基于模式的代理系统,利用小型语言模型作为主要代理,结合选择性LLM回退机制,降低计算成本,实验显示在BIRD基准上实现90%以上的成本节省。

摘要:

自然语言到SQL(NL2SQL)任务在通过直观语言使非专家用户能够与关系数据库交互方面起着关键作用。尽管最近的框架通过任务专门化提高了翻译准确性,但其对大型语言模型(LLMs)的依赖引发了计算开销、数据隐私和资源受限环境中实际部署的重大担忧。为了解决这些挑战,我们提出了一种基于模式的代理系统,战略性地利用小型语言模型(SLMs)作为主要代理,并辅以选择性LLM回退机制。LLM仅在检测到SLM生成输出错误时被调用,所提出的系统显著降低了计算支出。在BIRD基准上的实验结果表明,我们的系统实现了47.78%的执行准确率和51.05%的验证效率分数,相比LLM中心基线,成本减少了90%以上,大约67%的查询通过本地SLM解决。系统实现了平均0.0085的成本每查询,相比仅使用LLM的系统0.094,本地执行查询的运营成本接近零。[GitHub仓库: https://github.com/mindslab25/CESMA。]

英文摘要:

The natural language to SQL (NL2SQL) task plays a pivotal role in democratizing data access by enabling non-expert users to interact with relational databases through intuitive language. While recent frameworks have enhanced translation accuracy via task specialization, their reliance on Large Language Models (LLMs) raises significant concerns regarding computational overhead, data privacy, and real-world deployability in resource-constrained environments. To address these challenges, we propose a schema based agentic system that strategically employs Small Language Models (SLMs) as primary agents, complemented by a selective LLM fallback mechanism. The LLM is invoked only upon detection of errors in SLM-generated output, the proposed system significantly minimizes computational expenditure. Experimental results on the BIRD benchmark demonstrate that our system achieves an execution accuracy of 47.78% and a validation efficiency score of 51.05%, achieving over 90% cost reduction compared to LLM-centric baselines as approximately 67% of queries are resolved using local SLMs. The system achieves an average cost per query of 0.0085 compared to 0.094 for LLM-only systems, achieving near-zero operational costs for locally executed queries. [Github repository: https://github.com/mindslab25/CESMA.]

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑