TRANSMISSION // 2612.02918v1

UniBays speeds up semantic database queries by pruning first

Source published

UniBays combines relational pruning, a reusable semantic index and query-wide optimization to reduce the cost of database queries that use AI to interpret text.

AI-generated conceptual illustration for UniBays speeds up semantic database queries by pruning first
AI-generated conceptual illustration; not documentary evidence.

A database can quickly filter rows using exact values, but asking an AI model whether two documents are meaningfully related is slower and costlier. UniBays, a research system described in an arXiv preprint, aims to make these mixed queries more practical by removing unnecessary comparisons before inference and reserving larger models for uncertain decisions that matter to the final result.

Why semantic queries can be slow

A conventional database can join tables using explicit keys, such as matching an order number to an order record. But some questions depend on meaning in text: does a repair plan apply to a defect report, or can a particular site carry out that plan? Systems can use language models to answer such questions, but evaluating many possible document pairs can be expensive. The challenge grows when a query combines ordinary database filters and joins with several meaning-based judgments.

The authors of UniBays argue that making each AI judgment cheaper is not enough. Even compact decision models—which return a score or typed answer rather than generating paragraphs—remain much slower than ordinary relational operations. Their scores may also fail to correspond reliably to the judgments a larger language model would make. UniBays is designed to reduce the number of judgments and coordinate the remaining ones across the whole query.

Three stages of pruning and inference

First, UniBays uses exact relationships in the query to discard records that cannot contribute to an answer. For example, a report that cannot be linked to a return in the requested region need not be compared with repair plans. This reduction is inspired by semijoin techniques used in database research; it does not require guessing what the text means.

Second, a reusable semantic index screens some of the remaining candidate pairs. The index represents simpler, record-level propositions—such as whether a report describes a particular storage condition—that can be checked once and reused across different pairings. A plan may require one or more propositions to hold. If a necessary requirement is judged not to hold, the pair can be rejected without running the full semantic comparison. Crucially, meeting those requirements does not prove that the pair is a match. The paper describes this screening as approximate: imperfect requirements or scores can remove true matches.

Third, a global optimizer considers how the remaining uncertain judgments affect the query’s possible outputs. It begins with a fast decision model, calibrates score ranges using a sample of judgments from a larger language model, and sends selected cases to that larger model. It uses query structure—what the paper calls Boolean lineage—to prioritize decisions that could change the result, while batching requests to balance cost and waiting time. The system’s quality targets concern precision and recall relative to a reference result formed by evaluating the reduced query’s remaining semantic decisions with the larger model.

What the tests showed

The researchers evaluated UniBays on SemBench and on two new workloads, Shelob-Maintenance and Shelob-Ops, built on TPC-DS and populated with structured records and text. The tests compared it with Palimpzest, LOTUS and SEMA under the authors’ stated configurations and time limit.

On SemBench’s 21 queries, a UniBays configuration using the Jev decision model had the lowest latency on every query. The paper reports that it was 56.8 to 82.4 times faster than the three comparison systems in aggregate, at 13–31% of their model costs. Its mean reported quality was 0.858, compared with 0.8185 for the highest-scoring baseline. These figures describe this benchmark and setup; they are not a general guarantee for other workloads.

On Shelob, UniBays completed all 27 query instances, with a mean F1 score of 0.9201. The baselines completed fewer: LOTUS completed 15, SEMA 11, and Palimpzest 7 within the 2,000-second limit. In the nine Maintenance XS queries used for one index analysis, the indexes removed 68.8–86.4% of candidate pairs, while losing 0.4–2.9% of ground-truth matches. That trade-off illustrates why pruning must be evaluated not just by how many comparisons it avoids, but also by whether it removes useful matches.

The results also show costs and trade-offs within UniBays. On Maintenance XS, selective escalation improved mean F1 over decision-model-only execution, but took longer and cost more. Raising the optimizer’s precision and recall targets from 0.80 to 0.99 increased reported mean F1, alongside higher model cost and query time. Index construction also takes time and resources, so its benefits depend partly on reuse.

What remains uncertain

These are experimental results, not evidence that UniBays will perform similarly in every database or production setting. The Shelob workloads are constructed research benchmarks, and the reported comparisons depend on particular models, prices, hardware, concurrency settings and query configurations. The optimizer’s quality estimates rely on assumptions about how decisions within score bins behave, including conditional independence; the paper notes that end-to-end quality also depends on errors from earlier probabilistic pruning. Its quality targets are defined relative to the larger model’s judgments on the reduced query, not as a guarantee of agreement with human assessments.

The paper also identifies a current limitation: it does not interleave relational reduction with semantic inference as new judgments arrive. UniBays is presented in an arXiv preprint, which may not have undergone peer review. The benchmarks support a promising systems approach, but independent evaluation and testing on broader real-world workloads would help establish how well it generalizes.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.