Cut Costs, Not Accuracy: LLM-Powered Data Processing with Guarantees
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are being increasingly used as a building block in data systems to process large text datasets. To do so, LLM model providers offer multiple LLMs with different sizes, spanning various cost-quality trade-offs when processing text at scale. Top-of-the-line LLMs (e.g., GPT-4o, Claude Sonnet) operate with high accuracy but are prohibitively expensive when processing many records. To avoid high costs, more affordable but lower quality LLMs (e.g., GPT-4o-mini, Claude Haiku) can be used to process records, but we need to ensure that the overall accuracy does not deviate substantially from that of the top-of-the-line LLMs. The model cascade framework provides a blueprint to manage this trade-off, by using the confidence of LLMs in their output (e.g., log-probabilities) to decide on which records to use the affordable LLM. However, existing solutions following this framework provide only marginal cost savings and weak theoretical guarantees because of poor estimation of the quality of the affordable LLM's outputs. We present BARGAIN, a method that judiciously uses affordable LLMs in data processing to significantly reduce cost while providing strong theoretical guarantees on the solution quality. BARGAIN employs a novel adaptive sampling strategy and statistical estimation procedure that uses data and task characteristics and builds on recent statistical tools to make accurate estimations with tight theoretical guarantees. Variants of BARGAIN can support guarantees on accuracy, precision, or recall of the output. Experimental results across 8 real-world datasets show that BARGAIN reduces cost, on average, by up to 86% more than state-of-the-art, while providing stronger theoretical guarantees on accuracy of output, with similar gains when guaranteeing a desired level of precision or recall.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 20 of its 50 references that are in the map. First posted on arXiv 2 Sep 2025.
Builds on
20 of 50 references.
References · 20
- 2023FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performancecited by 853
- 2020How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answeringcited by 445
- 2022Can Foundation Models Wrangle Your Data?cited by 175
- 2020Estimating means of bounded random variables by bettingcited by 169
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 138
- 2023Language Models Enable Simple Systems for Generating Structured Views of Heterogeneous Data Lakescited by 111
- 2020ConvoKit: A Toolkit for the Analysis of Conversationscited by 72
- 2024DocETL: Agentic Query Rewriting and Evaluation for Complex Document Processingcited by 52
- 2018BlazeIt: Optimizing Declarative Aggregation and Limit Queries for Neural Network-Based Video Analyticscited by 41
- 2024A Declarative System for Optimizing AI Workloadscited by 37
- 2024The Design of an LLM-powered Unstructured Analytics Systemcited by 20
- 2018Physical Representation-based Predicate Optimization for a Visual Analytics Databasecited by 19
8 more
- 2020Approximate Selection with Guarantees using Proxiescited by 15
- 2025ThriftLLM: On Cost-Effective Selection of Large Language Models for Classification Queriescited by 14
- 2020Semantic Indexes for Machine Learning-based Queries over Unstructured Datacited by 11
- 2023Solo: Data Discovery Using Natural Language Questions Via A Self-Supervised Approachcited by 11
- 2021Accelerating Approximate Aggregation Queries with Expensive Predicatescited by 10
- 2022On Efficient Approximate Queries over Machine Learning Modelscited by 7
- 2023Accelerating Aggregation Queries on Unstructured Streams of Datacited by 4
- 2024SMART: Automatically Scaling Down Language Models with Accuracy Guarantees for Reduced Processing Feescited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 8.
9 papers.
- 2025ScaleDoc: Scaling LLM-based Predicates over Large Document Collectionscited by 3
- 2026Streaming Model Cascades for Semantic SQLcited by 3
- 2026Fast LLM-Based Semantic Filtering: From a Unified Framework to an Adaptive Two-Phase Methodcited by 2
- 2026Kalypso: Relational LLM Servingcited by 2
- 2026Beyond Linear LLM Invocation: An Efficient and Effective Semantic Filter Paradigmcited by 1
- 2026Position: the Stochastic Parrot in the Coal Mine. Model Collapse is a Threat to Low-Resource Communitiescited by 1
- 2026Evergreen: Efficient Claim Verification for Semantic Aggregatescited by 0
- 2026Credo: Reusable Declarative Primitives for Agentic Workflowscited by 0
- 2026Same Query, Different Answer: Run-to-Run Variance in Semantic Query Processingcited by 0
- 2026Same Query, Different Answer: Run-to-Run Variance in Semantic Query Processing9 Oct 2026
- 2026Credo: Reusable Declarative Primitives for Agentic Workflows28 Aug 2026
- 2026Kalypso: Relational LLM Serving26 Jul 2026
- 2026Fast LLM-Based Semantic Filtering: From a Unified Framework to an Adaptive Two-Phase Method6 Jun 2026
- 2026Position: the Stochastic Parrot in the Coal Mine. Model Collapse is a Threat to Low-Resource Communities5 May 2026
- 2026Evergreen: Efficient Claim Verification for Semantic Aggregates28 Apr 2026
- 2026Streaming Model Cascades for Semantic SQL1 Apr 2026
- 2026Beyond Linear LLM Invocation: An Efficient and Effective Semantic Filter Paradigm5 Mar 2026
- 2025ScaleDoc: Scaling LLM-based Predicates over Large Document Collections16 Sep 2025