Larch: 의미 술어를 위한 학습 기반 질의 최적화
Larch: Learned Query Optimization for Semantic Predicates
한국어 초록
거대 언어 모델(LLM)의 등장으로 많은 데이터베이스 시스템이 비정형 데이터(예: 텍스트, 이미지, 비디오)에 대한 분석 질의를 가능하게 하는 의미 연산자를 도입하였다. 의미 연산자는 일반적으로 추론 비용과 지연 시간이 높아 의미 기반(AI) SQL 질의를 대규모 데이터셋에 적용하기 어렵다. 동시에 의미 연산자의 의미적 성격 때문에 데이터베이스 엔진은 이를 블랙박스로 취급하므로 AISQL 질의를 최적화하기 어렵다. 본 논문에서는 AI SQL 질의에서 의미 필터의 실행을 최적화하는 프레임워크 Larch를 소개한다. Larch는 두 가지 핵심 관찰에서 착안하였다. i) 의미 연산자의 높은 지연 시간은 계산량이 큰 런타임 최적화 기법을 적용할 여지를 크게 남긴다. ii) 비정형 데이터에는 보통 임베딩 형태의 의미 정보가 수반되어 AI_FILTER 프롬프트와 데이터 값 간의 효율적인 의미 비교가 가능하다. 이 두 관찰에 기반하여 두 가지 Larch 변형인 Larch-A2C와 Larch-Sel을 제시한다. Larch-A2C는 임베딩으로 증강한 게이트 그래프 신경망으로 임의의 의미 필터 표현식 트리를 인코딩하고, 필터 평가 순서를 마르코프 결정 과정으로 정식화한다. 반면 Larch-Sel은 지도 학습 모델로 필터 선택도를 예측한 뒤 동적 계획법을 적용하여 각 입력 행에 대한 준최적 평가 순서를 찾는다. 다양한 실제 데이터셋과 포괄적인 합성 워크로드에서 평가한 결과, 두 Larch 변형 모두 모든 데이터셋과 워크로드에서 토큰 사용량 측면에서 기존 의미 필터 최적화 기법을 항상 능가한다. 이러한 결과는 Larch가 텍스트와 이미지 모달리티에 걸친 다양한 워크로드에서 견고하며, Palimpzest 및 Quest 대비 총 토큰 비용이 6%~30% 낮고 토큰 비용 오버헤드가 3배~19배 낮음을 보여 준다.
원문 초록
With the advent of Large Language Models (LLMs), many database systems introduced semantic operators that enabled analytical queries over unstructured data (e.g. text, images, videos). Semantic operators typically incur high inference costs and latencies making semantic (AI) SQL queries challenging to apply on large scale datasets. At the same time, their semantic nature leads database engines to treat them as black boxes, making AISQL queries difficult to optimize. In this paper, we introduce Larch, a framework for optimizing the execution of semantic filters in AI SQL queries. Larch was inspired by two key observations: i) the high latency of semantic operators leaves significant room for computationally-heavy runtime optimization techniques, ii) unstructured data are typically accompanied by semantic information in the form of embeddings allowing for efficient semantic comparisons between AI_FILTER prompts and data values. Based on these two key observations, we present two Larch variants: Larch-A2C and Larch-Sel. Larch-A2C encodes arbitrary semantic filters expression tree using an embedding-augmented Gated Graph Neural Network and formulates the filter evaluation order as a Markov decision process. In contrast, Larch-Sel leverages a supervised learning model to predict filter selectivities, subsequently applying dynamic programming to find a near-optimal evaluation order for each input row. Evaluated across diverse real-world datasets and comprehensive synthetic workloads, both Larch variants always outperform existing semantic filter optimization techniques in terms of token usage on every dataset and workload. Our results demonstrate that Larch is robust across diverse workloads across text and image modalities, 6%--30% lower total token costs and 3x--19x lower token costs overhead than Palimpzest and Quest.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
- arXiv:2606.07923v2제출 시각 미확인
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.