Skip to content

docs: signed i8 formulas per role — Q/K/V/Gate/Up/Down encoding + MatVec Complete formulas for building signed i8 distance tables: Q: raw cosine → i8 (extern, no gate) K: silu(gate) × K → cosine → i8 (intern, gate-modulated) V: silu(gate) × V → cosine → i8 (intern, gate-modulated) Gate: raw cosine → i8 (IS the gate, topology reference) Up: silu(gate) × Up → cosine → i8 (strongest effect, 33% Δ) Down: raw cosine → i8 (funnel, receives gated result) Per-role scale factors from Qwopus BF16 measured ranges. Gate gets highest resolution (scale=552) because range is narrowest. Signed MatVec + clamp(0) = excitation/inhibition dynamics. Complete layer_forward_signed() showing gate as NARS trust modulator. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp#119

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/setup-embedding-pipeline-Fa65C
Apr 5, 2026

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

No description provided.

Complete formulas for building signed i8 distance tables:
  Q:    raw cosine → i8 (extern, no gate)
  K:    silu(gate) × K → cosine → i8 (intern, gate-modulated)
  V:    silu(gate) × V → cosine → i8 (intern, gate-modulated)
  Gate: raw cosine → i8 (IS the gate, topology reference)
  Up:   silu(gate) × Up → cosine → i8 (strongest effect, 33% Δ)
  Down: raw cosine → i8 (funnel, receives gated result)

Per-role scale factors from Qwopus BF16 measured ranges.
Gate gets highest resolution (scale=552) because range is narrowest.
Signed MatVec + clamp(0) = excitation/inhibition dynamics.
Complete layer_forward_signed() showing gate as NARS trust modulator.

https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp
@AdaWorldAPI AdaWorldAPI merged commit 3d61067 into main Apr 5, 2026
AdaWorldAPI pushed a commit that referenced this pull request Apr 6, 2026
role_tables.rs (7 tests):
  silu(): SiLU activation function
  gate_modulate(): silu(gate) ⊙ role elementwise
  build_raw_table(): ClamCodebook → BF16 (Q, K, V, Gate, Down)
  build_gate_modulated_table(): silu(gate)×Up → cosine → BF16 (Up only)
  LayerTables: complete per-role table set for one layer
  GateModulationStats: cells_changed, mean/max delta

Per-role encoding (from PR #119 formulas):
  Q:    raw cosine → BF16  (extern, no gate)
  K:    raw cosine → BF16  (attention, no FFN gate)
  V:    raw cosine → BF16  (attention, no FFN gate)
  Gate: raw cosine → BF16  (topology reference)
  Up:   silu(gate)×Up → BF16  (gate-modulated, the 33% correction)
  Down: raw cosine → BF16  (funnel)

Synthetic test: 91.4% cells changed, mean Δ=0.087, max Δ=0.266
Real Qwopus (measured in other session): 99.2% cells, mean Δ=84.2 u8

Uses: bgz_tensor::stacked_n::{StackedN, ClamCodebook, bf16_to_f32}
      ndarray::hpc::heel_f64x8::cosine_f32_to_f64_simd

259 tests pass.

https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants