SQL-PaLM: 텍스트-투-SQL을 위한 개선된 대규모 언어 모델 적응
SQL-PaLM: Improved Large Language ModelAdaptation for Text-to-SQL
May 26, 2023
저자: Ruoxi Sun, Sercan O Arik, Hootan Nakhost, Hanjun Dai, Rajarishi Sinha, Pengcheng Yin, Tomas Pfister
cs.AI
초록
대규모 언어 모델(LLM)의 인상적인 창발적 능력 중 하나는 데이터베이스를 위한 구조화 질의 언어(SQL)를 포함한 코드 생성입니다. 자연어 텍스트를 SQL 쿼리로 변환하는 작업인 Text-to-SQL에서 LLM의 적응은 사용된 적응 데이터의 양에 따라 컨텍스트 내 학습과 미세 조정 설정 모두에서 매우 중요합니다. 본 논문에서는 PaLM-2를 기반으로 한 LLM 기반 Text-to-SQL 모델인 SQL-PaLM을 제안하며, 이는 두 설정 모두에서 최첨단 기술을 한 단계 더 끌어올립니다. 소수 샷 SQL-PaLM은 Text-to-SQL을 위해 설계된 실행 기반 자기 일관성 프롬프팅 접근 방식을 기반으로 하며, Spider 데이터셋에서 테스트 스위트 정확도 77.3%를 달성했습니다. 이는 우리가 아는 한, 미세 조정을 통해 이전 최첨단 기술을 상당한 차이인 4%로 능가한 첫 번째 사례입니다. 더 나아가, 미세 조정된 SQL-PaLM이 이를 또 다른 1% 더 능가함을 보여줍니다. SQL-PaLM을 실제 시나리오에 적용하기 위해 우리는 Spider의 다른 도전적인 변형에 대한 견고성을 추가로 평가하고 SQL-PaLM의 우수한 일반화 능력을 입증합니다. 또한, 다양한 사례 연구를 통해 LLM 기반 Text-to-SQL의 인상적인 지능적 능력과 다양한 성공 요인을 입증합니다.
English
One impressive emergent capability of large language models (LLMs) is
generation of code, including Structured Query Language (SQL) for databases.
For the task of converting natural language text to SQL queries, Text-to-SQL,
adaptation of LLMs is of paramount importance, both in in-context learning and
fine-tuning settings, depending on the amount of adaptation data used. In this
paper, we propose an LLM-based Text-to-SQL model SQL-PaLM, leveraging on
PaLM-2, that pushes the state-of-the-art in both settings. Few-shot SQL-PaLM is
based on an execution-based self-consistency prompting approach designed for
Text-to-SQL, and achieves 77.3% in test-suite accuracy on Spider, which to our
best knowledge is the first to outperform previous state-of-the-art with
fine-tuning by a significant margin, 4%. Furthermore, we demonstrate that the
fine-tuned SQL-PALM outperforms it further by another 1%. Towards applying
SQL-PaLM to real-world scenarios we further evaluate its robustness on other
challenging variants of Spider and demonstrate the superior generalization
capability of SQL-PaLM. In addition, via extensive case studies, we demonstrate
the impressive intelligent capabilities and various success enablers of
LLM-based Text-to-SQL.