动态环境中实时选LLM,兼顾成本与响应速度。
Online LLM Selection via Constrained Bandits with Time-Varying Demand

- 用带约束的在线学习算法自动选模型
- 在资源受限下实现低延迟与高准确率
- 适合边缘计算、云服务等实际部署场景
大型语言模型(LLMs)被越来越多地部署于边缘-云推理系统中,以应对用户任务的多样性,其性能表现存在异质性,涉及准确率、延迟和成本等多个维度。为每个任务选择合适的模型对保障服务质量与资源利用效率至关重要。然而,模型异质性、未知的随机性能特征以及随时间变化的任务需求,使得静态选择策略失效。真实部署常面临硬性资源预算(如支出上限)和软性服务水平要求(如延迟保证)双重约束,增加了在线决策难度。本文将该问题建模为一种带有时间变化需求的约束随机多臂赌博机问题,学习者需在打包型(硬性)与覆盖型(软性)约束下,通过部分反馈信息进行模型序列选择。我们提出一种新型在线学习算法,结合置信区间估计与需求预测,平衡奖励最大化与长期约束满足。理论分析表明,该算法相比具备完整信息的离线基准,具有次线性遗憾与次线性覆盖约束违规。在合成工作负载上的实验验证了方法在动态、资源受限环境下的有效性与鲁棒性。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are increasingly deployed in edge-cloud inference systems to handle diverse user tasks with heterogeneous accuracy, latency, and cost profiles. Selecting the appropriate LLM for each incoming task is critical for ensuring service quality and efficient resource utilization. However, model heterogeneity, stochastic and unknown performance characteristics, and time-varying task demands make static selection strategies inadequate. Real-world deployments often impose hard resource budgets such as monetary expenditure limits, along with soft service-level requirements such as latency guarantees. These constraints introduce additional challenges for online decision-making. We formulate this problem as a constrained stochastic bandit learning task, where the learner sequentially selects models under both packing-type (hard) and covering-type (soft) constraints, while adapting to time-varying task demand. The learner operates without access to the underlying reward, cost, or latency distributions and must rely on partial feedback. We develop a novel online learning algorithm that leverages confidence-bound estimates and demand predictions to balance reward maximization with long-term constraint satisfaction. We provide theoretical guarantees showing sublinear regret and sublinear covering constraint violations compared to an offline benchmark with full information. Experimental results on synthetic workloads demonstrate the effectiveness and robustness of our approach in dynamic, resource-constrained environments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。