arXiv:2604.00660cs.DBcs.AI2026-04被引 3

让复杂SQL查询更快:用智能分流减少大模型调用次数

Streaming Model Cascades for Semantic SQL

论文配图:Streaming Model Cascades for Semantic SQL
图 1 · 摘自论文原文
  • 设计流式处理的分级模型,按置信度分流数据,只对不确定行调用昂贵大模型
  • 在6个真实任务中实现F1≥0.95,比现有方法少最多58%的大模型调用
  • 支持高精度和高召回同时达标,适合对准确率和效率都有要求的生产系统

现代数据仓库将语义操作扩展至每行调用大语言模型,导致单行推理成本远高于传统SQL。模型级联通过快速代理模型处理大部分数据,仅将不确定行交由昂贵的权威模型处理,从而降低成本。以往的SUPG型级联需全局代理分数扫描,自身成为大模型推理瓶颈,并阻塞流水线执行;且仅优化精度或召回,无法兼顾两者。本文针对流式语义SQL中的级联路由问题,提出两种互补算法。SUPG-IT通过多批次迭代优化双阈值,在累积权威标签的基础上实现联合概率保证,首次在选定失败概率δ下满足用户指定的精度与召回目标。GAMCAL引入单一权衡参数α,学习单调广义可加模型,将代理得分校准为真实阳性概率,并提供点级不确定性以支持随机路由。在生产环境语义SQL引擎上的六个分类、过滤与连接基准测试中,二者均达到最高F1≥0.95。GAMCAL在20%委托预算下全面领先,相比LOTUS的SUPG级联减少最多58%的权威调用;SUPG-IT取得最佳表现,六数据集平均F1达0.989。

原文摘要 · Abstract (English)

Modern data warehouses extend SQL with semantic operators that invoke large language models on each qualifying row, making per-row inference orders of magnitude more expensive than traditional SQL. Model cascades reduce this cost by routing most rows through a fast proxy model and delegating uncertain cases to an expensive oracle. Prior SUPG-style cascades, however, require a global proxy-score pass that is itself an LLM-inference workload and blocks output in pipelined query engines. They also target either precision or recall and cannot serve workloads that need both. We formalize the cascade routing problem for streaming semantic SQL with independent parallel workers and present two complementary algorithms within this model. SUPG-IT extends SUPG from single-pass, single-metric estimation to streaming execution by iteratively refining two thresholds as oracle labels accumulate across batches, and is the first streaming cascade with joint probabilistic guarantees on user-specified precision and recall at a chosen failure probability $δ$. GAMCAL replaces user-specified targets with a single tradeoff parameter $α$ between classification error and oracle cost, and learns a monotone Generalized Additive Model that calibrates proxy scores to true-positive probabilities and supplies pointwise uncertainty for stochastic routing. On six classification, filtering, and join benchmarks evaluated in a production semantic SQL engine, both algorithms reach $F_1 \geq 0.95$ at their best operating points. GAMCAL also leads all six datasets at a 20% delegation budget and reaches $F_1 \geq 0.95$ with up to 58% fewer oracle calls than LOTUS's SUPG cascade. SUPG-IT attains the highest best-case $F_1$, with a mean of 0.989 across the six datasets.

语义查询模型级联大模型优化高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。