Source-linked AI summary

SAGE: A Unified Algebra and Self-Adaptive Execution for AI Functions in SQL

Xiangqi Wang, Nhan H. Pham, Oktie Hassanzadeh, Dharmashankar Subramanian, Xiangliang Zhang

arXiv:2608.20630v1cs.AI

TL;DR

AI scalar, aggregate, and join operators pose different execution challenges that fixed cascades do not address well. SAGE unifies them with three typed primitives and role-specific strategies, achieving best or tied-best updated-join quality except on Q5 and a 358× measured cost reduction on a representative factorable join.

  • Problem

    AI scalar, aggregate, and join operators pose different optimization problems, while fixed cascades are insufficient because input difficulty varies and model quality is not always monotone with size.

    Source: §1 · p. 1
  • Method

    SAGE represents AI functions with three typed primitives—row-to-value, group-to-value, and pair-to-predicate—and uses execution strategies tailored to each role.

    Source: §1 · p. 1, §2 · p. 2, §7 · p. 9
  • Results

    358× measured cost reduction accompanied replacement of 16,256 pairwise calls with 128 on a representative factorable join; updated-join quality was best or tied-best except on Q5.

    Source: §7 · p. 10
  • Takeaways & Limitations

    SAGE provides a small logical interface with guarded, primitive-specific execution rather than one implementation shared across all primitives.

    Source: §7 · p. 10

    The three-way coverage result is empirical and excludes recursive agents, training, side effects, raw multimodal conversion, and index construction.

    Source: §7 · p. 9

Abstract

from arXiv · show

SQL systems increasingly expose AI functions for tasks such as classification, extraction, filtering, ranking, retrieval, joining, and summarization. Despite their diverse APIs, these functions play only three relational roles: transforming individual rows, aggregating groups, or generating relationships between row pairs. We present SAGE (Self-Adaptive Generative Execution), a unified logical and physical framework that captures these roles with three typed primitives, AI_SCALAR, AI_AGG, and AI_JOIN, and composes them naturally with standard relational operators. All primitives share a confidence-gated execution interface while supporting physical strategies tailored to their relational shape. The main challenge is AI_JOIN, where SAGE analyzes the predicate, decomposes compound conditions when possible, and uses a recipe card together with a small label-free probe to select among complete execution strategies. Across a broad audit of public AI operators and evaluations spanning scalar, aggregate, and join workloads, this formulation covers common AI functionality while consistently improving execution quality and efficiency. SAGE achieves the strongest overall SemBench performance and, on a representative factorable join, reduces pairwise model calls by more than two orders of magnitude, yielding a 358-fold measured cost reduction.

1 Introduction

SAGE unifies query-time AI functions as three cardinality-based logical primitives—row-preserving, group-reducing, and pair-generating—while using confidence-gated adaptation with role-specific execution strategies. A label-free per-query probe selects a configuration under cost and latency budgets.

  • The logical framework reduces AI functions to AI_SCALAR for rows, AI_AGG for groups, and AI_JOIN for row pairs, with complex tasks composed from these primitives and standard relational operators.The formulation distinguishes the model-invoking core from user-facing function names and states its boundary.Source: §1 · pp. 1–2
  • All primitives share a confidence-gated small-to-large cascade, while scalar, aggregate, and join front ends use role-specific strategies for per-row routing, compaction and chunking, and pair-space control or factorization.Semantic-join routing and predicate decomposition are specializations of AI_JOIN, alongside scalar and aggregate plans.Source: §1 · pp. 1–2
  • SAGE achieves the best SemBench average and best or tied-best quality on every updated join except Q5; an exact all-pairs run drops from 16,256 calls to 128, cutting cost 358×.The fixed no-racing variant gives the cheapest point on all three compound workloads.Source: §1 · p. 2
  • An audit maps 63 of 78 operators from eleven public systems directly to the three primitives; 37 semantic-query intents require at most three primitives, and 94.6% require at most two.The remaining operators are multimodal conversions or non-semantic indexing and control constructs.Source: §1 · p. 2
  • A label-free probe races operator-specific candidates and selects a quality-maximizing plan under cost and latency budgets.The probe evaluates complete configurations for the current predicate and freezes the best one that satisfies those budgets.Source: §1 · p. 2, Figure 1 · p. 2
  • The unified evaluation covers scalar, aggregate, join, and ranking workloads on SemBench Q1–Q10 and Multi-XScience; semantic joins are physical subclasses of AI_JOIN, not a separate top-level category.The pair-primitive deep dive also uses the latest AI-Join runs for overlapping join columns and three compound predicates.Source: §1 · p. 2

