Large Language Model (LLM)-based approaches have become pivotal in text-to-SQL tasks. However, these methods struggle to effectively mitigate question ambiguity, thereby hindering their practical utility. To tackle this issue, we present MQA-SQL, which comprises the following stages: (1) Preliminary SQL Generation: MQA-SQL preliminarily produces SQL by leveraging multiple open-source LLMs through Supervised Fine-Tuning, providing a solid foundation for the subsequent process; (2) Rephrased Question-based SQL Generation: The framework seeks to improve the comprehension of user intent by generating multiple rephrased variants of the original question. The SQL candidates generated in the first stage are then synthesized by a closed-source LLM based on the original and rephrased questions to enhance SQL generation. The final SQL is selected based on the consistency of execution results among these candidates. Extensive experiments on diverse datasets substantiate the effectiveness of MQA-SQL in improving SQL generation.

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

MQA-SQL: Mitigating Question Ambiguity in Text-to-SQL with Multi-model Collaboration and Multi-variant Query Rephrasing

  • Yiming Huang,
  • Jiyu Guo,
  • Jichuan Zeng,
  • Cuiyun Gao,
  • Peiyi Han,
  • Chuanyi Liu

摘要

Large Language Model (LLM)-based approaches have become pivotal in text-to-SQL tasks. However, these methods struggle to effectively mitigate question ambiguity, thereby hindering their practical utility. To tackle this issue, we present MQA-SQL, which comprises the following stages: (1) Preliminary SQL Generation: MQA-SQL preliminarily produces SQL by leveraging multiple open-source LLMs through Supervised Fine-Tuning, providing a solid foundation for the subsequent process; (2) Rephrased Question-based SQL Generation: The framework seeks to improve the comprehension of user intent by generating multiple rephrased variants of the original question. The SQL candidates generated in the first stage are then synthesized by a closed-source LLM based on the original and rephrased questions to enhance SQL generation. The final SQL is selected based on the consistency of execution results among these candidates. Extensive experiments on diverse datasets substantiate the effectiveness of MQA-SQL in improving SQL generation.