[论文解读] Semiparametric Language Models Are Scalable Continual Learners
本文提出选择性记忆(SeMem),一种使半参数语言模型在持续学习中实现高效扩展的方法,通过仅记忆难以预测的困难样本而非全部训练数据。SeMem 实现了随时间推移和模型规模增长的次线性内存增长,显著降低了存储和计算成本,同时保持性能并最小化灾难性遗忘。
Semiparametric language models (LMs) have shown promise in continuously learning from new text data by combining a parameterized neural LM with a growable non-parametric memory for memorizing new content. However, conventional semiparametric LMs will finally become prohibitive for computing and storing if they are applied to continual learning over streaming data, because the non-parametric memory grows linearly with the amount of data they learn from over time. To address the issue of scalability, we present a simple and intuitive approach called Selective Memorization (SeMem), which only memorizes difficult samples that the model is likely to struggle with. We demonstrate that SeMem improves the scalability of semiparametric LMs for continual learning over streaming data in two ways: (1) data-wise scalability: as the model becomes stronger through continual learning, it will encounter fewer difficult cases that need to be memorized, causing the growth of the non-parametric memory to slow down over time rather than growing at a linear rate with the size of training data; (2) model-wise scalability: SeMem allows a larger model to memorize fewer samples than its smaller counterpart because it is rarer for a larger model to encounter incomprehensible cases, resulting in a non-parametric memory that does not scale linearly with model size. We conduct extensive experiments in language modeling and downstream tasks to test SeMem's results, showing SeMem enables a semiparametric LM to be a scalable continual learner with little forgetting.
研究动机与目标
- 为解决传统半参数语言模型的可扩展性问题,这些模型将所有训练数据存储在随数据量和模型规模线性增长的非参数记忆中。
- 通过在模型通过持续学习变得更强时减缓内存随时间的增长,提升数据层面的可扩展性。
- 通过减少大模型的内存需求,提升模型层面的可扩展性,因为大模型遇到的困难情况更少。
- 使半参数语言模型能够在无需微调或重新训练的情况下,作为实用且可扩展的持续学习者,处理流式文本数据。
- 在持续学习设置中,显著减少外部内存占用的同时,最小化灾难性遗忘。
提出的方法
- SeMem 引入了一种选择性记忆策略,通过评估每个训练样本的预测不确定性,仅存储模型可能难以应对的样本。
- 该方法利用参数化语言模型对下一个词符预测的置信度,判断样本是否困难——置信度低表明其为记忆候选。
- 仅当预测概率低于阈值的样本才会被添加到非参数记忆中,从而减少存储需求。
- 非参数记忆仍保持 k-最近邻查找结构,但仅包含高不确定性、难以预测的样本。
- 该方法与现有 k-NN-LM 框架兼容,无需架构更改或额外训练。
- 该方法在流式数据的持续学习过程中应用,记忆根据预测置信度增量式更新。

实验结果
研究问题
- RQ1选择性记忆是否能降低在流式数据持续学习过程中,半参数语言模型非参数记忆的增长速率?
- RQ2仅记忆困难样本是否能维持或提升相比完全记忆的模型性能?
- RQ3在选择性记忆与完全记忆下,模型规模如何影响内存增长?
- RQ4SeMem 在多大程度上减少了内存占用,同时保持持续学习中的性能?
- RQ5SeMem 是否能使半参数语言模型在真实流式环境中实现高效扩展,且遗忘极少?
主要发现
- 与完全记忆相比,SeMem 将非参数记忆大小减少了高达 58%,且内存增长随时间放缓,而非线性增长。
- 该方法实现了次线性数据可扩展性:随着模型学习更多内容,添加的困难样本越来越少,内存扩展速度减缓。
- SeMem 实现了次线性模型可扩展性:大模型记忆的样本比小模型更少,因为其更少会难以应对新输入。
- 在 RealTime QA 基准上,SeMem 以 42% 的记忆率实现了 RTE 任务 53.1 的 F1 分数,与完全记忆(50.3)性能相当,但内存使用显著减少。
- 在零样本 NLP 任务中,SeMem 维持了与完全记忆相当的性能(如 RTE 任务中 F1 为 53.1,与完全记忆相同),但内存占用大幅降低。
- SeMem 使半参数语言模型能够作为可扩展的持续学习者,无需重新训练,在流式数据场景中实现低遗忘和高效内存使用。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。