TL;DR
Modern database engines let you query unstructured text using LLMs, relying on cheap "proxy" models to handle easy rows and escalating only the hard ones to expensive frontier models. However, an audit of state-of-the-art cascade systems reveals a startling secret: their promised statistical accuracy guarantees fail up to 90.5% of the time. This paper introduces ACTIS, an adaptive tuning framework that restores mathematical rigor to LLM cascades—delivering rock-solid precision and recall guarantees while slashing expensive LLM calls by up to 5.1×.
What Problem Does This Paper Address?
Imagine running a SQL-style WHERE clause over a million customer reviews using a natural language prompt—a semantic filter. Asking a frontier LLM (the "oracle") to read every single row would bankrupt your compute budget and take hours.
To make this practical, semantic databases use two-threshold model cascades. First, a fast, cheap proxy model (like Llama-3.2-1B) scores every record from 0 to 1. Scores above an upper threshold ($\hat{\tau}$) are immediately marked True; scores below a lower threshold ($\check{\tau}$) are marked False; and only the ambiguous middle ground is sent to the expensive oracle.
Because a database silently dropping valid rows is unacceptable, systems tune these thresholds on a sample of oracle-labeled data to guarantee user-specified precision and recall targets (say, 95% accuracy with 95% probability). The problem? When the authors audited popular frameworks like LOTUS and ScaleDoc, they found those guarantees frequently evaporate in practice due to uncorrected multiple hypothesis testing and fragile approximations on skewed data. Meanwhile, the only existing statistically sound baseline (BARGAIN) samples uniformly—wasting thousands of expensive oracle calls scanning obvious negatives when hunting for rare needles in a haystack.
Methods
Rather than guessing a fixed pilot sample size upfront, ACTIS (Adaptive Cascade Tuning via Importance Sampling) treats threshold tuning as an online query optimization problem. After scoring all rows offline with the proxy, ACTIS queries the oracle in small sequential batches using four novel mechanisms:
- Anytime-Valid Testing with Safeguards: Repeatedly checking standard confidence intervals after every new batch inflates false-positive rates (the classic "peeking problem"). ACTIS uses asymptotic Gaussian mixture test processes that allow continuous monitoring without penalty, paired with three finite-sample safeguards (like an exact binomial check) so early lucky streaks don't trick the system into stopping prematurely.
- Decoupled Fixed-Sequence Testing: Searching a 2D grid of $(\check{\tau}, \hat{\tau})$ pairs usually requires severe statistical penalties (like Bonferroni corrections) that demand massive sample sizes. Noticing that recall depends only on the lower threshold, ACTIS decouples the 2D grid into two sequential 1D scans, testing monotonically so it can explore fine-grained upper thresholds with zero multiplicative statistical penalty.
- Variance-Minimizing Importance Sampling: Instead of sampling rows uniformly, ACTIS derives a closed-form sampling distribution that concentrates oracle queries on high-uncertainty regions and rare positives, guarded by score clipping and uniform mixing against miscalibrated proxies.
- Value-of-Information Stopping: ACTIS maintains both conservative and "optimistic" threshold bounds, halting the tuning loop the exact moment the cost of labeling one more batch exceeds the expected oracle calls saved across the rest of the table.
Datasets
The authors evaluate ACTIS across 42 benchmarks derived from 23 existing datasets/queries spanning three suites (no new raw datasets are introduced, though text corpora are freshly paired with modern cloud and local proxies):
- Pre-LLM Vision & NLP: ImageNet, Jackson, Onto, and TACRED (11k to 973k rows; positive rates down to 0.1%).
- General Text Corpora: Court, Review, Screenplay, and Wiki (1k to 10k rows).
- Technical Documents: PubMed, BigPatent, and GovReport (10k rows each).
Key Insights and Ideas
- An unsound SLA is worse than no SLA: Prior methods appear cheap largely because statistical shortcuts let them pick overly aggressive thresholds—missing a 95% accuracy target by up to 76 percentage points (LOTUS) and 86 percentage points (ScaleDoc) in the worst cases.
- Asymptotic math needs seatbelts on skewed tables: Without ACTIS's finite-sample safeguards, even rigorous asymptotic anytime-valid tests violate error budgets on 3.6% of scenarios when positive matches are rare and early batches have zero variance.
- Selectivity and calibration drive importance sampling: Importance sampling shines brightest when target matches are rare (<5% of data) and the proxy ranks items well, cutting oracle calls by up to 80% compared to uniform sampling.
Key Results
- Zero Soundness Violations: Across 1,000 independent trials per scenario over all 42 benchmarks, ACTIS (and its uniform non-asymptotic variant, ACTIS-U) achieved 0.0% certified unsound runs. At a 95% target ($\delta = 0.05$), LOTUS and ScaleDoc were certified unsound on 90.5% and 64.3% of benchmarks, respectively.
- Up to 5.1× Fewer Oracle Calls: Compared to BARGAIN (the only statistically valid baseline), ACTIS matched or reduced oracle invocations on 39 of 42 benchmarks. On the highly selective ImageNet workload (0.1% positives), BARGAIN exhausted 100% of the dataset looking for positives, whereas ACTIS met the guarantee while calling the oracle on just 19.6% of rows.
- Interactive Query Planning: ACTIS's tuning math adds a median CPU overhead of just 27.3 ms (under 90 ms on 41 of 42 benchmarks), scaling to the million-row Jackson table in 0.55–3.45 seconds while saving over 355,000 oracle calls.
Limitations and Future Work
ACTIS assumes proxy scores are precomputed offline for the entire table before tuning begins, and optimizes a single semantic filter in isolation rather than jointly optimizing multi-operator query plans (like semantic joins or aggregations). Furthermore, even with an ideal proxy, statistical certification inherently requires a minimum floor of oracle calls to mathematically prove a tight error budget—creating an unavoidable cost gap compared to an omniscient tuner. The authors call on the broader database community to make rigorous empirical auditing standard practice for probabilistic query optimizers.
Summary updated