Cortex:将上下文整合为参数化记忆

·

研究论文 · 2026/10/15

上下文可以提升大语言模型性能,但这些增益在移除上下文后可能丢失。受生物系统巩固启发,我们将记忆巩固(MC)定义为在保留非目标能力的同时内化这些增益,并将上下文指定的编辑、技能学习和行为引导统一在一个共同目标下。我们引入了一个五任务族测试平台,在单次、批量与顺序更新下衡量巩固与保持。我们提出 Cortex,它生成前瞻性查询以预测上下文的用途,并将上下文条件输出蒸馏为可合并的低秩或结构化前馈网络更新。在 4B--120B 稠密与混合专家骨干模型(包括纯文本与多模态模型)上,Cortex 在大多数评估设置中位于经验性的巩固--保持帕累托前沿。在 14B 模型上进行 50 次顺序事实编辑后,Cortex-Structural 恢复了 88.9% 的上下文诱导增益,同时保留了 99.8% 的原始非目标性能。

该工作将上下文增益内化到模型参数中,在提升性能的同时保持原有能力,为上下文利用与模型编辑提供了统一且有效的解决方案。

Context can improve large language model performance, but these gains may be lost after context removal. Inspired by biological systems consolidation, we formulate Memory Consolidation (MC) as internalizing these gains while preserving non-target capabilities, connecting context-specified editing, skill learning, and behavioral steering under a common objective. We introduce a five-task-family testbed measuring consolidation and retention under single, batch, and sequential updates. We propose Cortex, which generates prospective queries to anticipate uses of context and distills context-conditioned outputs into mergeable low-rank or structural feed-forward network updates. Across 4B--120B dense and mixture-of-experts backbones, including both text-only and multimodal models, Cortex lies on the empirical consolidation--retention Pareto frontier in most evaluated settings. After 50 sequential factual edits on a 14B model, Cortex-Structural recovers 88.9% of the context-induced gain while retaining 99.8% of original non-target performance.

阅读原文

参与讨论