title: SAFE-SQL: Self-Augmented In-Context Learning with Fine-grained Example
    Selection for Text-to-SQL
summary: Text-to-SQL aims to convert natural language questions into executable SQL
  queries. While previous approaches, such as skeleton-masked selection, have
  demonstrated strong performance by retrieving similar training examples to
  guide large language models (LLMs), they struggle in real-world scenarios where
  such examples are unavailable. To overcome this limitation, we propose
  Self-Augmentation in-context learning with Fine-grained Example selection for
  Text-to-SQL (SAFE-SQL), a novel framework that improves SQL generation by
  generating and filtering self-augmented examples. SAFE-SQL first prompts an LLM
  to generate multiple Text-to-SQL examples relevant to the test input. Then
  SAFE-SQL filters these examples through three relevance assessments,
  constructing high-quality in-context learning examples. Using self-generated
  examples, SAFE-SQL surpasses the previous zero-shot, and few-shot Text-to-SQL
  frameworks, achieving higher execution accuracy. Notably, our approach provides
  additional performance gains in extra hard and unseen scenarios, where
  conventional methods often fail.
paper_authors._id: 67b406993d0f54ab381594f5
paper_authors.name: Jimin Lee
paper_authors._id: 67b406993d0f54ab381594f6
paper_authors.name: Ingeol Baek
paper_authors._id: 67b406993d0f54ab381594f7
paper_authors.name: Byeongjeong Kim
paper_authors._id: 67b406993d0f54ab381594f8
paper_authors.name: Hwanhee Lee
paper_title: SAFE-SQL: Self-Augmented In-Context Learning with Fine-grained Example
    Selection for Text-to-SQL
paper_summary: Text-to-SQL aims to convert natural language questions into executable SQL
  queries. While previous approaches, such as skeleton-masked selection, have
  demonstrated strong performance by retrieving similar training examples to
  guide large language models (LLMs), they struggle in real-world scenarios where
  such examples are unavailable. To overcome this limitation, we propose
  Self-Augmentation in-context learning with Fine-grained Example selection for
  Text-to-SQL (SAFE-SQL), a novel framework that improves SQL generation by
  generating and filtering self-augmented examples. SAFE-SQL first prompts an LLM
  to generate multiple Text-to-SQL examples relevant to the test input. Then
  SAFE-SQL filters these examples through three relevance assessments,
  constructing high-quality in-context learning examples. Using self-generated
  examples, SAFE-SQL surpasses the previous zero-shot, and few-shot Text-to-SQL
  frameworks, achieving higher execution accuracy. Notably, our approach provides
  additional performance gains in extra hard and unseen scenarios, where
  conventional methods often fail.
paper_ai_summary: SAFE-SQL enhances Text-to-SQL by generating and filtering self-augmented examples, improving execution accuracy in real-world scenarios and hard-to-handle cases.
paper_ai_keywords: large language models (LLMs) self-augmentation in-context learning example selection zero-shot few-shot