2 A Unified Algebra for AI Functions

SAGE models single-pass, query-time AI functions as typed operations over a row, a group, or a candidate pair, composed with ordinary SQL. The framework’s audit finds that three primitives cover most public semantic functions and common query compositions, while its optimizer selects physical configurations at the plan level.

2.1 Three Logical Primitives

  • AI_SCALAR maps a row to a value while preserving N rows; AI_AGG maps a group to a value and reduces N rows to G outputs.Scalar uses include classification, extraction, scoring, and filtering; aggregate uses include summaries and group-level judgments, which need not be decomposable.Source: §2.1 · pp. 2–3
  • AI_JOIN judges candidate row pairs, exposing an N×M pair space so the optimizer can enumerate, block, retrieve, or factor candidates before model calls.Its logical contract is a pair predicate; ordinary SQL handles final selection or ordering.Source: §2.1 · p. 3

2.2 Scope, Completeness, and Coverage

  • The framework covers single-pass, query-time functions that consume relational data; recursive agents, training, multimodal conversion, indexing, and side-effecting actions are outside its scope.More complex in-scope tasks compose the three primitives with ordinary SQL.Source: §2.2 · p. 3
  • Of 78 operators across 11 public semantic-query systems, 63 map directly to the three primitives; all 37 decomposed tasks use at most three AI primitives.Almost all 37 tasks require no more than two primitives.Source: §2.2 · p. 3, Table 2 · p. 3, Figure 2 · p. 3

2.3 Plan-Level Optimization Objective

  • SAGE selects physical configurations for a complete query plan against task-quality, monetary-cost, and latency objectives under cost and latency budgets.It materializes reusable scalar values, pushes lossless and selective predicates early, and avoids partial execution of holistic aggregates because early lossy operations can remove evidence.Source: §2.3 · p. 3

3 Primitive-Aware Physical Execution

SAGE shares a confidence-gated execution skeleton across AI functions while tailoring physical plans to rows, groups, and pair spaces. Its plans preserve exactness where possible and use conservative pruning or measured approximations where needed.

3.1 A Shared Adaptive Skeleton

  • SAGE routes uncertain outputs from a first model to an escalation model using answer-bearing confidence, which improves AI-Join routing over random escalation at the same large-model budget.TokenSAR weights answer-relevant tokens; the query probe calibrates the escalation threshold, and escalation chooses the best model for uncertain cases rather than assuming the largest is strongest.Source: §3.1 · p. 4

3.2 AI_SCALAR: Independent Row Execution

  • AI_SCALAR calls factorize over independent rows, enabling batching, parallelism, caching, vectorized inference, and exact pass-rate ordering for consecutive Boolean scalars.A cheap labeler may front-end closed-set classification; free-form extraction or rewriting starts at the first model, and reused generated fields are materialized once.Source: §3.2 · p. 4

3.3 AI_AGG: Group Reduction

  • AI_AGG compacts near-duplicate group evidence before the shared cascade, while chunking is exact only for modular or algebraic aggregates with mergeable partial states.Compaction is an approximation measured on the probe; holistic judgments and cross-document summaries generally require the full group.Source: §3.3 · pp. 4–5

