Do Semantic Query Engines Need LLMs? An Experimental Study of Decision Models
Abstract
Semantic query processing engines (SQPEs) evaluate predicates written in natural language inside SQL by prompting large language models (LLMs), and many send the decisions a cheaper model is unsure of to a larger LLM. Yet a predicate often asks a question with a fixed set of answers, such as whether a review is positive, and a new kind of model targets such questions: decision models, small models that answer yes/no, choice and score questions with a probability for every answer. We present an experimental study of whether semantic query engines still need LLMs. Its key idea is to treat the reference as a variable. Every decision is scored against two references, the gold that people entered and what its text says, and every engine is calibrated with labels from the reference it is scored against. We run the study on SemBench and on DecideBench, a new benchmark whose answers combine many decisions through joins, quantifiers, negation and aggregates, in DecideSQL, a DuckDB-based engine in which decision models, LLMs, cascades and recorded decisions are interchangeable. Without labels, a 9B decision model matches or beats a 120B LLM on most of the SemBench queries it can answer, at a twelfth of the cost. With 200 labels per predicate, the best decision model answers DecideBench's queries more accurately than every open-weight LLM against the gold, and escalating its uncertain decisions to an LLM whose answers are taken as final mostly makes answers worse. Against the text, which engine wins depends on what a predicate is taken to mean.
Create a lesson
Metadata
- Categories
- cs.DB, cs.AI
- Comments
- 24 pages, 5 figures, 25 tables. Extended version with appendices
Related papers
DecideSQL: Probabilistic Semantic Query Processing with Decision Models
Shared title terminologycs.DBOktie Hassanzadeh, Long Vu, Dharmashankar Subramanian
CapCover Filter: Semantic Approximate Membership Queries over Embeddings
Shared title terminologycs.DBDvir David Biton, Shay Hahiashvili, Nadav Keren et al.
The Selfish Models Property: Bounding the Complexity of Query Containment and Entailment Problems
Shared title terminologycs.DBHubie Chen
Natural-Language-to-GPML: Dual-Oracle Witness Synthesis, Orthogonal Subspace Merging, and Live Schema-Constrained Decoding for ISO/IEC 39075 Graph Queries
Shared title terminologycs.DBMadhulatha Mandarapu, Sandeep Kunkunuru
Falcon: Fast, Lightweight, and Robust Cascade for Oracle-Efficient Semantic Filtering
Shared title terminologycs.DBZepeng Liu, Hai Lan, Yiming Shi et al.
ACTIS: Adaptive Cascade Tuning for Semantic Filters with Statistical Guarantees
Shared title terminologycs.DBNeil Marchant, Renata Borovica-Gajic, Benjamin Rubinstein et al.