arXiv:2610.21139math.OCOct 2026

Manuscript Offprint

arXiv:2610.21139

When is a better LLM worth paying for? Stochastic Optimization with Switching Mixed-Fidelity Oracles

Swati Gupta, Tianjiao Li

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

Abstract

Large language models (LLMs) are increasingly used upstream of decision-making to clean data, detect label errors, and reconstruct missing values. Yet LLM-assisted data curation creates a new operational tradeoff: higher-fidelity models and richer prompts can be substantially more expensive, while the value of this additional fidelity depends on the downstream optimization accuracy. This raises the central question of this work: when should one pay for a better LLM, given a specific downstream task at hand?

We study this question through stochastic optimization with mixed-fidelity first-order oracles, which can have systematic bias and state-dependent variance. We develop two cost-aware algorithmic frameworks that allow adaptive switching between stochastic oracles. With known bias, the first meta-algorithm applies a restarted, cost-aware policy that adaptively selects oracle fidelity across optimization stages. Its cumulative cost is no larger than that of the best fixed oracle in hindsight and can be substantially smaller. With unknown bias, we develop a budgeted certification scheme that uses occasional trusted-gradient evaluations to certify the optimization progress and eliminate unsuccessful oracle sources, and show an explicit tradeoff between certification cost and delayed detection of biased sources. We provide concrete realizations of these meta-algorithms by applying biased stochastic gradient extrapolation (SGE) and recursive regularization under state-dependent noise as subroutines. Synthetic and LLM-completion experiments illustrate the qualitative switching behavior predicted by the theory: the adaptive policy skips several expensive LLM oracles and substantially reduces cumulative cost relative to fixed high-fidelity alternatives while achieving comparable accuracy. Our studies demonstrate that, when information quality can be purchased at different prices, the right fidelity need not be fixed; it depends on how valuable additional accuracy is at the current stage of the downstream decision problem.

1 Introduction

Large language models (LLMs) are evolving rapidly, with a growing number of models available through commercial APIs and open-source platforms. These models are increasingly used not only to make predictions, but also to prepare the data on which downstream decisions are based. Recent work uses LLMs for data cleaning and matching (Zhang et al., 2024; Parciak et al., 2024; Peeters et al., 2025), missing-value imputation (Hayat and Hasan, 2025; He et al., 2025; Wang et al., 2025b), denoising recommendation data (Wang et al., 2025c,a), and data annotation (Gilardi et al., 2023; Goel et al., 2023; Ye et al., 2025). In these applications, choosing a model or prompt affects not only

⋄^{\diamond}Tianjiao Li was at MIT when most of this work was performed.

Table 1. Representative LLM-completion pipelines at 10%10\% missingness. Cost is the one-time full-dataset completion price; Obj. is the clean downstream regression objective. The empirical diagnostics σλ,∗2\sigma_{\lambda, *}^2, Lλ\mathcal{L}_{\lambda}, and B^λ\widehat{\mathcal{B}}_{\lambda} are defined in Section 6. The "clean data" row is a benchmark and is unavailable to the adaptive policy. The bolded rows represent the stochastic oracles selected along the trajectory of our adaptive algorithm.

λCompletion pipelineCost ($)Obj.σλ,∗2/104\sigma_{\lambda,*}^{2}/10^{4}Lλ/103\mathcal{L}_{\lambda}/10^{3}B^λ\widehat{\mathcal{B}}_{\lambda}
-Clean data (benchmark)033548.286.480
1GPT-5.4 Nano, simple-70.18238239.416.485.85
2GPT-5.4 Nano, LR-short-70.16837229.126.483.95
3GPT-5.4 Nano, LR-short-100.18936919.116.483.26
4GPT-5.4 Nano, LR-100.18836659.166.482.87
5GPT-5.6 Luna, LR-100.82236178.696.482.31
6Claude Haiku 4.5, LR-101.41735968.716.482.01
7Claude Sonnet 5, LR-103.15835968.746.482.37
8Avg. Haiku+Sonnet, LR-104.57535818.686.481.86
9Avg. Luna+Haiku+Sonnet, LR-105.39735858.656.481.98

the cost of obtaining the data, but also its statistical quality for the downstream task. Stronger models, richer prompts, or ensembles may produce more accurate data, but often at a substantially higher price. The key question we consider in this work is: when is additional fidelity worth paying for? We explore this in the context of downstream optimization tasks, like supervised machine learning.

Consider a synthetic experiment on the Aspiring Minds hiring dataset with 10%10\% missing covariates (randomly masked). The goal is to predict ComputerProgramming scores of the candidates from numeric independent features like performance in high school, tier of the undergraduate college, agreeableness, etc. We ask different LLM model-prompt pipelines to reconstruct the missing values, which induces a stochastic-gradient oracle for downstream linear regression, with different fidelities. Table 1 reports their cost and representative fidelity parameters. Even within one model family, richer prompting can significantly change downstream fidelity at almost the same cost. Across different models, price and fidelity are not necessarily monotone. For example, Claude Sonnet 5 costs substantially more than Claude Haiku 4.5 while attaining essentially the same downstream objective in this experiment. Conversely, averaging several high-fidelity completions reduces bias but is much more expensive than a simple completion with GPT Nano. Thus neither “always use the cheapest model” nor “always use the best model” is compelling.

