arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.22402cs.DBcs.AIcs.CL
收藏

EllieSQL:基于复杂度感知路由的成本高效 Text-to-SQL

EllieSQL: Cost-Efficient Text-to-SQL with Complexity-Aware Routing

The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));The Hong Kong University of Science and Technology(香港科技大学)

Yizhang Zhu, Runzhi Jiang, Boyan Li, Nan Tang, Yuyu Luo

AI总结:

本文提出复杂度感知路由框架 EllieSQL,通过将简单查询导向高效方法、复杂查询保留给计算密集型方法,并引入 TEP 指标衡量成本效率,在 Bird 开发集上减少超 40% token 使用且不牺牲性能,实现 TEP 提升 2 倍以上。

摘要:

Text-to-SQL 自动将自然语言查询翻译为 SQL,使非技术用户无需专门的 SQL 知识即可从数据库中检索数据。尽管基于先进大语言模型(LLM)的 Text-to-SQL 方法在排行榜上取得了成功,但其不可持续的计算成本——常常被忽视——是当前以排行榜为导向的研究中“房间里的大象”,限制了它们在现实部署和广泛采用中的经济实用性。为解决这一问题,我们探索性地提出了 EllieSQL,这是一个复杂度感知路由框架,根据估计的复杂度将查询分配给合适的 SQL 生成流水线。我们研究了多种路由器,将简单查询导向高效方法,同时为复杂情况保留计算密集型方法。借鉴经济学,我们引入了性能的 Token 弹性(Token Elasticity of Performance,TEP)指标,通过量化性能增益相对于 SQL 生成中 token 投入的响应程度来刻画成本效率。实验表明,与始终使用我们研究中最先进的方法相比,采用 Qwen2.5-0.5B-DPO 路由器的 EllieSQL 在 Bird 开发集上减少了超过 40% 的 token 使用量,且不牺牲性能,TEP 相比非路由方法提升了 2 倍以上。这不仅推进了对成本高效 Text-to-SQL 的追求,也邀请社区在关注性能的同时权衡资源效率,为可持续 Text-to-SQL 的进展做出贡献。我们的源代码和模型可在 https://elliesql.github.io/ 获取。

英文摘要:

Text-to-SQL automatically translates natural language queries to SQL, allowing non-technical users to retrieve data from databases without specialized SQL knowledge. Despite the success of advanced LLM-based Text-to-SQL approaches on leaderboards, their unsustainable computational costs--often overlooked--stand as the "elephant in the room" in current leaderboard-driven research, limiting their economic practicability for real-world deployment and widespread adoption. To tackle this, we exploratively propose EllieSQL, a complexity-aware routing framework that assigns queries to suitable SQL generation pipelines based on estimated complexity. We investigate multiple routers to direct simple queries to efficient approaches while reserving computationally intensive methods for complex cases. Drawing from economics, we introduce the Token Elasticity of Performance (TEP) metric, capturing cost-efficiency by quantifying the responsiveness of performance gains relative to token investment in SQL generation. Experiments show that compared to always using the most advanced methods in our study, EllieSQL with the Qwen2.5-0.5B-DPO router reduces token use by over 40% without compromising performance on Bird development set, achieving more than a 2x boost in TEP over non-routing approaches. This not only advances the pursuit of cost-efficient Text-to-SQL but also invites the community to weigh resource efficiency alongside performance, contributing to progress in sustainable Text-to-SQL. Our source code and model are available at https://elliesql.github.io/.

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

↑