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
@@ -1,5 +1,5 @@
1
1
  # Projection Attention
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  When the token/key space dimensionality is too high, the standard attention $Q K^T$ inner product tends to become uniform in high-dimensional spaces ("attention collapse"). In such cases, key/query vectors must first be projected onto a **subspace with superior geometric structure** before computing attention. Typical scenarios include: KV-Cache compression for long-context LLMs, attention sparsification in high-dimensional embedding spaces, and attention alignment of heterogeneous features in multimodal fusion.
@@ -51,14 +51,14 @@ scores = (Q @ eigenvecs) @ (K @ eigenvecs).T / sqrt(r)
51
51
  - **Hierarchical Projection**: Shallow layers use small $r$ (coarse filtering), while deep layers use large $r$ (fine ranking)
52
52
 
53
53
  ## GPU Feasibility
54
- - **Dimension 1 Tensorization**: Projection = matrix multiplication, attention = matrix multiplication chain; entirely tensor operations
55
- - **Dimension 2 GEMM-mappability**: $Q P_Q$ and $K P_K$ are both standard GEMM operations, fully utilizing Tensor Cores
56
- - **Dimension 3 Complexity**: Projection cost $O(ndr)$ is far below attention cost $O(n^2 d)$, and after projection $r \ll d$ reduces attention to $O(n^2 r)$
57
- - **Dimension 4 Memory**: Key-cache compressed by $d/r$; V-cache must be handled separately
58
- - **Dimension 5 Low Precision**: Projection matrices are orthogonal or near-orthogonal, yielding numerical stability; bf16 is acceptable
59
- - **Dimension 6 Parallelism**: Projection can be pipelined with attention; Multi-Head is naturally parallel across heads
60
- - **Dimension 7 Sparsity**: Projection matrices are inherently dense; sparse projections (CountSketch) may introduce gather/scatter operations
61
- - **Dimension 8 Operator Fusion ⚠️ Retrofittable, needs kernel-level validation**: Projection may be integrated into a FlashAttention-style kernel, but requires kernel-level verification
54
+ - **D1**: Projection = matrix multiplication, attention = matrix multiplication chain; entirely tensor operations
55
+ - **D2**: $Q P_Q$ and $K P_K$ are both standard GEMM operations, fully utilizing Tensor Cores
56
+ - **D3**: Projection cost $O(ndr)$ is far below attention cost $O(n^2 d)$, and after projection $r \ll d$ reduces attention to $O(n^2 r)$
57
+ - **D4**: Key-cache compressed by $d/r$; V-cache must be handled separately
58
+ - **D5**: Projection matrices are orthogonal or near-orthogonal, yielding numerical stability; bf16 is acceptable
59
+ - **D6**: Projection can be pipelined with attention; Multi-Head is naturally parallel across heads
60
+ - **D7**: Projection matrices are inherently dense; sparse projections (CountSketch) may introduce gather/scatter operations
61
+ - **D8[~] Retrofittable, needs kernel-level validation**: Projection may be integrated into a FlashAttention-style kernel, but requires kernel-level verification
62
62
 
63
63
  ## Paper Phrasing
64
64
  "We decompose attention computation into two steps -- low-dimensional subspace projection and projected-space attention -- achieving a $d/r$-fold Key-cache compression (full KV-Cache compression requires separate V compression/reconstruction) while preserving attention quality and guaranteeing Johnson-Lindenstrauss distance preservation."
@@ -1,5 +1,5 @@
1
1
  # 投影注意力 / Projection Attention
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当输入的 token/key 空间维度过高,标准注意力的 $Q K^T$ 内积在高维空间中趋于均匀("注意力坍缩")时,需要先将 key/query 投影到一个**几何结构更优的子空间**再做注意力计算。典型场景:长上下文 LLM 的 KV-Cache 压缩、高维嵌入空间的注意力稀疏化、多模态融合中异构特征的注意力对齐。
@@ -51,14 +51,14 @@ scores = (Q @ eigenvecs) @ (K @ eigenvecs).T / sqrt(r)
51
51
  - **分层投影**:浅层用小 $r$(粗筛),深层用大 $r$(精排)
52
52
 
53
53
  ## GPU 可行性
