Qwen3.5-0.8B-NestedMemory-v5b

Same architecture as v5 (Qwen3.5-0.8B frozen + NestedMemoryLayers after decoder layers 10 and 18, all control by learned neural gates, no RAG), trained 1,500 more steps with a new data source: personal facts whose values are real Thai / English words.

Why: a local test of v5 showed it copied real words wrongly (ลูกชิ้น → ลูกเล่น, พิมพ์ลดา → บอมพท์ลดา) and answered "never told" for relations it had been told (partner, pet). v5's training values were mostly random strings / syllables over 8 relation kinds. v5b adds personal_facts.py: ~24 Thai relations + 12 English relations (partner, parents, pet, favourite fruit, sport, car, allergy, favourite shop, …), values = real Thai names / words (Thai Wikipedia titles and answer spans from iapp) and English names / words; 30% of these episodes are English. Mix: 35% personal episodes, 40% general-chat preservation (as v5), rest = v4/v5 data.

Results (same final protocol for both, run in the same job)

Held-out real-word personal facts (iapp test split + values never used in training, 25% English; 60 each)

v5 v5b
told in one chat, asked later 15% 58%
+ 3 unrelated sessions in between 18% 55%

Chat, then come back (40 conversations: tell → 3-7 turns on other topics → ask again)

v5 v5b
recalled when asked midway (new chat) 75% 88%
recalled when coming back at the end (new chat) 70% 82%
same, memory wiped 0% 0%
general-knowledge answers correct while memory loaded (original Qwen 92%) 97% 93%
remembered value leaks into unrelated answers 0.6% 0.6%
one continuous chat: mid / end 70% / 72% 87% / 80%
one continuous chat: general (base 93%) / leak 92% / 3.0% 93% / 4.8%

OOD — sentence patterns never used in training (600 items; told now / after 3 other sessions; wiped = 0%)

type v5 v5b
ALL 58% 73%
foreign_name 57% / 44% 86% / 85%
name_new_pattern 56% / 62% 59% / 57%
number 59% / 47% 44% / 49%
odd_string 82% / 77% 80% / 79%
pet_word 73% / 62% 83% / 76%
province 28% / 33% 91% / 78%

Other held-out checks (n=60 each)

v5 v5b
random codes (copy) / long 40% / 47% 47% / 52%
bAbI / long 33% / 33% 37% / 43%
synthetic profile / long 95% / 90% 93% / 95%
Thai Wikipedia QA (iapp) / long 8.3% / 12% 12% / 12%

Honest notes

  • Numbers got worse on the OOD "number" type (≈ 59% → 44% when asked right away); general-knowledge accuracy in a new chat dipped 97% → 93% (still above the original Qwen's 92%); leak in one continuous chat 3% → 4.8%.
  • Thai-Wikipedia passage QA (iapp) is still near zero: memory is good at short personal facts, not at long passages.
  • Random letter codes are still copied wrongly about half the time.

Side experiment: same recipe on Qwen3.5-2B (v6) — not released

Memory trained from scratch on Qwen3.5-2B (stage 1: v3 synthetic curriculum 2,400 steps → 81% / 75% recall; stage 2: v5b recipe + layer-10 memory, 2,000 steps). Final protocol: come-back recall (new chat) 22.5% (v5b 82%), OOD 20% (v5b 73%), real-word personal facts 30% / 23% (v5b 58% / 55%), random codes 0%; general knowledge with memory loaded 100% (= original 2B), leak 0%. The 0.8B memory has had ~4 rounds of training (v3 → v4 → v5 → v5b); the 2B memory had one short round and was still improving slowly, so this is under-trained, not a verdict on size. Logs: results/train_log_v6_2b*.json, results/eval_v6_2b_*.json.

Usage

Same as v5 (variant_options("v5b") = v5 architecture). Use the tokenizer from tokenizer.json: newer transformers (e.g. 5.15) builds a Qwen3.5 tokenizer that splits Thai differently, and then even plain Qwen answers Thai badly. Model/qwen_memory.py → load_tokenizer() detects this and falls back automatically.

import torch
from config import ProjectConfig
from Model.qwen_memory import QwenMemoryWrapper
from train_nested import variant_options

cfg = ProjectConfig(dtype=torch.bfloat16, **variant_options("v5b"))
w = QwenMemoryWrapper(cfg=cfg, memory_type="nested")
w.model.load_state_dict(torch.load("unified_nested_L18_v5b_blank.pt"), strict=False)
w.memorize_text("แฟนผมชื่อพิมพ์ลดา")
w.end_session(); w.memory.forget(days=1)
print(w.generate("แฟนผมชื่ออะไร", update_memory=False))

Training: train_v4.py (train_v4("v5b", init=v5, mix_general=0.4, mix_personal=0.35, steps=1500)), data: personal_facts.py, Modal: run_v5b_pipeline in modal_train.py. Logs and all eval JSONs are in results/.

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-v5b

Finetuned
(1,065)
this model

Datasets used to train Jommarn/Qwen3.5-0.8B-NestedMemory-v5b