SSM-AI – Gate Formula & Modes (4.2)

Throttle by math: mix lanes → make g_t → scale alignment (never m).

4.2 Gate formula (how g_t shapes selection, alignment-only)
Instant gate (default). Normalize telemetry lanes to [0,1], then mix with nonnegative weights.

W      := wF + wD + wL + wE + wV + wQ
mix    := (wF*F_t + wD*D_t + wL*L_t + wE*E_t + wV*V_t + wQ*Q_t) / max(W, 1e-12)
g_inst := clamp(1 - mix, 0, 1)

Safety notch (optional). A severe lane forces conservative behavior.

sev   := max(F_t, D_t, E_t)          # pick lanes you deem critical
g_sev := clamp( 1 - (sev - s_thr) / max(1 - s_thr, 1e-12), 0, 1 )   # s_thr in [0,1)
g_inst := min(g_inst, g_sev)

Smoothing & floors (avoid jitter).

g_t := (1 - rho) * g_{t-1} + rho * g_inst     # rho in (0,1], e.g., 0.20
g_t := clamp( max(g_min, g_t), 0, 1 )         # e.g., g_min = 0.00

Two application modes (declare exactly one).

# Mode "mul" (default): proportional scaling in bounded space
RSI_env := g_t * RSI

# Mode "u_scale": scale curvature in u-space (gentler damping near high RSI)
RSI_env := tanh( g_t * atanh(RSI) )

Both keep |RSI_env| < 1. Band after gating (i.e., compute band on RSI_env). m is never altered; phi((m,a)) = m always holds.

Worked minis (calculator-fast).

RSI = 0.70, F_t=0.20, D_t=0.10, L_t=0.30, E_t=0.15, V_t=0.20, equal weights (W=5), rho=1
mix   = (0.20+0.10+0.30+0.15+0.20)/5 = 0.19
g_t   = 1 - 0.19 = 0.81

mode = "mul"    → RSI_env = 0.81 * 0.70 = 0.567  → band A0
mode = "u_scale"→ RSI_env = tanh(0.81 * atanh(0.70)) ≈ 0.606 → band A+

Pseudocode (drop-in).

def gate_value(F,D,L,E,V,Q=0.0, w=(1,1,1,1,1,0), s_thr=None, rho=0.2, state=None,
               eps_g=1e-12, g_min=0.0):
    wF,wD,wL,wE,wV,wQ = w
    W = max(wF+wD+wL+wE+wV+wQ, eps_g)
    mix   = (wF*F + wD*D + wL*L + wE*E + wV*V + wQ*Q) / W
    g_inst = max(0.0, min(1.0, 1.0 - mix))
    if s_thr is not None:
        sev   = max(F, D, E)
        g_sev = max(0.0, min(1.0, 1.0 - (sev - s_thr)/max(1.0 - s_thr, eps_g)))
        g_inst = min(g_inst, g_sev)
    g_prev = 1.0 if state is None else state["g"]
    g      = (1 - rho) * g_prev + rho * g_inst
    g      = max(g_min, min(1.0, g))
    return {"g": g}

def apply_gate(RSI, g, mode="mul"):
    if mode == "u_scale":
        return tanh(g * atanh(RSI))
    return g * RSI

Guardrails (normative).
Alignment-only: gate affects RSI/bands; never mutates m.
Determinism: same lanes + manifest ⇒ same g_t, RSI_env.
Visibility: log lanes, g_inst, g_t, mode, and RSI_env.
Fallback: if lanes missing/corrupt → clamp to [0,1], set g_t := 1, flag; continue.

One-line takeaway. Mix bounded telemetry into g_t and scale alignment, not values—choose “mul” for simple proportional damping or “u_scale” for gentler high-confidence behavior; in all cases phi((m,a)) = m keeps numbers identical.


Navigation
Previous: SSM-AI – Calm Gate (Volatility Governor) (4, 4.1)
Next: SSM-AI – Gate Knobs & Purity (4.3)


Directory of Pages
SSM-AI — Table of Contents