Qwen3.5-0.8B-NestedMemory-L18 (Unified In-Model Continual Memory)

A Unified Continual-Memory Transformer built on Qwen/Qwen3.5-0.8B combining:

  1. Loop 1 (Fast Token-Level Titans Associative Memory M, Momentum S): Updates online during the forward pass (T > 1 prefill) without backpropagation at inference time.
  2. 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)).
  3. 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_write automatically opens on factual statements and closes (< 0.5 -> 0.0) on questions so questions never overwrite stored memories.
    • Learned gate_read activates sparsely on entity tokens during memory queries and closes (< 0.15 -> 0.0) on general knowledge queries so base model knowledge remains 100% intact.
  4. 1 Model = 1 Person Deployment (M=0, V=0): All memory buffers (M, S, slot_values, expert_strength) live directly inside the model's state_dict (register_buffer). The base checkpoint unified_nested_L18_blank.pt is exported with M=0, V=0 so 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 + NestedMemoryLayer at Layer 18 with blank memory buffers M=0, V=0).
  • nested_memory_layer_L18.pt: Standalone NestedMemoryLayer weights & 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.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Jommarn/Qwen3.5-0.8B-NestedMemory-L18

Finetuned
(1,064)
this model