Return
Enhancing SQL generation through high-quality logical guidance
DOI:10.1007/s10844-026-01032-z.png)
Abstract
En 中文
Large Language Models (LLMs) can convert natural language questions into Structured Query Language (SQL) without requiring specific fine-tuning. By providing appropriate guidance examples that share similar query logic to the target question, LLMs can more accurately capture the mapping between the target question and its corresponding SQL. Existing research emphasizes using objective information (e.g., question skeletons) as evidence to select logical guidance examples for LLMs. However, the ambiguity and uncertainty of objective information may lead to the selection of inappropriate examples, thereby misleading LLMs into generating incorrect or non-gold SQL. In this research, we propose a Text-to-SQL method that considers the understanding of LLMs, named LU-SQL. Specifically, LU-SQL first utilizes LLMs to generate an understanding of the question based on a carefully designed logical representation form, and then interprets the generated understanding through an interpretation model. Subsequently, the method combines the question skeleton with the interpreted understanding to select appropriate logical guidance examples. Additionally, LU-SQL introduces a novel schema linking strategy that accumulates linking experiences from the linking processes of selected logical guidance examples and applies these experiences to guide the linking process of target cases. Experimental results show that LU-SQL achieves up to a 26% improvement in the performance of selecting appropriate guidance examples, and its SQL generation performance increases by more than 3% compared to the baseline model.
Keywords:
Text-to-SQL
Contextual Learning
Transformer
Graph convolutional network
Journal
J
IF:
3.4
Papers:
75
Citations:
0

