math-skill 2.1.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/README.en-US.md +165 -198
  2. package/README.md +165 -198
  3. package/agents/math-critic.en.md +28 -26
  4. package/agents/math-critic.md +33 -33
  5. package/commands/ask.en.md +10 -0
  6. package/commands/ask.md +3 -10
  7. package/design-patterns/attention/equivariant-attention.en.md +72 -0
  8. package/design-patterns/attention/equivariant-attention.md +72 -0
  9. package/design-patterns/attention/geometry-aware-attention.en.md +73 -0
  10. package/design-patterns/attention/geometry-aware-attention.md +72 -0
  11. package/design-patterns/attention/information-bottleneck-attention.en.md +72 -0
  12. package/design-patterns/attention/information-bottleneck-attention.md +72 -0
  13. package/design-patterns/attention/projection-attention.en.md +68 -0
  14. package/design-patterns/attention/projection-attention.md +68 -0
  15. package/design-patterns/attention/spectral-attention.en.md +71 -0
  16. package/design-patterns/attention/spectral-attention.md +71 -0
  17. package/design-patterns/compression/leverage-score-selection.en.md +71 -0
  18. package/design-patterns/compression/leverage-score-selection.md +71 -0
  19. package/design-patterns/compression/low-rank-kv-cache.en.md +60 -0
  20. package/design-patterns/compression/low-rank-kv-cache.md +60 -0
  21. package/design-patterns/compression/spectral-token-pruning.en.md +61 -0
  22. package/design-patterns/compression/spectral-token-pruning.md +61 -0
  23. package/design-patterns/compression/topology-preserving-compression.en.md +64 -0
  24. package/design-patterns/compression/topology-preserving-compression.md +64 -0
  25. package/design-patterns/loss/constraint-penalty.en.md +67 -0
  26. package/design-patterns/loss/constraint-penalty.md +78 -0
  27. package/design-patterns/loss/contrastive-loss.en.md +59 -0
  28. package/design-patterns/loss/contrastive-loss.md +68 -0
  29. package/design-patterns/loss/information-bottleneck-loss.en.md +69 -0
  30. package/design-patterns/loss/information-bottleneck-loss.md +74 -0
  31. package/design-patterns/loss/orthogonality-loss.en.md +56 -0
  32. package/design-patterns/loss/orthogonality-loss.md +60 -0
  33. package/design-patterns/loss/variational-loss.en.md +61 -0
  34. package/design-patterns/loss/variational-loss.md +71 -0
  35. package/design-patterns/representation/equivariant-split.en.md +87 -0
  36. package/design-patterns/representation/equivariant-split.md +89 -0
  37. package/design-patterns/representation/manifold-representation.en.md +85 -0
  38. package/design-patterns/representation/manifold-representation.md +87 -0
  39. package/design-patterns/representation/shared-private-decomposition.en.md +84 -0
  40. package/design-patterns/representation/shared-private-decomposition.md +86 -0
  41. package/design-patterns/representation/subspace-alignment.en.md +90 -0
  42. package/design-patterns/representation/subspace-alignment.md +92 -0
  43. package/design-patterns/routing/graph-routing.en.md +79 -0
  44. package/design-patterns/routing/graph-routing.md +81 -0
  45. package/design-patterns/routing/moe-routing.en.md +85 -0
  46. package/design-patterns/routing/moe-routing.md +87 -0
  47. package/design-patterns/routing/optimal-transport-routing.en.md +68 -0
  48. package/design-patterns/routing/optimal-transport-routing.md +72 -0
  49. package/design-patterns/routing/spectral-clustering-routing.en.md +88 -0
  50. package/design-patterns/routing/spectral-clustering-routing.md +90 -0
  51. package/knowledge-base/differential-geometry/connection.en.md +51 -0
  52. package/knowledge-base/differential-geometry/connection.md +51 -0
  53. package/knowledge-base/differential-geometry/curvature.en.md +49 -0
  54. package/knowledge-base/differential-geometry/curvature.md +49 -0
  55. package/knowledge-base/differential-geometry/geodesic.en.md +51 -0
  56. package/knowledge-base/differential-geometry/geodesic.md +51 -0
  57. package/knowledge-base/differential-geometry/manifold.en.md +47 -0
  58. package/knowledge-base/differential-geometry/manifold.md +47 -0
  59. package/knowledge-base/differential-geometry/metric-tensor.en.md +50 -0
  60. package/knowledge-base/differential-geometry/metric-tensor.md +50 -0
  61. package/knowledge-base/differential-geometry/tangent-space.en.md +48 -0
  62. package/knowledge-base/differential-geometry/tangent-space.md +48 -0
  63. package/knowledge-base/information-geometry/fisher-metric.en.md +56 -0
  64. package/knowledge-base/information-geometry/fisher-metric.md +56 -0
  65. package/knowledge-base/information-geometry/natural-gradient.en.md +54 -0
  66. package/knowledge-base/information-geometry/natural-gradient.md +54 -0
  67. package/knowledge-base/lie-theory/equivariance.en.md +54 -0
  68. package/knowledge-base/lie-theory/equivariance.md +54 -0
  69. package/knowledge-base/lie-theory/group-action.en.md +51 -0
  70. package/knowledge-base/lie-theory/group-action.md +51 -0
  71. package/knowledge-base/lie-theory/lie-algebra.en.md +51 -0
  72. package/knowledge-base/lie-theory/lie-algebra.md +51 -0
  73. package/knowledge-base/lie-theory/lie-group.en.md +51 -0
  74. package/knowledge-base/lie-theory/lie-group.md +51 -0
  75. package/knowledge-base/lie-theory/representation.en.md +52 -0
  76. package/knowledge-base/lie-theory/representation.md +52 -0
  77. package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +49 -0
  78. package/knowledge-base/matrix-analysis/low-rank-approximation.md +49 -0
  79. package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +49 -0
  80. package/knowledge-base/matrix-analysis/matrix-perturbation.md +49 -0
  81. package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +50 -0
  82. package/knowledge-base/matrix-analysis/positive-semidefinite.md +50 -0
  83. package/knowledge-base/matrix-analysis/projection.en.md +47 -0
  84. package/knowledge-base/matrix-analysis/projection.md +47 -0
  85. package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +48 -0
  86. package/knowledge-base/matrix-analysis/spectral-decomposition.md +48 -0
  87. package/knowledge-base/optimization/constrained-optimization.en.md +53 -0
  88. package/knowledge-base/optimization/constrained-optimization.md +53 -0
  89. package/knowledge-base/optimization/convex-optimization.en.md +50 -0
  90. package/knowledge-base/optimization/convex-optimization.md +50 -0
  91. package/knowledge-base/optimization/lagrangian-duality.en.md +50 -0
  92. package/knowledge-base/optimization/lagrangian-duality.md +50 -0
  93. package/knowledge-base/optimization/proximal-method.en.md +52 -0
  94. package/knowledge-base/optimization/proximal-method.md +52 -0
  95. package/knowledge-base/optimization/riemannian-optimization.en.md +51 -0
  96. package/knowledge-base/optimization/riemannian-optimization.md +51 -0
  97. package/knowledge-base/overview.en.md +29 -218
  98. package/knowledge-base/overview.md +29 -220
  99. package/knowledge-base/probability/concentration-inequality.en.md +45 -0
  100. package/knowledge-base/probability/concentration-inequality.md +45 -0
  101. package/knowledge-base/probability/entropy.en.md +47 -0
  102. package/knowledge-base/probability/entropy.md +47 -0
  103. package/knowledge-base/probability/fisher-information.en.md +48 -0
  104. package/knowledge-base/probability/fisher-information.md +48 -0
  105. package/knowledge-base/probability/information-bottleneck.en.md +49 -0
  106. package/knowledge-base/probability/information-bottleneck.md +49 -0
  107. package/knowledge-base/probability/kl-divergence.en.md +51 -0
  108. package/knowledge-base/probability/kl-divergence.md +51 -0
  109. package/knowledge-base/topology/euler-characteristic.en.md +54 -0
  110. package/knowledge-base/topology/euler-characteristic.md +54 -0
  111. package/knowledge-base/topology/fundamental-group.en.md +52 -0
  112. package/knowledge-base/topology/fundamental-group.md +52 -0
  113. package/knowledge-base/topology/persistent-homology.en.md +54 -0
  114. package/knowledge-base/topology/persistent-homology.md +54 -0
  115. package/lenses/algorithmic.en.md +49 -0
  116. package/lenses/algorithmic.md +49 -0
  117. package/lenses/axiomatization.en.md +48 -0
  118. package/lenses/axiomatization.md +48 -0
  119. package/lenses/categorical.en.md +48 -0
  120. package/lenses/categorical.md +48 -0
  121. package/lenses/causal.en.md +49 -0
  122. package/lenses/causal.md +49 -0
  123. package/lenses/duality.en.md +47 -0
  124. package/lenses/duality.md +47 -0
  125. package/lenses/game.en.md +50 -0
  126. package/lenses/game.md +50 -0
  127. package/lenses/geometric.en.md +53 -0
  128. package/lenses/geometric.md +53 -0
  129. package/lenses/local-to-global.en.md +52 -0
  130. package/lenses/local-to-global.md +52 -0
  131. package/lenses/perturbation.en.md +51 -0
  132. package/lenses/perturbation.md +51 -0
  133. package/lenses/probabilistic.en.md +48 -0
  134. package/lenses/probabilistic.md +48 -0
  135. package/lenses/projection.en.md +50 -0
  136. package/lenses/projection.md +50 -0
  137. package/lenses/spectral.en.md +52 -0
  138. package/lenses/spectral.md +52 -0
  139. package/lenses/symmetry.en.md +49 -0
  140. package/lenses/symmetry.md +49 -0
  141. package/lenses/topological.en.md +48 -0
  142. package/lenses/topological.md +48 -0
  143. package/lenses/variational.en.md +48 -0
  144. package/lenses/variational.md +48 -0
  145. package/package.json +9 -3
  146. package/references/agentic-workflow.en.md +1 -1
  147. package/references/agentic-workflow.md +1 -1
  148. package/references/books/abstract-algebra.en.md +124 -0
  149. package/references/books/abstract-algebra.md +22 -22
  150. package/references/books/algebraic-geometry-rising-sea.en.md +171 -0
  151. package/references/books/algebraic-geometry-rising-sea.md +11 -11
  152. package/references/books/differential-geometry.en.md +140 -0
  153. package/references/books/differential-geometry.md +19 -19
  154. package/references/books/matrix-analysis.en.md +146 -0
  155. package/references/books/matrix-analysis.md +10 -10
  156. package/references/books/micro-lie-theory.en.md +116 -0
  157. package/references/books/micro-lie-theory.md +17 -17
  158. package/references/books/optimization-ml.en.md +163 -0
  159. package/references/books/optimization-ml.md +7 -8
  160. package/references/books/smooth-manifolds.en.md +105 -0
  161. package/references/books/smooth-manifolds.md +14 -14
  162. package/references/gpu-friendly-math.en.md +23 -10
  163. package/references/gpu-friendly-math.md +17 -4
  164. package/references/inspiration.en.md +1 -1
  165. package/references/inspiration.md +2 -2
  166. package/skills/math-research-activator/SKILL.en.md +195 -114
  167. package/skills/math-research-activator/SKILL.md +194 -119
  168. package/skills/math-research-activator/original-texts.en.md +9 -9
  169. package/skills/math-research-activator/original-texts.md +11 -11
  170. package/commands/abstraction.md +0 -11
  171. package/commands/algorithmic-thinking.md +0 -11
  172. package/commands/axiomatization.md +0 -11
  173. package/commands/causal-inference.md +0 -11
  174. package/commands/discrete-combinatorial.md +0 -11
  175. package/commands/game-theory.md +0 -11
  176. package/commands/induction-analogy.md +0 -11
  177. package/commands/information-theory.md +0 -11
  178. package/commands/logic-deduction.md +0 -11
  179. package/commands/modeling.md +0 -11
  180. package/commands/optimization.md +0 -11
  181. package/commands/probability-statistics.md +0 -11
  182. package/commands/symmetry-invariance.md +0 -11
  183. package/commands/topological-thinking.md +0 -11
  184. package/commands/transformation.md +0 -11
  185. package/skills/abstraction/SKILL.en.md +0 -117
  186. package/skills/abstraction/SKILL.md +0 -121
  187. package/skills/abstraction/original-texts.en.md +0 -163
  188. package/skills/abstraction/original-texts.md +0 -175
  189. package/skills/algorithmic-thinking/SKILL.en.md +0 -132
  190. package/skills/algorithmic-thinking/SKILL.md +0 -138
  191. package/skills/algorithmic-thinking/original-texts.en.md +0 -253
  192. package/skills/algorithmic-thinking/original-texts.md +0 -256
  193. package/skills/axiomatization/SKILL.en.md +0 -144
  194. package/skills/axiomatization/SKILL.md +0 -151
  195. package/skills/axiomatization/original-texts.en.md +0 -154
  196. package/skills/axiomatization/original-texts.md +0 -160
  197. package/skills/causal-inference/SKILL.en.md +0 -147
  198. package/skills/causal-inference/SKILL.md +0 -151
  199. package/skills/causal-inference/original-texts.en.md +0 -136
  200. package/skills/causal-inference/original-texts.md +0 -167
  201. package/skills/discrete-combinatorial/SKILL.en.md +0 -124
  202. package/skills/discrete-combinatorial/SKILL.md +0 -131
  203. package/skills/discrete-combinatorial/original-texts.en.md +0 -184
  204. package/skills/discrete-combinatorial/original-texts.md +0 -185
  205. package/skills/game-theory/SKILL.en.md +0 -117
  206. package/skills/game-theory/SKILL.md +0 -123
  207. package/skills/game-theory/original-texts.en.md +0 -131
  208. package/skills/game-theory/original-texts.md +0 -131
  209. package/skills/induction-analogy/SKILL.en.md +0 -145
  210. package/skills/induction-analogy/SKILL.md +0 -152
  211. package/skills/induction-analogy/original-texts.en.md +0 -140
  212. package/skills/induction-analogy/original-texts.md +0 -154
  213. package/skills/information-theory/SKILL.en.md +0 -134
  214. package/skills/information-theory/SKILL.md +0 -140
  215. package/skills/information-theory/original-texts.en.md +0 -127
  216. package/skills/information-theory/original-texts.md +0 -127
  217. package/skills/logic-deduction/SKILL.en.md +0 -130
  218. package/skills/logic-deduction/SKILL.md +0 -135
  219. package/skills/logic-deduction/original-texts.en.md +0 -160
  220. package/skills/logic-deduction/original-texts.md +0 -173
  221. package/skills/modeling/SKILL.en.md +0 -135
  222. package/skills/modeling/SKILL.md +0 -139
  223. package/skills/modeling/original-texts.en.md +0 -162
  224. package/skills/modeling/original-texts.md +0 -165
  225. package/skills/optimization/SKILL.en.md +0 -129
  226. package/skills/optimization/SKILL.md +0 -135
  227. package/skills/optimization/original-texts.en.md +0 -167
  228. package/skills/optimization/original-texts.md +0 -168
  229. package/skills/probability-statistics/SKILL.en.md +0 -146
  230. package/skills/probability-statistics/SKILL.md +0 -151
  231. package/skills/probability-statistics/original-texts.en.md +0 -191
  232. package/skills/probability-statistics/original-texts.md +0 -193
  233. package/skills/symmetry-invariance/SKILL.en.md +0 -135
  234. package/skills/symmetry-invariance/SKILL.md +0 -139
  235. package/skills/symmetry-invariance/original-texts.en.md +0 -206
  236. package/skills/symmetry-invariance/original-texts.md +0 -221
  237. package/skills/topological-thinking/SKILL.en.md +0 -124
  238. package/skills/topological-thinking/SKILL.md +0 -128
  239. package/skills/topological-thinking/original-texts.en.md +0 -134
  240. package/skills/topological-thinking/original-texts.md +0 -164
  241. package/skills/transformation/SKILL.en.md +0 -120
  242. package/skills/transformation/SKILL.md +0 -124
  243. package/skills/transformation/original-texts.en.md +0 -204
  244. package/skills/transformation/original-texts.md +0 -216
