Skip to main content
QUICK REVIEW

[논문 리뷰] Text2SQL is Not Enough: Unifying AI and Databases with TAG

A. Biswal, Liana Patel|arXiv (Cornell University)|2024. 08. 27.
Semantic Web and OntologiesComputer Science인용 수 3
한 줄 요약

이 논문은 복잡한 자연어 질의를 해결하기 위해 대규모 언어 모델(Large Language Models, LLMs)과 관계형 데이터베이스 관리 시스템을 통합하는 통합 프레임워크인 테이블 보강 생성(Table-Augmented Generation, TAG)을 소개한다. 이는 세계 지식, 의미적 추론 또는 데이터 집계가 필요한 질문에 대응한다. Text2SQL이나 RAG와 달리, TAG는 세 단계의 파이프라인—질의 생성, 데이터베이스 실행, 답변 생성—을 사용하며, 어려운 질의에서 기존 기준 대비 최대 65% 높은 정확도를 달성한다. 이는 인공지능과 데이터베이스 통합 분야에서 중요한 연구 기회를 시사한다.

ABSTRACT

AI systems that serve natural language questions over databases promise to unlock tremendous value. Such systems would allow users to leverage the powerful reasoning and knowledge capabilities of language models (LMs) alongside the scalable computational power of data management systems. These combined capabilities would empower users to ask arbitrary natural language questions over custom data sources. However, existing methods and benchmarks insufficiently explore this setting. Text2SQL methods focus solely on natural language questions that can be expressed in relational algebra, representing a small subset of the questions real users wish to ask. Likewise, Retrieval-Augmented Generation (RAG) considers the limited subset of queries that can be answered with point lookups to one or a few data records within the database. We propose Table-Augmented Generation (TAG), a unified and general-purpose paradigm for answering natural language questions over databases. The TAG model represents a wide range of interactions between the LM and database that have been previously unexplored and creates exciting research opportunities for leveraging the world knowledge and reasoning capabilities of LMs over data. We systematically develop benchmarks to study the TAG problem and find that standard methods answer no more than 20% of queries correctly, confirming the need for further research in this area. We release code for the benchmark at https://github.com/TAG-Research/TAG-Bench.

연구 동기 및 목표

  • 기존의 Text2SQL 및 검색 보강 생성(Retrieval-Augmented Generation, RAG) 방법의 한계를 해결하기 위해, 데이터베이스 스키마 외부의 세계 지식이나 데이터 기반 의미적 추론이 필요한 자연어 질의를 처리하지 못하는 문제를 해결한다.
  • 사용자 정의 데이터 소스에서 더 일반적이고 강력한 질문-응답을 가능하게 하기 위해 LLM과 데이터베이스 시스템을 통합하는 통합적 패러다임인 테이블 보강 생성(Table-Augmented Generation, TAG)을 제안한다.
  • 새로운 벤치마크를 통해 TAG 문제를 체계적으로 평가하여, 현재의 방법들이 최대 20% 이하의 질의만 정확하게 답변하고 있음을 드러낸다.
  • 수작업으로 작성된 TAG 파이프라인은 기준 대비 최대 65% 높은 정확도를 달성함으로써 이 접근 방식의 가능성과 잠재력을 입증하고, 향후 연구를 촉진한다.

제안 방법

  • TAG는 세 단계 파이프라인을 정의한다: (1) 질의 생성은 자연어 요청 R을 LLM을 사용해 실행 가능한 데이터베이스 질의 Q로 변환한다.
  • 질의 실행 단계(exec)는 데이터베이스 시스템에서 Q를 실행하여 관련 데이터 T를 추출한다. 이 과정은 DBMS의 정확한 계산 및 필터링 능력을 활용한다.
  • 답변 생성 단계(gen)는 원본 요청 R과 추출된 데이터 T를 모두 활용하여 LLM을 통해 자연어 답변 A를 생성한다. 이는 의미적 추론과 세계 지식의 활용을 가능하게 한다.
  • 이 프레임워크는 Text2SQL과 RAG를 특수한 케이스로 일반화하며, 추론, 집계, 외부 지식을 포함한 더 넓은 범위의 질의를 가능하게 한다.
  • LLM을 데이터 기반으로 반복적 또는 재귀적으로 조율할 수 있도록 지원하여 대규모 데이터셋에서 복잡한 추론을 수행할 수 있다.
  • 효율적인 배치 추론을 고려하여 설계되었으며, 평가 과정에서 낮은 실행 시간이 관찰되었다.
Figure 1 . An example TAG implementation for answering the user’s natural language question over a table about movies. The TAG pipeline proceeds in three stages: query synthesis, query execution, and answer generation
Figure 1 . An example TAG implementation for answering the user’s natural language question over a table about movies. The TAG pipeline proceeds in three stages: query synthesis, query execution, and answer generation

실험 결과

연구 질문

  • RQ1기존의 Text2SQL 및 RAG 방법은 데이터베이스 스키마 외부의 세계 지식이 필요한 자연어 질의를 효과적으로 처리할 수 있는가?
  • RQ2LLM이 데이터베이스 실행과 결합될 경우, 자유 텍스트 필드에 대한 의미적 추론이나 대규모 데이터셋의 추세 집계를 얼마나 잘 수행할 수 있는가?
  • RQ3관계 연산과 비정형 데이터 또는 외부 지식에 대한 추론을 동시에 요구하는 질의에 대해 현재의 방법들이 얼마나 잘 일반화되는가?
  • RQ4복잡하고 실제 세계 유사 질의에서 수작업으로 작성된 TAG 파이프라인과 자동화된 기준 간의 성능 격차는 어느 정도인가?
  • RQ5현재 AI-데이터베이스 통합에서 정확하고 확장 가능하며 일반적인 자연어 질문-응답을 방해하는 주요 병목 현상은 무엇인가?

주요 결과

  • 표준 Text2SQL 및 RAG 기준은 최대 20% 이하의 벤치마크 질의만 정확하게 답변한다. 이는 새로운 방법의 필요성을 시사한다.
  • 수작업으로 작성된 TAG 파이프라인은 복잡한 질의에서 기준 대비 최대 65% 높은 정확도를 달성하여 이 접근 방식의 실현 가능성과 잠재력을 입증한다.
  • RAG 기준은 세팡 인터내셔널 서킷과 같은 집계 질의에 대해 관련 데이터를 확보하지 못한다. 이는 점검 기반 검색에 의존하기 때문이다.
  • Text2SQL + LM 기준은 데이터베이스 데이터를 효과적으로 활용하지 못하며, 유일하게 매개변수 기반 지식에 의존하고 데이터 기반 분석을 제공하지 않는다.
  • 정성적 분석 결과, TAG 시스템은 대규모 데이터를 성공적으로 집계하고 맥락이 풍부한 정보성 답변을 생성할 수 있다.
  • TAG 프레임워크는 낮은 지연 시간으로 효율적인 실행을 가능하게 하여, 이 패러다임을 기반으로 확장 가능하고 생산용으로 사용 가능한 시스템을 구축할 수 있음을 시사한다.
Figure 2 . Example Aggregation Results: The RAG baseline provides an incomplete answer to the query while Text2SQL + LM fails to answer the question using any data from the DB. The Hand-written TAG baseline provides the most thorough answer, synthesizing data from the DB and its own world knowledge.
Figure 2 . Example Aggregation Results: The RAG baseline provides an incomplete answer to the query while Text2SQL + LM fails to answer the question using any data from the DB. The Hand-written TAG baseline provides the most thorough answer, synthesizing data from the DB and its own world knowledge.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.