SQL-o1: A Self-Reward Heuristic Dynamic Search Method for Text-to-SQL

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Lyu, Shuai, Luo, Haoran, Li, Ripeng, Ou, Zhonghong, Sun, Jiangfeng, Qin, Yang, Shang, Xiaoran, Song, Meina, Zhu, Yifan
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908374768025600
author Lyu, Shuai
Luo, Haoran
Li, Ripeng
Ou, Zhonghong
Sun, Jiangfeng
Qin, Yang
Shang, Xiaoran
Song, Meina
Zhu, Yifan
author_facet Lyu, Shuai
Luo, Haoran
Li, Ripeng
Ou, Zhonghong
Sun, Jiangfeng
Qin, Yang
Shang, Xiaoran
Song, Meina
Zhu, Yifan
contents Text-to-SQL (Text2SQL) aims to map natural language questions to executable SQL queries. Although large language models (LLMs) have driven significant progress, current approaches struggle with poor transferability to open-source LLMs, limited robustness against logic and function errors in complex queries, and inefficiencies in structured search. We introduce SQL-o1, a self-reward-driven heuristic search framework built on an agent-based architecture to enhance model reasoning capabilities. SQL-o1 leverages Monte Carlo Tree Search (MCTS) for structured, multi-step exploration, and incorporates a dynamic pruning strategy to accelerate inference without sacrificing accuracy. On the Spider and Bird benchmarks, SQL-o1 achieves a +10.8 execution accuracy improvement on the complex Bird dataset, surpassing even GPT-4-based models. Notably, it exhibits strong few-shot generalization and robust cross-model transferability across open-source LLMs. Our code is available at:https://github.com/ShuaiLyu0110/SQL-o1.
format Preprint
id arxiv_https___arxiv_org_abs_2502_11741
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SQL-o1: A Self-Reward Heuristic Dynamic Search Method for Text-to-SQL
Lyu, Shuai
Luo, Haoran
Li, Ripeng
Ou, Zhonghong
Sun, Jiangfeng
Qin, Yang
Shang, Xiaoran
Song, Meina
Zhu, Yifan
Databases
Artificial Intelligence
Text-to-SQL (Text2SQL) aims to map natural language questions to executable SQL queries. Although large language models (LLMs) have driven significant progress, current approaches struggle with poor transferability to open-source LLMs, limited robustness against logic and function errors in complex queries, and inefficiencies in structured search. We introduce SQL-o1, a self-reward-driven heuristic search framework built on an agent-based architecture to enhance model reasoning capabilities. SQL-o1 leverages Monte Carlo Tree Search (MCTS) for structured, multi-step exploration, and incorporates a dynamic pruning strategy to accelerate inference without sacrificing accuracy. On the Spider and Bird benchmarks, SQL-o1 achieves a +10.8 execution accuracy improvement on the complex Bird dataset, surpassing even GPT-4-based models. Notably, it exhibits strong few-shot generalization and robust cross-model transferability across open-source LLMs. Our code is available at:https://github.com/ShuaiLyu0110/SQL-o1.
title SQL-o1: A Self-Reward Heuristic Dynamic Search Method for Text-to-SQL
topic Databases
Artificial Intelligence
url https://arxiv.org/abs/2502.11741