SignalCount: Approximate Counts with Structured and Semantic Predicates in Seconds
Matteo Agius-D'Arrigo, Zachary Zelner, Harrison Ju, Rushab Munot
Abstract
Many applications store records with structured columns and a text document, and ask how many records in a filtered set meet a criterion that only a reader of the text can judge, such as "How many patients with type 2 diabetes, aged 40 to 70, stopped metformin because their blood sugar stayed high?" An interactive application needs this count in seconds, as the user types the criterion, to decide whether the matching set is worth materializing with a batch pipeline in which an LLM judges the records. Prior approximate query processing over such semantic predicates has an expensive model, the oracle, label a sample at query time, so every query waits for the oracle. We present SignalCount, a production system that answers COUNT queries with structured and semantic predicates and calls no oracle at query time, even for ad-hoc criteria. Its oracle is the production LLM judge, and the judge's logged verdicts calibrate, offline, the fast classifier that already runs in front of the judge. At query time, SignalCount counts the filtered set exactly and draws a uniform sample of at most 1,000 records in one columnar scan, scores the sample with the classifier, and multiplies the average calibrated probability by the exact count. Its 90% interval combines a sampling term with one-sided, rate-dependent margins for calibration error, fitted by split conformal prediction across tenants. In a multi-tenant production deployment, latency has a p99 of 3.8 s and stays flat as the filtered set grows beyond the sample. On tenants held out from fitting, the interval covers the count that the production pipeline returns in 92% of estimates, although estimates run about 15% high in aggregate, because a calibration nearly unbiased per record is still biased per criterion.
Create a lesson
Metadata
- Categories
- cs.DB, cs.AI
- Comments
- 12 pages, 5 figures, 5 tables
Related papers
CapCover Filter: Semantic Approximate Membership Queries over Embeddings
Shared title terminologycs.DBDvir David Biton, Shay Hahiashvili, Nadav Keren et al.
SJG: A Skyline Joint Graph for Multi-Component Approximate Nearest Neighbor Search
Shared title terminologycs.DBLinyun Ma, Rui Mao
Bridging the Discovery Gap in Solid Dataspaces with a Semantic Data Catalog
Shared title terminologycs.DBFlorian Hölken, Alexander Paulus, Tobias Meisen et al.
Towards Online Adaptive LLM-based Semantic Filtering
Shared title terminologycs.DBZiqi Zou, Zhenyan Nie, Kangfei Zhao et al.
Cascadeability and the Realization Gap: An Empirical Study of LLM-Powered Semantic Filtering
Shared title terminologycs.DBNan Hou, Kangfei Zhao, Jiadong Xie et al.
The Value Semantics Layer: Enabling Machine-Understandable Databases for Agentic AI
Shared title terminologycs.DBJalal Mahmud, Eser Kandogan