TailorSQL利用历史查询数据提升自然语言转SQL的准确率与速度。
TailorSQL: An NL2SQL System Tailored to Your Query Workload
- 基于历史查询工作负载优化NL2SQL,挖掘隐含的表关联和字段语义。
- 在标准基准上实现最高2倍的执行准确率提升。
- 适合已有大量历史查询的数据库场景,如企业数据平台。
NL2SQL(自然语言转SQL)将自然语言问题转化为SQL查询,使非技术用户也能访问结构化数据,是智能数据应用的基础。现有NL2SQL方法通常通过检索数据库模式等特定信息,并调用预训练大语言模型生成SQL。然而,这些方法忽略了真实场景中的关键机会:大多数NL2SQL应用于已处理过大量历史SQL查询的数据库中。过往查询工作负载中隐含的信息(如常见连接路径、命名晦涩的表列语义)对准确翻译至关重要,而仅靠数据库模式无法获取。我们提出TailorSQL,一种能利用历史查询工作负载信息的NL2SQL系统,以提升自然语言到SQL转换的准确性与延迟表现。通过针对特定工作负载进行定制化,TailorSQL在标准基准上实现最高2倍的执行准确率提升。
原文摘要 · Abstract (English)
NL2SQL (natural language to SQL) translates natural language questions into SQL queries, thereby making structured data accessible to non-technical users, serving as the foundation for intelligent data applications. State-of-the-art NL2SQL techniques typically perform translation by retrieving database-specific information, such as the database schema, and invoking a pre-trained large language model (LLM) using the question and retrieved information to generate the SQL query. However, existing NL2SQL techniques miss a key opportunity which is present in real-world settings: NL2SQL is typically applied on existing databases which have already served many SQL queries in the past. The past query workload implicitly contains information which is helpful for accurate NL2SQL translation and is not apparent from the database schema alone, such as common join paths and the semantics of obscurely-named tables and columns. We introduce TailorSQL, a NL2SQL system that takes advantage of information in the past query workload to improve both the accuracy and latency of translating natural language questions into SQL. By specializing to a given workload, TailorSQL achieves up to 2$\times$ improvement in execution accuracy on standardized benchmarks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。