Recent database systems have introduced semantic operators that leverage large language models (LLMs) to filter, join, and project over structured data using natural language predicates. In practice, these operators are combined with traditional relational operators, e.g., equi-joins, producing hybrid query plans whose execution cost depends on both expensive LLM calls and conventional database processing. A key optimization question is where to place each semantic operator relative to the relational operators in the plan: placing them earlier reduces the data that subsequent operators process, but requires more LLM calls; placing them later reduces LLM calls through deduplication, but forces relational operators to process larger intermediate data. Existing systems either ignore this placement question or apply simple heuristics without considering the full cost trade-off. We present PLOP, a plan-level optimizer for hybrid semantic-relational queries. PLOP reduces hybrid query planning to semantic filter placement via two equivalence-preserving rewrites. We prove that deferring all semantic filters to the latest possible position minimizes LLM invocations under function caching, but show that this can cause relational processing costs to dominate on complex multi-table queries. To balance LLM cost against relational cost, PLOP uses a dynamic-programming-based cost model that finds the placement minimizing their weighted sum. On 44 semantic SQL queries across five schemas and two benchmarks, PLOP achieves up to 1.5$\times$ speedup and 4.29$\times$ cost reduction while maintaining high output quality: an average F1 of 0.85 against the unoptimized baseline and 0.84 against human-annotated ground truth on SemBench. Overall, PLOP achieves a significant cost reduction while preserving the highest accuracy among six publicly available systems.


翻译:摘要:近期数据库系统引入了语义算子,这些算子利用大语言模型(LLMs)通过自然语言谓词对结构化数据进行过滤、连接和投影操作。在实际应用中,这些算子与传统关系算子(如等值连接)结合,形成混合查询计划,其执行代价同时依赖于昂贵的LLM调用和常规数据库处理。一个关键的优化问题在于如何将每个语义算子放置在计划中相对于关系算子的位置:提前放置可减少后续算子处理的数据量,但需增加LLM调用次数;延后放置可通过去重减少LLM调用,但会迫使关系算子处理更大的中间数据。现有系统要么忽略这一放置问题,要么采用不考虑完整代价权衡的简单启发式方法。我们提出PLOP,一种面向混合语义-关系查询的计划级优化器。PLOP通过两种保持等价性的重写规则,将混合查询规划问题简化为语义过滤器的放置问题。我们证明,在函数缓存机制下,将所有语义过滤器推迟至可能的最新位置可最小化LLM调用次数,但同时也表明这种做法可能使复杂多表查询中的关系处理代价占据主导地位。为平衡LLM代价与关系代价,PLOP采用基于动态规划的代价模型,以找到最小化二者加权和的最优放置方案。在涵盖五个模式与两个基准测试的44个语义SQL查询中,PLOP在保持高输出质量的同时,实现了最高1.5倍的加速比与4.29倍的代价降低:在SemBench上,其平均F1分数相对于未优化基线为0.85,相对于人工标注真值为0.84。总体而言,PLOP在六种公开系统中取得了显著代价降低,同时保持了最优准确率。

0
下载
关闭预览

相关内容

大语言模型时代的城市计算
专知会员服务
21+阅读 · 2025年4月4日
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
《将大型语言模型(LLM)整合到海军作战规划中》
专知会员服务
130+阅读 · 2024年6月13日
基于大语言模型的复杂任务自主规划处理框架
专知会员服务
102+阅读 · 2024年4月12日
知识在检索式对话系统的应用
微信AI
32+阅读 · 2018年9月20日
推荐系统算法合集,满满都是干货(建议收藏)
七月在线实验室
17+阅读 · 2018年7月23日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
关系推理:基于表示学习和语义要素
计算机研究与发展
19+阅读 · 2017年8月22日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
VIP会员
最新内容
以色列-美国-伊朗战争中的无人机:关键要点
专知会员服务
1+阅读 · 今天14:04
《Palantir任务保障性软件安全标准(MA-S2)》
专知会员服务
5+阅读 · 今天13:49
基于声学的无人机检测技术综述
专知会员服务
3+阅读 · 今天13:37
《当代混合战争分析框架:俄乌战争经验教训》
专知会员服务
4+阅读 · 今天13:11
战略前沿人工智能的再思考(中文)
专知会员服务
7+阅读 · 5月29日
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
5+阅读 · 5月29日
“史诗怒火行动”中美军损失的作战飞机
专知会员服务
6+阅读 · 5月29日
ICML 2026 | 理解上下文持续学习中的泛化与遗忘
专知会员服务
5+阅读 · 5月28日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员