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.
Figures & tables
Figure 1. Shaping a cohort as the user types the criterion. Each estimate arrives in seconds; bars show its likely range against the screening capacity (dashed). Saving runs the batch pipeline. A cohort builder for trial recruitment. Filter chips read Diagnosis Type 2 diabetes, Age 40 to 70, Seen since Jan 1 and Near a trial site, and 50,000 patients match. The criterion box reads Stopped metformin because blood sugar stayed high. Below it, the versions of the criterion are listed newest first, each with its estimate and the time the estimate took: the current one, Stopped metformin because blood sugar stayed high, about 2,000 patients, estimated in 2.5 seconds; and, grayed out, Stopped metformin, about 4,000 patients in 2.7 seconds, and Tried metformin, about 9,000 patients in 2.4 seconds. Under each attempt, a bar shows its likely range against a dashed line at a screening capacity of 3,000 charts; only the current range lies below it. At the bottom, About 2,000 patients match your filters and criterion, next to a button Save cohort and find all patients.
Figure 2. Latency of 112 production estimates against the size of the filtered set. Sets of at most 1,000 records are scored in full (shaded). Lines join percentiles per size group. Scatter plot of end-to-end latency against filtered-set size on a log axis for 112 estimates, with percentile lines per size group and a dashed 5 second line. Latency rises with size up to 1,000 records, where the whole set is scored, and stays flat near 2.5 to 3.9 seconds above that, below the 5 second line.
Figure 3. Request path of an estimate. Every stage after the analytical query does work bounded by the sample cap of 1,000. Labels give p90 / p99 per stage over the latency workload (Section 5.2 ). A left-to-right pipeline of five boxes: API route, analytical query on a columnar store, document fetch from a row store, scoring with one classifier call per record, and the estimator, which returns the estimate, interval, flags and counts to the route. The query, fetch and scoring boxes are labeled with p90 and p99 latencies of 812/1045, 481/1365 and 1753/2294 ms.
Table, pairs
Pairs
All
≥ 0.10
Initial, in-sample study
188,757
0.0065
0.0262
Initial, main study
1,660,862
0.0083
0.0275
Deployed form, main study, out of fold
1,660,862
0.0037
0.0012
Calibrated probability
Records
Predicted
Observed
0 (score below 0.10)
1,373,189
0
0.0042
[0,0.1)
20,165
0.0736
0.0573
Table 1. Expected calibration error of the calibration table. Out of fold: refitted on 5 tenant folds of the main study’s pairs, each pair scored by the table fitted without its tenant. Bottom: reliability of the initial table on the main study’s pairs.
Quantity
Meaning
Set
N
size of the filtered set
per query, counted exactly
n
records scored, at most 1,000
per query
Yi , θ
verdict on record i (1 or 0); true count, their sum
unknown at query time
pi
record i ’s calibrated probability
per record, read from the table
pˉ , θ^
estimated rate; estimate Npˉ
per query, from the sample
V , W
variance of pi ; average of pi(1−pi)
per query, from the sample
Table 2. Quantities in the interval, and when each is set.
Figure 4. The running example’s 90% interval around the estimate of 2,000 patients: the calibration margin (wider on the low side) and the sampling term on each side. Of the width of 2,390, the margins contribute about 1,490 and the sampling term about 900; the floor of about 115 patients does not bind. A horizontal bar on a patient-count axis showing the interval from 418 to 2,808 around an estimate of 2,000. Each side is split into a calibration-margin segment and a sampling segment of about 450 patients, and the low-side margin segment is the widest.
Estimated rate
below 1%
1–5%
5–20%
above 20%
Group center
0.3%
2.24%
10%
44.7%
Low factor fL
0.81
0.47
0.38
0.53
High factor fU
1.31
1.11
1.30
1.53
Table 3. Deployed margin factors by estimated-rate group.
Latency
In-sample
Main
Tenants
fewer than 25
fewer than 25
hundreds
Estimates issued / answered
112 / 112
244 / 244
2,123 / 2,119
Filtered sets
112
142
1,687
Criteria
14
136
1,766
Estimates per tenant, median / max
7 / 20
13 / 19
1 / 19
N , median
2,435
5,561
2,362
Table 4. The three workloads. Size and predicate rows count each issued filtered set once. True-count rows count answered estimates and leave out the in-sample study’s 23 check pairs.
Figure 5. Coverage on held-out tenants over 200 repeated tenant splits, by group, for the deployed calibration: mean (dot and number) and 5th percentile (line end). Dot plot of the deployed calibration's interval coverage, overall and by estimated rate, filtered-set size and true rate, with dots at the mean over 200 tenant splits and lines to the 5th percentile, against the nominal 90 percent. The deployed calibration's mean is 0.920 overall and between 0.90 and 0.951 in every group except sets of 1k to 10k records at 0.881.
Interval
Coverage
Worst group
Width
Global symmetric margin
90.0%
–
1.79
Global one-sided pair
90.3%
80.7%
–
One-sided per group
90.5%
90.4%
1.50
EM prior shift + margins
≤ 86.3%
–
7.63
Point estimate
Med. err.
< 1%
1–5%
5–20%
> 20%
Averaging (SignalCount)
29.6%
1.45
1.58
1.12
0.92
Table 5. Design alternatives, evaluated out of fold. Top: intervals on the main study, cross-fitted by tenant. Bottom: point estimates on the 208 positive-truth in-sample estimates with reproduced scores, 5 tenant folds, initial calibration; ratio of sums by true rate.