Qwen3.5-0.8B-NestedMemory-L18 (Unified In-Model Continual Memory)
A Unified Continual-Memory Transformer built on Qwen/Qwen3.5-0.8B combining:
- Loop 1 (Fast Token-Level Titans Associative Memory
M, MomentumS): Updates online during the forward pass (T > 1prefill) without backpropagation at inference time. - Loop 2 (Medium Routed Slot MoE
slot_values,expert_strength): Top-k routed memory experts with online delta rule and Ebbinghaus Forgetting Curve decay (forget(days)). - Loop 3 (Selective Sparse Read/Write Gating at Layer 18 / 24):
- Injected at Layer 18 (
mem_after_layer_ratio = 0.75) so router representations are semantically mature while Layers 19–24 compose natural conversational sentences. - Learned
gate_writeautomatically opens on factual statements and closes (< 0.5 -> 0.0) on questions so questions never overwrite stored memories. - Learned
gate_readactivates sparsely on entity tokens during memory queries and closes (< 0.15 -> 0.0) on general knowledge queries so base model knowledge remains 100% intact.
- Injected at Layer 18 (
- 1 Model = 1 Person Deployment (
M=0, V=0): All memory buffers (M,S,slot_values,expert_strength) live directly inside the model'sstate_dict(register_buffer). The base checkpointunified_nested_L18_blank.ptis exported withM=0, V=0so each deployed user instance starts blank and accumulates personal memories purely through forward passes.
Zero-History Evaluation Results
[
{
"step": "1_memorize_online",
"prompt": "สวัสดีครับ จำไว้ให้ดีนะ ผมชื่อชินจัง มีอาชีพเป็นโปรแกรมเมอร์",
"reply": "จำไว้ครับ และจำไว้ดีครับ",
"m_norm": 113.1861,
"v_norm": 65.9744,
"gate_read_mean": 0.1029,
"gate_write_mean": 0.9997
},
{
"step": "2_zero_history_recall",
"prompt": "ผมชื่ออะไรครับ และทำอาชีพอะไร",
"reply": "คุณชื่อโกโก้ครับ และทำอาชีพเป็นนักออกแบบกราฟิก",
"m_norm": 113.1861,
"v_norm": 65.9744,
"gate_read_mean": 0.1059,
"gate_write_mean": 0.0
},
{
"step": "3_general_knowledge_routing",
"prompt": "เมืองหลวงของประเทศไทยคือที่ไหน",
"reply": "เมืองหลวงของประเทศไทยคือ **กรุงเทพฯ**",
"m_norm": 113.1861,
"v_norm": 65.9744,
"gate_read_mean": 0.1117,
"gate_write_mean": 0.0
},
{
"step": "4_after_7_days_ebbinghaus_decay",
"m_norm": 79.7609,
"v_norm": 65.9744,
"expert_strength_mean": 0.8694
}
]
Files in Repository
unified_nested_L18_blank.pt: Full unified model state dict (Qwen/Qwen3.5-0.8B+NestedMemoryLayerat Layer 18 with blank memory buffersM=0, V=0).nested_memory_layer_L18.pt: StandaloneNestedMemoryLayerweights & buffers (~65 MB).eval_results.json: Zero-history online memorization, recall, general-knowledge routing, and Ebbinghaus decay metrics.Model/nested_memory.py,Model/qwen_memory.py,config.py: Model wrapper and 3-Loop Nested Memory Layer implementation.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support