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.
翻译:文本到SQL技术能够自动将自然语言查询转换为SQL语句,使非技术用户无需掌握专业SQL知识即可从数据库中检索数据。尽管基于先进大语言模型的文本到SQL方法在性能榜单上取得了成功,但其不可持续的计算成本——这一常被忽视的问题——已成为当前榜单驱动研究中的"房间里的大象",限制了这些方法在实际部署和广泛采用中的经济可行性。为解决这一问题,我们探索性地提出了EllieSQL,这是一个基于复杂度感知的路由框架,能够根据预估的复杂度将查询分配至合适的SQL生成流水线。我们研究了多种路由器的设计,旨在将简单查询导向高效方法,同时为复杂案例保留计算密集型方法。借鉴经济学原理,我们提出了性能的令牌弹性指标,通过量化SQL生成中性能提升相对于令牌投入的响应程度来捕捉成本效益。实验表明,与研究中始终使用最先进方法相比,搭载Qwen2.5-0.5B-DPO路由器的EllieSQL在Bird开发集上保持性能不变的同时,减少了超过40%的令牌使用量,其TEP值较非路由方法提升超过2倍。这不仅推动了高性价比文本到SQL技术的探索,也促使研究社区在关注性能的同时权衡资源效率,为可持续的文本到SQL研究进展作出贡献。