$\text{Memory}^3$: Language Modeling with Explicit Memory

Hongkang Yang, Zehao Lin, Wenjin Wang, Hao Wu, Zhiyu Li +11 more
7/1/2024
cs.CLcs.AIcs.LG

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

The training and inference of large language models (LLMs) are together a costly process that transports knowledge from raw data to meaningful computation. Inspired by the memory hierarchy of the human brain, we reduce this cost by equipping LLMs with explicit memory, a memory format cheaper than model parameters and text retrieval-augmented generation (RAG). Conceptually, with most of its knowledge externalized to explicit memories, the LLM can enjoy a smaller parameter size, training cost, and inference cost, all proportional to the amount of remaining "abstract knowledge". As a preliminary proof of concept, we train from scratch a 2.4B LLM, which achieves better performance than much larger LLMs as well as RAG models, and maintains higher decoding speed than RAG. The model is named $\text{Memory}^3$, since explicit memory is the third form of memory in LLMs after implicit memory (model parameters) and working memory (context key-values). We introduce a memory circuitry theory to support the externalization of knowledge, and present novel techniques including a memory sparsification mechanism that makes storage tractable and a two-stage pretraining scheme that facilitates memory formation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yang2024textmemory,
  title  = {$\text{Memory}^3$: Language Modeling with Explicit Memory},
  author = {Hongkang Yang and Zehao Lin and Wenjin Wang and Hao Wu and Zhiyu Li and Bo Tang and Wenqiang Wei and Jinbo Wang and Zeyun Tang and Shichao Song and Chenyang Xi and Yu Yu and Kai Chen and Feiyu Xiong and Linpeng Tang and Weinan E},
  year   = {2024},
  eprint = {2407.01178},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.01178v1}
}

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

Discussion