54
- - **维度 1 张量化 ✅**:投影 = 矩阵乘,注意力 = 矩阵乘链,全程张量运算
55
- - **维度 2 GEMM 可映射 ✅**:$Q P_Q$ 和 $K P_K$ 均为标准 GEMM,吃满 Tensor Core
56
- - **维度 3 复杂度 ✅**:投影 $O(ndr)$ 远低于注意力 $O(n^2 d)$,且投影后 $r \ll d$ 使注意力 $O(n^2 r)$
57
- - **维度 4 显存 ✅**:Key-cache 压缩 $d/r$ 倍(V-cache 需独立处理),直接降低显存峰值
58
- - **维度 5 低精度 ✅**:投影矩阵正交/近正交时数值稳定,bf16 可接受
59
- - **维度 6 并行 ✅**:投影可与注意力流水线并行,Multi-Head 天然跨头并行
60
- - **维度 7 稀疏 ⚠️**:投影矩阵本身稠密;若用稀疏投影(CountSketch),可能引入 gather/scatter
61
- - **维度 8 算子融合 ⚠️可改造需验证**:投影可融入 FlashAttention 的 online softmax 循环中
54
+ - **D1[v]**:投影 = 矩阵乘,注意力 = 矩阵乘链,全程张量运算
55
+ - **D2[v]**:$Q P_Q$ 和 $K P_K$ 均为标准 GEMM,吃满 Tensor Core
56
+ - **D3[v]**:投影 $O(ndr)$ 远低于注意力 $O(n^2 d)$,且投影后 $r \ll d$ 使注意力 $O(n^2 r)$
57
+ - **D4[v]**:Key-cache 压缩 $d/r$ 倍(V-cache 需独立处理),直接降低显存峰值
58
+ - **D5[v]**:投影矩阵正交/近正交时数值稳定,bf16 可接受
59
+ - **D6[v]**:投影可与注意力流水线并行,Multi-Head 天然跨头并行
60
+ - **D7[~]**:投影矩阵本身稠密;若用稀疏投影(CountSketch),可能引入 gather/scatter
61
+ - **D8[~]可改造需验证**:投影可融入 FlashAttention 的 online softmax 循环中
62
62
 
63
63
  ## 论文表述方式
64
64
  "我们将注意力计算分解为低维子空间投影与投影空间注意力两步,在保持注意力质量的同时将 Key-cache 压缩 $d/r$ 倍(V-cache 需独立处理),并保证 Johnson-Lindenstrauss 距离保持性。"
@@ -1,5 +1,5 @@
1
1
  # Spectral Attention
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  When the input signal exhibits **frequency-domain/spectral structure** (periodicity, cyclic symmetry, graph structure), computing attention in the spectral domain rather than the spatial domain can dramatically reduce complexity while exploiting the signal's intrinsic structure. Typical scenarios include: time series forecasting (periodic signals), graph neural networks (graph Laplacian spectral decomposition), positional encoding (frequency-domain interpretation of RoPE/ALiBi), and $O(n \log n)$ acceleration of long-sequence attention.
@@ -54,14 +54,14 @@ attn = ifft(scores_freq)
54
54
  - **Frequency-Aware Positional Encoding**: The essence of RoPE is the unitary representation of the cyclic group $\mathbb{Z}$ (see Abstract Algebra Ch.4), generalizable to other groups
55
55
 
56
56
  ## GPU Feasibility
57
- - **Dimension 1 Tensorization**: FFT and matrix multiplication are both standard tensor operations
58
- - **Dimension 2 GEMM-mappability**: Spectral projection $U^T Q$ is a standard GEMM; although FFT is not GEMM, highly optimized cuFFT implementations are available
59
- - **Dimension 3 Complexity**: FFT attention $O(n \log n \cdot d)$, far superior to $O(n^2 d)$
60
- - **Dimension 4 Memory**: Frequency-domain representation introduces no extra dimensions; spectral projection can reduce to $k \ll n$ dimensions
61
- - **Dimension 5 Low Precision**: Complex-valued FFT suffers precision loss under fp16; fp32 or real-valued FFT (RFFT) is required
62
- - **Dimension 6 Parallelism**: FFT can be parallelized across batch/head; cuFFT supports multi-stream execution
63
- - **Dimension 7 Sparsity**: High-frequency components can be truncated in the spectral domain (structured sparsity), retaining only top-k frequencies
64
- - **Dimension 8 Operator Fusion**: Fusing FFT with attention requires custom kernels; no ready-made fusion exists in standard libraries
57
+ - **D1**: FFT and matrix multiplication are both standard tensor operations
58
+ - **D2**: Spectral projection $U^T Q$ is a standard GEMM; although FFT is not GEMM, highly optimized cuFFT implementations are available
59
+ - **D3**: FFT attention $O(n \log n \cdot d)$, far superior to $O(n^2 d)$
60
+ - **D4**: Frequency-domain representation introduces no extra dimensions; spectral projection can reduce to $k \ll n$ dimensions
61
+ - **D5**: Complex-valued FFT suffers precision loss under fp16; fp32 or real-valued FFT (RFFT) is required
62
+ - **D6**: FFT can be parallelized across batch/head; cuFFT supports multi-stream execution
63
+ - **D7**: High-frequency components can be truncated in the spectral domain (structured sparsity), retaining only top-k frequencies
64
+ - **D8**: Fusing FFT with attention requires custom kernels; no ready-made fusion exists in standard libraries
65
65
 
