Fine-tuning large language models (LLMs) for specific domain tasks has achieved great success in Text-to-SQL tasks. However, these fine-tuned models often face challenges with multi-turn Text-to-SQL tasks caused by ambiguous or unanswerable questions. It is desired to enhance LLMs to handle multiple types of questions in multi-turn Text-to-SQL tasks. To address this, we propose a novel data augmentation method, called QDA-SQL, which generates multiple types of multi-turn Q\&A pairs using LLMs. In QDA-SQL, we introduce a method incorporating validation and correction mechanisms to handle complex multi-turn Text-to-SQL tasks. Experimental results demonstrate that QDA-SQL enables fine-tuned models to exhibit higher performance on SQL statement accuracy and enhances their ability to handle complex, unanswerable questions in multi-turn Text-to-SQL tasks. The generation script and test set are released at https://github.com/mcxiaoxiao/QDA-SQL
翻译:针对特定领域任务对大型语言模型(LLM)进行微调,已在Text-to-SQL任务中取得显著成功。然而,这些微调后的模型在处理多轮Text-to-SQL任务时,常因问题表述模糊或不可回答而面临挑战。因此,需要增强LLM以处理多轮Text-to-SQL任务中的多种问题类型。为此,我们提出了一种新颖的数据增强方法QDA-SQL,该方法利用LLM生成多种类型的多轮问答对。在QDA-SQL中,我们引入了一种结合验证与校正机制的方法,以处理复杂的多轮Text-to-SQL任务。实验结果表明,QDA-SQL使微调模型在SQL语句准确率上表现出更高性能,并增强了其处理多轮Text-to-SQL任务中复杂、不可回答问题的能力。生成脚本与测试集已发布于https://github.com/mcxiaoxiao/QDA-SQL。