research: lock reduced AttnRes model contract

This commit is contained in:
wuyang
2026-07-30 06:34:52 +08:00
parent 9039de1b02
commit e3617532de
+10 -3
View File
@@ -111,21 +111,29 @@ manifest 必须记录:
| positional embedding | learned absolute, 256 × 192 | | positional embedding | learned absolute, 256 × 192 |
| norm | RMSNorm, `eps=1e-6` | | norm | RMSNorm, `eps=1e-6` |
| attention | causal multi-head softmax,score 用 FP32 softmax | | attention | causal multi-head softmax,score 用 FP32 softmax |
| MLP | bias-free SwiGLU,two `192→768` projections + one `768→192` projection |
| input/output embedding | tied | | input/output embedding | tied |
| final readout | RMSNorm 后乘 tied token embedding |
三种 residual graph: 三种 residual graph:
1. **PreNorm baseline**:`h ← h + f(RMSNorm(h))`。 1. **PreNorm baseline**:`h ← h + f(RMSNorm(h))`。
2. **Full AttnRes**:每个 attention / MLP 子层从 embedding 与所有早期子层输出中, 2. **Full AttnRes**:每个 attention / MLP 子层从 embedding 与所有早期子层输出中,
以 `softmax(q_l^T RMSNorm(source))` 选出输入;当前分支输出成为下一个独立 source。 以 `softmax(q_l^T RMSNorm(source))` 选出输入;当前分支输出成为下一个独立 source;
32 个子层结束后用同型 output mixer 聚合 embedding + 32 个输出。
3. **Block AttnRes**:32 个子层按顺序冻结为 8 块、每块 4 个子层;跨块保存 8 个 block 3. **Block AttnRes**:32 个子层按顺序冻结为 8 块、每块 4 个子层;跨块保存 8 个 block
sums,块内使用 partial sum,embedding 永远是 source 0。 sums,块内使用 partial sum,embedding 永远是 source 0;最后用同型 output mixer 聚合
embedding + 8 个完整 block sums。
AttnRes 每个子层增加: AttnRes 每个子层增加:
- 一个 `d_model` pseudo-query,初始化严格为 0; - 一个 `d_model` pseudo-query,初始化严格为 0;
- 一个 `d_model` RMSNorm key weight,初始化严格为 1。 - 一个 `d_model` RMSNorm key weight,初始化严格为 1。
Full / Block 各自再增加一组相同结构的 output mixer。所有 bias-free linear 与 embedding 使用
`N(0, 0.02)`;attention output projection 与 MLP down projection 按
`0.02 / sqrt(2 × 16)` 缩放初始化;普通 RMSNorm 为 1。
核心 token / position embedding、attention、MLP、输入 norm 与 tied output weights 在同一 seed 核心 token / position embedding、attention、MLP、输入 norm 与 tied output weights 在同一 seed
的三种架构中必须逐 tensor SHA-256 exact。AttnRes 额外参数与 mixer 运算如实报告,不通过 的三种架构中必须逐 tensor SHA-256 exact。AttnRes 额外参数与 mixer 运算如实报告,不通过
无作用 dummy 参数伪造“完全等容量”。 无作用 dummy 参数伪造“完全等容量”。
@@ -266,4 +274,3 @@ src/data/k3-attnres-reduced-compact.json
原始 parquet 与训练 checkpoint 留在本机 cache,不进入公开仓库;manifest、原始指标 JSON、 原始 parquet 与训练 checkpoint 留在本机 cache,不进入公开仓库;manifest、原始指标 JSON、
分析结果、代码、环境、checksum 和确定性复现账进入开源树。 分析结果、代码、环境、checksum 和确定性复现账进入开源树。