math-skill 3.0.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 (118) hide show
  1. package/README.en-US.md +9 -1
  2. package/README.md +9 -1
  3. package/agents/math-critic.en.md +27 -25
  4. package/agents/math-critic.md +27 -27
  5. package/commands/ask.en.md +10 -0
  6. package/commands/ask.md +1 -1
  7. package/design-patterns/attention/equivariant-attention.en.md +9 -9
  8. package/design-patterns/attention/equivariant-attention.md +9 -9
  9. package/design-patterns/attention/geometry-aware-attention.en.md +9 -9
  10. package/design-patterns/attention/geometry-aware-attention.md +9 -9
  11. package/design-patterns/attention/information-bottleneck-attention.en.md +9 -9
  12. package/design-patterns/attention/information-bottleneck-attention.md +9 -9
  13. package/design-patterns/attention/projection-attention.en.md +9 -9
  14. package/design-patterns/attention/projection-attention.md +9 -9
  15. package/design-patterns/attention/spectral-attention.en.md +9 -9
  16. package/design-patterns/attention/spectral-attention.md +9 -9
  17. package/design-patterns/compression/leverage-score-selection.en.md +1 -1
  18. package/design-patterns/compression/leverage-score-selection.md +1 -1
  19. package/design-patterns/compression/low-rank-kv-cache.en.md +1 -1
  20. package/design-patterns/compression/low-rank-kv-cache.md +1 -1
  21. package/design-patterns/compression/spectral-token-pruning.en.md +1 -1
  22. package/design-patterns/compression/spectral-token-pruning.md +1 -1
  23. package/design-patterns/compression/topology-preserving-compression.en.md +1 -1
  24. package/design-patterns/compression/topology-preserving-compression.md +1 -1
  25. package/design-patterns/loss/constraint-penalty.en.md +1 -1
  26. package/design-patterns/loss/constraint-penalty.md +1 -1
  27. package/design-patterns/loss/contrastive-loss.en.md +1 -1
  28. package/design-patterns/loss/contrastive-loss.md +1 -1
  29. package/design-patterns/loss/information-bottleneck-loss.en.md +1 -1
  30. package/design-patterns/loss/information-bottleneck-loss.md +1 -1
  31. package/design-patterns/loss/orthogonality-loss.en.md +1 -1
  32. package/design-patterns/loss/orthogonality-loss.md +1 -1
  33. package/design-patterns/loss/variational-loss.en.md +1 -1
  34. package/design-patterns/loss/variational-loss.md +1 -1
  35. package/design-patterns/representation/equivariant-split.en.md +1 -1
  36. package/design-patterns/representation/equivariant-split.md +1 -1
  37. package/design-patterns/representation/manifold-representation.en.md +1 -1
  38. package/design-patterns/representation/manifold-representation.md +1 -1
  39. package/design-patterns/representation/shared-private-decomposition.en.md +1 -1
  40. package/design-patterns/representation/shared-private-decomposition.md +1 -1
  41. package/design-patterns/representation/subspace-alignment.en.md +1 -1
  42. package/design-patterns/representation/subspace-alignment.md +1 -1
  43. package/design-patterns/routing/graph-routing.en.md +1 -1
  44. package/design-patterns/routing/graph-routing.md +1 -1
  45. package/design-patterns/routing/moe-routing.en.md +1 -1
  46. package/design-patterns/routing/moe-routing.md +1 -1
  47. package/design-patterns/routing/optimal-transport-routing.en.md +1 -1
  48. package/design-patterns/routing/optimal-transport-routing.md +1 -1
  49. package/design-patterns/routing/spectral-clustering-routing.en.md +1 -1
  50. package/design-patterns/routing/spectral-clustering-routing.md +1 -1
  51. package/knowledge-base/differential-geometry/metric-tensor.md +1 -1
  52. package/knowledge-base/information-geometry/fisher-metric.en.md +8 -8
  53. package/knowledge-base/information-geometry/fisher-metric.md +8 -8
  54. package/knowledge-base/information-geometry/natural-gradient.en.md +7 -7
  55. package/knowledge-base/information-geometry/natural-gradient.md +7 -7
  56. package/knowledge-base/overview.en.md +2 -2
  57. package/knowledge-base/overview.md +2 -2
  58. package/knowledge-base/probability/concentration-inequality.en.md +5 -5
  59. package/knowledge-base/probability/concentration-inequality.md +5 -5
  60. package/knowledge-base/probability/entropy.en.md +5 -5
  61. package/knowledge-base/probability/entropy.md +5 -5
  62. package/knowledge-base/probability/fisher-information.en.md +7 -7
  63. package/knowledge-base/probability/fisher-information.md +7 -7
  64. package/knowledge-base/probability/information-bottleneck.en.md +6 -6
  65. package/knowledge-base/probability/information-bottleneck.md +6 -6
  66. package/knowledge-base/probability/kl-divergence.en.md +6 -6
  67. package/knowledge-base/probability/kl-divergence.md +6 -6
  68. package/lenses/algorithmic.en.md +1 -1
  69. package/lenses/algorithmic.md +1 -1
  70. package/lenses/axiomatization.en.md +1 -1
  71. package/lenses/axiomatization.md +1 -1
  72. package/lenses/categorical.en.md +1 -1
  73. package/lenses/categorical.md +1 -1
  74. package/lenses/causal.en.md +1 -1
  75. package/lenses/causal.md +1 -1
  76. package/lenses/duality.en.md +1 -1
  77. package/lenses/duality.md +1 -1
  78. package/lenses/game.en.md +2 -2
  79. package/lenses/game.md +2 -2
  80. package/lenses/geometric.en.md +1 -1
  81. package/lenses/geometric.md +1 -1
  82. package/lenses/local-to-global.en.md +1 -1
  83. package/lenses/local-to-global.md +1 -1
  84. package/lenses/perturbation.en.md +1 -1
  85. package/lenses/perturbation.md +1 -1
  86. package/lenses/probabilistic.en.md +1 -1
  87. package/lenses/probabilistic.md +1 -1
  88. package/lenses/projection.en.md +1 -1
  89. package/lenses/projection.md +1 -1
  90. package/lenses/spectral.en.md +1 -1
  91. package/lenses/spectral.md +1 -1
  92. package/lenses/symmetry.en.md +1 -1
  93. package/lenses/symmetry.md +1 -1
  94. package/lenses/topological.en.md +1 -1
  95. package/lenses/topological.md +1 -1
  96. package/lenses/variational.en.md +1 -1
  97. package/lenses/variational.md +1 -1
  98. package/package.json +1 -1
  99. package/references/agentic-workflow.en.md +1 -1
  100. package/references/agentic-workflow.md +1 -1
  101. package/references/books/abstract-algebra.en.md +124 -0
  102. package/references/books/abstract-algebra.md +17 -17
  103. package/references/books/algebraic-geometry-rising-sea.en.md +171 -0
  104. package/references/books/algebraic-geometry-rising-sea.md +7 -7
  105. package/references/books/differential-geometry.en.md +140 -0
  106. package/references/books/differential-geometry.md +18 -18
  107. package/references/books/matrix-analysis.en.md +146 -0
  108. package/references/books/matrix-analysis.md +8 -8
  109. package/references/books/micro-lie-theory.en.md +116 -0
  110. package/references/books/micro-lie-theory.md +16 -16
  111. package/references/books/optimization-ml.en.md +163 -0
  112. package/references/books/optimization-ml.md +6 -7
  113. package/references/books/smooth-manifolds.en.md +105 -0
  114. package/references/books/smooth-manifolds.md +12 -12
  115. package/references/gpu-friendly-math.en.md +15 -2
  116. package/references/gpu-friendly-math.md +15 -2
  117. package/skills/math-research-activator/SKILL.en.md +27 -1
  118. package/skills/math-research-activator/SKILL.md +26 -3
