SEG-SQL: Structure-aware Example Generation for Text-to-SQL Method with In-context Learning 


Vol. 52,  No. 11, pp. 992-1001, Nov.  2025
10.5626/JOK.2025.52.11.992


PDF

  Abstract

Large language models (LLMs) that utilize in-context learning have significantly improved Text-to-SQL performance. However, traditional natural language similarity-based example selection often fails to ensure SQL structural similarity and can degrade performance when no structurally similar examples exist for a target SQL query. To address this issue, we propose SEG-SQL (Structure-aware Example Generation for Text-to-SQL). SEG-SQL first generates an initial SQL query from a given natural language question and converts it into a hint vector that captures its structural characteristics. It then modifies specific bits of this hint vector to create structurally similar SQL queries, which are subsequently transformed back into natural language through SQL-to-Text conversion. These transformed queries are used as few-shot examples for in-context learning. On the BIRD benchmark, SEG-SQL improved execution accuracy by 2.5% compared to CHESS and by 3.4% compared to OpenSearch-SQL. Under the most challenging difficulty setting, these gains increased to 30.0% and 62.2%, respectively. These results show that SEG-SQL consistently enhances the accuracy of in-context learning-based Text-to-SQL methods, even in complex environments.


  Statistics
Cumulative Counts from November, 2022
Multiple requests among the same browser session are counted as one view. If you mouse over a chart, the values of data points will be shown.


  Cite this article

[IEEE Style]

D. Kwon, J. Moon, J. Lee, "SEG-SQL: Structure-aware Example Generation for Text-to-SQL Method with In-context Learning," Journal of KIISE, JOK, vol. 52, no. 11, pp. 992-1001, 2025. DOI: 10.5626/JOK.2025.52.11.992.


[ACM Style]

Donguk Kwon, Jaewan Moon, and Jongwook Lee. 2025. SEG-SQL: Structure-aware Example Generation for Text-to-SQL Method with In-context Learning. Journal of KIISE, JOK, 52, 11, (2025), 992-1001. DOI: 10.5626/JOK.2025.52.11.992.


[KCI Style]

권동욱, 문재완, 이종욱, "구조 기반 예제 생성을 활용한 문맥 학습 기반 Text-to-SQL 기법," 한국정보과학회 논문지, 제52권, 제11호, 992~1001쪽, 2025. DOI: 10.5626/JOK.2025.52.11.992.


[Endnote/Zotero/Mendeley (RIS)]  Download


[BibTeX]  Download



Search




Journal of KIISE

  • ISSN : 2383-630X(Print)
  • ISSN : 2383-6296(Electronic)
  • KCI Accredited Journal

Editorial Office

  • Tel. +82-2-588-9240
  • Fax. +82-2-521-1352
  • E-mail. chwoo@kiise.or.kr