From a1a52d42807c43c0dde3de04f65c7d7d93dbd79e Mon Sep 17 00:00:00 2001 From: wuyang <5700876+banisherwy@user.noreply.gitee.com> Date: Thu, 30 Jul 2026 12:20:47 +0800 Subject: [PATCH] site: explain AttnRes spike path study --- PROGRESS.md | 20 +- README.md | 16 +- package.json | 1 + scripts/check-k3-attnres-spike-browser.mjs | 216 +++++ scripts/check-k3-browser.mjs | 10 +- src/components/K3AttnResSpikeLab.astro | 892 +++++++++++++++++++++ src/pages/k3/index.astro | 39 +- src/pages/progress/index.astro | 13 +- 8 files changed, 1190 insertions(+), 17 deletions(-) create mode 100644 scripts/check-k3-attnres-spike-browser.mjs create mode 100644 src/components/K3AttnResSpikeLab.astro diff --git a/PROGRESS.md b/PROGRESS.md index 50f7450..7404c86 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -8,7 +8,7 @@ |---|---:|---:|---| | 研究框架与规范 | 进行中 | 83% | Scaling Laws 二轮拟合复现与逐图精读 | | 网站设计系统 | 进行中 | 89% | 打印样式与更多通用可视化组件 | -| Kimi K3 深读 | 五轮实证进行中 | 98% | 定位 Block layer 21–25 尖峰、联查 mixer weights / reduction 敏感性,并等待 `A_log` 官方转换合同 | +| Kimi K3 深读 | 六轮实证进行中 | 99% | 对 group 6 / 7 做局部 mixer backward 干预,并等待 `A_log` 官方转换合同 | | 语言模型前史 | 完成首版 | 78% | Kneser–Ney、LSTM、Bahdanau 逐图精读与真实小语料复现 | | Transformer 基础 | 完成首版 | 79% | 多头电路、归一化 traces 与真实 kernel / KV 配置 | | 表示、位置与残差高速公路 | 完成首版 | 81% | 真实 hidden-state / norm traces、长上下文位置外推与深层稳定性消融 | @@ -41,7 +41,7 @@ - [x] 完成 486 篇关键论文索引,覆盖 16 个标签专题与 Kimi/DeepSeek 聚光主线。 - [x] 完成可检索、可按专题筛选的论文库页面。 - [x] 完成 K3、语言模型前史、Transformer 基础、表示/位置/残差、DeepSeek 谱系、Scaling Laws、数据工程、长上下文、MoE、指令微调与人类偏好、推理、Agent、原生多模态、训练系统、推理服务、数值优化与评测安全十七篇首版长文。 -- [x] 完成 K3 三轴架构、八联报告实验、四联开放工件实验、Round 04 / 05 各五联 AttnRes 独立实验、语言模型前史四联实验、Transformer 四联实验、表示深度四联实验、DeepSeek 二十二联实验、长上下文、MoE 路由、推理三页签,以及训练系统、推理服务、Scaling、数据工程、数值、Alignment、Agent、原生多模态与评测安全专题各四页签等九十九个原创交互视图。 +- [x] 完成 K3 三轴架构、八联报告实验、四联开放工件实验、Round 04 / 05 / 06 各五联 AttnRes 独立实验、语言模型前史四联实验、Transformer 四联实验、表示深度四联实验、DeepSeek 二十二联实验、长上下文、MoE 路由、推理三页签,以及训练系统、推理服务、Scaling、数据工程、数值、Alignment、Agent、原生多模态与评测安全专题各四页签等一百零四个原创交互视图。 - [x] 完成长上下文首版:五张成本账、26 篇一手论文、10+ 机制图与 8 策略交互实验室。 - [x] 核验 FlashAttention、DeepSeek-V2/V3.2/V4、Kimi Linear/K3 等六份论文原文,并建立长上下文研究账本。 - [x] 核验 Switch、ST-MoE、DeepSeekMoE、Loss-Free、V3、LatentMoE 与 K3 原文,并建立 MoE 研究账本。 @@ -288,10 +288,19 @@ - [x] K3 Round 05 五视图实验室完成:论文定义已知/未定义、绝对/归一化深度谱、六 checkpoint 时间轨迹、Output RMS 组节律、activation/parameter/BPC/成本/重放联合账全部可切换;21 个 raw JSON、完整 aggregate、compact、runner、analyzer、协议与审计进入公开树。 - [x] Round 05 本地闸门通过:94 个 Astro 文件零诊断/提示,21 个页面、1,151 个站内引用、12 个跨页锚点零失败;冻结数据、新专项、Round 04 与 K3 全量真实 Chrome 回归通过,桌面/390px 移动端零文档级溢出、零运行时异常。 - [x] K3 Round 05 以功能提交 `f7670ef`、不可变镜像 `20260730T022610Z-f7670ef` 发布;OCI digest `sha256:02f902c1a64f976c6ed5d8614a826fca487b483f9addf2392637ea3f021cc09b`,NAS healthy / 零重启、21/21 公网路由、HTTPS/2、gzip/immutable 与三套 K3 生产 Chrome 回归全部通过;保留 `20260729T233142Z-4ce780d` 回滚。 +- [x] K3 Round 06 在正式训练前冻结 `llm-atlas-k3-attnres-spike-path-v1`:固定 Round 05 depth-32 Block、三个 seed、8,000 steps、六个 checkpoint、layer 21–25 目标集合、六个张量位置、四种 confirmatory reduction、三条 same-forward backward rule、20% 材料级阈值与完整 seed-1 replay;研究身份明确为受 Round 05 启发的 targeted follow-up,不冒充 blind discovery。 +- [x] 三个正式格共消费 196,608,000 target bytes;最终模型、优化器、六个 BPC、全部训练历史与 Round 05 post-MLP 数组逐 seed exact。完整 replay 再消费 65,536,000 bytes,16 组冻结字段全部 exact,compare SHA-256 为 `05396eaf…cbb87`。 +- [x] 尖峰发展轨迹显示 layer 21–25 不是初始化时固有:三 seed mean contrast 在 step 0 / 100 / 500 为 `0.757 / 0.563 / 0.524×`,到 step 2,000 / 4,000 / 8,000 升为 `2.233 / 2.594 / 2.754×`;seed 3 的最终 `1.881×` 同向但更弱。 +- [x] 六个张量位置的最终 mean contrast 均超过 1.5,且每个位置 3 / 3 seed 可见;最早采样点 `pre_attention_input` 已可见,但观测顺序不升级为物理起源或注入位置。 +- [x] 预注册 reduction 家族 12 / 12 格同时满足 contrast ≥ 1.5、top-5 与目标集合至少重叠 3 层、相对 element RMS 的 Spearman ≥ .8;正式结论严格写作 `robust within the preregistered reduction family`。 +- [x] 全局切断 64 个 depth mixer 与 output mixer 的 softmax/query/key source-gradient paths 后,contrast / peak 平均相对“降幅”为 `−2.00% / −0.84%`,三 seed 均略微上升,不支持材料级降低。将 learned value-backward coefficients 换成 `1/N` 后,contrast / peak 平均下降 `70.20% / 37.03%`,三 seed 都超过 20% 阈值,peak layer 全部移到 layer 2。 +- [x] mixer 观察关联与反向干预分层:layers 19–28 的 MLP latest weight 对 normalized gradient Pearson / Spearman 为 `.690 / .693`,MLP entropy 为 `−.636 / −.640`;相关性只提供候选机制,全局干预只支持 value-route sensitivity,不冒充局部 mixer attribution。 +- [x] K3 Round 06 五视图实验室完成:训练轨迹、六位置谱、12 格 reduction 稳健性、same-forward 三规则干预与 mixer 散点/证据阶梯可交互;protocol、scoping、audit、runner、analyzer、raw/aggregate/compact/reproduction 全部进入公开树。 +- [x] Round 06 本地闸门通过:97 个 Astro 文件零诊断,21 个页面、1,151 个站内引用、12 个跨页锚点零失败;Round 04/05/06 三套冻结数据、三套专项与 K3 全量真实 Chrome 回归通过,桌面/390px 移动端零文档级溢出、零 offender、零运行时异常。 ## 正在进行 -- [ ] K3 五轮下一闸门:对齐 layer 21–25 的 activation-gradient 尖峰、pre-attention / pre-MLP 位置与 mixer source weights,并做公开 reduction sensitivity;真实 K3 forward 继续等待 `A_log [128]→[96]` 官方转换或权重修订。 +- [ ] K3 六轮下一闸门:把全局 value-route sensitivity 收缩成 group 6 / group 7 的局部 mixer intervention matrix,并设计前向训练变体;真实 K3 forward 继续等待 `A_log [128]→[96]` 官方转换或权重修订。 - [ ] DeepSeek 八轮下一闸门:推进干预式 mediation、SM90 FlashMLA、FP8 / pipeline traces 与 R1-like RL 小模型复现。 - [ ] 表示、位置与残差二轮:真实 hidden-state / norm traces、长上下文位置外推复现与 mHC / AttnRes 深层稳定性消融。 - [ ] 评测安全二轮:真实 cross-harness / pass@k 复跑、Judge 元评测、动态污染与过拒案例。 @@ -490,6 +499,11 @@ | 2026-07-30 | 绝对尺度与归一化形状永久同报 | Block activation-gradient mean 约为 Baseline 54%–57%;不能把更接近 1 的首尾比自动解释为各层信号更强 | | 2026-07-30 | Round 05 完整重放过闸 | depth-32 Block seed-1 从零重训 8,000 steps;全部冻结字段与 model/optimizer state hashes exact,timing 仍单独报告 | | 2026-07-30 | K3 Round 05 梯度尺度里程碑发布 | 功能源 `f7670ef`、镜像 `20260730T022610Z-f7670ef`、OCI `sha256:02f902c1…cc09b`;复用 NAS `12010→8080`、NPM 31 / cert 41、门户 order 180,保留 Round 04 回滚点 | +| 2026-07-30 | 尖峰集合是 targeted follow-up,不是盲发现 | layer 21–25 来自 Round 05;Round 06 固定集合后才检查时间、位置、reduction 与路径,避免用同一结果发现并确认 | +| 2026-07-30 | “最早可见”与“物理起源”永久分账 | pre-attention input 是六个采样点中最早可见张量;更早 mixer 与反向传播已经作用,不能写成尖峰从这里注入 | +| 2026-07-30 | 同一前向只识别 backward-rule sensitivity | learned / detached / uniform 三模式的 logits、loss、activations 与 mixer summaries exact;结果不升级为重训模型或性能结论 | +| 2026-07-30 | value-route 降幅不写成因果贡献百分比 | 全局 uniform value-backward 让 contrast 平均下降 70.2%,只支持预注册阈值下的材料级敏感性;不声称 value 路径“解释了 70.2%” | +| 2026-07-30 | reduction 稳健性限定在预注册家族 | element RMS、token RMS mean/median/P95 的 12/12 格通过;探索性 reduction 和其他 batch 不被纳入确认性外推 | ## 未决问题 diff --git a/README.md b/README.md index 4388f46..fa89b2a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ 当前里程碑包含 17 专题学习地图、486 篇关键论文索引、Kimi K3 完整导读, 语言模型前史、Transformer 基础、表示/位置/残差、DeepSeek 技术谱系、Scaling Laws、数据工程、长上下文、MoE、指令微调与人类偏好、推理、工具使用与长程 Agent、原生多模态、训练系统、推理服务、数值优化,以及评测与安全深度专题, -以及 99 个覆盖核心机制的原创交互视图。K3 二轮导读以 32 张问题账、16 图 / 5 表审计、 +以及 104 个覆盖核心机制的原创交互视图。K3 二轮导读以 32 张问题账、16 图 / 5 表审计、 8 个交互实验和 100 个一手/官方节点,完整覆盖架构、预训练、后训练、系统、评测、案例与附录。 第三轮已完成开放工件与首个真实 kernel 里程碑:固定官方模型与 FlashKDA revisions,审计 96 个 checkpoint shards、 497,220 个 tensor entries、真实 KDA / MLA / MoE / MoonViT shapes 与小范围参数统计,并用 4 个新视图 @@ -52,6 +52,20 @@ peak allocated memory 约 2.2×,不冒充同算力优势。指定 depth-32 / B [K3_ATTNRES_GRADIENT_DEFINITION_AUDIT.md](./research/K3_ATTNRES_GRADIENT_DEFINITION_AUDIT.md)、 [K3_ATTNRES_GRADIENT_SCALE_AUDIT.md](./research/K3_ATTNRES_GRADIENT_SCALE_AUDIT.md) 与 [gradient experiment](./experiments/k3/attnres_gradient/)。 +第六轮冻结 `llm-atlas-k3-attnres-spike-path-v1`,严格复用 Round 05 的 depth-32 Block +训练格,在 optimizer 之外追踪六个 checkpoint、六个 block 内张量位置与四种预注册 +reduction,并在同一前向值下比较 learned、detached-learned 与 uniform-value-backward +三条反向规则。layer 21–25 的 post-MLP contrast 在 step 500 仍仅为三 seed 平均 `0.524×`, +到 step 2,000 升至 `2.233×`,说明尖峰在训练中形成;六个位置全部在 3/3 seed 可见, +四种 reduction 的 12/12 格同时通过 contrast、top-5 overlap 与 Spearman 闸门。 +切断全局 softmax/query/key 源梯度后 contrast 反而平均增加约 2.0%;把 learned +value-backward coefficients 换成均匀系数后,contrast 平均下降 `70.2%`、peak/mean +下降 `37.0%`,三 seed 都达到预注册材料级敏感性阈值。该结果只支持全局反向路径敏感性, +不冒充训练变体、因果贡献百分比或局部 mixer 归因。正式三格与完整 replay 共 +262,144,000 target bytes,Round 05 等价字段与 16 组 replay 字段全部 exact。详见 +[K3_ATTNRES_SPIKE_PROTOCOL.md](./research/K3_ATTNRES_SPIKE_PROTOCOL.md)、 +[K3_ATTNRES_SPIKE_AUDIT.md](./research/K3_ATTNRES_SPIKE_AUDIT.md) 与 +[spike-path experiment](./experiments/k3/attnres_spike/)。 DeepSeek 八轮专题以 24 张问题账、10 次技术转向、 22 个交互实验和 60 个一手/官方节点,串起 Dense、MoE、MLA、V3 协同、R1 与 V4; 并固定官方 V2-Lite revision,在 RTX 5090 上连续执行 7/27 层,记录 3,240 次真实专家选择、 diff --git a/package.json b/package.json index f7f8ff7..327659a 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "check:deepseek-task-bootstrap-browser": "node scripts/check-deepseek-task-bootstrap-browser.mjs", "check:k3-attnres-browser": "node scripts/check-k3-attnres-browser.mjs", "check:k3-attnres-gradient-browser": "node scripts/check-k3-attnres-gradient-browser.mjs", + "check:k3-attnres-spike-browser": "node scripts/check-k3-attnres-spike-browser.mjs", "check:k3-browser": "node scripts/check-k3-browser.mjs" }, "dependencies": { diff --git a/scripts/check-k3-attnres-spike-browser.mjs b/scripts/check-k3-attnres-spike-browser.mjs new file mode 100644 index 0000000..61127fd --- /dev/null +++ b/scripts/check-k3-attnres-spike-browser.mjs @@ -0,0 +1,216 @@ +import { writeFileSync } from "node:fs"; + +const cdpPort = process.env.CDP_PORT ?? "9229"; +const baseUrl = process.env.SITE_URL ?? "http://127.0.0.1:4329"; +const pages = await fetch(`http://127.0.0.1:${cdpPort}/json/list`).then((response) => response.json()); +const page = pages.find((entry) => entry.type === "page"); +if (!page) throw new Error(`CDP ${cdpPort} 没有可用页面`); + +const socket = new WebSocket(page.webSocketDebuggerUrl); +await new Promise((resolve, reject) => { + socket.addEventListener("open", resolve, { once: true }); + socket.addEventListener("error", reject, { once: true }); +}); + +let nextId = 0; +const pending = new Map(); +const exceptions = []; +socket.addEventListener("message", (event) => { + const message = JSON.parse(event.data); + if (message.id && pending.has(message.id)) { + const { resolve, reject } = pending.get(message.id); + pending.delete(message.id); + if (message.error) reject(new Error(message.error.message)); + else resolve(message.result); + } + if (message.method === "Runtime.exceptionThrown") { + exceptions.push(message.params.exceptionDetails.exception?.description ?? message.params.exceptionDetails.text); + } +}); + +const command = (method, params = {}) => new Promise((resolve, reject) => { + const id = ++nextId; + pending.set(id, { resolve, reject }); + socket.send(JSON.stringify({ id, method, params })); +}); +const pause = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)); +const evaluate = async (expression) => { + const result = await command("Runtime.evaluate", { expression, returnByValue: true, awaitPromise: true }); + if (result.exceptionDetails) throw new Error(result.exceptionDetails.exception?.description ?? result.exceptionDetails.text); + return result.result.value; +}; +const navigate = async (path) => { + await command("Page.navigate", { url: `${baseUrl}${path}` }); + for (let attempt = 0; attempt < 100; attempt += 1) { + await pause(100); + if (await evaluate("document.readyState === 'complete'")) return; + } + throw new Error(`${path} 加载超时`); +}; +const screenshot = async (path) => { + const result = await command("Page.captureScreenshot", { format: "png", captureBeyondViewport: false }); + writeFileSync(path, Buffer.from(result.data, "base64")); +}; + +await command("Page.enable"); +await command("Runtime.enable"); +await command("Emulation.setDeviceMetricsOverride", { + width: 1440, + height: 1100, + deviceScaleFactor: 1, + mobile: false, +}); +await navigate("/k3/"); + +const desktop = await evaluate(`(() => { + const root = document.querySelector("[data-spike-lab]"); + root.scrollIntoView({ block: "start", behavior: "instant" }); + window.scrollBy(0, -78); + const text = (selector) => root.querySelector(selector)?.textContent.trim(); + const panel = () => root.querySelector("[data-spike-panel]:not([hidden])")?.dataset.spikePanel; + const points = (selector) => root.querySelector(selector)?.getAttribute("points"); + const setSelect = (selector, value) => { + const node = root.querySelector(selector); + node.value = value; + node.dispatchEvent(new Event("change", { bubbles: true })); + }; + + const initial = { + panel: panel(), + tabs: root.querySelectorAll("[data-spike-tab]").length, + panels: root.querySelectorAll("[data-spike-panel]").length, + ledger: root.querySelectorAll(".spike-ledger article").length, + trajectoryPoints: root.querySelectorAll("[data-spike-time-points] circle").length, + trajectoryLine: points("[data-spike-time-line]"), + boundary: root.textContent.includes("不是训练出的 uniform 模型") && + root.textContent.includes("不是 70.2% 因果贡献"), + }; + root.querySelector('[data-spike-time-metric="population_cv"]').click(); + setSelect("[data-spike-time-seed]", "2026073003"); + const trajectoryChanged = { + title: text("[data-spike-time-title]"), + state: text("[data-spike-time-state]"), + line: points("[data-spike-time-line]"), + thresholdHidden: getComputedStyle(root.querySelector("[data-spike-time-threshold]")).display === "none", + }; + + root.querySelector('[data-spike-tab="positions"]').click(); + root.querySelector('[data-spike-position="pre_mlp_input"]').click(); + setSelect("[data-spike-position-seed]", "2026073002"); + const positions = { + panel: panel(), + buttons: root.querySelectorAll("[data-spike-position]").length, + state: text("[data-spike-position-state]"), + contrast: text("[data-spike-position-contrast]"), + peak: text("[data-spike-position-peak]"), + peakValue: text("[data-spike-position-peak-value]"), + pointCount: root.querySelectorAll("[data-spike-position-points] circle").length, + }; + + root.querySelector('[data-spike-tab="reductions"]').click(); + setSelect("[data-spike-reduction-seed]", "2026073003"); + setSelect("[data-spike-reduction]", "token_rms_median"); + const reductions = { + panel: panel(), + rows: root.querySelectorAll(".reduction-table tbody tr").length, + state: text("[data-spike-reduction-state]"), + contrast: text("[data-spike-reduction-contrast]"), + overlap: text("[data-spike-reduction-overlap]"), + rho: text("[data-spike-reduction-rho]"), + pointCount: root.querySelectorAll("[data-spike-reduction-points] circle").length, + }; + + root.querySelector('[data-spike-tab="intervention"]').click(); + setSelect("[data-spike-intervention-seed]", "2026073002"); + const intervention = { + panel: panel(), + lines: root.querySelectorAll("[data-spike-intervention-line]").length, + keyDrop: text("[data-spike-key-drop]"), + valueDrop: text("[data-spike-value-drop]"), + peakShift: text("[data-spike-peak-shift]"), + linePoints: [...root.querySelectorAll("[data-spike-intervention-line]")].map((node) => node.getAttribute("points").split(" ").length), + forwardIdentity: root.textContent.includes("same logits · same loss"), + }; + + root.querySelector('[data-spike-tab="mixer"]').click(); + const mixerInitial = { + panel: panel(), + points: root.querySelectorAll("[data-spike-mixer-points] circle").length, + pearson: text("[data-spike-mixer-pearson]"), + spearman: text("[data-spike-mixer-spearman]"), + title: text("[data-spike-mixer-title]"), + }; + root.querySelector('[data-spike-mixer-metric="mlp_entropy"]').click(); + const mixerChanged = { + points: root.querySelectorAll("[data-spike-mixer-points] circle").length, + pearson: text("[data-spike-mixer-pearson]"), + spearman: text("[data-spike-mixer-spearman]"), + title: text("[data-spike-mixer-title]"), + }; + + const first = root.querySelector('[data-spike-tab="trajectory"]'); + first.focus(); + first.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true })); + const keyboard = { + selected: root.querySelector('[data-spike-tab][aria-selected="true"]').dataset.spikeTab, + panel: panel(), + }; + + return { + initial, trajectoryChanged, positions, reductions, intervention, mixerInitial, mixerChanged, keyboard, + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + rootOverflow: root.scrollWidth - root.clientWidth, + }; +})()`); +await pause(180); +await screenshot("/tmp/llm-atlas-k3-attnres-spike-desktop.png"); + +await command("Emulation.setDeviceMetricsOverride", { + width: 390, + height: 844, + deviceScaleFactor: 1, + mobile: true, +}); +await navigate("/k3/"); +const mobile = await evaluate(`(() => { + const root = document.querySelector("[data-spike-lab]"); + root.scrollIntoView({ block: "start", behavior: "instant" }); + window.scrollBy(0, -64); + root.querySelector('[data-spike-tab="intervention"]').click(); + return { + tabs: root.querySelectorAll("[data-spike-tab]").length, + ledger: root.querySelectorAll(".spike-ledger article").length, + visiblePanel: root.querySelector("[data-spike-panel]:not([hidden])")?.dataset.spikePanel, + lines: root.querySelectorAll("[data-spike-intervention-line]").length, + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + rootOverflow: root.scrollWidth - root.clientWidth, + }; +})()`); +await pause(180); +await screenshot("/tmp/llm-atlas-k3-attnres-spike-mobile.png"); + +const report = { desktop, mobile, exceptions }; +console.log(JSON.stringify(report, null, 2)); + +const numeric = (value) => Number.parseFloat(value.replace("−", "-").replace("%", "")); +const failures = []; +if (desktop.initial.panel !== "trajectory" || desktop.initial.tabs !== 5 || desktop.initial.panels !== 5 || desktop.initial.ledger !== 6 || desktop.initial.trajectoryPoints !== 6) failures.push("五视图或六点轨迹初始结构异常"); +if (!desktop.initial.boundary) failures.push("因果与训练变体边界缺失"); +if (!desktop.trajectoryChanged.title.includes("POPULATION CV") || !desktop.trajectoryChanged.state.includes("2026073003") || desktop.trajectoryChanged.line === desktop.initial.trajectoryLine || !desktop.trajectoryChanged.thresholdHidden) failures.push("轨迹 seed / metric 切换异常"); +if (desktop.positions.panel !== "positions" || desktop.positions.buttons !== 6 || !desktop.positions.state.includes("MLP 前输入") || Math.abs(numeric(desktop.positions.contrast) - 4.527) > .001 || numeric(desktop.positions.peak) !== 21 || desktop.positions.pointCount !== 32) failures.push("六位置谱或 seed 切换异常"); +if (desktop.reductions.panel !== "reductions" || desktop.reductions.rows !== 12 || !desktop.reductions.state.includes("Token RMS 中位数") || Math.abs(numeric(desktop.reductions.contrast) - 1.666) > .001 || desktop.reductions.overlap !== "3 / 5" || Math.abs(numeric(desktop.reductions.rho) - .934) > .001 || desktop.reductions.pointCount !== 32) failures.push("reduction robustness 视图异常"); +if (desktop.intervention.panel !== "intervention" || desktop.intervention.lines !== 3 || Math.abs(numeric(desktop.intervention.keyDrop) + 1.93) > .01 || Math.abs(numeric(desktop.intervention.valueDrop) - 76.87) > .01 || desktop.intervention.peakShift !== "21 → 2" || desktop.intervention.linePoints.some((count) => count !== 32) || !desktop.intervention.forwardIdentity) failures.push("same-forward backward 干预视图异常"); +if (desktop.mixerInitial.panel !== "mixer" || desktop.mixerInitial.points !== 30 || Math.abs(numeric(desktop.mixerInitial.pearson) - .690) > .001 || Math.abs(numeric(desktop.mixerInitial.spearman) - .693) > .001 || desktop.mixerChanged.points !== 30 || Math.abs(numeric(desktop.mixerChanged.pearson) + .636) > .001 || Math.abs(numeric(desktop.mixerChanged.spearman) + .640) > .001 || desktop.mixerInitial.title === desktop.mixerChanged.title) failures.push("mixer association 散点或指标切换异常"); +if (desktop.keyboard.selected !== "positions" || desktop.keyboard.panel !== "positions") failures.push("键盘 tab 导航异常"); +if (desktop.documentOverflow > 1 || desktop.rootOverflow > 1 || mobile.documentOverflow > 1 || mobile.rootOverflow > 1) failures.push("桌面或移动端出现文档级横向溢出"); +if (mobile.tabs !== 5 || mobile.ledger !== 6 || mobile.visiblePanel !== "intervention" || mobile.lines !== 3) failures.push("移动端交互结构异常"); +if (exceptions.length) failures.push(`浏览器异常:${exceptions.join(" | ")}`); + +if (failures.length) { + console.error(`\nFAIL\n- ${failures.join("\n- ")}`); + process.exitCode = 1; +} else { + console.log("\nPASS K3 AttnRes spike browser regression"); +} + +socket.close(); diff --git a/scripts/check-k3-browser.mjs b/scripts/check-k3-browser.mjs index 4d76a9b..cc77aba 100644 --- a/scripts/check-k3-browser.mjs +++ b/scripts/check-k3-browser.mjs @@ -83,6 +83,8 @@ const overview = await evaluate(`(() => ({ attnresPanels: document.querySelectorAll("[data-attnres-panel]").length, gradientTabs: document.querySelectorAll("[data-gradient-tab]").length, gradientPanels: document.querySelectorAll("[data-gradient-panel]").length, + spikeTabs: document.querySelectorAll("[data-spike-tab]").length, + spikePanels: document.querySelectorAll("[data-spike-panel]").length, nativeVisionCorrected: document.body.textContent.includes("MoonViT‑V2 从头训练") && document.body.textContent.includes("同一个 next-token prediction objective"), staleVisionClaim: document.body.textContent.includes("先固定语言模型训练视觉组件"), @@ -293,8 +295,9 @@ const mobile = await evaluate(`(() => { artifactLayers: document.querySelectorAll("[data-layer-cell]").length, attnresTabs: document.querySelectorAll("[data-attnres-tab]").length, gradientTabs: document.querySelectorAll("[data-gradient-tab]").length, + spikeTabs: document.querySelectorAll("[data-spike-tab]").length, offenders: [...document.querySelectorAll("body *")] - .filter((node) => !node.closest(".paper-chain, .spec-table-wrap, .cache-strip, .architecture-explorer, [data-k3-lab], [data-k3-artifact-lab], [data-attnres-lab], [data-gradient-lab]")) + .filter((node) => !node.closest(".paper-chain, .spec-table-wrap, .cache-strip, .architecture-explorer, [data-k3-lab], [data-k3-artifact-lab], [data-attnres-lab], [data-gradient-lab], [data-spike-lab]")) .filter((node) => node.getBoundingClientRect().right > document.documentElement.clientWidth + 1) .slice(0, 15) .map((node) => ({ @@ -325,13 +328,14 @@ console.log(JSON.stringify(report, null, 2)); const numeric = (text) => Number.parseFloat(text.replaceAll(",", "").replace("−", "-")); const failures = []; if (!overview.title.includes("因果环节")) failures.push("K3 二轮标题异常"); -if (overview.sections !== 34 || overview.tocLinks !== 34) failures.push("33 个编号专题加阅读链的目录结构异常"); +if (overview.sections !== 35 || overview.tocLinks !== 35) failures.push("34 个编号专题加阅读链的目录结构异常"); if (overview.ledgers !== 32 || overview.reportMap !== 9) failures.push("32 张问题账或报告地图异常"); if (overview.figureAtlas !== 21 || overview.paperLinks !== 100 || overview.paperGroups < 12) failures.push("图表审计或 100 节点阅读链异常"); if (overview.labTabs !== 8 || overview.labPanels !== 8) failures.push("八联实验结构异常"); if (overview.artifactTabs !== 4 || overview.artifactPanels !== 4 || overview.artifactLayers !== 93 || !overview.artifactMismatch) failures.push("开放工件四视图、93 层条带或形状冲突异常"); if (overview.attnresTabs !== 5 || overview.attnresPanels !== 5) failures.push("AttnRes 独立实验五视图异常"); if (overview.gradientTabs !== 5 || overview.gradientPanels !== 5) failures.push("AttnRes 梯度定义扩展五视图异常"); +if (overview.spikeTabs !== 5 || overview.spikePanels !== 5) failures.push("AttnRes 尖峰路径五视图异常"); if (!overview.nativeVisionCorrected || overview.staleVisionClaim) failures.push("原生多模态纠错未生效或旧错误残留"); if (overview.documentOverflow > 1 || mobile.documentOverflow > 1) failures.push("桌面或移动端存在文档级横向溢出"); if (labs.memoryInitial.panel !== "memory" || numeric(labs.memoryInitial.additiveError) <= numeric(labs.memoryInitial.deltaError)) failures.push("Delta memory 初始递推异常"); @@ -356,7 +360,7 @@ if (artifacts.parameterChanged.shape !== "[96,128] F32" || !artifacts.parameterC if (artifacts.reproductionInitial.panel !== "reproduction" || numeric(artifacts.reproductionInitial.speedup) !== 1.85 || numeric(artifacts.reproductionInitial.localMean) < 2.6 || !artifacts.reproductionInitial.exactSuite || numeric(artifacts.reproductionInitial.cv) < 2) failures.push("FlashKDA H20、本机 exact suite 或 router 初始探针异常"); if (numeric(artifacts.reproductionChanged.speedup) !== 3.27 || numeric(artifacts.reproductionChanged.flash) !== 0.7064 || numeric(artifacts.reproductionChanged.localMean) >= numeric(artifacts.reproductionInitial.localMean) || !artifacts.reproductionChanged.localMode.includes("FP32 state") || numeric(artifacts.reproductionChanged.cv) <= numeric(artifacts.reproductionInitial.cv) || numeric(artifacts.reproductionChanged.zero) <= numeric(artifacts.reproductionInitial.zero)) failures.push("GB200 benchmark、本机 varlen/state 或 synthetic router counterexample 未更新"); if (artifacts.keyboardSelected !== "tensors" || artifacts.keyboardVisible !== "tensors") failures.push("开放工件键盘 tab 导航异常"); -if (!mobile.menuVisible || mobile.menuOpen !== "true" || mobile.tabs !== 8 || mobile.artifactTabs !== 4 || mobile.artifactLayers !== 93 || mobile.attnresTabs !== 5 || mobile.gradientTabs !== 5) failures.push("移动端导航或实验异常"); +if (!mobile.menuVisible || mobile.menuOpen !== "true" || mobile.tabs !== 8 || mobile.artifactTabs !== 4 || mobile.artifactLayers !== 93 || mobile.attnresTabs !== 5 || mobile.gradientTabs !== 5 || mobile.spikeTabs !== 5) failures.push("移动端导航或实验异常"); if (mobile.offenders.length) failures.push(`移动端越界元素:${JSON.stringify(mobile.offenders)}`); if (exceptions.length) failures.push(`浏览器异常:${exceptions.join(" | ")}`); diff --git a/src/components/K3AttnResSpikeLab.astro b/src/components/K3AttnResSpikeLab.astro new file mode 100644 index 0000000..519ad4c --- /dev/null +++ b/src/components/K3AttnResSpikeLab.astro @@ -0,0 +1,892 @@ +--- +import rawLab from "@/data/k3-attnres-spike-compact.json"; + +const lab = rawLab as any; +const json = JSON.stringify(lab).replaceAll("<", "\\u003c"); +const reductions = lab.verdicts.reduction_robustness.cells; +const replayHash = lab.gates.replay.frozen_compare_sha256; +const shortHash = (value: string) => `${value.slice(0, 10)}…${value.slice(-8)}`; +const reductionLabels: Record = { + element_rms: "全元素 RMS", + token_rms_mean: "Token RMS 均值", + token_rms_median: "Token RMS 中位数", + token_rms_p95: "Token RMS P95", +}; +--- + +
+
+
+

