From a54152dc24208c902ca87e210bf55f10a0319da5 Mon Sep 17 00:00:00 2001 From: wuyang <5700876+banisherwy@user.noreply.gitee.com> Date: Wed, 29 Jul 2026 04:47:36 +0800 Subject: [PATCH] feat: publish language model origins chapter --- PROGRESS.md | 18 +- README.md | 6 +- ROADMAP.md | 8 +- package.json | 3 +- research/LANGUAGE_MODEL_HISTORY_GROK_LEADS.md | 126 + research/LANGUAGE_MODEL_HISTORY_RESEARCH.md | 739 +++++ research/sources/README.md | 11 + scripts/check-data-browser.mjs | 8 +- .../check-language-model-history-browser.mjs | 218 ++ scripts/check-moe-browser.mjs | 2 +- scripts/check-numerics-browser.mjs | 8 +- scripts/check-reasoning-browser.mjs | 2 +- scripts/check-scaling-browser.mjs | 6 +- scripts/check-training-systems-browser.mjs | 2 +- src/components/LanguageModelHistoryLab.astro | 1224 +++++++ src/components/SiteHeader.astro | 2 +- src/data/chapters.ts | 6 +- src/data/papers.ts | 198 +- src/pages/foundations/index.astro | 43 + .../foundations/language-models/index.astro | 2881 +++++++++++++++++ src/pages/index.astro | 30 +- src/pages/progress/index.astro | 15 +- 22 files changed, 5521 insertions(+), 35 deletions(-) create mode 100644 research/LANGUAGE_MODEL_HISTORY_GROK_LEADS.md create mode 100644 research/LANGUAGE_MODEL_HISTORY_RESEARCH.md create mode 100644 scripts/check-language-model-history-browser.mjs create mode 100644 src/components/LanguageModelHistoryLab.astro create mode 100644 src/pages/foundations/language-models/index.astro diff --git a/PROGRESS.md b/PROGRESS.md index e443d8c..d684cf2 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -9,6 +9,7 @@ | 研究框架与规范 | 进行中 | 83% | Scaling Laws 二轮拟合复现与逐图精读 | | 网站设计系统 | 进行中 | 89% | 打印样式与更多通用可视化组件 | | Kimi K3 深读 | 进行中 | 66% | 扩写 pre-training / infra 逐图笔记 | +| 语言模型前史 | 完成首版 | 78% | Kneser–Ney、LSTM、Bahdanau 逐图精读与真实小语料复现 | | Transformer 基础 | 进行中 | 52% | 矩阵形状动画与手算练习 | | Scaling Laws | 完成首版 | 74% | 真实拟合复现、置信区间与更多模型族对照 | | 数据工程与预训练配方 | 完成首版 | 73% | FineWeb / DCLM 逐图精读、真实去重误伤与 mixture traces | @@ -31,10 +32,10 @@ - [x] 提炼参考网站的编辑设计语言。 - [x] 确认 `git.k1412.top` 为 Gitea/Forgejo 兼容服务且本机 HTTPS 凭据可用于既有仓库。 - [x] 使用 Grok CLI 检索并形成约 95 篇一手论文的补充路线,主代理已回查关键来源。 -- [x] 完成 223 篇关键论文索引,覆盖 14 个标签专题与 Kimi/DeepSeek 聚光主线。 +- [x] 完成 247 篇关键论文索引,覆盖 14 个标签专题与 Kimi/DeepSeek 聚光主线。 - [x] 完成可检索、可按专题筛选的论文库页面。 -- [x] 完成 K3、Transformer 基础、DeepSeek 谱系、Scaling Laws、数据工程、长上下文、MoE、推理、训练系统与数值优化十篇首版长文。 -- [x] 完成 K3 三轴架构、Self-Attention、DeepSeek 谱系、长上下文、MoE 路由、推理三页签,以及训练系统、Scaling、数据工程与数值专题各四页签等二十四个原创交互视图。 +- [x] 完成 K3、语言模型前史、Transformer 基础、DeepSeek 谱系、Scaling Laws、数据工程、长上下文、MoE、推理、训练系统与数值优化十一篇首版长文。 +- [x] 完成 K3 三轴架构、语言模型前史四联实验、Self-Attention、DeepSeek 谱系、长上下文、MoE 路由、推理三页签,以及训练系统、Scaling、数据工程与数值专题各四页签等二十八个原创交互视图。 - [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 研究账本。 @@ -77,9 +78,16 @@ - [x] 对数据工程、Scaling、训练系统、推理与 MoE 重新执行全量浏览器回归;14 项桌面 / 移动导航和首页数值新章入口无回归。 - [x] Astro 类型检查、生产构建、14 个页面路由、593 个站内引用和 19 个跨页锚点全部通过。 - [x] 数值专题首版以源提交 `c21af18`、不可变镜像 `20260728T200309Z-c21af18` 发布;NAS、VPS/Tailscale、NPM、DNS、HTTPS、证书、14 路由、门户、公开 Forgejo 与生产 Chrome 全链路通过。 +- [x] 启动语言模型前史专题:以八张独立问题账拆开预测单位、概率信息、上下文、稀疏性、表示、记忆、转导与成本,避免伪单线架构史。 +- [x] 使用 Grok Headless 扩展 45+ 候选一手节点;将错误元数据、过强因果和未核实旧论文永久保留在独立 leads。 +- [x] 建立语言模型前史正式研究账本:33 个正式节点、逐篇旧瓶颈/贡献/遗留问题、四实验合同与 19 组原创重绘清单。 +- [x] 完成语言模型前史首版:20 段长文、Shannon → N-gram → neural LM → RNN/LSTM → Seq2Seq/Attention 完整问题链,以及 DeepSeek/K3 当代回声。 +- [x] 论文库新增 24 个语言模型前史节点,从 223 篇扩充至 247 篇;DeepSeek-V3/V4 与 K3 补充「基础」映射。 +- [x] 语言模型前史真实 Chrome 断言通过:零概率/平滑、one-hot 选择、指数记忆衰减、Attention 对齐、键盘 tabs 与 390px 移动端均正确响应。 ## 正在进行 +- [ ] 语言模型前史二轮:Kneser–Ney / LSTM / Bahdanau 逐图精读、真实小语料复现与 tokenizer 公平性案例。 - [ ] Scaling Laws 二轮精读:真实拟合复现、逐篇图表、置信区间、外推失败与更多模型族对照。 - [ ] 数据工程二轮:FineWeb / DCLM / Dolma / ROOTS 逐图精读、真实去重误伤、mixture traces 与污染案例。 - [ ] 大规模训练系统二轮:真实集群 traces、故障恢复案例与精确 topology / kernel 配置。 @@ -131,6 +139,10 @@ | 2026-07-29 | 数值首版用四个独立实验闭环 | 格式误差、状态字节、矩阵更新与失稳防线分开建模,不合成伪“效率总分” | | 2026-07-29 | 论文库新增「优化器」标签并扩充到 223 篇 | 新增 Shampoo、Adafactor、μP、8-bit optimizer、FP8-LM、FP4 training、稳定性代理等 21 个节点 | | 2026-07-29 | 数值首版用不可变镜像 `20260728T200309Z-c21af18` 发布 | OCI digest `sha256:2155fd7f…c386`;复用 `12010→8080`、NPM host 31 / cert 41、门户 order 180 与公开 Forgejo | +| 2026-07-29 | 语言模型前史拆成八张彼此独立的账 | 不再把 Tokenizer、平滑、Embedding、循环记忆、Seq2Seq 与系统成本压成一条“架构越来越强”的年表 | +| 2026-07-29 | Grok 语言模型候选与正式证据永久分离 | 45+ 候选只负责召回;正式 33 节点必须回到 DOI、ACL/PMLR/ISCA、出版社页面或官方技术报告 | +| 2026-07-29 | K3 / DeepSeek 的 NTP、MTP、多模态与 draft 分角色记账 | 统一视觉/文本 next-token objective 不排斥 one MTP layer;MTP 与 speculative draft 都不写成取消自回归 | +| 2026-07-29 | 论文库扩充到 247 篇 | 新增 Shannon 1951、Good、Katz、Kneser–Ney、LSTM、RNNLM、Seq2Seq 前夜与输出成本等 24 个一手节点 | ## 未决问题 diff --git a/README.md b/README.md index a890199..415205d 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ - 持续进度:[PROGRESS.md](./PROGRESS.md) - 证据与写作规范:[research/METHODOLOGY.md](./research/METHODOLOGY.md) -当前里程碑包含 16 专题学习地图、223 篇关键论文索引、Kimi K3 完整导读、 -Transformer 基础、DeepSeek 技术谱系、Scaling Laws、数据工程、长上下文、MoE、推理、训练系统与数值优化深度专题, -以及覆盖核心机制的原创交互实验室。 +当前里程碑包含 16 专题学习地图、247 篇关键论文索引、Kimi K3 完整导读、 +语言模型前史、Transformer 基础、DeepSeek 技术谱系、Scaling Laws、数据工程、长上下文、MoE、推理、训练系统与数值优化深度专题, +以及 28 个覆盖核心机制的原创交互视图。 其余专题按进度账本持续扩建。 ## 本地开发 diff --git a/ROADMAP.md b/ROADMAP.md index 0340585..e81a406 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -23,7 +23,13 @@ ### 01. 语言模型从哪里来 -N-gram → 神经概率语言模型 → 分布式词表示 → RNN/LSTM → Seq2Seq。解释“预测下一个词”为何最终能长成通用模型。 +Shannon → N-gram → Good–Turing / Katz / Kneser–Ney → 神经概率语言模型 → 分布式词表示 → RNN/LSTM → Seq2Seq → Attention 前夜。 +用“预测单位、概率信息、上下文、稀疏性、分布式表示、循环记忆、序列转导、评测与成本”八张账, +解释 next-token 目标为什么能持续到 Kimi K3 与 DeepSeek,也明确它没有自动保证事实性、忠实推理与行为对齐。 + +首版已发布:20 段长文、33 个正式节点、19 组原创机制图,以及概率显微镜、Embedding 几何、 +循环记忆衰减、Seq2Seq 瓶颈/Attention 桥四个独立实验。正文显式分开 K3 的统一视觉/文本 NTP、 +one MTP layer 与 EAGLE-3 draft bridge,并与 DeepSeek-V3/V4 的顺序 MTP 对照。 ### 02. 注意力与 Transformer diff --git a/package.json b/package.json index c40e8c7..6a884d6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "check:training-systems-browser": "node scripts/check-training-systems-browser.mjs", "check:scaling-browser": "node scripts/check-scaling-browser.mjs", "check:data-browser": "node scripts/check-data-browser.mjs", - "check:numerics-browser": "node scripts/check-numerics-browser.mjs" + "check:numerics-browser": "node scripts/check-numerics-browser.mjs", + "check:language-model-history-browser": "node scripts/check-language-model-history-browser.mjs" }, "dependencies": { "@astrojs/sitemap": "3.7.3", diff --git a/research/LANGUAGE_MODEL_HISTORY_GROK_LEADS.md b/research/LANGUAGE_MODEL_HISTORY_GROK_LEADS.md new file mode 100644 index 0000000..1e5ba35 --- /dev/null +++ b/research/LANGUAGE_MODEL_HISTORY_GROK_LEADS.md @@ -0,0 +1,126 @@ +# 语言模型前史:Grok 候选线索(未核验区) + +> 生成时间:2026-07-29 +> 生成方式:Grok CLI headless(`--no-subagents`) +> 状态:只用于扩大检索召回率,不作为网站正文证据。标题、年份、作者、DOI、实验数字都必须回到原论文或出版社页面核验。 +> 正式证据:见 `LANGUAGE_MODEL_HISTORY_RESEARCH.md`。 + +## 本轮提示词要求 + +围绕八张彼此独立的账,寻找 40–50 个候选一手节点: + +1. 预测单位:字母、词、子词、字符与大词表; +2. 概率与信息:链式法则、熵、交叉熵、困惑度; +3. 上下文:Markov / N-gram、固定窗口、循环状态; +4. 稀疏性:未见事件、折扣、回退、插值; +5. 分布式表示:共现、矩阵分解、预测式词向量; +6. 循环记忆:SRN、长程梯度、LSTM、GRU; +7. 序列转导:encoder–decoder、固定向量、软对齐; +8. 评测与成本:基准、词表 Softmax、并行性、系统约束。 + +每个候选需要给出“旧瓶颈、核心贡献、遗留问题、适合重绘的图、最容易误传的边界”,并单列 Kimi K3、DeepSeek-V3/V4 对 next-token prediction 与 MTP 的继承关系。 + +## 候选池摘要 + +### 概率、信息与预测 + +- Shannon 1948 — *A Mathematical Theory of Communication* +- Shannon 1951 — *Prediction and Entropy of Printed English* +- Jelinek et al. 1977 — *Perplexity—a measure of the difficulty of speech recognition tasks* +- Brown et al. 1992 — *Class-Based n-gram Models of Natural Language* +- Chelba et al. 2013 — *One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling* + +### 稀疏性与平滑 + +- Good 1953 — *The Population Frequencies of Species and the Estimation of Population Parameters* +- Katz 1987 — *Estimation of Probabilities from Sparse Data for the Language Model Component of a Speech Recognizer* +- Witten & Bell 1991 — *The Zero-Frequency Problem* +- Kneser & Ney 1995 — *Improved Backing-off for M-gram Language Modeling* +- Chen & Goodman 1996/1998/1999 — *An Empirical Study of Smoothing Techniques for Language Modeling* +- Goodman 2001 — *A Bit of Progress in Language Modeling* + +### 分布与表示 + +- Harris 1954 — *Distributional Structure* +- Firth 1957 — *A Synopsis of Linguistic Theory 1930–1955* +- Deerwester et al. 1990 — *Indexing by Latent Semantic Analysis* +- Bengio et al. 2003 — *A Neural Probabilistic Language Model* +- Morin & Bengio 2005 — *Hierarchical Probabilistic Neural Network Language Model* +- Collobert & Weston 2008 / Collobert et al. 2011 +- Mikolov et al. 2013 — CBOW / Skip-gram +- Mikolov et al. 2013 — negative sampling / phrases +- Pennington et al. 2014 — GloVe +- Levy & Goldberg 2014 — SGNS as implicit matrix factorization + +### 循环记忆 + +- Elman 1990 — *Finding Structure in Time* +- Bengio, Simard & Frasconi 1994 — *Learning long-term dependencies with gradient descent is difficult* +- Hochreiter & Schmidhuber 1997 — *Long Short-Term Memory* +- Gers, Schmidhuber & Cummins 2000 — forget gate +- Mikolov et al. 2010 — RNN language model +- Graves 2013 — recurrent sequence generation +- Cho et al. 2014 — encoder–decoder / GRU + +### 序列转导与 Attention 前夜 + +- Kalchbrenner & Blunsom 2013 — recurrent continuous translation +- Cho et al. 2014 — RNN encoder–decoder +- Sutskever, Vinyals & Le 2014 — Seq2Seq +- Bahdanau, Cho & Bengio 2014/2015 — additive attention +- Luong, Pham & Manning 2015 — global/local attention +- Sennrich et al. 2016 — BPE for rare words +- Gehring et al. 2017 — convolutional Seq2Seq +- Vaswani et al. 2017 — Transformer(本章终点,不在本章展开) + +### 词表、评测与系统成本 + +- Papineni et al. 2002 — BLEU +- Wu et al. 2016 — GNMT +- Jozefowicz et al. 2016 — large-scale RNN language modeling +- Grave et al. 2016 — adaptive softmax +- Press & Wolf 2016 — input/output embedding weight tying +- Dauphin et al. 2016 — gated convolutional language modeling +- Shazeer et al. 2017 — sparsely-gated MoE +- Merity et al. 2017 — AWD-LSTM + +### 当代回声 + +- Gloeckle et al. 2024 — multi-token prediction +- DeepSeek-V3 Technical Report +- DeepSeek-V4 Technical Report +- Kimi K3 Technical Report + +## Grok 输出里需要特别警惕的地方 + +1. 它把若干“历史联系”写成了直接因果;正式正文只称“概念桥”或“后见之明下的连续性”。 +2. Brown 1992 的作者名和若干旧论文页码有拼写风险,不能照抄。 +3. Chen–Goodman 有 1996 会议版、1998 技术报告和 1999 期刊版,正式引用必须固定版本。 +4. 现代课堂常见的三门 LSTM 含后来的 forget gate,不能全部算到 1997 原论文。 +5. Word2Vec 是词表示训练方法,不是完整句子语言模型。 +6. Bahdanau additive attention 与 Transformer scaled dot-product attention 不是同一公式。 +7. “RNN 理论上能看无限历史”不能写成“实践中记得无限历史”。 +8. MTP 是辅助训练/推测解码桥梁,不等于取消单步自回归生成。 +9. K3 的视觉与文本统一 next-token objective 和它的一层 MTP 同时存在,二者不矛盾。 +10. DeepSeek-V4 的版本号、标题和细节必须以本地保存的官方技术报告为准。 + +## 已经被正式核准的高价值线索 + +- Good 1953 DOI:`10.1093/biomet/40.3-4.237` +- Elman 1990 DOI:`10.1207/s15516709cog1402_1` +- LSTM 1997 DOI:`10.1162/neco.1997.9.8.1735` +- Morin & Bengio 2005:PMLR R5:246–252 +- Luong et al. 2015:ACL Anthology D15-1166,DOI `10.18653/v1/D15-1166` +- Mikolov et al. 2010:ISCA DOI `10.21437/Interspeech.2010-343` + +## 留在发现队列、暂不进入正文的候选 + +- Firth 1957:重要但书章元数据不稳定,且不是计算模型; +- Gage 1994:BPE 压缩起源的网页副本与正式书目信息需要额外核查; +- Witten–Bell 1991:可作为平滑旁支,但会分散主线; +- Collobert 系列:更偏通用 NLP 表示,不是本章最短因果链; +- Kalchbrenner–Blunsom 2013:重要前驱,但正文空间优先给 Cho / Sutskever / Bahdanau; +- BLEU / WMT:属于序列转导评测,正文只保留边界说明; +- GNMT:系统史重要,首版暂放扩展阅读; +- Gloeckle MTP:本章当代回声可引用,MTP 机制主体仍留给推理服务章节。 + diff --git a/research/LANGUAGE_MODEL_HISTORY_RESEARCH.md b/research/LANGUAGE_MODEL_HISTORY_RESEARCH.md new file mode 100644 index 0000000..52de23c --- /dev/null +++ b/research/LANGUAGE_MODEL_HISTORY_RESEARCH.md @@ -0,0 +1,739 @@ +# 第 01 章研究账本:语言模型从哪里来 + +> 更新时间:2026-07-29 +> 章节范围:从概率语言观、N-gram 与平滑,到分布式表示、RNN/LSTM、Seq2Seq 与 Attention 前夜;Transformer 只作为下一章边界。 +> 证据原则:正式节点只接受原论文、出版社/学会页面、作者机构仓库或当前项目已缓存的官方技术报告。 +> 教学目标:让完全没有机器学习背景的读者能回答“模型在预测什么、概率从哪里来、为什么会稀疏、向量解决了什么、循环为什么仍会忘、Attention 为什么自然出现”。 + +--- + +## 0. 先固定本章的边界 + +本章不是“从 1948 到 2017 的论文年表”。它沿着八张不能互相替代的账前进: + +| 账 | 核心问题 | 常见混淆 | +|---|---|---| +| 预测单位 | 一次究竟预测字母、词、子词还是字符? | 把 Token 当成天然语言单位 | +| 概率与信息 | 怎样给一段序列分配概率并衡量预测难度? | 把困惑度当成理解力 | +| 上下文 | 条件概率能看到多远、用什么状态表示? | 理论可访问与实践可记住混为一谈 | +| 稀疏性 | 没见过的组合为什么不能直接给零概率? | 把所有 smoothing 都叫“加一” | +| 分布式表示 | 相似词怎样共享统计强度? | 把词向量当成上下文语义 | +| 循环记忆 | 怎样让一个固定大小状态携带变长历史? | 把 LSTM 说成彻底解决长依赖 | +| 序列转导 | 一个序列怎样条件生成另一个序列? | 把 Seq2Seq 与 Attention 混成一次发明 | +| 评测与成本 | 指标、词表与计算怎样改变可行路线? | 只讲架构,不讲 Softmax 和吞吐 | + +正文每个关键节点必须回答五句话: + +1. 旧方法撞到哪面墙; +2. 新方法改动了哪一层; +3. 公式最小闭环是什么; +4. 论文实际证明了什么; +5. 它没有证明什么。 + +--- + +## 1. 预测单位账:语言必须先变成可数事件 + +### 1.1 Shannon 1951:已知前文,猜下一个字母 + +- **正式来源**:Claude E. Shannon, “Prediction and Entropy of Printed English,” *Bell System Technical Journal* 30(1):50–64, 1951. +- **DOI**: +- **原文证据**:摘要明确说,实验是在给出 preceding text 时预测 next letter,用预测结果估计英语的熵与冗余。 +- **正确教学表述**:它是现代 next-token 叙事的概念祖先:把自然语言当作带上下文的随机符号源。 +- **边界**:Shannon 没有训练神经网络,也没有提出现代交叉熵优化目标;预测者主要是人类实验。 +- **适合重绘**:逐字符猜测游戏;上下文从 0、1、2…个字符增加时,候选分布逐渐收窄。 + +### 1.2 词级模型:单位更有语义,词表却会爆炸 + +- 词级 N-gram 把事件从字符提升为词,条件概率更贴近语法和搭配。 +- 代价是词表大、稀有词多、未登录词 OOV 必须统一成 ``。 +- 一个词被切成单一 ID 时,“猫/猫咪/小猫”不能天然共享统计。 + +### 1.3 Sennrich et al. 2016:子词是闭词表与开放词表的折中 + +- **正式来源**:Rico Sennrich, Barry Haddow, Alexandra Birch, “Neural Machine Translation of Rare Words with Subword Units,” ACL 2016. +- **URL**: +- **原文主张**:通过 BPE 编码常见字符序列,使模型可用固定大小词表表示开放词汇,并处理稀有词与复合词。 +- **边界**:BPE 是频率驱动的切分/合并算法,不保证语义上最合理;它解决表示覆盖,不自动赋予语义。 +- **适合重绘**:从字节/字符出发,按 pair frequency 合并;展示“unbelievable”在不同词表预算下的粒度。 + +### 1.4 Kim et al. 2016:字符也可以先组合成词表示 + +- **正式来源**:Yoon Kim et al., “Character-Aware Neural Language Models,” AAAI 2016 / arXiv:1508.06615. +- **URL**: +- **机制**:字符 embedding → CNN → max pooling → highway network → LSTM language model。 +- **论文证据**:在论文设置中参数更少,并对形态丰富语言有效。 +- **边界**:它仍然在词级输出,不能等同于现代 byte-level decoder。 + +### 本账结论 + +预测目标的数学形式可以不变,但预测单位改变: + +```text +字符:词表小,序列长 +词:序列短,词表巨大且有 OOV +子词:在序列长度与词表覆盖之间折中 +字节:覆盖最彻底,语义粒度更细 +``` + +Tokenizer 不是“预处理小工具”;它决定序列长度、词表 Softmax 成本、跨语言公平性与一个“错误”究竟在哪个粒度发生。 + +--- + +## 2. 概率与信息账:一段话为什么能拆成许多道预测题 + +### 2.1 概率链式法则 + +对序列 \(x_{1:T}\): + +\[ +P(x_{1:T})=\prod_{t=1}^{T}P(x_t\mid x_{ +- **核心量**:\(H(P)=-\sum_x P(x)\log P(x)\)。 +- **教学直觉**:若正确事件总是很容易猜,需要的信息位数低;候选均匀且多,需要的信息位数高。 +- **边界**:信息熵不评价内容是否真实、有用或有意义。 + +### 2.3 负对数似然与交叉熵 + +给定真实数据分布 \(P\) 与模型 \(Q\),交叉熵: + +\[ +H(P,Q)=\mathbb E_{x\sim P}[-\log Q(x)] +\] + +在样本上最小化平均 token NLL,就是最大化正确序列似然。对 one-hot 标签而言,常说的 categorical cross-entropy 与正确 token 的负对数概率等价。 + +边界: + +- loss 降低说明模型给测试 token 的平均概率提高; +- 不保证它给出的解释忠实; +- 不保证生成样本事实正确; +- 数据泄漏可以让 loss 变好却没有获得可迁移能力。 + +### 2.4 困惑度:把平均 NLL 指数化 + +\[ +\text{PPL}=\exp\left(\frac{1}{T}\sum_t-\log Q(x_t\mid x_{ +- **使用方式**:只作为“perplexity 一词进入语音/语言模型评测”的历史节点。 +- **边界**:这是短篇会议摘要,不能承担现代 PPL 全部理论解释。 + +--- + +## 3. 上下文账:条件分布究竟记住多少历史 + +### 3.1 有限阶 Markov 假设 + +完整历史 \(x_{ +- **机制**:把词映射到离散类,分解成类序列概率与类内词概率。 +- **价值**:在神经词向量之前,用离散簇让相似词共享统计。 +- **边界**:一个词通常归一个离散类;不是连续 embedding,也不是上下文化表示。 + +### 3.3 固定窗口神经 LM + +Bengio 2003 仍只看固定数量前词,但相似词的 embedding 让未见过的具体组合也能借到统计强度。 + +### 3.4 RNN 状态:把可变长前缀压进固定大小向量 + +\[ +h_t=f_\theta(h_{t-1}, e(x_t)),\quad +P(x_{t+1}\mid x_{\le t})=\text{softmax}(Wh_t) +\] + +RNN 去掉了显式的固定阶数,却没有得到无限可靠记忆:所有历史必须通过同一个固定大小状态、逐步改写。 + +--- + +## 4. 稀疏性账:没有见过,不等于不可能 + +### 4.1 最大似然计数的零概率灾难 + +\[ +\hat P(w\mid h)=\frac{C(h,w)}{C(h)} +\] + +若测试序列含一个未见 N-gram,整段概率乘积立刻为 0,NLL 变为无穷大。真实语言组合开放,因此必须从已见事件“留出”概率质量。 + +### 4.2 Good 1953:frequency of frequencies + +- **正式来源**:I. J. Good, “The Population Frequencies of Species and the Estimation of Population Parameters,” *Biometrika* 40(3/4):237–264, 1953. +- **DOI**: +- **原文范围**:物种总体频率估计,也明确提到可用于文学词汇;Good 致谢 Turing 的关键公式。 +- **核心直觉**:只出现一次的事件有多少种,比“某个事件出现了一次”更能告诉我们未见质量有多大。 +- **边界**:Good–Turing 本身不是完整语言模型;还需要上下文结构、回退或插值。 + +### 4.3 Katz 1987:高阶可靠时相信高阶,不可靠时回退 + +- **正式来源**:Slava M. Katz, “Estimation of Probabilities from Sparse Data for the Language Model Component of a Speech Recognizer,” IEEE TASSP 35(3), 1987. +- **URL**: +- **机制**:对低计数事件折扣,把释放出的概率质量分给未见事件;未见高阶 N-gram 回退到低阶模型。 +- **边界**:backoff 不是无条件把所有阶相加;只有高阶缺失/不可靠时才转向低阶。 + +### 4.4 Kneser & Ney 1995:低阶概率应该问“能接在多少种上下文后” + +- **正式来源**:Reinhard Kneser, Hermann Ney, “Improved Backing-off for M-gram Language Modeling,” ICASSP 1995, pp. 181–184. +- **DOI**: +- **经典直觉**:“Francisco”频率高可能几乎都来自 “San Francisco”,它不该因此在任意新上下文后都有很高 unigram 概率。 +- **continuation count**:低阶概率按一个词出现过的不同左上下文数估计。 +- **边界**:modified interpolated Kneser–Ney 是后来的实用变体,不能把全部公式归给 1995 原文。 + +### 4.5 Chen & Goodman 1996:平滑方法必须在受控实验里比较 + +- **正式来源**:Stanley F. Chen, Joshua Goodman, “An Empirical Study of Smoothing Techniques for Language Modeling,” ACL 1996. +- **URL**: +- **价值**:跨数据规模、模型阶数与训练条件系统比较平滑方法;成为 modified Kneser–Ney 常用证据源。 +- **边界**:结论受语料、实现和版本影响,不能说某方法在所有时代/任务永远最优。 + +### 4.6 Goodman 2001:计数时代不是一条单技巧路线 + +- **正式来源**:Joshua T. Goodman, “A Bit of Progress in Language Modeling,” arXiv:cs/0108005. +- **URL**: +- **贡献**:把 caching、高阶 N-gram、skipping、Kneser–Ney、clustering 等组合评估。 +- **教学价值**:提醒读者,历史最强系统往往是多个互补信号的组合,不是“神经网络突然替代一个朴素 trigram”。 + +--- + +## 5. 分布式表示账:从“精确匹配”到“相似输入共享参数” + +### 5.1 One-hot 的问题 + +词 ID 经 one-hot 表示后: + +- 任意两个不同词的距离完全相同; +- “猫”和“狗”不会比“猫”和“微积分”更接近; +- 参数只能通过完全相同的词复用。 + +连续 embedding \(e_w\in\mathbb R^d\) 让一个词由多个维度共同表示,也让一个维度服务多个词。 + +### 5.2 Deerwester et al. 1990:全局共现矩阵的低秩空间 + +- **来源**:Scott Deerwester et al., “Indexing by Latent Semantic Analysis,” JASIS 41(6):391–407, 1990. +- **DOI**: +- **机制**:词—文档矩阵经 SVD 压到低维空间。 +- **边界**:词袋式全局矩阵分解,不建模词序,也不是 next-token 训练。 +- **正文地位**:旁支桥梁,不作为主干模型。 + +### 5.3 Bengio et al. 2003:表示与语言模型一起学 + +- **正式来源**:Yoshua Bengio, Réjean Ducharme, Pascal Vincent, Christian Jauvin, “A Neural Probabilistic Language Model,” JMLR 3:1137–1155, 2003. +- **URL**: +- **旧瓶颈**:离散 N-gram 的组合空间随词表和上下文长度指数增长;相似序列只因一个词不同就不能共享统计。 +- **机制**: + 1. 每个上下文词查 embedding; + 2. 拼接固定窗口; + 3. 前馈网络输出全词表分布; + 4. embedding 与概率模型端到端联合训练。 +- **论文原词**:distributed representation、curse of dimensionality。 +- **边界**:仍是固定窗口,且全词表归一化很昂贵。 +- **适合重绘**:lookup table → concat → tanh hidden → softmax;旁边画出相似词替换后输入向量只小幅移动。 + +### 5.4 Morin & Bengio 2005:输出词表也要有数据结构 + +- **正式来源**:Frederic Morin, Yoshua Bengio, “Hierarchical Probabilistic Neural Network Language Model,” AISTATS 2005, PMLR R5:246–252. +- **URL**: +- **旧瓶颈**:标准 Softmax 每个训练样本都要给整个词表打分,成本与 \(|V|\) 线性增长。 +- **机制**:沿二叉词树做一串二分类,把输出复杂度从 \(O(|V|)\) 降到与路径深度相关。 +- **论文证据**:在它的 WordNet 约束层次上报告约 200 倍训练/识别加速。 +- **边界**:树结构引入归纳偏置;高频词路径和语义树质量都会影响性能。 + +### 5.5 Mikolov et al. 2013:把“学词向量”单独做得极其高效 + +- **正式来源 A**:*Efficient Estimation of Word Representations in Vector Space*, arXiv:1301.3781. +- **正式来源 B**:*Distributed Representations of Words and Phrases and their Compositionality*, NeurIPS 2013 / arXiv:1310.4546. +- **机制**: + - CBOW:上下文预测中心词; + - Skip-gram:中心词预测邻近词; + - negative sampling:把完整归一化改成正负样本二分类近似目标; + - subsampling:降低高频词支配; + - phrase detection:学习部分多词单元。 +- **边界**: + - Word2Vec 不是完整句子 LM; + - 类比线性关系是经验现象,不是所有语义关系的保证; + - 一个词型一个静态向量,多义词仍混在一起。 + +### 5.6 GloVe 2014:局部窗口与全局计数的另一座桥 + +- **来源**:Jeffrey Pennington, Richard Socher, Christopher D. Manning, “GloVe: Global Vectors for Word Representation,” EMNLP 2014. +- **URL**: +- **机制**:在全局共现计数上拟合加权 log-bilinear 关系。 +- **边界**:不是更深的神经语言模型;仍是静态词型表示。 + +### 本账结论 + +神经 LM 的关键不只是“换成神经网络”,而是参数共享方式改变: + +```text +计数 N-gram:精确符号后缀共享 +类别 N-gram:离散词类共享 +神经 LM:连续向量邻域共享 +上下文化模型:同一 Token 还会随上下文动态改写 +``` + +--- + +## 6. 循环记忆账:固定窗口消失了,信息瓶颈还在 + +### 6.1 Elman 1990:把上一时刻隐藏状态带到下一时刻 + +- **正式来源**:Jeffrey L. Elman, “Finding Structure in Time,” *Cognitive Science* 14(2):179–211, 1990. +- **DOI**: +- **机制**:context units 保存上一时刻 hidden activation;网络用当前输入和旧状态预测序列。 +- **价值**:隐藏状态能形成与预测有关的结构,而非手写离散状态。 +- **边界**:实验规模小;不是现代大规模 RNNLM 的性能证据。 + +### 6.2 Mikolov et al. 2010:RNNLM 在真实语音任务上成为强模型 + +- **来源**:Tomáš Mikolov et al., “Recurrent neural network based language model,” Interspeech 2010. +- **URL**: +- **DOI**:`10.21437/Interspeech.2010-343` +- **旧瓶颈**:Bengio 前馈 LM 的上下文长度必须预先固定。 +- **论文报告**:在其混合模型与任务设置下,对比强 backoff LM 报告约 50% PPL 降低;WSJ / RT05 语音识别的 WER 相对降低约 18% / 5%。 +- **边界**:这些是特定数据、混合与解码设置的作者报告;论文也明确指出训练复杂度高。 + +### 6.3 为什么普通 RNN 学不住很远 + +跨 \(k\) 步梯度包含一串 Jacobian 乘积: + +\[ +\frac{\partial h_t}{\partial h_{t-k}} +=\prod_{i=t-k+1}^{t}\frac{\partial h_i}{\partial h_{i-1}} +\] + +若典型奇异值小于 1,信号指数衰减;大于 1,可能指数爆炸。激活饱和和重复矩阵乘法让问题更严重。 + +### 6.4 Bengio, Simard & Frasconi 1994:长程学习的基本困难 + +- **来源**:“Learning long-term dependencies with gradient descent is difficult,” IEEE Transactions on Neural Networks 5(2), 1994. +- **URL**: +- **DOI**:`10.1109/72.279181` +- **价值**:系统阐明学习长期存储与保持梯度之间的困难。 +- **边界**:不能把它简化为一句“发现了 vanishing gradient”;它讨论的是更完整的动态与优化权衡。 + +### 6.5 LSTM 1997:给误差信号一条受控的近恒等路径 + +- **正式来源**:Sepp Hochreiter, Jürgen Schmidhuber, “Long Short-Term Memory,” *Neural Computation* 9(8):1735–1780, 1997. +- **DOI**: +- **旧瓶颈**:原论文摘要称 recurrent backpropagation 的 insufficient, decaying error backflow 使长时距学习极慢。 +- **机制直觉**:cell state 提供受控的持续通道;乘法门决定何时写入、何时读出。 +- **重要边界**:课堂常见 forget / input / output 三门图包含后继改进;1997 原版没有现代默认的 forget gate。 +- **进一步边界**:LSTM 缓解梯度与记忆问题,但每个时间步仍依赖前一步,训练并行性没有解决。 + +### 6.6 Cho et al. 2014:GRU 与 encoder–decoder 同时进入主线 + +- **来源**:“Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation,” EMNLP 2014 / arXiv:1406.1078. +- **URL**: +- **机制**:reset/update gates 控制旧状态与新候选状态混合;编码器把源序列压成定长向量,解码器条件生成。 +- **边界**:GRU 不是“理论上优于 LSTM”;它是参数与门控结构不同的替代。 + +### 本账结论 + +RNN 把“固定 N 个词”换成“固定大小状态”,LSTM 把状态更新变得更可控;但三件事仍没消失: + +1. 信息必须逐步走过时间; +2. 长序列训练难并行; +3. 所有历史竞争同一个状态容量。 + +--- + +## 7. 序列转导账:从一个概率源到“条件生成另一个序列” + +### 7.1 语言模型与 Seq2Seq 的关系 + +普通 LM: + +\[ +P(y)=\prod_tP(y_t\mid y_{ +- **机制**:多层 LSTM encoder 映射到固定维向量,另一个 LSTM decoder 生成目标序列。 +- **关键工程洞见**:把源序列反转,缩短源—目标对应词之间的最小时间距离,使优化更容易。 +- **边界**:论文在特定 WMT14 英法任务上表现强,不等于固定向量瓶颈不存在;它仍是顺序模型。 + +### 7.4 Bahdanau, Cho & Bengio 2014/2015:不再要求一个向量记住全部 + +- **正式来源**:“Neural Machine Translation by Jointly Learning to Align and Translate,” ICLR 2015 / arXiv 2014. +- **URL**: +- **论文动机**:明确称 fixed-length vector 是基本瓶颈。 +- **机制**:每个 decoder step 根据当前状态给所有 encoder hidden states 打分,softmax 后做加权和,得到当步 context vector。 +- **含义**:过去是“先压缩再生成”;现在是“生成每一步时重新检索源序列”。 +- **边界**:这是 additive attention;仍有 RNN encoder/decoder,位置间训练依赖仍然存在。 + +### 7.5 Luong, Pham & Manning 2015:把注意力设计空间系统化 + +- **正式来源**:“Effective Approaches to Attention-based Neural Machine Translation,” EMNLP 2015, pp. 1412–1421. +- **URL**: +- **DOI**:`10.18653/v1/D15-1166` +- **比较**:global attention 看全部源词;local attention 只看预测窗口;给出 dot/general/concat 等 scoring 形式。 +- **边界**:它与 Bahdanau 的网络细节不同;也不是 Transformer 的 multi-head self-attention。 + +### 7.6 Transformer 是本章终点,不是本章内容 + +- **来源**:Vaswani et al., “Attention Is All You Need,” NeurIPS 2017. +- **URL**: +- **在本章只回答**:为什么 Attention 会自然成为主体——它提供直接路径和并行矩阵计算。 +- **留给第 02 章**:Q/K/V、scaled dot-product、multi-head、causal mask、position、residual、FFN。 +- **边界**:原论文是 encoder–decoder 机器翻译架构;现代 decoder-only LLM 是后续路线。 + +--- + +## 8. 评测与系统成本账:好想法必须付得起 + +### 8.1 Softmax 的词表税 + +标准输出: + +\[ +P(w\mid h)=\frac{\exp(o_w)}{\sum_{v\in V}\exp(o_v)} +\] + +每个样本要计算/归一化整个词表。大词表下,输出层参数和计算都可能占主导。 + +### 8.2 层次 Softmax、负采样与 adaptive softmax 回答不同问题 + +- **层次 Softmax**:把一个 \(|V|\) 类决策变成树路径上的多个二分类; +- **负采样**:训练词表示时只更新少量正负词,不产生严格归一化的完整 LM 分布; +- **Adaptive Softmax**:按频率与计算预算分簇,让高频词走短路径、低频词共享尾部结构。 + +不能把三者统称为“Softmax 加速”后就认为目标完全等价。 + +### 8.3 Grave et al. 2016:按词频分配计算 + +- **来源**:Edouard Grave et al., “Efficient softmax approximation for GPUs,” arXiv:1609.04309. +- **URL**: +- **机制**:利用词频长尾,把词聚成计算成本不同的簇,显式降低期望计算。 +- **边界**:是近似输出结构;收益依赖硬件、批大小、词频分布和实现。 + +### 8.4 Chelba et al. 2013:可比的十亿词基准 + +- **来源**:“One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling,” arXiv:1312.3005. +- **URL**: +- **数据**:接近 10 亿词。 +- **论文报告**:unpruned Kneser–Ney 5-gram 基线 PPL 67.6;组合技术相对降低 PPL 35%(交叉熵约 10%),RNN 模型最好。 +- **边界**:数字只属于该预处理、词表与 benchmark;不能拿来与不同 tokenizer 的现代 LLM 直接比。 + +### 8.5 Jozefowicz et al. 2016:在 Transformer 前夜把 RNNLM 推到大规模 + +- **来源**:“Exploring the Limits of Language Modeling,” arXiv:1602.02410. +- **URL**: +- **价值**:集中暴露大数据、大词表、计算与长程建模挑战,说明架构优雅之外还存在完整系统账。 + +### 8.6 Dauphin et al. 2016 与 Merity et al. 2017:历史不是一条直线 + +- Gated convolutional LM 展示有限感受野卷积也能竞争,并带来更高并行性; +- AWD-LSTM 用 DropConnect、NT-ASGD 等训练配方把 LSTM 基线显著做强; +- 因此 Transformer 的胜利不是“RNN 已经完全无效”,而是能力、并行性和规模化路径的综合转变。 + +--- + +## 9. 八张账合并后的最短因果链 + +```text +语言可视作条件随机符号源 + ↓ +链式法则把序列拆成逐步预测 + ↓ +有限 N-gram 让计数可行 + ↓ +组合爆炸与未见事件 → 折扣、回退、插值 + ↓ +离散精确匹配仍无法跨相似词泛化 + ↓ +分布式 embedding + 神经条件分布 + ↓ +固定窗口 → 循环状态 + ↓ +长程梯度与顺序计算 → LSTM / GRU + ↓ +条件序列生成 → encoder–decoder + ↓ +固定向量瓶颈 → 每步软检索全部源状态 + ↓ +Attention 成为主体 → Transformer(下一章) +``` + +这是一条教学因果链,不是假装每位作者都按这条线直接引用前一篇。正文必须用“解决同一瓶颈的后继节点”“后见之明下的桥”而非虚构直接历史因果。 + +--- + +## 10. 当代回声:K3 与 DeepSeek 继承了什么 + +### 10.1 不变量:主干仍是因果 next-token distribution + +经典自回归目标: + +\[ +\mathcal L_\text{NTP}=-\sum_t\log P_\theta(x_t\mid x_{ K3 把图像与文字放进同一条因果预测接口,同时保留一层 MTP 作为额外训练信号与 EAGLE-3 draft 的桥。多模态是条件/符号空间扩展,MTP 是预测跨度与推理加速扩展;二者不是一回事。 + +### 10.5 一张角色合同 + +| 角色 | 经典 LM | DeepSeek-V3/V4 | Kimi K3 | +|---|---|---|---| +| 主目标 | next-token NLL | next-token NLL | 统一视觉/文本 next-token NLL | +| 辅助目标 | 通常无 | 顺序 MTP,D=1 | one MTP layer | +| 推理主路径 | 单步自回归 | 可丢 MTP,仍可单步 | target 仍自回归 | +| 加速桥 | cache / batching | MTP 可服务 speculative decoding | MTP → EAGLE-3 draft | +| Tokenizer | 依模型 | byte-level BPE, 128K | vocabulary 160K | + +--- + +## 11. 正文论文链(首版 33 个节点) + +### 必讲 18 节点 + +1. Shannon 1948 — entropy / source +2. Shannon 1951 — next-symbol predictability +3. Good 1953 — unseen mass +4. Katz 1987 — discount + backoff +5. Elman 1990 — recurrent state +6. Brown et al. 1992 — discrete class sharing +7. Bengio et al. 1994 — long dependency optimization +8. Kneser & Ney 1995 — continuation probability +9. Hochreiter & Schmidhuber 1997 — LSTM +10. Bengio et al. 2003 — neural probabilistic LM +11. Morin & Bengio 2005 — hierarchical output +12. Mikolov et al. 2010 — practical RNNLM +13. Mikolov et al. 2013 — word2vec +14. Cho et al. 2014 — GRU encoder–decoder +15. Sutskever et al. 2014 — Seq2Seq +16. Bahdanau et al. 2014/2015 — soft alignment +17. Sennrich et al. 2016 — subword units +18. Vaswani et al. 2017 — chapter boundary + +### 地图节点 14 + +19. Jelinek et al. 1977 — perplexity term +20. Deerwester et al. 1990 — LSA +21. Chen & Goodman 1996 — smoothing benchmark +22. Goodman 2001 — count-LM system combination +23. Mikolov et al. 2013 — negative sampling / phrases +24. Pennington et al. 2014 — GloVe +25. Chelba et al. 2013 — One Billion Word benchmark +26. Luong et al. 2015 — global/local attention +27. Kim et al. 2016 — character-aware LM +28. Jozefowicz et al. 2016 — large RNN LM +29. Grave et al. 2016 — adaptive softmax +30. Dauphin et al. 2016 — gated convolutional LM +31. Merity et al. 2017 — AWD-LSTM +32. DeepSeek-V3/V4 reports — MTP +33. Kimi K3 report — unified multimodal NTP + draft bridge + +--- + +## 12. 四个交互实验的事实合同 + +### Lab A:N-gram 概率显微镜 + +- 可变项:阶数、未见事件、平滑强度、插值比例; +- 输出:逐步条件概率、sequence NLL、PPL; +- 必须显示:一个零概率如何让整句概率归零; +- 简化声明:使用手工小语料,不代表真实语言频率; +- 不能声称:更高阶必然更好。 + +### Lab B:Embedding 几何 + +- 可变项:one-hot / 低维分布向量、目标词; +- 输出:相似度、近邻、二维投影; +- 必须显示:一个维度不是一个固定人类概念; +- 简化声明:二维坐标为教学重绘,不是从真实 Word2Vec 权重导出; +- 不能声称:向量距离等于真正语义。 + +### Lab C:记忆走廊 + +- 可变项:距离、RNN retention、LSTM forget gate; +- 输出:信号与梯度相对强度; +- 必须显示:重复乘法的指数效应; +- 简化声明:标量 retention 是机制直觉,不是完整 Jacobian spectrum; +- 不能声称:LSTM 永不遗忘。 + +### Lab D:Seq2Seq 瓶颈与 Attention 桥 + +- 可变项:源长度、目标步、固定向量/attention; +- 输出:信息路径长度、对齐热力图、检索权重; +- 必须显示:decoder 每一步可以选择不同源位置; +- 简化声明:对齐权重为教学示意; +- 不能声称:attention weight 等于因果解释。 + +--- + +## 13. 视觉重绘清单 + +1. 符号源 → 条件分布 → 猜测 → surprise; +2. 链式法则的“整句拆题”带状图; +3. N-gram 上下文窗口与组合数量; +4. unseen event 把序列概率击穿; +5. Good–Turing frequency-of-frequencies; +6. Katz backoff 决策树; +7. 普通 unigram vs Kneser–Ney continuation count; +8. one-hot 正交角与 embedding 邻域; +9. Bengio 2003 lookup–concat–MLP–softmax; +10. full Softmax vs hierarchical tree; +11. Elman context loop; +12. 时间展开后的梯度乘积; +13. LSTM cell highway 与门; +14. fixed vector encoder–decoder; +15. source reversal 缩短依赖; +16. Bahdanau 每步软对齐; +17. global / local attention; +18. 八张账汇合到 Transformer 的总地图; +19. NTP / MTP / multimodal / speculative decoding 角色分离图。 + +所有图均原创重绘,标题注明“机制示意”或“依据原论文重绘”,不直接复制受版权保护的论文插图。 + +--- + +## 14. 事实检查清单 + +- [x] Shannon 1948 / 1951 DOI 与范围 +- [x] Good 1953 DOI 与论文摘要 +- [x] Katz 1987 IEEE 记录 +- [x] Brown 1992 ACL Anthology 记录 +- [x] Elman 1990 DOI +- [x] Bengio 1994 IEEE 记录 +- [x] Kneser–Ney 1995 DOI / 页码 +- [x] Chen–Goodman 1996 ACL 版本 +- [x] LSTM 1997 MIT Press 页面 +- [x] Bengio 2003 JMLR 版本与作者列表 +- [x] Morin–Bengio 2005 PMLR 记录 +- [x] Mikolov 2010 ISCA 记录与限定数字 +- [x] Word2Vec 两篇 2013 论文分开 +- [x] Cho / Sutskever / Bahdanau / Luong 版本边界 +- [x] Sennrich 2016 ACL 版本 +- [x] One Billion Word 数字与范围 +- [x] adaptive softmax 原文摘要 +- [x] K3 统一 NTP、160K、一层 MTP、EAGLE-3 draft +- [x] DeepSeek-V3 128K、D=1、MTP 可弃/可加速 +- [x] DeepSeek-V4 继承 V3 MTP 与权重调度 +- [ ] 对旧论文外链做发布前自动 HEAD/GET 检查 +- [ ] 第二轮逐图精读 Kneser–Ney、LSTM、Bahdanau 实验表 diff --git a/research/sources/README.md b/research/sources/README.md index af13453..27d65df 100644 --- a/research/sources/README.md +++ b/research/sources/README.md @@ -10,3 +10,14 @@ - arXiv:2607.24653 + +语言模型前史首轮缓存位于 `language-model-history/`(不提交 PDF/TXT): + +- Shannon 1948 / 1951; +- Bengio et al. 2003; +- Morin & Bengio 2005; +- Mikolov et al. 2010; +- Luong et al. 2015。 + +其余已核节点通过 DOI、ACL Anthology、PMLR、ISCA、JMLR、NeurIPS 或官方 arXiv 页面定位, +完整证据边界见 `../LANGUAGE_MODEL_HISTORY_RESEARCH.md`。 diff --git a/scripts/check-data-browser.mjs b/scripts/check-data-browser.mjs index 3957c2e..a9c37c3 100644 --- a/scripts/check-data-browser.mjs +++ b/scripts/check-data-browser.mjs @@ -234,11 +234,11 @@ if (layout.navLinks !== 14 || mobile.mobileLinks !== 14 || home.navLinks !== 14) if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentOverflow > 0) failures.push("页面存在横向溢出"); if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); if (!mobile.menuVisible || mobile.menuOpen !== "true") failures.push("移动端菜单不可用"); -if (home.releaseCards !== 7 || !home.firstRelease.includes("少几个比特") || home.firstHref !== "/systems/numerics/") { - failures.push("首页数值新章入口异常"); +if (home.releaseCards !== 8 || !home.firstRelease.includes("预测下一个 Token") || home.firstHref !== "/foundations/language-models/") { + failures.push("首页语言模型前史新章入口异常"); } -if (home.paperCount !== "223") failures.push(`首页论文总数异常:${home.paperCount}`); -if (!papers.hasDataFilter || papers.total !== 223 || papers.visible < 25) failures.push("论文库数据标签或论文总数异常"); +if (home.paperCount !== "247") failures.push(`首页论文总数异常:${home.paperCount}`); +if (!papers.hasDataFilter || papers.total !== 247 || papers.visible < 25) failures.push("论文库数据标签或论文总数异常"); if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); socket.close(); diff --git a/scripts/check-language-model-history-browser.mjs b/scripts/check-language-model-history-browser.mjs new file mode 100644 index 0000000..8ee8976 --- /dev/null +++ b/scripts/check-language-model-history-browser.mjs @@ -0,0 +1,218 @@ +import { writeFileSync } from "node:fs"; + +const cdpPort = process.env.CDP_PORT ?? "9224"; +const baseUrl = process.env.SITE_URL ?? "http://127.0.0.1:4323"; +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 < 60; attempt += 1) { + await pause(100); + if (await evaluate("document.readyState === 'complete'")) return; + } + throw new Error(`${path} 加载超时`); +}; +const screenshot = async (path, full = false) => { + const params = { format: "png", captureBeyondViewport: full }; + if (full) { + const metrics = await command("Page.getLayoutMetrics"); + params.clip = { + x: 0, + y: 0, + width: metrics.cssContentSize.width, + height: metrics.cssContentSize.height, + scale: 1, + }; + } + const result = await command("Page.captureScreenshot", params); + 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("/foundations/language-models/"); +await screenshot("/tmp/llm-atlas-language-history-desktop.png"); + +const overview = await evaluate(`(() => ({ + title: document.querySelector("h1")?.textContent.trim(), + sections: document.querySelectorAll(".article-section").length, + tocLinks: document.querySelectorAll(".side-rail a").length, + paperLinks: document.querySelectorAll(".paper-chain a").length, + labTabs: document.querySelectorAll("[data-history-tab]").length, + labPanels: document.querySelectorAll("[data-history-panel]").length, + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + mainObjective: document.querySelector(".objective-stack .main h3")?.textContent, +}))()`); + +const probability = await evaluate(`(() => { + const root = document.querySelector("[data-history-lab]"); + const read = () => ({ + probability: root.querySelector("[data-sequence-probability]").textContent, + nll: root.querySelector("[data-sequence-nll]").textContent, + ppl: root.querySelector("[data-sequence-ppl]").textContent, + zeroSteps: root.querySelectorAll(".sequence-readout .zero").length, + }); + const initial = read(); + const slider = root.querySelector("[data-smoothing]"); + slider.value = "20"; + slider.dispatchEvent(new Event("input", { bubbles: true })); + const smoothed = read(); + root.querySelector("[data-ngram-order]").value = "1"; + root.querySelector("[data-ngram-order]").dispatchEvent(new Event("change", { bubbles: true })); + const unigram = read(); + return { initial, smoothed, unigram }; +})()`); + +const embedding = await evaluate(`(() => { + const root = document.querySelector("[data-history-lab]"); + root.querySelector('[data-history-tab="embedding"]').click(); + root.querySelector('[data-word="dog"]').click(); + return { + selected: root.querySelector("[data-selected-word]").textContent, + onehot: [...root.querySelectorAll("[data-onehot-vector] i")].map((node) => node.textContent).join(""), + activeMap: root.querySelector(".map-point.selected b").textContent, + visiblePanel: root.querySelector("[data-history-panel]:not([hidden])").dataset.historyPanel, + }; +})()`); + +const memory = await evaluate(`(() => { + const root = document.querySelector("[data-history-lab]"); + root.querySelector('[data-history-tab="memory"]').click(); + const distance = root.querySelector("[data-memory-distance]"); + const retention = root.querySelector("[data-memory-retention]"); + distance.value = "50"; + distance.dispatchEvent(new Event("input", { bubbles: true })); + retention.value = "0.99"; + retention.dispatchEvent(new Event("change", { bubbles: true })); + return { + signal: root.querySelector("[data-memory-signal]").textContent, + distance: root.querySelector("[data-distance-label]").textContent, + rnn: root.querySelector("[data-rnn-value]").textContent, + lstm: root.querySelector("[data-lstm-value]").textContent, + }; +})()`); + +const seq2seq = await evaluate(`(() => { + const root = document.querySelector("[data-history-lab]"); + root.querySelector('[data-history-tab="seq2seq"]').click(); + root.querySelector('[data-seq-mode="attention"]').click(); + root.querySelector('[data-decoder-step="1"]').click(); + const weights = [...root.querySelectorAll("[data-source-value]")].map((node) => node.textContent); + const firstTab = root.querySelector('[data-history-tab="probability"]'); + firstTab.focus(); + firstTab.dispatchEvent(new KeyboardEvent("keydown", { key: "End", bubbles: true })); + return { + token: root.querySelector("[data-decoder-token]").textContent, + weights, + note: root.querySelector("[data-seq-note]").textContent, + bridge: root.querySelector("[data-bridge-label]").textContent, + keyboardSelected: root.querySelector('[data-history-tab][aria-selected="true"]').dataset.historyTab, + keyboardVisible: root.querySelector("[data-history-panel]:not([hidden])").dataset.historyPanel, + }; +})()`); + +await evaluate(`document.querySelector("[data-history-lab]").scrollIntoView({ block: "start", behavior: "instant" })`); +await pause(180); +await screenshot("/tmp/llm-atlas-language-history-lab-desktop.png"); + +await command("Emulation.setDeviceMetricsOverride", { + width: 390, + height: 844, + deviceScaleFactor: 1, + mobile: true, +}); +await navigate("/foundations/language-models/"); +const mobile = await evaluate(`(() => { + const root = document.querySelector("[data-history-lab]"); + root.scrollIntoView({ block: "start", behavior: "instant" }); + const toggle = document.querySelector("#menu-toggle"); + toggle?.click(); + return { + documentOverflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + menuVisible: getComputedStyle(toggle).display !== "none", + menuOpen: toggle.getAttribute("aria-expanded"), + tabs: root.querySelectorAll("[data-history-tab]").length, + offenders: [...document.querySelectorAll("body *")] + .filter((node) => node.getBoundingClientRect().right > document.documentElement.clientWidth + 1) + .slice(0, 12) + .map((node) => ({ + tag: node.tagName, + className: typeof node.className === "string" ? node.className : "", + right: Math.round(node.getBoundingClientRect().right), + width: Math.round(node.getBoundingClientRect().width), + })), + }; +})()`); +await pause(180); +await screenshot("/tmp/llm-atlas-language-history-mobile.png"); + +const report = { overview, probability, embedding, memory, seq2seq, mobile, exceptions }; +console.log(JSON.stringify(report, null, 2)); + +const numeric = (value) => Number.parseFloat(value); +const failures = []; +if (overview.sections !== 21 || overview.tocLinks !== 21) failures.push("章节/目录数量异常"); +if (overview.paperLinks !== 33) failures.push("正式论文链不是 33 个节点"); +if (overview.labTabs !== 4 || overview.labPanels !== 4) failures.push("四联实验结构异常"); +if (overview.documentOverflow > 1 || mobile.documentOverflow > 1) failures.push("桌面或移动端存在横向溢出"); +if (overview.mainObjective?.trim() !== "Next-token NLL") failures.push("当代目标主次标签异常"); +if (probability.initial.ppl !== "∞" || probability.initial.zeroSteps !== 1) failures.push("零概率未击穿初始序列"); +if (!Number.isFinite(numeric(probability.smoothed.ppl)) || numeric(probability.smoothed.probability) <= 0) failures.push("平滑没有救活未见序列"); +if (probability.unigram.zeroSteps !== 0) failures.push("Unigram 不应出现零概率步骤"); +if (embedding.selected.trim() !== "狗" || embedding.onehot !== "0100000" || embedding.activeMap.trim() !== "狗") failures.push("Embedding 选择状态不同步"); +if (memory.distance.trim() !== "50 步" || numeric(memory.signal) < 60 || numeric(memory.signal) > 61) failures.push("记忆指数衰减计算异常"); +if (seq2seq.token.trim() !== "猫" || seq2seq.weights[2] !== "72%" || !seq2seq.note.includes("cat")) failures.push("Attention 对齐状态异常"); +if (seq2seq.bridge.trim() !== "Σ αᵢhᵢ") failures.push("Attention context 标签异常"); +if (seq2seq.keyboardSelected !== "seq2seq" || seq2seq.keyboardVisible !== "seq2seq") failures.push("实验 tab 键盘导航异常"); +if (!mobile.menuVisible || mobile.menuOpen !== "true") 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 language-model-history browser regression"); +} + +socket.close(); diff --git a/scripts/check-moe-browser.mjs b/scripts/check-moe-browser.mjs index e5d35e8..e353c73 100644 --- a/scripts/check-moe-browser.mjs +++ b/scripts/check-moe-browser.mjs @@ -177,7 +177,7 @@ if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentO } if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); if (!mobile.menuVisible) failures.push("移动端菜单按钮未显示"); -if (home.releaseCards !== 7) failures.push(`首页新章卡数量异常:${home.releaseCards}`); +if (home.releaseCards !== 8) failures.push(`首页新章卡数量异常:${home.releaseCards}`); if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); socket.close(); diff --git a/scripts/check-numerics-browser.mjs b/scripts/check-numerics-browser.mjs index e83f162..63e6bcb 100644 --- a/scripts/check-numerics-browser.mjs +++ b/scripts/check-numerics-browser.mjs @@ -277,11 +277,11 @@ if (layout.navLinks !== 14 || mobile.mobileLinks !== 14 || home.navLinks !== 14) if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentOverflow > 0) failures.push("页面存在横向溢出"); if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); if (!mobile.menuVisible || mobile.menuOpen !== "true") failures.push("移动端菜单不可用"); -if (home.releaseCards !== 7 || !home.firstRelease.includes("少几个比特") || home.firstHref !== "/systems/numerics/") { - failures.push("首页数值新章入口异常"); +if (home.releaseCards !== 8 || !home.firstRelease.includes("预测下一个 Token") || home.firstHref !== "/foundations/language-models/") { + failures.push("首页语言模型前史新章入口异常"); } -if (home.paperCount !== "223") failures.push(`首页论文总数异常:${home.paperCount}`); -if (!papers.hasOptimizerFilter || papers.total !== 223 || papers.visible < 8) failures.push("论文库优化器标签或论文总数异常"); +if (home.paperCount !== "247") failures.push(`首页论文总数异常:${home.paperCount}`); +if (!papers.hasOptimizerFilter || papers.total !== 247 || papers.visible < 8) failures.push("论文库优化器标签或论文总数异常"); if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); socket.close(); diff --git a/scripts/check-reasoning-browser.mjs b/scripts/check-reasoning-browser.mjs index 60cad72..620e411 100644 --- a/scripts/check-reasoning-browser.mjs +++ b/scripts/check-reasoning-browser.mjs @@ -289,7 +289,7 @@ if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentO } if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); if (!mobile.menuVisible || mobile.menuOpen !== "true") failures.push("移动端菜单不可用"); -if (home.releaseCards !== 7 || !home.firstRelease.includes("少几个比特")) failures.push("首页数值新章入口异常"); +if (home.releaseCards !== 8 || !home.firstRelease.includes("预测下一个 Token")) failures.push("首页语言模型前史新章入口异常"); if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); socket.close(); diff --git a/scripts/check-scaling-browser.mjs b/scripts/check-scaling-browser.mjs index 458cfc1..332beaf 100644 --- a/scripts/check-scaling-browser.mjs +++ b/scripts/check-scaling-browser.mjs @@ -273,10 +273,10 @@ if (layout.navLinks !== 14 || mobile.mobileLinks !== 14 || home.navLinks !== 14) if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentOverflow > 0) failures.push("页面存在横向溢出"); if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); if (!mobile.menuVisible || mobile.menuOpen !== "true") failures.push("移动端菜单不可用"); -if (home.releaseCards !== 7 || !home.firstRelease.includes("少几个比特") || home.firstHref !== "/systems/numerics/") { - failures.push("首页数值新章入口异常"); +if (home.releaseCards !== 8 || !home.firstRelease.includes("预测下一个 Token") || home.firstHref !== "/foundations/language-models/") { + failures.push("首页语言模型前史新章入口异常"); } -if (home.paperCount !== "223") failures.push(`首页论文总数异常:${home.paperCount}`); +if (home.paperCount !== "247") failures.push(`首页论文总数异常:${home.paperCount}`); if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); socket.close(); diff --git a/scripts/check-training-systems-browser.mjs b/scripts/check-training-systems-browser.mjs index 84f7349..3fdfb4f 100644 --- a/scripts/check-training-systems-browser.mjs +++ b/scripts/check-training-systems-browser.mjs @@ -233,7 +233,7 @@ if (layout.articleSections !== 16 || layout.paperLinks !== 37 || layout.labTabs if (layout.documentOverflow > 0 || mobile.documentOverflow > 0 || home.documentOverflow > 0) failures.push("页面存在横向溢出"); if (layout.navGap < 0) failures.push(`桌面导航碰撞:${layout.navGap}px`); if (!mobile.menuVisible || mobile.menuOpen !== "true") failures.push("移动端菜单不可用"); -if (home.releaseCards !== 7 || !home.firstRelease.includes("少几个比特")) failures.push("首页数值新章入口异常"); +if (home.releaseCards !== 8 || !home.firstRelease.includes("预测下一个 Token")) failures.push("首页语言模型前史新章入口异常"); if (exceptions.length) failures.push(`浏览器脚本异常:${exceptions.join("; ")}`); socket.close(); diff --git a/src/components/LanguageModelHistoryLab.astro b/src/components/LanguageModelHistoryLab.astro new file mode 100644 index 0000000..8740dda --- /dev/null +++ b/src/components/LanguageModelHistoryLab.astro @@ -0,0 +1,1224 @@ +--- +const embeddingPoints = [ + { id: "cat", label: "猫", x: 74, y: 25, group: "动物", note: "小型、宠物、会叫" }, + { id: "dog", label: "狗", x: 67, y: 33, group: "动物", note: "小型、宠物、会叫" }, + { id: "tiger", label: "老虎", x: 80, y: 46, group: "动物", note: "大型、野生、捕食" }, + { id: "apple", label: "苹果", x: 25, y: 29, group: "食物", note: "水果、可食、植物" }, + { id: "pear", label: "梨", x: 20, y: 38, group: "食物", note: "水果、可食、植物" }, + { id: "car", label: "汽车", x: 46, y: 76, group: "工具", note: "人造、移动、机械" }, + { id: "train", label: "火车", x: 57, y: 83, group: "工具", note: "人造、移动、机械" }, +]; + +const sourceTokens = ["the", "black", "cat", "sat", "down"]; +const targetSteps = [ + { token: "黑色的", weights: [0.05, 0.69, 0.15, 0.07, 0.04] }, + { token: "猫", weights: [0.04, 0.11, 0.72, 0.08, 0.05] }, + { token: "坐下了", weights: [0.03, 0.05, 0.09, 0.45, 0.38] }, +]; +--- + +
+
+
+ INTERACTIVE / FOUR BOTTLENECKS +

把四次技术转弯亲手走一遍

+
+

全部数字都是可解释的教学微型模型;实验说明机制,不冒充论文复现实验或真实模型权重。

+
+ +
+ + + + +
+ +
+
+ LAB 01 / N-GRAM +

一句话只要有一步概率为 0,整句概率就归零

+

+ 小语料见过“我 喜欢 吃 苹果”,没见过“我 喜欢 吃 梨”。 + 调高阶数会让上下文更精确,也会让未见组合更多;平滑从已见事件挪出一点概率质量,救活未见事件。 +

+
+ + +
+
+ 微型训练语料 + 我 喜欢 吃 苹果 + 你 喜欢 吃 苹果 + 我 喜欢 看 电影 +
+
+
+
+ 测试序列 +
+
+
+
SEQUENCE P0.0000
+
AVG NLL
+
PERPLEXITY
+
+

+ Bigram 从“吃”出发只见过“苹果”,所以“梨”的概率是 0。最后一步把整条乘法链击穿。 +

+
+
+ + + + + + + +
+ 交互图 01 + 四个实验分别对应计数稀疏、参数共享、循环梯度与序列对齐。它们是原创机制重绘,不复制论文插图;数值只服务于可验证直觉。 +
+
+ + + + diff --git a/src/components/SiteHeader.astro b/src/components/SiteHeader.astro index 1b8ff7d..e6e7163 100644 --- a/src/components/SiteHeader.astro +++ b/src/components/SiteHeader.astro @@ -9,7 +9,7 @@ const items = [ { id: "roadmap", href: "/roadmap/", label: "学习地图" }, { id: "k3", href: "/k3/", label: "K3 解剖" }, { id: "deepseek", href: "/deepseek/", label: "DeepSeek" }, - { id: "foundations", href: "/foundations/", label: "基础原理" }, + { id: "foundations", href: "/foundations/language-models/", label: "基础原理" }, { id: "scaling", href: "/scaling/", label: "Scaling" }, { id: "data", href: "/pretraining/data/", label: "数据工程" }, { id: "moe", href: "/moe/", label: "MoE" }, diff --git a/src/data/chapters.ts b/src/data/chapters.ts index 965ff9e..04bdca8 100644 --- a/src/data/chapters.ts +++ b/src/data/chapters.ts @@ -35,9 +35,9 @@ export const chapters: Chapter[] = [ kicker: "LANGUAGE MODELING", question: "预测下一个 Token,为什么能产生通用能力?", summary: "从 N-gram、神经概率语言模型、词向量一路走到 Seq2Seq,理解 Transformer 出现前的瓶颈。", - status: "researching", - progress: 24, - papers: 10, + status: "published", + progress: 78, + papers: 33, prerequisites: [], highlights: ["概率分解", "分布式表示", "序列瓶颈"], }, diff --git a/src/data/papers.ts b/src/data/papers.ts index 1bf4d57..87bf3bf 100644 --- a/src/data/papers.ts +++ b/src/data/papers.ts @@ -33,6 +33,102 @@ export const papers: Paper[] = [ contribution: "信息熵与序列概率的理论起点。", verified: true, }, + { + year: 1951, + title: "Prediction and Entropy of Printed English", + url: "https://doi.org/10.1002/j.1538-7305.1951.tb01366.x", + topics: ["基础"], + contribution: "用已知前文时的下一字母猜测实验估计英语熵与冗余,是 next-symbol 预测的概念先声。", + verified: true, + }, + { + year: 1953, + title: "The Population Frequencies of Species and the Estimation of Population Parameters", + url: "https://doi.org/10.1093/biomet/40.3-4.237", + topics: ["基础"], + contribution: "以 frequency of frequencies 估计低频与未见事件的概率质量,奠定 Good–Turing 主线。", + verified: true, + }, + { + year: 1977, + title: "Perplexity—a measure of the difficulty of speech recognition tasks", + url: "https://doi.org/10.1121/1.2016299", + topics: ["基础", "评测"], + contribution: "早期把 perplexity 用作语音识别语言约束难度的历史节点。", + verified: true, + }, + { + year: 1987, + title: "Estimation of Probabilities from Sparse Data for the Language Model Component of a Speech Recognizer", + url: "https://ieeexplore.ieee.org/document/1165125", + topics: ["基础"], + contribution: "用折扣与回退把高阶 N-gram 的未见概率质量交给低阶模型。", + verified: true, + }, + { + year: 1990, + title: "Finding Structure in Time", + url: "https://doi.org/10.1207/s15516709cog1402_1", + topics: ["基础"], + contribution: "Elman 网络用循环 context units 在预测任务中形成序列相关的隐藏结构。", + verified: true, + }, + { + year: 1990, + title: "Indexing by Latent Semantic Analysis", + url: "https://doi.org/10.1002/(SICI)1097-4571(199009)41:6%3C391::AID-ASI1%3E3.0.CO;2-9", + topics: ["基础"], + contribution: "用词—文档矩阵的低秩分解构造全局潜在语义空间。", + verified: true, + }, + { + year: 1992, + title: "Class-Based n-gram Models of Natural Language", + url: "https://aclanthology.org/J92-4003/", + topics: ["基础"], + contribution: "用离散词类在 N-gram 中共享统计,是连续词向量之前的重要参数共享路线。", + verified: true, + }, + { + year: 1994, + title: "Learning long-term dependencies with gradient descent is difficult", + url: "https://ieeexplore.ieee.org/document/279181", + topics: ["基础"], + contribution: "系统阐明循环网络学习长期存储时的梯度与动力学困难。", + verified: true, + }, + { + year: 1995, + title: "Improved Backing-off for M-gram Language Modeling", + url: "https://doi.org/10.1109/ICASSP.1995.479394", + topics: ["基础"], + contribution: "用不同续接上下文的数量构造低阶分布,形成 Kneser–Ney smoothing 的核心直觉。", + verified: true, + }, + { + year: 1996, + title: "An Empirical Study of Smoothing Techniques for Language Modeling", + url: "https://aclanthology.org/P96-1041/", + topics: ["基础", "评测"], + contribution: "跨数据规模和模型阶数系统比较平滑方法,建立 modified Kneser–Ney 的实证坐标。", + verified: true, + }, + { + year: 1997, + title: "Long Short-Term Memory", + url: "https://doi.org/10.1162/neco.1997.9.8.1735", + topics: ["基础"], + contribution: "用受门控的恒定误差通路缓解循环网络的长期依赖与衰减误差回流。", + verified: true, + }, + { + year: 2001, + title: "A Bit of Progress in Language Modeling", + url: "https://arxiv.org/abs/cs/0108005", + topics: ["基础", "评测"], + contribution: "组合 cache、高阶 N-gram、skipping、Kneser–Ney 与 clustering,展现计数时代的强系统基线。", + verified: true, + }, { year: 2003, title: "A Neural Probabilistic Language Model", @@ -41,6 +137,22 @@ export const papers: Paper[] = [ contribution: "用分布式词表示和神经网络突破 N-gram 稀疏泛化。", verified: true, }, + { + year: 2005, + title: "Hierarchical Probabilistic Neural Network Language Model", + url: "https://proceedings.mlr.press/r5/morin05a.html", + topics: ["基础"], + contribution: "用二叉词树把全词表预测改成路径二分类,直面神经 LM 的 Softmax 词表税。", + verified: true, + }, + { + year: 2010, + title: "Recurrent neural network based language model", + url: "https://www.isca-archive.org/interspeech_2010/mikolov10_interspeech.html", + topics: ["基础", "评测"], + contribution: "把变长循环状态带入真实语音识别 LM,并明确暴露高训练复杂度。", + verified: true, + }, { year: 2013, title: "Efficient Estimation of Word Representations in Vector Space", @@ -49,6 +161,38 @@ export const papers: Paper[] = [ contribution: "Word2Vec 把大规模词向量训练变得简单高效。", verified: true, }, + { + year: 2013, + title: "Distributed Representations of Words and Phrases and their Compositionality", + url: "https://proceedings.neurips.cc/paper/2013/hash/9aa42b31882ec039965f3c4923ce901b-Abstract.html", + topics: ["基础"], + contribution: "以 negative sampling、频繁词子采样和短语发现扩展高效静态词表示。", + verified: true, + }, + { + year: 2013, + title: "One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling", + url: "https://arxiv.org/abs/1312.3005", + topics: ["基础", "评测"], + contribution: "提供接近十亿词的可比 LM 基准,并并列计数、循环与组合系统。", + verified: true, + }, + { + year: 2014, + title: "GloVe: Global Vectors for Word Representation", + url: "https://aclanthology.org/D14-1162/", + topics: ["基础"], + contribution: "在全局共现计数上拟合加权 log-bilinear 关系,连接矩阵分解与局部窗口表示。", + verified: true, + }, + { + year: 2014, + title: "Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation", + url: "https://aclanthology.org/D14-1179/", + topics: ["基础"], + contribution: "引入 RNN encoder–decoder 与 GRU 门控,把变长源序列映射到条件生成。", + verified: true, + }, { year: 2014, title: "Sequence to Sequence Learning with Neural Networks", @@ -65,6 +209,14 @@ export const papers: Paper[] = [ contribution: "用可微软对齐让 decoder 直接检索全部 encoder state。", verified: true, }, + { + year: 2015, + title: "Effective Approaches to Attention-based Neural Machine Translation", + url: "https://aclanthology.org/D15-1166/", + topics: ["基础", "Transformer"], + contribution: "系统化 global/local attention 与多种打分形式,澄清 Attention 前夜的设计空间。", + verified: true, + }, { year: 2015, title: "Neural Machine Translation of Rare Words with Subword Units", @@ -73,6 +225,46 @@ export const papers: Paper[] = [ contribution: "把 BPE 引入神经机器翻译,形成现代子词分词主线。", verified: true, }, + { + year: 2016, + title: "Character-Aware Neural Language Models", + url: "https://arxiv.org/abs/1508.06615", + topics: ["基础"], + contribution: "用字符 CNN 与 highway network 构造词表示,再交给 LSTM LM 建模。", + verified: true, + }, + { + year: 2016, + title: "Exploring the Limits of Language Modeling", + url: "https://arxiv.org/abs/1602.02410", + topics: ["基础", "训练系统", "评测"], + contribution: "在 Transformer 前夜把 RNN/CNN 词级语言模型推向大数据、大词表与大计算。", + verified: true, + }, + { + year: 2016, + title: "Efficient softmax approximation for GPUs", + url: "https://arxiv.org/abs/1609.04309", + topics: ["基础", "训练系统"], + contribution: "Adaptive Softmax 利用词频长尾分配不同计算,降低全词表输出的期望成本。", + verified: true, + }, + { + year: 2016, + title: "Language Modeling with Gated Convolutional Networks", + url: "https://arxiv.org/abs/1612.08083", + topics: ["基础", "训练系统"], + contribution: "以门控卷积建立可并行的强语言模型路线,说明历史并非 RNN 单线演进。", + verified: true, + }, + { + year: 2017, + title: "Regularizing and Optimizing LSTM Language Models", + url: "https://arxiv.org/abs/1708.02182", + topics: ["基础", "训练系统"], + contribution: "以 DropConnect 与 NT-ASGD 等配方建立 AWD-LSTM 强基线。", + verified: true, + }, { year: 1991, title: "Adaptive Mixtures of Local Experts", @@ -474,7 +666,7 @@ export const papers: Paper[] = [ year: 2024, title: "DeepSeek-V3 Technical Report", url: "https://arxiv.org/abs/2412.19437", - topics: ["MoE", "Scaling", "数据", "训练系统", "低精度"], + topics: ["基础", "MoE", "Scaling", "数据", "训练系统", "低精度"], contribution: "671B-A37B;FP8、MTP、无辅助损失平衡与 DualPipe。", spotlight: "DeepSeek", verified: true, @@ -1814,7 +2006,7 @@ export const papers: Paper[] = [ year: 2026, title: "DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence", url: "https://arxiv.org/abs/2606.19348", - topics: ["长上下文", "MoE", "数据", "训练系统", "推理"], + topics: ["基础", "长上下文", "MoE", "数据", "训练系统", "推理"], contribution: "32/33T 长文与 agentic 数据、CSA/HCA、mHC、Muon 和 1M 上下文双模型。", spotlight: "DeepSeek", verified: true, @@ -1823,7 +2015,7 @@ export const papers: Paper[] = [ year: 2026, title: "Kimi K3: Open Frontier Intelligence", url: "https://arxiv.org/abs/2607.24653", - topics: ["长上下文", "MoE", "数据", "训练系统", "低精度", "推理", "Agent", "多模态", "评测"], + topics: ["基础", "长上下文", "MoE", "数据", "训练系统", "低精度", "推理", "Agent", "多模态", "评测"], contribution: "四文本域与视觉语料、2.8T-A104B、KDA/MLA、Stable LatentMoE 与 1M Agentic RL。", spotlight: "Kimi", verified: true, diff --git a/src/pages/foundations/index.astro b/src/pages/foundations/index.astro index cfd95bf..a4ddf2a 100644 --- a/src/pages/foundations/index.astro +++ b/src/pages/foundations/index.astro @@ -63,6 +63,11 @@ const toc = [ 文本先被切成 Token,Token 变成向量;自注意力让每个位置从其他位置收集信息, 前馈网络在每个位置内部加工;残差和归一化让几十上百层能够稳定堆叠。

+ + PREVIOUS / CHAPTER 01 +
语言模型从哪里来

如果 N-gram、Embedding、RNN/LSTM、Seq2Seq 或 Attention 的来由还不清楚,先回到完整前史。

+ 返回上一章 → +
+ diff --git a/src/pages/index.astro b/src/pages/index.astro index 694a7c0..f851a1a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,6 +6,7 @@ import { chapters, statusLabel } from "@/data/chapters"; const routes: Record = { roadmap: "/roadmap/", + "foundations/language-models": "/foundations/language-models/", foundations: "/foundations/", scaling: "/scaling/", "pretraining/data": "/pretraining/data/", @@ -79,6 +80,7 @@ const paths = [

选择学习路径 + 语言模型从哪里来 直接解剖 K3 DeepSeek 专题 Scaling Laws 专题 @@ -97,7 +99,7 @@ const paths = [
16核心专题
151K3 报告来源
-
223关键论文索引
+
247关键论文索引
47pK3 技术报告
@@ -111,6 +113,22 @@ const paths = [
+ +
+

NEW / CHAPTER 01 LANGUAGE MODELING ORIGINS

+

预测下一个 Token,为什么会走到今天的大模型?

+

+ 用预测单位、概率信息、上下文、稀疏性、分布式表示、循环记忆、序列转导与系统成本八张账, + 从 Shannon、N-gram、Kneser–Ney、Bengio、RNN/LSTM 一路走到 Seq2Seq、Attention 与 K3 / DeepSeek。 +

+
+
+
LINEAGE
1948 → 2026
+
PAPERS
33 个一手节点
+
LAB
概率 · 向量 · 记忆 · 对齐
+
+ +

NEW / CHAPTER 09 PRECISION · OPTIMIZATION · STABILITY

@@ -456,6 +474,7 @@ const paths = [ transition: transform 180ms ease, border-color 180ms ease; } + .foundation-release, .numerics-release, .data-release, .scaling-release, @@ -473,6 +492,14 @@ const paths = [ var(--paper-raised); } + .foundation-release { + background: + radial-gradient(circle at 82% 18%, rgba(159, 91, 52, 0.2), transparent 30%), + repeating-linear-gradient(90deg, transparent 0 72px, rgba(159, 91, 52, 0.045) 72px 73px), + repeating-linear-gradient(0deg, transparent 0 72px, rgba(48, 64, 82, 0.035) 72px 73px), + var(--paper-raised); + } + .data-release { background: radial-gradient(circle at 82% 18%, rgba(76, 118, 112, 0.2), transparent 30%), @@ -563,6 +590,7 @@ const paths = [ padding-bottom: 76px; } + .foundation-release, .numerics-release, .data-release, .scaling-release, diff --git a/src/pages/progress/index.astro b/src/pages/progress/index.astro index 4872f3c..e704d8a 100644 --- a/src/pages/progress/index.astro +++ b/src/pages/progress/index.astro @@ -10,6 +10,7 @@ const workstreams = [ { label: "研究框架与规范", value: 83, next: "给 Scaling 与推理专题补逐篇图表/实验精读层级" }, { label: "网站设计系统", value: 89, next: "打印样式与更多通用可视化组件" }, { label: "Kimi K3 深读", value: 66, next: "扩写 pre-training / infra 逐图笔记" }, + { label: "语言模型前史", value: 78, next: "逐图精读 Kneser–Ney、LSTM 与 Bahdanau,并加入真实小语料复现" }, { label: "Transformer 基础", value: 52, next: "加入矩阵形状动画与手算练习" }, { label: "Scaling Laws", value: 74, next: "加入真实拟合复现、置信区间与更多模型族对照" }, { label: "数据工程与预训练配方", value: 73, next: "逐图精读 FineWeb / DCLM,加入真实去重与 mixture traces" }, @@ -43,7 +44,7 @@ const workstreams = [
OVERALL
专题平均 {average}%
READABLE
{published} 个首版可读专题
ACTIVE
{researching} 个研究/写作中
-
UPDATED
2026-07-29 03:55 CST
+
UPDATED
2026-07-29 04:48 CST
MODE
持续迭代,不锁死版本
@@ -53,7 +54,7 @@ const workstreams = [

01 WORKSTREAMS

-

十四条工作流同时推进,但不混淆“有页面”和“已核验”

+

十五条工作流同时推进,但不混淆“有页面”和“已核验”

内容首版优先打通全局脉络;随后每轮迭代选择一个专题推进到论文/工程层,并做独立事实复核。 @@ -90,8 +91,9 @@ const workstreams = [

K3 报告已结构化拆解

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

16 专题知识图

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

编辑式网站系统

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

-

二十四个原创交互视图

K3、注意力、DeepSeek、长上下文、MoE、推理,以及训练系统、Scaling、数据工程和数值专题的多页签实验。

-

十篇首版长文

K3、Transformer、DeepSeek、Scaling、数据工程、长上下文、MoE、推理、训练系统与数值优化专题。

+

二十八个原创交互视图

K3、语言模型前史、注意力、DeepSeek、长上下文、MoE、推理,以及训练系统、Scaling、数据工程和数值专题的多页签实验。

+

十一篇首版长文

K3、语言模型前史、Transformer、DeepSeek、Scaling、数据工程、长上下文、MoE、推理、训练系统与数值优化专题。

+

语言模型前史深度专题

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

Scaling Laws 深度专题

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

数据工程深度专题

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

长上下文深度专题

五张成本账、26 篇一手论文、10+ 机制图与 8 策略交互实验室。

@@ -99,7 +101,7 @@ const workstreams = [

推理深度专题

八张账、30 篇一手论文链、DeepSeek/Kimi 双主线与三页签互动实验室。

训练系统深度专题

九张账、37 个一手节点、DeepSeek/Kimi 双谱系与显存—网格—气泡—通信实验室。

数值、优化器与稳定性深度专题

十张账、36 个一手节点、K2/K3 与 DeepSeek-V3/V4 双谱系,以及格式—状态—更新—失稳四联实验。

-

223 篇关键论文索引

新增「优化器」标签和 21 个一手节点,继续支持全文搜索与 Kimi/DeepSeek 聚光主线。

+

247 篇关键论文索引

新增 24 个语言模型前史节点,并把 DeepSeek-V3/V4 与 K3 映射回 next-token 主线。

公开仓库与自托管发布

源码公开到 git.k1412.top,网站由不可变镜像、Compose Manager 与 HTTPS 交付。

@@ -114,6 +116,7 @@ const workstreams = [
优先级专题本轮交付完成闸门
+
P0语言模型前史二轮

Kneser–Ney / LSTM / Bahdanau 逐图 → 真实小语料复现 → tokenizer 公平性

可复现实验 + 逐图笔记
P0Scaling Laws 二轮

真实拟合复现 → 置信区间 → 更多模型族与下游任务外推

可复现实验 + 逐图笔记
P1数据工程二轮

FineWeb / DCLM 逐图 → 真实去重误伤 → mixture traces 与污染案例

逐图笔记 + 案例库
P1大规模训练系统二轮

真实集群 traces → 故障恢复 → 精确 topology / kernel 配置

案例库 + 实测边界
@@ -167,6 +170,8 @@ const workstreams = [
Grok 数据线索与正式账本永久分离

1264 行正式研究账本只接受回查一手来源后的结论;203 行 Grok 产物保留为未核验发现队列。

数值专题按十张账组织

把格式、缩放、计算、累加、搬运、更新、参数化、观测、恢复与证据经济分开核算。

低精度结论必须写完整角色合同

对象、格式、scale 粒度、accumulator、输出与硬件不再被压缩成一个 dtype 标签。

+
语言模型前史按八张账组织

预测单位、概率信息、上下文、稀疏性、分布式表示、循环记忆、序列转导与系统成本不再混成单一架构年表。

+
NTP、MTP 与多模态永久分角色

K3 的统一视觉/文本 next-token objective、one MTP layer 与 EAGLE-3 draft bridge 分开记账;DeepSeek MTP 也不写成取代自回归。