arXiv cs.AI· Fuheng Zhao, Pawel Liskowski, Zihan Li, Benjamin Han, Puxuan Yu, Varich Boonsanong, Dimitris Tsirogiannis, Anupam Datta·· 4 小时前AI 评分36
Larch:面向语义谓词的学习式查询优化框架
Larch: Learned Query Optimization for Semantic Predicates
AI 导读
arXiv 论文提出 Larch,一个优化 AI SQL 查询中语义过滤器执行的框架,包含两个变体:Larch-A2C 用嵌入增强的 Gated Graph Neural Network 将过滤评估顺序建模为马尔可夫决策过程,Larch-Sel 用监督学习预测过滤选择性并用动态规划求近优顺序。
正文 · 原文
Abstract: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.
| Subjects: | Databases (cs.DB); Artificial Intelligence (cs.AI); Machine Learning (cs.LG) |
| Cite as: | arXiv:2606.07923 [cs.DB] |
| (or arXiv:2606.07923v2 [cs.DB] for this version) | |
| https://doi.org/10.48550/arXiv.2606.07923 arXiv-issued DOI via DataCite |
Submission history
From: Fuheng Zhao [view email]
[v1]
Sat, 6 Jun 2026 01:16:58 UTC (1,335 KB)
[v2]
Thu, 12 Nov 2026 20:50:29 UTC (1,620 KB)
来源:arXiv cs.AI · arxiv.org