MemoryPrompt: A Light Wrapper to Improve Context Tracking in Pre-trained Language Models

Nathanaël Carraz Rakotonirina, Marco Baroni
2/23/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: ncarraz/MemoryPrompt (12 stars, last commit 2024-03-24).

Abstract

Transformer-based language models (LMs) track contextual information through large, hard-coded input windows. We introduce MemoryPrompt, a leaner approach in which the LM is complemented by a small auxiliary recurrent network that passes information to the LM by prefixing its regular input with a sequence of vectors, akin to soft prompts, without requiring LM finetuning. Tested on a task designed to probe a LM's ability to keep track of multiple fact updates, a MemoryPrompt-augmented LM outperforms much larger LMs that have access to the full input history. We also test MemoryPrompt on a long-distance dialogue dataset, where its performance is comparable to that of a model conditioned on the entire conversation history. In both experiments we also observe that, unlike full-finetuning approaches, MemoryPrompt does not suffer from catastrophic forgetting when adapted to new tasks, thus not disrupting the generalist capabilities of the underlying LM.

View on arXivView PDF

Code Implementations(1)

LREC-COLING 2024: MemoryPrompt: A Light Wrapper to Improve Context Tracking in Pre-trained Language Models

120PythonFeb 21, 20242 years ago

Similar Papers

Cite this paper

@article{rakotonirina2024memoryprompt,
  title  = {MemoryPrompt: A Light Wrapper to Improve Context Tracking in Pre-trained Language Models},
  author = {Nathanaël Carraz Rakotonirina and Marco Baroni},
  year   = {2024},
  eprint = {2402.15268},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.15268v1}
}

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/2402.15268.svg)](https://codeofpaper.com/paper/2402.15268)

Discussion