arXiv:2504.13171cs.AIcs.CL2025-04被引 38

让大模型提前‘思考’,降低推理时计算开销。

Sleep-time Compute: Beyond Inference Scaling at Test-time

  • 模型在用户提问前预计算可能用到的信息,减少实时推理负担。
  • 测试阶段计算量减少约5倍,准确率最高提升18%。
  • 适合可预测查询场景,如智能代理、问答系统等应用。

测试时扩展计算已成为大语言模型解决复杂问题的关键,但带来高延迟和高昂推理成本。本文提出睡眠期计算(sleep-time compute),让模型在用户提问前预先处理上下文:通过预测用户可能提出的问题并提前计算有用信息,显著降低测试阶段的计算需求。为验证方法有效性,我们改造了两个推理任务——Stateful GSM-Symbolic 和 Stateful AIME。结果表明,睡眠期计算可使达成相同准确率所需的测试时计算量减少约5倍;通过扩大睡眠期计算规模,状态型GSM-Symbolic准确率最高提升13%,AIME提升18%。此外,我们引入Multi-Query GSM-Symbolic,对同一上下文包含多个相关问题的任务进行优化。通过在相关查询间分摊睡眠期计算,平均每个查询成本降低2.5倍。进一步分析显示,用户查询可预测性与睡眠期计算效果高度相关。最后,我们在一个真实的智能体式软件工程任务中进行了案例研究。

原文摘要 · Abstract (English)

Scaling test-time compute has emerged as a key ingredient for enabling large language models (LLMs) to solve difficult problems, but comes with high latency and inference cost. We introduce sleep-time compute, which allows models to "think" offline about contexts before queries are presented: by anticipating what queries users might ask and pre-computing useful quantities, we can significantly reduce the compute requirements at test-time. To demonstrate the efficacy of our method, we create modified versions of two reasoning tasks - Stateful GSM-Symbolic and Stateful AIME. We find that sleep-time compute can reduce the amount of test-time compute needed to achieve the same accuracy by ~ 5x on Stateful GSM-Symbolic and Stateful AIME and that by scaling sleep-time compute we can further increase accuracy by up to 13% on Stateful GSM-Symbolic and 18% on Stateful AIME. Furthermore, we introduce Multi-Query GSM-Symbolic, which extends GSM-Symbolic by including multiple related queries per context. By amortizing sleep-time compute across related queries about the same context using Multi-Query GSM-Symbolic, we can decrease the average cost per query by 2.5x. We then conduct additional analysis to understand when sleep-time compute is most effective, finding the predictability of the user query to be well correlated with the efficacy of sleep-time compute. Finally, we conduct a case-study of applying sleep-time compute to a realistic agentic SWE task.

大模型推理优化预计算智能代理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。