Learning to Forget: Sleep-Inspired Memory Consolidation for Resolving Proactive Interference in Large Language Models
Organizations: Kennesaw State University
Abstract
Large language models (LLMs) suffer from proactive interference (PI): outdated information in the context window disrupts retrieval of current values. This interference degrades retrieval accuracy log-linearly as stale associations accumulate, a bottleneck that persists regardless of context length and resists prompt-engineering mitigations. Biological brains resolve an analogous challenge through sleep-dependent memory consolidation: synaptic downscaling, selective replay, and targeted forgetting. We propose SleepGate, a biologically inspired framework that augments transformer-based LLMs with a learned sleep cycle over the key-value (KV) cache. SleepGate introduces three mechanisms: (1) a conflict-aware temporal tagger detecting when new entries supersede old ones; (2) a lightweight forgetting gate trained to selectively evict or compress stale cache entries; and (3) a consolidation module that merges surviving entries into compact summaries. These components activate periodically during inference in sleep micro-cycles, governed by an adaptive entropy-based trigger. We formalize a dual-phase training objective jointly optimizing language modeling during the wake phase and post-consolidation retrieval during the sleep phase. Theoretical analysis shows SleepGate reduces the interference horizon from O(n) to O(log n). In experiments with a small-scale transformer (4 layers, 793K parameters), SleepGate achieves 99.5% retrieval accuracy at PI depth 5 and 97.0% at depth 10, while all five baselines -- full KV cache, sliding window, H2O, StreamingLLM, and decay-only ablation -- remain below 18%. Our framework offers an architecture-level solution that prompt engineering cannot address.
Figures & tables
| Component | Parameters | Description |
| Base transformer | 793,344 | Embedding + 4 layers + LM head |
| Temporal tagger | 16,576 | Semantic signature projection |
| Forgetting gate | 74,241 | 2-layer MLP (retention scorer) |
| Consolidation | 33,152 | Cross-attention compression |
| Total | 917,313 | |
| Sleep overhead | 15.6% |
| Method | |||||||
|---|---|---|---|---|---|---|---|
| SleepGate | 82.5 / 0.0 | 99.0 / 0.5 | 99.5 / 0.0 | 97.0 / 3.5 | 73.5 / 23.5 | 30.5 / 55.5 | 16.5 / 62.0 |
| StreamingLLM | 17.5 / 0.0 | 18.0 / 9.0 | 10.0 / 28.5 | 6.0 / 19.5 | 6.0 / 22.5 | 4.0 / 31.5 | 5.5 / 29.0 |
| Sliding Window | 12.5 / 0.0 | 12.5 / 7.0 | 8.0 / 23.5 | 8.5 / 23.0 | 6.5 / 23.0 | 4.0 / 22.5 | 2.0 / 30.0 |
| Decay Only | 9.5 / 0.0 | 12.5 / 7.0 | 7.0 / 22.0 | 7.5 / 23.0 | 8.5 / 25.0 | 3.5 / 23.5 | 4.5 / 22.5 |
| Full KV Cache | 8.0 / 0.0 | 9.0 / 7.5 | 3.5 / 21.0 | 2.0 / 17.0 | 3.0 / 20.0 | 1.5 / 18.5 | 2.5 / 19.5 |
| H 2 O | 6.5 / 0.0 | 7.5 / 5.5 | 1.0 / 7.5 | 4.0 / 11.0 | 3.0 / 11.5 | 0.0 / 10.0 | 0.5 / 9.0 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Symbol | Value | Description |
|---|---|---|---|
| Gate hidden dim | 128 | Hidden dimension of | |
| Semantic sig. dim | 64 | Dimension of semantic signatures | |
| Local pool window | 4 | Window size for local pooling | |
| Conflict threshold | 0.85 | Cosine similarity for conflict | |
| Keep threshold | 0.7 | Retention score for keeping | |
| Evict threshold | 0.3 | Retention score for eviction |
| Biological Mechanism | SleepGate Module | Functional Correspondence |
|---|---|---|
| Synaptic homeostasis (global downscaling during SWS) | Key decay | Log-scale reduction of key magnitudes preserves relative importance while reducing absolute interference |
| Hippocampal-neocortical replay (selective consolidation) | Consolidation module | Cross-attention compression transfers important information into compact representations |
| Dopaminergic active forgetting | Forgetting gate | Learned, content-dependent eviction of stale entries |
| Sleep spindles / sharp-wave ripples (oscillatory coordination) | Adaptive sleep trigger | Entropy and conflict signals coordinate when consolidation occurs |
| REM sleep (pattern separation) | Semantic signatures | Explicit representation of “what slot” each entry occupies enables disambiguation |
KV-Cache Management
Key-value (KV) cache management reduces and coordinates Transformer attention state to make long-context inference faster and more memory-efficient.
See all 199 papers