arXiv:2611.05835cs.LGNov 2026

Manuscript Offprint

arXiv:2611.05835

Pathwise-Budgeted LLM Routing: Online Allocation with K-Bit Tail-Cost Learning

Hanzhang Qin, Sophie H. Yu, Yuewei Zhang, Zhi-Hai Zhang

Abstract

Firms using large language models under fixed budgets must decide which model to call and whether to retry a failed task. Because a call's charge is revealed only after completion, one long response can exhaust the remaining budget and leave later tasks unserved. Our objective is to maximize the number of tasks solved before service stops. We develop a contextual bandit policy, ADP-HT, which learns each model's task-specific success probability and constructs conservative cost estimates from coarsened response-length labels on a quantile grid with 2K2^K intervals. The policy weighs predicted success against these costs, adjusting the cost penalty to realized spending and the budget available per remaining task. Under calibration, local regularity, and grid-coverage conditions, we bound the excess allowance in the policy's conservative cost estimates. At a fixed sample size, increasing KK reduces the discretization term but increases the estimation allowance. At the tightest tested budgets, ADP-HT solves more than twice as many MATH500 and GPQA tasks as the best implemented baseline. It achieves the highest mean cumulative score at ten of fourteen RouterBench budgets. On LiveCodeBench, it outperforms a deployed commercial router in both default and cost-saving modes at the three lowest test budgets.

Keywords: Bandits with knapsacks; Pathwise budgets; Online resource allocation; Quantized feedback; LLM routing.

Contents

1 Introduction2
2 Literature Review4
2.1 Online Resource Allocation under Random Consumption4
2.2 Tail-Sensitive Learning with Coarsened Cost Feedback5
2.3 Cost-Aware and Sequential LLM Routing5
3 Problem Statement6
3.1 Tasks, Models, and Information6
3.2 Decision Process7
3.3 Pathwise Budget and Stopping Rule7
3.4 Objective8

*Authors are listed in alphabetical order.

H. Qin is with the Department of Industrial Systems Engineering and Management, National University of Singapore, hzqin@nus.edu.sg. S. H. Yu is with The Wharton School of Business, University of Pennsylvania, Philadelphia PA, USA, hyophie@wharton.upenn.edu. Y. Zhang is with the Department of Industrial Engineering, Tsinghua University, Beijing, China, zyw23@mails.tsinghua.edu.cn. Z.H Zhang is with the Department of Industrial Engineering, Tsinghua University, Beijing, China, zhzhang@tsinghua.edu.cn.

Y. Zhang is the corresponding author.

4 Methodology 8 4.1 Reward Learner ..... 9 4.2 Cost Learner ..... 10 4.3 Dual-Pace Controller ..... 12 4.4 Model Selection and Retry Gate ..... 13 5 Numerical Experiments 15 5.1 Experiment 1: Routing and Retries Under a Binding Budget ..... 15 5.2 Experiment 2: Comparison on a Public Benchmark ..... 17 5.3 Experiment 3: Comparison with a Deployed Commercial Router ..... 19 6 Conclusion 19 EC.1 Proof and Calibration Details 25 EC.2 Implementation and Evaluation Details 30 EC.3 Cost-Head Ablation on RouterBench 35 EC.4 Validation and Analysis in a Numerical Example 36 EC.5 Tail Costs and the Value of Future Service 40

References (100)

Couldn't load all references. Reload the page to try again.