让小模型靠大模型给提示,大幅降低推理成本。
Pay for Hints, Not Answers: LLM Shepherding for Cost-Efficient Inference
- 只向大模型索取部分提示,交由小模型完成任务。
- 在数学与代码任务上成本降低42%-94%,准确率不降。
- 适合需要高效推理的部署场景,尤其关注成本优化者。
大型语言模型(LLM)在复杂推理任务上表现卓越,但推理成本限制了大规模部署。小型语言模型(SLM)虽成本低,但准确率差距显著。现有方法如路由和级联将LLM视为全有或全无资源:要么完全跳过,要么以全成本生成完整响应。本文提出LLM Shepherding框架,仅向LLM请求短前缀(提示),并将其提供给SLM。该机制在数学与编程任务中效果显著:即使提示仅占完整响应的10%-30%,也能显著提升SLM准确率。Shepherding同时涵盖路由与级联,且在理想决策下成本更低。我们设计了两阶段预测器,联合判断是否需提示及请求多少令牌。在广泛使用的数学推理(GSM8K、CNK12)和代码生成(HumanEval、MBPP)基准上,相较纯LLM推理,成本降低42%-94%;相比最先进路由与级联基线,成本最高可降低2.8倍,同时保持相同准确率。据我们所知,这是首个利用令牌级预算控制实现SLM-LLM协作的工作。
原文摘要 · Abstract (English)
Large Language Models (LLMs) deliver state-of-the-art performance on complex reasoning tasks, but their inference costs limit deployment at scale. Small Language Models (SLMs) offer dramatic cost savings yet lag substantially in accuracy. Existing approaches - routing and cascading - treat the LLM as an all-or-nothing resource: either the query bypasses the LLM entirely, or the LLM generates a complete response at full cost. We introduce LLM Shepherding, a framework that requests only a short prefix (a hint) from the LLM and provides it to SLM. This simple mechanism is surprisingly effective for math and coding tasks: even hints comprising 10-30% of the full LLM response improve SLM accuracy significantly. Shepherding generalizes both routing and cascading, and it achieves lower cost under oracle decision-making. We develop a two-stage predictor that jointly determines whether a hint is needed and how many tokens to request. On the widely-used mathematical reasoning (GSM8K, CNK12) and code generation (HumanEval, MBPP) benchmarks, Shepherding reduces costs by 42-94% relative to LLM-only inference. Compared to state-of-the-art routing and cascading baselines, shepherding delivers up to 2.8x cost reduction while matching accuracy. To our knowledge, this is the first work to exploit token-level budget control for SLM-LLM collaboration.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。