math-skill 3.0.1 → 3.1.0
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.
- package/README.en-US.md +42 -30
- package/README.md +18 -6
- package/agents/math-critic.en.md +6 -6
- package/agents/math-critic.md +6 -6
- package/commands/ask.en.md +6 -1
- package/commands/ask.md +6 -1
- package/design-patterns/attention/equivariant-attention.en.md +8 -2
- package/design-patterns/attention/equivariant-attention.md +7 -1
- package/design-patterns/attention/geometry-aware-attention.en.md +2 -2
- package/design-patterns/attention/geometry-aware-attention.md +1 -1
- package/design-patterns/attention/information-bottleneck-attention.en.md +32 -12
- package/design-patterns/attention/information-bottleneck-attention.md +32 -12
- package/design-patterns/attention/projection-attention.en.md +3 -3
- package/design-patterns/attention/projection-attention.md +2 -2
- package/design-patterns/attention/spectral-attention.en.md +19 -5
- package/design-patterns/attention/spectral-attention.md +18 -4
- package/design-patterns/compression/leverage-score-selection.en.md +13 -13
- package/design-patterns/compression/leverage-score-selection.md +13 -13
- package/design-patterns/compression/low-rank-kv-cache.en.md +39 -12
- package/design-patterns/compression/low-rank-kv-cache.md +38 -12
- package/design-patterns/compression/spectral-token-pruning.en.md +16 -14
- package/design-patterns/compression/spectral-token-pruning.md +16 -14
- package/design-patterns/compression/topology-preserving-compression.en.md +10 -10
- package/design-patterns/compression/topology-preserving-compression.md +10 -10
- package/design-patterns/loss/constraint-penalty.en.md +8 -4
- package/design-patterns/loss/constraint-penalty.md +9 -6
- package/design-patterns/loss/contrastive-loss.en.md +37 -11
- package/design-patterns/loss/contrastive-loss.md +38 -12
- package/design-patterns/loss/information-bottleneck-loss.en.md +5 -5
- package/design-patterns/loss/information-bottleneck-loss.md +6 -6
- package/design-patterns/loss/orthogonality-loss.en.md +24 -17
- package/design-patterns/loss/orthogonality-loss.md +24 -18
- package/design-patterns/loss/variational-loss.en.md +4 -4
- package/design-patterns/loss/variational-loss.md +5 -5
- package/design-patterns/overview.en.md +36 -0
- package/design-patterns/overview.md +36 -0
- package/design-patterns/representation/equivariant-split.en.md +4 -4
- package/design-patterns/representation/equivariant-split.md +4 -5
- package/design-patterns/representation/manifold-representation.en.md +12 -12
- package/design-patterns/representation/manifold-representation.md +13 -14
- package/design-patterns/representation/shared-private-decomposition.en.md +12 -7
- package/design-patterns/representation/shared-private-decomposition.md +12 -9
- package/design-patterns/representation/subspace-alignment.en.md +12 -12
- package/design-patterns/representation/subspace-alignment.md +12 -12
- package/design-patterns/routing/graph-routing.en.md +11 -11
- package/design-patterns/routing/graph-routing.md +11 -11
- package/design-patterns/routing/moe-routing.en.md +12 -12
- package/design-patterns/routing/moe-routing.md +12 -14
- package/design-patterns/routing/optimal-transport-routing.en.md +5 -5
- package/design-patterns/routing/optimal-transport-routing.md +6 -6
- package/design-patterns/routing/spectral-clustering-routing.en.md +26 -15
- package/design-patterns/routing/spectral-clustering-routing.md +26 -17
- package/knowledge-base/differential-geometry/connection.en.md +17 -2
- package/knowledge-base/differential-geometry/connection.md +17 -2
- package/knowledge-base/differential-geometry/curvature.en.md +14 -1
- package/knowledge-base/differential-geometry/curvature.md +14 -1
- package/knowledge-base/differential-geometry/geodesic.en.md +16 -2
- package/knowledge-base/differential-geometry/geodesic.md +16 -2
- package/knowledge-base/differential-geometry/index.en.md +52 -0
- package/knowledge-base/differential-geometry/index.md +52 -0
- package/knowledge-base/differential-geometry/manifold.en.md +15 -2
- package/knowledge-base/differential-geometry/manifold.md +15 -2
- package/knowledge-base/differential-geometry/metric-tensor.en.md +16 -2
- package/knowledge-base/differential-geometry/metric-tensor.md +16 -2
- package/knowledge-base/differential-geometry/tangent-space.en.md +17 -3
- package/knowledge-base/differential-geometry/tangent-space.md +17 -3
- package/knowledge-base/information-geometry/fisher-metric.en.md +24 -5
- package/knowledge-base/information-geometry/fisher-metric.md +24 -5
- package/knowledge-base/information-geometry/index.en.md +45 -0
- package/knowledge-base/information-geometry/index.md +45 -0
- package/knowledge-base/information-geometry/natural-gradient.en.md +17 -3
- package/knowledge-base/information-geometry/natural-gradient.md +17 -3
- package/knowledge-base/lie-theory/equivariance.en.md +18 -3
- package/knowledge-base/lie-theory/equivariance.md +18 -3
- package/knowledge-base/lie-theory/group-action.en.md +16 -2
- package/knowledge-base/lie-theory/group-action.md +16 -2
- package/knowledge-base/lie-theory/index.en.md +52 -0
- package/knowledge-base/lie-theory/index.md +52 -0
- package/knowledge-base/lie-theory/lie-algebra.en.md +17 -2
- package/knowledge-base/lie-theory/lie-algebra.md +17 -2
- package/knowledge-base/lie-theory/lie-group.en.md +17 -3
- package/knowledge-base/lie-theory/lie-group.md +17 -3
- package/knowledge-base/lie-theory/representation.en.md +17 -2
- package/knowledge-base/lie-theory/representation.md +17 -2
- package/knowledge-base/matrix-analysis/index.en.md +49 -0
- package/knowledge-base/matrix-analysis/index.md +49 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +20 -7
- package/knowledge-base/matrix-analysis/low-rank-approximation.md +20 -7
- package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +13 -1
- package/knowledge-base/matrix-analysis/matrix-perturbation.md +13 -1
- package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +20 -6
- package/knowledge-base/matrix-analysis/positive-semidefinite.md +20 -6
- package/knowledge-base/matrix-analysis/projection.en.md +14 -1
- package/knowledge-base/matrix-analysis/projection.md +14 -1
- package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +14 -1
- package/knowledge-base/matrix-analysis/spectral-decomposition.md +14 -1
- package/knowledge-base/optimization/constrained-optimization.en.md +17 -3
- package/knowledge-base/optimization/constrained-optimization.md +17 -3
- package/knowledge-base/optimization/convex-optimization.en.md +15 -2
- package/knowledge-base/optimization/convex-optimization.md +15 -2
- package/knowledge-base/optimization/index.en.md +50 -0
- package/knowledge-base/optimization/index.md +50 -0
- package/knowledge-base/optimization/lagrangian-duality.en.md +18 -4
- package/knowledge-base/optimization/lagrangian-duality.md +18 -4
- package/knowledge-base/optimization/proximal-method.en.md +15 -1
- package/knowledge-base/optimization/proximal-method.md +15 -1
- package/knowledge-base/optimization/riemannian-optimization.en.md +18 -4
- package/knowledge-base/optimization/riemannian-optimization.md +18 -4
- package/knowledge-base/overview.en.md +20 -8
- package/knowledge-base/overview.md +20 -8
- package/knowledge-base/probability/concentration-inequality.en.md +16 -2
- package/knowledge-base/probability/concentration-inequality.md +16 -2
- package/knowledge-base/probability/entropy.en.md +19 -3
- package/knowledge-base/probability/entropy.md +18 -2
- package/knowledge-base/probability/fisher-information.en.md +17 -3
- package/knowledge-base/probability/fisher-information.md +17 -3
- package/knowledge-base/probability/index.en.md +51 -0
- package/knowledge-base/probability/index.md +51 -0
- package/knowledge-base/probability/information-bottleneck.en.md +18 -2
- package/knowledge-base/probability/information-bottleneck.md +18 -2
- package/knowledge-base/probability/kl-divergence.en.md +15 -2
- package/knowledge-base/probability/kl-divergence.md +15 -2
- package/knowledge-base/topology/euler-characteristic.en.md +15 -2
- package/knowledge-base/topology/euler-characteristic.md +15 -2
- package/knowledge-base/topology/fundamental-group.en.md +16 -2
- package/knowledge-base/topology/fundamental-group.md +16 -2
- package/knowledge-base/topology/index.en.md +48 -0
- package/knowledge-base/topology/index.md +48 -0
- package/knowledge-base/topology/persistent-homology.en.md +17 -2
- package/knowledge-base/topology/persistent-homology.md +17 -2
- package/lenses/spectral.en.md +1 -1
- package/lenses/spectral.md +1 -1
- package/lenses/topological.en.md +1 -1
- package/lenses/topological.md +1 -1
- package/package.json +5 -5
- package/references/agentic-workflow.en.md +2 -2
- package/references/books/abstract-algebra.en.md +12 -12
- package/references/books/abstract-algebra.md +9 -9
- package/references/books/algebraic-geometry-rising-sea.en.md +2 -2
- package/references/books/differential-geometry.en.md +16 -16
- package/references/books/differential-geometry.md +14 -14
- package/references/books/matrix-analysis.en.md +3 -3
- package/references/books/matrix-analysis.md +24 -24
- package/references/books/micro-lie-theory.en.md +1 -1
- package/references/books/optimization-ml.en.md +15 -15
- package/references/books/optimization-ml.md +14 -14
- package/references/books/smooth-manifolds.en.md +3 -3
- package/references/books/smooth-manifolds.md +6 -6
- package/references/gpu-friendly-math.en.md +21 -8
- package/references/gpu-friendly-math.md +19 -4
- package/references/skill-index.en.md +105 -0
- package/references/skill-index.md +105 -0
- package/skills/math-research-activator/SKILL.en.md +70 -112
- package/skills/math-research-activator/SKILL.md +60 -100
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# GPU-Friendly Math Checklist
|
|
2
2
|
|
|
3
3
|
> This file is the **single source of truth** for the "GPU-feasibility" acceptance gate.
|
|
4
|
-
> The activator, the 15 thinking lenses, `books/*.md`, and `../agents/math-critic.md` all reference this file; no duplicate definitions elsewhere.
|
|
5
|
-
>
|
|
6
|
-
> This file is the single source of truth for the "GPU-feasibility" acceptance gate. The activator, the 15 thinking lenses, the book references, and the math-critic all point here.
|
|
4
|
+
> The activator, the 15 thinking lenses, `books/*.md`, and `../agents/math-critic.en.md` all reference this file; no duplicate definitions elsewhere.
|
|
7
5
|
|
|
8
6
|
## Eight-Dimension Abbreviations
|
|
9
7
|
|
|
@@ -18,6 +16,21 @@
|
|
|
18
16
|
| D7 | Sparse structure |
|
|
19
17
|
| D8 | Operator fusion |
|
|
20
18
|
|
|
19
|
+
## Quantitative Checklist
|
|
20
|
+
|
|
21
|
+
When evaluating each dimension, provide concrete numbers rather than just labels:
|
|
22
|
+
|
|
23
|
+
| Dimension | Quantitative Questions to Answer |
|
|
24
|
+
|-----------|--------------------------------|
|
|
25
|
+
| D1 Tensorization | What are the tensor shapes of core operations? Where is the batch dimension? |
|
|
26
|
+
| D2 GEMM-mappability | How many GEMM/matmul operations? What are the (M,N,K) dimensions of each? |
|
|
27
|
+
| D3 Complexity | Total FLOPs? Ratio vs. baseline (standard attention/MLP)? |
|
|
28
|
+
| D4 Memory | Peak memory (bytes)? Is an n×n matrix materialized? KV-Cache overhead? |
|
|
29
|
+
| D5 Low-precision | Numerical error magnitude under bf16/fp8? Mixed-precision strategy needed? |
|
|
30
|
+
| D6 Parallelism | Theoretical parallelism degree? Communication volume (bytes/step)? All-reduce required? |
|
|
31
|
+
| D7 Sparsity | Sparsity ratio (%)? Sparse format (CSR/BSR/block-sparse)? Dedicated kernel available? |
|
|
32
|
+
| D8 Operator Fusion | Number of fusible kernels? Reduction in kernel launches and memory transfers after fusion? |
|
|
33
|
+
|
|
21
34
|
## Core Proposition
|
|
22
35
|
|
|
23
36
|
**Mathematical beauty ≠ computability.** For a structure to truly enter training and inference on modern GPU clusters, it must simultaneously satisfy two requirements:
|
|
@@ -66,13 +79,13 @@ Common techniques for transforming "beautiful but non-computable" into "both bea
|
|
|
66
79
|
|
|
67
80
|
## Worked Example: Tropical Sheaf Attention
|
|
68
81
|
|
|
69
|
-
Drawn from the auto-research directions cited in `agentic-workflow.md`, demonstrating how a **candidate design enters the 8-dimension verification**:
|
|
82
|
+
Drawn from the auto-research directions cited in `agentic-workflow.en.md`, demonstrating how a **candidate design enters the 8-dimension verification**:
|
|
70
83
|
|
|
71
84
|
| Component | Mathematical Source | GPU Friendliness |
|
|
72
85
|
|-----------|-------------------|-----------------|
|
|
73
|
-
| Tropical Gating | Tropical semiring, piecewise-linear | Replaces Top-K: element-wise max-plus —
|
|
74
|
-
| Cellular Sheaf Diffusion | Algebraic geometry / topology (sheaves, restriction maps) | Each edge is a low-rank linear transform = small GEMM (
|
|
75
|
-
| Čech Cohomology Regularization | Algebraic topology (first cohomology $H^1$) | Local, inexpensive; serves as an algebraic criterion for hallucination (
|
|
76
|
-
| Low-Rank Basis KV Compression (Plücker/Grassmannian perspective) | Projective geometry | Store the basis rather than Plücker coordinates (the latter expands when low-rank); block-summary candidate — compression ratio / error / throughput must be benchmarked (
|
|
86
|
+
| Tropical Gating | Tropical semiring, piecewise-linear | Replaces Top-K: element-wise max-plus — D1[v] / D2[x] Not a Tensor Core GEMM (runs on CUDA cores) / D3[v] Per-token gating only, sub-quadratic (min-plus matmul is APSP-hard, not sub-quadratic); sub-differentiable, kinks require LogSumExp smoothing (smoothing recovers standard softmax) |
|
|
87
|
+
| Cellular Sheaf Diffusion | Algebraic geometry / topology (sheaves, restriction maps) | Each edge is a low-rank linear transform = small GEMM (D2/D4) |
|
|
88
|
+
| Čech Cohomology Regularization | Algebraic topology (first cohomology $H^1$) | Local, inexpensive; serves as an algebraic criterion for hallucination (D3/D8) |
|
|
89
|
+
| Low-Rank Basis KV Compression (Plücker/Grassmannian perspective) | Projective geometry | Store the basis rather than Plücker coordinates (the latter expands when low-rank); block-summary candidate — compression ratio / error / throughput must be benchmarked (D4) |
|
|
77
90
|
|
|
78
91
|
Do not treat the table above as validated conclusions. The correct approach is to enter each component into the test plan: prove or estimate complexity, measure peak memory and throughput, check bf16/fp8 stability, and confirm whether it can be mapped to GEMM / batched GEMM / fused kernels. Only after both empirical benchmarks and theoretical derivations pass should a component be labeled "math beautiful × GPU friendly."
|
|
@@ -20,6 +20,21 @@
|
|
|
20
20
|
| D7 | 稀疏结构 |
|
|
21
21
|
| D8 | 算子融合 |
|
|
22
22
|
|
|
23
|
+
## 量化检查清单
|
|
24
|
+
|
|
25
|
+
评估每个维度时,应填写具体数值而非仅给标签:
|
|
26
|
+
|
|
27
|
+
| 维度 | 需回答的量化问题 |
|
|
28
|
+
|------|----------------|
|
|
29
|
+
| D1 张量化 | 核心操作的 tensor shape 是什么?batch 维在哪? |
|
|
30
|
+
| D2 GEMM 可映射 | 操作可分解为几次 GEMM/matmul?每次的 (M,N,K) 是多少? |
|
|
31
|
+
| D3 复杂度 | FLOPs 总量?与 baseline (标准 attention/MLP) 的比值? |
|
|
32
|
+
| D4 显存 | 峰值显存 (bytes)?是否物化 n×n 矩阵?KV-Cache 额外开销? |
|
|
33
|
+
| D5 低精度 | bf16/fp8 下的数值误差量级?是否需要混合精度策略? |
|
|
34
|
+
| D6 并行 | 理论并行度?通信量 (bytes/step)?是否需要 all-reduce? |
|
|
35
|
+
| D7 稀疏 | 稀疏度 (%)?稀疏格式 (CSR/BSR/block-sparse)?是否有专用 kernel? |
|
|
36
|
+
| D8 算子融合 | 可融合的 kernel 数?融合后减少的 kernel launch 次数和显存搬运量? |
|
|
37
|
+
|
|
23
38
|
## 核心命题 / Core Proposition
|
|
24
39
|
|
|
25
40
|
**数学美 ≠ 可算。** 一个结构要真正进入现代 GPU 集群的训练与推理,必须同时满足两件事:
|
|
@@ -72,9 +87,9 @@
|
|
|
72
87
|
|
|
73
88
|
| 组件 | 数学来源 | GPU 友好性 |
|
|
74
89
|
|------|---------|-----------|
|
|
75
|
-
| 热带门控 Tropical Gating | 热带半环分段线性 | 替代 Top-K:逐元素 max-plus——
|
|
76
|
-
| 胞腔层扩散 Cellular Sheaf Diffusion | 代数几何/拓扑(层、限制映射)| 每边低秩线性变换 = 小 GEMM
|
|
77
|
-
| Čech 上同调正则 | 代数拓扑(一阶上同调 H¹)|
|
|
78
|
-
| 低秩基底 KV 压缩(Plücker/Grassmannian 视角) | 射影几何 | 存基底而非 Plücker
|
|
90
|
+
| 热带门控 Tropical Gating | 热带半环分段线性 | 替代 Top-K:逐元素 max-plus——D1[v] / D2[x] 非 Tensor Core GEMM(落 CUDA core)/ D3[v] 仅逐 token 门控亚二次(min-plus matmul 则 APSP-hard 非亚二次);次可微,折点需 LogSumExp 软化(软化退回标准 softmax)|
|
|
91
|
+
| 胞腔层扩散 Cellular Sheaf Diffusion | 代数几何/拓扑(层、限制映射)| 每边低秩线性变换 = 小 GEMM(D2/D4)|
|
|
92
|
+
| Čech 上同调正则 | 代数拓扑(一阶上同调 H¹)| 局部、廉价;作幻觉的代数判据(D3/D8)|
|
|
93
|
+
| 低秩基底 KV 压缩(Plücker/Grassmannian 视角) | 射影几何 | 存基底而非 Plücker 坐标(后者低秩时反扩张);块摘要候选,压缩率/误差/吞吐需实测(D4)|
|
|
79
94
|
|
|
80
95
|
使用时不要把上表当作已验证结论。正确做法是把每个组件写进 testplan:证明或估计复杂度,测峰值显存和吞吐,检查 bf16/fp8 稳定性,确认能否落到 GEMM / batched GEMM / fused kernel。只有实测和推导都通过后,才标为 "math beautiful × GPU friendly"。
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Skill Index: Lens Library, Knowledge Base, Design Pattern Library, Workflow Examples
|
|
2
|
+
|
|
3
|
+
> This file is extracted from `../skills/math-research-activator/SKILL.en.md` for reference when the full catalogs are needed. SKILL.en.md retains condensed summaries with links to this file.
|
|
4
|
+
|
|
5
|
+
## Language Routing & Mixed-Input Rules (Full Version)
|
|
6
|
+
|
|
7
|
+
Language routing only determines "which language version to read" and "what language to respond in." It does NOT affect whether the math system triggers or the A/B/C/D/E scenario classification.
|
|
8
|
+
|
|
9
|
+
### Decision Rules
|
|
10
|
+
|
|
11
|
+
1. **Judge the natural-language frame first**
|
|
12
|
+
- If the user's sentence structure, verbs, and mood particles are primarily Chinese, treat as Chinese even if English technical terms are interspersed.
|
|
13
|
+
- E.g., "帮我 design 一个 attention" / "这个 loss 有没有理论问题" / "能不能用 manifold 做 routing" → Chinese.
|
|
14
|
+
|
|
15
|
+
2. **English technical terms do not count as English primary language**
|
|
16
|
+
- attention, loss, routing, embedding, manifold, operator, kernel, KV-cache, transformer, MoE, and similar AI/math/engineering terms are domain terms and do not trigger a switch to English.
|
|
17
|
+
|
|
18
|
+
3. **Code, paths, and formulas are excluded from language detection**
|
|
19
|
+
- File paths, function names, variable names, LaTeX formulas, and CLI arguments do not count toward language ratio.
|
|
20
|
+
|
|
21
|
+
4. **When primary language is unclear, follow the user's last clear language**
|
|
22
|
+
- If the CN/EN ratio is close and indeterminate, use the user's most recent unambiguous natural language.
|
|
23
|
+
- If there is no prior context, default to Chinese.
|
|
24
|
+
|
|
25
|
+
5. **Output language matches primary language**
|
|
26
|
+
- Chinese primary → read `../skills/math-research-activator/SKILL.md`, respond in Chinese, retaining necessary English terms.
|
|
27
|
+
- English primary → read `../skills/math-research-activator/SKILL.en.md`, respond in English.
|
|
28
|
+
- If the user explicitly requests "in English" / "in Chinese," follow the explicit request.
|
|
29
|
+
|
|
30
|
+
## Lens Library (15 Mathematical Perspectives)
|
|
31
|
+
|
|
32
|
+
Each lens answers: What is this perspective? What kinds of problems is it suited to diagnose? Which knowledge domains does it route to?
|
|
33
|
+
|
|
34
|
+
| Lens | File | Core Perspective |
|
|
35
|
+
|------|------|-----------------|
|
|
36
|
+
| Axiomatization | `../lenses/axiomatization.en.md` | Examine consistency/independence/completeness of assumptions |
|
|
37
|
+
| Duality | `../lenses/duality.en.md` | Transform to the dual space to expose constraints and invariants |
|
|
38
|
+
| Symmetry | `../lenses/symmetry.en.md` | Invariants and conservation laws under transformations |
|
|
39
|
+
| Spectral Decomposition | `../lenses/spectral.en.md` | Eigenvalues/singular values reveal dominant structure |
|
|
40
|
+
| Geometric | `../lenses/geometric.en.md` | Metric/curvature/spatial structure on manifolds |
|
|
41
|
+
| Projection & Decomposition | `../lenses/projection.en.md` | Orthogonal decomposition, subspace separation, conflict elimination |
|
|
42
|
+
| Variational | `../lenses/variational.en.md` | Constrained extrema, energy minimization |
|
|
43
|
+
| Local-to-Global | `../lenses/local-to-global.en.md` | Patching local properties into global ones, cohomological obstructions |
|
|
44
|
+
| Topological | `../lenses/topological.en.md` | Invariants under continuous deformation, connectedness, holes |
|
|
45
|
+
| Categorical | `../lenses/categorical.en.md` | Universal properties, functors, natural transformations |
|
|
46
|
+
| Perturbation | `../lenses/perturbation.en.md` | Propagation of small perturbations, stability, robustness |
|
|
47
|
+
| Causal | `../lenses/causal.en.md` | Correlation ≠ causation, interventions, counterfactuals |
|
|
48
|
+
| Game-Theoretic | `../lenses/game.en.md` | Multi-agent strategic interaction, equilibria, mechanism design |
|
|
49
|
+
| Probabilistic & Statistical | `../lenses/probabilistic.en.md` | Quantifying uncertainty, Bayesian updating |
|
|
50
|
+
| Algorithmic | `../lenses/algorithmic.en.md` | Complexity, feasibility, parallelizability |
|
|
51
|
+
|
|
52
|
+
## Knowledge Base (Organized by Mathematical Domain)
|
|
53
|
+
|
|
54
|
+
Each knowledge card answers: Minimal definition, core formulas, applicable problems, AI design translation, engineering feasibility, risks.
|
|
55
|
+
|
|
56
|
+
| Domain | Directory | Knowledge Cards |
|
|
57
|
+
|--------|-----------|----------------|
|
|
58
|
+
| Matrix Analysis | `../knowledge-base/matrix-analysis/` | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
|
|
59
|
+
| Optimization | `../knowledge-base/optimization/` | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
|
|
60
|
+
| Differential Geometry | `../knowledge-base/differential-geometry/` | manifold, tangent-space, metric-tensor, geodesic, curvature, connection |
|
|
61
|
+
| Lie Theory | `../knowledge-base/lie-theory/` | group-action, lie-group, lie-algebra, representation, equivariance |
|
|
62
|
+
| Topology | `../knowledge-base/topology/` | persistent-homology, euler-characteristic, fundamental-group |
|
|
63
|
+
| Probability & Information | `../knowledge-base/probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
|
|
64
|
+
| Information Geometry | `../knowledge-base/information-geometry/` | natural-gradient, fisher-metric |
|
|
65
|
+
|
|
66
|
+
## Design Pattern Library (Organized by AI Component)
|
|
67
|
+
|
|
68
|
+
Each design pattern answers: Mathematical origin, AI module form, implementable architecture, GPU feasibility, paper-level exposition, risks.
|
|
69
|
+
|
|
70
|
+
| Component Type | Directory | Patterns |
|
|
71
|
+
|---------------|-----------|----------|
|
|
72
|
+
| Attention | `../design-patterns/attention/` | projection-attention, spectral-attention, equivariant-attention, geometry-aware-attention, information-bottleneck-attention |
|
|
73
|
+
| Loss Functions | `../design-patterns/loss/` | orthogonality-loss, contrastive-loss, variational-loss, information-bottleneck-loss, constraint-penalty |
|
|
74
|
+
| Routing | `../design-patterns/routing/` | optimal-transport-routing, graph-routing, moe-routing, spectral-clustering-routing |
|
|
75
|
+
| Representation | `../design-patterns/representation/` | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
|
|
76
|
+
| Compression | `../design-patterns/compression/` | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
|
|
77
|
+
|
|
78
|
+
## Workflow Example
|
|
79
|
+
|
|
80
|
+
**User**: "Design a new KV Cache compression method that preserves long-range dependencies — I don't want to just do top-k."
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Step 1 — Diagnosis: Scenario B (Mechanism Design)
|
|
84
|
+
Problem type: Sequence memory compression + information preservation + long-range structure
|
|
85
|
+
Core tension: Compressing token count vs. preserving long-range dependencies
|
|
86
|
+
|
|
87
|
+
Step 2 — Lens Selection:
|
|
88
|
+
1. Spectral Decomposition (preserve dominant subspace)
|
|
89
|
+
2. Information Theory (retain states with maximum mutual information)
|
|
90
|
+
3. Topological (preserve critical connectivity points of sequential structure)
|
|
91
|
+
|
|
92
|
+
Step 3 — Knowledge Query:
|
|
93
|
+
→ low-rank-approximation (Matrix Analysis)
|
|
94
|
+
→ leverage-score-selection (Design Pattern: compression)
|
|
95
|
+
→ information-bottleneck (Probability & Information)
|
|
96
|
+
|
|
97
|
+
Step 4 — Design Translation:
|
|
98
|
+
Candidate A: Spectral KV Compression (low-rank + leverage score)
|
|
99
|
+
Candidate B: Information-Preserving Cache (query sensitivity)
|
|
100
|
+
Candidate C: Topology-Preserving Cache (graph bridge-node retention)
|
|
101
|
+
|
|
102
|
+
Step 5 — Critic Review:
|
|
103
|
+
A is most GPU-friendly; B requires estimating future queries with inherent uncertainty; C has prohibitive graph construction cost
|
|
104
|
+
Recommendation: Prioritize A; use B as a lightweight gate
|
|
105
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Skill 索引:透镜库、知识库、设计模式库、工作流范例
|
|
2
|
+
|
|
3
|
+
> 本文件从 `../skills/math-research-activator/SKILL.md` 提取,供需要查阅完整目录时使用。SKILL.md 保留精简摘要和指向本文件的链接。
|
|
4
|
+
|
|
5
|
+
## 语言路由与混合输入规则(完整版)
|
|
6
|
+
|
|
7
|
+
语言路由只决定"读取哪个语言版本的说明"和"最终用什么语言回答",不参与数学系统是否触发、也不参与 A/B/C/D/E 场景判断。
|
|
8
|
+
|
|
9
|
+
### 判定规则
|
|
10
|
+
|
|
11
|
+
1. **先判断自然语言主框架**
|
|
12
|
+
- 如果用户的请求句式、动词、语气词主要是中文,即使夹杂英文技术词,也按中文处理。
|
|
13
|
+
- 例如:"帮我 design 一个 attention""这个 loss 有没有理论问题""能不能用 manifold 做 routing"均按中文处理。
|
|
14
|
+
|
|
15
|
+
2. **英文技术词不计入英文主语言**
|
|
16
|
+
- attention、loss、routing、embedding、manifold、operator、kernel、KV-cache、transformer、MoE 等 AI/数学/工程术语视为领域术语,不作为切换到英文的依据。
|
|
17
|
+
|
|
18
|
+
3. **代码、路径、公式不参与语言判定**
|
|
19
|
+
- 文件路径、函数名、变量名、LaTeX 公式、命令行参数不计入语言比例。
|
|
20
|
+
|
|
21
|
+
4. **主语言不明显时,沿用用户上一轮主要语言**
|
|
22
|
+
- 若中英文比例接近且无法判断,以用户最近一次明确使用的自然语言为准。
|
|
23
|
+
- 若没有上下文,默认中文。
|
|
24
|
+
|
|
25
|
+
5. **输出语言与主语言一致**
|
|
26
|
+
- 中文主语言 → 读取中文 `../skills/math-research-activator/SKILL.md`,用中文回答,保留必要英文术语。
|
|
27
|
+
- 英文主语言 → 读取 `../skills/math-research-activator/SKILL.en.md`,用英文回答。
|
|
28
|
+
- 用户明确要求"用英文/用中文"时,以用户显式要求为准。
|
|
29
|
+
|
|
30
|
+
## 透镜库(15 个数学视角)
|
|
31
|
+
|
|
32
|
+
每个透镜回答:这是什么视角?适合诊断什么问题?会路由到哪些知识域?
|
|
33
|
+
|
|
34
|
+
| 透镜 | 文件 | 核心视角 |
|
|
35
|
+
|------|------|---------|
|
|
36
|
+
| 公理化 | `../lenses/axiomatization.md` | 审查假设的相容性/独立性/完备性 |
|
|
37
|
+
| 对偶 | `../lenses/duality.md` | 转换到对偶空间暴露约束与不变量 |
|
|
38
|
+
| 对称性 | `../lenses/symmetry.md` | 变换下的不变量与守恒律 |
|
|
39
|
+
| 谱分解 | `../lenses/spectral.md` | 特征值/奇异值揭示主导结构 |
|
|
40
|
+
| 几何 | `../lenses/geometric.md` | 度量/曲率/流形上的空间结构 |
|
|
41
|
+
| 投影与分解 | `../lenses/projection.md` | 正交分解、子空间分离、冲突消除 |
|
|
42
|
+
| 变分 | `../lenses/variational.md` | 约束下极值、能量最小化 |
|
|
43
|
+
| 局部到整体 | `../lenses/local-to-global.md` | 局部性质拼接为全局、层上同调障碍 |
|
|
44
|
+
| 拓扑 | `../lenses/topological.md` | 连续变形不变量、连通性、空洞 |
|
|
45
|
+
| 范畴化 | `../lenses/categorical.md` | 泛性质、函子、自然变换 |
|
|
46
|
+
| 扰动 | `../lenses/perturbation.md` | 小扰动的传播、稳定性、鲁棒性 |
|
|
47
|
+
| 因果 | `../lenses/causal.md` | 相关≠因果、干预、反事实 |
|
|
48
|
+
| 博弈 | `../lenses/game.md` | 多方策略互动、均衡、机制设计 |
|
|
49
|
+
| 概率统计 | `../lenses/probabilistic.md` | 量化不确定性、贝叶斯更新 |
|
|
50
|
+
| 算法 | `../lenses/algorithmic.md` | 复杂度、可行性、并行性 |
|
|
51
|
+
|
|
52
|
+
## 知识库(按数学领域组织)
|
|
53
|
+
|
|
54
|
+
每个知识卡片回答:最小定义、核心公式、适用问题、AI 设计翻译、工程可行性、风险。
|
|
55
|
+
|
|
56
|
+
| 领域 | 目录 | 知识卡片 |
|
|
57
|
+
|------|------|---------|
|
|
58
|
+
| 矩阵分析 | `../knowledge-base/matrix-analysis/` | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
|
|
59
|
+
| 最优化 | `../knowledge-base/optimization/` | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
|
|
60
|
+
| 微分几何 | `../knowledge-base/differential-geometry/` | manifold, tangent-space, metric-tensor, geodesic, curvature, connection |
|
|
61
|
+
| 李理论 | `../knowledge-base/lie-theory/` | group-action, lie-group, lie-algebra, representation, equivariance |
|
|
62
|
+
| 拓扑 | `../knowledge-base/topology/` | persistent-homology, euler-characteristic, fundamental-group |
|
|
63
|
+
| 概率与信息 | `../knowledge-base/probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
|
|
64
|
+
| 信息几何 | `../knowledge-base/information-geometry/` | natural-gradient, fisher-metric |
|
|
65
|
+
|
|
66
|
+
## 设计模式库(按 AI 组件组织)
|
|
67
|
+
|
|
68
|
+
每个设计模式回答:数学来源、AI 模块形式、可实现结构、GPU 可行性、论文表述、风险。
|
|
69
|
+
|
|
70
|
+
| 组件类型 | 目录 | 模式 |
|
|
71
|
+
|---------|------|------|
|
|
72
|
+
| 注意力 | `../design-patterns/attention/` | projection-attention, spectral-attention, equivariant-attention, geometry-aware-attention, information-bottleneck-attention |
|
|
73
|
+
| 损失函数 | `../design-patterns/loss/` | orthogonality-loss, contrastive-loss, variational-loss, information-bottleneck-loss, constraint-penalty |
|
|
74
|
+
| 路由 | `../design-patterns/routing/` | optimal-transport-routing, graph-routing, moe-routing, spectral-clustering-routing |
|
|
75
|
+
| 表示 | `../design-patterns/representation/` | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
|
|
76
|
+
| 压缩 | `../design-patterns/compression/` | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
|
|
77
|
+
|
|
78
|
+
## 工作流范例
|
|
79
|
+
|
|
80
|
+
**用户**:"设计新的 KV Cache 压缩方法,保留长期依赖,不想只做 top-k"
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
第一步 诊断:场景 B(机制设计)
|
|
84
|
+
问题类型:序列记忆压缩 + 信息保留 + 长程结构
|
|
85
|
+
核心张力:压缩 token 数量 vs 不破坏长期依赖
|
|
86
|
+
|
|
87
|
+
第二步 透镜选择:
|
|
88
|
+
1. 谱分解(保留主导子空间)
|
|
89
|
+
2. 信息论(保留最大互信息状态)
|
|
90
|
+
3. 拓扑(保留序列结构关键连接点)
|
|
91
|
+
|
|
92
|
+
第三步 知识查询:
|
|
93
|
+
→ low-rank-approximation(矩阵分析)
|
|
94
|
+
→ leverage-score-selection(设计模式:压缩)
|
|
95
|
+
→ information-bottleneck(概率与信息)
|
|
96
|
+
|
|
97
|
+
第四步 设计翻译:
|
|
98
|
+
候选 A:Spectral KV Compression(低秩 + leverage score)
|
|
99
|
+
候选 B:Information-Preserving Cache(query sensitivity)
|
|
100
|
+
候选 C:Topology-Preserving Cache(图桥接节点保留)
|
|
101
|
+
|
|
102
|
+
第五步 Critic 审查:
|
|
103
|
+
A 最 GPU 友好,B 需估计未来 query 有不确定性,C 图构建成本过高
|
|
104
|
+
建议:优先 A,B 作轻量 gate
|
|
105
|
+
```
|
|
@@ -5,32 +5,7 @@ description: |
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
> **
|
|
9
|
-
>
|
|
10
|
-
> ## Language Routing & Mixed-Input Rules
|
|
11
|
-
>
|
|
12
|
-
> Language routing only determines "which language version to read" and "what language to respond in." It does NOT affect whether the math system triggers or the A/B/C/D/E scenario classification.
|
|
13
|
-
>
|
|
14
|
-
> ### Decision Rules
|
|
15
|
-
>
|
|
16
|
-
> 1. **Judge the natural-language frame first**
|
|
17
|
-
> - If the user's sentence structure, verbs, and mood particles are primarily Chinese, treat as Chinese even if English technical terms are interspersed.
|
|
18
|
-
> - E.g., "帮我 design 一个 attention" / "这个 loss 有没有理论问题" → Chinese.
|
|
19
|
-
>
|
|
20
|
-
> 2. **English technical terms do not count as English primary language**
|
|
21
|
-
> - attention, loss, routing, embedding, manifold, operator, kernel, KV-cache, transformer, MoE, etc. are domain terms and do not trigger a switch to English.
|
|
22
|
-
>
|
|
23
|
-
> 3. **Code, paths, and formulas are excluded from language detection**
|
|
24
|
-
> - File paths, function names, variable names, LaTeX formulas, and CLI arguments do not count toward language ratio.
|
|
25
|
-
>
|
|
26
|
-
> 4. **When primary language is unclear, follow the user's last clear language**
|
|
27
|
-
> - If the CN/EN ratio is close and indeterminate, use the user's most recent unambiguous natural language.
|
|
28
|
-
> - If there is no prior context, default to Chinese.
|
|
29
|
-
>
|
|
30
|
-
> 5. **Output language matches primary language**
|
|
31
|
-
> - Chinese primary → read `SKILL.md`, respond in Chinese, retaining necessary English terms.
|
|
32
|
-
> - English primary → read `SKILL.en.md`, respond in English.
|
|
33
|
-
> - If the user explicitly requests "in English" / "in Chinese," follow the explicit request.
|
|
8
|
+
> **Language Routing & Mixed-Input Rules**: Judge primary language by sentence structure/verbs/mood particles. AI/math/engineering terms don't count. Code/paths/formulas excluded. When CN/EN ratio is close, follow last turn; default to Chinese if no context. Explicit request overrides. Chinese → `SKILL.md`, English → this file. Full rules: `../../references/skill-index.en.md`.
|
|
34
9
|
|
|
35
10
|
# Math Research OS
|
|
36
11
|
|
|
@@ -38,18 +13,26 @@ description: |
|
|
|
38
13
|
|
|
39
14
|
This system is a mathematical staff office for AI architecture innovation — not an arsenal, but one that tells you: **what kind of battle this is, which arms to deploy, how to deploy them, and where things could go wrong.**
|
|
40
15
|
|
|
16
|
+
## Core Principle
|
|
17
|
+
|
|
18
|
+
> Math Skill does not store mathematics. It activates, routes, and translates mathematics for AI research.
|
|
19
|
+
|
|
20
|
+
- **knowledge-base/** is not a closed encyclopedia but a set of mathematical activation anchors
|
|
21
|
+
- When existing cards cannot cover a problem, the agent must NOT stop or force-fit; instead, generate a "temporary knowledge card" based on lenses, reference layers, and the agent's own mathematical knowledge, then continue with design translation
|
|
22
|
+
- **design-patterns/** is a collection of math→AI translation prototypes, not a complete model repository; when no matching pattern exists, generate a temporary design candidate from the mathematical structure and label it as a temporary design pattern
|
|
23
|
+
|
|
41
24
|
## Three-Layer Orthogonal Architecture
|
|
42
25
|
|
|
43
26
|
| Layer | Responsibility | Directory | Core Question |
|
|
44
27
|
|-------|---------------|-----------|--------------|
|
|
45
|
-
| **Thinking Lenses** | Diagnose problem structure, recommend mathematical perspectives | `../../lenses/*.md` | Which perspective should we view this problem through? |
|
|
46
|
-
| **Math Knowledge** | Provide concrete mathematical tools (definitions/theorems/formulas) | `../../knowledge-base/*/*.md` | What specific mathematics does this perspective require? |
|
|
47
|
-
| **Design Translation** | Translate mathematics into AI modules/losses/operators | `../../design-patterns/*/*.md` | How does this mathematics become model architecture? |
|
|
28
|
+
| **Thinking Lenses** | Diagnose problem structure, recommend mathematical perspectives | `../../lenses/*.en.md` | Which perspective should we view this problem through? |
|
|
29
|
+
| **Math Knowledge** | Provide concrete mathematical tools (definitions/theorems/formulas) | `../../knowledge-base/*/*.en.md` | What specific mathematics does this perspective require? |
|
|
30
|
+
| **Design Translation** | Translate mathematics into AI modules/losses/operators | `../../design-patterns/*/*.en.md` | How does this mathematics become model architecture? |
|
|
48
31
|
|
|
49
32
|
Auxiliary layers:
|
|
50
|
-
- `../../references/books/*.md`: Distilled notes from 7 textbooks; full context when deeper understanding is needed
|
|
51
|
-
- `../../references/gpu-friendly-math.md`: GPU Eight-Dimension Acceptance Gate (single source of truth)
|
|
52
|
-
- `../../agents/math-critic.md`: Math-engineering dual critic
|
|
33
|
+
- `../../references/books/*.en.md`: Distilled notes from 7 textbooks; full context when deeper understanding is needed
|
|
34
|
+
- `../../references/gpu-friendly-math.en.md`: GPU Eight-Dimension Acceptance Gate (single source of truth)
|
|
35
|
+
- `../../agents/math-critic.en.md`: Math-engineering dual critic
|
|
53
36
|
|
|
54
37
|
## Intent Diagnosis (5 Scenarios)
|
|
55
38
|
|
|
@@ -58,56 +41,20 @@ Auxiliary layers:
|
|
|
58
41
|
| **A. Problem Analysis** | "Is this design sound?" "Are there gaps in the reasoning chain?" | Lenses → critic |
|
|
59
42
|
| **B. Mechanism Design** | "Design a new attention mechanism" "Transfer X to Y" | Lenses → Knowledge → Design → critic |
|
|
60
43
|
| **C. Knowledge Query** | "What is a tangent space on a manifold?" "How is the projection theorem applied?" | Knowledge |
|
|
61
|
-
| **D. Verification & Review** | "Does this formula hold?" "What guarantees does this loss provide?" | Knowledge → critic |
|
|
44
|
+
| **D. Verification & Review** | "Does this formula hold?" "What guarantees does this loss provide?" | Knowledge → relevant design patterns (if a concrete AI construct is cited) → critic |
|
|
62
45
|
| **E. Pure Engineering** | Debugging, refactoring, hyperparameter tuning, code review | **Do not invoke the math system** |
|
|
63
46
|
|
|
64
47
|
## Lens Library (15 Mathematical Perspectives)
|
|
65
48
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
| Lens | File | Core Perspective |
|
|
69
|
-
|------|------|-----------------|
|
|
70
|
-
| Axiomatization | `../../lenses/axiomatization.md` | Examine consistency/independence/completeness of assumptions |
|
|
71
|
-
| Duality | `../../lenses/duality.md` | Transform to the dual space to expose constraints and invariants |
|
|
72
|
-
| Symmetry | `../../lenses/symmetry.md` | Invariants and conservation laws under transformations |
|
|
73
|
-
| Spectral Decomposition | `../../lenses/spectral.md` | Eigenvalues/singular values reveal dominant structure |
|
|
74
|
-
| Geometric | `../../lenses/geometric.md` | Metric/curvature/spatial structure on manifolds |
|
|
75
|
-
| Projection & Decomposition | `../../lenses/projection.md` | Orthogonal decomposition, subspace separation, conflict elimination |
|
|
76
|
-
| Variational | `../../lenses/variational.md` | Constrained extrema, energy minimization |
|
|
77
|
-
| Local-to-Global | `../../lenses/local-to-global.md` | Patching local properties into global ones, cohomological obstructions |
|
|
78
|
-
| Topological | `../../lenses/topological.md` | Invariants under continuous deformation, connectedness, holes |
|
|
79
|
-
| Categorical | `../../lenses/categorical.md` | Universal properties, functors, natural transformations |
|
|
80
|
-
| Perturbation | `../../lenses/perturbation.md` | Propagation of small perturbations, stability, robustness |
|
|
81
|
-
| Causal | `../../lenses/causal.md` | Correlation ≠ causation, interventions, counterfactuals |
|
|
82
|
-
| Game-Theoretic | `../../lenses/game.md` | Multi-agent strategic interaction, equilibria, mechanism design |
|
|
83
|
-
| Probabilistic & Statistical | `../../lenses/probabilistic.md` | Quantifying uncertainty, Bayesian updating |
|
|
84
|
-
| Algorithmic | `../../lenses/algorithmic.md` | Complexity, feasibility, parallelizability |
|
|
49
|
+
15 lenses covering: Axiomatization, Duality, Symmetry, Spectral Decomposition, Geometric, Projection & Decomposition, Variational, Local-to-Global, Topological, Categorical, Perturbation, Causal, Game-Theoretic, Probabilistic & Statistical, Algorithmic. Directory: `../../lenses/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
|
|
85
50
|
|
|
86
51
|
## Knowledge Base (Organized by Mathematical Domain)
|
|
87
52
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
| Domain | Directory | Knowledge Cards |
|
|
91
|
-
|--------|-----------|----------------|
|
|
92
|
-
| Matrix Analysis | `../../knowledge-base/matrix-analysis/` | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
|
|
93
|
-
| Optimization | `../../knowledge-base/optimization/` | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
|
|
94
|
-
| Differential Geometry | `../../knowledge-base/differential-geometry/` | manifold, tangent-space, metric-tensor, geodesic, curvature, connection |
|
|
95
|
-
| Lie Theory | `../../knowledge-base/lie-theory/` | group-action, lie-group, lie-algebra, representation, equivariance |
|
|
96
|
-
| Topology | `../../knowledge-base/topology/` | persistent-homology, euler-characteristic, fundamental-group |
|
|
97
|
-
| Probability & Information | `../../knowledge-base/probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
|
|
98
|
-
| Information Geometry | `../../knowledge-base/information-geometry/` | natural-gradient, fisher-metric |
|
|
53
|
+
7 domains: Matrix Analysis, Optimization, Differential Geometry, Lie Theory, Topology, Probability & Information, Information Geometry. Directory: `../../knowledge-base/*/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
|
|
99
54
|
|
|
100
55
|
## Design Pattern Library (Organized by AI Component)
|
|
101
56
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| Component Type | Directory | Patterns |
|
|
105
|
-
|---------------|-----------|----------|
|
|
106
|
-
| Attention | `../../design-patterns/attention/` | projection-attention, spectral-attention, equivariant-attention, geometry-aware-attention, information-bottleneck-attention |
|
|
107
|
-
| Loss Functions | `../../design-patterns/loss/` | orthogonality-loss, contrastive-loss, variational-loss, information-bottleneck-loss, constraint-penalty |
|
|
108
|
-
| Routing | `../../design-patterns/routing/` | optimal-transport-routing, graph-routing, moe-routing, spectral-clustering-routing |
|
|
109
|
-
| Representation | `../../design-patterns/representation/` | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
|
|
110
|
-
| Compression | `../../design-patterns/compression/` | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
|
|
57
|
+
5 component types: Attention, Loss Functions, Routing, Representation, Compression. Directory: `../../design-patterns/*/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
|
|
111
58
|
|
|
112
59
|
## Automatic Trigger Conditions
|
|
113
60
|
|
|
@@ -138,76 +85,87 @@ The user's intent matches one of scenarios A/B/C/D. Pure engineering tasks match
|
|
|
138
85
|
|
|
139
86
|
```
|
|
140
87
|
Scenario A (Analysis): Select 1–3 lenses → output perspective diagnosis → critic review
|
|
141
|
-
Scenario B (Design): Select 1–3 lenses →
|
|
142
|
-
Scenario C (Query):
|
|
143
|
-
Scenario D (Verification): Load knowledge cards → critic reviews conditions and boundaries
|
|
88
|
+
Scenario B (Design): Select 1–3 lenses → invoke relevant activation anchors; if no coverage, enter Knowledge Gap Protocol → generate formal/temporary design patterns → critic review
|
|
89
|
+
Scenario C (Query): Prefer loading relevant activation anchors; if no coverage, generate temporary knowledge card → output per knowledge activation protocol
|
|
90
|
+
Scenario D (Verification): Load relevant anchors or temporary knowledge cards → critic reviews conditions and boundaries
|
|
144
91
|
Scenario E (Engineering): No intervention
|
|
145
92
|
```
|
|
146
93
|
|
|
147
94
|
### Step 3: Output Format
|
|
148
95
|
|
|
96
|
+
**Token-economy rule**: The following is the maximum structure, not the default full template. Trim to the user's question; for simple knowledge queries, provide only the needed definition / formula / risk. Expand design and GPU sections only when relevant, and do not restate loaded cards verbatim.
|
|
97
|
+
|
|
149
98
|
**Scenario A/B Output**:
|
|
150
99
|
1. **[Diagnosis]** Problem type + core tension
|
|
151
100
|
2. **[Lens]** Recommend 1–3 mathematical perspectives (annotate why each is/is not suitable)
|
|
152
|
-
3. **[Knowledge]** (Scenario B only)
|
|
153
|
-
4. **[Design]** (Scenario B only) Candidate AI module drafts (reference design patterns)
|
|
101
|
+
3. **[Knowledge]** (Scenario B only) Activated mathematical structures (reference activation anchors or temporary knowledge cards)
|
|
102
|
+
4. **[Design]** (Scenario B only) Candidate AI module drafts (reference design patterns or temporary design drafts)
|
|
154
103
|
5. **[GPU]** Run candidates through the Eight-Dimension Gate (friendly/retrofittable/unfriendly)
|
|
155
104
|
6. **[Conclusion]** Retain candidates that pass both acceptance gates + next-step recommendations
|
|
156
105
|
|
|
157
|
-
**Scenario C Output** (Knowledge Activation Protocol):
|
|
106
|
+
**Scenario C Output** (Knowledge Activation Protocol, trimmed as needed):
|
|
158
107
|
1. Minimal definition
|
|
159
108
|
2. Core formulas
|
|
160
109
|
3. Applicable problems
|
|
161
|
-
4. AI design translation
|
|
162
|
-
5. Engineering feasibility
|
|
110
|
+
4. AI design translation (only when the question involves AI / operators)
|
|
111
|
+
5. Engineering feasibility (only when implementation / GPU matters)
|
|
163
112
|
6. Risks and failure conditions
|
|
164
|
-
7. Further references (
|
|
113
|
+
7. Further references (only when traceability is requested or the conclusion depends on book references)
|
|
165
114
|
|
|
166
|
-
**Scenario D Output
|
|
115
|
+
**Scenario D Output** (short conclusion first + conditions/boundaries):
|
|
167
116
|
1. Conditions under which it holds
|
|
168
117
|
2. Conditions under which it fails
|
|
169
118
|
3. What it can guarantee at most
|
|
170
119
|
4. What it cannot guarantee
|
|
171
|
-
5. Engineering feasibility
|
|
120
|
+
5. Engineering feasibility (only when implementation / GPU matters)
|
|
172
121
|
|
|
173
122
|
**A conclusion must always be provided — never output analysis alone without convergence.**
|
|
174
123
|
|
|
175
124
|
## GPU Eight-Dimension Acceptance Gate
|
|
176
125
|
|
|
177
|
-
Formal terminology (single authoritative source: `../../references/gpu-friendly-math.md`):
|
|
126
|
+
Formal terminology (single authoritative source: `../../references/gpu-friendly-math.en.md`):
|
|
178
127
|
**Tensorization / GEMM-mappability / Complexity / Memory & KV-Cache / Low-Precision Stability / Parallelism & Communication / Sparse Structure / Operator Fusion**
|
|
179
128
|
|
|
129
|
+
**Quantitative assessment requirements**: For each candidate design, the GPU assessment should not only provide [v]/[~]/[x] labels but also answer:
|
|
130
|
+
1. FLOPs of core operations and ratio vs. baseline
|
|
131
|
+
2. Peak memory (bytes), whether large matrices are materialized
|
|
132
|
+
3. Numerical stability strategy under bf16/fp8
|
|
133
|
+
4. Number of fusible kernels and expected speedup
|
|
134
|
+
|
|
135
|
+
See the quantitative checklist in `../../references/gpu-friendly-math.en.md`.
|
|
136
|
+
|
|
180
137
|
## Depth-of-Consultation Protocol
|
|
181
138
|
|
|
182
|
-
- **Light**: Read knowledge cards (`../../knowledge-base/*/*.md`); self-contained and immediately usable
|
|
183
|
-
- **Medium**: Read distilled book notes (`../../references/books/*.md`) for more complete context
|
|
139
|
+
- **Light**: Read knowledge cards (`../../knowledge-base/*/*.en.md`); self-contained and immediately usable
|
|
140
|
+
- **Medium**: Read distilled book notes (`../../references/books/*.en.md`) for more complete context
|
|
184
141
|
- **Deep**: When `math_book/<PDF>` is available locally, the agent automatically runs `pdftotext` + grep to locate the original page
|
|
185
142
|
|
|
186
|
-
##
|
|
143
|
+
## Knowledge Gap Protocol
|
|
187
144
|
|
|
188
|
-
|
|
145
|
+
When the mathematical tools required by the user's problem are not in the existing `knowledge-base/`, do NOT force-fit existing cards. Execute the following procedure:
|
|
189
146
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
147
|
+
1. **Gap Identification**: Explicitly state that no fully corresponding knowledge card exists. Classify the gap as: new domain, new theorem family, new structure, new application scenario, or combinatorial extension of existing cards.
|
|
148
|
+
|
|
149
|
+
2. **Lens Fallback**: Select 1–3 most relevant thinking lenses to determine the problem's mathematical structure. E.g., local-to-global, categorical, spectral, projection, causal, perturbation.
|
|
150
|
+
|
|
151
|
+
3. **Candidate Knowledge Localization**: Provide mathematical keywords, theorem families, concept clusters, and reference book directions to look up. Existing card coverage is not required, but explain why these concepts are relevant.
|
|
152
|
+
|
|
153
|
+
4. **Temporary Knowledge Card**: Generate a temporary knowledge summary in the same format as formal cards:
|
|
154
|
+
- Minimal definition
|
|
155
|
+
- Core structure
|
|
156
|
+
- Applicable problems
|
|
157
|
+
- AI design translation
|
|
158
|
+
- GPU feasibility
|
|
159
|
+
- Risks and failure conditions
|
|
160
|
+
- **Source & Confidence** (required):
|
|
161
|
+
- Knowledge source: label as "Agent inference / Lens derivation / Reference book extrapolation / Requires external verification"
|
|
162
|
+
- Confidence: High (theorem-backed) / Medium (reasonable inference, not rigorously proven) / Low (exploratory hypothesis)
|
|
163
|
+
- Unverified claims: list key conclusions requiring subsequent verification
|
|
164
|
+
|
|
165
|
+
5. **Design Translation**: If the user's goal is mechanism design, translate the temporary knowledge into candidate AI modules, losses, routing, attention, representation, or compression schemes.
|
|
166
|
+
|
|
167
|
+
6. **Upgrade Recommendation**: If this gap recurs frequently, recommend adding a formal knowledge card or design pattern.
|
|
168
|
+
|
|
169
|
+
## Workflow Example
|
|
170
|
+
|
|
171
|
+
Full workflow example: `../../references/skill-index.en.md`.
|