RSL-SQL: Robust Schema Linking in Text-to-SQL Generation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Cao, Zhenbiao, Zheng, Yuanlei, Fan, Zhihao, Zhang, Xiaojin, Chen, Wei, Bai, Xiang
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913585831084032
author Cao, Zhenbiao
Zheng, Yuanlei
Fan, Zhihao
Zhang, Xiaojin
Chen, Wei
Bai, Xiang
author_facet Cao, Zhenbiao
Zheng, Yuanlei
Fan, Zhihao
Zhang, Xiaojin
Chen, Wei
Bai, Xiang
contents Text-to-SQL generation aims to translate natural language questions into SQL statements. In Text-to-SQL based on large language models, schema linking is a widely adopted strategy to streamline the input for LLMs by selecting only relevant schema elements, therefore reducing noise and computational overhead. However, schema linking faces risks that require caution, including the potential omission of necessary elements and disruption of database structural integrity. To address these challenges, we propose a novel framework called RSL-SQL that combines bidirectional schema linking, contextual information augmentation, binary selection strategy, and multi-turn self-correction. We improve the recall of pattern linking using forward and backward pruning methods, achieving a strict recall of 94% while reducing the number of input columns by 83%. Furthermore, it hedges the risk by voting between a full mode and a simplified mode enhanced with contextual information. Experiments on the BIRD and Spider benchmarks demonstrate that our approach achieves SOTA execution accuracy among open-source solutions, with 67.2% on BIRD and 87.9% on Spider using GPT-4o. Furthermore, our approach outperforms a series of GPT-4 based Text-to-SQL systems when adopting DeepSeek (much cheaper) with same intact prompts. Extensive analysis and ablation studies confirm the effectiveness of each component in our framework. The codes are available at https://github.com/Laqcce-cao/RSL-SQL.
format Preprint
id arxiv_https___arxiv_org_abs_2411_00073
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle RSL-SQL: Robust Schema Linking in Text-to-SQL Generation
Cao, Zhenbiao
Zheng, Yuanlei
Fan, Zhihao
Zhang, Xiaojin
Chen, Wei
Bai, Xiang
Computation and Language
Artificial Intelligence
Databases
Text-to-SQL generation aims to translate natural language questions into SQL statements. In Text-to-SQL based on large language models, schema linking is a widely adopted strategy to streamline the input for LLMs by selecting only relevant schema elements, therefore reducing noise and computational overhead. However, schema linking faces risks that require caution, including the potential omission of necessary elements and disruption of database structural integrity. To address these challenges, we propose a novel framework called RSL-SQL that combines bidirectional schema linking, contextual information augmentation, binary selection strategy, and multi-turn self-correction. We improve the recall of pattern linking using forward and backward pruning methods, achieving a strict recall of 94% while reducing the number of input columns by 83%. Furthermore, it hedges the risk by voting between a full mode and a simplified mode enhanced with contextual information. Experiments on the BIRD and Spider benchmarks demonstrate that our approach achieves SOTA execution accuracy among open-source solutions, with 67.2% on BIRD and 87.9% on Spider using GPT-4o. Furthermore, our approach outperforms a series of GPT-4 based Text-to-SQL systems when adopting DeepSeek (much cheaper) with same intact prompts. Extensive analysis and ablation studies confirm the effectiveness of each component in our framework. The codes are available at https://github.com/Laqcce-cao/RSL-SQL.
title RSL-SQL: Robust Schema Linking in Text-to-SQL Generation
topic Computation and Language
Artificial Intelligence
Databases
url https://arxiv.org/abs/2411.00073