Score each step to a bounded RSI; add tiny, public nudges only in u-space
Purpose. Compute a bounded step chooser RSI_s in (-1,+1) for each step of a chain or agent, keep m pristine via phi((m,a)) = m, then move to u-space for order-invariant path pooling.
Per-step chooser (from Section 3).
# two-channel form (ready to use)
U_in_s := SUM_i w_i * atanh(a_in_i)
V_out_s := SUM_j w_j * atanh(a_out_j)
W_in_s := SUM_i w_i
RSI_s := tanh( (V_out_s - U_in_s) / max(W_in_s, eps_w) )
Defaults: eps_w = 1e-12. Weights default w := |m|^gamma with gamma = 1 (uniform w := 1 permitted if declared).
Zero-evidence guard (normative).
if W_in_s == 0:
RSI_s := 0.0 # neutral
band := "A0"
reason := "insufficient_evidence"
Optional calm gate (alignment-only).
# mode "mul" (default)
RSI_used_s := g_s * RSI_s
# mode "u_scale" (curvature-preserving)
RSI_used_s := tanh( g_s * atanh(RSI_s) )
g_s in [0,1] from step telemetry. Invariant: phi((m,a)) = m always; gate scales alignment only.
Why u-space (rapidity). Path math composes additively and becomes order/shard-invariant if we operate in u := atanh(a):
u_s := atanh( clamp(RSI_used_s, -1+eps_a, +1-eps_a) )
Default eps_a = 1e-6 (dtype-aware).
Tiny, public priors (optional).
# bounded prior in u-space
u_s_prime := u_s + beta * b_s
RSI_s_prime := tanh(u_s_prime)
Rules: (i) Publish b_s in [-1,+1] and beta >= 0; (ii) beta = 0 disables prior; (iii) never touch m.
Step record (stamp-ready).
m_s, RSI_s, g_s, RSI_used_s, b_s, beta,
RSI_s_prime, U_s := atanh(RSI_s_prime), W_s
Pick W_s per manifest (uniform 1 or |m_s|^gamma).
Worked minis (calculator-fast; 6-dec).
A) One step with gate and prior
RSI_s = tanh(0.700000) = 0.604368
g_s = 0.800000 -> RSI_used_s = 0.483494
u_s = atanh(0.483494) = 0.527535
b_s = +0.300000, beta = 0.200000 -> u_s_prime = 0.587535
RSI_s_prime = tanh(0.587535) = 0.528120
B) Another step (neutral prior)
RSI_s = tanh(0.400000) = 0.379949
g_s = 1.000000, beta = 0.0 -> u_s_prime = 0.400000
RSI_s_prime = 0.379949
Pseudocode (drop-in, per step).
def step_score(e_in_out_items, g_s=1.0, beta=0.0, b_s=0.0,
eps_w=1e-12, eps_a=1e-6, gate_mode="mul"):
U_in = V_out = W_in = 0.0
for (e_in, e_out, w) in e_in_out_items:
a_in = tanh(-e_in); a_out = tanh(+e_out)
a_in = max(-1+eps_a, min(1-eps_a, a_in))
a_out = max(-1+eps_a, min(1-eps_a, a_out))
U_in += w * atanh(a_in)
V_out += w * atanh(a_out)
W_in += w
if W_in <= 0.0:
return {"RSI_s": 0.0, "RSI_used": 0.0, "u_step": 0.0,
"band": "A0", "reason": "insufficient_evidence"}
RSI_s = tanh((V_out - U_in) / max(W_in, eps_w))
RSI_used = (tanh(g_s * atanh(RSI_s)) if gate_mode == "u_scale"
else g_s * RSI_s)
RSI_used = max(-1+eps_a, min(1-eps_a, RSI_used))
u_step = atanh(RSI_used) + beta * b_s
return {"RSI_s": RSI_s, "RSI_used": RSI_used, "u_step": u_step}
Acceptance checklist (pass/fail).
C1 Collapse parity: phi((m_s,a_s)) == m_s for all steps
C2 Boundedness: |RSI_s| < 1, |RSI_used_s| < 1
C3 Determinism: same inputs + manifest ⇒ identical outputs
C4 Zero-evidence: W_in_s == 0 ⇒ RSI_s = 0, band A0, reason logged
C5 Prior neutrality: beta = 0 ⇒ no change
C6 Gate purity: gate scales alignment only; never m
One-line takeaway. Score each step to a bounded RSI_s, optionally gate it, move to u-space, and add only tiny, published priors there — setting up deterministic, order-invariant path pooling in 5.2 while phi((m,a)) = m keeps numbers identical.
Navigation
Previous: SSM-AI – Gate Stamp Fields (4.6)
Next: SSM-AI – Path Pooling and Reporting (5.2)
Directory of Pages
SSM-AI — Table of Contents