This question motivates us to propose a progress-dependent optimization strategy. Rather than committing to one oracle throughout optimization, we divide the optimization trajectory into stages of progressively finer accuracy. At a stage with current error scale RR, an oracle does not need to be the most accurate one available; it only needs to be accurate enough to support the next constant-factor reduction in optimization error. Among the oracles that can achieve this reduction, we choose the most cost-efficient one, i.e., the one with the smallest total stage cost. Therefore, when far from the optimum, a cheap but relatively noisy or biased oracle can be the most economical choice. As the target radius shrinks, the required bias level becomes more stringent and residual noise becomes more important, causing the algorithm to switch to higher-fidelity sources. This design is informed by recent studies on state-dependent behavior of stochastic optimization algorithms (Woodworth and Srebro, 2021; Juditsky et al., 2023; Ilandarideva et al., 2025). In the classical state-independent setting (Nemirovski et al., 2009; Lan, 2012), the stochastic gradient noise is assumed to

Figure

Figure 1. Schematic illustration of stage-dependent oracle switching. At coarse accuracy scales, a low-cost oracle can be sufficient for continued progress; as optimization approaches x∗x^{*}, higher-fidelity oracles become worthwhile or necessary. The actual switching points depend jointly on oracle cost, bias, variance, and the current optimization scale.

be uniformly bounded over the domain, which can be restrictive for important applications such as generalized linear regression with unbounded regressors. Under the more general state-dependent model, the noise level varies with the optimality state: the state-dependent component decreases as the iterates approach the optimum, while the residual component captures the irreducible noise at the optimum. With multiple priced oracles, these different scalings imply that the relative cost-efficiency of the oracles can change across optimization stages; thus there need not be a single oracle that is uniformly optimal throughout the trajectory. In our illustrative experiment with oracles shown in Table 1, this logic produces the progression from inexpensive Nano pipelines to Luna and eventually an ensemble, while skipping several more expensive alternatives like Sonnet altogether. This algorithmic idea is further illustrated in Figure 1. 1^{1}

Framework for Mixed-Fidelity Stochastic Oracles We consider a general model for stochastic optimization, where mixed-fidelity oracles can be used to provide stochastic gradients, with known costs and state-dependent bias and variance. The goal is to minimize

f∗:=min⁡x∈Xf(x),(1.1)f^{*}:=\min_{x\in X}f(x), \tag{1.1}

where X⊆RdX \subseteq \mathbb{R}^d is closed and convex, and ff is LL-smooth and μ\mu-strongly convex 2^2. For example, one can consider the least squares loss for any regression problem. We assume that we have access to

1^{1}Additionally, we use Claude Opus 5.5 to create an interactive playground https://claude.ai/artifact/AsfEe1aEpfKCkPv9YXsDEg for the reader to explore our algorithmic framework with different stochastic oracles.

2^{2}Here, a function f(⋅)f(\cdot) is LL-smooth and μ\mu-strongly convex if μ2∥x−y∥2≤f(x)−f(y)−⟨∇f(y),x−y⟩≤L2∥x−y∥2\frac{\mu}{2}\|x-y\|^2 \leq f(x) - f(y) - \langle \nabla f(y), x-y \rangle \leq \frac{L}{2}\|x-y\|^2 where ∥⋅∥\|\cdot\| denote the Euclidean norm ( ℓ2\ell_2-norm) in Rd\mathbb{R}^d.

ℓ\ell stochastic first-order oracles {SOλ}λ=1ℓ\{SO_\lambda\}_{\lambda=1}^\ell, where a query to SOλSO_\lambda costs cλc_\lambda and this is known to the user. The fidelity of the oracle is governed by three parameters: (i) the systemic bias of the oracle Bλ\mathcal{B}_\lambda; (ii) the state-dependent modulus Lλ\mathcal{L}_\lambda; (iii) the residual variance near the optimum σλ,∗\sigma_\lambda,^*. A query to SOλSO_\lambda at point xx returns a stochastic gradient Gλ(x,ξ)\mathcal{G}_\lambda(x,\xi) with mean gλ(x)=Eξ[Gλ(x,ξ)]g_\lambda(x)=\mathbb{E}_\xi[\mathcal{G}_\lambda(x,\xi)], and

∥gλ(x)−∇f(x)∥≤Bλ,(1.2)\|g_{\lambda}(x)-\nabla f(x)\|\leq\mathcal{B}_{\lambda}, \tag{1.2} E∥Gλ(x,ξ)−gλ(x)∥2≤Lλ[f(x)−f∗]+σλ,∗2.(1.3)\mathbb{E}\|\mathcal{G}_{\lambda}(x,\xi)-g_{\lambda}(x)\|^{2}\leq\mathcal{L}_{\lambda}[f(x)-f^{*}]+\sigma_{\lambda,*}^{2}. \tag{1.3}

The first condition captures systematic oracle bias. In our most general setting, we do not assume knowledge of the bias parameter. The second condition allows the stochastic variance to depend on the current optimization error: the component Lλ[f(x)−f∗]\mathcal{L}_{\lambda}[f(x) - f^*] decreases as optimization progresses, while the residual variance σλ,∗2\sigma_{\lambda,*}^2 is non-diminishing even near the optimum. This setting coincides with our framework where the noise introduced by stochastic oracles depend on the optimization progress. Together, Bλ,Lλ,σλ,∗2\mathcal{B}_{\lambda}, \mathcal{L}_{\lambda}, \sigma_{\lambda,*}^2, and the price cλc_{\lambda} determine the value of oracle λ\lambda at a given accuracy scale. In an LLM pipeline, an oracle may correspond to a model, prompt, ensemble, or human–AI combination, while ff represents the downstream objective rather than the upstream completion or annotation task itself. Section 2 gives concrete examples and verifies these assumptions for LLM-generated labels and completed covariates.

References (60)