3.4 AI_JOIN: Predicate-Aware Pair Execution

  • AI_JOIN selects membership, relational, or reasoning routes from predicate structure: row-local labels enable hash joins, pair models prune negatives, and ambiguous pairs retain generative reasoning.Reasoning-route pruning commits only high-margin negatives, avoiding unsafe factorization; relational predicates retain the pair grid and send surviving pairs to the cascade.Source: §3.4 · p. 5
  • |A||B| pair evaluations become |A| + |B| row evaluations for factorable AI_JOIN predicates, with exactness conditional on correct factorization and predicted row values.SAGE materializes row-local virtual columns and applies an ordinary hash join; model errors remain visible as virtual-column errors.Source: §3.4 · p. 5
  • For compound AI_JOIN predicates, SAGE pushes down atom plans and orders them by estimated cost per eliminated candidate; ordinary relational completion preserves outer-join semantics.LEFT, RIGHT, and FULL joins track whether each preserved row received a qualifying match before completing dangling rows.Source: §3.4 · pp. 5–6

4 Test-Time Configuration Selection

SAGE selects configurations from contract-preserving candidate spaces by probing and racing a small slate, then uses the outcomes to guide future queries. On SemBench Q5, fixed join thresholds can miss the best configuration, while the reported validation supports small-probe stability and near-oracle selection.

4.1 Configuration Spaces and Slates

  • Candidate spaces preserve each AI node’s logical contract and include settings tailored to scalar, aggregate, or join execution; their product across query nodes is too large for exhaustive testing.Aggregate candidates add compaction and legal partial reduction; join candidates add recipe route, blocking or factorization parameters, and front-end cutoff.Source: §4.1 · p. 6
  • Each primitive proposes a small candidate set of cheap and quality anchors plus history-guided exploratory settings, which SAGE assembles into at most K whole-plan configurations.Cold start uses anchors and space-filling samples; later queries reuse primitive-specific feedback, reducing plans tested without deciding the winner.Source: §4.1 · p. 6

4.2 Probe-and-Race Execution

  • SAGE evaluates every candidate on the same stratified sample, captures downstream effects for composed queries, estimates quality with a fixed judge, and extrapolates resource usage.It records actual token usage, cost, and latency, then progressively eliminates statistically inferior or budget-infeasible candidates.Source: §4.2 · p. 6
  • Deployment uses no benchmark gold labels, and probe outcomes update the proposer for future queries.The final choice is made from the surviving slate.Source: §4.2 · p. 6
  • On SemBench Q5, quality varies substantially across (τ_f, τ_e), and validation reports small-probe stability, high near-oracle coverage, and a label-free proxy that tracks a gold-based oracle.The passage identifies Figure 7 as the representative Q5 case; it provides no numeric values for these findings.Source: §4.2 · p. 6

5 Evaluation

The evaluation compares SAGE across the three primitives, then studies AI_JOIN’s execution strategies, mechanisms, and label-free estimates.

Cross-primitive and per-query gains (RQ1)

  • 0.908 SemBench average: SAGE leads the ten-query suite, ties on MXS, and has best or tied-best updated-join quality except Q5.Under shift, SAGE recovers 80.8% of the target-trained ceiling, versus 73.5% for LOTUS and 60.1% for FDJ.Source: §5 · p. 6, Table 3 · p. 7

Performance at Confounded Predicate (RQ2)

  • 0.846 mean F1 makes selective-first execution best on confounded workloads, while SAGE (No Racing) is cheapest on all three at $0.002–$0.007 versus $0.009–$0.031.Removing an atom or decomposition degrades precision or nearly doubles pairwise calls.Source: §5 · p. 7, Table 4 · p. 8

Scalability

  • 16,256 to 128 pairwise calls (127× fewer) cuts wall-clock by 89× and cost by 358× on a representative join.In Q6/Q7 sweeps, F1 stays stable while cost and latency fall by one to three orders of magnitude versus always-large execution.Source: §5 · p. 7, Table 5 · p. 8

