arXiv:2611.08367cs.DBNov 2026

Manuscript Offprint

arXiv:2611.08367

CascadeFilter: Cost-Efficient Semantic Filtering with Joint Threshold Selection

Yanji He, Tao Zhong, Hongyang Chen, Xiaobo Zhang, Mingyu Yang, Wei Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yanji He1^{1}, Tao Zhong2^{2}, Hongyang Chen3^{3}, Xiaobo Zhang4^{4}, Mingyu Yang1^{1}, and Wei Wang1,5^{1,5}

1^{1}The Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China;

2^{2}University of New South Wales, Sydney, Australia;

3^{3}Zhejiang Lab, Hangzhou, China; 4^{4}Southwest Jiaotong University, Chengdu, China;

5^{5}The Hong Kong University of Science and Technology, Hong Kong SAR, China

yhe720@connect.hkust-gz.edu.cn; tao.zhong@unswalumni.com; dr.h.chen@ieee.org;

zhangxb@swjtu.edu.cn; myang250@connect.hkust-gz.edu.cn; weiwcs@ust.hk

Abstract—Semantic filtering selects records that satisfy a natural-language predicate and is an important operation in data analytics based on large language models (LLMs). Executing an expensive model on every document incurs substantial inference cost. Existing approaches reduce this cost by accepting predictions from cheaper models and forwarding uncertain records to an oracle. Task Cascades further varies document portions and operations, and provides an accuracy-guaranteed extension. However, its threshold calibration follows a prescribed adjustment sequence after cascade assembly, rather than minimizing cost over alternative combinations of stage thresholds.

Motivated by this, we propose CascadeFilter, a three-stage semantic filtering method that jointly searches the thresholds for a small language model operating on extracted evidence and full documents, with unresolved records forwarded to the oracle. For a fixed cascade, we formulate threshold selection as minimizing token-aware cost subject to an oracle-relative error constraint, and select the least-cost certified configuration in a pre-specified grid. A finite-population calibration procedure bounds oracle-relative error after selection, using fixed-sequence tests on threshold tracks to allocate the multiple-testing budget. We further combine lexical and dense retrieval, reranking, and neighborhood-supported confidence to improve evidence extraction and routing. These components enhance the cascade while leaving its certification interface unchanged. Across six datasets and 13 evaluation settings, the reported results have the highest benchmark accuracy and macro-averaged F1 score in 12 settings each. These comparisons describe the reported operating points; the accuracy guarantee concerns agreement with the oracle.

I. INTRODUCTION

Semantic filtering identifies the records in a corpus that satisfy a natural-language predicate. Given a collection of documents and a query such as “does this review mention a billing issue?”, the operation returns the documents for which the predicate is true. Large language models (LLMs) make such predicates available in data systems without requiring users to specify extraction rules or train a classifier for each query [1]–[3]. Applications include selecting customer reviews by aspect, identifying dialogue outcomes, and checking whether textual evidence supports a claim. These applications require semantic decisions over large collections, making efficient execution of the filtering operation an important problem. Unlike a predicate over a structured attribute, a semantic predicate may depend on paraphrases, relationships between sentences, or the

context in which a statement appears. A review can describe a billing problem without using that exact phrase, while a document containing those words need not report a problem. Retrieving a relevant passage helps identify evidence, but does not by itself replace the final semantic decision.

A direct execution strategy invokes a capable LLM on every document. Although simple, this strategy repeatedly pays for processing the entire input and generating a decision, even when a short passage is sufficient to answer the predicate. Its cost increases with both the number and length of documents. A cheaper small language model (SLM) can reduce inference cost, but accepting all its predictions can reduce accuracy. A model cascade therefore uses the cheaper model first and forwards uncertain records to a more expensive reference model, called the oracle. The objective is to reduce the total execution cost while meeting a user-specified accuracy target. Here accuracy is certified relative to the oracle; agreement with benchmark ground truth is evaluated separately because the oracle can itself make mistakes. Two decisions determine execution cost: how much text to process and which model to invoke. A short input can omit necessary evidence; a full document can supply that evidence without requiring a stronger model. Conversely, some records remain difficult even with full context. The execution policy should distinguish these cases and account for both input and output tokens.

