On the Construction of Text-to-SQL Tools Based on Large Language Models for Real-World Relational Databases
摘要
A strategy to construct natural language database interfaces is to use Large Language Models (LLMs) to translate the end-user questions into SQL queries. Such interfaces will be called LLM-based text-to-SQL tools. This article analyses the limitations and proposes solutions to improve the performance of LLM-based text-to-SQL tools for real-world relational databases that have large, complex schemas often expressed in terms different from those adopted by end-users to formulate their questions. The article considers implementations based on Prompt Engineering, including Retrieval-Augmented Generation, and LLM fine-tuning. Finally, it describes experiments that analyze the accuracy of some implementations on two benchmarks built upon databases with large schemas.