Ablation across mechanisms (RQ3)

  • 0.850 to 0.634 and 0.805 to 0.746: mean-log-probability routing hurts membership and reasoning F1, while removing routing costs $0.563 for membership and drops FewRel to 0.039.The no-racing variant also loses quality on Q2, Q6–Q7, Q9–Q10, FewRel, BRIGHT, and all three compound joins; neither model tier alone is both cheap and reliable.Source: §5 · p. 8

The proposer fills the slate (RQ3)

  • 60.8% versus 3.4%: at K=3, the learned proposer’s slate hits a near-oracle configuration more often than a uniform slate.The proposer also beats ε-greedy, UCB, and last-winner baselines; cold-reset history falls to chance, while warm history sustains the hit rate.Source: §5 · p. 8

Convergence Pace

  • About fifty probed samples stabilize the race, lifting deployed F1 from 0.685 to 0.746 with bounded, front-loaded overhead.The race stabilizes within the stated sample count.Source: §5 · p. 8

Cross-domain recovery

  • 80.8% recovery: across ten stratified splits and twelve directions, SAGE exceeds LOTUS at 73.5% and FDJ at 60.1%, leading or tying on eight directions.Each held-out family is evaluated without target labels, allowing only SAGE’s unlabeled probe; recovery divides target F1 by the best target-trained F1 among SAGE, LOTUS, and FDJ.Source: §5 · p. 8

6 Related Work

SAGE relates diverse AI-SQL APIs through the relational unit each invocation must preserve and distinguishes its execution framework from structure-aware joins, cascades, and adaptive plan search. Its query-local probe selects a complete semantics-preserving configuration without deployment labels.

6 Related Work

  • Public systems expose diverse model-backed relational operations, while SAGE classifies them by whether an invocation preserves rows, reduces groups, or tests pairs.Examples include LOTUS, Palimpzest, ZenDB, Sema, ThalamusDB, DocETL, SUQL, UQE, and production warehouse suites Patel et al. [2024], Liu et al. [2024a], Lin et al. [2024], Qi et al. [2026], Jo and Trummer [2024], Shankar et al. [2024], Dai et al. [2024], Databricks [2025], Snowflake [2025], Google Cloud [2025].Source: §6 · p. 8
  • Semantic-join systems reduce the |A||B| search through retrieval, batching, approximation, decomposition, or factorization; SAGE guards these choices by predicate structure.It retains pair semantics when a join cannot factor and distinguishes exact mergeable aggregates from approximate compaction Patel et al. [2024], Jo and Trummer [2024], Zeighami et al. [2025].Source: §6 · pp. 8–9
  • SAGE combines item-level answer-relevance confidence with a query-local probe that selects and freezes a complete physical configuration without deployment labels.Unlike model cascades and related iterated-racing or cross-entropy methods, its candidates are semantics-preserving plans whose feasibility jointly reflects quality, cost, and latency Chen et al. [2023], Ong et al. [2024], Duan et al. [2024], López-Ibáñez et al. [2016], Rubinstein [1999], De Boer et al. [2005].Source: §6 · p. 9

7 Discussion, Limitations, and Conclusion · Contents of the Technical Appendix · A Recipe-Card Compiler and Routing Reliability

SAGE unifies audited single-pass, query-time AI functions through row, group, and pair invocation signatures with role-specific correctness constraints. Within its empirical scope, it delivers strong updated-join quality and substantially reduces calls and cost on a representative factorable join.

7 Discussion, Limitations, and Conclusion

  • SAGE maps audited single-pass, query-time AI functions to row-to-value, group-to-value, and pair-to-predicate signatures, each with distinct correctness obligations.AI_SCALAR must preserve row identity, AI_AGG must preserve the group result under an explicit merge or approximation contract, and AI_JOIN must preserve pair truth unless the predicate factors through per-row state.Source: §7 · p. 9
  • The three-way coverage result is empirical and excludes recursive agents, training, side effects, raw multimodal conversion, and index construction.Scale results cover two membership joins; transfer results measure configuration recovery using an unlabeled target probe, not universal task transfer. The paper also identifies correlated compiler/proxy errors, approximate aggregate compaction, and probe amortization as limitations.Source: §7 · pp. 9–10
  • 16,256 pairwise calls fall to 128 on a representative factorable join, reducing measured cost by 358×; SAGE achieves best or tied-best updated-join quality except Q5.The paper presents this as a result within its evaluated scope, not as a claim that all primitives share one implementation.Source: §7 · p. 10

