Fine-tuning text-to-SQL models with reinforcement-learning training objectives

Text-to-SQL is an important natural language processing task that helps users automatically convert natural language queries into formal SQL code. While transformer-based models have pushed text-to-SQL to unprecedented accuracy levels in recent years, such performance is confined to models of very large size that can only be run in specialised clouds. For this reason, in this paper we explore the use of reinforcement learning to improve the performance of models of more conservative size, which can fit within standard user hardware. As reinforcement learning reward, we propose a novel function which better aligns with the text-to-SQL evaluation metrics, applied in conjunction with two strong policy gradient algorithms, REINFORCE and RELAX. Our experimental results over the popular Spider benchmark show that the proposed approach has been able to outperform a conventionally-trained T5 Small baseline by 6.6 pp (percentage points) of exact-set-match accuracy and 4.6 pp of execution accuracy, and a T5 Base baseline by 2.0 pp and 1.9 pp, respectively. The proposed model has also achieved a remarkable comparative performance against ChatGPT instances. • Tackles the useful text-to-SQL task with models of compact size. • Leverages reinforcement learning training objectives to improve the models’ performance. • Compares with conventional training objectives and a popular policy gradient algorithm. • Results on the Spider dataset show that the proposed approach has outperformed the compared models. • Performs strongly also against zero-shot and one-shot set-ups of GPT-3.5 and GPT-4.

Authors

Institutions

Publication Details

Journal
Natural Language Processing Journal
Published
2025-02-21
DOI
https://doi.org/10.1016/j.nlp.2025.100135
Citations
7
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
17.37
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fine-tuning text-to-SQL models with reinforcement-learning training objectives

Xuan-Hieu Phan, Xuan-Ha Nguyen, Massimo Piccardi
7 citations
Natural Language Processing Journal
Topic Modeling
17.37
article

Fine-tuning text-to-SQL models with reinforcement-learning training objectives

Xuan-Hieu Phan, Xuan-Ha Nguyen, Massimo Piccardi
article en
7 citations

Abstract

Text-to-SQL is an important natural language processing task that helps users automatically convert natural language queries into formal SQL code. While transformer-based models have pushed text-to-SQL to unprecedented accuracy levels in recent years, such performance is confined to models of very large size that can only be run in specialised clouds. For this reason, in this paper we explore the use of reinforcement learning to improve the performance of models of more conservative size, which can fit within standard user hardware. As reinforcement learning reward, we propose a novel function which better aligns with the text-to-SQL evaluation metrics, applied in conjunction with two strong policy gradient algorithms, REINFORCE and RELAX. Our experimental results over the popular Spider benchmark show that the proposed approach has been able to outperform a conventionally-trained T5 Small baseline by 6.6 pp (percentage points) of exact-set-match accuracy and 4.6 pp of execution accuracy, and a T5 Base baseline by 2.0 pp and 1.9 pp, respectively. The proposed model has also achieved a remarkable comparative performance against ChatGPT instances. • Tackles the useful text-to-SQL task with models of compact size. • Leverages reinforcement learning training objectives to improve the models’ performance. • Compares with conventional training objectives and a popular policy gradient algorithm. • Results on the Spider dataset show that the proposed approach has outperformed the compared models. • Performs strongly also against zero-shot and one-shot set-ups of GPT-3.5 and GPT-4.

Natural Language Processing JournalVol. 10
FPT University (VN), University of Technology Sydney (AU), Vietnam National University, Hanoi (VN)
Openalex Percentile: Top 1%
Topic Modeling
17.37
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.