TailorSQL: An NL2SQL System Tailored to Your Query Workload

Kapil Vaidya, Jialin Ding, Sebastian Kosak, David Kernert, Chuan Lei +5 more
5/29/2025
cs.DBcs.CL

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{vaidya2025tailorsql,
  title  = {TailorSQL: An NL2SQL System Tailored to Your Query Workload},
  author = {Kapil Vaidya and Jialin Ding and Sebastian Kosak and David Kernert and Chuan Lei and Xiao Qin and Abhinav Tripathy and Ramesh Balan and Balakrishnan Narayanaswamy and Tim Kraska},
  year   = {2025},
  eprint = {2505.23039},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.23039v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.23039.svg)](https://codeofpaper.com/paper/2505.23039)

Discussion