← Latest papers
🤖 machine learning

Memory as a Markov Matrix: Sample Efficient Knowledge Expansion via Token-to-Dictionary Mapping

This article proposes a sample-efficient framework for continuous knowledge expansion in large language models by representing memory as a Markov transition matrix and employing a token-to-vocabulary mapping strategy with minimal embedding updates to avoid catastrophic forgetting.

Original authors: Kaustubh Pethkar, Ziyang Xiong, Zuofeng Shang, Yingcong Li

Published 2026-05-07
📖 4 min read☕ Coffee break read

Original authors: Kaustubh Pethkar, Ziyang Xiong, Zuofeng Shang, Yingcong Li

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine a Large Language Model (LLM) as a vast, highly organized library of stories. Every time the model reads a sentence, it is as if a librarian looks at the last word and guesses which word comes next.

Normally, if you want to teach this librarian a brand-new word (such as a new scientific term or a slang expression), you must retrain the entire library. However, here lies the problem: when you retrain the entire library to learn the new word, the librarian often forgets how to tell the old stories correctly. This is known as "catastrophic forgetting."

This article proposes a clever, low-effort way to add new words without damaging the old ones. Here is the breakdown with simple analogies:

1. The Library as a "Traffic Map" (The Markov Idea)

The authors view the language model not as a complex brain, but as a traffic map.

  • The Nodes: Every word in the dictionary is a city on the map.
  • The Roads: The connections between words are roads. If you are in the city "The," certain roads lead to "cat," "dog," or "sun."
  • The Memory: The model's "memory" is merely the map of these roads. It knows that "The" usually leads to "cat" with a certain probability.

2. The Problem: Adding a New City

If you want to teach the model a new word (let's call it "Zorp"), you are essentially adding a new city to the map.

  • The Old Way (Full Fine-Tuning): You try to redraw the entire map to include "Zorp." In doing so, you accidentally delete or alter the roads between the old cities. The librarian forgets that "The" leads to "cat" and instead starts saying that "The" leads to "Zorp."
  • The Article's Way: Instead of redrawing the entire map, you simply add a sign for "Zorp." You say: "Hey, when you see 'Zorp,' treat it exactly the way you treat 'The' or 'Cat'."

3. The Solution: The "Token-to-Dictionary" Map

The article proposes a strategy called Token-to-Dictionary Mapping.

  • Imagine you have a new, strange word "Zorp." Instead of teaching the model the meaning of "Zorp" from scratch, you tell the model: "When you see 'Zorp,' just act as if it were the word 'Star'."
  • The model does not need to learn new roads for "Zorp." It only needs to know that "Zorp" points to the same destination as "Star."
  • Since the model does not need to change the existing roads (the transition probabilities between old words), it never forgets the old stories.

4. The "Sample Efficiency" (Why It Is Fast)

The authors prove mathematically that this is incredibly efficient.

  • The Analogy: If you want to learn a new word, you do not need to read the entire library again. You only need to read a few examples of how this new word is used in sentences.
  • The Math: The number of examples you need depends on how many existing words you map the new word to. If you map "Zorp" to only 5 common words, you need only a tiny amount of data to learn it. You do not need to worry about the size of the entire library (which might have 100,000 words).

5. The Experiment: Teaching Mathematics and Made-Up Words

The researchers tested this with two scenarios:

  1. The Magic Operator: They taught a model a special symbol (like ⟨spec⟩) that meant "multiply."
    • Result: The model learned very quickly to multiply with the new symbol.
    • The Gain: Crucially, the model still knew how to add numbers. With other methods, learning the new symbol caused the model to forget how to add. This method kept the addition skills perfect.
  2. Made-Up Words: They invented 100 nonsense words (like "glor" and "zorp") and inserted them into sentences.
    • Result: The model learned to use these invented words correctly without forgetting how to speak English.
    • Comparison: Other methods (such as standard fine-tuning or LoRA) caused the model to forget English while learning the invented words. The new method caused not a single instance of forgetting.

Summary

Consider this method as adding a new room to a house without tearing down the walls of the existing rooms.

  • Old Way: To add a new room, you rebuild the entire foundation. The old rooms crack and fall apart.
  • New Way: You build the new room and attach a door that leads directly into an existing hallway. The old hallway remains exactly as it was, and the new room fits perfectly inside.

The article claims this is a mathematically proven way to expand a language model's vocabulary with very few data points while suffering absolutely no loss of prior knowledge.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →