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.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

On the Construction of Text-to-SQL Tools Based on Large Language Models for Real-World Relational Databases

  • Eduardo Nascimento,
  • Gustavo Coelho,
  • Lucas Feijó,
  • Yenier Izquierdo,
  • Grettel García,
  • Aiko Oliveira,
  • João Pinheiro,
  • Antony Seabra,
  • Antonio Furtado,
  • Luiz Paes Leme,
  • Melissa Lemos,
  • Marco Casanova

摘要

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.