arXiv:2509.03937cs.CLcs.AI2025-09EMNLP被引 5

通过自博弈微调提升大模型文本转SQL能力,解决纠错难问题

SPFT-SQL: Enhancing Large Language Model for Text-to-SQL Parsing by Self-Play Fine-Tuning

  • 先用验证反馈迭代生成高质量数据,构建不同能力模型基底
  • 自博弈中设计错误驱动损失,强化主模型区分正确与错误SQL的能力
  • 在5个主流基准上超越现有最佳方法,适用于需要高精度数据库查询的场景

尽管自博弈微调(SPIN)能通过不同能力模型间的竞争互动将弱大模型转变为强模型,但在文本转SQL任务中仍面临挑战:SPIN不产生新信息,且对手模型生成的大量正确SQL会削弱主模型生成准确SQL的能力。为此,我们提出专用于文本转SQL任务的自博弈微调方法SPFT-SQL。在自博弈前,引入基于验证反馈的迭代微调,依据数据库模式和验证反馈迭代合成高质量微调数据,同时构建具备不同能力的模型基底。在自博弈微调阶段,提出错误驱动损失函数,激励对手模型输出错误,使主模型能更好区分正确与错误的SQL,从而提升生成准确性。在六种开源大语言模型和五个常用基准上的大量实验及深入分析表明,该方法优于现有最先进(SOTA)方法。

原文摘要 · Abstract (English)

Despite the significant advancements of self-play fine-tuning (SPIN), which can transform a weak large language model (LLM) into a strong one through competitive interactions between models of varying capabilities, it still faces challenges in the Text-to-SQL task. SPIN does not generate new information, and the large number of correct SQL queries produced by the opponent model during self-play reduces the main model's ability to generate accurate SQL queries. To address this challenge, we propose a new self-play fine-tuning method tailored for the Text-to-SQL task, called SPFT-SQL. Prior to self-play, we introduce a verification-based iterative fine-tuning approach, which synthesizes high-quality fine-tuning data iteratively based on the database schema and validation feedback to enhance model performance, while building a model base with varying capabilities. During the self-play fine-tuning phase, we propose an error-driven loss method that incentivizes incorrect outputs from the opponent model, enabling the main model to distinguish between correct SQL and erroneous SQL generated by the opponent model, thereby improving its ability to generate correct SQL. Extensive experiments and in-depth analyses on six open-source LLMs and five widely used benchmarks demonstrate that our approach outperforms existing state-of-the-art (SOTA) methods.

文本转SQL自博弈大模型微调

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。