arXiv:2606.29532cs.DBcs.AI2026-06

用AI智能选策略,让自然语言查表更快更省。

SemJoin: Semantic Join Optimization

论文配图:SemJoin: Semantic Join Optimization
图 1 · 摘自论文原文
  • 让大模型当参谋,自动选最优匹配策略。
  • 在多个数据集上比现有方法高20-33点准确率。
  • 适合需要高效处理自然语言查询的数据库场景。

将非结构化数据融入关系型数据库系统的需求日益增长,支持自然语言查询与分析。语义连接(semantic join)通过大语言模型(LLM)根据自然语言谓词连接两个表,但逐对比较需执行 O(M × N) 次 LLM 调用,大规模下成本过高。现有系统虽降低开销,但通常采用单一固定策略(如嵌入相似度或批量处理),无视数据特征与查询谓词差异。本文提出基于 LLM 代理的决策流水线,根据表的特性动态选择执行策略:聚类连接(Cluster Join)通过无监督嵌入聚类和样本过滤减少候选;分类器策略适用于可归约至共享离散标签集的谓词。在 IMDb 评论、邮件矛盾、Stack Overflow 标签三个异构数据集上,该顾问始终为每项任务选出最优策略。动态路由效果显著:相比自适应分块连接(ABJ),F1 提升 20–33 点,且在其中两个数据集消耗更少令牌;相较特征分解连接(FDJ),F1 更高,同时令牌消耗低一到两个数量级。

原文摘要 · Abstract (English)

Integrating unstructured data into relational database systems is increasingly important as demand grows for natural language querying and analysis. A semantic join, joining two tables under a natural-language predicate, can be evaluated with a large language model (LLM), but comparing every pair of tuples requires O(M x N) LLM invocations and is cost-prohibitive at scale. Existing systems reduce this cost but typically commit to a single fixed strategy (e.g., embedding similarity or one batched scheme) regardless of the data or the join predicate. We propose an LLM-agent-based decision pipeline that optimizes semantic joins by matching the execution strategy to the characteristics of the underlying tables. An LLM advisor routes each join to one of two strategies: a Cluster Join, which prunes candidates via unsupervised embedding clustering and sample-based filtering, or a Classifier strategy for predicates that reduce to a shared discrete label set. Across three diverse datasets (IMDb reviews, email contradictions, and Stack Overflow tags), the advisor consistently identifies the optimal execution strategy for each workload. This dynamic routing proves decisive: it outperforms adaptive block join (ABJ) by 20-33 F1 points across all datasets while consuming fewer tokens on two of the three, and achieves higher F1 scores than featurized-decomposition join (FDJ) at one to two orders of magnitude lower token cost.

语义连接大模型优化数据库

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