math-skill 2.1.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +165 -198
- package/README.md +165 -198
- package/agents/math-critic.en.md +28 -26
- package/agents/math-critic.md +33 -33
- package/commands/ask.en.md +10 -0
- 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/agentic-workflow.en.md +1 -1
- package/references/agentic-workflow.md +1 -1
- package/references/books/abstract-algebra.en.md +124 -0
- package/references/books/abstract-algebra.md +22 -22
- package/references/books/algebraic-geometry-rising-sea.en.md +171 -0
- package/references/books/algebraic-geometry-rising-sea.md +11 -11
- package/references/books/differential-geometry.en.md +140 -0
- package/references/books/differential-geometry.md +19 -19
- package/references/books/matrix-analysis.en.md +146 -0
- package/references/books/matrix-analysis.md +10 -10
- package/references/books/micro-lie-theory.en.md +116 -0
- package/references/books/micro-lie-theory.md +17 -17
- package/references/books/optimization-ml.en.md +163 -0
- package/references/books/optimization-ml.md +7 -8
- package/references/books/smooth-manifolds.en.md +105 -0
- package/references/books/smooth-manifolds.md +14 -14
- package/references/gpu-friendly-math.en.md +23 -10
- package/references/gpu-friendly-math.md +17 -4
- package/references/inspiration.en.md +1 -1
- package/references/inspiration.md +2 -2
- package/skills/math-research-activator/SKILL.en.md +195 -114
- package/skills/math-research-activator/SKILL.md +194 -119
- 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
|
@@ -1,132 +1,213 @@
|
|
|
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
|
+
>
|
|
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.
|
|
34
|
+
|
|
35
|
+
# Math Research OS
|
|
36
|
+
|
|
37
|
+
> "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."
|
|
38
|
+
|
|
39
|
+
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
|
+
|
|
41
|
+
## Three-Layer Orthogonal Architecture
|
|
42
|
+
|
|
43
|
+
| Layer | Responsibility | Directory | Core Question |
|
|
44
|
+
|-------|---------------|-----------|--------------|
|
|
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? |
|
|
48
|
+
|
|
49
|
+
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
|
|
53
|
+
|
|
54
|
+
## Intent Diagnosis (5 Scenarios)
|
|
55
|
+
|
|
56
|
+
| Scenario | Diagnostic Signal | Invocation Path |
|
|
57
|
+
|----------|------------------|-----------------|
|
|
58
|
+
| **A. Problem Analysis** | "Is this design sound?" "Are there gaps in the reasoning chain?" | Lenses → critic |
|
|
59
|
+
| **B. Mechanism Design** | "Design a new attention mechanism" "Transfer X to Y" | Lenses → Knowledge → Design → critic |
|
|
60
|
+
| **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 |
|
|
62
|
+
| **E. Pure Engineering** | Debugging, refactoring, hyperparameter tuning, code review | **Do not invoke the math system** |
|
|
63
|
+
|
|
64
|
+
## Lens Library (15 Mathematical Perspectives)
|
|
65
|
+
|
|
66
|
+
Each lens answers: What is this perspective? What kinds of problems is it suited to diagnose? Which knowledge domains does it route to?
|
|
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 |
|
|
85
|
+
|
|
86
|
+
## Knowledge Base (Organized by Mathematical Domain)
|
|
87
|
+
|
|
88
|
+
Each knowledge card answers: Minimal definition, core formulas, applicable problems, AI design translation, engineering feasibility, risks.
|
|
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 |
|
|
99
|
+
|
|
100
|
+
## Design Pattern Library (Organized by AI Component)
|
|
101
|
+
|
|
102
|
+
Each design pattern answers: Mathematical origin, AI module form, implementable architecture, GPU feasibility, paper-level exposition, risks.
|
|
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 |
|
|
111
|
+
|
|
112
|
+
## Automatic Trigger Conditions
|
|
113
|
+
|
|
114
|
+
**All of Gate 1 + Gate 2 + Gate 3 must be satisfied simultaneously for intervention:**
|
|
115
|
+
|
|
116
|
+
### Gate 0 · Exclusion Gate (Highest Priority)
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
### Gate 1 · Environment Signal
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
### Gate 2 · Task Signal
|
|
123
|
+
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`.
|
|
124
|
+
|
|
125
|
+
### Gate 3 · Intent Match
|
|
126
|
+
The user's intent matches one of scenarios A/B/C/D. Pure engineering tasks matching scenario E → no intervention.
|
|
127
|
+
|
|
128
|
+
> **`/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.
|
|
129
|
+
|
|
130
|
+
## Main Workflow
|
|
131
|
+
|
|
132
|
+
### Step 1: Diagnose Intent
|
|
133
|
+
1. Determine which scenario (A/B/C/D/E) the user's intent belongs to
|
|
134
|
+
2. Extract the core tension of the problem: what to preserve? what to suppress? what are the constraints? what is the engineering bottleneck?
|
|
135
|
+
3. Output a problem-type classification
|
|
136
|
+
|
|
137
|
+
### Step 2: Route Invocation
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Scenario A (Analysis): Select 1–3 lenses → output perspective diagnosis → critic review
|
|
141
|
+
Scenario B (Design): Select 1–3 lenses → query knowledge cards → generate design patterns → critic review
|
|
142
|
+
Scenario C (Query): Load knowledge cards directly → output per knowledge activation protocol
|
|
143
|
+
Scenario D (Verification): Load knowledge cards → critic reviews conditions and boundaries
|
|
144
|
+
Scenario E (Engineering): No intervention
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Step 3: Output Format
|
|
148
|
+
|
|
149
|
+
**Scenario A/B Output**:
|
|
150
|
+
1. **[Diagnosis]** Problem type + core tension
|
|
151
|
+
2. **[Lens]** Recommend 1–3 mathematical perspectives (annotate why each is/is not suitable)
|
|
152
|
+
3. **[Knowledge]** (Scenario B only) Required concrete mathematical tools (reference knowledge cards)
|
|
153
|
+
4. **[Design]** (Scenario B only) Candidate AI module drafts (reference design patterns)
|
|
154
|
+
5. **[GPU]** Run candidates through the Eight-Dimension Gate (friendly/retrofittable/unfriendly)
|
|
155
|
+
6. **[Conclusion]** Retain candidates that pass both acceptance gates + next-step recommendations
|
|
156
|
+
|
|
157
|
+
**Scenario C Output** (Knowledge Activation Protocol):
|
|
158
|
+
1. Minimal definition
|
|
159
|
+
2. Core formulas
|
|
160
|
+
3. Applicable problems
|
|
161
|
+
4. AI design translation
|
|
162
|
+
5. Engineering feasibility
|
|
163
|
+
6. Risks and failure conditions
|
|
164
|
+
7. Further references (distilled book notes / original book paths)
|
|
165
|
+
|
|
166
|
+
**Scenario D Output**:
|
|
167
|
+
1. Conditions under which it holds
|
|
168
|
+
2. Conditions under which it fails
|
|
169
|
+
3. What it can guarantee at most
|
|
170
|
+
4. What it cannot guarantee
|
|
171
|
+
5. Engineering feasibility
|
|
10
172
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
**No lengthy math tutorials.** Once triggered, immediately enter the three-step pipeline: "Diagnose → Map → GPU Screen," activating modern mathematics into algorithm/hardware design, and passing every output through the **dual acceptance gate**:
|
|
14
|
-
|
|
15
|
-
1. **Mathematically correct (beautiful in math)** — self-consistent, differentiable (or relaxable to differentiable), with correctness guarantees.
|
|
16
|
-
2. **GPU-feasible (friendly to GPU)** — see `../../references/gpu-friendly-math.md` eight dimensions.
|
|
17
|
-
|
|
18
|
-
> This is the **sole automatic entry point** of the skill pack. It loads the methodology layer (`../../references/agentic-workflow.md`, `../../references/gpu-friendly-math.md`), the book activation layer (`../../references/books/*.md`), and the 16 thinking weapons (sibling directories `../*/SKILL.md`) on demand, keeping only the minimal trigger and diagnostic logic resident at all times — progressive disclosure to save tokens.
|
|
19
|
-
|
|
20
|
-
## When to Auto-Engage
|
|
21
|
-
|
|
22
|
-
**Both the "environment signal" AND the "task signal" must be satisfied simultaneously (neither alone is sufficient):**
|
|
23
|
-
|
|
24
|
-
### Gate 0 · Exclusion Gate (evaluated first; if hit, do not engage)
|
|
25
|
-
|
|
26
|
-
The following tasks must **never** trigger this activator, regardless of what code is in the workspace:
|
|
27
|
-
- Code review / debugging / parameter-passing chain verification / interface consistency checks
|
|
28
|
-
- Refactoring, renaming, removing redundant code, dead code cleanup
|
|
29
|
-
- Build / packaging / CI / deployment / environment configuration
|
|
30
|
-
- Pure factual queries ("what does this function do," "who receives this parameter")
|
|
31
|
-
- General software engineering (file I/O, networking, data loading, logging)
|
|
32
|
-
- Training script hyperparameter tuning, hyperparameter search, experiment comparison
|
|
33
|
-
- Adding / modifying loss implementation details (as opposed to designing the mathematical structure of a new loss)
|
|
34
|
-
|
|
35
|
-
**Rule of thumb: if the task can be accomplished by "reading code → tracing call chains → reporting results," no mathematical weapon is needed.**
|
|
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)
|
|
173
|
+
**A conclusion must always be provided — never output analysis alone without convergence.**
|
|
94
174
|
|
|
95
|
-
|
|
175
|
+
## GPU Eight-Dimension Acceptance Gate
|
|
96
176
|
|
|
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 |
|
|
177
|
+
Formal terminology (single authoritative source: `../../references/gpu-friendly-math.md`):
|
|
178
|
+
**Tensorization / GEMM-mappability / Complexity / Memory & KV-Cache / Low-Precision Stability / Parallelism & Communication / Sparse Structure / Operator Fusion**
|
|
106
179
|
|
|
107
|
-
##
|
|
180
|
+
## Depth-of-Consultation Protocol
|
|
108
181
|
|
|
109
|
-
- **Light**: Read `../../
|
|
110
|
-
- **
|
|
111
|
-
-
|
|
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
|
|
184
|
+
- **Deep**: When `math_book/<PDF>` is available locally, the agent automatically runs `pdftotext` + grep to locate the original page
|
|
112
185
|
|
|
113
|
-
##
|
|
186
|
+
## Workflow Example
|
|
114
187
|
|
|
115
|
-
|
|
188
|
+
**User**: "Design a new KV Cache compression method that preserves long-range dependencies — I don't want to just do top-k."
|
|
116
189
|
|
|
117
|
-
|
|
190
|
+
```
|
|
191
|
+
Step 1 — Diagnosis: Scenario B (Mechanism Design)
|
|
192
|
+
Problem type: Sequence memory compression + information preservation + long-range structure
|
|
193
|
+
Core tension: Compressing token count vs. preserving long-range dependencies
|
|
118
194
|
|
|
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.
|
|
195
|
+
Step 2 — Lens Selection:
|
|
196
|
+
1. Spectral Decomposition (preserve dominant subspace)
|
|
197
|
+
2. Information Theory (retain states with maximum mutual information)
|
|
198
|
+
3. Topological (preserve critical connectivity points of sequential structure)
|
|
125
199
|
|
|
126
|
-
|
|
200
|
+
Step 3 — Knowledge Query:
|
|
201
|
+
→ low-rank-approximation (Matrix Analysis)
|
|
202
|
+
→ leverage-score-selection (Design Pattern: compression)
|
|
203
|
+
→ information-bottleneck (Probability & Information)
|
|
127
204
|
|
|
128
|
-
|
|
205
|
+
Step 4 — Design Translation:
|
|
206
|
+
Candidate A: Spectral KV Compression (low-rank + leverage score)
|
|
207
|
+
Candidate B: Information-Preserving Cache (query sensitivity)
|
|
208
|
+
Candidate C: Topology-Preserving Cache (graph bridge-node retention)
|
|
129
209
|
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
|
|
210
|
+
Step 5 — Critic Review:
|
|
211
|
+
A is most GPU-friendly; B requires estimating future queries with inherent uncertainty; C has prohibitive graph construction cost
|
|
212
|
+
Recommendation: Prioritize A; use B as a lightweight gate
|
|
213
|
+
```
|