28 Commits

Author SHA1 Message Date
iomgaa e7cf27cecc docs: roadmap 存档点更新——docs/04 已精读,下一步开写 E1(压缩前存档)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:48:40 -04:00
iomgaa 142aeb8ab1 docs: 层 3 章节文档 docs/04(语义相似度 φ + MC 估计器,式3/4/5)
论文精读(§3.2.1-3.2.2 式3/4/5)+ 参考实现解剖(带行号)+ 保留/替代/删除 + E1-E3
重构任务 + 验证方式。核心:logit-free 支点(比文本非比 logits)、Dirichlet 贝叶斯
π̂ 反塌缩、detach 命门(层 2 §4.1 姊妹篇)。解剖抓出参考实现三处不一致(φ 比文本
vs 比 token id、rouge1 集合 vs 多重集)作重构清理依据。roadmap 存档点/索引同步。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:40:58 -04:00
iomgaa fac8e0dcc5 docs: 层 2 关账——§6.1 远程实证勘误"预期见毛刺" + roadmap 存档点 + 接口回看
- docs/03 §6.1:两次远程跑(sanity/noclip)均平稳,勘误当初"预期毛刺"的错误
  预测;三条实证结论(爆炸真机制但本区间高度阻尼、grad_norm 是裁剪前值、层 5
  真正杀手锏是 logit-free)
- roadmap 存档点:层 2  关账,判据全过、关键发现、接口回看(全判"深",
  三条不返工小注);章节索引 03 标已关账;下一步层 3

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:30:45 -04:00
iomgaa 2f4780b69f docs: roadmap 存档点更新——层 2 代码关账(U1-U5 全绿),列远程冒烟三盯待办
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 05:24:25 -04:00
iomgaa e42af5256f 层2/U1: 新增 DistillConfig(式(2) 白盒蒸馏参数)+ docs/03 表述打磨
configs.py(对应 docs/03 §5 U1):
- DistillConfig 自包含、不继承 SFTConfig;teacher_model 进 config、student 留脚本
- 三处刻意缺席: 无 teacher_completions_path/max_length/top_k(现场生成+全词表)
- 两温度分名: kl_temperature(散度 softmax)vs gen_temperature(on-policy 采样)
- 默认即式(2): beta=1 反向KL、温度1、纯采样 top_p=1;lr=1e-6(论文§5.1蒸馏)
- __post_init__ 8 分支构造即校验(gen_temperature>0 护 on-policy 语义)

docs/03:
- §2.3 β 三副面孔表: 记号统一 π、补 mode-seeking 对称、附全词表/稀疏双镜像说明
- §2.3 三条实现约定(温度/log域/batchmean)由一句话拆成可扫读表格
- §3 偏差清单上方补统领抉择原则

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 03:37:44 -04:00
iomgaa db392d9c81 存档点:压缩前补记层 2 开写前两件待办(默认参数确认+显存重审、自查题对答案)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 10:47:08 -04:00
iomgaa eb56883267 层1 正式关账:判据全过、接口回看完成、疤痕档案与诊断工具箱入存档点
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 10:44:58 -04:00
iomgaa 4f13365ffa 层1: 损失缩放终解——显式退出 HF 新式梯度累积契约(model_accepts_loss_kwargs=False)
第二幕根因:新式契约的 ×world_size 补偿在基类 compute_loss 尾部(v5
trainer.py:2028),整体重写会绕过它 → loss 与梯度 ÷4(sanity 0.244≈0.85/4)。
按 HF 文档建议(trainer.py:1977)退出新式契约回经典行为;docs/02 勘误改为
两幕全记录。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 10:25:11 -04:00
iomgaa ee16e29846 层1: 修复 HF 梯度累积契约坑——compute_loss 按新式契约返回 sum/num_items_in_batch
根因(探针定案):预训练模型真实 CE≈0.85,训练日志 7.5≈0.94×8(累积步数)。
Qwen3 forward 接受 loss_kwargs → Trainer 走新式契约不再除以累积步数,我们
返回裸 mean 导致日志与梯度同放大 8 倍。sft_loss 纯函数不动,适配收口在
compute_loss;docs/02 §5 勘误起点预期(~0.85)并记录此坑。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 10:18:09 -04:00
iomgaa a0faec0df7 层1: 修复远程 sanity OOM——per_device batch 8→2、累积 2→8(全局 64 不变)
根因:150k 大词表下显存大头是 (B,T,V) logits 链(fp32 ~20G@B=8)与逐层激活,
均正比于 B 而与 0.6B 参数量无关。docs/02 §2.6 旧显存估算勘误入档;
train_sft.sh 加 expandable_segments 防碎片。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 09:21:38 -04:00
iomgaa 68216ace22 docs: 第三章勘误——off-policy 切片是数据轨迹上的 KL 蒸馏而非混 SFT;补 prompt-only 下静默空转的说明
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 09:02:41 -04:00
iomgaa 1d272b6d6c docs: roadmap 索引同步(第三章已写待读)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 08:34:45 -04:00
iomgaa 3c1530a1db docs: 第三章——层 2 white-box OPD(式(2) 精读、standard 路径解剖、U1-U5 重构任务)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 08:34:29 -04:00
iomgaa c5a3b7d0bb 层1/T5: 自包含训练脚本 train_sft.sh + train_sft.py;层 1 代码收口
- train_sft.py: FSDP 环境变量前置块(import 前,DDP 下无害);fail-fast 加载
  顺序(数据→tokenizer→模型);首样本自检打印(真 tokenizer 掩码边界肉眼核对);
  remove_unused_columns=False 等非显然约束逐条注释;sanity 模式 = replace 覆盖
- train_sft.sh: 显式 CUDA_VISIBLE_DEVICES 4 卡、PYTHONUNBUFFERED、HF 镜像/缓存
  改道 /data,前置检查清单(含 scp 数据命令)
- 本地验证:fail-fast 到 teacher 缓存缺失处显式报错(941/1000,59 条真实命中
  反向证明 prompt_key 契约端到端成立)
- roadmap 存档点:层 1 代码完成,进入运行阶段

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 08:16:24 -04:00
iomgaa 20e6d97427 层1/T2: teacher.py 批量生成 + sha256 JSONL 缓存;teacher 改定 MiniMax-M3
- teacher.py: 通用 OpenAI 兼容客户端(配置驱动 base_url,替代 OpenRouter 专用);
  缓存即断点(逐条落盘+flush,重跑自动续传);单条失败先落盘其余、结束汇总显式报错;
  M3 思考段 <think>...</think> 入库前剥离(只剥开头一段)
- configs.py: 新增 TeacherGenConfig(采样参数显式化;连接三元组走 .env)
- scripts/generate_teacher_completions.py: 自包含生成脚本(本地跑,与训练侧
  同 seed 同子集约束已注明)
- teacher 决策变更同步:.env.example / docs/00 关键设定与存档点 / docs/02
- tests/test_teacher.py: 10 个单测(假客户端注入),含与 attach 的端到端契约闭环

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 07:52:53 -04:00
iomgaa 240f404416 工作模式变更入档:层 1 起 Claude 编写代码、用户精读提问;存档点同步
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:30:55 -04:00
iomgaa 6c128ad6f5 docs/02:FSDP 决策定案——DDP 到 1.7B,触发点写死(4B 或 seq>8K),env 坑今日消除(脚本头部前置块)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:21:30 -04:00
iomgaa 0bcfc6efd4 层 0 关账:两端环境验收通过(本地 4 passed + 远程 4 passed),存档点进入层 1
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:05:17 -04:00
iomgaa 12e2a8b0ae docs: 第二章——层1 SFT 基线开工文档(参考实现解剖+保留/替代/删除清单+任务表);CLAUDE.md 映射表补 data.py
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:51:06 -04:00
iomgaa 77f0419bad roadmap:训练数据定为 DAPO-Math-17K(对齐论文§5.1),登记 φ/β 两处论文-代码默认值背离
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:47:30 -04:00
iomgaa 9c0ec15716 setup_remote.sh 自清 pip 残留;存档点记录远程根分区结构性问题(/root/zym 507G)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:39:14 -04:00
iomgaa f255d5613a docs: roadmap 增加存档点小节(断点恢复用),登记层 0 当前状态
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:20:12 -04:00
iomgaa cccccc0ce6 docs: 新增研究方向记录(RI-1:OmniOPD × ZO-RGD 零阶黎曼优化的三个结合点)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 02:57:01 -04:00
iomgaa 72799a34dc tests: 预置 π̂ detach 命门守护测试(对应 docs/01 §3.4,层 3 接入真实 estimator)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 02:32:05 -04:00
iomgaa c9eddd5be8 docs: 修正 π̂ detach 失败机制的方向性错误(压低先验逃逸而非抬高自我强化),补充推导要点
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 02:23:49 -04:00
iomgaa d0bedd564c docs: 教学注释规范与接口回看规则入 CLAUDE.md;新增 CLAUDE.md 取舍决策附录
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 11:59:05 -04:00
iomgaa 8647c5a89d docs: 第一章——论文精读与参考实现全景映射(含实现与论文差异清单)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 11:29:20 -04:00
iomgaa 6dc13314d8 仓库骨架:README、CLAUDE.md、分层重构路线图(docs/00-roadmap.md)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 11:26:11 -04:00