66
66
  ## Paper Phrasing
67
67
  "We propose a spectral-domain attention mechanism that transforms attention computation into the Fourier/Laplacian spectral domain, leveraging the cyclic convolution theorem to reduce sequence attention complexity from $O(n^2)$ to $O(n \log n)$ while preserving the ability to model dependencies at multiple scales through frequency-adaptive weights."
@@ -1,5 +1,5 @@
1
1
  # 谱注意力 / Spectral Attention
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当输入信号具有**频域/谱结构**(周期性、循环对称性、图结构)时,在谱域而非空域计算注意力可大幅降低复杂度并利用信号的内在结构。典型场景:时间序列预测(周期性信号)、图神经网络(图 Laplacian 谱分解)、位置编码(RoPE/ALiBi 的频率解释)、长序列注意力的 $O(n \log n)$ 加速。
@@ -54,14 +54,14 @@ attn = ifft(scores_freq)
54
54
  - **频率感知位置编码**:RoPE 的本质即循环群 $\mathbb{Z}$ 的酉表示(参见抽象代数 Ch.4),可推广到其他群
55
55
 
56
56
  ## GPU 可行性
57
- - **维度 1 张量化 ✅**:FFT 和矩阵乘均为标准张量运算
58
- - **维度 2 GEMM 可映射 ✅**:谱投影 $U^T Q$ 为标准 GEMM;FFT 虽非 GEMM 但有高度优化的 cuFFT 实现
59
- - **维度 3 复杂度 ✅**:FFT 注意力 $O(n \log n \cdot d)$,远优于 $O(n^2 d)$
60
- - **维度 4 显存 ✅**:频域表示不增加额外维度,谱投影可降低到 $k \ll n$ 维
61
- - **维度 5 低精度 ⚠️**:复数 FFT 在 fp16 下精度损失,需 fp32 或使用实数 FFT (RFFT)
62
- - **维度 6 并行 ✅**:FFT 可跨 batch/head 并行,cuFFT 支持多流
63
- - **维度 7 稀疏 ✅**:谱域中高频分量可截断(结构化稀疏),只保留 top-k 频率
64
- - **维度 8 算子融合 ⚠️**:FFT 与 attention 融合需自定义 kernel,标准库无现成融合
57
+ - **D1[v]**:FFT 和矩阵乘均为标准张量运算
58
+ - **D2[v]**:谱投影 $U^T Q$ 为标准 GEMM;FFT 虽非 GEMM 但有高度优化的 cuFFT 实现
59
+ - **D3[v]**:FFT 注意力 $O(n \log n \cdot d)$,远优于 $O(n^2 d)$
60
+ - **D4[v]**:频域表示不增加额外维度,谱投影可降低到 $k \ll n$ 维
61
+ - **D5[~]**:复数 FFT 在 fp16 下精度损失,需 fp32 或使用实数 FFT (RFFT)
62
+ - **D6[v]**:FFT 可跨 batch/head 并行,cuFFT 支持多流
63
+ - **D7[v]**:谱域中高频分量可截断(结构化稀疏),只保留 top-k 频率
64
+ - **D8[~]**:FFT 与 attention 融合需自定义 kernel,标准库无现成融合
65
65
 
66
66
  ## 论文表述方式
67
67
  "我们提出谱域注意力机制,通过将注意力计算转换到 Fourier/Laplacian 谱域,利用循环卷积定理将序列注意力复杂度从 $O(n^2)$ 降至 $O(n \log n)$,同时通过频率自适应权重保留对不同尺度依赖关系的建模能力。"
@@ -1,5 +1,5 @@
1
1
  # Leverage Score Selection
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Target Problem
5
5
  Use when selecting the most representative rows / columns / tokens from a large-scale matrix while guaranteeing the precision of downstream linear algebra operations: KV-Cache token selection, data coreset construction, Nystrom landmark sampling, distributed gradient compression. Core objective: **sample based on statistical leverage scores derived from subspace projections, with probabilistic guarantees of approximating full-computation accuracy**.
@@ -1,5 +1,5 @@
1
1
  # Leverage Score Selection(杠杆分数选择)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要从大规模矩阵中选取最有代表性的行/列/token,且需保证下游线性代数运算精度时使用:KV-Cache token 选择、数据 coreset 构建、Nyström landmark 采样、分布式梯度压缩。核心诉求:**基于子空间投影的统计杠杆分数做采样,以概率保证逼近全量计算精度**。
