arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.15564cs.CLcs.AI
收藏

超越静态流水线:用于文本到SQL的动态工作流学习

Beyond Static Pipelines: Learning Dynamic Workflows for Text-to-SQL

Renmin University of China(中国人民大学);University of International Business and Economics(国际经济贸易大学)

Yihan Wang, Peiyu Liu, Runyu Chen, Wei Xu

AI总结:

本文提出SquRL框架,通过强化学习提升文本到SQL任务中动态工作流构建的推理能力,实验表明动态方法在复杂和分布外查询上表现优于传统静态方法。

摘要:

文本到SQL最近取得了显著进展,但仍难以在现实场景中有效应用。这种差距源于对单一静态工作流的依赖,从根本上限制了其扩展性,无法适应分布外和长尾场景。与其要求用户通过大量实验选择合适的方法,我们尝试让系统在推理时自适应地构建工作流。通过理论和实证分析,我们证明最优的动态策略始终优于最佳静态工作流,性能提升的根本驱动力是候选工作流之间的异质性。受此启发,我们提出了SquRL,一种强化学习框架,旨在增强LLM在自适应工作流构建中的推理能力。我们设计了一个基于规则的奖励函数,并引入了两种有效的训练机制:动态动作遮蔽以鼓励更广泛的探索,以及伪奖励以提高训练效率。在广泛使用的文本到SQL基准测试中,动态工作流构建始终优于最佳静态工作流方法,尤其在复杂和分布外查询上表现突出。代码可在https://github.com/Satissss/SquRL获取。

英文摘要:

Text-to-SQL has recently achieved impressive progress, yet remains difficult to apply effectively in real-world scenarios. This gap stems from the reliance on single static workflows, fundamentally limiting scalability to out-of-distribution and long-tail scenarios. Instead of requiring users to select suitable methods through extensive experimentation, we attempt to enable systems to adaptively construct workflows at inference time. Through theoretical and empirical analysis, we demonstrate that optimal dynamic policies consistently outperform the best static workflow, with performance gains fundamentally driven by heterogeneity across candidate workflows. Motivated by this, we propose SquRL, a reinforcement learning framework that enhances LLMs' reasoning capability in adaptive workflow construction. We design a rule-based reward function and introduce two effective training mechanisms: dynamic actor masking to encourage broader exploration, and pseudo rewards to improve training efficiency. Experiments on widely-used Text-to-SQL benchmarks demonstrate that dynamic workflow construction consistently outperforms the best static workflow methods, with especially pronounced gains on complex and out-of-distribution queries. The codes are available at https://github.com/Satissss/SquRL

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