Get Started
Home
Topics
Search
Library
6 min read · LLM Training · Memory · Added Sep 22 · Paper published Sep 14, 2026

MoME: Mixture-of-Memory Embeddings for Context-Aware Sparse Lookup

Source: research paper via Hugging Face Daily Papers
Memory-augmented LMs waste capacity because token-indexed side tables force python-the-language and python-the-snake into one row. MoME gives each row M slots with a context-gated top-K router, matching or beating prior memory methods across three backbones at ~1.05× latency, with routes that track word sense.

TL;DR

Mixture of Memory Embeddings (MoME) gives a language model’s parametric memory table multiple slots per token and a learned gate that picks slots based on the current hidden state, so the same token routes to different memory entries in different contexts while keeping the lookup as cheap as a single-vector table.

Why It Matters

Transformers spend a lot of early-layer capacity reconstructing facts that could just be looked up: named entities, formulaic phrases, common associations. A recent line of work (memory-embedding methods like Per-Layer Embedding in Gemma 3, Value Embedding, STEM, and Engram) adds a cheap side table that each token indexes into, injecting a learned vector into the backbone. The table can be much bigger than the transformer weights because only one row is touched per token, similar in spirit to MoE but on the memory side rather than the FFN side.
The catch: existing methods index the table deterministically by the token ID (or a fixed n-gram hash). That means python the language and python the animal share the same memory row. One vector has to hold both senses, and nearby-synonym tokens like cat/cats each get their own row storing nearly duplicate content. Capacity is allocated by surface form, not by meaning.

How It Works

MoME keeps the cheap token-indexed lookup but expands each row into M slots instead of one vector. A small gate reads the current hidden state, scores the M slots, picks the top K (default K=2), and returns a weighted sum of the selected slot vectors. That sum is added to the attention value stream through a per-head residual gate.
The key move is that the slot selector conditions on the hidden state h_t, which has already absorbed context from earlier layers. So the row is chosen by token identity (fast, deterministic), but which slots within that row are read depends on context. This is where semantic disambiguation can happen.
Optionally, semantically similar tokens can be collapsed into shared rows using offline kNN in a pretrained embedding space (grouping factor c_grp), freeing budget for more slots per row.
A latency-conscious detail: because the router reads h_t and writes into the value stream, the memory branch runs in parallel with the standard value projection. The only serial join is the final gated add.
# per memory-augmented layer, per position t n_t = f(x_t) # row index from token id (or grouped) logits = W_g @ h_t + b_g # per-head slot scores from hidden state A = topk(logits, K) # K active slots out of M alpha = normalize(sigmoid(logits[A])) m_agg = sum(alpha[a] * E_mem[n_t, a] for a in A) gamma = 2 * sigmoid(W_gamma @ h_t) # per-head injection strength v_tilde = v + gamma * m_agg # add to attention value stream

What They Found

The authors pretrain on FineWeb-Edu and ClimbMix across three backbone families (nanochat, Llama-3/MobileLLM at 125M and 350M, and Qwen3 at 0.6B), matching either parameter count or training FLOPs against Base, Bigram, Value Embedding, and STEM baselines.
•
Iso-parameter on nanochat d12 (151M memory, ~3.3B tokens): MoME reaches 0.8621 validation bits per byte (bpb) vs 0.8636 for Bigram and 0.8633 for Value Embedding, with training throughput within 2% of Bigram. Doubling memory to 302M lowers val bpb to 0.8569.
•
Iso-token on MobileLLM 350M and Qwen3 0.6B: MoME beats STEM on both validation bpb and the CORE metric aggregate while using fewer memory parameters (168M vs 1342M on MobileLLM 350M; 470M vs 1409M on Qwen3 0.6B). Wall-clock overhead is 1.04\u20131.08\u00d7 the no-memory base.
•
Memory-size scaling: sweeping memory from 75M to 604M on nanochat d12, MoME’s validation bpb stays below Bigram’s at every point tested, and MoME shows visibly smaller seed-to-seed variance.
•
Compound scaling: MoME’s row indexer can be swapped for Bigram’s 2-gram hash. Combining the two beats either alone at matched budget, so the mechanisms are complementary.
•
Inference latency: on Qwen3-4B, MoME’s value-stream design adds 0.509 ms per memory layer vs 0.996 ms for a hidden-state-injection variant. Relative overhead shrinks as the backbone grows (about 1.56% on Qwen3-8B).
•
Routing analysis: on a filtered Word-in-Context (WiC) set of 670 pairs, at 117 of 144 layer\u2013head sites, routing distributions diverge more between different-sense occurrences of the same word than between same-sense occurrences. Qualitative panels show bank, bug, drive, python routing to different slots when the surrounding sentence changes the sense. This is correlational: the paper measures routing behavior, not whether it improves predictions.
One mixed result: on the in-domain ClimbMix validation set at 100B tokens, MoME’s bpb is slightly worse than Value Embedding’s (0.6504 vs 0.6463), though MoME wins on three out-of-domain corpora and on CORE-22.

What’s Useful

•
If you’re training a sub-billion-parameter model from scratch and are already considering a memory-augmented design (Value Embedding, Per-Layer Embedding, STEM), MoME is a drop-in variant that adds a per-head top-K gate over M slots. The reported gains hold across three backbone families at controlled compute, which is stronger evidence than a single-architecture win.
•
The value-stream injection site matters for latency. If you implement something like this, keep the memory branch parallel to the value projection so the only serial cost is the residual add. The paper’s ablation shows the alternative roughly doubles per-layer overhead.
•
MoME’s row indexer is pluggable. You can start with token-identity and later swap in a Bigram hash or a kNN grouping without changing the slot mechanism. Worth testing if you already have a Bigram-style setup and want to add context sensitivity on top.
•
The semantic routing story is suggestive but not causal. If you care about interpretability or steering, the fact that routing tracks word sense is interesting, but the paper does not show that intervening on routes changes predictions. Treat it as a hypothesis to test, not a shipped capability.
•
Released artifacts: code and a pretrained checkpoint.

Caveats

•
Scale ceiling is modest. The largest run is roughly 0.8B dense backbone plus ~0.6B memory, trained on 100B tokens with a single seed. Whether the scaling trend holds at multi-billion dense scale is untested.
•
The semantic-routing analysis is descriptive. The authors are explicit that causal interventions would be needed to show routing behavior improves downstream accuracy or robustness under distribution shift.
•
Wins over baselines are consistent but small in absolute bpb terms (single-digit thousandths). The CORE metric gains are more substantial and probably a better signal than raw bpb.
•
On in-domain ClimbMix at 100B tokens, Value Embedding edges MoME on bpb. MoME’s advantage is clearer out-of-domain and on aggregate benchmark accuracy.
•
The Engram, JTok, and MoVE-Input baselines in the appendix are the authors’ adaptations of those methods to this training harness, not the original implementations, so those specific comparisons are weaker evidence than the STEM and Value Embedding ones.
Topics
LLM Training
Memory
Small Models
NLP
LLM Training
Memory
Small Models
NLP
Up next in LLM Training
Interlock: From Local Correctness to Task Completion in Long-Horizon Agents
Kronecker Delta Rule for Long Context Linear Attention
Don't miss new content
Log in to follow topics and personalize your feed.
Related topics you might like
Small Models12 episodes
LLM Training199 episodes
NLP145 episodes