@@ -1,5 +1,5 @@
1
1
  # Low-Rank KV-Cache
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Target Problem
5
5
  Use when KV-Cache memory consumption becomes the bottleneck during LLM inference: long-context inference ($L > 8K$), multi-turn conversation accumulation, edge deployment, speculative decoding / beam search. Core objective: **compress the KV-Cache from $O(Ld)$ to $O(kd)$ with $k \ll L$, under controlled information loss**.
@@ -1,5 +1,5 @@
1
1
  # Low-Rank KV-Cache(低秩 KV 缓存压缩)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当 LLM 推理的 KV-Cache 显存占用成为瓶颈时使用:长上下文推理($L > 8K$)、多轮对话累积、边缘部署、投机解码/束搜索。核心诉求:**以可控信息损失将 KV-Cache 从 $O(Ld)$ 压缩到 $O(kd)$,$k \ll L$**。
@@ -1,5 +1,5 @@
1
1
  # Spectral Token Pruning
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Target Problem
5
5
  Use when pruning must be based on the structural importance of tokens (rather than raw attention scores alone): KV-Cache eviction, long-document summarization, inference acceleration (reducing $O(L^2)$), multimodal vision token compression. Core objective: **quantify the structural importance of each token via spectral methods, achieving pruning with minimal information loss**.
@@ -1,5 +1,5 @@
1
1
  # Spectral Token Pruning(谱 Token 剪枝)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要基于 token 的结构性重要性(而非单纯 attention score)进行剪枝时使用:KV-Cache 驱逐、长文档摘要、推理加速(降低 $O(L^2)$)、多模态视觉 token 压缩。核心诉求:**用谱方法量化每个 token 的结构性重要性,实现信息损失最小的剪枝**。
@@ -1,5 +1,5 @@
1
1
  # Topology-Preserving Compression
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Target Problem
5
5
  Use when compressing representations while homologically preserving the intrinsic topological structure of the data (connected components, loops, cavities): latent-space compression (a toroidal manifold must not collapse into a line segment), knowledge distillation (student--teacher homological equivalence), 3D mesh simplification (genus invariance), KV-Cache semantic preservation (cluster structure must not collapse). Core objective: **compress dimensions or counts while ensuring that changes in the persistence diagram of persistent homology remain controlled**.
@@ -1,5 +1,5 @@
1
1
  # Topology-Preserving Compression(拓扑保持压缩)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当压缩表示时需要同构保持数据的本质拓扑结构(连通性、环、空腔)时使用:隐空间压缩(环形流形不能压成线段)、知识蒸馏(学生-教师同调等价)、3D 网格简化(genus 不变)、KV-Cache 语义保持(聚类结构不坍缩)。核心诉求:**压缩维度或数量,保证持续同调的 persistence diagram 变化可控**。
@@ -1,5 +1,5 @@
1
1
  # Constraint Penalty
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  When the design involves hard constraints (e.g., probability simplex, orthogonality, capacity limits, load balancing) but end-to-end training is required. Typical scenarios: (1) MoE routing probabilities must lie on the $K$-simplex with load balancing; (2) Expert activation count is constrained (top-k); (3) Subspace projection matrices must satisfy orthogonality $W^T W = I$; (4) Feature norms are bounded $\|z\| \leq R$. Core objective: **transform mathematical constraints into differentiable penalty terms integrated into gradient-based variational**.
@@ -1,5 +1,5 @@
1
1
  # Constraint Penalty(约束惩罚损失)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当设计中有硬约束(如概率单纯形、正交性、容量限制、负载均衡)但需要端到端训练时使用。
@@ -1,5 +1,5 @@
1
1
  # Contrastive Loss
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  When the model needs to learn "what is similar to what and what is different from what." Typical scenarios: (1) Different augmented views of the same input should be pulled closer (positive pairs), while different inputs should be pushed apart (negative pairs); (2) Shared representations should capture cross-task commonalities, while Private representations should distinguish task-specific features; (3) In the expert embedding space, similar inputs should be routed to the same expert. Core objective: **learn relative relationships rather than absolute values**.
@@ -1,5 +1,5 @@
1
1
  # Contrastive Loss(对比损失)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要让模型学会"什么和什么相似、什么和什么不同"时使用。典型场景:
@@ -1,5 +1,5 @@
1
1
  # Information Bottleneck Loss
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  When a representation $Z$ must achieve an optimal balance between "retaining task-relevant information" and "compressing input redundancy." Typical scenarios: (1) Shared representations should retain only cross-task common information, discarding task-specific noise; (2) Private representations should retain only single-task unique information; (3) Routing features should maximize expert-task matching information. Core objective: **optimal information compression -- nothing more, nothing less, retaining only what is useful**.
@@ -1,5 +1,5 @@
1
1
  # Information Bottleneck Loss(信息瓶颈损失)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要让表示 Z 在"保留任务相关信息"与"压缩输入冗余信息"之间取得最优平衡时使用。
