Reasoning-SQL: 추론 강화 텍스트-투-SQL을 위한 SQL 맞춤형 부분 보상 기반 강화 학습
Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQL
March 29, 2025
저자: Mohammadreza Pourreza, Shayan Talaei, Ruoxi Sun, Xingchen Wan, Hailong Li, Azalia Mirhoseini, Amin Saberi, Sercan "O. Arik
cs.AI
초록
Text-to-SQL은 자연어 이해, 데이터베이스 스키마 이해, 정확한 SQL 쿼리 작성과 같은 다중 추론 집약적 하위 작업을 포함하는 도전적인 과제입니다. 기존 접근 방식은 종종 귀납적 편향을 가진 수작업 추론 경로에 의존하여 전반적인 효과를 제한할 수 있습니다. 최근 DeepSeek R1과 OpenAI o1과 같은 추론 강화 모델의 성공에 영감을 받아, 이러한 모델이 보상 기반 자기 탐색을 효과적으로 활용하여 추론 능력과 일반화를 향상시킨 점을 바탕으로, 우리는 Text-to-SQL 작업에 특화된 새로운 부분 보상 세트를 제안합니다. 우리의 보상 세트는 스키마 연결, AI 피드백, n-gram 유사성, 구문 검사를 포함하며, 강화 학습(RL)에서 흔히 발생하는 보상 희소성 문제를 명시적으로 해결하기 위해 설계되었습니다. 그룹 상대 정책 최적화(GRPO)를 활용하여, 우리의 접근 방식은 대규모 언어 모델(LLM)이 정확한 SQL 쿼리 생성을 위해 필요한 내재적 추론 능력을 개발하도록 명시적으로 장려합니다. 다양한 크기의 모델을 통해, 우리가 제안한 보상을 사용한 RL 전용 훈련이 지도 미세 조정(SFT)보다 일관되게 더 높은 정확도와 우수한 일반화를 달성함을 입증합니다. 특히, 우리의 RL 훈련을 받은 14B 파라미터 모델은 BIRD 벤치마크에서 더 큰 독점 모델인 o3-mini를 4%, Gemini-1.5-Pro-002를 3% 앞서는 성능을 보였습니다. 이러한 결과는 Text-to-SQL 작업에서 정확도와 추론 능력을 모두 향상시키기 위한 우리의 제안된 RL 훈련 프레임워크와 부분 보상의 효율성을 강조합니다.
English
Text-to-SQL is a challenging task involving multiple reasoning-intensive
subtasks, including natural language understanding, database schema
comprehension, and precise SQL query formulation. Existing approaches often
rely on handcrafted reasoning paths with inductive biases that can limit their
overall effectiveness. Motivated by the recent success of reasoning-enhanced
models such as DeepSeek R1 and OpenAI o1, which effectively leverage
reward-driven self-exploration to enhance reasoning capabilities and
generalization, we propose a novel set of partial rewards tailored specifically
for the Text-to-SQL task. Our reward set includes schema-linking, AI feedback,
n-gram similarity, and syntax check, explicitly designed to address the reward
sparsity issue prevalent in reinforcement learning (RL). Leveraging group
relative policy optimization (GRPO), our approach explicitly encourages large
language models (LLMs) to develop intrinsic reasoning skills necessary for
accurate SQL query generation. With models of different sizes, we demonstrate
that RL-only training with our proposed rewards consistently achieves higher
accuracy and superior generalization compared to supervised fine-tuning (SFT).
Remarkably, our RL-trained 14B-parameter model significantly outperforms larger
proprietary models, e.g. o3-mini by 4% and Gemini-1.5-Pro-002 by 3% on the BIRD
benchmark. These highlight the efficacy of our proposed RL-training framework
with partial rewards for enhancing both accuracy and reasoning capabilities in
Text-to-SQL tasks.Summary
AI-Generated Summary