arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.18002cs.LG
收藏

神经垃圾回收:在学习推理的同时学习遗忘

Neural Garbage Collection: Learning to Forget while Learning to Reason

Stanford University(斯坦福大学)

Michael Y. Li, Jubayer Ibn Hamid, Emily B. Fox, Noah D. Goodman

AI总结:

本文提出神经垃圾回收(NGC),通过端到端学习使语言模型在推理时自动管理内存,无需人工设计规则,实现内存压缩与效率提升。

摘要:

链式推理推动了语言模型能力的显著提升,但每一步推理都会增加KV缓存,限制了该范式的扩展。当前方法通过人工设计的准则管理这些约束。更可扩展的方法应让端到端学习完全接管这一设计选择,遵循深度学习中的广泛模式。既然模型能学习推理,为何不能学习遗忘?我们引入神经垃圾回收(NGC),使语言模型在学习推理的同时学习遗忘,通过端到端学习从基于结果的任务奖励中训练。当模型推理时,它会定期暂停,决定哪些KV缓存条目需要清除,并继续基于剩余缓存进行推理。通过将链式推理中的token和缓存清除决策视为离散动作,我们可以利用强化学习共同优化模型的推理和内存管理:模型清除的内容影响它记住的内容,它记住的内容影响推理,而推理的正确性决定其奖励。关键的是,模型完全从单一学习信号——基于结果的任务奖励中学习这种行为,而无需监督微调或代理目标。在Countdown、AMC和AIME任务中,NGC在2-3倍峰值KV缓存压缩下保持与全缓存上限相当的准确性,并显著优于清除基线。我们的结果是朝着更广泛愿景的第一步,即端到端优化驱动语言模型的能力和效率。

英文摘要:

Chain-of-thought reasoning has driven striking advances in language model capability, yet every reasoning step grows the KV cache, creating a bottleneck to scaling this paradigm further. Current approaches manage these constraints on the model's behalf using hand-designed criteria. A more scalable approach would let end-to-end learning subsume this design choice entirely, following a broader pattern in deep learning. After all, if a model can learn to reason, why can't it learn to forget? We introduce Neural Garbage Collection (NGC), in which a language model learns to forget while learning to reason, trained end-to-end from outcome-based task reward alone. As the model reasons, it periodically pauses, decides which KV cache entries to evict, and continues to reason conditioned on the remaining cache. By treating tokens in a chain-of-thought and cache-eviction decisions as discrete actions sampled from the language model, we can use reinforcement learning to jointly optimize how the model reasons and how it manages its own memory: what the model evicts shapes what it remembers, what it remembers shapes its reasoning, and the correctness of that reasoning determines its reward. Crucially, the model learns this behavior entirely from a single learning signal - the outcome-based task reward - without supervised fine-tuning or proxy objectives. On Countdown, AMC, and AIME tasks, NGC maintains strong accuracy relative to the full-cache upper bound at 2-3x peak KV cache size compression and substantially outperforms eviction baselines. Our results are a first step towards a broader vision where end-to-end optimization drives both capability and efficiency in language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