@@ -1,230 +1,39 @@
1
- > **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `overview.en.md`。
1
+ # 数学知识库导航 / Knowledge Base Navigation
2
2
 
3
- # 数学知识体系概述 / Mathematical Knowledge System Overview
3
+ > 本文件是 v3 知识库的索引,帮助你从问题类型找到具体的知识卡片。
4
4
 
5
- ## 概述
5
+ ## 知识库结构
6
6
 
7
- 数学知识体系是数学学科的结构化框架,涵盖从基础概念到前沿分支的完整内容。它不仅描述学科之间的层次关系,也呈现出数学方法如何在不同问题域中互补与协同。
7
+ 知识库按数学领域组织,共 7 个领域、31 张知识卡片。每张卡片包含:最小定义、核心公式、适用问题、AI 设计翻译、工程可行性、风险与失效条件。
8
8
 
9
- 本概述旨在帮助你:
9
+ | 领域 | 目录 | 卡片 | 典型应用 |
10
+ |------|------|------|---------|
11
+ | 矩阵分析 | `matrix-analysis/` | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation | LoRA、谱归一化、条件数监控 |
12
+ | 最优化 | `optimization/` | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method | GAN minimax、权重约束、Muon 优化器 |
13
+ | 微分几何 | `differential-geometry/` | manifold, tangent-space, metric-tensor, geodesic, curvature, connection | 自然梯度、流形优化、K-FAC |
14
+ | 李理论 | `lie-theory/` | group-action, lie-group, lie-algebra, representation, equivariance | 等变网络、SO(3) 参数化、球谐特征 |
15
+ | 拓扑 | `topology/` | persistent-homology, euler-characteristic, fundamental-group | 拓扑正则、隐空间监控 |
16
+ | 概率与信息 | `probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information | VAE、知识蒸馏、泛化界 |
17
+ | 信息几何 | `information-geometry/` | natural-gradient, fisher-metric | 自然梯度下降、Fisher-Rao 度量 |
10
18
 
11
- - 快速定位数学问题所属的学科与方法领域;
12
- - 理解本项目 16 种思想武器(15 武器 + math-research-activator)与数学分支之间的对应关系;
13
- - 形成从问题到工具、从概念到应用的整体认知。
19
+ ## 从问题找知识卡
14
20
 
15
- 数学的发展受到逻辑推理、科学需求和交叉应用的共同推动。
21
+ | 问题类型 | 推荐知识卡 |
22
+ |---------|-----------|
23
+ | 需要降维/压缩 | low-rank-approximation, projection |
24
+ | 需要约束优化 | constrained-optimization, lagrangian-duality |
25
+ | 需要等变/对称 | group-action, equivariance, representation |
26
+ | 需要稳定训练 | matrix-perturbation, positive-semidefinite, fisher-information |
27
+ | 需要流形参数化 | manifold, riemannian-optimization, tangent-space |
28
+ | 需要信息压缩 | information-bottleneck, entropy, kl-divergence |
29
+ | 需要拓扑正则 | persistent-homology, euler-characteristic |
16
30
 
17
- ## 一、数学体系的三大基础支柱
31
+ ## 与思想透镜的关系
18
32
 
19
- 现代数学大厦建立在**集合论**和**数理逻辑**基础上,三大基础学科是:
33
+ 思想透镜(`../lenses/`)负责"用什么视角看问题",知识库负责"提供具体数学工具"。典型链路:
20
34
 
21
- ### 代数学(Algebra)
35
+ ```
36
+ 透镜诊断 → 知识卡片提供工具 → 设计模式翻译成 AI 模块
37
+ ```
22
38
 
23
- 研究数、结构、关系和符号运算。
24
-
25
- | 层次 | 内容 | 核心概念 |
26
- |------|------|---------|
27
- | 初等代数 | 方程、不等式、多项式运算 | 变量、等式、运算律 |
28
- | 高等代数(线性代数) | 向量空间、线性变换、矩阵 | 线性空间、基、维数、特征值 |
29
- | 抽象代数 | 群、环、域 | 代数结构、同态、同构 |
30
- | 范畴论 | 对象与态射的抽象理论 | 函子、自然变换、泛性质 |
31
-
32
- ### 几何学(Geometry)
33
-
34
- 研究空间、形状、结构及其关系。
35
-
36
- | 层次 | 内容 | 核心概念 |
37
- |------|------|---------|
38
- | 欧几里得几何 | 平面与立体几何 | 点、线、面、角、距离 |
39
- | 解析几何 | 用代数方法研究几何 | 坐标系、方程、曲线 |
40
- | 非欧几何 | 改变平行公理的几何 | 双曲几何、椭圆几何 |
41
- | 微分几何 | 用微积分研究几何 | 曲率、测地线、流形 |
42
- | 分形几何 | 自相似的几何结构 | 分形维数、迭代函数系统 |
43
-
44
- ### 分析学(Analysis)
45
-
46
- 研究函数、极限、连续、微分、积分等。
47
-
48
- | 层次 | 内容 | 核心概念 |
49
- |------|------|---------|
50
- | 微积分 | 极限、导数、积分 | 连续、可微、可积 |
51
- | 数学分析 | 严格的极限理论 | ε-δ语言、一致收敛 |
52
- | 实分析 | 测度论、Lebesgue 积分 | 测度空间、L^p 空间 |
53
- | 复分析 | 复变函数理论 | 解析函数、留数、共形映射 |
54
- | 泛函分析 | 无限维空间上的分析 | Banach 空间、Hilbert 空间、算子 |
55
- | 微分方程 | ODE 与 PDE | 存在唯一性、稳定性、数值解法 |
56
-
57
- ## 二、主要分支
58
-
59
- ### 1. 数论(Number Theory)
60
-
61
- 研究整数性质,如素数分布、同余、丢番图方程等。
62
-
63
- - **初等数论**:整除、同余、素数
64
- - **解析数论**:用分析方法研究数论问题(如素数定理)
65
- - **代数数论**:用代数方法研究数论问题(如代数数域)
66
- - **几何数论**:用几何方法研究数论问题
67
-
68
- ### 2. 概率论与数理统计(Probability & Statistics)
69
-
70
- 研究随机现象和数据分析,广泛应用于金融、生物、社会科学等。对应思想武器:**概率与统计**、**信息论思想**、**因果推断思想**。
71
-
72
- - **概率论**:随机变量、分布、极限定理 → 详见 **概率与统计**(Kolmogorov 公理)
73
- - **数理统计**:参数估计、假设检验、回归分析 → 详见 **概率与统计**(回归建模、实验设计)
74
- - **随机过程**:马尔可夫链、布朗运动、鞅论
75
- - **贝叶斯统计**:先验、后验、MCMC → 详见 **信息论思想**(最大熵原则)
76
-
77
- ### 3. 拓扑学(Topology)
78
-
79
- 研究空间在连续变形下的不变性质。对应思想武器:**拓扑思想**。
80
-
81
- - **点集拓扑**:开集、闭集、连通性、紧致性 → 详见 **对称与不变性**(不变量视角)
82
- - **代数拓扑**:同伦、同调、上同调 → 详见 **拓扑思想**(基本群、Betti 数)
83
- - **微分拓扑**:流形、切空间、微分形式
84
-
85
- ### 4. 离散数学(Discrete Mathematics)
86
-
87
- 集合论、图论、数理逻辑等,是计算机科学的数学基础。对应思想武器:**算法与计算思想**、**离散与组合思想**。
88
-
89
- - **集合论**:集合、关系、函数、基数、序数
90
- - **图论**:图、路径、连通性、着色、网络流
91
- - **数理逻辑**:命题逻辑、谓词逻辑、可计算性 → 详见 **公理化思想**、**逻辑演绎**
92
- - **组合数学**:计数、排列组合、生成函数 → 详见 **离散与组合思想**
93
- - **算法与复杂度**:排序、搜索、P/NP、可判定性 → 详见 **算法与计算思想**
94
-
95
- ### 5. 应用数学分支
96
-
97
- 将数学方法应用于实际问题。对应思想武器:**优化思想**、**信息论思想**、**博弈论思想**、**算法与计算思想**、**因果推断思想**。
98
-
99
- - **运筹学**:线性规划、整数规划、动态规划、排队论 → 详见 **优化思想**(LP/IP/DP 分类)、**算法与计算思想**(求解算法)
100
- - **控制理论**:系统控制、最优控制、鲁棒控制 → 详见 **优化思想**(最优控制即变分优化)
101
- - **信息论**:熵、信道容量、数据压缩、编码理论 → 详见 **信息论思想**(Shannon 熵、编码定理)
102
- - **博弈论**:策略互动、均衡分析、机制设计 → 详见 **博弈论思想**(Nash 均衡、minimax)
103
- - **因果推断**:因果图模型、干预分析、反事实推理 → 详见 **因果推断思想**(DAG、do 算子)
104
- - **金融数学**:期权定价、风险管理、随机微积分 → 详见 **建模思想**(Black-Scholes)、**概率与统计**
105
- - **计算数学**:数值分析、有限元、蒙特卡洛方法 → 详见 **算法与计算思想**(数值算法)
106
- - **机器学习数学基础**:优化、统计学习理论、核方法 → 详见 **优化思想**、**概率与统计**、**信息论思想**(MDL/AIC)
107
-
108
- ## 三、知识体系的层次结构
109
-
110
- 从学习路径看,数学知识可分层次:
111
-
112
- ### 地基层
113
-
114
- 数感、逻辑与分类、算术与基础几何。
115
-
116
- - 数的概念与运算
117
- - 基本逻辑推理
118
- - 算术运算(加减乘除)
119
- - 基础几何图形与性质
120
-
121
- ### 代数层
122
-
123
- 变量、方程、函数、几何证明。
124
-
125
- - 代数表达式与方程
126
- - 函数概念与基本函数族
127
- - 平面几何证明
128
- - 向量与坐标
129
-
130
- ### 综合层
131
-
132
- 函数与导数、微积分、数列、立体几何、概率统计深化。
133
-
134
- - 极限与连续
135
- - 微分与积分
136
- - 数列与级数
137
- - 立体几何
138
- - 概率分布与统计推断
139
-
140
- ### 前沿层
141
-
142
- 数学分析、高等代数、解析/微分几何、数论、拓扑学等。
143
-
144
- - 严格的分析理论(ε-δ)
145
- - 抽象代数结构(群环域)
146
- - 流形与微分几何
147
- - 代数/解析数论
148
- - 点集/代数拓扑
149
- - 泛函分析与算子理论
150
-
151
- ## 四、数学思想方法的层次
152
-
153
- | 层次 | 思想方法 | 说明 |
154
- |------|---------|------|
155
- | 基础层 | 逻辑演绎、归纳类比 | 所有数学思维的基础 |
156
- | 方法层 | 公理化、抽象化、建模 | 构建数学理论的方法 |
157
- | 工具层 | 优化、变换、概率统计 | 解决具体问题的工具 |
158
- | 拓展层 | 算法与计算、信息论、博弈论、因果推断 | 应用于计算、信息、互动和因果的工具 |
159
- | 哲学层 | 对称不变性、拓扑思想、离散组合 | 理解结构与本质的哲学视角 |
160
-
161
- ## 五、数学与其他学科的联系
162
-
163
- | 学科 | 使用的数学工具 | 典型应用 |
164
- |------|--------------|---------|
165
- | 物理学 | 微积分、线性代数、群论 | 力学、量子力学、相对论 |
166
- | 计算机科学 | 离散数学、图论、概率 | 算法分析、密码学、AI |
167
- | 经济学 | 优化、博弈论、微分方程 | 市场均衡、定价模型 |
168
- | 生物学 | 微分方程、统计、图论 | 种群动力学、系统生物学 |
169
- | 工程学 | 微分方程、傅里叶分析、数值方法 | 控制系统、信号处理 |
170
- | 社会科学 | 统计、博弈论、网络分析 | 社会网络、决策分析 |
171
-
172
- ## 六、思维武器与数学分支的映射
173
-
174
- 本项目的 16 种思想武器(15 种专业武器 + 1 个 math-research-activator 自动触发入口)不是孤立存在的,它们与数学分支形成了互补的工具集。下面展示一个简化映射,帮助你从问题类型直接找到适合的数学方法。v2 另有 `references/books/*.md` × 7 把代数几何 / 微分几何 / 李理论 / 抽象代数 / 矩阵分析 / 最优化 / 流形等现代数学结构按需激活进算法设计(见 README「三层渐进式披露」)。
175
-
176
- | 思维武器 | 对应数学分支 | 典型方法/概念 |
177
- |---------|-------------|--------------|
178
- | 🧭 数学研究激活器 | 元认知、问题分类、现代数学映射 | 诊断→映射→路由→GPU 筛选、双验收门 |
179
- | 📐 公理化思想 | 数理逻辑、集合论 | 公理体系、形式语言、相容性、独立性 |
180
- | 🧩 抽象化思想 | 代数、范畴论、拓扑学 | 抽象结构、同构、泛性质 |
181
- | 🧠 逻辑演绎 | 数理逻辑、证明论 | 命题逻辑、谓词逻辑、推理规则 |
182
- | 🌉 建模思想 | 应用数学、统计 | 方程建模、量纲分析、验证 |
183
- | ⚖️ 优化思想 | 最优化、运筹学 | 凸优化、KKT、动态规划 |
184
- | 🎲 概率与统计 | 概率论、数理统计 | 随机变量、假设检验、回归分析 |
185
- | 🔄 变换思想 | 分析学、生成函数 | 傅里叶、拉普拉斯、代数变换 |
186
- | ⚛️ 对称与不变性 | 群论、几何 | 群作用、不变量、商空间 |
187
- | 📈 归纳与类比 | 初等数学、数论 | 归纳证明、类比推理、模式识别 |
188
- | 🖥️ 算法与计算思想 | 计算理论、离散数学 | 复杂度、可计算性、算法范式 |
189
- | 📡 信息论思想 | 信息论、统计学习 | 熵、互信息、编码极限 |
190
- | 🎯 博弈论思想 | 数理经济学、机制设计 | 纳什均衡、激励相容、最优策略 |
191
- | 🔗 因果推断思想 | 因果推断、统计学 | DAG、do-演算、干预分析 |
192
- | 🌀 拓扑思想 | 拓扑学、代数拓扑 | 同伦、同调、拓扑不变量 |
193
- | 🧮 离散与组合思想 | 组合数学、图论 | 鸽巢原理、生成函数、枚举 |
194
-
195
- ## 七、如何选择思想武器
196
-
197
- 面对一个问题时,最重要的第一步不是”用力分析”,而是”选对工具”。以下是选择指南:
198
-
199
- ### 快速选择指南
200
-
201
- | 问题核心特征 | 最可能适合的思想武器 |
202
- |-------------|-------------------|
203
- | 多方互动,我的最优取决于他人 | 🎯 博弈论 |
204
- | 不确定性/随机性 | 🎲 概率与统计 |
205
- | 在限制下做最优选择 | ⚖️ 优化 |
206
- | 当前视角下难以处理 | 🔄 变换 |
207
- | 需要提取本质结构 | 🧩 抽象化 |
208
- | 需要严格推理验证 | 🧠 逻辑演绎 |
209
- | 需要从经验中发现规律 | 📈 归纳与类比 |
210
- | 需要构建模型预测 | 🌉 建模 |
211
- | 变化中的不变性 | ⚛️ 对称与不变性 |
212
- | 需要可执行步骤 | 🖥️ 算法与计算 |
213
- | 有限对象的计数/结构 | 🧮 离散与组合 |
214
-
215
- ### 使用激活器
216
-
217
- 如果不确定该用哪个工具,直接使用 `/ask` 命令调用 math-research-activator,它会诊断问题、映射现代数学结构、推荐 1–3 个最合适的思想武器并做 GPU 可行性筛选。工作区出现算法 / kernel / 模型代码时,激活器也会自动介入。
218
-
219
- ### 路径
220
-
221
- v2 已移除「科研 / 生活双路径」,统一为单一研究 / 算法路径:保留完整数学符号与推导,并在用于算法 / 算子设计时强制过 GPU 八维门。
222
-
223
- ## 八、如何使用本概述
224
-
225
- - 先从问题特征出发:判断它是”结构性””动态性””随机性””交互性”还是”可数性”。
226
- - 对照快速选择指南或使用 `/ask` 命令,找到最贴近的思想武器。
227
- - 结合”知识体系层次结构”,判断当前问题更适合基础思路还是前沿方法。
228
- - 若问题横跨多个类别,可同时调用多个思想武器,例如"建模+优化"、"概率+因果"、"抽象+算法"。
229
- - 算法 / 算子设计问题可让激活器把现代数学结构(代数几何 / 李理论 / 拓扑等)迁移进来,并过 GPU 八维门。
230
- - 在学习或阅读文献时,把本概述作为归纳框架,将零散概念归入统一的知识地图。
39
+ 深入查阅时,`../references/books/*.md` 提供 7 本书的蒸馏稿。
@@ -0,0 +1,45 @@
1
+ # Concentration Inequality
2
+
3
+ ## Minimal Definition
4
+ Concentration inequalities bound the **probability that a sum of independent random variables (or a Lipschitz function) deviates from its expectation**. The core intuition: when many independent random factors are superimposed, the outcome is highly concentrated around the mean, with tail probabilities decaying exponentially. They serve as a "quantitative strengthening of the law of large numbers."
5
+
6
+ ## Core Formulas
7
+
8
+ **Markov's Inequality** (weakest, most general):
9
+ $$P(X \geq a) \leq \frac{\mathbb{E}[X]}{a}, \quad X \geq 0$$
10
+
11
+ **Hoeffding's Inequality** (sum of bounded independent variables):
12
+ $$P\left(\left|\frac{1}{n}\sum_{i=1}^n X_i - \mathbb{E}\left[\frac{1}{n}\sum X_i\right]\right| \geq t\right) \leq 2\exp\left(-\frac{2n^2 t^2}{\sum(b_i - a_i)^2}\right)$$
13
+
14
+ **Bernstein's Inequality** (exploits variance information, tighter tails):
15
+ $$P\left(\sum X_i \geq t\right) \leq \exp\left(-\frac{t^2/2}{\sigma^2 + Mt/3}\right)$$
16
+
17
+ **McDiarmid's Inequality** (bounded-difference functions): If $f$ has sensitivity $c_i$ to changes in the $i$-th variable, then
18
+ $$P(|f(X_1,\ldots,X_n) - \mathbb{E}[f]| \geq t) \leq 2\exp\left(-\frac{2t^2}{\sum c_i^2}\right)$$
19
+
20
+ ## Applicable Problems
21
+ - **Generalization bound derivation**: Given training set size $n$, with what probability does the gap between model predictions and true risk fall within $\epsilon$
22
+ - **Stochastic algorithm reliability**: Probabilistic control of the deviation between mini-batch gradients and full-batch gradients
23
+ - **Sampling estimation accuracy**: Quantitative computation of confidence intervals for Monte Carlo estimators
24
+
25
+ ## AI Design Translation
26
+ - **PAC learning bounds / generalization bounds**: Hoeffding/McDiarmid provides probabilistic bounds on the gap between empirical risk and true risk
27
+ - **Variance control for Dropout / Stochastic Depth**: Bernstein's inequality guarantees output concentration under stochastic regularization
28
+ - **Gradient compression / communication efficiency**: Concentration bounds on gradient deviation after quantization or sparsification, ensuring convergence of distributed training
29
+
30
+ ## Engineering Feasibility
31
+ - **D1[v]**: The bounds themselves are scalar formulas with no tensor operations; zero overhead as an analytical tool
32
+ - **D2[v]**: Does not directly participate in GEMM, but can serve as a theoretical basis for hyperparameter selection (batch size, compression ratio)
33
+ - **D3[v]**: Computing the bound itself is $O(1)$ or $O(n)$, very low cost
34
+ - **D5[v]**: Bounds can be computed in fp32; does not enter the training backbone
35
+ - **D8[v]**: Does not enter the computation graph; no fusion overhead
36
+
37
+ ## Risks and Failure Conditions
38
+ - **Independence assumption violated**: In sequential data and autoregressive models, tokens are strongly correlated, and Hoeffding's exponential decay guarantee fails. Martingale versions (Azuma-Hoeffding) or mixing-time corrections are required.
39
+ - **Boundedness assumption violated**: Under heavy-tailed distributions (e.g., power laws), Hoeffding does not apply; Bernstein or truncation tricks are needed. In LLM training, when gradients occasionally take extreme values, naive concentration bounds yield a false sense of security.
40
+
41
+ ## Further References
42
+ - Distillation draft: `references/books/` — no dedicated probability distillation draft at present; this card is based on standard probability theory textbooks
43
+ - Boucheron, Lugosi, Massart. *Concentration Inequalities: A Nonasymptotic Theory of Independence*. Oxford, 2013
44
+ - Vershynin. *High-Dimensional Probability*. Cambridge, 2018 (Chapters 2-3)
45
+ - Related knowledge cards: `probability/entropy.md`, `probability/fisher-information.md`
@@ -0,0 +1,45 @@
1
+ # 浓度不等式 / Concentration Inequality
2
+
3
+ ## 最小定义
4
+ 浓度不等式界定了**独立随机变量之和(或 Lipschitz 函数)偏离其期望的概率上界**。核心直觉:大量独立随机因素叠加后,结果高度集中在期望附近,尾部概率指数衰减。它是"大数定律的定量加强版"。
5
+
6
+ ## 核心公式
7
+
8
+ **Markov 不等式**(最弱、最通用):
9
+ $$P(X \geq a) \leq \frac{\mathbb{E}[X]}{a}, \quad X \geq 0$$
10
+
11
+ **Hoeffding 不等式**(有界独立变量之和):
12
+ $$P\left(\left|\frac{1}{n}\sum_{i=1}^n X_i - \mathbb{E}\left[\frac{1}{n}\sum X_i\right]\right| \geq t\right) \leq 2\exp\left(-\frac{2n^2 t^2}{\sum(b_i - a_i)^2}\right)$$
13
+
14
+ **Bernstein 不等式**(利用方差信息,尾部更紧):
15
+ $$P\left(\sum X_i \geq t\right) \leq \exp\left(-\frac{t^2/2}{\sigma^2 + Mt/3}\right)$$
16
+
17
+ **McDiarmid 不等式**(有界差分函数):若 $f$ 对第 $i$ 个变量的变化敏感度为 $c_i$,则
18
+ $$P(|f(X_1,\ldots,X_n) - \mathbb{E}[f]| \geq t) \leq 2\exp\left(-\frac{2t^2}{\sum c_i^2}\right)$$
19
+
20
+ ## 适用问题
21
+ - **泛化界推导**:给定训练集大小 $n$,模型预测与真实风险之差以多大概率落在 $\epsilon$ 内
22
+ - **随机算法可靠性**:Mini-batch 梯度与全量梯度的偏差概率控制
23
+ - **采样估算精度**:Monte Carlo 估计的置信区间定量计算
24
+
25
+ ## AI 设计翻译
26
+ - **PAC 学习界 / 泛化界**:Hoeffding/McDiarmid → 经验风险与真实风险之差的概率界
27
+ - **Dropout / Stochastic Depth 的方差控制**:Bernstein 不等式给出随机正则化后输出集中度的保证
28
+ - **梯度压缩 / 通信效率**:量化或稀疏化后梯度偏差的浓度界,确保分布式训练收敛
29
+
30
+ ## 工程可行性
31
+ - **D1[v]**:界本身是标量公式,不涉及张量运算,作为分析工具零开销
32
+ - **D2[v]**:不直接参与 GEMM,但可作为超参数选择(batch size、压缩率)的理论依据
33
+ - **D3[v]**:计算界本身 $O(1)$ 或 $O(n)$,极低
34
+ - **D5[v]**:界用 fp32 计算即可,不进入训练主干
35
+ - **D8[v]**:不进入计算图,无融合负担
36
+
37
+ ## 风险与失效条件
38
+ - **独立性假设不成立**:序列数据、自回归模型中 token 间强相关,Hoeffding 的指数衰减保证失效。需用 Martingale 版本(Azuma-Hoeffding)或混合时间修正。
39
+ - **有界性假设违反**:重尾分布(如幂律)下 Hoeffding 不适用,需改用 Bernstein 或截断技巧。在 LLM 训练中梯度偶尔出现极大值时,朴素浓度界给出虚假安全感。
40
+
41
+ ## 深入参考
42
+ - 蒸馏稿:`references/books/` 暂无专用概率蒸馏稿,本卡基于标准概率论教材
43
+ - Boucheron, Lugosi, Massart. *Concentration Inequalities: A Nonasymptotic Theory of Independence*. Oxford, 2013
44
+ - Vershynin. *High-Dimensional Probability*. Cambridge, 2018(第 2-3 章)
45
+ - 关联知识卡:`probability/entropy.md`、`probability/fisher-information.md`
@@ -0,0 +1,47 @@
1
+ # Entropy
2
+
3
+ ## Minimal Definition
4
+ Shannon entropy measures the **total uncertainty** of a random variable — that is, the minimum average number of bits required to describe it. It is the cornerstone of information theory and the unifying quantity underlying maximum likelihood, variational inference, regularization, and other AI methods.
5
+
6
+ ## Core Formulas
7
+
8
+ **Shannon Entropy** (discrete):
9
+ $$H(X) = -\sum_{x} p(x) \log p(x)$$
10
+
11
+ **Differential Entropy** (continuous):
12
+ $$h(X) = -\int p(x) \log p(x)\, dx$$
13
+
14
+ **Joint Entropy and Conditional Entropy**:
15
+ $$H(X, Y) = H(X) + H(Y|X), \quad H(Y|X) = -\sum_{x,y} p(x,y) \log p(y|x)$$
16
+
17
+ **Mutual Information** (the amount of information shared by two variables):
18
+ $$I(X; Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = \sum_{x,y} p(x,y) \log \frac{p(x,y)}{p(x)p(y)}$$
19
+
20
+ **Maximum Entropy Principle**: Among all distributions satisfying the constraints $\mathbb{E}[f_i(X)] = c_i$, the distribution that maximizes $H(X)$ belongs to the exponential family $p(x) \propto \exp\left(\sum \lambda_i f_i(x)\right)$.
21
+
22
+ ## Applicable Problems
23
+ - **Feature selection**: Use mutual information $I(X; Y)$ to select the most informative features with respect to the target variable
24
+ - **Model compression and quantization**: Entropy provides the theoretical lower bound for lossless compression (Shannon's coding theorem)
25
+ - **Regularization design**: Maximum entropy regularization encourages the model to output "uncertain yet fair" distributions, preventing overconfidence
26
+
27
+ ## AI Design Translation
28
+ - **Cross-Entropy Loss**: $H(p, q) = -\sum p(x)\log q(x)$, the default loss function for classification tasks; it is essentially the "coding redundancy" between the true distribution $p$ and the model distribution $q$
29
+ - **KL Divergence** (see `kl-divergence.md`): $D_{KL}(p\|q) = H(p,q) - H(p)$, i.e., the difference between cross-entropy and entropy
30
+ - **Variational Autoencoder (VAE)**: ELBO = reconstruction likelihood $-$ KL regularization term; it fundamentally balances information compression (low $H(Z)$) against reconstruction fidelity
31
+
32
+ ## Engineering Feasibility
33
+ - **D1[v]**: $-\sum p \log p$ is an element-wise operation, perfectly vectorizable
34
+ - **D2[~]**: Entropy itself is not a GEMM, but the gradient computation of the cross-entropy loss involves a softmax-to-matmul chain
35
+ - **D3[v]**: $O(|\mathcal{X}|)$ linear; acceptable for vocabulary-level computation
36
+ - **D5[v]**: $\log$ and exp are stable in bf16; softmax benefits from the log-sum-exp trick
37
+ - **D8[v]**: softmax + cross-entropy is a classic fused operator (FusedSoftmaxCrossEntropy)
38
+
39
+ ## Risks and Failure Conditions
40
+ - **Continuous entropy can be negative**: Differential entropy $h(X)$ is not constrained by $H(X) \geq 0$; directly comparing differential entropies of different dimensions can be misleading. Mutual information or KL divergence (which are non-negative) should be used instead.
41
+ - **Sensitive to vocabulary size**: With large vocabularies (e.g., 128K tokenizers for LLMs), the peak memory usage of softmax + cross-entropy can reach tens of GB, requiring chunked/online softmax or label smoothing for mitigation.
42
+
43
+ ## Further References
44
+ - Distillation draft: `references/books/` — no dedicated information theory distillation draft at present
45
+ - Cover & Thomas. *Elements of Information Theory*, 2nd Edition. Wiley, 2006
46
+ - MacKay. *Information Theory, Inference, and Learning Algorithms*. Cambridge, 2003
47
+ - Related knowledge cards: `probability/kl-divergence.md`, `probability/information-bottleneck.md`
@@ -0,0 +1,47 @@
1
+ # 熵 / Entropy
2
+
3
+ ## 最小定义
4
+ Shannon 熵度量一个随机变量的**不确定性总量**——即描述该变量所需的最少平均比特数。它是信息论的基石,也是最大似然、变分推断、正则化等 AI 方法的底层统一量。
5
+
6
+ ## 核心公式
7
+
8
+ **Shannon 熵**(离散):
9
+ $$H(X) = -\sum_{x} p(x) \log p(x)$$
10
+
11
+ **微分熵**(连续):
12
+ $$h(X) = -\int p(x) \log p(x)\, dx$$
13
+
14
+ **联合熵与条件熵**:
15
+ $$H(X, Y) = H(X) + H(Y|X), \quad H(Y|X) = -\sum_{x,y} p(x,y) \log p(y|x)$$
16
+
17
+ **互信息**(两个变量共享的信息量):
18
+ $$I(X; Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = \sum_{x,y} p(x,y) \log \frac{p(x,y)}{p(x)p(y)}$$
19
+
20
+ **最大熵原理**:在满足约束条件 $\mathbb{E}[f_i(X)] = c_i$ 的所有分布中,使 $H(X)$ 最大的分布为指数族 $p(x) \propto \exp\left(\sum \lambda_i f_i(x)\right)$。
21
+
22
+ ## 适用问题
23
+ - **特征选择**:用互信息 $I(X; Y)$ 筛选对目标变量最有信息量的特征
24
+ - **模型压缩与量化**:熵给出无损压缩的理论下界(Shannon 编码定理)
25
+ - **正则化设计**:最大熵正则化鼓励模型输出"不确定但公平"的分布,防止过自信
26
+
27
+ ## AI 设计翻译
28
+ - **交叉熵损失 Cross-Entropy Loss**:$H(p, q) = -\sum p(x)\log q(x)$,分类任务的默认损失函数,本质是真实分布 $p$ 与模型分布 $q$ 之间的"编码冗余"
29
+ - **KL 散度**(详见 `kl-divergence.md`):$D_{KL}(p\|q) = H(p,q) - H(p)$,即交叉熵与熵之差
30
+ - **变分自编码器 VAE**:ELBO = 重构似然 $-$ KL 正则项,本质是在信息压缩(低 $H(Z)$)与重构保真之间取平衡
31
+
32
+ ## 工程可行性
33
+ - **D1[v]**:$-\sum p \log p$ 是逐元素运算,完美向量化
34
+ - **D2[~]**:熵本身不是 GEMM,但交叉熵损失的梯度计算涉及 softmax → matmul 链
35
+ - **D3[v]**:$O(|\mathcal{X}|)$ 线性,vocab 级计算可接受
36
+ - **D5[v]**:$\log$ 和 exp 在 bf16 下稳定,softmax 有 log-sum-exp 技巧
37
+ - **D8[v]**:softmax + cross-entropy 是经典融合算子(FusedSoftmaxCrossEntropy)
38
+
39
+ ## 风险与失效条件
40
+ - **连续熵可为负**:微分熵 $h(X)$ 不受 $H(X) \geq 0$ 约束,直接比较不同量纲的微分熵可产生误导。应改用互信息或 KL 散度(非负)。
41
+ - **对 vocab 大小敏感**:大 vocab(如 LLM 的 128K tokenizer)下 softmax + 交叉熵的显存峰值可达数十 GB,需 chunked/online softmax 或 label smoothing 缓解。
42
+
43
+ ## 深入参考
44
+ - 蒸馏稿:`references/books/` 暂无专用信息论蒸馏稿
45
+ - Cover & Thomas. *Elements of Information Theory*, 2nd Edition. Wiley, 2006
46
+ - MacKay. *Information Theory, Inference, and Learning Algorithms*. Cambridge, 2003
47
+ - 关联知识卡:`probability/kl-divergence.md`、`probability/information-bottleneck.md`
@@ -0,0 +1,48 @@
1
+ # Fisher Information
2
+
3
+ ## Minimal Definition
4
+ Fisher information measures the **sensitivity of a parametric family of probability distributions to its parameters** — that is, how much information observed data provides about the parameter $\theta$. It defines a natural Riemannian metric on the statistical manifold (the Fisher information matrix = the metric tensor), and is the cornerstone of information geometry.
5
+
6
+ ## Core Formulas
7
+
8
+ **Fisher Information (scalar parameter)**:
9
+ $$\mathcal{I}(\theta) = \mathbb{E}_\theta\left[\left(\frac{\partial}{\partial \theta} \log p(X|\theta)\right)^2\right] = -\mathbb{E}_\theta\left[\frac{\partial^2}{\partial \theta^2} \log p(X|\theta)\right]$$
10
+
11
+ **Fisher Information Matrix (vector parameter)**:
12
+ $$[\mathcal{I}(\theta)]_{ij} = \mathbb{E}_\theta\left[\frac{\partial \log p(X|\theta)}{\partial \theta_i} \frac{\partial \log p(X|\theta)}{\partial \theta_j}\right] = -\mathbb{E}_\theta\left[\frac{\partial^2 \log p(X|\theta)}{\partial \theta_i \partial \theta_j}\right]$$
13
+
14
+ **Cramér-Rao Lower Bound** (variance lower bound for unbiased estimators):
15
+ $$\text{Var}(\hat{\theta}) \geq \frac{1}{\mathcal{I}(\theta)}$$
16
+
17
+ **Relationship to KL Divergence** (Fisher information = second-order expansion coefficient of KL divergence):
18
+ $$D_{KL}(p_\theta \| p_{\theta + d\theta}) \approx \frac{1}{2} d\theta^T \mathcal{I}(\theta) d\theta$$
19
+
20
+ ## Applicable Problems
21
+ - **Parameter estimation efficiency assessment**: The Cramér-Rao bound gives the theoretical limit on the precision of any unbiased estimator
22
+ - **Natural gradient descent**: Use $\mathcal{I}(\theta)^{-1} \nabla_\theta \mathcal{L}$ instead of the naive gradient, updating along geodesic directions on the statistical manifold (see `information-geometry/natural-gradient.md`)
23
+ - **Experimental design / active learning**: Select data points that maximize Fisher information, maximizing the information gain for parameter learning
24
+
25
+ ## AI Design Translation
26
+ - **Natural Gradient / K-FAC Optimizer**: Use a Kronecker approximation of the Fisher information matrix $\mathcal{I} \approx A \otimes B$ in place of the Hessian, enabling approximate second-order optimization
27
+ - **Elastic Weight Consolidation (EWC)**: $\mathcal{L}_{\text{EWC}} = \mathcal{L}_{\text{new}} + \frac{\lambda}{2} \sum_i \mathcal{I}_i (\theta_i - \theta_i^*)^2$, using Fisher information to measure the importance of each parameter to previous tasks, preventing catastrophic forgetting
28
+ - **Sensitivity analysis for pretraining-finetuning**: Parameter directions with high Fisher information = parameters sensitive to data; these should be handled more carefully during fine-tuning
29
+
30
+ ## Engineering Feasibility
31
+ - **D1[~]**: The full FIM is a $d \times d$ matrix ($d$ = number of parameters); direct materialization is infeasible (LLM parameter counts $10^{10}+$). Approximations are required.
32
+ - **D2[v]**: K-FAC uses Kronecker factors $A \otimes B$; $A$ and $B$ can each be computed and inverted using GEMM
33
+ - **D3[~]**: Exact FIM computation is $O(nd^2)$; K-FAC reduces this to $O(d)$ scale but requires per-layer maintenance
34
+ - **D4[~]**: K-FAC's Kronecker factors require additional memory, though significantly compressed compared to the full FIM
35
+ - **D5[v]**: FIM estimation can use fp32; fp64 is not required
36
+ - **D6[v]**: K-FAC's Kronecker factors naturally decompose by layer, enabling parallel computation
37
+ - **D8[v]**: The EWC penalty term is element-wise and can be fused into the parameter update kernel
38
+
39
+ ## Risks and Failure Conditions
40
+ - **Full FIM is intractable**: For LLM-scale parameter counts ($d > 10^9$), even K-FAC's Kronecker approximation may be too costly. In practice, diagonal Fisher ($O(d)$) or low-rank approximations are commonly used.
41
+ - **Empirical Fisher ≠ True Fisher**: Replacing the expectation with a training set average introduces significant estimation bias when the sample size is insufficient, potentially causing the natural gradient direction to point in the wrong direction. This should be paired with learning rate warmup.
42
+
43
+ ## Further References
44
+ - Distillation draft: `references/books/` — no dedicated information geometry distillation draft at present
45
+ - Amari. *Information Geometry and Its Applications*. Springer, 2016
46
+ - Amari & Nagaoka. *Methods of Information Geometry*. AMS, 2000
47
+ - Martens. "Optimizing Neural Networks with Kronecker-Factored Approximate Curvature." *ICML*, 2015
48
+ - Related knowledge cards: `information-geometry/natural-gradient.md`, `information-geometry/fisher-metric.md`
@@ -0,0 +1,48 @@
1
+ # Fisher 信息 / Fisher Information
2
+
3
+ ## 最小定义
4
+ Fisher 信息度量**概率分布族对参数的敏感度**——即观测数据对参数 $\theta$ 提供了多少信息。它在统计流形上定义了一个自然的黎曼度量(Fisher 信息矩阵 = 度量张量),是信息几何的基石。
5
+
6
+ ## 核心公式
7
+
8
+ **Fisher 信息(标量参数)**:
9
+ $$\mathcal{I}(\theta) = \mathbb{E}_\theta\left[\left(\frac{\partial}{\partial \theta} \log p(X|\theta)\right)^2\right] = -\mathbb{E}_\theta\left[\frac{\partial^2}{\partial \theta^2} \log p(X|\theta)\right]$$
10
+
11
+ **Fisher 信息矩阵(向量参数)**:
12
+ $$[\mathcal{I}(\theta)]_{ij} = \mathbb{E}_\theta\left[\frac{\partial \log p(X|\theta)}{\partial \theta_i} \frac{\partial \log p(X|\theta)}{\partial \theta_j}\right] = -\mathbb{E}_\theta\left[\frac{\partial^2 \log p(X|\theta)}{\partial \theta_i \partial \theta_j}\right]$$
13
+
14
+ **Cramér-Rao 下界**(无偏估计的方差下界):
15
+ $$\text{Var}(\hat{\theta}) \geq \frac{1}{\mathcal{I}(\theta)}$$
16
+
17
+ **与 KL 散度的关系**(Fisher 信息 = KL 散度的二阶展开系数):
18
+ $$D_{KL}(p_\theta \| p_{\theta + d\theta}) \approx \frac{1}{2} d\theta^T \mathcal{I}(\theta) d\theta$$
19
+
20
+ ## 适用问题
21
+ - **参数估计效率评估**:Cramér-Rao 界给出任何无偏估计器精度的理论极限
22
+ - **自然梯度下降**:用 $\mathcal{I}(\theta)^{-1} \nabla_\theta \mathcal{L}$ 替代朴素梯度,沿统计流形的测地线方向更新(详见 `information-geometry/natural-gradient.md`)
23
+ - **实验设计 / 主动学习**:选择使 Fisher 信息最大的数据点采集,最大化参数学习的信息增益
24
+
25
+ ## AI 设计翻译
26
+ - **自然梯度 / K-FAC 优化器**:用 Fisher 信息矩阵的 Kronecker 近似 $\mathcal{I} \approx A \otimes B$ 替代 Hessian,实现近似二阶优化
27
+ - **弹性权重巩固 EWC**:$\mathcal{L}_{\text{EWC}} = \mathcal{L}_{\text{new}} + \frac{\lambda}{2} \sum_i \mathcal{I}_i (\theta_i - \theta_i^*)^2$,用 Fisher 信息衡量每个参数对旧任务的重要性,防止灾难性遗忘
28
+ - **预训练-微调的敏感度分析**:Fisher 信息大的参数方向 = 对数据敏感的参数,微调时应更谨慎
29
+
30
+ ## 工程可行性
31
+ - **D1[~]**:完整 FIM 是 $d \times d$ 矩阵($d$ = 参数量),直接物化不可行(LLM 参数量 $10^{10}+$)。必须用近似。
32
+ - **D2[v]**:K-FAC 用 Kronecker 因子 $A \otimes B$,$A$ 和 $B$ 各自可用 GEMM 计算和求逆
33
+ - **D3[~]**:精确 FIM 计算 $O(nd^2)$,K-FAC 降至 $O(d)$ 量级但需逐层维护
34
+ - **D4[~]**:K-FAC 的 Kronecker 因子需额外显存,但相比完整 FIM 已大幅压缩
35
+ - **D5[v]**:FIM 估计用 fp32 即可,不需 fp64
36
+ - **D6[v]**:K-FAC 的 Kronecker 因子天然按层分解,可并行计算
37
+ - **D8[v]**:EWC 惩罚项为逐元素运算,可融入参数更新 kernel
38
+
39
+ ## 风险与失效条件
40
+ - **完整 FIM 不可计算**:对于 LLM 级别的参数规模($d > 10^9$),即使 K-FAC 的 Kronecker 近似也可能代价过高。实践中常用对角 Fisher($O(d)$)或低秩近似。
41
+ - **经验 Fisher ≠ 真实 Fisher**:用训练集均值替代期望,在样本量不足时估计偏差大,自然梯度方向可能指向错误方向。需与 learning rate warmup 配合。
42
+
43
+ ## 深入参考
44
+ - 蒸馏稿:`references/books/` 暂无专用信息几何蒸馏稿
45
+ - Amari. *Information Geometry and Its Applications*. Springer, 2016
46
+ - Amari & Nagaoka. *Methods of Information Geometry*. AMS, 2000
47
+ - Martens. "Optimizing Neural Networks with Kronecker-Factored Approximate Curvature." *ICML*, 2015
48
+ - 关联知识卡:`information-geometry/natural-gradient.md`、`information-geometry/fisher-metric.md`
@@ -0,0 +1,49 @@
1
+ # Information Bottleneck
2
+
3
+ ## Minimal Definition
4
+ The Information Bottleneck (IB) is a theoretical framework for representation learning: given input $X$ and target $Y$, find a compressed representation $Z$ that **discards as much information in $X$ that is irrelevant to $Y$ as possible, while retaining information useful for predicting $Y$**. It recasts the learning problem as an information-theoretic constrained optimization.
5
+
6
+ ## Core Formulas
7
+
8
+ **IB Objective**:
9
+ $$\min_{p(z|x)} \; I(X; Z) - \beta \cdot I(Z; Y)$$
10
+
11
+ where $\beta > 0$ is a Lagrange multiplier controlling the **compression-prediction** trade-off:
12
+ - $I(X; Z)$: the amount of information about input $X$ retained in representation $Z$ (smaller = stronger compression)
13
+ - $I(Z; Y)$: the amount of information about target $Y$ contained in representation $Z$ (larger = better prediction)
14
+
15
+ **Variational Lower Bound** (practically computable version):
16
+ $$\mathcal{L}_{VIB} = \mathbb{E}_{p(x,y)}[-\log q_\phi(y|z)] + D_{KL}(p_\theta(z|x) \| r(z))$$
17
+
18
+ where $q_\phi(y|z)$ is the classifier/decoder, $r(z)$ is the prior distribution (typically $\mathcal{N}(0,I)$), and $p_\theta(z|x)$ is the encoder.
19
+
20
+ **IB Curve**: In the $(I(X;Z), I(Z;Y))$ plane, the Pareto-optimal solutions form a concave curve, with inflection points corresponding to optimal compression rates.
21
+
22
+ ## Applicable Problems
23
+ - **Understanding the learning dynamics of deep networks**: Information Plane analysis — tracking the trajectory of $(I(X;Z_l), I(Z_l;Y))$ for each layer during training
24
+ - **Theoretical guidance for representation learning**: Why regularization (dropout, weight decay) works — they implicitly compress redundant information
25
+ - **Feature selection and dimensionality reduction**: Finding Pareto-optimal points between compression rate and predictive performance
26
+
27
+ ## AI Design Translation
28
+ - **VIB Layer (Variational Information Bottleneck)**: Encoder $p_\theta(z|x)$ + KL regularization + decoder $q_\phi(y|z)$; structurally identical to a VAE but with different objective semantics (VAE reconstructs $X$, VIB predicts $Y$)
29
+ - **Unified perspective on $\beta$-VAE**: The $\beta$-VAE objective is formally identical to the VIB objective, where $\beta$ is the IB Lagrange multiplier
30
+ - **Information-theoretic interpretation of attention sparsification / routing**: Sparse Attention and MoE routing can be understood as implicit information bottlenecks — selectively allowing "useful" tokens to pass while discarding noise
31
+
32
+ ## Engineering Feasibility
33
+ - **D1[v]**: The VIB encoder/decoder are standard networks; $D_{KL}$ is computed element-wise
34
+ - **D2[v]**: The main computation is a standard feedforward network + GEMM
35
+ - **D3[v]**: Only adds $O(d)$ computation for the KL term compared to the original network
36
+ - **D4[~]**: Requires additional parameters for the prior distribution $r(z)$ and intermediate quantities for KL computation
37
+ - **D5[v]**: Reparameterization trick + analytical KL solution are stable in bf16
38
+ - **D8[v]**: No conflict with the standard training pipeline; normal fusion applies
39
+
40
+ ## Risks and Failure Conditions
41
+ - **Accurate estimation of $I(X;Z)$ is difficult**: Mutual information estimation between high-dimensional continuous variables is itself an open problem (estimators such as MINE and NWJ have high variance). In practice, the VIB variational lower bound is used as a workaround, but the bound may be loose.
42
+ - **Sensitive to $\beta$ tuning**: If $\beta$ is too large, excessive compression leads to underfitting; if too small, the objective degenerates to standard ERM (no compression effect). Information plane analysis or adaptive $\beta$ scheduling is required.
43
+
44
+ ## Further References
45
+ - Distillation draft: `references/books/` — no dedicated IB distillation draft at present
46
+ - Tishby, Pereira, Bialek. "The Information Bottleneck Method." *arXiv:physics/0004057*, 2000
47
+ - Alemi, Poole, Fischer, Dillon, Suresh, Murphy. "Deep Variational Information Bottleneck." *ICLR*, 2017
48
+ - Shwartz-Ziv, Tishby. "Opening the Black Box of Deep Neural Networks via Information." *arXiv:1703.00810*, 2017
49
+ - Related knowledge cards: `probability/entropy.md`, `probability/kl-divergence.md`