CogniSQL-R1-Zero:轻量级强化推理用于高效SQL生成
CogniSQL-R1-Zero: Lightweight Reinforced Reasoning for Efficient SQL Generation
AI总结:
CogniSQL-R1-Zero提出基于轻量级奖励信号的强化学习框架,在7B骨干上实现BIRD基准最先进执行准确率,并发布推理轨迹与弱监督语料数据集,实现高效可扩展的Text-to-SQL生成。
摘要:
将自然语言翻译为SQL(Text-to-SQL)仍然是语言理解与结构化数据访问交叉领域的核心挑战。尽管大型语言模型(LLMs)提升了流畅性,但生成正确且可执行的SQL,尤其是针对复杂查询,仍然具有挑战性。我们提出了CogniSQL-R1-Zero,一个基于强化学习(RL)的框架和模型,利用基于执行正确性和格式标签合规性的轻量级奖励信号来生成准确的SQL。通过避免中间监督、混合流水线和复杂的奖励塑形,我们的方法促进了稳定学习,并增强了与最终任务目标(生成可执行程序)的一致性。CogniSQL-R1-Zero在Text2SQL基准测试BIRD bench上达到了最先进的执行准确率,超越了先前监督和指令微调的基线模型,包括SFT CodeS-7B、DeepSeek-Coder 236B和Mistral 123B,尽管其训练使用的骨干模型仅为7B,规模显著更小。这一结果凸显了我们的基于RL的方法在仅使用四块NVIDIA A100 GPU(每块40 GB显存)训练时的可扩展性和效率。为了支持高效且可解释的Text-to-SQL建模的进一步研究,我们发布了两个精选数据集:(i)包含5,024条不同上下文长度的推理轨迹集合,以及(ii)包含36,356条弱监督查询的正采样语料库,每条查询均标注了六个语义多样的推理路径。这些贡献共同推进了可扩展的、与执行对齐的Text-to-SQL生成。
英文摘要:
Translating natural language into SQL (Text-to-SQL) remains a core challenge at the intersection of language understanding and structured data access. Although large language models (LLMs) have improved fluency, generating correct and executable SQL, especially for complex queries, continues to be challenging. We introduce CogniSQL-R1-Zero, a reinforcement learning (RL) framework and model that produces accurate SQL using a lightweight reward signal based on execution correctness and format-tag compliance. By avoiding intermediate supervision, hybrid pipelines and complex reward shaping, our method encourages stable learning and stronger alignment with the ultimate task objective-producing executable programs. CogniSQL-R1-Zero achieves state-of-the-art execution accuracy on Text2SQL benchmark; BIRD bench, outperforming prior supervised and instruction-tuned baselines including SFT CodeS-7B, DeepSeek-Coder 236B, and Mistral 123B-despite being trained on a significantly smaller 7B backbone. This result underscores the scalability and efficiency of our RL-based approach when trained on just four NVIDIA A100 GPUs (40 GB VRAM each). To support further research in efficient and interpretable Text-to-SQL modeling, we release two curated datasets: (i) a collection of 5,024 reasoning traces with varying context lengths, and (ii) a positive-sampled corpus of 36,356 corpus of weakly supervised queries, each annotated with six semantically diverse reasoning paths. Together, these contributions advance scalable, execution-aligned Text-to-SQL generation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。