Recent advancements in Text-to-SQL systems have improved the conversion of natural language queries into SQL, but challenges remain in ensuring accuracy and reliability. While self-correction techniques refine outputs, they often introduce new errors. Existing methods focused on execution feedback mainly address syntax issues, leaving semantic errors -- where the query's logic fails to align with the user's intent -- largely unaddressed. We propose a novel approach combining structured execution feedback with a trained critic agent that provides detailed, interpretable critiques. This method effectively identifies and corrects both syntactic and semantic errors, enhancing accuracy and interpretability. Experimental results show significant improvements on two major Text-to-SQL benchmarks, Spider and BIRD, demonstrating the effectiveness of our approach.
翻译:近年来,文本到SQL系统在将自然语言查询转换为SQL语句方面取得了显著进展,但在确保准确性和可靠性方面仍面临挑战。虽然自校正技术能够优化输出结果,但常常会引入新的错误。现有基于执行反馈的方法主要解决语法问题,而对语义错误——即查询逻辑与用户意图不一致的情况——则基本未能处理。本文提出一种创新方法,将结构化执行反馈与经过训练的批评器智能体相结合,该智能体能够提供详细且可解释的批评意见。该方法能有效识别并修正语法和语义错误,从而提升准确性与可解释性。在两个主流文本到SQL基准测试集Spider和BIRD上的实验结果表明,我们的方法取得了显著性能提升,验证了其有效性。