@@ -28,11 +28,11 @@ $$P(|f(X_1,\ldots,X_n) - \mathbb{E}[f]| \geq t) \leq 2\exp\left(-\frac{2t^2}{\su
28
28
  - **Gradient compression / communication efficiency**: Concentration bounds on gradient deviation after quantization or sparsification, ensuring convergence of distributed training
29
29
 
30
30
  ## Engineering Feasibility
31
- - **Dimension 1 Tensorization ✅**: The bounds themselves are scalar formulas with no tensor operations; zero overhead as an analytical tool
32
- - **Dimension 2 GEMM-mappability ✅**: Does not directly participate in GEMM, but can serve as a theoretical basis for hyperparameter selection (batch size, compression ratio)
33
- - **Dimension 3 Complexity ✅**: Computing the bound itself is $O(1)$ or $O(n)$, very low cost
34
- - **Dimension 5 Low Precision ✅**: Bounds can be computed in fp32; does not enter the training backbone
35
- - **Dimension 8 Operator Fusion ✅**: Does not enter the computation graph; no fusion overhead
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
36
 
37
37
  ## Risks and Failure Conditions
38
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.
@@ -28,11 +28,11 @@ $$P(|f(X_1,\ldots,X_n) - \mathbb{E}[f]| \geq t) \leq 2\exp\left(-\frac{2t^2}{\su
28
28
  - **梯度压缩 / 通信效率**:量化或稀疏化后梯度偏差的浓度界,确保分布式训练收敛
29
29
 
30
30
  ## 工程可行性
31
- - **维度 1 张量化 ✅**:界本身是标量公式,不涉及张量运算,作为分析工具零开销
32
- - **维度 2 GEMM 可映射 ✅**:不直接参与 GEMM,但可作为超参数选择(batch size、压缩率)的理论依据
33
- - **维度 3 复杂度 ✅**:计算界本身 $O(1)$ 或 $O(n)$,极低
34
- - **维度 5 低精度 ✅**:界用 fp32 计算即可,不进入训练主干
35
- - **维度 8 算子融合 ✅**:不进入计算图,无融合负担
31
+ - **D1[v]**:界本身是标量公式,不涉及张量运算,作为分析工具零开销
32
+ - **D2[v]**:不直接参与 GEMM,但可作为超参数选择(batch size、压缩率)的理论依据
33
+ - **D3[v]**:计算界本身 $O(1)$ 或 $O(n)$,极低
34
+ - **D5[v]**:界用 fp32 计算即可,不进入训练主干
35
+ - **D8[v]**:不进入计算图,无融合负担
36
36
 
37
37
  ## 风险与失效条件
38
38
  - **独立性假设不成立**:序列数据、自回归模型中 token 间强相关,Hoeffding 的指数衰减保证失效。需用 Martingale 版本(Azuma-Hoeffding)或混合时间修正。
@@ -30,11 +30,11 @@ $$I(X; Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = \sum_{x,y} p(x,y) \log \frac{p(x,y)}
30
30
  - **Variational Autoencoder (VAE)**: ELBO = reconstruction likelihood $-$ KL regularization term; it fundamentally balances information compression (low $H(Z)$) against reconstruction fidelity
31
31
 
32
32
  ## Engineering Feasibility
33
- - **Dimension 1 Tensorization ✅**: $-\sum p \log p$ is an element-wise operation, perfectly vectorizable
34
- - **Dimension 2 GEMM-mappability ⚠️**: Entropy itself is not a GEMM, but the gradient computation of the cross-entropy loss involves a softmax-to-matmul chain
35
- - **Dimension 3 Complexity ✅**: $O(|\mathcal{X}|)$ linear; acceptable for vocabulary-level computation
36
- - **Dimension 5 Low Precision ✅**: $\log$ and exp are stable in bf16; softmax benefits from the log-sum-exp trick
37
- - **Dimension 8 Operator Fusion ✅**: softmax + cross-entropy is a classic fused operator (FusedSoftmaxCrossEntropy)
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
38
 
39
39
  ## Risks and Failure Conditions
40
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.
@@ -30,11 +30,11 @@ $$I(X; Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = \sum_{x,y} p(x,y) \log \frac{p(x,y)}
30
30
  - **变分自编码器 VAE**:ELBO = 重构似然 $-$ KL 正则项,本质是在信息压缩(低 $H(Z)$)与重构保真之间取平衡
31
31
 
32
32
  ## 工程可行性
33
- - **维度 1 张量化 ✅**:$-\sum p \log p$ 是逐元素运算,完美向量化
34
- - **维度 2 GEMM 可映射 ⚠️**:熵本身不是 GEMM,但交叉熵损失的梯度计算涉及 softmax → matmul 链
35
- - **维度 3 复杂度 ✅**:$O(|\mathcal{X}|)$ 线性,vocab 级计算可接受
36
- - **维度 5 低精度 ✅**:$\log$ 和 exp 在 bf16 下稳定,softmax 有 log-sum-exp 技巧
37
- - **维度 8 算子融合 ✅**:softmax + cross-entropy 是经典融合算子(FusedSoftmaxCrossEntropy)
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
38
 
39
39
  ## 风险与失效条件
40
40
  - **连续熵可为负**:微分熵 $h(X)$ 不受 $H(X) \geq 0$ 约束,直接比较不同量纲的微分熵可产生误导。应改用互信息或 KL 散度(非负)。
@@ -28,13 +28,13 @@ $$D_{KL}(p_\theta \| p_{\theta + d\theta}) \approx \frac{1}{2} d\theta^T \mathca
28
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
29
 
30
30
  ## Engineering Feasibility
31
- - **Dimension 1 Tensorization ⚠️**: 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
- - **Dimension 2 GEMM-mappability ✅**: K-FAC uses Kronecker factors $A \otimes B$; $A$ and $B$ can each be computed and inverted using GEMM
33
- - **Dimension 3 Complexity ⚠️**: Exact FIM computation is $O(nd^2)$; K-FAC reduces this to $O(d)$ scale but requires per-layer maintenance
34
- - **Dimension 4 Memory ⚠️**: K-FAC's Kronecker factors require additional memory, though significantly compressed compared to the full FIM
35
- - **Dimension 5 Low Precision ✅**: FIM estimation can use fp32; fp64 is not required
36
- - **Dimension 6 Parallelism ✅**: K-FAC's Kronecker factors naturally decompose by layer, enabling parallel computation
37
- - **Dimension 8 Operator Fusion ✅**: The EWC penalty term is element-wise and can be fused into the parameter update kernel
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
38
 
39
39
  ## Risks and Failure Conditions
40
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.
@@ -28,13 +28,13 @@ $$D_{KL}(p_\theta \| p_{\theta + d\theta}) \approx \frac{1}{2} d\theta^T \mathca
28
28
  - **预训练-微调的敏感度分析**:Fisher 信息大的参数方向 = 对数据敏感的参数,微调时应更谨慎
29
29
 
30
30
  ## 工程可行性
31
- - **维度 1 张量化 ⚠️**:完整 FIM 是 $d \times d$ 矩阵($d$ = 参数量),直接物化不可行(LLM 参数量 $10^{10}+$)。必须用近似。
32
- - **维度 2 GEMM 可映射 ✅**:K-FAC 用 Kronecker 因子 $A \otimes B$,$A$ 和 $B$ 各自可用 GEMM 计算和求逆
33
- - **维度 3 复杂度 ⚠️**:精确 FIM 计算 $O(nd^2)$,K-FAC 降至 $O(d)$ 量级但需逐层维护
34
- - **维度 4 显存 ⚠️**:K-FAC 的 Kronecker 因子需额外显存,但相比完整 FIM 已大幅压缩
35
- - **维度 5 低精度 ✅**:FIM 估计用 fp32 即可,不需 fp64
36
- - **维度 6 并行 ✅**:K-FAC 的 Kronecker 因子天然按层分解,可并行计算
37
- - **维度 8 算子融合 ✅**:EWC 惩罚项为逐元素运算,可融入参数更新 kernel
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
38
 
39
39
  ## 风险与失效条件
40
40
  - **完整 FIM 不可计算**:对于 LLM 级别的参数规模($d > 10^9$),即使 K-FAC 的 Kronecker 近似也可能代价过高。实践中常用对角 Fisher($O(d)$)或低秩近似。
@@ -30,12 +30,12 @@ where $q_\phi(y|z)$ is the classifier/decoder, $r(z)$ is the prior distribution
30
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
31
 
32
32
  ## Engineering Feasibility
33
- - **Dimension 1 Tensorization ✅**: The VIB encoder/decoder are standard networks; $D_{KL}$ is computed element-wise
34
- - **Dimension 2 GEMM-mappability ✅**: The main computation is a standard feedforward network + GEMM
35
- - **Dimension 3 Complexity ✅**: Only adds $O(d)$ computation for the KL term compared to the original network
36
- - **Dimension 4 Memory ⚠️**: Requires additional parameters for the prior distribution $r(z)$ and intermediate quantities for KL computation
37
- - **Dimension 5 Low Precision ✅**: Reparameterization trick + analytical KL solution are stable in bf16
38
- - **Dimension 8 Operator Fusion ✅**: No conflict with the standard training pipeline; normal fusion applies
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
39
 
40
40
  ## Risks and Failure Conditions
41
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.
@@ -30,12 +30,12 @@ $$\mathcal{L}_{VIB} = \mathbb{E}_{p(x,y)}[-\log q_\phi(y|z)] + D_{KL}(p_\theta(z
30
30
  - **注意力稀疏化 / 路由的信息论解释**:Sparse Attention 和 MoE 路由可理解为隐式信息瓶颈——选择性地让"有用" token 通过,丢弃噪声
31
31
 
32
32
  ## 工程可行性
33
- - **维度 1 张量化 ✅**:VIB 的编码器/解码器均为标准网络,$D_{KL}$ 为逐元素计算
34
- - **维度 2 GEMM 可映射 ✅**:主体计算为标准前向网络 + GEMM
35
- - **维度 3 复杂度 ✅**:相比原始网络仅增加 KL 项的 $O(d)$ 计算
36
- - **维度 4 显存 ⚠️**:需要额外维护先验分布 $r(z)$ 的参数和 KL 计算中间量
37
- - **维度 5 低精度 ✅**:重参数化技巧 + KL 解析解在 bf16 下稳定
38
- - **维度 8 算子融合 ✅**:与标准训练流程无冲突,可正常融合
33
+ - **D1[v]**:VIB 的编码器/解码器均为标准网络,$D_{KL}$ 为逐元素计算
34
+ - **D2[v]**:主体计算为标准前向网络 + GEMM
35
+ - **D3[v]**:相比原始网络仅增加 KL 项的 $O(d)$ 计算
36
+ - **D4[~]**:需要额外维护先验分布 $r(z)$ 的参数和 KL 计算中间量
37
+ - **D5[v]**:重参数化技巧 + KL 解析解在 bf16 下稳定
38
+ - **D8[v]**:与标准训练流程无冲突,可正常融合
39
39
 
40
40
  ## 风险与失效条件
41
41
  - **$I(X;Z)$ 的精确估计困难**:高维连续变量间的互信息估计本身是开放问题(MINE、NWJ 等估计器方差大),实际用 VIB 变分下界绕过,但下界可能很松。
@@ -33,12 +33,12 @@ $$D_{KL}(p \| q) = H(p, q) - H(p)$$
33
33
  - **PPO / RLHF**: $D_{KL}(\pi_\theta \| \pi_{\text{ref}})$ serves as a penalty term for the policy deviating from the reference policy
34
34
 
35
35
  ## Engineering Feasibility
36
- - **Dimension 1 Tensorization ✅**: Element-wise $p \log(p/q)$ is fully vectorizable
37
- - **Dimension 2 GEMM-mappability ⚠️**: KL itself is not a GEMM, but its inputs (logits) come from GEMM layers
38
- - **Dimension 3 Complexity ✅**: $O(|\mathcal{X}|)$ linear
39
- - **Dimension 4 Memory ⚠️**: For large vocabularies, both $p$ and $q$ probability vectors must be held simultaneously; chunked computation is possible
40
- - **Dimension 5 Low Precision ✅**: Log-softmax differences are stable in bf16; note that $\log q$ diverges as $q \to 0$, requiring clamping
41
- - **Dimension 8 Operator Fusion ✅**: Can be fused with softmax into FusedKLDivLoss
36
+ - **D1[v]**: Element-wise $p \log(p/q)$ is fully vectorizable
37
+ - **D2[~]**: KL itself is not a GEMM, but its inputs (logits) come from GEMM layers
38
+ - **D3[v]**: $O(|\mathcal{X}|)$ linear
39
+ - **D4[~]**: For large vocabularies, both $p$ and $q$ probability vectors must be held simultaneously; chunked computation is possible
40
+ - **D5[v]**: Log-softmax differences are stable in bf16; note that $\log q$ diverges as $q \to 0$, requiring clamping
41
+ - **D8[v]**: Can be fused with softmax into FusedKLDivLoss
42
42
 
43
43
  ## Risks and Failure Conditions
44
44
  - **KL diverges to infinity when $q(x)=0$ but $p(x)>0$**: In practice, label smoothing or temperature scaling must be applied to $q$ to avoid zero probabilities. The mode-seeking behavior of reverse KL can exacerbate this issue — the student model "drops" low-probability regions of the teacher distribution.
@@ -33,12 +33,12 @@ $$D_{KL}(p \| q) = H(p, q) - H(p)$$
33
33
  - **PPO / RLHF**:$D_{KL}(\pi_\theta \| \pi_{\text{ref}})$ 作为策略偏离参考策略的惩罚项
34
34
 
35
35
  ## 工程可行性
36
- - **维度 1 张量化 ✅**:逐元素 $p \log(p/q)$ 完全向量化
37
- - **维度 2 GEMM 可映射 ⚠️**:KL 本身不是 GEMM,但输入(logits)来自 GEMM 层
38
- - **维度 3 复杂度 ✅**:$O(|\mathcal{X}|)$ 线性
39
- - **维度 4 显存 ⚠️**:大 vocab 下需同时保留 $p$ 和 $q$ 的完整概率向量,可 chunk 计算
40
- - **维度 5 低精度 ✅**:log-softmax 差值在 bf16 下稳定;注意 $q \to 0$ 时 $\log q$ 发散,需 clamp
41
- - **维度 8 算子融合 ✅**:可与 softmax 融合为 FusedKLDivLoss
36
+ - **D1[v]**:逐元素 $p \log(p/q)$ 完全向量化
37
+ - **D2[~]**:KL 本身不是 GEMM,但输入(logits)来自 GEMM 层
38
+ - **D3[v]**:$O(|\mathcal{X}|)$ 线性
39
+ - **D4[~]**:大 vocab 下需同时保留 $p$ 和 $q$ 的完整概率向量,可 chunk 计算
40
+ - **D5[v]**:log-softmax 差值在 bf16 下稳定;注意 $q \to 0$ 时 $\log q$ 发散,需 clamp
41
+ - **D8[v]**:可与 softmax 融合为 FusedKLDivLoss
42
42
 
43
43
  ## 风险与失效条件
44
44
  - **$q(x)=0$ 但 $p(x)>0$ 时 KL 发散为无穷**:实践中必须对 $q$ 做 label smoothing 或温度缩放,避免零概率。反向 KL 的 mode-seeking 行为可加剧此问题——学生模型"丢弃"教师分布的低概率区域。
@@ -1,4 +1,4 @@
1
- # 🖥️ Algorithmic Lens
1
+ # Algorithmic Lens
2
2
 
3
3
  > Algorithms are the automation of thought — converting insights into precise, repeatable steps.
4
4
 
@@ -1,4 +1,4 @@
1
- # 🖥️ 算法透镜 / Algorithmic Lens
1
+ # 算法透镜 / Algorithmic Lens
2
2
 
3
3
  > 算法是思想的自动化——将洞察转化为可重复执行的精确步骤。
4
4
 
@@ -1,4 +1,4 @@
1
- # 📐 Axiomatization Lens
1
+ # Axiomatization Lens
2
2
 
3
3
  > Build from minimal assumptions using rigorous logic — scrutinizing premises matters more than checking conclusions
4
4
 
@@ -1,4 +1,4 @@
1
- # 📐 公理化透镜
1
+ # 公理化透镜
2
2
 
3
3
  > 从最少假设出发,用严格逻辑构建——审查前提比检查结论更重要
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧩 Categorification Lens
1
+ # Categorification Lens
2
2
 
3
3
  > Strip away incidental details to reveal essential structure — problems across different domains often share the same abstract skeleton
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧩 范畴化透镜
1
+ # 范畴化透镜
2
2
 
3
3
  > 忽略偶然细节,揭示必然结构——不同领域的问题往往共享相同的抽象骨架
4
4
 
@@ -1,4 +1,4 @@
1
- # 🔗 Causal Lens
1
+ # Causal Lens
2
2
 
3
3
  > Correlation does not imply causation — but causation can be clarified. The crucial distinction: "how Y behaves when X is observed" is not the same as "what would happen if X were done."
4
4
 
package/lenses/causal.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🔗 因果透镜 / Causal Lens
1
+ # 因果透镜 / Causal Lens
2
2
 
3
3
  > 相关不等于因果——但因果可以理清。关键区别:"看到 X 时 Y 如何"不等于"如果做了 X 会怎样"。
4
4
 
@@ -1,4 +1,4 @@
1
- # 🔄 Duality Lens
1
+ # Duality Lens
2
2
 
3
3
  > A hard problem is equivalent to an easy problem — the key is finding the right transform and its inverse
4
4
 
package/lenses/duality.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🔄 对偶透镜
1
+ # 对偶透镜
2
2
 
3
3
  > 复杂问题等价于简单问题——关键是找到合适的变换和它的逆
4
4
 
package/lenses/game.en.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🎯 Game Lens
1
+ # Game Lens
2
2
 
3
3
  > Your optimal choice depends on others' choices — thinking must be not only deep but interactive.
4
4
 
@@ -15,7 +15,7 @@ This is a "player's" perspective — in environments where multiple decision-mak
15
15
 
16
16
  ## What Problems It Is Not Suited For
17
17
 
18
- - Single-agent decision problems with no interaction with others — optimization thinking is more appropriate
18
+ - Single-agent decision problems with no interaction with others — the variational lens is more appropriate
19
19
  - Purely cooperative problems where all participants share identical objectives — strategic analysis is unnecessary
20
20
  - Deterministic problems where outcomes are uniquely determined by one's own actions — no others' responses are involved
21
21
  - Outcomes determined purely by luck, with no strategic choices available to any party
package/lenses/game.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🎯 博弈透镜 / Game Lens
1
+ # 博弈透镜 / Game Lens
2
2
 
3
3
  > 你的最优选择取决于他人的选择——思考不仅要深入,还要互动。
4
4
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  ## 不适合什么问题
17
17
 
18
- - 单人决策问题,与他人无互动——优化思想更适用
18
+ - 单人决策问题,与他人无互动——变分透镜更适用
19
19
  - 纯合作问题,参与者目标完全一致——无需战略分析
20
20
  - 确定性问题,结果由自身行动唯一决定——不涉及他人反应
21
21
  - 纯粹运气决定的结果,各方无策略选择
@@ -1,4 +1,4 @@
1
- # 🌉 Geometric Lens
1
+ # Geometric Lens
2
2
 
3
3
  > Metric, curvature, and spatial structure on manifolds — seeing problems through the eyes of differential geometry, where distance, bending, and optimal paths reveal the intrinsic shape of data
4
4
 
@@ -1,4 +1,4 @@
1
- # 🌉 几何透镜
1
+ # 几何透镜
2
2
 
3
3
  > 度量/曲率/流形上的空间结构——用微分几何的眼光看问题,距离、弯曲与最优路径揭示数据的内在形状
4
4
 
@@ -1,4 +1,4 @@
1
- # 📈 Local-to-Global Lens
1
+ # Local-to-Global Lens
2
2
 
3
3
  > Patching local properties into global, sheaf cohomology obstructions — can local solutions be seamlessly assembled into a global solution? Where do the obstructions lie?
4
4
 
@@ -1,4 +1,4 @@
1
- # 📈 局部到全局透镜
1
+ # 局部到全局透镜
2
2
 
3
3
  > 局部性质拼接为全局、层上同调障碍——局部解能否无缝组装成全局解?障碍在哪里?
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧠 Perturbation Lens
1
+ # Perturbation Lens
2
2
 
3
3
  > Propagation of small perturbations, stability, and robustness — a system's sensitivity to tiny changes determines its reliability
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧠 微扰透镜
1
+ # 微扰透镜
2
2
 
3
3
  > 小扰动的传播、稳定性、鲁棒性——系统对微小变化的敏感度决定了它的可靠性
4
4
 
@@ -1,4 +1,4 @@
1
- # 🎲 Probabilistic Lens
1
+ # Probabilistic Lens
2
2
 
3
3
  > Uncertainty is quantifiable — probability is quantified belief, data is quantified evidence
4
4
 
@@ -1,4 +1,4 @@
1
- # 🎲 概率透镜
1
+ # 概率透镜
2
2
 
3
3
  > 不确定性是可量化的——概率是量化的信念,数据是量化的证据
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧮 Projection & Decomposition Lens
1
+ # Projection & Decomposition Lens
2
2
 
3
3
  > Complex wholes can be orthogonally decomposed into independent components — conflicts are exposed in subspaces, signal and noise are separated under projection.
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧮 投影与分解透镜 / Projection & Decomposition Lens
1
+ # 投影与分解透镜 / Projection & Decomposition Lens
2
2
 
3
3
  > 复杂整体可以正交分解为独立分量——冲突在子空间中暴露,信号与噪声在投影下分离。
4
4
 
@@ -1,4 +1,4 @@
1
- # 📡 Spectral Decomposition Lens
1
+ # Spectral Decomposition Lens
2
2
 
3
3
  > Any linear operator can be decomposed into a superposition of eigencomponents — eigenvalues reveal dominant structure, eigenvectors reveal dominant directions.
4
4
 
@@ -1,4 +1,4 @@
1
- # 📡 谱分解透镜 / Spectral Decomposition Lens
1
+ # 谱分解透镜 / Spectral Decomposition Lens
2
2
 
3
3
  > 任何线性算子都可以分解为特征分量的叠加——特征值揭示主导结构,特征向量揭示主导方向。
4
4
 
@@ -1,4 +1,4 @@
1
- # ⚛️ Symmetry Lens
1
+ # Symmetry Lens
2
2
 
3
3
  > Seek the invariant amid change — every symmetry corresponds to a conserved quantity, and every invariant is a key to simplifying the problem
4
4
 
@@ -1,4 +1,4 @@
1
- # ⚛️ 对称透镜
1
+ # 对称透镜
2
2
 
3
3
  > 在变化中寻找不变——每一个对称性都对应一个守恒量,每一个不变量都是简化问题的钥匙
4
4
 
@@ -1,4 +1,4 @@
1
- # 🌀 Topological Lens
1
+ # Topological Lens
2
2
 
3
3
  > Stretching and bending are allowed, but tearing is not — the truly important properties are those invariant under continuous deformation
4
4
 
@@ -1,4 +1,4 @@
1
- # 🌀 拓扑透镜
1
+ # 拓扑透镜
2
2
 
3
3
  > 可以拉伸弯曲但不能撕裂——真正重要的性质在连续变形中不变
4
4
 
@@ -1,4 +1,4 @@
1
- # ⚖️ Variational Lens
1
+ # Variational Lens
2
2
 
3
3
  > Pursue the best among the feasible under constraints — convexity determines difficulty, duality reveals structure
4
4
 
@@ -1,4 +1,4 @@
1
- # ⚖️ 变分透镜
1
+ # 变分透镜
2
2
 
3
3
  > 在约束下追求可行中的最优——凸性决定难度,对偶揭示结构
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-skill",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "面向 AI 架构创新的数学研究操作系统 v3:三层正交架构(思想透镜 / 数学知识库 / 设计翻译层),自动诊断用户意图并路由。Math Research OS for AI architecture design: thinking lenses + math knowledge base + design translation layer with auto intent diagnosis.",
5
5
  "keywords": [
6
6
  "math",
@@ -38,7 +38,7 @@ Record research tasks in a table that the Agent can continuously update:
38
38
  ```markdown
39
39
  | Candidate Structure | Math Correctness | GPU 8-Dim | Complexity | Status | Notes / Next Steps |
40
40
  |--------------------|-----------------|-----------|------------|--------|-------------------|
41
- | Tropical gating replacing TopK | Differentiable relaxation | 123✅… | Sub-quadratic (per-token) | Verifying | Compare with SWA baseline |
41
+ | Tropical gating replacing TopK | [v] Differentiable relaxation | 1[v]2[x]3[v]… | Sub-quadratic (per-token) | Verifying | Compare with SWA baseline |
42
42
  | … | | | | Todo | |
43
43
  ```
44
44
 
@@ -40,7 +40,7 @@
40
40
  ```markdown
41
41
  | 候选结构 | 数学正确性 | GPU 八维 | 复杂度 | 状态 | 备注/下一步 |
42
42
  |---------|-----------|---------|-------|------|-----------|
43
- | 热带门控替代 TopK | 可微松弛 | 123✅… | 亚二次(逐token) | 验证中 | 对比 SWA 基线 |
43
+ | 热带门控替代 TopK | [v] 可微松弛 | 1[v]2[x]3[v]… | 亚二次(逐token) | 验证中 | 对比 SWA 基线 |
44
44
  | … | | | | 待办 | |
45
45
  ```
46
46