Cut Costs, Not Accuracy: LLM-Powered Data Processing with Guarantees

Sepanta Zeighami, Shreya Shankar, Aditya G. Parameswaran · DOI

Introduction

Processing large-scale datasets with state-of-the-art Large Language Models (LLMs) like GPT-4o or Claude 3.5 Sonnet is often prohibitively expensive. While cheaper "proxy" models (e.g., GPT-4o-mini) offer a cost-effective alternative, their lower accuracy can compromise the integrity of data processing tasks such as filtering, extraction, and classification. To bridge this gap, researchers use model cascades, which route queries to a cheap proxy first and only escalate to an expensive "oracle" model when the proxy's confidence is low.

The Cascade Threshold Problem

The efficiency of a model cascade hinges on the cascade threshold: the confidence score above which a proxy's answer is accepted. Setting this threshold involves a critical trade-off. A threshold that is too low risks failing the user's accuracy requirements, while a threshold that is too high wastes money on unnecessary oracle calls.

Overview of model cascade inference and threshold selection.

Existing methods, such as SUPG, typically rely on the Central Limit Theorem to estimate threshold quality. However, these asymptotic guarantees often fail in practice, particularly with small sample sizes or rare labels, leading to reliability gaps. Furthermore, uniform sampling strategies used by these methods often waste the labeling budget on uninformative data points.

The BARGAIN Framework

This paper introduces BARGAIN, a framework designed to find optimal cascade thresholds with rigorous, non-asymptotic mathematical guarantees. BARGAIN improves upon previous methods through three key innovations:

  1. Variance-Aware Estimation: Instead of standard Hoeffding bounds, BARGAIN utilizes betting-based hypothesis testing. By incorporating the empirical variance of samples, BARGAIN recognizes that high-accuracy thresholds have low variance. This allows for tighter statistical bounds, enabling the system to prove a threshold meets target quality using significantly fewer oracle labels.
  2. Adaptive Sampling: Rather than sampling a fixed batch upfront, BARGAIN evaluates candidate thresholds iteratively in descending order of proxy confidence. It pulls oracle labels on-the-fly and stops early if a threshold is clearly non-viable, preserving the budget for more promising candidates.
  3. Smart Threshold Selection: BARGAIN employs a tolerance parameter to manage the statistical "budget" across multiple thresholds, preventing the algorithm from becoming overly conservative and sacrificing cost savings.

Experimental Evaluation

The authors evaluated BARGAIN across eight real-world datasets, including standard benchmarks like ImageNet and new LLM-specific datasets involving court opinions and Wikipedia talk pages.

Comparison of oracle calls avoided and threshold selection accuracy.

The results demonstrate that BARGAIN consistently outperforms state-of-the-art baselines. For Accuracy Target (AT) queries, BARGAIN reduced expensive oracle calls by up to 86% more than SUPG. While SUPG frequently failed to meet user-defined targets in adversarial or rare-label scenarios—missing targets over 75% of the time in some tests—BARGAIN strictly adhered to the specified failure probability ($\delta$).

Beyond accuracy, BARGAIN showed significant gains in other metrics. For Precision Target (PT) queries, it improved recall by up to 118% over SUPG, and for Recall Target (RT) queries, it improved precision by up to 19%.

Conclusion and Future Work

BARGAIN provides a robust solution for cost-effective LLM data processing without sacrificing reliability. By moving away from asymptotic assumptions and embracing adaptive, variance-aware sampling, it achieves superior cost savings while maintaining strict quality guarantees.

Currently, BARGAIN is optimized for classification and filtering tasks where proxies provide clear confidence scores. Future research aims to extend this framework to open-ended generative tasks and complex relational operations like semantic joins, where additional structural properties can be exploited for further optimization.

Summary updated

BibTeX
@article{zeighami2025cut,
  author = {Sepanta Zeighami and Shreya Shankar and Aditya G. Parameswaran},
  title = {{Cut Costs, Not Accuracy: LLM-Powered Data Processing with Guarantees}},
  journal = {Proc. ACM Manag. Data},
  year = {2025},
  doi = {10.1145/3769776},
}
Figure