@@ -1,5 +1,5 @@
1
1
  # Orthogonality Loss
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  In multi-expert / multi-task settings, representations learned by submodules are highly overlapping and redundant, leading to poor parameter utilization. This loss is used when the $d$-dimensional feature space needs to be partitioned into $K$ non-interfering subspaces -- such as Shared-Private separation, MoE expert differentiation, and multi-task head decorrelation. Core objective: **ensure different modules see different things**.
@@ -1,5 +1,5 @@
1
1
  # Orthogonality Loss(正交性损失)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  多专家/多任务场景中,各子模块学习到的表示高度重叠、冗余,导致参数利用率低下。
@@ -1,5 +1,5 @@
1
1
  # Variational Loss
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  When sampling from latent variable distributions is required to generate diverse outputs. Typical scenarios: (1) Expert selection introduces discrete latent variables $z$ that need end-to-end variational; (2) Representation spaces need to model uncertainty; (3) Generative routing requires sampling from posterior distributions $p(z|x)$; (4) Bayesian mixture of experts. Core objective: **model distributions rather than point estimates in latent space, enabling uncertainty awareness and diversity**.
@@ -1,5 +1,5 @@
1
1
  # Variational Loss(变分损失)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要从隐变量分布中采样并生成多样化输出时使用。典型场景:
@@ -1,5 +1,5 @@
1
1
  # Equivariant Split
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use when the input possesses symmetries (e.g., permutations, rotations, translations) and the representation should preserve or reflect those symmetries.
@@ -1,5 +1,5 @@
1
1
  # Equivariant Split(等变分割)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当输入具有对称性(如排列、旋转、平移),且表示应保持或反映这些对称性时使用。
@@ -1,5 +1,5 @@
1
1
  # Manifold Representation
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use when input data resides in a high-dimensional space but is actually distributed on a low-dimensional manifold. Typical scenarios:
@@ -1,5 +1,5 @@
1
1
  # Manifold Representation(流形表示)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当输入数据虽然在高维空间中,但实际分布在低维流形上时使用。典型场景:
@@ -1,5 +1,5 @@
1
1
  # Shared-Private Decomposition
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use in multi-task/multi-domain learning when representations need to be decomposed into a "cross-task common component" and a "task-specific component."
@@ -1,5 +1,5 @@
1
1
  # Shared-Private Decomposition(共享-私有分解)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  多任务/多领域学习中,需要将表示分解为"跨任务共性部分"和"任务特异部分"。
@@ -1,5 +1,5 @@
1
1
  # Subspace Alignment
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use when two or more representation spaces need to be aligned to a common subspace. Typical scenarios:
@@ -1,5 +1,5 @@
1
1
  # Subspace Alignment(子空间对齐)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当两个或多个表示空间需要对齐到共同的子空间时使用。典型场景:
@@ -1,5 +1,5 @@
1
1
  # Graph Routing
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use when there exists a known or learnable topological structure among modules/experts. Typical scenarios:
@@ -1,5 +1,5 @@
1
1
  # Graph Routing(图路由)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当模块/专家之间存在已知的或可学习的拓扑结构时使用。典型场景:
@@ -1,5 +1,5 @@
1
1
  # MoE Routing (Mixture-of-Experts Routing)
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use in large-scale models where a small number of experts must be dynamically selected to process each token, achieving parameter scaling while keeping inference cost manageable.
@@ -1,5 +1,5 @@
1
1
  # MoE Routing(混合专家路由)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  大规模模型中需要动态选择少量专家处理每个 token,以实现参数扩展而推理代价可控。
@@ -1,5 +1,5 @@
1
1
  # Optimal Transport Routing
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use when a set of input tokens/samples must be assigned to a set of experts/sub-modules while pursuing globally optimal matching cost.
@@ -1,5 +1,5 @@
1
1
  # Optimal Transport Routing(最优传输路由)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要将一组输入 token/样本 分配到一组专家/子模块,且追求全局最优的匹配代价时使用。
@@ -1,5 +1,5 @@
1
1
  # Spectral Clustering Routing
2
- > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as verified / ⚠️ retrofittable (needs validation) / infeasible. Unmarked claims are theoretically possible but require engineering validation.
2
+ > **Rigor disclaimer**: Claims about complexity, memory, FlashAttention fusion, Tensor Core, and KV-Cache compression are marked as [v] verified / [~] retrofittable (needs validation) / [x] infeasible. Unmarked claims are theoretically possible but require engineering validation.
3
3
 
