From raw logs to a bounded, fair lens in 30 minutes — values untouched, fusion invariant.
I1) Inputs & outputs (what you start with, what you ship)
- You have (from logs): per-item positive cues
P_i, penaltiesN_j, any magnitudem, and optional labels/judge scores. - You must publish (to manifest): Unit > 0, c > 0, weight policy
w := |m|^gamma(orw := 1), optional gate presetg_t, and a band table. - Lens skeleton (repeatable):
e := ( sum_i alpha_i*P_i - sum_j beta_j*N_j ) / Unit, then mapa := tanh(c*e)(or two-channela_out := tanh(+c*e_out),a_in := tanh(-c*e_in)). - Invariant: classical numbers remain untouched:
phi((m,a)) = m.
# Fusion (order/shard-invariant)
a_c := clamp(a, -1+eps_a, +1-eps_a)
u := atanh(a_c)
U += w * u
W += w
a_out := tanh( U / max(W, eps_w) )
I2) 30-Minute recipe (deterministic, copy-paste)
Step 1 — Normalize raw terms (dimensionless).
Scale each P_i, N_j so typical values lie in [0,1] (e.g., divide by p95, mean+2*std, or an SLO).
Step 2 — Choose Unit so typical |e| ∈ [0.2, 1.5].
Let z_pos := p95( sum_i alpha_i*P_i ), z_neg := p95( sum_j beta_j*N_j ).
Set Unit := max(z_pos, z_neg, 1e-12) (single-channel: Unit := p95(|ΣαP − ΣβN|)).
Step 3 — Pick c from a target response.
Choose e* := p95(|e|) and a target alignment boundary, e.g., t* := 0.60 (A+) or 0.90 (A++).
Solve once: c := atanh(t*) / max(e*, 1e-12).
Step 4 — Select weight policy w.w := 1 (pure comparability) or w := |m|^gamma (strength-aware, start gamma = 1).
Step 5 — Dry run and band sanity.
Compute a := tanh(c*e), then pool to RSI := tanh( mean_u ). Expect spread across A0/A+ with few A–/A++ (unless trivial).
Step 6 — Freeze and stamp.
Record Unit, c, weights, eps_a, eps_w, and a knobs_hash. From now, runs are comparable.
# I2 – quick helper snippets
Unit := p95(|e_raw|) # robust default
c := atanh(0.60) / p95(|e|) # map p95 to ~A+ boundary (or use 0.90 for A++)
w := 1 # or |m|^gamma with gamma=1
I3) Worked micro example (calculator-fast, single-channel)
Warmup slice (1k items) gives p95(|e_raw|) = 0.780000.
Choose t* = 0.60: c = atanh(0.60) / 0.780000 ≈ 0.693147 / 0.780000 ≈ 0.888650.
Weights: w := 1.
# Two items
e = 0.500000 → a = tanh(0.888650 * 0.500000) = tanh(0.444325) ≈ 0.417223 → band A0
e = 1.100000 → a = tanh(0.888650 * 1.100000) = tanh(0.977515) ≈ 0.751988 → band A+
One-line takeaway. Normalize to dimensionless e, pick Unit from a robust percentile and c from one target boundary, declare w once, and you have a portable, bounded lens that fuses order-invariantly while phi((m,a)) = m keeps your numbers pristine.
Navigation
Previous: SSM-AI – Appendix H — Comparisons & Synergies (H7–H9)
Next: SSM-AI – Appendix I — Lens Builder (I4–I6)
Directory of Pages
SSM-AI — Table of Contents