RB-SQL: A Retrieval-based LLM Framework for Text-to-SQL

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wu, Zhenhe, Li, Zhongqiu, Zhang, Jie, Li, Mengxiang, Zhao, Yu, Fang, Ruiyu, He, Zhongjiang, Li, Xuelong, Li, Zhoujun, Song, Shuangyong
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910523739602944
author Wu, Zhenhe
Li, Zhongqiu
Zhang, Jie
Li, Mengxiang
Zhao, Yu
Fang, Ruiyu
He, Zhongjiang
Li, Xuelong
Li, Zhoujun
Song, Shuangyong
author_facet Wu, Zhenhe
Li, Zhongqiu
Zhang, Jie
Li, Mengxiang
Zhao, Yu
Fang, Ruiyu
He, Zhongjiang
Li, Xuelong
Li, Zhoujun
Song, Shuangyong
contents Large language models (LLMs) with in-context learning have significantly improved the performance of text-to-SQL task. Previous works generally focus on using exclusive SQL generation prompt to improve the LLMs' reasoning ability. However, they are mostly hard to handle large databases with numerous tables and columns, and usually ignore the significance of pre-processing database and extracting valuable information for more efficient prompt engineering. Based on above analysis, we propose RB-SQL, a novel retrieval-based LLM framework for in-context prompt engineering, which consists of three modules that retrieve concise tables and columns as schema, and targeted examples for in-context learning. Experiment results demonstrate that our model achieves better performance than several competitive baselines on public datasets BIRD and Spider.
format Preprint
id arxiv_https___arxiv_org_abs_2407_08273
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle RB-SQL: A Retrieval-based LLM Framework for Text-to-SQL
Wu, Zhenhe
Li, Zhongqiu
Zhang, Jie
Li, Mengxiang
Zhao, Yu
Fang, Ruiyu
He, Zhongjiang
Li, Xuelong
Li, Zhoujun
Song, Shuangyong
Computation and Language
Large language models (LLMs) with in-context learning have significantly improved the performance of text-to-SQL task. Previous works generally focus on using exclusive SQL generation prompt to improve the LLMs' reasoning ability. However, they are mostly hard to handle large databases with numerous tables and columns, and usually ignore the significance of pre-processing database and extracting valuable information for more efficient prompt engineering. Based on above analysis, we propose RB-SQL, a novel retrieval-based LLM framework for in-context prompt engineering, which consists of three modules that retrieve concise tables and columns as schema, and targeted examples for in-context learning. Experiment results demonstrate that our model achieves better performance than several competitive baselines on public datasets BIRD and Spider.
title RB-SQL: A Retrieval-based LLM Framework for Text-to-SQL
topic Computation and Language
url https://arxiv.org/abs/2407.08273