Existing work addresses this cost-accuracy tradeoff through model routing, proxy prediction, and cascade execution. FrugalGPT and RouteLLM select among models with different costs and capabilities [4], [5]. LOTUS supports approximate semantic execution, while BARGAIN provides variants with statistical guarantees on accuracy, precision, or recall [1], [6]. ScaleDoc uses document representations and lightweight proxy models to reduce expensive predicate evaluations [7]. These methods motivate using inexpensive computations to resolve easy records. Task Cascades extends this idea by varying the model, document portion, and operation within a cascade [8]. Thus, exploiting shorter inputs and providing an accuracy guarantee are established directions; our focus is how to select coupled routing thresholds under an explicit cost objective.

The State-of-the-art. Task Cascades [8] generates candi-date tasks using alternative models, document portions, and simplified or related operations. It first sets class-specific thresholds for individual tasks on development data, then greedily assembles a cascade from these tasks. Its accuracy-guaranteed extension subsequently adjusts the assembled cascade's thresholds on a validation split. In particular, it moves the thresholds together along a prescribed sequence of score-based offsets and tests the resulting cascade, stopping when certification fails [8]. This procedure already accounts for cascade-level accuracy and should not be characterized as merely calibrating each stage independently. However, the guarantee adjustment is a post-processing step rather than a cost optimization over threshold combinations. Changing an early threshold changes both the number and composition of records reaching later stages. Consequently, different combinations can have different costs even when they meet the same accuracy target. This motivates jointly searching thresholds for a fixed cascade structure and comparing certified candidates by their total token cost. For example, relaxing the first threshold accepts additional records cheaply, but changes the error budget available downstream. Tightening the second threshold can compensate by forwarding more records to the oracle. Whether this exchange saves cost depends on which records move between stages and their processing costs. Evaluating each threshold separately cannot in general determine the best exchange. This comparison concerns threshold selection; our fixed structure does not subsume the broader task-generation capabilities of Task Cascades.

Our Idea. We propose CascadeFilter, which processes each record using an SLM on extracted evidence, then the SLM on the full document if needed, and finally the oracle for unresolved records. We formulate cost-minimizing threshold selection for this fixed cascade. The objective and feasible set are generally nonconvex, but error decreases with the second-stage threshold when the first is fixed. This structure motivates searching the two acceptance thresholds jointly over a grid fixed before calibration. For each pair, we account for errors across the complete cascade and certify oracle-relative accuracy using a sample drawn without replacement from the deployment population. We organize candidates into monotone tracks and apply fixed-sequence testing within each track, allocating the failure budget across tracks. We then select the least-cost certified candidate; this need not recover the true feasible optimum even within the grid. To improve the inputs and routing scores, we combine Best Matching 25 (BM25) lexical retrieval [9] with dense retrieval using reciprocal rank fusion (RRF), rerank the resulting chunks, and incorporate embedding-neighborhood support into model confidence. These established retrieval components support the threshold-search design rather than constitute separate claims of new retrieval algorithms. The resulting method couples cost-aware selection with finite-population certification while retaining flexibility in evidence extraction and routing. The candidate grid and routing scores are frozen before calibration, preventing calibration labels from being reused to construct new policies. For each fixed first-stage threshold, second-stage candidates form a conservative-to-lenient sequence, allowing testing to stop at the first uncertified candidate. Searching across tracks retains alternative first-stage choices. If no candidate certifies, the method uses the oracle. The guarantee applies to the specified population and requires fresh calibration for deployment on a new population.

Contributions. We summarize our contributions as follows:

  • Joint Threshold Selection (Section III). We develop a three-stage semantic filtering method and jointly search its coupled thresholds, accounting for both context length and model cost. The search returns the least-cost certified configuration in a pre-specified grid.

  • Finite-Population Certification (Section IV). We instantiate a without-replacement betting bound for cascade error and combine monotone tracks with fixed-sequence testing to control oracle-relative error after threshold selection. The betting method and fixed-sequence testing are existing tools; our contribution is their application to the coupled search.

  • Evidence and Routing Enhancements (Section III). We integrate hybrid retrieval, reranking, batched evidence inference, and neighborhood-supported confidence into the cascade. These components improve the candidate policies evaluated by the certification procedure.

  • Experimental Analysis (Section V). We evaluate six datasets with 13 settings and study cascade structure, routing components, and calibration behavior. The main table reports the highest reported benchmark accuracy and macro-averaged F1 score in 12 settings each, at the evaluated operating points.

Due to space limitations, proofs and supplementary details are provided in Appendix A, which serves as the technical report for this version. Code is available at https://github.com/ocean-usXXD/cascade.

References (51)