让大模型不改参数也能学会复杂推理,靠的是智能缓存演示样本。
ReasonCACHE: Teaching LLMs To Reason Without Weight Updates
- 用前缀调优将推理示例压缩成固定键值缓存,避免上下文过长
- 在多个难题基准上表现超越传统提示学习,媲美参数更新方法
- 更高效:省数据、降计算、零可训练参数,适合资源受限场景
大型语言模型能否在不更新权重的情况下仅通过上下文学习(ICL)实现推理?尽管ICL极为高效,通常只需少量示例即可学习,但复杂推理任务通常需要大量训练样本。然而,简单增加演示数量会因注意力开销呈平方级增长而失效,性能趋于饱和或下降,且仍为浅层学习。因此,实践中多依赖参数更新(IWL)来诱导推理。本文提出ReasonCACHE,基于前缀调优,将演示样本提炼为固定键值缓存,在不扩展上下文窗口且无任何权重更新的前提下实现推理学习。实验证明,它在包括GPQA-Diamond在内的多个挑战性推理基准上优于标准ICL,并达到或超越IWL方法性能。同时,在数据、推理成本和可训练参数三方面均更高效。理论证明,ReasonCACHE的表达能力严格强于低秩权重更新,因其不受输入秩的限制,直接注入键值至注意力机制。综上,ReasonCACHE成为上下文与参数学习间的中间路径,为突破上下文限制的推理技能学习提供可扩展方案。
原文摘要 · Abstract (English)
Can Large language models (LLMs) learn to reason without any weight update and only through in-context learning (ICL)? ICL is strikingly sample-efficient, often learning from only a handful of demonstrations, but complex reasoning tasks typically demand many training examples to learn from. However, naively scaling ICL by adding more demonstrations breaks down at this scale: attention costs grow quadratically, performance saturates or degrades with longer contexts, and the approach remains a shallow form of learning. Due to these limitations, practitioners predominantly rely on in-weight learning (IWL) to induce reasoning. In this work, we show that by using Prefix Tuning, LLMs can learn to reason without overloading the context window and without any weight updates. We introduce $\textbf{ReasonCACHE}$, an instantiation of this mechanism that distills demonstrations into a fixed key-value cache. Empirically, across challenging reasoning benchmarks, including GPQA-Diamond, ReasonCACHE outperforms standard ICL and matches or surpasses IWL approaches. Further, it achieves this all while being more efficient across three key axes: data, inference cost, and trainable parameters. We also theoretically prove that ReasonCACHE can be strictly more expressive than low-rank weight update since the latter ties expressivity to input rank, whereas ReasonCACHE bypasses this constraint by directly injecting key-values into the attention mechanism. Together, our findings identify ReasonCACHE as a middle path between in-context and in-weight learning, providing a scalable algorithm for learning reasoning skills beyond the context window without modifying parameters. Our project page: https://reasoncache.github.io/
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。