Reinforcing Code Generation: Improving Text-to-SQL with Execution-Based Learning

要約

この作業では、自然言語の質問からSQLクエリの生成に重点を置いて、コード生成の問題を大規模な言語モデル(LLM)で研究します。
私たちは尋ねます:テキストコードペアで監視された微調整を使用する代わりに、データベースエンジンと対話することでモデルを調整できますか?
この問題は、モデルがスカラー報酬の形で環境から実行ベースのフィードバックを受信する強化学習問題としてフレーム化します。
これらの報酬は、実行障害を罰し、クエリが正解を返すときに正の値を割り当てます。
グループ相対ポリシー最適化(GRPO)フレームワーク内の報酬を使用します。
調査結果をテストおよび評価するために、表形式の推論ベンチマークを使用します。
質問を回答したペアの形での監督のみが弱いため、RLチューニングはモデル生成されたSQLコードの精度を31.49から49.83に改善し、誤差率を25.43%から14.71%に削減することがわかります。
この改善により、モデルはパフォーマンスのパフォーマンスをより大きなSQLCoder-70Bモデルにほぼ一致させることができました。
私たちの仕事は、実行ベースのフィードバックを使用してLLMの象徴的な推論能力を改善する可能性を示しています。

要約(オリジナル)

In this work, we study the problem of code generation with a large language model (LLM), with a focus on generating SQL queries from natural language questions. We ask: Instead of using supervised fine tuning with text-code pairs, can we tune a model by having it interact with a database engine? We frame this problem as a reinforcement learning problem where the model receives execution-based feedback from the environment in the form of scalar rewards. These rewards penalize execution failures and assign positive values when a query returns a correct answer. We use the rewards within the Group Relative Policy Optimization (GRPO) framework. We use a tabular reasoning benchmark to test and evaluate our findings. We find that with only weak supervision in the form of question-answer pairs, RL-tuning improves the accuracy of model generated SQL code from 31.49 to 49.83 while reducing error percentage from 25.43% to 14.71%. This improvement allowed the model nearly match the performance performance to the larger SQLCoder-70B model. Our work demonstrates the potential of using execution-based feedback to improve symbolic reasoning capabilities of LLMs.

arxiv情報

著者 Atharv Kulkarni,Vivek Srikumar
発行日 2025-06-06 13:52:41+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク