math-skill 2.1.0 → 3.0.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 +159 -200
- package/README.md +159 -200
- package/agents/math-critic.en.md +2 -2
- package/agents/math-critic.md +8 -8
- package/commands/ask.md +3 -10
- package/design-patterns/attention/equivariant-attention.en.md +72 -0
- package/design-patterns/attention/equivariant-attention.md +72 -0
- package/design-patterns/attention/geometry-aware-attention.en.md +73 -0
- package/design-patterns/attention/geometry-aware-attention.md +72 -0
- package/design-patterns/attention/information-bottleneck-attention.en.md +72 -0
- package/design-patterns/attention/information-bottleneck-attention.md +72 -0
- package/design-patterns/attention/projection-attention.en.md +68 -0
- package/design-patterns/attention/projection-attention.md +68 -0
- package/design-patterns/attention/spectral-attention.en.md +71 -0
- package/design-patterns/attention/spectral-attention.md +71 -0
- package/design-patterns/compression/leverage-score-selection.en.md +71 -0
- package/design-patterns/compression/leverage-score-selection.md +71 -0
- package/design-patterns/compression/low-rank-kv-cache.en.md +60 -0
- package/design-patterns/compression/low-rank-kv-cache.md +60 -0
- package/design-patterns/compression/spectral-token-pruning.en.md +61 -0
- package/design-patterns/compression/spectral-token-pruning.md +61 -0
- package/design-patterns/compression/topology-preserving-compression.en.md +64 -0
- package/design-patterns/compression/topology-preserving-compression.md +64 -0
- package/design-patterns/loss/constraint-penalty.en.md +67 -0
- package/design-patterns/loss/constraint-penalty.md +78 -0
- package/design-patterns/loss/contrastive-loss.en.md +59 -0
- package/design-patterns/loss/contrastive-loss.md +68 -0
- package/design-patterns/loss/information-bottleneck-loss.en.md +69 -0
- package/design-patterns/loss/information-bottleneck-loss.md +74 -0
- package/design-patterns/loss/orthogonality-loss.en.md +56 -0
- package/design-patterns/loss/orthogonality-loss.md +60 -0
- package/design-patterns/loss/variational-loss.en.md +61 -0
- package/design-patterns/loss/variational-loss.md +71 -0
- package/design-patterns/representation/equivariant-split.en.md +87 -0
- package/design-patterns/representation/equivariant-split.md +89 -0
- package/design-patterns/representation/manifold-representation.en.md +85 -0
- package/design-patterns/representation/manifold-representation.md +87 -0
- package/design-patterns/representation/shared-private-decomposition.en.md +84 -0
- package/design-patterns/representation/shared-private-decomposition.md +86 -0
- package/design-patterns/representation/subspace-alignment.en.md +90 -0
- package/design-patterns/representation/subspace-alignment.md +92 -0
- package/design-patterns/routing/graph-routing.en.md +79 -0
- package/design-patterns/routing/graph-routing.md +81 -0
- package/design-patterns/routing/moe-routing.en.md +85 -0
- package/design-patterns/routing/moe-routing.md +87 -0
- package/design-patterns/routing/optimal-transport-routing.en.md +68 -0
- package/design-patterns/routing/optimal-transport-routing.md +72 -0
- package/design-patterns/routing/spectral-clustering-routing.en.md +88 -0
- package/design-patterns/routing/spectral-clustering-routing.md +90 -0
- package/knowledge-base/differential-geometry/connection.en.md +51 -0
- package/knowledge-base/differential-geometry/connection.md +51 -0
- package/knowledge-base/differential-geometry/curvature.en.md +49 -0
- package/knowledge-base/differential-geometry/curvature.md +49 -0
- package/knowledge-base/differential-geometry/geodesic.en.md +51 -0
- package/knowledge-base/differential-geometry/geodesic.md +51 -0
- package/knowledge-base/differential-geometry/manifold.en.md +47 -0
- package/knowledge-base/differential-geometry/manifold.md +47 -0
- package/knowledge-base/differential-geometry/metric-tensor.en.md +50 -0
- package/knowledge-base/differential-geometry/metric-tensor.md +50 -0
- package/knowledge-base/differential-geometry/tangent-space.en.md +48 -0
- package/knowledge-base/differential-geometry/tangent-space.md +48 -0
- package/knowledge-base/information-geometry/fisher-metric.en.md +56 -0
- package/knowledge-base/information-geometry/fisher-metric.md +56 -0
- package/knowledge-base/information-geometry/natural-gradient.en.md +54 -0
- package/knowledge-base/information-geometry/natural-gradient.md +54 -0
- package/knowledge-base/lie-theory/equivariance.en.md +54 -0
- package/knowledge-base/lie-theory/equivariance.md +54 -0
- package/knowledge-base/lie-theory/group-action.en.md +51 -0
- package/knowledge-base/lie-theory/group-action.md +51 -0
- package/knowledge-base/lie-theory/lie-algebra.en.md +51 -0
- package/knowledge-base/lie-theory/lie-algebra.md +51 -0
- package/knowledge-base/lie-theory/lie-group.en.md +51 -0
- package/knowledge-base/lie-theory/lie-group.md +51 -0
- package/knowledge-base/lie-theory/representation.en.md +52 -0
- package/knowledge-base/lie-theory/representation.md +52 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +49 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.md +49 -0
- package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +49 -0
- package/knowledge-base/matrix-analysis/matrix-perturbation.md +49 -0
- package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +50 -0
- package/knowledge-base/matrix-analysis/positive-semidefinite.md +50 -0
- package/knowledge-base/matrix-analysis/projection.en.md +47 -0
- package/knowledge-base/matrix-analysis/projection.md +47 -0
- package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +48 -0
- package/knowledge-base/matrix-analysis/spectral-decomposition.md +48 -0
- package/knowledge-base/optimization/constrained-optimization.en.md +53 -0
- package/knowledge-base/optimization/constrained-optimization.md +53 -0
- package/knowledge-base/optimization/convex-optimization.en.md +50 -0
- package/knowledge-base/optimization/convex-optimization.md +50 -0
- package/knowledge-base/optimization/lagrangian-duality.en.md +50 -0
- package/knowledge-base/optimization/lagrangian-duality.md +50 -0
- package/knowledge-base/optimization/proximal-method.en.md +52 -0
- package/knowledge-base/optimization/proximal-method.md +52 -0
- package/knowledge-base/optimization/riemannian-optimization.en.md +51 -0
- package/knowledge-base/optimization/riemannian-optimization.md +51 -0
- package/knowledge-base/overview.en.md +29 -218
- package/knowledge-base/overview.md +29 -220
- package/knowledge-base/probability/concentration-inequality.en.md +45 -0
- package/knowledge-base/probability/concentration-inequality.md +45 -0
- package/knowledge-base/probability/entropy.en.md +47 -0
- package/knowledge-base/probability/entropy.md +47 -0
- package/knowledge-base/probability/fisher-information.en.md +48 -0
- package/knowledge-base/probability/fisher-information.md +48 -0
- package/knowledge-base/probability/information-bottleneck.en.md +49 -0
- package/knowledge-base/probability/information-bottleneck.md +49 -0
- package/knowledge-base/probability/kl-divergence.en.md +51 -0
- package/knowledge-base/probability/kl-divergence.md +51 -0
- package/knowledge-base/topology/euler-characteristic.en.md +54 -0
- package/knowledge-base/topology/euler-characteristic.md +54 -0
- package/knowledge-base/topology/fundamental-group.en.md +52 -0
- package/knowledge-base/topology/fundamental-group.md +52 -0
- package/knowledge-base/topology/persistent-homology.en.md +54 -0
- package/knowledge-base/topology/persistent-homology.md +54 -0
- package/lenses/algorithmic.en.md +49 -0
- package/lenses/algorithmic.md +49 -0
- package/lenses/axiomatization.en.md +48 -0
- package/lenses/axiomatization.md +48 -0
- package/lenses/categorical.en.md +48 -0
- package/lenses/categorical.md +48 -0
- package/lenses/causal.en.md +49 -0
- package/lenses/causal.md +49 -0
- package/lenses/duality.en.md +47 -0
- package/lenses/duality.md +47 -0
- package/lenses/game.en.md +50 -0
- package/lenses/game.md +50 -0
- package/lenses/geometric.en.md +53 -0
- package/lenses/geometric.md +53 -0
- package/lenses/local-to-global.en.md +52 -0
- package/lenses/local-to-global.md +52 -0
- package/lenses/perturbation.en.md +51 -0
- package/lenses/perturbation.md +51 -0
- package/lenses/probabilistic.en.md +48 -0
- package/lenses/probabilistic.md +48 -0
- package/lenses/projection.en.md +50 -0
- package/lenses/projection.md +50 -0
- package/lenses/spectral.en.md +52 -0
- package/lenses/spectral.md +52 -0
- package/lenses/symmetry.en.md +49 -0
- package/lenses/symmetry.md +49 -0
- package/lenses/topological.en.md +48 -0
- package/lenses/topological.md +48 -0
- package/lenses/variational.en.md +48 -0
- package/lenses/variational.md +48 -0
- package/package.json +9 -3
- package/references/books/abstract-algebra.md +5 -5
- package/references/books/algebraic-geometry-rising-sea.md +5 -5
- package/references/books/differential-geometry.md +3 -3
- package/references/books/matrix-analysis.md +4 -4
- package/references/books/micro-lie-theory.md +3 -3
- package/references/books/optimization-ml.md +1 -1
- package/references/books/smooth-manifolds.md +3 -3
- package/references/gpu-friendly-math.en.md +8 -8
- package/references/gpu-friendly-math.md +2 -2
- package/references/inspiration.en.md +1 -1
- package/references/inspiration.md +2 -2
- package/skills/math-research-activator/SKILL.en.md +161 -106
- package/skills/math-research-activator/SKILL.md +162 -110
- package/skills/math-research-activator/original-texts.en.md +9 -9
- package/skills/math-research-activator/original-texts.md +11 -11
- package/commands/abstraction.md +0 -11
- package/commands/algorithmic-thinking.md +0 -11
- package/commands/axiomatization.md +0 -11
- package/commands/causal-inference.md +0 -11
- package/commands/discrete-combinatorial.md +0 -11
- package/commands/game-theory.md +0 -11
- package/commands/induction-analogy.md +0 -11
- package/commands/information-theory.md +0 -11
- package/commands/logic-deduction.md +0 -11
- package/commands/modeling.md +0 -11
- package/commands/optimization.md +0 -11
- package/commands/probability-statistics.md +0 -11
- package/commands/symmetry-invariance.md +0 -11
- package/commands/topological-thinking.md +0 -11
- package/commands/transformation.md +0 -11
- package/skills/abstraction/SKILL.en.md +0 -117
- package/skills/abstraction/SKILL.md +0 -121
- package/skills/abstraction/original-texts.en.md +0 -163
- package/skills/abstraction/original-texts.md +0 -175
- package/skills/algorithmic-thinking/SKILL.en.md +0 -132
- package/skills/algorithmic-thinking/SKILL.md +0 -138
- package/skills/algorithmic-thinking/original-texts.en.md +0 -253
- package/skills/algorithmic-thinking/original-texts.md +0 -256
- package/skills/axiomatization/SKILL.en.md +0 -144
- package/skills/axiomatization/SKILL.md +0 -151
- package/skills/axiomatization/original-texts.en.md +0 -154
- package/skills/axiomatization/original-texts.md +0 -160
- package/skills/causal-inference/SKILL.en.md +0 -147
- package/skills/causal-inference/SKILL.md +0 -151
- package/skills/causal-inference/original-texts.en.md +0 -136
- package/skills/causal-inference/original-texts.md +0 -167
- package/skills/discrete-combinatorial/SKILL.en.md +0 -124
- package/skills/discrete-combinatorial/SKILL.md +0 -131
- package/skills/discrete-combinatorial/original-texts.en.md +0 -184
- package/skills/discrete-combinatorial/original-texts.md +0 -185
- package/skills/game-theory/SKILL.en.md +0 -117
- package/skills/game-theory/SKILL.md +0 -123
- package/skills/game-theory/original-texts.en.md +0 -131
- package/skills/game-theory/original-texts.md +0 -131
- package/skills/induction-analogy/SKILL.en.md +0 -145
- package/skills/induction-analogy/SKILL.md +0 -152
- package/skills/induction-analogy/original-texts.en.md +0 -140
- package/skills/induction-analogy/original-texts.md +0 -154
- package/skills/information-theory/SKILL.en.md +0 -134
- package/skills/information-theory/SKILL.md +0 -140
- package/skills/information-theory/original-texts.en.md +0 -127
- package/skills/information-theory/original-texts.md +0 -127
- package/skills/logic-deduction/SKILL.en.md +0 -130
- package/skills/logic-deduction/SKILL.md +0 -135
- package/skills/logic-deduction/original-texts.en.md +0 -160
- package/skills/logic-deduction/original-texts.md +0 -173
- package/skills/modeling/SKILL.en.md +0 -135
- package/skills/modeling/SKILL.md +0 -139
- package/skills/modeling/original-texts.en.md +0 -162
- package/skills/modeling/original-texts.md +0 -165
- package/skills/optimization/SKILL.en.md +0 -129
- package/skills/optimization/SKILL.md +0 -135
- package/skills/optimization/original-texts.en.md +0 -167
- package/skills/optimization/original-texts.md +0 -168
- package/skills/probability-statistics/SKILL.en.md +0 -146
- package/skills/probability-statistics/SKILL.md +0 -151
- package/skills/probability-statistics/original-texts.en.md +0 -191
- package/skills/probability-statistics/original-texts.md +0 -193
- package/skills/symmetry-invariance/SKILL.en.md +0 -135
- package/skills/symmetry-invariance/SKILL.md +0 -139
- package/skills/symmetry-invariance/original-texts.en.md +0 -206
- package/skills/symmetry-invariance/original-texts.md +0 -221
- package/skills/topological-thinking/SKILL.en.md +0 -124
- package/skills/topological-thinking/SKILL.md +0 -128
- package/skills/topological-thinking/original-texts.en.md +0 -134
- package/skills/topological-thinking/original-texts.md +0 -164
- package/skills/transformation/SKILL.en.md +0 -120
- package/skills/transformation/SKILL.md +0 -124
- package/skills/transformation/original-texts.en.md +0 -204
- package/skills/transformation/original-texts.md +0 -216
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
# GPU 友好性总清单 / GPU-Friendly Math Checklist
|
|
4
4
|
|
|
5
5
|
> 本文件是「GPU 可行性」验收门的**唯一权威来源(single source of truth)**。
|
|
6
|
-
> activator、
|
|
6
|
+
> activator、15 个思想透镜、`books/*.md`、以及 `../agents/math-critic.md` 都引用此处,不重复定义。
|
|
7
7
|
>
|
|
8
|
-
> This file is the single source of truth for the "GPU-feasibility" acceptance gate. The activator, the
|
|
8
|
+
> 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.
|
|
9
9
|
|
|
10
10
|
## 核心命题 / Core Proposition
|
|
11
11
|
|
|
@@ -108,6 +108,6 @@ What matters is not finding the legendary "global optimum," but rather, at each
|
|
|
108
108
|
|
|
109
109
|
The inspiration for this project stems precisely from these two insights:
|
|
110
110
|
|
|
111
|
-
1. **The value of mathematical tools far exceeds their original intent** — Sophus Lie's dragon-slaying blade story teaches us that a tool invented for solving differential equations ultimately became the universal language for describing symmetry. This is the core idea behind "thinking
|
|
111
|
+
1. **The value of mathematical tools far exceeds their original intent** — Sophus Lie's dragon-slaying blade story teaches us that a tool invented for solving differential equations ultimately became the universal language for describing symmetry. This is the core idea behind "thinking lenses": every mathematical concept carries transferable value far beyond its original application domain.
|
|
112
112
|
|
|
113
113
|
2. **Mathematics is a lens for understanding life** — Optimization theory is not just about algorithms; it is a framework for understanding the structure of life decisions. When you transfer the "exploration–exploitation trade-off" from reinforcement learning to career choices, or the "local optimum trap" from convex optimization to everyday decisions, mathematics steps off the blackboard and into daily life.
|
|
@@ -20,7 +20,7 @@ Sophus Lie 是一个想打造一把**屠龙刀**(解通微分方程)的铁
|
|
|
20
20
|
|
|
21
21
|
一个为解决特定问题而发明的工具,最终在完全不同的领域展现出远超初衷的价值。公理化思想最初是为了让几何严密,后来却成了所有数学分支的基础语言;傅里叶变换最初是为了解热方程,后来却成了信号处理和量子力学的核心;欧拉的生成函数最初是为了算整数分拆,后来却成了组合学和概率论的通用工具。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
数学思想透镜也是如此——你学习它,可能是为了审查一篇论文或解决一个具体问题,但它真正的价值,在于它改变了你看世界的方式。
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -110,6 +110,6 @@ $x_0$ 是你的出身、天赋、起点。
|
|
|
110
110
|
|
|
111
111
|
本项目的灵感来源,正是这两段感悟:
|
|
112
112
|
|
|
113
|
-
1. **数学工具的价值远超初衷** —— Sophus Lie 的屠龙刀故事告诉我们,一个为解微分方程而发明的工具,最终成为描述对称性的通用语言。这正是"
|
|
113
|
+
1. **数学工具的价值远超初衷** —— Sophus Lie 的屠龙刀故事告诉我们,一个为解微分方程而发明的工具,最终成为描述对称性的通用语言。这正是"思想透镜"的核心理念:每个数学思想方法,都有远超其原始应用场景的迁移价值。
|
|
114
114
|
|
|
115
115
|
2. **数学是理解生活的透镜** —— 最优化理论不只是算法,它还是一种理解人生决策结构的方式。当你把"探索与利用的权衡"从强化学习迁移到职业选择,把"局部最优陷阱"从凸优化迁移到生活决策,数学就从黑板走进了日常。
|
|
@@ -1,132 +1,187 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: math-research-activator
|
|
3
3
|
description: |
|
|
4
|
-
|
|
4
|
+
Mathematical research OS — auto-diagnoses user intent, routes to thinking lenses, math knowledge base, or design translation layer. Triggers on architecture/operator design, theoretical analysis, math-to-AI transfer. Does NOT trigger for pure engineering tasks (debug, refactoring, hyperparameter tuning).
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# 🧭 Math Research Activator
|
|
8
7
|
|
|
9
|
-
>
|
|
8
|
+
> **File routing**: When this document references any file (lenses, knowledge-base, design-patterns, references, agents), always load the `.en.md` variant if it exists. For example, `../../lenses/symmetry.md` → load `lenses/symmetry.en.md`.
|
|
9
|
+
# 🧭 Math Research OS
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
> "The thinking system does not hand out theorems, the knowledge system does not indulge in loose inspiration, and the design layer does not fake profundity."
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
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.**
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
2. **GPU-feasible (friendly to GPU)** — see `../../references/gpu-friendly-math.md` eight dimensions.
|
|
15
|
+
## Three-Layer Orthogonal Architecture
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
| Layer | Responsibility | Directory | Core Question |
|
|
18
|
+
|-------|---------------|-----------|--------------|
|
|
19
|
+
| **Thinking Lenses** | Diagnose problem structure, recommend mathematical perspectives | `../../lenses/*.md` | Which perspective should we view this problem through? |
|
|
20
|
+
| **Math Knowledge** | Provide concrete mathematical tools (definitions/theorems/formulas) | `../../knowledge-base/*/*.md` | What specific mathematics does this perspective require? |
|
|
21
|
+
| **Design Translation** | Translate mathematics into AI modules/losses/operators | `../../design-patterns/*/*.md` | How does this mathematics become model architecture? |
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
Auxiliary layers:
|
|
24
|
+
- `../../references/books/*.md`: Distilled notes from 7 textbooks; full context when deeper understanding is needed
|
|
25
|
+
- `../../references/gpu-friendly-math.md`: GPU Eight-Dimension Acceptance Gate (single source of truth)
|
|
26
|
+
- `../../agents/math-critic.md`: Math-engineering dual critic
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
## Intent Diagnosis (5 Scenarios)
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
| Scenario | Diagnostic Signal | Invocation Path |
|
|
31
|
+
|----------|------------------|-----------------|
|
|
32
|
+
| **A. Problem Analysis** | "Is this design sound?" "Are there gaps in the reasoning chain?" | Lenses → critic |
|
|
33
|
+
| **B. Mechanism Design** | "Design a new attention mechanism" "Transfer X to Y" | Lenses → Knowledge → Design → critic |
|
|
34
|
+
| **C. Knowledge Query** | "What is a tangent space on a manifold?" "How is the projection theorem applied?" | Knowledge |
|
|
35
|
+
| **D. Verification & Review** | "Does this formula hold?" "What guarantees does this loss provide?" | Knowledge → critic |
|
|
36
|
+
| **E. Pure Engineering** | Debugging, refactoring, hyperparameter tuning, code review | **Do not invoke the math system** |
|
|
37
|
+
|
|
38
|
+
## Lens Library (15 Mathematical Perspectives)
|
|
25
39
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
Each lens answers: What is this perspective? What kinds of problems is it suited to diagnose? Which knowledge domains does it route to?
|
|
41
|
+
|
|
42
|
+
| Lens | File | Core Perspective |
|
|
43
|
+
|------|------|-----------------|
|
|
44
|
+
| Axiomatization | `../../lenses/axiomatization.md` | Examine consistency/independence/completeness of assumptions |
|
|
45
|
+
| Duality | `../../lenses/duality.md` | Transform to the dual space to expose constraints and invariants |
|
|
46
|
+
| Symmetry | `../../lenses/symmetry.md` | Invariants and conservation laws under transformations |
|
|
47
|
+
| Spectral Decomposition | `../../lenses/spectral.md` | Eigenvalues/singular values reveal dominant structure |
|
|
48
|
+
| Geometric | `../../lenses/geometric.md` | Metric/curvature/spatial structure on manifolds |
|
|
49
|
+
| Projection & Decomposition | `../../lenses/projection.md` | Orthogonal decomposition, subspace separation, conflict elimination |
|
|
50
|
+
| Variational | `../../lenses/variational.md` | Constrained extrema, energy minimization |
|
|
51
|
+
| Local-to-Global | `../../lenses/local-to-global.md` | Patching local properties into global ones, cohomological obstructions |
|
|
52
|
+
| Topological | `../../lenses/topological.md` | Invariants under continuous deformation, connectedness, holes |
|
|
53
|
+
| Categorical | `../../lenses/categorical.md` | Universal properties, functors, natural transformations |
|
|
54
|
+
| Perturbation | `../../lenses/perturbation.md` | Propagation of small perturbations, stability, robustness |
|
|
55
|
+
| Causal | `../../lenses/causal.md` | Correlation ≠ causation, interventions, counterfactuals |
|
|
56
|
+
| Game-Theoretic | `../../lenses/game.md` | Multi-agent strategic interaction, equilibria, mechanism design |
|
|
57
|
+
| Probabilistic & Statistical | `../../lenses/probabilistic.md` | Quantifying uncertainty, Bayesian updating |
|
|
58
|
+
| Algorithmic | `../../lenses/algorithmic.md` | Complexity, feasibility, parallelizability |
|
|
59
|
+
|
|
60
|
+
## Knowledge Base (Organized by Mathematical Domain)
|
|
61
|
+
|
|
62
|
+
Each knowledge card answers: Minimal definition, core formulas, applicable problems, AI design translation, engineering feasibility, risks.
|
|
63
|
+
|
|
64
|
+
| Domain | Directory | Knowledge Cards |
|
|
65
|
+
|--------|-----------|----------------|
|
|
66
|
+
| Matrix Analysis | `../../knowledge-base/matrix-analysis/` | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
|
|
67
|
+
| Optimization | `../../knowledge-base/optimization/` | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
|
|
68
|
+
| Differential Geometry | `../../knowledge-base/differential-geometry/` | manifold, tangent-space, metric-tensor, geodesic, curvature, connection |
|
|
69
|
+
| Lie Theory | `../../knowledge-base/lie-theory/` | group-action, lie-group, lie-algebra, representation, equivariance |
|
|
70
|
+
| Topology | `../../knowledge-base/topology/` | persistent-homology, euler-characteristic, fundamental-group |
|
|
71
|
+
| Probability & Information | `../../knowledge-base/probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
|
|
72
|
+
| Information Geometry | `../../knowledge-base/information-geometry/` | natural-gradient, fisher-metric |
|
|
73
|
+
|
|
74
|
+
## Design Pattern Library (Organized by AI Component)
|
|
75
|
+
|
|
76
|
+
Each design pattern answers: Mathematical origin, AI module form, implementable architecture, GPU feasibility, paper-level exposition, risks.
|
|
77
|
+
|
|
78
|
+
| Component Type | Directory | Patterns |
|
|
79
|
+
|---------------|-----------|----------|
|
|
80
|
+
| Attention | `../../design-patterns/attention/` | projection-attention, spectral-attention, equivariant-attention, geometry-aware-attention, information-bottleneck-attention |
|
|
81
|
+
| Loss Functions | `../../design-patterns/loss/` | orthogonality-loss, contrastive-loss, variational-loss, information-bottleneck-loss, constraint-penalty |
|
|
82
|
+
| Routing | `../../design-patterns/routing/` | optimal-transport-routing, graph-routing, moe-routing, spectral-clustering-routing |
|
|
83
|
+
| Representation | `../../design-patterns/representation/` | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
|
|
84
|
+
| Compression | `../../design-patterns/compression/` | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
|
|
85
|
+
|
|
86
|
+
## Automatic Trigger Conditions
|
|
87
|
+
|
|
88
|
+
**All of Gate 1 + Gate 2 + Gate 3 must be satisfied simultaneously for intervention:**
|
|
89
|
+
|
|
90
|
+
### Gate 0 · Exclusion Gate (Highest Priority)
|
|
91
|
+
The following tasks **never** trigger the system regardless of workspace contents: code review, debugging, refactoring, hyperparameter tuning, build/deployment, purely factual queries, general software engineering.
|
|
92
|
+
|
|
93
|
+
### Gate 1 · Environment Signal
|
|
94
|
+
The workspace contains architecture-level core code (attention/transformer/MoE, `*.cu`/kernel) or research notes. Routine files like `model.py` or `trainer.py` alone **do not** constitute an environment signal.
|
|
95
|
+
|
|
96
|
+
### Gate 2 · Task Signal
|
|
97
|
+
The user's task involves **designing/improving** a new architecture/operator, **analyzing** theoretical properties, **transferring** mathematical structures into AI design, or **querying math knowledge relevant to AI research** (e.g., "how is tangent space used in optimization?"). Pure encyclopedic math queries (e.g., "what is a group?" with no AI context) do not auto-trigger, but can be accessed via `/ask`.
|
|
98
|
+
|
|
99
|
+
### Gate 3 · Intent Match
|
|
100
|
+
The user's intent matches one of scenarios A/B/C/D. Pure engineering tasks matching scenario E → no intervention.
|
|
101
|
+
|
|
102
|
+
> **`/ask` entry**: Manual invocation skips Gate 1 and Gate 2, executing only Gate 0 (exclusion) + Gate 3 (intent match), allowing direct access to any scenario including knowledge queries.
|
|
103
|
+
|
|
104
|
+
## Main Workflow
|
|
105
|
+
|
|
106
|
+
### Step 1: Diagnose Intent
|
|
107
|
+
1. Determine which scenario (A/B/C/D/E) the user's intent belongs to
|
|
108
|
+
2. Extract the core tension of the problem: what to preserve? what to suppress? what are the constraints? what is the engineering bottleneck?
|
|
109
|
+
3. Output a problem-type classification
|
|
110
|
+
|
|
111
|
+
### Step 2: Route Invocation
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Scenario A (Analysis): Select 1–3 lenses → output perspective diagnosis → critic review
|
|
115
|
+
Scenario B (Design): Select 1–3 lenses → query knowledge cards → generate design patterns → critic review
|
|
116
|
+
Scenario C (Query): Load knowledge cards directly → output per knowledge activation protocol
|
|
117
|
+
Scenario D (Verification): Load knowledge cards → critic reviews conditions and boundaries
|
|
118
|
+
Scenario E (Engineering): No intervention
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Step 3: Output Format
|
|
122
|
+
|
|
123
|
+
**Scenario A/B Output**:
|
|
124
|
+
1. **[Diagnosis]** Problem type + core tension
|
|
125
|
+
2. **[Lens]** Recommend 1–3 mathematical perspectives (annotate why each is/is not suitable)
|
|
126
|
+
3. **[Knowledge]** (Scenario B only) Required concrete mathematical tools (reference knowledge cards)
|
|
127
|
+
4. **[Design]** (Scenario B only) Candidate AI module drafts (reference design patterns)
|
|
128
|
+
5. **[GPU]** Run candidates through the Eight-Dimension Gate (friendly/retrofittable/unfriendly)
|
|
129
|
+
6. **[Conclusion]** Retain candidates that pass both acceptance gates + next-step recommendations
|
|
130
|
+
|
|
131
|
+
**Scenario C Output** (Knowledge Activation Protocol):
|
|
132
|
+
1. Minimal definition
|
|
133
|
+
2. Core formulas
|
|
134
|
+
3. Applicable problems
|
|
135
|
+
4. AI design translation
|
|
136
|
+
5. Engineering feasibility
|
|
137
|
+
6. Risks and failure conditions
|
|
138
|
+
7. Further references (distilled book notes / original book paths)
|
|
139
|
+
|
|
140
|
+
**Scenario D Output**:
|
|
141
|
+
1. Conditions under which it holds
|
|
142
|
+
2. Conditions under which it fails
|
|
143
|
+
3. What it can guarantee at most
|
|
144
|
+
4. What it cannot guarantee
|
|
145
|
+
5. Engineering feasibility
|
|
34
146
|
|
|
35
|
-
**
|
|
36
|
-
|
|
37
|
-
### Gate 1 · Environment Signal (necessary condition, not sufficient)
|
|
38
|
-
|
|
39
|
-
The workspace contains at least one of the following:
|
|
40
|
-
- Core model architecture code (not training scripts / data pipelines): attention/transformer/MoE implementations, `*.cu`/`*.cuh`/kernels, Triton/CUDA operators.
|
|
41
|
-
- Algorithm research notes / paper review documents.
|
|
42
|
-
- Design drafts or mathematical derivations for new architectures / new operators.
|
|
43
|
-
|
|
44
|
-
> The mere presence of `model.py`, `trainer.py`, `config.json`, or similar routine ML engineering files **does not constitute an environment signal**.
|
|
45
|
-
|
|
46
|
-
### Gate 2 · Task Signal (necessary condition, not sufficient)
|
|
47
|
-
|
|
48
|
-
The user's current task explicitly involves at least one of the following:
|
|
49
|
-
- **Designing or improving** a new model architecture / operator / attention mechanism (not fixing an existing implementation).
|
|
50
|
-
- **Selecting or justifying** the applicability of a mathematical structure (e.g., "should we use manifold constraints," "does this structure have equivariance").
|
|
51
|
-
- **Analyzing** theoretical properties of an algorithm (complexity lower bounds, convergence, expressivity, information bottleneck).
|
|
52
|
-
- **Transferring** a mathematical structure from some field into algorithm/GPU design.
|
|
53
|
-
|
|
54
|
-
> If the task signal is merely "code doesn't run," "parameter wasn't passed," "loss didn't take effect," or similar engineering issues, the activator does **not trigger** even if the environment signal is hit.
|
|
55
|
-
|
|
56
|
-
**When NOT to engage:**
|
|
57
|
-
- Gate 0 is hit (exclusion gate).
|
|
58
|
-
- Either Gate 1 or Gate 2 is not satisfied.
|
|
59
|
-
- The problem is not in a domain where mathematics can help.
|
|
60
|
-
|
|
61
|
-
## The Activation Loop
|
|
62
|
-
|
|
63
|
-
> See `../../references/agentic-workflow.md` for detailed working methodology (Human-in-the-Agent-Loop).
|
|
64
|
-
|
|
65
|
-
1. **Diagnose**: What is the algorithmic structure or bottleneck? (complexity? memory/KV? numerics? parallelism? expressivity?)
|
|
66
|
-
2. **Map**: Use the "Modern Math Toolbox" (below) to scan for transferable structures, **enumerating multiple candidates** (leverage the large context window — don't just give one).
|
|
67
|
-
3. **Route**: Select 1–3 thinking weapons for deeper analysis (decision tree below).
|
|
68
|
-
4. **GPU Screen**: Pass each candidate through the eight dimensions of `../../references/gpu-friendly-math.md`, rating "friendly / retrofittable / unfriendly" + adaptation recommendations.
|
|
69
|
-
5. **Dual Acceptance Gate**: Retain only candidates that are **mathematically correct AND (eight-dimension friendly or retrofittable)**.
|
|
70
|
-
6. **Track**: For complex explorations, use a markdown testplan table (template in agentic-workflow.md) to iterate toward convergence.
|
|
71
|
-
|
|
72
|
-
The eight-dimension terminology must remain consistent: **Tensorization / GEMM-Mappability / Complexity / Memory & KV-Cache / Low-Precision Stability / Parallelism & Communication / Sparsity Structure / Operator Fusion**. Do not substitute vague judgments covering only a subset of dimensions for the full eight-dimension gate.
|
|
73
|
-
|
|
74
|
-
## Weapon Routing
|
|
75
|
-
|
|
76
|
-
Match by the core characteristic of the problem (select up to 3, label primary/secondary):
|
|
77
|
-
|
|
78
|
-
1. **Multi-agent interaction** (my optimum depends on others) → `/game-theory` (primary); resource allocation + `/optimization`; information asymmetry + `/information-theory`
|
|
79
|
-
2. **Uncertainty / randomness** → `/probability-statistics` (primary); need causal rather than correlational + `/causal-inference`
|
|
80
|
-
3. **Optimization under constraints** → `/optimization` (primary); need to model first + `/modeling` (prerequisite)
|
|
81
|
-
4. **Current form is intractable, need change of perspective / simplification** → `/transformation` (primary)
|
|
82
|
-
5. **Need to extract essential structure** → `/abstraction` (primary); verify assumptions + `/axiomatization`; simplify + `/symmetry-invariance`
|
|
83
|
-
6. **Need rigorous reasoning and verification** → `/logic-deduction` (primary); verify premises + `/axiomatization`
|
|
84
|
-
7. **Finding patterns from data / experience** → `/induction-analogy` (primary); cross-domain transfer + `/abstraction`
|
|
85
|
-
8. **Building predictive / explanatory models** → `/modeling` (primary); optimization + `/optimization`; uncertainty + `/probability-statistics`
|
|
86
|
-
9. **Invariance / conservation / equivariance under change** → `/symmetry-invariance` (primary); connected structure + `/topological-thinking`
|
|
87
|
-
10. **Reducing to executable steps / evaluating feasibility and complexity** → `/algorithmic-thinking` (primary)
|
|
88
|
-
11. **Compression / encoding / information bottleneck / KV-Cache compression / quantization** → `/information-theory` (primary); representation transforms + `/transformation`; routing information gain + `/game-theory`
|
|
89
|
-
12. **Counting / enumeration / structure of finite objects** → `/discrete-combinatorial` (primary)
|
|
90
|
-
|
|
91
|
-
> **Modern math priority hint**: When the problem is "designing/improving an operator or structure," **always open the modern math toolbox first** while routing weapons — many breakthroughs come from transferring structures from algebraic geometry / differential geometry / Lie theory, rather than circling within classical tools alone.
|
|
92
|
-
|
|
93
|
-
## Modern-Math Toolbox (Layer 3 · Loaded on Demand)
|
|
147
|
+
**A conclusion must always be provided — never output analysis alone without convergence.**
|
|
94
148
|
|
|
95
|
-
|
|
149
|
+
## GPU Eight-Dimension Acceptance Gate
|
|
96
150
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
| Operator = matrix multiply / spectrum / low-rank / numerical stability | `matrix-analysis.md` | GEMM formulation, low-rank compression, spectral normalization, preconditioning |
|
|
100
|
-
| Training / convergence / optimizer / constraints | `optimization-ml.md` | Feasibility of adaptive / second-order optimization, dual solving |
|
|
101
|
-
| Symmetry / equivariance / semiring / permutation invariance | `abstract-algebra.md` | Group-equivariant layers, tropical semiring routing, finite-field encoding |
|
|
102
|
-
| Manifold constraints / latent-space geometry / differentiable structure | `smooth-manifolds.md` | Manifold optimization, Stiefel/orthogonal constraints, geodesic interpolation |
|
|
103
|
-
| Metric / curvature / natural gradient / gauge / fiber bundle | `differential-geometry.md` | Natural gradient / K-FAC, information geometry, gauge equivariance |
|
|
104
|
-
| Pose / SO(3) / SE(3) / state estimation / equivariance | `micro-lie-theory.md` | Lie group optimization, SE(3) equivariance, manifold loss |
|
|
105
|
-
| Attention / sparsity / global consistency / KV compression | `algebraic-geometry-rising-sea.md` | Sheaf attention, Čech cohomology regularization, Plücker KV, tropical gating |
|
|
151
|
+
Formal terminology (single authoritative source: `../../references/gpu-friendly-math.md`):
|
|
152
|
+
**Tensorization / GEMM-mappability / Complexity / Memory & KV-Cache / Low-Precision Stability / Parallelism & Communication / Sparse Structure / Operator Fusion**
|
|
106
153
|
|
|
107
|
-
##
|
|
154
|
+
## Depth-of-Consultation Protocol
|
|
108
155
|
|
|
109
|
-
- **Light**: Read `../../
|
|
110
|
-
- **
|
|
111
|
-
-
|
|
156
|
+
- **Light**: Read knowledge cards (`../../knowledge-base/*/*.md`); self-contained and immediately usable
|
|
157
|
+
- **Medium**: Read distilled book notes (`../../references/books/*.md`) for more complete context
|
|
158
|
+
- **Deep**: When `math_book/<PDF>` is available locally, the agent automatically runs `pdftotext` + grep to locate the original page
|
|
112
159
|
|
|
113
|
-
##
|
|
160
|
+
## Workflow Example
|
|
114
161
|
|
|
115
|
-
|
|
162
|
+
**User**: "Design a new KV Cache compression method that preserves long-range dependencies — I don't want to just do top-k."
|
|
116
163
|
|
|
117
|
-
|
|
164
|
+
```
|
|
165
|
+
Step 1 — Diagnosis: Scenario B (Mechanism Design)
|
|
166
|
+
Problem type: Sequence memory compression + information preservation + long-range structure
|
|
167
|
+
Core tension: Compressing token count vs. preserving long-range dependencies
|
|
118
168
|
|
|
119
|
-
|
|
120
|
-
1.
|
|
121
|
-
2.
|
|
122
|
-
3.
|
|
123
|
-
4. **[GPU Screen]**: Each candidate evaluated against the eight dimensions, rated "friendly / retrofittable / unfriendly" + adaptation recommendations.
|
|
124
|
-
5. **[Conclusion]**: Retain only candidates passing the dual acceptance gate; provide a testplan table when necessary.
|
|
169
|
+
Step 2 — Lens Selection:
|
|
170
|
+
1. Spectral Decomposition (preserve dominant subspace)
|
|
171
|
+
2. Information Theory (retain states with maximum mutual information)
|
|
172
|
+
3. Topological (preserve critical connectivity points of sequential structure)
|
|
125
173
|
|
|
126
|
-
|
|
174
|
+
Step 3 — Knowledge Query:
|
|
175
|
+
→ low-rank-approximation (Matrix Analysis)
|
|
176
|
+
→ leverage-score-selection (Design Pattern: compression)
|
|
177
|
+
→ information-bottleneck (Probability & Information)
|
|
127
178
|
|
|
128
|
-
|
|
179
|
+
Step 4 — Design Translation:
|
|
180
|
+
Candidate A: Spectral KV Compression (low-rank + leverage score)
|
|
181
|
+
Candidate B: Information-Preserving Cache (query sensitivity)
|
|
182
|
+
Candidate C: Topology-Preserving Cache (graph bridge-node retention)
|
|
129
183
|
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
|
|
184
|
+
Step 5 — Critic Review:
|
|
185
|
+
A is most GPU-friendly; B requires estimating future queries with inherent uncertainty; C has prohibitive graph construction cost
|
|
186
|
+
Recommendation: Prioritize A; use B as a lightweight gate
|
|
187
|
+
```
|