Contents of the Technical Appendix

A Recipe-Card Compiler and Routing Reliability

  • For a predicate and at most five LIMIT-style candidate pairs, the compiler returns predicate type, featurizer, labels, entity labels, and comparison direction.Its evaluation tests format validity and robustness to perturbed sampled rows; semantic correctness is conditional on successful parsing, with parse failures reported separately.Source: A Recipe-Card Compiler and Routing… · p. 13, Table 7 · p. 13
  • Route interventions show that removing membership factorization, flipping sentiment direction, or removing the relational route changes results on the evaluated workloads.On BRIGHT, replacing the reasoning route with the relational route reduces F1 and increases cost; because the route is fixed by the card, these interventions are the reported evidence on route choice.Source: A Recipe-Card Compiler and Routing… · p. 13
  • For a conjunction of a cheap candidate-generation condition and a semantic residual, removing either condition changes the target predicate.Removing the semantic condition admits false positives; removing the cheap condition preserves more matches but eliminates pruning. Pairwise execution of the whole conjunction recovers the decomposed plan’s result at higher pairwise-call count.Source: A Recipe-Card Compiler and Routing… · p. 13

A.1 Probe-Set Sensitivity of Recipe-Card Generation · B Zero-Shot Front-End Comparison

SAGE’s recipe-card structure largely converges by five probe pairs, which the paper adopts as the default. The front-end comparison treats zero-shot encoders as diagnostics and selects cascade tiers empirically, offline, rather than by parameter count.

A.1 Probe-Set Sensitivity of Recipe-Card Generation

  • The sensitivity experiment fixes each workload’s join predicate and varies sampled probe sets of 1, 2, 3, or 5 row pairs, with eight independent sets per size.Source: §A.1 · p. 13
  • Agreement measures the fraction of compilations matching the modal five-pair recipe card’s structural signature; 1 − agreement measures probe-induced structural variance.The signature includes operator type, featurizer, and direction, while ignoring wording differences that do not change execution.Source: §A.1 · p. 13
  • At five probe pairs, FewRel agreement rises from 62.5% to 100%, Confounded workloads reach 91.7%, and only 8.3% disagreement remains for Confounded workloads.Recipe-card variance disappears for SemBench, FewRel, and BRIGHT; the paper therefore uses five row pairs as the default probe-set size.Source: §A.1 · p. 13
  • SemBench and BRIGHT are stable with one pair, while FewRel is sensitive to small probe sets and Confounded predicates improve from 75.0% to 91.7%.These results describe agreement with each workload’s modal five-pair recipe card.Source: §A.1 · p. 13

B Zero-Shot Front-End Comparison

  • Table 10 compares GLiREL and GLiClass as component diagnostics of positive-versus-negative pair ranking on hard, balanced sets, not as a runtime model assignment.The supplied passage gives no AUROC values.Source: B Zero-Shot Front-End Comparison · p. 14, Table 10 · p. 14
  • On the opposite-sentiment join, accuracy is not monotone in parameter count, so the two cascade tiers are selected empirically from the diagnostic measurement.The model pair is chosen once offline, applies to every join, and is not part of the configuration searched by the race.Source: B Zero-Shot Front-End Comparison · p. 14, Table 11 · p. 14

C Confidence Signal and Escalation · D Threshold Sensitivity · E Bandit Proposer

The sections examine confidence-based escalation and per-query threshold choice, then describe a proposer that races candidate AI_JOIN configurations on a shared probe. Confidence ordering is diagnostic rather than a claim of universal calibration.

