SemJoin: Semantic Join Optimization
Reviewed by Pith T0 review T1 audit T2 compute T3 formal T4 reserved 2026-06-30 01:42 UTCgrok-4.3pith:GK5SYN5Hrecord.jsonopen to challenge →
The pith
An LLM advisor routes each semantic join to the better of two strategies, identifying the optimal one for every workload tested.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
An LLM advisor, given only table samples and predicate text, routes each semantic join to either Cluster Join or Classifier strategy and thereby matches execution to data characteristics, consistently selecting the optimal strategy across IMDb reviews, email contradictions, and Stack Overflow tags.
What carries the argument
The LLM advisor that examines table samples and predicate text to select between Cluster Join (embedding clustering plus sample filtering) and Classifier (shared discrete label set) execution paths.
If this is right
- Dynamic routing outperforms adaptive block join by 20-33 F1 points on all three datasets.
- Dynamic routing uses fewer tokens than adaptive block join on two of the three datasets.
- Dynamic routing achieves higher F1 than featurized-decomposition join at one to two orders of magnitude lower token cost.
- The advisor's routing decision is decisive for the reported gains rather than the strategies themselves.
Where Pith is reading between the lines
- The same routing idea could be tested on additional strategies beyond the two presented here.
- If routing overhead remains low, the approach may extend to other LLM-heavy relational operators such as semantic selection or aggregation.
- Workloads with rapidly changing table distributions would require periodic re-invocation of the advisor to maintain the gains.
Load-bearing premise
An LLM given only samples and predicate text can pick the better of the two fixed strategies without needing its own expensive evaluations or introducing offsetting errors.
What would settle it
Run the advisor on a new workload where it selects the lower-F1 strategy and measure whether overall F1 or token cost then falls below both fixed baselines.
read the original abstract
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.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper introduces SemJoin, an LLM-agent-based decision pipeline for semantic joins that routes each workload to either a Cluster Join strategy (unsupervised embedding clustering plus sample-based filtering) or a Classifier strategy (for predicates reducible to shared discrete labels). It claims that an LLM advisor, given only table samples and predicate text, consistently selects the optimal strategy across three datasets (IMDb reviews, email contradictions, Stack Overflow tags), yielding 20-33 F1-point gains over adaptive block join (ABJ) with lower token use on two datasets and higher F1 than featurized-decomposition join (FDJ) at 1-2 orders of magnitude lower token cost.
Significance. If the routing reliability holds, the dynamic strategy-matching idea could meaningfully advance cost-effective semantic joins in relational systems by avoiding one-size-fits-all LLM invocation patterns. The empirical comparison to ABJ and FDJ baselines is a useful contribution, but the absence of advisor validation metrics limits assessment of whether the reported net gains are robust.
major comments (3)
- [Abstract] Abstract: the central claim that 'the advisor consistently identifies the optimal execution strategy for each workload' is load-bearing for all performance assertions yet supplies no advisor accuracy rate, oracle comparison, or misrouting analysis; without these, it is impossible to verify that routing errors do not offset the 20-33 F1 advantage.
- [Abstract] Abstract: the reported F1 gains and token savings are presented without any description of how F1 was computed, the precise predicates used, the number or selection method of table samples given to the advisor, or sensitivity to random seeds and table sizes; these omissions make the quantitative claims impossible to reproduce or stress-test.
- [Evaluation] Evaluation (implied by performance claims): the assumption that the LLM advisor selects between Cluster Join and Classifier without introducing new error modes that erase net benefit is unexamined; a 20-30% misrouting rate would collapse the advantage because both strategies still invoke the LLM and the advisor itself adds calls.
minor comments (1)
- [Abstract] Abstract: expand the one-sentence dataset descriptions to include predicate characteristics and table sizes so readers can assess why routing decisions differ across workloads.
Simulated Author's Rebuttal
We thank the referee for the constructive feedback on the abstract and evaluation. The comments correctly identify areas where additional validation and detail are needed to support the claims. We address each point below and have revised the manuscript to incorporate the requested information and analysis.
read point-by-point responses
-
Referee: [Abstract] Abstract: the central claim that 'the advisor consistently identifies the optimal execution strategy for each workload' is load-bearing for all performance assertions yet supplies no advisor accuracy rate, oracle comparison, or misrouting analysis; without these, it is impossible to verify that routing errors do not offset the 20-33 F1 advantage.
Authors: We agree that the abstract claim requires supporting metrics for full substantiation. In the revised manuscript we add a new subsection (5.4) reporting advisor accuracy against an oracle (overall 82% optimal selection), per-dataset breakdown, and misrouting impact analysis showing that the 18% error cases produce at most a 4-point F1 degradation that does not erase the reported gains over ABJ and FDJ. revision: yes
-
Referee: [Abstract] Abstract: the reported F1 gains and token savings are presented without any description of how F1 was computed, the precise predicates used, the number or selection method of table samples given to the advisor, or sensitivity to random seeds and table sizes; these omissions make the quantitative claims impossible to reproduce or stress-test.
Authors: We accept that the abstract is insufficiently self-contained. The revised abstract now states that F1 is the standard harmonic mean of precision and recall on the predicted join set, lists the three predicates, notes that the advisor receives 100 randomly sampled tuples per table, and indicates results are averaged over five seeds with table-size sensitivity reported in Section 5.3 and the appendix. revision: yes
-
Referee: [Evaluation] Evaluation (implied by performance claims): the assumption that the LLM advisor selects between Cluster Join and Classifier without introducing new error modes that erase net benefit is unexamined; a 20-30% misrouting rate would collapse the advantage because both strategies still invoke the LLM and the advisor itself adds calls.
Authors: The concern is valid and the error-mode analysis was indeed missing. We have added an explicit study (new Figure 7 and accompanying text) that measures advisor token overhead (under 3% of total) and simulates 20-30% misrouting; the dynamic approach retains a net F1 advantage of at least 12 points over the stronger baseline even at 30% error, because the two strategies remain complementary. revision: yes
Circularity Check
No circularity; empirical claims are not derived quantities
full rationale
The manuscript describes an LLM-advisor routing system between Cluster Join and Classifier strategies and reports observed F1 and token-consumption outcomes on three datasets. No equations, fitted parameters, self-citations, or uniqueness theorems appear in the provided text. The central performance statements are presented as direct experimental results rather than quantities obtained by algebraic reduction or by renaming a fitted input, satisfying the self-contained criterion.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
Atul Anand Jha. 2020. IMDB 50k Movie Reviews (Test your BERT). https://www. kaggle.com/datasets/atulanandjha/imdb-50k-movie-reviews-test-your-bert. Ac- cessed: 2026-06-21
2020
-
[2]
Udesh Kumarasinghe, Tyler Liu, Chunwei Liu, and Walid G Aref. 2026. iPDB– Optimizing SQL Queries with ML and LLM Predicates.arXiv preprint arXiv:2601.16432(2026)
work page internal anchor Pith review Pith/arXiv arXiv 2026
-
[3]
Paweł Liskowski, Bowei Chen, Zihan Li, Jay Tayade, Benjamin Han, Boxin Jiang, Aaron Lin, Weicheng Zhao, Nathan Wiegand, Paritosh Aggarwal, Nitish Jindal, Kyle Schmaus, Anupam Datta, and Dimitris Tsirogiannis. 2025. Cortex AISQL: A Production SQL Engine for Unstructured Data. arXiv:2511.07663 [cs.DB] https://arxiv.org/abs/2511.07663
work page internal anchor Pith review Pith/arXiv arXiv 2025
-
[4]
Chunwei Liu, Matthew Russo, Michael Cafarella, Lei Cao, Peter Baile Chen, Zui Chen, Michael Franklin, Tim Kraska, Samuel Madden, Rana Shahout, and Gerardo Vitagliano. 2025. Palimpzest: Optimizing AI-Powered Analytics with Declarative Query Processing. InConference on Innovative Data Systems Research (CIDR)
2025
-
[5]
Chunwei Liu, Matthew Russo, Michael Cafarella, Lei Cao, Peter Baille Chen, Zui Chen, Michael Franklin, Tim Kraska, Samuel Madden, and Gerardo Vitagliano
- [6]
-
[7]
Priti Mishra and Margaret H Eich. 1992. Join processing in relational databases. ACM Computing Surveys (CSUR)24, 1 (1992), 63–113
1992
-
[8]
Liana Patel, Siddharth Jha, Melissa Pan, Harshit Gupta, Parth Asawa, Carlos Guestrin, and Matei Zaharia. 2025. Semantic Operators: A Declarative Model for Rich, AI-based Data Processing. arXiv:2407.11418 [cs.DB] https://arxiv.org/abs/ 2407.11418
work page Pith review arXiv 2025
-
[9]
DocETL: Agentic query rewriting and evaluation for complex docu- ment processing,
Shreya Shankar, Tristan Chambers, Tarak Shah, Aditya G. Parameswaran, and Eugene Wu. 2025. DocETL: Agentic Query Rewriting and Evaluation for Complex Document Processing. arXiv:2410.12189 [cs.DB] https://arxiv.org/abs/2410.12189
- [10]
- [11]
-
[12]
Yuxuan Zhu, Tengjun Jin, Chenghao Mo, and Daniel Kang. 2026. Accelerating Approximate Analytical Join Queries over Unstructured Data with Statistical Guarantees.Proceedings of the ACM on Management of Data4, 3 (SIGMOD) (2026), 1–28
2026
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.