ROUND 06 / SPIKE TRAJECTORY × BACKWARD PATH

+

尖峰不是出生时就有;它在训练中形成,并对 value 路径敏感

+
+

+ 固定 Round 05 的 depth-32 Block 训练格,只在 optimizer 之外增加诊断。 + 3 个正式 seed、1 个完整重放;所有前向值完全相同,只改变同一次反向传播的局部导数规则。 +

+
+ +
+
FORMAL TARGET BYTES196.608M

3 × 8,000 steps

+
FULL REPLAYexact

16 组冻结字段

+
VISIBLE POSITIONS6 / 6

每个位置 3 / 3 seed

+
REDUCTIONS12 / 12

预注册家族内稳健

+
KEY / SOFTMAX PATH−2.0%

移除后反而略升

+
VALUE COEFFICIENTS−70.2%

平均 contrast 降幅

+
+ +
+ + + + + +
+ +
+
+
I / DEVELOPMENT

先问“训练到什么时候出现”,再问“由哪条路径放大”

+

+ 尖峰集合 S 固定为 layer 21–25。纵轴 contrast = S 内均值 ÷ 其余层均值: + 1 表示没有集中,越大表示梯度越集中在这五层。 +

+
+
+ +
+ + + +
+
+
+
SPIKE CONTRAST · S / REST3-SEED MEAN
+ + + + + + +
post-MLP activation-gradient预注册可见阈值 1.5
+
+
+
STEP 00.757×

