Meta-Learning Online Adaptation of Language Models

Nathan Hu, Eric Mitchell, Christopher D. Manning, Chelsea Finn
5/24/2023
cs.CL

No official code found. Best implementation: nathanhu0/CaMeLS (26 stars, Apache-2.0, last commit 2024-01-23).

Abstract

Large language models encode impressively broad world knowledge in their parameters. However, the knowledge in static language models falls out of date, limiting the model's effective "shelf life." While online fine-tuning can reduce this degradation, we find that naively fine-tuning on a stream of documents leads to a low level of information uptake. We hypothesize that online fine-tuning does not sufficiently attend to important information. That is, the gradient signal from important tokens representing factual information is drowned out by the gradient from inherently noisy tokens, suggesting that a dynamic, context-aware learning rate may be beneficial. We therefore propose learning which tokens to upweight. We meta-train a small, autoregressive model to reweight the language modeling loss for each token during online fine-tuning, with the objective of maximizing the out-of-date base question-answering model's ability to answer questions about a document after a single weighted gradient step. We call this approach Context-aware Meta-learned Loss Scaling (CaMeLS). Across three different distributions of documents, our experiments find that CaMeLS provides substantially improved information uptake on streams of thousands of documents compared with standard fine-tuning and baseline heuristics for reweighting token losses.

View on arXivView PDF

Code Implementations(1)

nathanhu0/CaMeLSCommunity100%
Apache-2.0

Codebase for Context-aware Meta-learned Loss Scaling (CaMeLS). https://arxiv.org/abs/2305.15076.

265Python, Jupyter NotebookJul 15, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{hu2023metalearning,
  title  = {Meta-Learning Online Adaptation of Language Models},
  author = {Nathan Hu and Eric Mitchell and Christopher D. Manning and Chelsea Finn},
  year   = {2023},
  eprint = {2305.15076},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.15076v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.15076.svg)](https://codeofpaper.com/paper/2305.15076)

Discussion