用强化学习思想提升文本转SQL模型效果,无需复杂设计。
An Actor-Critic Approach to Boosting Text-to-SQL Large Language Model
- 让大模型自动生成SQL并自我纠错,通过评判机制迭代优化。
- 在Spider等数据集上,11个大模型性能均显著提升。
- 方法通用且理论可保证,适合所有文本转SQL任务使用。
基于大语言模型的文本转SQL(T2S)已广泛应用,依赖其理解自然语言查询意图的能力。现有研究聚焦于模式与问题的表示、任务特定指令和示例,以及复杂的推理流程,但这些方法均为经验性且任务特定,缺乏性能理论边界。本文提出一种简单、通用且性能有保障的T2S增强方法——演员-评论家(Actor-Critic, AC)。具体地,利用同一LLM扮演两个角色:演员生成SQL,评论家评估生成结果;若评论家判定错误,则通知演员重试。通过此简单迭代过程,理论上可获得预期性能。我们在Spider及相关数据集上对11个LLM进行了广泛实验,证明该方法能持续提升T2S性能,作为通用增强手段具有普适价值。
原文摘要 · Abstract (English)
Text-To-SQL (T2S) conversion based on large language models (LLMs) has found a wide range of applications, by leveraging the capabilities of LLMs in interpreting the query intent expressed in natural language. Existing research focuses on suitable representations for data schema and/or questions, task-specific instructions and representative examples, and complicated inference pipelines. All these methods are empirical and task specific, without a theoretical bound on performance. In this paper, we propose a simple, general, and performance guaranteed T2S enhancement approach called Actor-Critic (AC). Specifically, we design two roles using the same LLM: an Actor to produce SQL queries and a Critic to evaluate the produced SQL. If the Critic believes the produced SQL is wrong, it notifies the Actor to reproduce the SQL and perform evaluation again. By this simple iterative process, expected performance can be derived in theory. We conducted extensive experiments on the Spider and related datasets with eleven LLMs, and demonstrated that the Actor-Critic method consistently improves the performance of T2S, thus serving as a general enhancement approach for T2S conversion.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。