错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

KIS-SQL: Knowledge-Enhanced In-Context Learning and Self-correction of Text-to-SQL

  • Qiujie Fan

摘要

Text-to-SQL power by large language models enhances the accessibility and user-friendliness of relational databases significantly. Optimizing prompting strategies for improved SQL query accuracy, is one of the key research directions in this field. We propose the KIS-SQL model based on knowledge-enhanced prompt learning. KIS-SQL used Structural Measurement-Based In-Context Learning to predict the syntax structure of SQLs, and integrating this structural knowledge to construct prompts that can better guide large language models in generating SQLs. Meanwhile, Syntax-Semantic Analysis Guided Self-Correction is employed to incorporate syntax and semantic knowledge obtained from external analysis engines into prompts, thereby improving the ability of large language models to correct SQLs. Experiments are conducted on the Spider dataset using Exact-Set-Match accuracy and Execution accuracy as metrics, and the results show that KIS-SQL outperforms baseline models.