Pre-training Limited Memory Language Models with Internal and External Knowledge

Linxi Zhao, Sofian Zalouk, Christian K. Belardi, Justin Lovelace, Jin Peng Zhou +5 more
5/21/2025
cs.CLcs.AIcs.LG

No official code found. Best implementation: kilian-group/LMLM (34 stars, MIT, last commit 2025-10-31).

Abstract

Neural language models are black-boxes--both linguistic patterns and factual knowledge are distributed across billions of opaque parameters. This entangled encoding makes it difficult to reliably inspect, verify, or update specific facts. We introduce Limited Memory Language Models (LMLM), a new class of language models that externalizes factual knowledge to external database during pre-training rather than memorizing them. Our pre-training approach strategically masks externally retrieved factual values from the training loss, thereby teaching the model to perform targeted lookups rather than relying on memorization in model weights. Our experiments demonstrate that LMLMs achieve competitive performance compared to significantly larger LLMs on standard benchmarks, while offering the advantages of explicit, editable, and verifiable knowledge bases.

View on arXivView PDF

Code Implementations(1)

kilian-group/LMLMCommunity100%
MIT
341Shell, PythonMay 21, 202511 months agoMIT

Similar Papers

Cite this paper

@article{zhao2025pretraining,
  title  = {Pre-training Limited Memory Language Models with Internal and External Knowledge},
  author = {Linxi Zhao and Sofian Zalouk and Christian K. Belardi and Justin Lovelace and Jin Peng Zhou and Ryan Thomas Noonan and Dongyoung Go and Kilian Q. Weinberger and Yoav Artzi and Jennifer J. Sun},
  year   = {2025},
  eprint = {2505.15962},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.15962v3}
}

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

Discussion