arXiv:2610.25425cs.CLOct 2026

Manuscript Offprint

arXiv:2610.25425

Mixture-of-Memories: Low-Overhead Language Modeling with Modular Knowledge Injection

Yifan Lu, Rubin Wei, Ziyun Zou, Junhong Liang, Haolin Yang, Xinlin Zhuang, Abhijit Das, Adinath Madhavrao Dukre, Shadab Khan, Zhouhan Lin, Imran Razzak

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yifan Lu1^{1}, Rubin Wei2^{2}, Ziyun Zou1^{1}, Junhong Liang1^{1}, Haolin Yang1^{1}, Xinlin Zhuang3^{3}, Abhijit Das1^{1}, Adinath Madhavrao Dukre1^{1}, Shadab Khan4^{4}, Zhouhan Lin2^{2}, Imran Razzak1^{1}

1^{1}MBZUAI, Abu Dhabi, UAE, 2^{2}LUMIA Lab, School of Artificial Intelligence, Shanghai Jiao Tong University, China, 3^{3}The Chinese University of Hong Kong, Hong Kong, 4^{4}ADIA Lab, Abu Dhabi, UAE

Large language models store substantial factual knowledge in their parameters, yet this knowledge is difficult to control, update, and reliably elicit at inference time. Existing memory-augmented approaches typically rely on a single auxiliary mechanism, such as retrieval, parameter updates, or neural memory, and therefore apply the same form of correction to tokens with very different knowledge demands. We propose Mixture-of-Memories (MoM), a memory-augmented language modeling framework that separates routed neural memory from writable factual memory. MoM combines a frozen base LM with two neural memory experts: a latent memory that provides low-latency hidden-state corrections and a lexical memory that provides a token-space knowledge pathway. A lightweight Budget Router sets per-token mixture weights from uncertainty and disagreement features, replacing the fixed interpolation of prior memory modules. For post-hoc updates, an external explicit memory stays outside the router, because a router trained before facts are written learns to down-weight it; new facts are appended without retraining any component and used only when an answer-level gate accepts the retrieved fact. Experiments across language modeling, factual QA, update analysis, and efficiency show that MoM improves both predictive accuracy and updateability while retaining low inference overhead.

Keywords: Parametric Memory, Knowledge Updating, Token-Level Routing

Contact: Yifan.Lu@mbzuai.ac.ae

Mistral-7B

Base LM

CPT

LoRA

RAG

MoM

Llama-3.1-8B

Time to first token (↓)

TTFT (ms)

Tokens per second (↑)

TPS (tokens/s)

Figure

Figure

Figure

Figure 1: Performance and efficiency comparison. Left and middle: accuracy on three QA benchmarks with Mistral-7B and Llama-3.1-8B; bars are scaled within each benchmark. MoM improves over the base LM on every benchmark, whereas parametric methods (CPT, LoRA) and non-parametric retrieval (RAG) each lower at least one. Right: inference efficiency on a 7B backbone, measured by time to first token (TTFT, ↓ lower is better) and tokens per second (TPS, ↑ higher is better). Relative to RAG and kNN-LM, MoM lowers TTFT by 2.9–3.0× and raises TPS by 1.4–3.9×.

Corresponding author(s): Imran Razzak; Email: Imran.Razzak@mbzuai.ac.ae

1. Introduction

Large language models (LLMs) encode a substantial amount of world knowledge in their parameters (Allen-Zhu and Li, 2025). This capability follows from large-scale next-token prediction and is one reason pretrained LMs generalize well. Parametric knowledge, however, is a poor interface for knowledge-intensive prediction. Parameters are optimized to capture broad statistical regularities, not to give explicit control over how individual facts are stored, accessed, or updated. The mechanism that handles common linguistic and factual patterns therefore becomes unreliable when a prediction depends on precise, infrequent, or newly introduced knowledge (Chang et al., 2024, Gekhman et al., 2024, Ovadia et al., 2024), which leaves a gap between what an LLM absorbs during pretraining and what it can reliably use at inference time.

This gap has at least three sources. A fact may be weakly represented because it is under-supported in pretraining, difficult to recover because the context does not elicit it, or stale because it changed after training. Existing approaches address these failure modes only partially. Parameter-side methods internalize new information into model weights, but frequent or repeated updates remain difficult to support cleanly (Wang et al., 2024c). External retrieval and token-level memory make updates easier but add search and context-processing overhead at inference time (Cao et al., 2026). Latent-space memory compresses information into hidden representations and can improve retention, but it is tied to model-specific representations (Wang et al., 2024b, 2025). Plug-and-play parametric memories imitate non-parametric retrievers with lightweight auxiliary modules, which improves portability and inference efficiency, yet they still expose a single auxiliary path with fixed interpolation (Cao et al., 2026, Wei et al., 2025).

Because all of these mechanisms ultimately act through next-token prediction at inference time, their differences matter only insofar as they change the local prediction problem during generation. The need for extra knowledge is not uniform across positions. At many steps, the base LM is already sufficient: the next token is governed mainly by local syntax, common lexical patterns, or highly reinforced knowledge, so auxiliary support brings little benefit. The challenging cases are concentrated on a much smaller subset of positions where prediction depends on precise factual content, such as entities, numbers, dates, and other knowledge-bearing slots (Yao et al., 2025). Even there, the relevant deficiency is not always the same. Some errors reflect weak parametric support and call for a lightweight correction to the base prediction; others reflect a need for more explicit token-level guidance or direct access to facts introduced after pretraining. This makes a single global augmentation rule difficult to justify. If the same auxiliary correction is applied uniformly throughout generation, the model is forced to treat easy and difficult positions alike, and to use the same form of support for qualitatively different failure modes. A more natural formulation is to let knowledge support vary with the local prediction state, invoking different auxiliary paths only where they are likely to reduce token-level error.

To bridge the gap, we propose Mixture-of-Memories (MoM), a memory-augmented language modeling framework that separates memory for stable prediction from memory for post-hoc updates. MoM combines a frozen base LM with two routed neural memory experts: a latent memory (LatM) that provides low-latency, retrieval-like corrections in hidden space, and a lexical memory (LexM) that operates in token space and is therefore less coupled to the backbone's representations. A lightweight Budget Router assigns token-wise mixture weights over these stable sources from uncertainty and disagreement features. Mutable knowledge goes to an explicit memory (ExpM), an external store that is kept outside the router; it retrieves a stored fact once per question and injects its answer only when an answer-level gate judges the fact reliable. Facts are added by appending entries, without retraining the backbone, the neural memories, or the router.

Our contributions are as follows:

• We propose Mixture-of-Memories, which composes a frozen base language model with a latent and a lexical memory through a lightweight token-wise Budget Router.

• We keep mutable knowledge in an explicit memory outside the router, so new facts can be written without retraining the backbone, the neural memories, or the router, and take effect immediately.

• Extensive experiments show that MoM reduces WikiText-103 perplexity on GPT2-large from 10.45 to 9.37, improves the average factual QA score over frozen backbones by 15.6% on Mistral-7B and 10.9% on Llama-3.1-8B, and lowers time to first token by 2.9–3.0× relative to retrieval-augmented baselines on a 7B backbone.

References (41)