Fuse in u-space. Multiply/divide by rapidity.
2.3 Order-Invariant Streaming Fuse (U/W mean in u-space)
Goal. Combine many alignments into one bounded result that is independent of order, chunking, or sharding.
Definition (the fuse).
# items i with alignments a_i (|a_i|<1 after clamp) and weights w_i >= 0
U := SUM_i w_i * atanh(a_i)
W := SUM_i w_i
a_out := tanh( U / max(W, eps_w) ) # default eps_w = 1e-12
# convention: if W = 0 then a_out := 0 (neutral)
Why it is order-invariant.U and W are additive across time and shards; tanh/atanh invert on the clamped domain, so a_out depends only on the multiset {(a_i,w_i)}.
Do not average in a-space.
Naive a_out := SUM(w*a)/SUM(w) is not invariant and misbehaves near edges. Always fuse in u-space.
State to carry in streams.
Carry only (U, W). If you must carry a_out, also carry W and reconstruct U := W * atanh(a_out) before merging.
Worked example (calculator-fast).a1 = tanh(0.2), a2 = tanh(0.4), a3 = tanh(-0.1); w = [1, 2, 0.5].
Contributions in u are 0.2, 0.4, -0.1.U = 0.95, W = 3.5, a_out = tanh(0.95/3.5) ≈ 0.264954 (same under any permutation or sharding).
Pseudocode (drop-in, streaming-safe).
class Fuse:
def __init__(self, eps_w=1e-12):
self.U = 0.0; self.W = 0.0; self.eps_w = eps_w
def add(self, a, w=1.0, eps_a=1e-6):
a = max(-1+eps_a, min(1-eps_a, a))
self.U += w * atanh(a)
self.W += w
def merge(self, other):
self.U += other.U; self.W += other.W
def value(self):
if self.W <= 0: return 0.0
return tanh(self.U / max(self.W, self.eps_w))
Edge behavior.
• Zero weight: contributes nothing.
• All-zero weight: W=0 ⇒ a_out=0.
• Weights: start with w := |m|^gamma (gamma=1) or uniform w := 1 if declared.
• Precision: pick eps_w consistent with dtype.
Proof sketch (associative merge).
# groups G1:(U1,W1), G2:(U2,W2)
a_batch := tanh( (U1+U2) / (W1+W2) )
# streaming via carried U/W gives the same result:
U' := U1 + U2
W' := W1 + W2
a_stream := tanh( U' / W' ) = a_batch
One-line takeaway. Fuse in u-space with (U,W); invert once with tanh. That’s why streams, batches, and shards all produce the same bounded answer.
2.4 Lane Mul/Div (M2) and Division Policy
Definition (lane only; magnitudes are classical).
# x1 := (m1,a1), x2 := (m2,a2), with |a1|,|a2| < 1 after clamp
# Mul (M2)
a_mul := tanh( atanh(a1) + atanh(a2) )
m_mul := m1 * m2
# Div (M2)
a_div := tanh( atanh(a1) - atanh(a2) )
m_div := m1 / m2 # per host system rules
# Collapse parity: phi((m*,a_*)) = m_*
Why M2. atanh turns the bounded lane into an additive space; returning with tanh keeps results in (-1,+1).
Properties (quick).
• Commutative (mul), non-commutative (div) — matches classical behavior.
• Identity: multiplying by a=0 leaves the lane unchanged.
• Reciprocal/power: a_pow := tanh(k*atanh(a)) (reciprocal at k=-1).
• Clamp-safety: always use a_c := clamp(a, -1+eps_a, +1-eps_a) before atanh.
Division policy (declare once; affects control, not m).
division_policy := "strict" # default
# "strict": if |m2| <= eps_div, do not use the lane for actuation; log/stamp and fallback to classical policy.
# "meadow": totalized division in host system; SSM-AI still records lanes/bands, never alters m.
# "soft": UI/analytics saturation only; never change m inside SSM-AI.
Worked numbers (calculator-fast).a1 = tanh(0.5) ≈ 0.462117, a2 = tanh(0.2) ≈ 0.197375a_mul = tanh(0.7) ≈ 0.604367, a_div = tanh(0.3) ≈ 0.291313.
Near-edge: a = 0.9999999, eps_a=1e-6 → a_c = 0.999999; atanh(a_c) finite; results stay bounded.
Pseudocode (drop-in).
def clamp_align(a, eps_a=1e-6):
return max(-1+eps_a, min(+1-eps_a, a))
def lane_mul(a1, a2, eps_a=1e-6):
return tanh(atanh(clamp_align(a1, eps_a)) + atanh(clamp_align(a2, eps_a)))
def lane_div(a1, a2, eps_a=1e-6):
return tanh(atanh(clamp_align(a1, eps_a)) - atanh(clamp_align(a2, eps_a)))
def lane_pow(a, k, eps_a=1e-6):
return tanh(k * atanh(clamp_align(a, eps_a)))
QA checklist (pass/fail).
• Clamp: inputs satisfy |clamp_align(a)| < 1.
• Reciprocal: lane_mul(a, lane_pow(a, -1)) == 0 (lane identity) within tolerance.
• Associativity (mul): lane_mul(a1, lane_mul(a2, a3)) == lane_mul(lane_mul(a1, a2), a3).
• Edge near zero (div): under "strict", if |m2| <= eps_div, do not use the lane for actuation; log/stamp and fallback.
One-line takeaway. Use rapidity addition/subtraction for lane mul/div:tanh(atanh(a1) +/- atanh(a2)). Reliability stays bounded and stable, while m follows classical math unchanged.
Navigation
Previous: SSM-AI – Canon — Numerals & Rapidity (2.1, 2.2)
Next: SSM-AI – Lens → Align → RSI (3, 3.1)
Directory of Pages
SSM-AI — Table of Contents