当计划改变答案时:语义查询的成本-准确性优化的形式化
When Plans Change Answers: Formalizing Cost-Accuracy Optimization for Semantic Queries
浏览论文内容
中文总结 AI 辅助
针对语义查询引擎中错误传播问题,提出成本-准确性优化的形式化定义,基于校准置信度计算预期输出质量,并分析计划等价性与优化复杂性。
中文摘要 AI 辅助
在语义查询引擎中,谓词由机器学习模型评估,查询计划的选择不仅影响查询的成本,还影响其结果。现有系统要么对每个语义算子应用固定阈值,要么针对每个算子调整准确性,而没有考虑错误如何通过连接传播。我们为这类查询的成本-准确性优化给出了一个正式的问题定义。我们的出发点是决策模型(如Jev)对每个决策附加的校准置信度。它为每个决策产生一个预期误差;通过每个决策对输出的贡献(在最简单的情况下,即其扇出)对这些误差进行加权,即可在没有任何标注数据的情况下得出计划的预期输出质量,而反向的相同计算则将输出级别的准确性目标转化为每个基础或中间元组的价格。在此基础上,我们定义了带有语义算子的关系代数的oracle语义,物理计划作为逻辑计划和决策策略的对,声明性的输出级别目标,以及计划等价性的层次结构。我们表明,在逐点确定性策略下,准确性是计划不变的,并且当升级带在计划自身的候选上校准时,选择下推不是质量可靠的。在袋语义下,预期质量可以在多项式时间内计算;在集合语义下,当每个关系都带有语义谓词时,它遵循元组独立概率数据库的二分类。选择要丢弃的元组是NP难的,而优化问题通过两个拉格朗日乘子分解为每个元组的决策。在合成工作负载上的模拟说明了这些效果;在真实引擎上的评估留待未来工作。
英文摘要
In semantic query engines, predicates are evaluated by machine-learned models, and the choice of a query plan affects not only the cost of a query but also its result. Existing systems either apply a fixed threshold to each semantic operator or tune accuracy per operator, without accounting for how errors propagate through joins. We give a formal problem definition for cost-accuracy optimization of such queries. Our starting point is the calibrated confidence that decision models such as Jev attach to each decision. It yields an expected error for every decision; weighting these errors by each decision's contribution to the output (in the simplest case, its fan-out) gives the expected output quality of a plan without any labeled data, and the same computation in reverse turns an output-level accuracy target into a price on each base or intermediate tuple. Building on this, we define an oracle semantics for relational algebra with semantic operators, physical plans as pairs of a logical plan and a decision policy, declarative output-level targets, and a hierarchy of plan equivalence. We show that accuracy is plan-invariant under pointwise-deterministic policies, and that selection pushdown is not quality-sound when escalation bands are calibrated on the plan's own candidates. Expected quality can be computed in polynomial time under bag semantics; under set semantics it follows the dichotomy of tuple-independent probabilistic databases when every relation carries a semantic predicate. Choosing which tuples to drop is NP-hard, while the optimization problem decomposes into per-tuple decisions through two Lagrange multipliers, and, with what we call confidence-centric skipping, tuples that can no longer affect the target are skipped without being scored. Simulations on a synthetic workload illustrate these effects; an evaluation on real engines is left for future work.
发表机构
- KAIST(韩国科学技术院)
机构由 AI 辅助整理,请以论文原文为准。