Skip to main content
QUICK REVIEW

[Paper Review] Semiparametric Language Models Are Scalable Continual Learners

Guangyue Peng, Tao Ge|arXiv (Cornell University)|Mar 2, 2023
Topic ModelingComputer Science3 citations
TL;DR

This paper proposes Selective Memorization (SeMem), a method that enables semiparametric language models to scale efficiently for continual learning by memorizing only difficult, hard-to-predict samples rather than all training data. SeMem achieves sublinear growth in memory size over time and with model size, significantly reducing storage and computational costs while maintaining performance with minimal forgetting.

ABSTRACT

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.

Motivation & Objective

  • To address the scalability problem of conventional semiparametric language models, which store all training data in a non-parametric memory that grows linearly with data and model size.
  • To improve data-wise scalability by slowing memory growth over time as the model becomes more capable through continual learning.
  • To improve model-wise scalability by reducing memory requirements for larger models, which encounter fewer difficult cases.
  • To enable semiparametric LMs to function as practical, scalable continual learners over streaming text data without retraining or fine-tuning.
  • To minimize catastrophic forgetting while drastically reducing external memory footprint in continual learning settings.

Proposed method

  • SeMem introduces a selective memorization policy that evaluates each training sample's prediction uncertainty and only stores those that the model is likely to struggle with.
  • The method uses the parametric LM’s confidence in predicting the next token to determine whether a sample is difficult—low confidence indicates a candidate for memorization.
  • Only samples with prediction probabilities below a threshold are added to the non-parametric memory, reducing storage needs.
  • The non-parametric memory remains a k-NN lookup structure, but now contains only high-uncertainty, hard-to-predict examples.
  • The approach is compatible with existing k-NN-LM frameworks and requires no architectural changes or additional training.
  • The method is applied during continual learning over streaming data, with memory updated incrementally based on prediction confidence.
Figure 1: (a) The growth trend of memorized tokens of the conventional full memorization (FullMem) and our proposed Selective Memorization (SeMem) policy. Compared with FullMem, not only does SeMem have a significantly reduced memory but also its memory growth will become slower as it continuously l
Figure 1: (a) The growth trend of memorized tokens of the conventional full memorization (FullMem) and our proposed Selective Memorization (SeMem) policy. Compared with FullMem, not only does SeMem have a significantly reduced memory but also its memory growth will become slower as it continuously l

Experimental results

Research questions

  • RQ1Can selective memorization reduce the growth rate of non-parametric memory in semiparametric LMs during continual learning over streaming data?
  • RQ2Does memorizing only difficult samples maintain or improve model performance compared to full memorization?
  • RQ3How does model size affect memory growth under selective versus full memorization?
  • RQ4To what extent does SeMem reduce memory footprint while preserving performance in continual learning?
  • RQ5Can SeMem enable semiparametric LMs to scale efficiently in real-world streaming settings with minimal forgetting?

Key findings

  • SeMem reduces the non-parametric memory size by up to 58% compared to full memorization, with memory growth slowing over time rather than growing linearly.
  • The method achieves sublinear data-wise scalability: as the model learns more, fewer difficult samples are added, slowing memory expansion.
  • SeMem achieves sublinear model-wise scalability: larger models memorize fewer samples than smaller ones, as they are less likely to struggle with new inputs.
  • On the RealTime QA benchmark, SeMem with 42% memorization rate achieves 53.1 F1 on RTE, matching the performance of full memorization (50.3) while using significantly less memory.
  • In 0-shot NLP tasks, SeMem maintains performance comparable to full memorization (e.g., 53.1 F1 on RTE vs. 53.1 for full memorization) with substantially reduced memory footprint.
  • SeMem enables semiparametric LMs to be scalable continual learners without retraining, achieving low forgetting and efficient memory usage in streaming data scenarios.
Figure 2: Intuition of SeMem where we consider cases with $\log P<-1.5$ as hard: (a) Small-1 and Small-2 illustrate what training cases need to be memorized/skipped; (b) Small-2 and Small-3 show that some hard cases will become easy and thus be skipped if their similar cases are memorized before; (c
Figure 2: Intuition of SeMem where we consider cases with $\log P<-1.5$ as hard: (a) Small-1 and Small-2 illustrate what training cases need to be memorized/skipped; (b) Small-2 and Small-3 show that some hard cases will become easy and thus be skipped if their similar cases are memorized before; (c

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.