三 seed 均低于 1;layer 21–25 并不特殊。

+ → +
STEP 5000.524×

学习已经发生,但尖峰尚未出现。

+ → +
STEP 2,0002.233×

峰值层同时迁移到 layer 21,结构开始显形。

+ → +
STEP 8,0002.754×

seed 3 只有 1.881×:方向一致,强度并不整齐。

+
+
+ 通俗读法 +

这不像一个由初始化直接写死的“坏层”;它更像训练动力学与 Block mixer 共同塑出的深度模式。

+
+
+ + + + + + + + + + +
+ + + + diff --git a/src/pages/k3/index.astro b/src/pages/k3/index.astro index 75165b6..66c1b0c 100644 --- a/src/pages/k3/index.astro +++ b/src/pages/k3/index.astro @@ -3,6 +3,7 @@ import BaseLayout from "@/layouts/BaseLayout.astro"; import ArchitectureExplorer from "@/components/ArchitectureExplorer.astro"; import K3ArtifactLab from "@/components/K3ArtifactLab.astro"; import K3AttnResGradientLab from "@/components/K3AttnResGradientLab.astro"; +import K3AttnResSpikeLab from "@/components/K3AttnResSpikeLab.astro"; import K3AttnResTraceLab from "@/components/K3AttnResTraceLab.astro"; import K3ReportLab from "@/components/K3ReportLab.astro"; import { k3FigureAtlas, k3Ledgers, k3PaperChain, k3ReportMap } from "@/data/k3"; @@ -40,7 +41,8 @@ const toc = [ ["29", "artifacts", "开放权重工件审计"], ["30", "attnres-reduced", "AttnRes 缩小机制实验"], ["31", "attnres-gradient", "梯度定义与深度扩展"], - ["32", "audit", "21 张图表审计"], + ["32", "attnres-spike", "尖峰轨迹与反向路径"], + ["33", "audit", "21 张图表审计"], ["↳", "papers", "100 节点阅读链"], ]; @@ -109,13 +111,13 @@ const paperGroups = [
-

ANCHOR REPORT / ROUND 05 KIMI K3 · REPORT → ARTIFACTS → INDEPENDENT PROBE

+

ANCHOR REPORT / ROUND 06 KIMI K3 · REPORT → ARTIFACTS → INDEPENDENT PROBE

不把报告压成摘要
把每个因果环节
重新展开

K3 同时扩展序列、深度、宽度、视觉与 Agent 轨迹。真正值得读的不是 2.8T 这个最大数字, @@ -125,11 +127,11 @@ const paperGroups = [

QUESTIONS
32 张问题账
REPORT
16 Figures · 5 Tables
-
LABS
8 + 4 + 5 + 5 个交互视图
+
LABS
8 + 4 + 5 + 5 + 5 个交互视图
READING
100 个一手 / 官方节点
MODEL
2.78T total / 104.2B active
ARTIFACTS
96 shards · 497,220 tensors
-
STATUS
K3 五轮 · 梯度定义闭环
+
STATUS
K3 六轮 · 尖峰路径审计
@@ -922,8 +924,33 @@ const paperGroups = [ +
+

32 SPIKE TRAJECTORY × BACKWARD PATH

+

layer 21–25 的尖峰从什么时候出现,又对 mixer 的哪条反向路径敏感?

+

+ 第六轮不把上一轮的局部尖峰直接解释成机制。本站预注册六个训练时点、六个张量位置、 + 四种 confirmatory reduction 与三种 same-forward backward rule;正式训练严格复用 + Round 05 depth-32 Block 的模型、数据、optimizer 与 schedule,诊断全部位于 optimizer 之外。 + 结果显示尖峰在 step 500 后才形成、六个位置均可见;切断 softmax / query / key 源梯度没有降低尖峰, + 而把全局 learned value-backward coefficients 改成均匀后,contrast 平均下降 70.2%。 +

+
+
F / FROZEN3 formal + 1 replay

196,608,000 formal target bytes;完整重放再加 65,536,000。

+
X / DEVELOPMENTstep 500 → 2,000

三 seed 的尖峰 contrast 从 0.524× 跃到平均 2.233×。

+
X / ROBUSTNESS12 / 12 PASS

四种预注册 reduction 都保留 layer 21–25 集中。

+
B / BOUNDARYglobal sensitivity

不是训练变体、因果贡献百分比或局部 mixer 归因。

+
+ + +
+
-

32 FIGURE & TABLE AUDIT

+

33 FIGURE & TABLE AUDIT

Figure 1–16、Table 1–5:每张图究竟支持什么,不能支持什么

{k3FigureAtlas.map(([id, report, title, contract]) => ( diff --git a/src/pages/progress/index.astro b/src/pages/progress/index.astro index 3b6b743..478ecd7 100644 --- a/src/pages/progress/index.astro +++ b/src/pages/progress/index.astro @@ -9,7 +9,7 @@ const researching = chapters.filter((chapter) => ["researching", "drafting"].inc const workstreams = [ { label: "研究框架与规范", value: 83, next: "给 Scaling 与推理专题补逐篇图表/实验精读层级" }, { label: "网站设计系统", value: 89, next: "打印样式与更多通用可视化组件" }, - { label: "Kimi K3 深读", value: 98, next: "对齐 layer 21–25 梯度尖峰与 mixer weights;等待 A_log 官方转换合同" }, + { label: "Kimi K3 深读", value: 99, next: "对 group 6 / 7 做局部 mixer backward 干预;等待 A_log 官方转换合同" }, { label: "语言模型前史", value: 78, next: "逐图精读 Kneser–Ney、LSTM 与 Bahdanau,并加入真实小语料复现" }, { label: "Transformer 基础", value: 79, next: "逐图精读多头电路、Pre/Post-LN 与真实 kernel / KV 配置" }, { label: "表示、位置与残差高速公路", value: 81, next: "加入真实 hidden-state / norm traces、长上下文位置外推复现与更多深层稳定性消融" }, @@ -50,7 +50,7 @@ const workstreams = [
OVERALL
专题平均 {average}%
READABLE
{published} 个首版可读专题
ACTIVE
{researching} 个研究/写作中
-
UPDATED
2026-07-30 10:05 CST
+
UPDATED
2026-07-30 12:20 CST
MODE
持续迭代,不锁死版本
@@ -97,7 +97,7 @@ const workstreams = [
✓

K3 报告已结构化拆解

47 页报告目录、151 条参考来源和架构/后训练/系统主线已经提取。

✓

17 专题知识图

从语言模型基础到评测安全,包含先修依赖和三条贯穿案例。

✓

编辑式网站系统

响应式导航、章节模板、侧栏、进度、论文链和证据提示组件。

-
✓

九十九个原创交互视图

K3 三轴图、八联报告实验、四联开放工件实验与两轮十联 AttnRes 独立实验,DeepSeek 四联公式实验、十三联 Base 工件实验、Chat 行为、completion/full-depth、multi-seed、cross-source 与 task-bootstrap CRN 五轮实验,以及语言模型前史、Transformer、表示深度、长上下文、MoE、推理、Agent、多模态、训练系统、推理服务、Scaling、数据工程、数值、Alignment 与评测安全专题。

+
✓

一百零四个原创交互视图

K3 三轴图、八联报告实验、四联开放工件实验与三轮十五联 AttnRes 独立实验,DeepSeek 四联公式实验、十三联 Base 工件实验、Chat 行为、completion/full-depth、multi-seed、cross-source 与 task-bootstrap CRN 五轮实验,以及语言模型前史、Transformer、表示深度、长上下文、MoE、推理、Agent、多模态、训练系统、推理服务、Scaling、数据工程、数值、Alignment 与评测安全专题。

✓

十七篇首版长文

K3、语言模型前史、Transformer、表示/位置/残差、DeepSeek、Scaling、数据工程、长上下文、MoE、后训练、推理、Agent、原生多模态、训练系统、推理服务、数值优化与评测安全专题。

✓

语言模型前史深度专题

八张独立问题账、33 个正式节点、20 段长文与概率—向量—记忆—对齐四联实验。

✓

Transformer 深度专题

十张独立问题账、40 个正式节点、21 段正文与 QKV—Mask—多头位置—Block 成本四联实验。

@@ -107,6 +107,7 @@ const workstreams = [
✓

Kimi K3 三轮开放工件里程碑

固定官方 revisions,审计 96 个 shards、497,220 个 tensor entries 与真实 KDA / MLA / MoE / MoonViT shapes;四联实验分开显示层型、tensor anatomy、参数范围和复现边界。

✓

Kimi K3 四轮 AttnRes 独立实验

冻结三结构 × 三 seed 的 9 个 2,000-step 格;Full / Block 相对 Baseline 的平均 paired delta 为 −0.01457 / −0.04247 BPC,但核心参数梯度 CV 没有复现论文叙述。指定正式格全新进程八字段 exact,五视图同时展示结果、反证、成本与 claim boundary。

✓

Kimi K3 五轮梯度定义与深度扩展

先确认 Figure 5 没有公开唯一 gradient telemetry 合同,再冻结 16/32 blocks × Baseline/Block × 3 seeds 的 12 个 8,000-step 格。Block 的首尾失衡 6/6 改善但全层 CV 6/6 恶化,两个深度都判为 mixed;指定 32 层格完整重训的模型、优化器与全部冻结字段 exact。

+
✓

Kimi K3 六轮尖峰轨迹与反向路径

严格复用 Round 05 depth-32 Block 的三个正式格:尖峰在 step 500 后形成,六个位置 3/3 seed 可见,四种 reduction 12/12 格稳健。切断 key/softmax 源梯度没有降低尖峰;uniform value-backward 让 contrast 平均下降 70.2%,只判为全局 backward-rule sensitivity。完整 replay 的 16 组冻结字段 exact。

✓

FlashKDA RTX 5090 执行闸门

隔离 CUDA 13.0 / glibc 2.39 编译 sm_120a wheel;6/6 官方参考逐元素相等,并完成 fixed / varlen、三种 state mode 的 1,800 个 CUDA Event samples。

✓

Scaling Laws 深度专题

九张账、29 个一手节点、DeepSeek/Kimi 双谱系与曲面—部署—复用—涌现四联实验。

✓

数据工程深度专题

十二张账、31 个一手节点、DeepSeek/Kimi 双谱系与流水线—去重—混合—改写四联实验。

@@ -135,7 +136,7 @@ const workstreams = [
优先级专题本轮交付完成闸门
-
P0K3 五轮后续

对齐 layer 21–25 尖峰、pre-attention / pre-MLP 与 mixer source weights → 等待 A_log 官方合同后进入真实 checkpoint forward

局部机制 + 工件边界
+
P0K3 六轮后续

group 6 / 7 局部 mixer intervention matrix → 前向训练变体 → 等待 A_log 官方合同后进入真实 checkpoint forward

局部机制 + 工件边界
P0DeepSeek 八轮后续

干预式 mediation → SM90 FlashMLA / FP8 / pipeline traces → R1-like RL 小模型复现

运行证据 + 独立复现
P0Transformer 二轮

多头电路逐图 → Pre/Post-LN 真实 traces → Flash/KV 配置与 kernel 对照

逐图笔记 + 实测边界
P0表示、位置与残差二轮

真实 hidden-state / norm traces → 长上下文位置外推 → mHC / AttnRes 深层稳定性消融

可复现实验 + 逐图笔记
@@ -225,6 +226,10 @@ const workstreams = [
首尾平衡与全层 CV 永久分账

Block 在 6/6 配对中改善 first/last,却因中后段局部尖峰让 CV 在 6/6 配对中恶化;联合判定保持 mixed。

绝对梯度尺度必须与归一化谱同屏

Block mean gradient 约为 Baseline 的 54%–57%;更接近 1 的首尾比不能偷换成各层信号更强。

32 层完整重放扩到状态哈希

8,000-step fresh replay 的全部冻结字段以及 model / optimizer state hashes exact;额外 replay bytes 单列,不混入 formal 预算。

+
尖峰是定向复查,不是盲发现

layer 21–25 来自 Round 05;Round 06 先固定目标集合,再检查训练时点、张量位置、reduction 与反向路径。

+
最早可见不等于物理起源

pre-attention input 是六个采样点中最早可见位置;更早 mixer 与跨层回传已经作用,不能写成尖峰从这里注入。

+
同一前向只识别反向规则敏感性

三模式的 logits、loss、activations 与 mixer summaries exact;uniform value-backward 的 70.2% contrast 降幅不是训练变体或因果贡献百分比。

+
相关性、全局干预与局部归因分三层

MLP latest weight 的局部 r≈.69 只提供候选;全局 value-route 干预支持路径敏感性,下一轮才做 group 6 / 7 局部归因矩阵。

32-token 对照改为同源 16→24

TNEWS 只有 105/10,000 条达到 32 tokens,强行统一会落入约 1% 极端长尾;24-token eligibility 仍保留 1,609 条中文候选。

长度敏感性必须成对重采样

16-token 输入严格是 24-token 输入前缀,2,000 次 bootstrap 共用 prompt indices;结果只描述固定 cohort 的长度敏感性。

三类 cohort 永久分身份

自然长度回答本批样本如何路由;matched-16 / 24 回答同一 prompt 多看 8 tokens 后如何变化,不把二者混成内容因果。