Adaptive Semiparametric Language Models
Dani Yogatama, Cyprien de Masson d'Autume, Lingpeng Kong
TL;DR
The paper introduces SPALM, a semiparametric language model that combines a Transformer with both short-term working memory and long-term episodic memory retrieved via $k$-NN search. A context-dependent gate blends local, extended, and global information to predict the next token, enabling adaptive memory usage across contexts. Empirical results on WikiText-103, WMT, and enwik8 show SPALM beating strong baselines, with notable gains from integrating long-term memory and reduced reliance on fixed interpolation. The work demonstrates the viability of architectural memory integration for language modeling and points toward extensible, multi-modal memory frameworks.
Abstract
We present a language model that combines a large parametric neural network (i.e., a transformer) with a non-parametric episodic memory component in an integrated architecture. Our model uses extended short-term context by caching local hidden states -- similar to transformer-XL -- and global long-term memory by retrieving a set of nearest neighbor tokens at each timestep. We design a gating function to adaptively combine multiple information sources to make a prediction. This mechanism allows the model to use either local context, short-term memory, or long-term memory (or any combination of them) on an ad hoc basis depending on the context. Experiments on word-based and character-based language modeling datasets demonstrate the efficacy of our proposed method compared to strong baselines.