4
4
  ## Applicable Problems
5
5
  Use when routing needs to be based on the intrinsic similarity structure of tokens/samples. Typical scenarios:
@@ -1,5 +1,5 @@
1
1
  # Spectral Clustering Routing(谱聚类路由)
2
- > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「✅ 已验证 / ⚠️ 可改造需验证 / 不可行」。未标注的视为理论可行,需工程验证。
2
+ > **严谨性声明**:本文件中涉及复杂度、显存、FlashAttention 融合、Tensor Core、KV-Cache 压缩的结论均标注为「[v] 已验证 / [~] 可改造需验证 / [x] 不可行」。未标注的视为理论可行,需工程验证。
3
3
 
4
4
  ## 适用问题
5
5
  当需要基于 token/样本的内在相似性结构进行分组路由时使用。典型场景:
@@ -47,4 +47,4 @@ GPU 友好度取决于度量的结构化程度:
47
47
  - 蒸馏稿:references/books/differential-geometry.md(Ch 7 §7.6 Metric Tensors, Ch 13 §13.1 Levi-Civita)
48
48
  - 蒸馏稿:references/books/smooth-manifolds.md(Ch 13 Riemannian Metrics)
49
49
  - 原书:Jeffrey M. Lee, *Manifolds and Differential Geometry*, §7.6 Metric Tensors
