PCEM-SQL: enhancing text-to-SQL capabilities by large language models and prompt engineering with self-consistency and self-evaluation mechanism
In recent years, natural language processing has experienced rapid development, especially in utilizing natural language statements to quickly query target data in databases. Transforming user’s natural language into computer executable SQL statements has become an important research direction for improving user database interaction. However, with the rise of large language models, enhancing their performance in Text-to-SQL tasks through prompt engineering has become a feasible research direction. This article proposes the PCEM-SQL method, which enables a large language model to generate high-quality SQL statements through clear prompt template and carefully constructed prompt words. By introducing self-consistency and self-evaluation Mechanism of the large language model, the accuracy of Text-to-SQL is significantly improved on the open-source large language model Qwen. To verify the effectiveness of the method, we construct a small dataset (Spider-SM) and conducted experiments on GPT3.5 and Qwen, once again proving that our method has a significant improvement (13%) in Qwen’s Text-to-SQL performance, and can achieve similar results as GPT3.5.
Authors
- Xide Lai (ORCID: https://orcid.org/0000-0001-7112-2177)
- Liang Xiao (ORCID: https://orcid.org/0000-0003-0178-9384)
- Zhuo Chen (ORCID: https://orcid.org/0000-0001-5370-2688)
- Lianggui Tang (ORCID: https://orcid.org/0009-0001-9402-5000)
- Jiajun Yang (ORCID: https://orcid.org/0000-0002-8414-8330)
- Xiyu Zhu (ORCID: https://orcid.org/0000-0001-6721-3746)
Institutions
- Chongqing Technology and Business University (CN)
Publication Details
- Published
- 2024-10-28
- DOI
- https://doi.org/10.1117/12.3050108
- Primary Topic
- Distributed and Parallel Computing Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00