C Confidence Signal and Escalation

  • TokenSAR shows stronger confidence separation than mean log-probability on the diagnostic sample, but this is not a universal calibration claim.The TokenSAR score is negated so both plotted panels read as confidence, with larger values more trusted.Source: C Confidence Signal and Escalation · p. 14
  • About 40% of pairs need escalation for the confidence-ordered curve to reach the large-model reference on the opposite-sentiment join.The evaluation compares confidence ordering with randomly selecting the same number of escalations.Source: C Confidence Signal and Escalation · p. 14
  • The saturation point varies across predicates, motivating per-query escalation-threshold selection instead of one global threshold.Source: C Confidence Signal and Escalation · p. 14

D Threshold Sensitivity

  • Threshold sensitivity is evaluated across five workloads, with arrows tracing configurations from the default to the selected setting.The analysis studies local sensitivity to the two cascade thresholds, τ1 and τ2.Source: D Threshold Sensitivity · p. 15

E Bandit Proposer

  • The recipe card fixes the route and cascade tiers, while the proposer selects up to K untested configurations for evaluation in rounds on the same probe.Source: E Bandit Proposer · p. 15
  • After each round, iRace removes statistically inferior or infeasible configurations; if none survives, the proposer updates its posterior and repeats until finding a feasible configuration or exhausting the action space.Source: E Bandit Proposer · p. 15

F Proposer Replay Evaluation

The proposer is evaluated by replay to separate slate composition from final proxy-based choice, using sampled workload queries and measured oracle configurations.

F Proposer Replay Evaluation

  • Replay uses 160 queries across four workload families, executes all 96 configurations per query, and averages slate-hit rates over 20 random seeds.A hit means the slate contains a configuration satisfying the near-oracle criterion in Eq. 12.Source: F Proposer Replay Evaluation · p. 15
  • Figure 17 examines accumulated versus cold-reset history, charges measured probe costs, and varies the low-quality-configuration share without assuming transferable history in new domains.These views evaluate only the specified replay stream.Source: F Proposer Replay Evaluation · p. 15

G Outer-Join Correctness and Dangling Rows · H Prompt Templates and Runtime Assignment

The sections test whether AI outer joins preserve unmatched left rows and document prompt templates that classify predicates and route AI_JOIN execution.

G Outer-Join Correctness and Dangling Rows

  • A LEFT JOIN must retain each left row without a qualifying partner, and the section checks this structural behavior separately from pairwise semantic accuracy.Dangling recall measures preservation of unmatched rows; dangling F1 and inner F1 also depend on pairwise semantic decisions.Source: G Outer-Join Correctness and Dangling… · p. 15
  • The controlled test used 40 left rows, 240 candidate pairs, and right-side scores {7, 8}; 15 left rows were dangling under deterministic labels.The experiment checks outer-join structure on a small input, not general quality, and defines gold labels for left-side dangling-row evaluation.Source: G Outer-Join Correctness and Dangling… · p. 15

H.1 Recipe-card prompts

  • The recipe-card system prompt compiles an AI_JOIN predicate into strict JSON specifying execution type, featurizer, labels, entity labels, and direction.The allowed types are per_side, joint, and reasoning; featurizers include gliclass, gliner, numeric, embed, and glirel.Source: §H.1 · p. 17
  • Routing assigns per-side attributes to row-level featurizers, joint relations to GLiREL, and reasoning predicates to a generative cascade with GLiREL as a high-confidence negative filter.The prompt maps closed attributes to gliclass, entity spans to gliner, numbers to numeric, and graded similarity to embed.Source: §H.1 · p. 17
  • Recipe conventions require mutually exclusive labels for gliclass, two self-descriptive GLiREL relation labels with the positive first, and empty labels for gliner, numeric, and embed.Direction applies only to per_side recipes; other types use none.Source: §H.1 · p. 17
  • The row-labeling and closed-classification prompts require exactly one allowed label or none, while model-role prompts distinguish concise task following from authoritative ambiguity resolution.The classification prompt returns only the selected label or none.Source: §H.1 · p. 17
  • Pair-judging prompts require a relationship to hold clearly for the specific pair, with variants either treating the predicate literally or recognizing paraphrases without adding unsupported facts.Output modes specify either a single lowercase true/false or a concise rationale followed by a final Answer line.Source: §H.1 · p. 17

