ReasonCACHE: Teaching LLMs To Reason Without Weight Updates

LLM LoRA/Adapter Latent Reasoning
大型语言模型(LLMs)能否在不更新任何模型权重、仅依靠上下文内学习(In-Context Learning, ICL)的情况下,学会进行推理?ICL 具有惊人的样本效率,往往仅需寥寥数个示例即可完成学习;然而,复杂的推理任务通常需要大量训练样本才能有效掌握。但若简单地通过堆叠更多示例来扩大 ICL 规模,该方法在较大规模下便会失效:注意力计算开销呈二次方增长,模型性能在上下文变长后趋于饱和甚至下降,且这种学习方式本质上仍是一种浅层学习。受上述局限性制约,实际应用中,从业者主要依赖“权重内学习”(In-Weight Learning, IWL)来赋予模型推理能力。本文表明,借助前缀微调(Prefix Tuning)技术,LLM 可在不超出上下文窗口容量、亦不更新任何模型参数的前提下,成功习得推理能力。我们由此提出 **ReasonCACHE**——一种基于该机制的具体实现方案,它将示范样例提炼并固化为一个固定大小的键值缓存(key-value cache)。实验结果表明,在包括 GPQA-Diamond 在内的多项高难度推理基准测试中,ReasonCACHE 均显著优于标准 ICL 方法,并达到或超越各类 IWL 方法的性能水平。更重要的是,它在三个关键维度上均展现出更高效率:所需数据量更少、推理开销更低、可训练参数量更小。此外,我们从理论上严格证明:ReasonCACHE 的表达能力可严格强于低秩权重更新(low-rank weight update),因为后者将模型表达力受限于输入的秩(input rank),而 ReasonCACHE 则通过直接向注意力机制注入键值对的方式,绕开了这一根本性约束。综上所述,我们的研究揭示了 ReasonCACHE 是一条介于上下文内学习与权重内学习之间的中间路径,提供了一种可扩展的算法框架——无需修改模型参数,即可突破上下文窗口限制,高效习得并拓展推理能力。项目主页:https://reasoncache.github.io/
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/
许愿