Semantic Views: Certified Reuse of LLM Labels Across Semantic Queries

Oktie Hassanzadeh, Dharmashankar SubramanianarXiv 2026

TL;DR

SemViews is a new optimization framework that allows database engines to reuse expensive Large Language Model (LLM) labels across different natural-language queries. By separating the "free" signals used to order data (like past query results and embeddings) from the "fresh" samples used to certify accuracy, it cuts LLM costs by up to 45% while providing rigorous statistical guarantees on precision and recall.

What Problem Does This Paper Address?

Modern "semantic" query engines allow users to filter data using natural language (e.g., SELECT * FROM reviews WHERE {text} complains about the battery). To execute this, the system must ask an LLM—the "oracle"—to evaluate every single row. These oracle calls are the primary bottleneck, dominating both cost and latency.

Current optimizers try to solve this by using "cascades": they use a cheap, small model to filter out "easy" rows and only send "hard" rows to the LLM. However, they face a frustrating dilemma:

  1. Unsafe Reuse: Methods that trust similarity or LLM-judged "entailment" (e.g., assuming a "battery overheat" query is contained within a "battery complaint" query) often fail because LLMs aren't logically consistent. In practice, these methods frequently miss accuracy targets.
  2. Conservative Guarantees: Methods that provide strict statistical guarantees often save very little (sometimes only 2-10%) because they are too cautious.
  3. Wasteful Execution: Almost all existing systems discard the expensive LLM labels as soon as a query finishes. If a user asks a slightly different but related question a minute later, the system starts from scratch.

Methods

The authors introduce SemViews, which treats previous query results as Semantic Views. The core of the system is the CertifiedFilter operator, which follows a strict rule: use everything available for free to decide where to look, but only use fresh oracle samples to decide what is true.

Figure 1: Certified reuse on the running example. Past views (blue: positive, white: negative, gray: unknown) and the helper score are features of a score ˆ𝜋for the new predicate 𝑞. The planner splits the score order into three regions. Only fresh oracle samples drawn after the split enter the confi- dence bounds, so wrong views change the cost, never the guarantee.

The process works in five stages:

  1. Matching: It finds the top-10 most relevant past queries (views) from a catalog using embedding similarity.
  2. Shaping: It takes a small "shaping sample" of the current data to learn how well these past views (and other signals like local embeddings) predict the new query.
  3. Refinement: It iteratively labels a few more "uncertain" tuples to sharpen its predictive score.
  4. Planning & Certification: It sorts the data by the predictive score and splits it into three regions: a Reject region (likely negatives), an Accept region (likely positives), and an Oracle region (uncertain, labeled in full). It then draws fresh, uniform samples from the Reject and Accept regions to calculate exact statistical bounds (using hypergeometric distributions) to ensure the final result meets the user's precision and recall targets.
  5. Gap Closing: If the statistical bounds aren't tight enough to meet the targets, it labels a few more tuples until they are.

Datasets

The authors evaluated SemViews on four diverse text datasets, each with a pool of 25–40 semantic predicates:

  • PubMed: Biomedical abstracts with human-written predicates.
  • GoEmotions: Social media comments categorized by emotion taxonomies.
  • DBpedia: Encyclopedia entries categorized by class taxonomies.
  • Reviews: Electronics product reviews with analyst-style predicates.

They also conducted larger-scale experiments on up to 100,000 tuples using DBpedia and Amazon Electronics reviews to confirm that their findings scale.

Table 2: Datasets and predicate pools. Selectivity is the me- dian share of tuples that the oracle labels positive, with the range over predicates in parentheses.

Key Insights and Ideas

  • Entailment is Unreliable: One of the most striking findings is that "logical" containment between predicates rarely holds up in practice. An LLM might judge that "A implies B," but on actual data, 56% of such judged implications were violated by more than 10% of the labels. This is why SemViews uses views only for ordering, never for deciding a label without certification.
  • The Certification Floor: Any method providing a statistical guarantee faces a "cost floor"—a minimum number of samples required to prove a certain recall level. This floor depends on the query's selectivity (how rare the positives are) but, crucially, not on the total size of the table. This means SemViews becomes significantly more efficient as the dataset grows.
  • Robustness to "Bad" Views: Because the system uses fresh samples to certify the final answer, even if the catalog contains misleading or adversarial views, the system remains accurate. A bad view might make the query more expensive (by forcing more oracle calls), but it will never break the precision/recall guarantee.

Key Results

  • Cost Savings: SemViews saved 28%–45% of oracle calls compared to labeling every row. It outperformed BARGAIN (the state-of-the-art certified method) by 4x–18x.
  • Reliability: Across 145,000 replayed queries, SemViews met accuracy targets 99.63% of the time, successfully staying within the user-defined failure probability ($\delta = 0.05$).
  • Reworded Queries: When the same question was asked in different words, SemViews leveraged the "twin" query's labels to save an additional 27%–36% in calls. In contrast, uncertified methods like similarity caches missed their targets on 53%–83% of such queries.
Figure 3: Cumulative oracle calls as a share of exact evaluation as each workload unfolds (median over workload orders; bands: 10th to 90th percentile). Dotted methods miss their targets on many queries (Table 5); SemViews is the cheapest method that meets them.

Limitations and Future Work

  • Scope: The current work focuses strictly on semantic filters. Extending these certified reuse techniques to more complex operations like semantic joins or ranking remains an open challenge.
  • View Management: While the paper demonstrates that views are useful, it doesn't deeply explore "view selection" policies—deciding which partial views to complete during idle time or which ones to evict when storage is limited.
  • Latency: While SemViews reduces the number of LLM calls, it issues them in sequential rounds (shaping, refinement, certification). This could increase total wall-clock latency compared to a single-round approach, though the authors suggest larger batch sizes could mitigate this.

Summary updated

BibTeX
@misc{hassanzadeh2026semantic,
  author = {Oktie Hassanzadeh and Dharmashankar Subramanian},
  title = {{Semantic Views: Certified Reuse of LLM Labels Across Semantic Queries}},
  year = {2026},
  eprint = {2610.12768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.12768},
}
Figure