I Detailed Experimental Setup … J.3 MapReduce Decomposability

SAGE’s three relational primitives cover audited semantic-query intents, but their MapReduce decomposability depends on operator class and predicate structure. The experimental setup standardizes workloads, candidate pairs, pricing, probing, and proposal evaluation.

I Detailed Experimental Setup

  • Full-suite quality uses scaled metrics by workload, while traces identify Granite and gpt-oss models and external systems retain native configurations with shared token pricing.Metrics are precision@5 for Q1–Q2, max(0, 1 − relative error) for Q3, Q4, and Q8, (ρ + 1)/2 for Q9–Q10, and ROUGE-1 for Multi-XScience. Table 3 replaces earlier Q5–Q7, FewRel, and BRIGHT point estimates with current join repeated-run means; methods share inputs and pricing within each workload column.Source: I Detailed Experimental Setup · pp. 17–18
  • Current join experiments evaluate identical candidate pairs under one OpenRouter price schedule, racing three configurations on a uniform probe of up to 50 pairs.The cascade uses Granite-3.0-8B and gpt-oss-120b; the 96 configurations vary filtering and entailment thresholds, reasoning, and temperature. Probe cost and latency are scaled linearly to the full candidate set, including recipe generation, racing, and judging.Source: I Detailed Experimental Setup · p. 18
  • A Bayesian linear Thompson sampler proposes configurations from Granite predicate representations and recipe-card classes, while a blinded fixed gpt-oss-120b judge scores correctness.History starts with uniform slates and updates from three observations per query; default budgets are $0.03 and 240 seconds, with infeasible queries reported as budget violations.Source: I Detailed Experimental Setup · p. 18

J Primitive-Core Coverage and Decomposability

  • The coverage audit, intent decompositions, and operator-specific MapReduce limits jointly support the claim that three primitives suffice for the audited semantic-query functionality.The primitives are AI_SCALAR, AI_AGG, and AI_JOIN.Source: J Primitive-Core Coverage and… · p. 18

J.1 Audited Operator-to-Primitive Map

  • Fleiss’ κ=0.933 in a five-annotator audit mapping public semantic-query operators to primitives; retrieval and reranking count as AI_JOIN, while raw embeddings are non-semantic.The audit includes public APIs and AI-SQL suites; embeddings serve as indexing or blocking mechanisms, not query-level semantic primitives.Source: §J.1 · p. 18

J.2 Intent Decomposition by Depth

  • All 37 audited intents decompose into finite plans over per-tuple AI_SCALAR, per-group AI_AGG, and per-pair AI_JOIN signatures; the longest chain has depth three.Whole-relation judgments reduce to aggregation over a trivial group; search, top-k, and similarity use synthesized AI_JOIN predicates; deduplication combines pairwise matching with component construction; ranking uses a scalar key or join relevance followed by sorting. Most intents have depth one or two.Source: §J.2 · p. 18

J.3 MapReduce Decomposability

  • MapReduce factorization is exact for modular aggregation and membership joins, but holistic aggregation needs a merge contract and relational or reasoning joins still evaluate the full N×M grid.Membership joins reduce predicate cost to N+M through per-row keys; distributed tiling alone does not reduce model work for predicates that jointly read both rows.Source: §J.3 · p. 18, Table 20 · p. 22
  • The optimizer permits partial aggregation only with bounded mergeable state and reduces AI_JOIN model work only when predicates compile to independent row keys.Chunk size, batching, and worker placement are safe alternatives for every primitive; partial-state schemas and per-side key extractors are conditional rewrites admitted only after a recipe proves decomposition.Source: §J.3 · p. 20
Loading 2608.20630v1…