ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedback

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhai, Bohan, Xu, Canwen, He, Yuxiong, Yao, Zhewei
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910893383614464
author Zhai, Bohan
Xu, Canwen
He, Yuxiong
Yao, Zhewei
author_facet Zhai, Bohan
Xu, Canwen
He, Yuxiong
Yao, Zhewei
contents Text-to-SQL demands precise reasoning to convert natural language questions into structured queries. While large language models (LLMs) excel in many reasoning tasks, their ability to leverage Chain-of-Thought (CoT) reasoning for text-to-SQL remains underexplored. We identify critical limitations: zero-shot CoT offers minimal gains, and Direct Preference Optimization (DPO) applied without CoT yields marginal improvements. We propose ExCoT, a novel framework that iteratively optimizes open-source LLMs by combining CoT reasoning with off-policy and on-policy DPO, relying solely on execution accuracy as feedback. This approach eliminates the need for reward models or human-annotated preferences. Our experimental results demonstrate significant performance gains: ExCoT improves execution accuracy on BIRD dev set from 57.37% to 68.51% and on Spider test set from 78.81% to 86.59% for LLaMA-3 70B, with Qwen-2.5-Coder demonstrating similar improvements. Our best model achieves state-of-the-art performance in the single-model setting on both BIRD and Spider datasets, notably achieving 68.53% on the BIRD test set.
format Preprint
id arxiv_https___arxiv_org_abs_2503_19988
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedback
Zhai, Bohan
Xu, Canwen
He, Yuxiong
Yao, Zhewei
Machine Learning
Artificial Intelligence
Databases
Text-to-SQL demands precise reasoning to convert natural language questions into structured queries. While large language models (LLMs) excel in many reasoning tasks, their ability to leverage Chain-of-Thought (CoT) reasoning for text-to-SQL remains underexplored. We identify critical limitations: zero-shot CoT offers minimal gains, and Direct Preference Optimization (DPO) applied without CoT yields marginal improvements. We propose ExCoT, a novel framework that iteratively optimizes open-source LLMs by combining CoT reasoning with off-policy and on-policy DPO, relying solely on execution accuracy as feedback. This approach eliminates the need for reward models or human-annotated preferences. Our experimental results demonstrate significant performance gains: ExCoT improves execution accuracy on BIRD dev set from 57.37% to 68.51% and on Spider test set from 78.81% to 86.59% for LLaMA-3 70B, with Qwen-2.5-Coder demonstrating similar improvements. Our best model achieves state-of-the-art performance in the single-model setting on both BIRD and Spider datasets, notably achieving 68.53% on the BIRD test set.
title ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedback
topic Machine Learning
Artificial Intelligence
Databases
url https://arxiv.org/abs/2503.19988