Practical MVP algorithm (harvested)
Parent: Research'/maths/outputs/HARVESTED_COHERENT_SPEC.md
In-tree MVP: new_ai_language/aoc/hybrid_aoc.py (NumPy Tier 0.5/1)
Code seeds: Research'/maths/outputs/harvested_practical_approx.py, Research'/maths/math_kv/attention_output_approx.py
Philosophy
Ship data-driven prototypes + A-cloud anchors + hybrid window.
Avoid full high-d chirotope enum (scaling disaster at d_h=64, m=32k).
Build
- Extract per-head K,V (hooks) for prefix length m.
- Sample queries (isotropic scaled + key perturbations, or real Q if available).
- Compute A(q) cloud.
- Estimate r_Σ (PCA 95%).
- If r_Σ high → dense path.
- Else choose r\* (fixed or elbow).
- Kmeans / greedy farthest on A-cloud → anchors ŵ_j.
- Greedy farthest on K → key protos for locate.
- Optional: cluster means of V as A0 payloads.
- Store anchors, protos, scalars; keep small val set for probes.
- Discard bulk K,V if in AOC mode.
Query
- Exact attention on local_window KV if present.
- Locate nearest proto for q.
- Manifold contrib = anchors[j\*] (or soft weights).
- Sum/combine with local; apply W_O as model requires.
- Periodic probe: compare to dense A on held q; if error > tol → widen local or dense fallback.
Online
- Append to local ring buffer.
- Every refresh_every tokens: graduate oldest → light recluster / barycentric anchor update.
- Deposit “trace” on high error (stigmergy-style) to trigger local refine (optional).
Metrics
- r_Σ, r\*, m
- ||A_hat−A|| mean/max
- mem bytes vs dense
- later: logits KL, needle, PPL
Relation to full matroid research
Matroid/return/Möbius lines remain theory + stretch goals for exact-on-μ subcases.
MVP does not block on them.