RISS 학술연구정보서비스

검색

인기 검색어

    다국어 입력

    http://chineseinput.net/에서 pinyin(병음)방식으로 중국어를 변환할 수 있습니다.

    변환된 중국어를 복사하여 사용하시면 됩니다.

    예시)
    • 中文 을 입력하시려면 zhongwen을 입력하시고 space를누르시면됩니다.
    • 北京 을 입력하시려면 beijing을 입력하시고 space를 누르시면 됩니다.
    닫기

    구조 기반 예제 생성을 활용한 문맥 학습 기반 Text-to-SQL 기법

    한글로보기

    https://www.riss.kr/link?id=T17387650

    • 0

      상세조회
    • 0

      다운로드
    서지정보 열기
    • 내보내기
    • 내책장담기
    • 공유하기
      • URL 복사
    • 오류접수
    인용문이 복사되었습니다.

    부가정보

    국문 초록 (Abstract) kakao i 다국어 번역

    Text-to-SQL은 사용자가 데이터베이스 질의를 자연어로 수행할 수 있도록 하는 핵심 기술로, 최근 대규모 언어 모델(LLM)의 문맥 학습(In-Context Learning) 능력에 의해 비약적인 발전을 이루었다. 그러나 기존의 예제 선택 방식은 자연어 질의 간 의미 유사도에만 의존하기 때문에, 실제 SQL 구조적 패턴과 일치하지 않는 예제를 선택하는 문제가 발생한다. 특히 BIRD와 같은 복잡한 스키마를 포함한 고난이도 데이터셋에서는 구조적으로 유사한 예제가 학습 데이터에 존재하지 않아, LLM이 참조할 만한 유효한 Few-shot 예제를 확보하기 어렵다. 이로 인해 복잡한 조인, 중첩 서브쿼리, 집계 연산이 포함된 질의에서 성능이 크게 저하되는 한계가 있다.
    이러한 문제를 해결하기 위해 본 연구는 SEG-SQL(Structure-aware Example Generation for Text-to-SQL) 프레임워크를 제안한다. SEG-SQL은 자연어 질의로부터 생성된 초기 SQL을 구조 요약 지표인 힌트 벡터(Hint Vector) 로 변환하고, 일부 비트를 변형(mutation)하여 구조적으로 유사하지만 변형된 형태의 pseudo SQL을 생성한다. 이후 각 SQL을 SQL-to-Text 변환을 통해 대응되는 자연어 질의로 재구성함으로써, 구조적으로 일관되고 표현적으로 다양한 NL-SQL 예제 쌍을 생성한다. 생성된 예제들은 LLM의 Few-shot 프롬프트에 포함되어, 자연어 표현이 아닌 SQL 구조 중심의 문맥 학습을 가능하게 한다.
    BIRD 벤치마크에서 수행된 실험 결과, SEG-SQL은 기존 최신 모델인 CHESS 및 OpenSearch-SQL 대비 각각 2.5%, 3.4%의 실행 정확도 향상을 보였다. 특히 구조적으로 유사한 예제가 부족한 Challenging 난이도 구간에서는 각각 30.0%, 62.2%의 성능 향상을 기록하며, 복잡한 질의 환경에서도 일관된 성능을 유지하였다. 또한 힌트 벡터의 비트 수를 확장할수록 실행 정확도가 점진적으로 증가함을 확인하여, SQL 구조 정보의 세밀한 표현이 LLM의 질의 변환 능력에 직접적으로 기여함을 입증하였다.
    결과적으로 SEG-SQL은 자연어 유사도 기반 접근이 가진 한계를 넘어, SQL 구조의 형식적 특징을 직접 활용하여 문맥 학습 기반 Text-to-SQL의 정확도와 안정성을 모두 향상시킨다. 본 연구는 LLM이 구조적 정보를 이해하고 활용할 수 있도록 하는 새로운 예제 생성 패러다임을 제시하였으며, 향후 구조 기반 프롬프트 설계 및 자동 예제 생성 연구의 기반을 제공한다.
    번역하기

    Text-to-SQL은 사용자가 데이터베이스 질의를 자연어로 수행할 수 있도록 하는 핵심 기술로, 최근 대규모 언어 모델(LLM)의 문맥 학습(In-Context Learning) 능력에 의해 비약적인 발전을 이루었다. 그...

    Text-to-SQL은 사용자가 데이터베이스 질의를 자연어로 수행할 수 있도록 하는 핵심 기술로, 최근 대규모 언어 모델(LLM)의 문맥 학습(In-Context Learning) 능력에 의해 비약적인 발전을 이루었다. 그러나 기존의 예제 선택 방식은 자연어 질의 간 의미 유사도에만 의존하기 때문에, 실제 SQL 구조적 패턴과 일치하지 않는 예제를 선택하는 문제가 발생한다. 특히 BIRD와 같은 복잡한 스키마를 포함한 고난이도 데이터셋에서는 구조적으로 유사한 예제가 학습 데이터에 존재하지 않아, LLM이 참조할 만한 유효한 Few-shot 예제를 확보하기 어렵다. 이로 인해 복잡한 조인, 중첩 서브쿼리, 집계 연산이 포함된 질의에서 성능이 크게 저하되는 한계가 있다.
    이러한 문제를 해결하기 위해 본 연구는 SEG-SQL(Structure-aware Example Generation for Text-to-SQL) 프레임워크를 제안한다. SEG-SQL은 자연어 질의로부터 생성된 초기 SQL을 구조 요약 지표인 힌트 벡터(Hint Vector) 로 변환하고, 일부 비트를 변형(mutation)하여 구조적으로 유사하지만 변형된 형태의 pseudo SQL을 생성한다. 이후 각 SQL을 SQL-to-Text 변환을 통해 대응되는 자연어 질의로 재구성함으로써, 구조적으로 일관되고 표현적으로 다양한 NL-SQL 예제 쌍을 생성한다. 생성된 예제들은 LLM의 Few-shot 프롬프트에 포함되어, 자연어 표현이 아닌 SQL 구조 중심의 문맥 학습을 가능하게 한다.
    BIRD 벤치마크에서 수행된 실험 결과, SEG-SQL은 기존 최신 모델인 CHESS 및 OpenSearch-SQL 대비 각각 2.5%, 3.4%의 실행 정확도 향상을 보였다. 특히 구조적으로 유사한 예제가 부족한 Challenging 난이도 구간에서는 각각 30.0%, 62.2%의 성능 향상을 기록하며, 복잡한 질의 환경에서도 일관된 성능을 유지하였다. 또한 힌트 벡터의 비트 수를 확장할수록 실행 정확도가 점진적으로 증가함을 확인하여, SQL 구조 정보의 세밀한 표현이 LLM의 질의 변환 능력에 직접적으로 기여함을 입증하였다.
    결과적으로 SEG-SQL은 자연어 유사도 기반 접근이 가진 한계를 넘어, SQL 구조의 형식적 특징을 직접 활용하여 문맥 학습 기반 Text-to-SQL의 정확도와 안정성을 모두 향상시킨다. 본 연구는 LLM이 구조적 정보를 이해하고 활용할 수 있도록 하는 새로운 예제 생성 패러다임을 제시하였으며, 향후 구조 기반 프롬프트 설계 및 자동 예제 생성 연구의 기반을 제공한다.

    더보기

    다국어 초록 (Multilingual Abstract) kakao i 다국어 번역

    Text-to-SQL aims to translate natural language questions into executable SQL queries, enabling users to interact with databases without domain-specific expertise. Recent advances in large language models (LLMs) have substantially improved this task through In-Context Learning (ICL), where a few examples are provided within the prompt. However, existing example selection methods rely primarily on the semantic similarity between natural language questions, which fails to ensure structural similarity between their corresponding SQL queries. As a result, when the target query involves complex joins, nested subqueries, or multi-level aggregations—especially in realistic benchmarks such as BIRD—models often fail to retrieve structurally relevant examples, leading to severe performance degradation.
    To address this limitation, we propose SEG-SQL (Structure-aware Example Generation for Text-to-SQL), a novel framework that generates structure-aligned examples for ICL. SEG-SQL first generates an initial SQL query from a given question and encodes its structural characteristics into a Hint Vector, a 40-bit binary representation summarizing SQL components such as clauses, joins, subqueries, and conditions. By mutating a subset of bits—particularly those corresponding to frequently mispredicted structures—SEG-SQL produces pseudo SQLs that are structurally similar yet diverse. Each pseudo SQL is then converted into a consistent natural language question via a SQL-to-Text generation process using an LLM, resulting in diverse NL-SQL pairs that reflect both semantic fidelity and structural consistency.
    Experimental results on the BIRD benchmark demonstrate that SEG-SQL consistently outperforms existing ICL-based approaches. Specifically, it achieves 2.5% and 3.4% higher execution accuracy than CHESS and OpenSearch-SQL, respectively, under the same experimental settings. In the most challenging subset, where structurally similar examples are scarce, SEG-SQL yields 30.0% and 62.2% improvements, showing robust performance even in complex schema environments. Moreover, we observe that expanding the dimensionality of the Hint Vector leads to gradual accuracy gains, indicating that richer structural representations help LLMs better reason about SQL generation.
    Overall, SEG-SQL moves beyond natural-language similarity and introduces a structure-driven paradigm for example generation in Text-to-SQL. By leveraging the asymmetry between SQL-to-Text and Text-to-SQL tasks, it enables LLMs to internalize SQL structures more effectively, enhancing both accuracy and robustness. This work provides a new perspective on structure-aware prompt design and automated example construction for LLM-based database reasoning.
    번역하기

    Text-to-SQL aims to translate natural language questions into executable SQL queries, enabling users to interact with databases without domain-specific expertise. Recent advances in large language models (LLMs) have substantially improved this task th...

    Text-to-SQL aims to translate natural language questions into executable SQL queries, enabling users to interact with databases without domain-specific expertise. Recent advances in large language models (LLMs) have substantially improved this task through In-Context Learning (ICL), where a few examples are provided within the prompt. However, existing example selection methods rely primarily on the semantic similarity between natural language questions, which fails to ensure structural similarity between their corresponding SQL queries. As a result, when the target query involves complex joins, nested subqueries, or multi-level aggregations—especially in realistic benchmarks such as BIRD—models often fail to retrieve structurally relevant examples, leading to severe performance degradation.
    To address this limitation, we propose SEG-SQL (Structure-aware Example Generation for Text-to-SQL), a novel framework that generates structure-aligned examples for ICL. SEG-SQL first generates an initial SQL query from a given question and encodes its structural characteristics into a Hint Vector, a 40-bit binary representation summarizing SQL components such as clauses, joins, subqueries, and conditions. By mutating a subset of bits—particularly those corresponding to frequently mispredicted structures—SEG-SQL produces pseudo SQLs that are structurally similar yet diverse. Each pseudo SQL is then converted into a consistent natural language question via a SQL-to-Text generation process using an LLM, resulting in diverse NL-SQL pairs that reflect both semantic fidelity and structural consistency.
    Experimental results on the BIRD benchmark demonstrate that SEG-SQL consistently outperforms existing ICL-based approaches. Specifically, it achieves 2.5% and 3.4% higher execution accuracy than CHESS and OpenSearch-SQL, respectively, under the same experimental settings. In the most challenging subset, where structurally similar examples are scarce, SEG-SQL yields 30.0% and 62.2% improvements, showing robust performance even in complex schema environments. Moreover, we observe that expanding the dimensionality of the Hint Vector leads to gradual accuracy gains, indicating that richer structural representations help LLMs better reason about SQL generation.
    Overall, SEG-SQL moves beyond natural-language similarity and introduces a structure-driven paradigm for example generation in Text-to-SQL. By leveraging the asymmetry between SQL-to-Text and Text-to-SQL tasks, it enables LLMs to internalize SQL structures more effectively, enhancing both accuracy and robustness. This work provides a new perspective on structure-aware prompt design and automated example construction for LLM-based database reasoning.

    더보기

    목차 (Table of Contents)

    • 제1장 서 론 1
    • 제2장 사전 지식 및 관련 연구 7
    • 1. Text-to-SQL 7
    • 2. Text-to-SQL과 In-Context Learning 9
    • 제3장 제안 방법 12
    • 제1장 서 론 1
    • 제2장 사전 지식 및 관련 연구 7
    • 1. Text-to-SQL 7
    • 2. Text-to-SQL과 In-Context Learning 9
    • 제3장 제안 방법 12
    • 1. 전처리 단계 14
    • 2. 초기 SQL 생성 단계 14
    • 1) 정보 검색 15
    • 2) 스키마 선택 15
    • 3) 초기 SQL 생성 16
    • 3. SQL-to-Text 기반 예제 생성 단계 17
    • 1) 힌트 벡터와 벡터 변형 기반 SQL 생성 17
    • 2) SQL-to-Text 19
    • 4. 최종 SQL 생성 단계 20
    • 제4장 실험 및 결과 21
    • 1. 실험 환경 21
    • 2. 실험 및 평가 25
    • 1) 전체 성능 평가 26
    • 2) 목표 쿼리와 후보 예제 간 유사도 분석 28
    • 3) SQL-to-Text 정확도 29
    • 4) 힌트 벡터 비트 수에 따른 성능 평가 31
    • 5) 사례 분석 33
    • 제5장 결론 35
    더보기

    분석정보

    View

    상세정보조회

    0

    Usage

    원문다운로드

    0

    대출신청

    0

    복사신청

    0

    EDDS신청

    0

    동일 주제 내 활용도 TOP

    더보기

    주제

    연도별 연구동향

    연도별 활용동향

    연관논문

    연구자 네트워크맵

    공동연구자 (7)

    유사연구자 (20) 활용도상위20명

    해외이동버튼