New AI Language docs · static / Cloudflare Pages

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

  1. Extract per-head K,V (hooks) for prefix length m.
  2. Sample queries (isotropic scaled + key perturbations, or real Q if available).
  3. Compute A(q) cloud.
  4. Estimate r_Σ (PCA 95%).
  5. If r_Σ high → dense path.
  6. Else choose r\* (fixed or elbow).
  7. Kmeans / greedy farthest on A-cloud → anchors ŵ_j.
  8. Greedy farthest on K → key protos for locate.
  9. Optional: cluster means of V as A0 payloads.
  10. Store anchors, protos, scalars; keep small val set for probes.
  11. Discard bulk K,V if in AOC mode.

Query

  1. Exact attention on local_window KV if present.
  2. Locate nearest proto for q.
  3. Manifold contrib = anchors[j\*] (or soft weights).
  4. Sum/combine with local; apply W_O as model requires.
  5. 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.