让大模型持续记新知识,还能不丢旧记忆。
Continual Memorization of Factoids in Language Models
- 用随机词串和通用数据混合训练,缓解模型遗忘。
- 在多阶段学习中,该方法使准确率恢复至初始水平。
- 适合需要长期更新知识的大模型应用。
随着新知识快速积累,预训练语言模型的原有知识很快过时。传统方法是直接在新数据上微调,但近期研究发现,这种微调可能无法有效存储知识或加剧幻觉。本文提出持续记忆场景:模型需在多个阶段的微调中不断记住并保留事实性知识。通过大量实验,我们发现模型在第二阶段后普遍存在遗忘现象。为此,我们提出通过调整训练动态来缓解遗忘:一是保护记忆过程,二是减少后续训练干扰。令人意外的是,在不同训练阶段混合随机生成词串或预训练语料中的通用数据(即REMIX),可显著减轻遗忘。REMIX能有效恢复性能,优于重播方法和其他持续学习基线。分析表明,稳健记忆呈现特定模式:知识被存储在更早层,并分散于更多层,便于回忆与操作。
原文摘要 · Abstract (English)
As new knowledge rapidly accumulates, language models (LMs) with pretrained knowledge quickly become obsolete. A common approach to updating LMs is fine-tuning them directly on new knowledge. However, recent studies have shown that fine-tuning for memorization may be ineffective in storing knowledge or may exacerbate hallucinations. In this work, we introduce a setting we call continual memorization, where a model must memorize and retain a set of factoids through multiple stages of fine-tuning on subsequent datasets. We characterized the forgetting patterns through extensive experiments and show that LMs widely suffer from forgetting, especially when needing to memorize factoids in the second stage. We posit that forgetting can be alleviated by modifying training dynamics: (1) protecting the memorization process when learning factoids or (2) reducing interference from subsequent training stages. Intriguingly, we find that mixing randomly generated word sequences or generic data sampled from pretraining corpora at different training stages effectively mitigates forgetting REMIX: Random and Generic Data Mixing). REMIX can recover performance from severe forgetting, outperforming replay methods and other continual learning baselines. We analyze how REMIX influences the learning process and find that robust memorization follows a distinct pattern: the model stores factoids in earlier layers than usual and diversifies the layers that retain them, which results in easier recall and manipulate of the learned factoids.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。