Larch: Learned Query Optimization for Semantic Predicates
Not on the map. Why?
Abstract (arXiv)
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. Our results demonstrate that Larch is robust across diverse workloads, reducing total token cost overhead by 3x-19x compared to Palimpzest and Quest.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 23 of its 68 references that are in the map. First posted on arXiv 6 Jun 2026.
Builds on
23 of 68 references.
References · 23
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2016Layer Normalizationcited by 5,669
- 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 5,045
- 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,375
- 2023FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performancecited by 853
- 2014Distributed Representations of Sentences and Documentscited by 678
- 2019BIGPATENT: A Large-Scale Dataset for Abstractive and Coherent Summarizationcited by 156
- 2018Learning Scheduling Algorithms for Data Processing Clusterscited by 134
- 2017PubMed 200k RCT: a Dataset for Sequential Sentence Classification in Medical Abstractscited by 124
- 2024Arctic-Embed 2.0: Multilingual Retrieval Without Compromisecited by 58
- 2024Semantic Operators: A Declarative Model for Rich, AI-based Data Processingcited by 34
11 more
- 2024Answer is All You Need: Instruction-following Text Embedding via Answering the Questioncited by 27
- 2024BlendSQL: A Scalable Dialect for Unifying Hybrid Question Answering in Relational Algebracited by 24
- 2019SkinnerDB: Regret-Bounded Query Evaluation via Reinforcement Learningcited by 17
- 2020Approximate Selection with Guarantees using Proxiescited by 15
- 2025Cortex AISQL: A Production SQL Engine for Unstructured Datacited by 11
- 2025QUEST: Query Optimization in Unstructured Document Analysiscited by 10
- 2024CascadeServe: Unlocking Model Cascades for Inference Servingcited by 4
- 2025Making Prompts First-Class Citizens for Adaptive LLM Pipelinescited by 3
- 2025ScaleDoc: Scaling LLM-based Predicates over Large Document Collectionscited by 3
- 2026Streaming Model Cascades for Semantic SQLcited by 3
- 2025A Case for Computing on Unstructured Datacited by 2
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026Compositional Online Learning for Semantic Data Processing Systemscited by 0
- 2026When Plans Change Answers: Formalizing Cost-Accuracy Optimization for Semantic Queriescited by 0
- 2026Semantic Views: Certified Reuse of LLM Labels Across Semantic Queriescited by 0
- 2026Same Query, Different Answer: Run-to-Run Variance in Semantic Query Processingcited by 0
- 2026Same Query, Different Answer: Run-to-Run Variance in Semantic Query Processing9 Oct 2026
- 2026Semantic Views: Certified Reuse of LLM Labels Across Semantic Queries8 Oct 2026
- 2026When Plans Change Answers: Formalizing Cost-Accuracy Optimization for Semantic Queries6 Oct 2026
- 2026Compositional Online Learning for Semantic Data Processing Systems27 Aug 2026