diff --git a/paper.md b/paper.md index 535db8f..9d185a5 100644 --- a/paper.md +++ b/paper.md @@ -1,35 +1,18 @@ # Solving the Clive Wearing Problem: One-Shot Episodic Memory for Frozen Transformers -*Named for Clive Wearing, the musician who lost the ability to form new long-term memories but retained his procedural skills. Like Wearing, our frozen backbone retains all its trained capabilities but cannot form new memories through its own weights. We give it an external hippocampus.* - ## Abstract -We present a method for teaching frozen transformer language models new facts without gradient descent. The model's own hidden states are stored as episodic memories using Hebbian association. On recall, stored hidden states directly bias token generation through logit injection, bypassing re-encoding. A Continuous Thought Machine (CTM) gates memory retrieval through multi-tick deliberation. Sleep consolidation optimizes synapse weights via closed-form least-squares without backpropagation. We demonstrate one-shot learning of novel facts (100% recall accuracy) with zero weight modification to the backbone, surviving NREM/REM sleep cycles. The system runs on commodity hardware. +We enable frozen transformers to form new memories without gradient descent. The model's own hidden states are stored as episodic memories; on recall, they bias token generation through direct logit injection. A frozen Qwen 2.5 0.5B taught three novel facts recalls all three at 100% accuracy. No weights are modified. No gradients are computed. Memories persist to disk across sessions. Code and reproduction: [git.rotko.net/tommi/epimem](https://git.rotko.net/tommi/epimem). -**Key result**: A frozen Qwen 2.5 backbone taught three facts about a fictional entity recalls all three correctly after a sleep consolidation cycle. No gradients computed at any point. The least-squares residual bound confirms synapse optimality post-consolidation. +## 1. The Clive Wearing Problem -## 1. Introduction +Clive Wearing lost his hippocampus to encephalitis in 1985. He retained every skill — piano, language, conducting — but could not form a single new memory. Every 7 seconds, he believed he had just woken up for the first time. His diary: "8:31 AM Now I am awake. 8:34 AM Now I am properly awake." Each entry crossed out moments later. -Teaching a pretrained language model new information requires one of: +Current LLMs are Clive Wearing. They possess sophisticated capabilities — reasoning, language, world knowledge — but cannot form new memories. Every conversation starts from zero. The context window is their 7-second span. When it clears, everything is gone. -- **Fine-tuning**: gradient descent on new data. Modifies weights. Causes catastrophic forgetting. Computationally expensive. -- **RAG** (Retrieval-Augmented Generation): retrieve relevant text, insert into context window. No learning occurs — the model re-processes text each time. Context-window dependent. -- **LoRA/Adapters**: low-rank gradient updates to auxiliary weight matrices. Still requires backpropagation. -- **In-context learning**: examples provided in the prompt. Ephemeral — disappears when the context clears. +Fine-tuning modifies weights and causes catastrophic forgetting. RAG re-encodes text into the context window every time — no actual learning. LoRA still requires gradients. In-context learning vanishes when the conversation ends. -We propose a fifth approach: **hidden-state episodic memory**. Store the model's own internal representations as memories. On recall, inject the stored representation directly as a logit bias, modifying the output distribution without touching weights. - -The key insight: a transformer's hidden states already encode semantic meaning in a continuous vector space. Rather than storing text and re-encoding it (as in RAG), we store the hidden state itself. Recall is a nearest-neighbor lookup in the model's own representation space. The retrieved memory biases generation by direct logit injection — no re-encoding, no context window consumption. - -This mirrors biological episodic memory. The hippocampus stores cortical activation patterns during experience and replays them during recall to bias cortical processing. No synaptic weight changes occur during recall — only during offline consolidation (sleep). The frozen backbone is the cortex. The memory bank is the hippocampus. Sleep consolidation is NREM replay. - -### 1.1 Clive Wearing Analogy - -Clive Wearing suffered bilateral hippocampal damage in 1985 and lost the ability to form new episodic memories. Yet he retained all procedural skills — he could still play piano, conduct a choir, recognize music. His cortex was intact; his hippocampus was destroyed. - -A frozen transformer is Clive Wearing. It has all its learned capabilities (language, reasoning, world knowledge encoded in weights) but cannot form new memories — it processes each input fresh, with no persistence beyond the context window. - -We give it a synthetic hippocampus: an external episodic memory bank that stores hidden-state patterns and replays them to bias future processing. The backbone never changes. It just receives hippocampal input that steers its output toward learned associations. +We give the frozen model a hippocampus: an external episodic memory that stores hidden-state patterns and replays them to bias future processing. The backbone never changes. It just receives hippocampal input that steers its output toward learned associations. ## 2. Method