Natural Memory NM2.1: 记忆路由器分叉、数据集缺陷修复与全轴评测证据
- 引入 MemoryRouterXL 与 v5/v6 流式多线程训练/编码管线 - 修复 prepare_memory_router_dataset 候选池重建缺陷(mega 家族 3568x 加速,输出逐字节相同) - 修复 v5 被破坏的拒答与多跳标签(train 未知样本 319 -> 16319,multi_hop 平均正例 1.00 -> 2.00) - 同存储预算下 V2-128 v6 逐轴 22/22 通过:Top-1 41.12% -> 94.62%,未知拒答 0.00% -> 100.00% - 记录三条被实测推翻的显然优化(logits_to_keep=1 反而慢 55%、XL 容量未带来收益) - 记忆手术跨架构可移植性 14/14,读写关闭时与原生模型逐位相同
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
"""Inspect the downloaded LoCoMo dataset: structure, categories, evidence format."""
|
||||
import collections
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
path = Path(sys.argv[1] if len(sys.argv) > 1 else r"H:\Memory\V2_dpskw\data\net_locomo\locomo10.json")
|
||||
data = json.loads(path.read_text(encoding="utf-8"))
|
||||
print("conversations:", len(data))
|
||||
first = data[0]
|
||||
print("top keys:", list(first.keys()))
|
||||
conv = first["conversation"]
|
||||
print("conversation keys:", list(conv.keys()))
|
||||
for key in list(conv.keys())[:5]:
|
||||
value = conv[key]
|
||||
size = len(value) if hasattr(value, "__len__") else "-"
|
||||
print(f" {key}: {type(value).__name__} len={size}")
|
||||
if isinstance(value, list) and value:
|
||||
print(" first:", json.dumps(value[0], ensure_ascii=False)[:300])
|
||||
|
||||
categories = collections.Counter()
|
||||
n_qa = 0
|
||||
turns = 0
|
||||
sessions = 0
|
||||
for item in data:
|
||||
c = item["conversation"]
|
||||
keys = [k for k in c if k.startswith("session_") and not k.endswith("date_time")]
|
||||
sessions += len(keys)
|
||||
turns += sum(len(c[k]) for k in keys)
|
||||
for q in item["qa"]:
|
||||
n_qa += 1
|
||||
categories[q.get("category")] += 1
|
||||
|
||||
print()
|
||||
print(f"total QA: {n_qa} sessions: {sessions} turns: {turns}")
|
||||
print("category distribution:", dict(sorted(categories.items())))
|
||||
|
||||
print()
|
||||
print("=== one example per category ===")
|
||||
seen = set()
|
||||
for item in data:
|
||||
for q in item["qa"]:
|
||||
cat = q.get("category")
|
||||
if cat in seen:
|
||||
continue
|
||||
seen.add(cat)
|
||||
ev = q.get("evidence")
|
||||
print(f"[cat {cat}] Q={q['question']!r}")
|
||||
print(f" answer={q['answer']!r} evidence={ev} adversarial={q.get('adversarial_answer')!r}")
|
||||
|
||||
print()
|
||||
print("=== a conversation turn, verbatim ===")
|
||||
sample = data[0]["conversation"]["session_1"][:3]
|
||||
print(json.dumps(sample, ensure_ascii=False, indent=1)[:900])
|
||||
Reference in New Issue
Block a user