ChatPaper.aiChatPaper

SAFE-SQL: 텍스트에서 SQL로의 섬세한 예제 선택을 위한 자가 증강된 맥락 학습

SAFE-SQL: Self-Augmented In-Context Learning with Fine-grained Example Selection for Text-to-SQL

February 17, 2025
저자: Jimin Lee, Ingeol Baek, Byeongjeong Kim, Hwanhee Lee
cs.AI

초록

Text-to-SQL은 자연어 질문을 실행 가능한 SQL 쿼리로 변환하는 것을 목표로 합니다. 이전 접근 방식인 스켈레톤-마스크 선택과 같은 방법은 대규모 언어 모델(LLMs)을 안내하기 위해 유사한 훈련 예제를 검색함으로써 강력한 성능을 나타내었지만, 실제 시나리오에서는 해당 예제를 사용할 수 없는 경우에 어려움을 겪습니다. 이 한계를 극복하기 위해 우리는 Self-Augmentation in-context 학습과 Fine-grained Example 선택을 결합한 Text-to-SQL (SAFE-SQL)을 제안합니다. 이 혁신적인 프레임워크는 SQL 생성을 개선하기 위해 자가 증강된 예제를 생성하고 필터링합니다. SAFE-SQL은 먼저 LLM에게 테스트 입력과 관련된 여러 Text-to-SQL 예제를 생성하도록 요청합니다. 그런 다음 SAFE-SQL은 이러한 예제를 세 가지 관련성 평가를 통해 필터링하여 고품질의 인-컨텍스트 학습 예제를 구성합니다. 자체 생성된 예제를 사용하여 SAFE-SQL은 이전의 제로샷 및 퓨샷 Text-to-SQL 프레임워크를 능가하여 더 높은 실행 정확도를 달성합니다. 특히, 우리의 접근 방식은 전통적인 방법이 종종 실패하는 추가 어려운 및 보이지 않는 시나리오에서 성능 향상을 제공합니다.
English
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.

Summary

AI-Generated Summary

PDF72February 18, 2025