SSM-AI – Canon — Numerals & Rapidity (2.1, 2.2)

Two-lane numeral. Clamp safely. Compose in rapidity.

Two-Lane Numeral and Collapse (2.1)
Definition. Every quantity carries a magnitude and a bounded alignment lane: x := (m, a) with a in (-1,+1). Collapse map: phi((m,a)) = m.

Semantics (read-only lane).
m is the classical value (logit, probability, score, distance, latency, reward, etc.).
a is dimensionless, bounded, and composable; it summarizes stability/fit under a declared lens.
• All routing/selection may inspect a (or RSI) while classical code continues to see m via phi.

Bounds & clamps.
• Enforce |a| < 1. Use a small clamp.

a_c := clamp(a, -1+eps_a, +1-eps_a)    # default eps_a = 1e-6

• Neutral alignment is a = 0 (no preference; u = 0 in rapidity space).

Identity & neutrality.
Numeral identity: (m, 0) behaves like the classical m under collapse: phi((m,0)) = m.
Lane neutrality under pooling: adding neutral items (a = 0) does not change pooled alignment (see 2.3).

Units.
m retains its original units; a is unitless.
Lens scale c and any Unit constants are declared in the manifest so a stays comparable across runs.

Data shapes.
• Scalars, vectors, matrices, and tensors are supported. m and a share shape; operations are elementwise except in explicit pooling (U/W).

Serialization (logs & CSVs).
• Columns: m, a, band, U, W, RSI, RSI_env, stamp.
Collapse for external systems: write m_out := phi((m,a)) = m wherever only classical values are allowed.

Compatibility (drop-in).
• Existing APIs that expect m continue unchanged; the lane is side-car.
• When emitting one field, choose m; when emitting two, choose (m,a); when emitting a decision, include RSI (and optionally RSI_env).

Tiny examples.
E1 — Neutral lane. x = (0.73, 0) ⇒ phi(x) = 0.73.
E2 — Bounded lane. x = (42, tanh(0.8)) ≈ (42, 0.664037) ⇒ phi(x) = 42.
E3 — Tensor shape. m = [0.2, 0.8], a = [tanh(0.1), tanh(0.3)] ⇒ shapes match; collapse yields [0.2, 0.8].

Pocket struct & helpers (pseudocode).

struct LaneValue { m: float, a: float }  # |a| < 1

def collapse(x):
    return x.m  # phi((m,a)) = m

def clamp_align(a, eps_a=1e-6):
    return max(-1+eps_a, min(+1-eps_a, a))

def make(m, a, eps_a=1e-6):
    return LaneValue(m=m, a=clamp_align(a, eps_a))

One-line takeaway. Treat every AI quantity as x := (m,a); always recover the classical path with phi((m,a)) = m, while the lane powers bounded, comparable decisions.


Clamp & Rapidity (2.2)
Engine.

a_c := clamp(a, -1+eps_a, +1-eps_a)
u   := atanh(a_c)
a   := tanh(u)

Why clamp? Keep alignment strictly inside (-1,+1) so composition is finite and stable. Use a tiny margin eps_a to avoid infinities at ±1.

Why rapidity? Map bounded alignment to an additive space for safe, order-invariant composition; invert back to the bounded lane.
Monotone & odd: atanh/tanh preserve ordering; atanh(-a) = -atanh(a).
Additive in u: fusing evidence adds u’s, then returns to a via tanh.
Stable near 0: atanh(a) ≈ a for small |a|.
Edge-finite: clamp keeps |u| < +∞ even when a -> ±1.

Core identities (use everywhere).

atanh(tanh(u)) = u
tanh(atanh(a)) = a_c           # post-clamp
d/du tanh(u) = 1 - tanh(u)^2   # = 1 - a^2
atanh(a) = 0.5*log((1+a)/(1-a))  # a in (-1,+1)

Streaming fuse (mean in u-space).

U := SUM w_i * atanh(a_i)
W := SUM w_i
a_out := tanh( U / max(W, eps_w) )    # default eps_w = 1e-12

This makes batch == stream == shuffled by construction.

Numerical guardrails.
• Choose eps_a to fit dtype: 1e-6 (float32), 1e-12 (float64).
• Use eps_w to avoid divide-by-zero when W = 0.
• Apply clamp/atanh/tanh elementwise; do reductions only in fusing.

Worked minis (calculator-fast).
Clamp: a = 0.9999999, eps_a=1e-6a_c = 0.999999 (finite).
Map/invert: u = atanh(0.5) ≈ 0.549306; back a = tanh(0.549306) ≈ 0.5.
Fuse two (w=1): a1 = tanh(0.2), a2 = tanh(0.4)U = 0.6, W = 2, a_out = tanh(0.3) ≈ 0.291313 (same if order swapped).

Pseudocode (drop-in).

def clamp_align(a, eps_a=1e-6):
    return max(-1+eps_a, min(+1-eps_a, a))

def to_u(a, eps_a=1e-6):
    return atanh(clamp_align(a, eps_a))

def from_u(u):
    return tanh(u)

def fuse_alignments(a_list, w_list, eps_a=1e-6, eps_w=1e-12):
    U = sum(w*to_u(a, eps_a) for a, w in zip(a_list, w_list))
    W = sum(w_list)
    return from_u(U / max(W, eps_w))

Traditional vs SSM-AI (combining “confidence” cues).
Goal: combine multiple reliability cues without order effects.
Traditional: weighted average in a-space a_out = SUM(w*a)/SUM(w) → saturation/edge artifacts.
SSM-AI: work in rapidity:

U = SUM w*atanh(a)
a_out = tanh( U / max(W, eps_w) )

→ order-invariant, edge-safe fusion with clamps.

QA checklist (pass/fail).
Clamp hits: for any input a, |clamp_align(a)| < 1.
Round-trip: from_u(to_u(a)) == clamp_align(a) within tolerance.
Additivity: to_u(a1) + to_u(a2) == to_u( tanh(atanh(a1) + atanh(a2)) ).
Order-invariance: fuse_alignments([a1,a2],[w1,w2]) == fuse_alignments([a2,a1],[w2,w1]).

One-line takeaway. Clamp → map to u := atanh(a) → compose additively → return via a := tanh(u) — that is the simple engine behind SSM-AI’s bounded, order-invariant behavior.


Navigation
Previous: SSM-AI – Limits & Failure Modes (1.6)
Next: SSM-AI – Canon — Streaming Fuse & M2 (2.3, 2.4)


Directory of Pages
SSM-AI — Table of Contents