50
- - 原书:John M. Lee, *Introduction to Smooth Manifolds*, Ch 13(黎曼度量、升降指标 ♯/♭)
50
+ - 原书:John M. Lee, *Introduction to Smooth Manifolds*, Ch 13(黎曼度量、升降指标 (sharp)/(flat))
@@ -33,14 +33,14 @@ $$\Gamma_{ijk}^{(\alpha)} = \mathbb{E}\left[\left(\partial_i \partial_j \ell + \
33
33
  - **Geometric analysis of MoE expert distributions**: The degree of separation between the output distributions of different experts under the Fisher metric can quantify expert diversity
34
34
 
35
35
  ## Engineering Feasibility
36
- - **Dimension 1 Tensorization ❌**: The full metric tensor $g_{ij}$ is $d \times d$; infeasible to materialize when $d \sim 10^{10}$
37
- - **Dimension 2 GEMM-mappability ⚠️**: Kronecker/diagonal approximations can be mapped; the exact metric cannot
38
- - **Dimension 3 Complexity ❌**: Geodesic computation requires solving a second-order ODE; exact computation is intractable
39
- - **Dimension 4 Memory ❌**: Full metric tensor storage is $O(d^2)$; completely impossible at LLM scale
40
- - **Dimension 5 Low Precision ⚠️**: The condition number of the metric tensor may be very large, leading to instability under low precision
41
- - **Dimension 6 Parallelism ⚠️**: Approximate versions (K-FAC, diagonal) can be parallelized; exact versions cannot
42
- - **Dimension 7 Sparsity ⚠️**: The Fisher information matrix is typically dense; block-diagonal approximations (inter-layer independence) introduce structured sparsity
43
- - **Dimension 8 Operator Fusion ✅**: Approximate versions can be fused into optimizer updates
36
+ - **D1[x]**: The full metric tensor $g_{ij}$ is $d \times d$; infeasible to materialize when $d \sim 10^{10}$
37
+ - **D2[~]**: Kronecker/diagonal approximations can be mapped; the exact metric cannot
38
+ - **D3[x]**: Geodesic computation requires solving a second-order ODE; exact computation is intractable
39
+ - **D4[x]**: Full metric tensor storage is $O(d^2)$; completely impossible at LLM scale
40
+ - **D5[~]**: The condition number of the metric tensor may be very large, leading to instability under low precision
41
+ - **D6[~]**: Approximate versions (K-FAC, diagonal) can be parallelized; exact versions cannot
42
+ - **D7[~]**: The Fisher information matrix is typically dense; block-diagonal approximations (inter-layer independence) introduce structured sparsity
43
+ - **D8[v]**: Approximate versions can be fused into optimizer updates
44
44
 
45
45
  **Conclusion**: The exact Fisher metric is infeasible at LLM scale, but **approximate versions** (K-FAC, diagonal Fisher, low-rank) are engineering-viable. The theoretical value of information geometry lies primarily in **guiding design** rather than direct computation.
46
46
 
@@ -33,14 +33,14 @@ $$\Gamma_{ijk}^{(\alpha)} = \mathbb{E}\left[\left(\partial_i \partial_j \ell + \
33
33
  - **MoE 专家分布的几何分析**:不同专家的输出分布在 Fisher 度量下的分离度可量化专家多样性
34
34
 
35
35
  ## 工程可行性
36
- - **维度 1 张量化 ❌**:完整度量张量 $g_{ij}$ 是 $d \times d$,$d \sim 10^{10}$ 时不可物化
37
- - **维度 2 GEMM 可映射 ⚠️**:Kronecker/对角近似可,精确度量不可
38
- - **维度 3 复杂度 ❌**:测地线计算需解二阶 ODE,精确计算不可行
39
- - **维度 4 显存 ❌**:完整度量张量存储 $O(d^2)$,LLM 级完全不可能
40
- - **维度 5 低精度 ⚠️**:度量张量的条件数可能很大,低精度下不稳定
41
- - **维度 6 并行 ⚠️**:近似版本(K-FAC、对角)可并行,精确版本不可
42
- - **维度 7 稀疏 ⚠️**:Fisher 信息矩阵通常稠密;块对角近似(层间独立)引入结构化稀疏
43
- - **维度 8 算子融合 ✅**:近似版本可融入优化器更新
36
+ - **D1[x]**:完整度量张量 $g_{ij}$ 是 $d \times d$,$d \sim 10^{10}$ 时不可物化
37
+ - **D2[~]**:Kronecker/对角近似可,精确度量不可
38
+ - **D3[x]**:测地线计算需解二阶 ODE,精确计算不可行
39
+ - **D4[x]**:完整度量张量存储 $O(d^2)$,LLM 级完全不可能
40
+ - **D5[~]**:度量张量的条件数可能很大,低精度下不稳定
41
+ - **D6[~]**:近似版本(K-FAC、对角)可并行,精确版本不可
42
+ - **D7[~]**:Fisher 信息矩阵通常稠密;块对角近似(层间独立)引入结构化稀疏
43
+ - **D8[v]**:近似版本可融入优化器更新
44
44
 
45
45
  **结论**:精确 Fisher 度量在 LLM 规模下不可行,但**近似版本**(K-FAC、对角 Fisher、低秩)在工程上可落地。信息几何的理论价值主要在**指导设计**而非直接计算。
46
46
 
@@ -34,13 +34,13 @@ where $A_l = \mathbb{E}[a_l a_l^T]$ (activation covariance) and $B_l = \mathbb{E
34
34
  - **Natural Gradient in Variational Inference**: For exponential family parameters, the natural gradient equals the difference in expected sufficient statistics, avoiding Fisher matrix inversion
35
35
 
36
36
  ## Engineering Feasibility
37
- - **Dimension 1 Tensorization ⚠️**: The Kronecker factors of the FIM are dense matrices and can be tensorized; the full FIM cannot
38
- - **Dimension 2 GEMM-mappability ✅**: K-FAC's $A_l^{-1} (\nabla W_l) B_l^{-1}$ is two matrix multiplications, naturally GEMM
39
- - **Dimension 3 Complexity ⚠️**: K-FAC adds $O(d_A^2 + d_B^2)$ per-layer covariance estimation + $O(d_A^3 + d_B^3)$ matrix inversion; diagonal approximation is $O(d)$
40
- - **Dimension 4 Memory ⚠️**: Requires additional storage of $A_l$ and $B_l$ per layer ($O(d_A^2 + d_B^2)$); acceptable for LLMs but non-trivial
41
- - **Dimension 5 Low Precision ⚠️**: Matrix inversion may be unstable in fp16; fp32 or Tikhonov regularization $(A + \epsilon I)^{-1}$ is needed
42
- - **Dimension 6 Parallelism ✅**: Kronecker factors for each layer are computed independently; fully parallel across layers
43
- - **Dimension 8 Operator Fusion ✅**: Natural gradient updates can be fused into the parameter update kernel
37
+ - **D1[~]**: The Kronecker factors of the FIM are dense matrices and can be tensorized; the full FIM cannot
38
+ - **D2[v]**: K-FAC's $A_l^{-1} (\nabla W_l) B_l^{-1}$ is two matrix multiplications, naturally GEMM
39
+ - **D3[~]**: K-FAC adds $O(d_A^2 + d_B^2)$ per-layer covariance estimation + $O(d_A^3 + d_B^3)$ matrix inversion; diagonal approximation is $O(d)$
40
+ - **D4[~]**: Requires additional storage of $A_l$ and $B_l$ per layer ($O(d_A^2 + d_B^2)$); acceptable for LLMs but non-trivial
41
+ - **D5[~]**: Matrix inversion may be unstable in fp16; fp32 or Tikhonov regularization $(A + \epsilon I)^{-1}$ is needed
42
+ - **D6[v]**: Kronecker factors for each layer are computed independently; fully parallel across layers
43
+ - **D8[v]**: Natural gradient updates can be fused into the parameter update kernel
44
44
 
45
45
  ## Risks and Failure Conditions
46
46
  - **K-FAC's inter-layer independence assumption is overly strong**: It assumes the Fisher information is block-diagonal across layers, ignoring inter-layer correlations. In deep networks, this may underestimate the effective curvature, leading to excessively large steps. Line search or trust-region safeguards are needed.
@@ -34,13 +34,13 @@ $$\mathcal{I}_l \approx A_l \otimes B_l$$
34
34
  - **变分推断中的自然梯度**:指数族参数的自然梯度 = 充分统计量的期望差,避免 Fisher 矩阵求逆
35
35
 
36
36
  ## 工程可行性
37
- - **维度 1 张量化 ⚠️**:FIM 的 Kronecker 因子为稠密矩阵,可张量化;完整 FIM 不可
38
- - **维度 2 GEMM 可映射 ✅**:K-FAC 的 $A_l^{-1} (\nabla W_l) B_l^{-1}$ 是两次矩阵乘,天然 GEMM
39
- - **维度 3 复杂度 ⚠️**:K-FAC 每层额外 $O(d_A^2 + d_B^2)$ 协方差估计 + $O(d_A^3 + d_B^3)$ 矩阵逆;对角近似 $O(d)$
40
- - **维度 4 显存 ⚠️**:需额外存储每层的 $A_l$ 和 $B_l$($O(d_A^2 + d_B^2)$),对 LLM 可接受但非零
41
- - **维度 5 低精度 ⚠️**:矩阵求逆在 fp16 下可能不稳定,需 fp32 或 Tikhonov 正则化 $(A + \epsilon I)^{-1}$
42
- - **维度 6 并行 ✅**:各层 Kronecker 因子独立计算,层间完全并行
43
- - **维度 8 算子融合 ✅**:自然梯度更新可融入参数更新 kernel
37
+ - **D1[~]**:FIM 的 Kronecker 因子为稠密矩阵,可张量化;完整 FIM 不可
38
+ - **D2[v]**:K-FAC 的 $A_l^{-1} (\nabla W_l) B_l^{-1}$ 是两次矩阵乘,天然 GEMM
39
+ - **D3[~]**:K-FAC 每层额外 $O(d_A^2 + d_B^2)$ 协方差估计 + $O(d_A^3 + d_B^3)$ 矩阵逆;对角近似 $O(d)$
40
+ - **D4[~]**:需额外存储每层的 $A_l$ 和 $B_l$($O(d_A^2 + d_B^2)$),对 LLM 可接受但非零
41
+ - **D5[~]**:矩阵求逆在 fp16 下可能不稳定,需 fp32 或 Tikhonov 正则化 $(A + \epsilon I)^{-1}$
42
+ - **D6[v]**:各层 Kronecker 因子独立计算,层间完全并行
43
+ - **D8[v]**:自然梯度更新可融入参数更新 kernel
44
44
 
45
45
  ## 风险与失效条件
46
46
  - **K-FAC 的层间独立性假设过强**:假设各层 Fisher 信息块对角,忽略层间相关性。在深网络中可能低估有效曲率,导致步长过大。需搭配线搜索或 trust-region 安全机制。
@@ -30,10 +30,10 @@ The knowledge base is organized by mathematical domain, with 7 domains and 31 kn
30
30
 
31
31
  ## Relationship to Thinking Lenses
32
32
 
33
- Thinking lenses (`../../lenses/`) handle "what perspective to use"; the knowledge base provides "concrete mathematical tools." Typical chain:
33
+ Thinking lenses (`../lenses/`) handle "what perspective to use"; the knowledge base provides "concrete mathematical tools." Typical chain:
34
34
 
35
35
  ```
36
36
  Lens diagnosis → Knowledge card provides tools → Design pattern translates to AI module
37
37
  ```
38
38
 
39
- For deeper study, `../../references/books/*.md` provides 7 book distillations.
39
+ For deeper study, `../references/books/*.md` provides 7 book distillations.
@@ -30,10 +30,10 @@
30
30
 
31
31
  ## 与思想透镜的关系
32
32
 
33
- 思想透镜(`../../lenses/`)负责"用什么视角看问题",知识库负责"提供具体数学工具"。典型链路:
33
+ 思想透镜(`../lenses/`)负责"用什么视角看问题",知识库负责"提供具体数学工具"。典型链路:
34
34
 
35
35
  ```
36
36
  透镜诊断 → 知识卡片提供工具 → 设计模式翻译成 AI 模块
37
37
  ```
38
38
 
39
- 深入查阅时,`../../references/books/*.md` 提供 7 本书的蒸馏稿。
39
+ 深入查阅时,`../references/books/*.md` 提供 7 本书的蒸馏稿。