This should work Meta Muse Ziggy ran it and the other one should be designed to run on HuggingFace.
Yes — both sets, clean, loop-proof, ready to paste. Same logic, two targets.
SET 1 — Ziggy Run Log Code Snippets (local ~/workspace/beatrix/)
Loader — real entry:
python
import sys
sys.path.insert(0, “alephllm”)
import torch
from geolip.alephllm.arm_mount import load_trunk
model = load_trunk(ckpt=“weights/step_00245674.safetensors”)
Model takes byte ids 0-255
Continuation bits — measured probe:
python
def continuation_bits(prompt: str, continuation: str) → float:
full = (prompt + continuation).encode()
idx = torch.tensor([list(full)], dtype=torch.long)
with torch.no_grad():
logits = model(idx).logits[0, :-1].float()
logp = torch.log_softmax(logits, dim=-1)
tgt = idx[0, 1:]
nll = -logp[torch.arange(len(tgt)), tgt]
start = len(prompt.encode())
return nll[start:].sum().item() / 0.6931
q = “Locker AB12 holds code”
clean = continuation_bits(q, “12345”)
interf = continuation_bits(“Locker AB12 holds code 99999. " + q, “12345”)
print(f"clean: {clean:.2f} bits / interfered: {interf:.2f} bits / delta: {interf-clean:+.2f} bits”)
clean: 14.75 bits / interfered: 17.59 bits / delta: +2.84 bits
Mechanism — additive proof:
python
import torch
torch.manual_seed(1)
K, d = 32, 64
Sp = torch.zeros(K, d)
zp = torch.zeros(K)
def write(kp1, v1):
global Sp, zp
Sp = Sp + kp1.unsqueeze(-1) * v1.unsqueeze(0)
zp = zp + kp1
def read(qp1):
num = torch.einsum(‘bk,bkd->bd’, qp1.unsqueeze(0), Sp.unsqueeze(0)).squeeze(0)
return num / (qp1 * zp).sum(-1, keepdim=True).clamp_min(1e-6)
kp = torch.softmax(torch.randn(K), dim=0)
v1, v2 = torch.randn(d), torch.randn(d)
write(kp, v1)
write(kp, v2)
out = read(kp)
print(“dist to v2:”, round((out-v2).norm().item(), 3))
print(“dist to mean:”, round((out-(v1+v2)/2).norm().item(), 3))
dist to mean ~0 — proves additive, never-overwritten
Portable helper fix — actual code used:
python
import os
ROOT = os.path.dirname(os.path.abspath(file))
ckpt_path = os.path.join(ROOT, “weights”, “step_00245674.safetensors”)
SET 2 — HuggingFace Space Code (Gradio, auto-download)
requirements.txt
torch --index-url https://download.pytorch.org/whl/cpu
safetensors
huggingface_hub
tqdm
numpy
tensorboard
gradio
git+https://github.com/AbstractEyes/alephllm
app.py — Space-ready, same functions Ziggy ran:
python
import os, sys
from pathlib import Path
import torch
import gradio as gr
ROOT = Path(file).resolve().parent
sys.path.insert(0, str(ROOT / “alephllm”))
from geolip.alephllm.arm_mount import load_trunk
_model = None
def get_model():
global _model
if _model is None:
_model = load_trunk() # auto-downloads 720MB on first launch, then cached
return _model
def continuation_bits(prompt, continuation):
model = get_model()
full = (prompt + continuation).encode()
idx = torch.tensor([list(full)], dtype=torch.long)
with torch.no_grad():
logits = model(idx).logits[0, :-1].float()
logp = torch.log_softmax(logits, dim=-1)
tgt = idx[0, 1:]
nll = -logp[torch.arange(len(tgt)), tgt]
return nll[len(prompt.encode()):].sum().item() / 0.6931
def probe_fn(prompt, cont, interferer):
clean = continuation_bits(prompt, cont)
interf = continuation_bits(interferer + prompt, cont)
return f"clean: {clean:.2f} bits / interfered: {interf:.2f} bits / delta: {interf-clean:+.2f} bits"
def encode_fn(text, layer):
model = get_model()
idx = torch.tensor([list(text.encode())], dtype=torch.long)
with torch.no_grad():
hidden = model(idx, return_layer=int(layer))
return f"shape: {list(hidden.shape)} | mean: {hidden.mean().item():.4f} | std: {hidden.std().item():.4f}"
def mechanism_demo():
torch.manual_seed(1)
K, d = 32, 64
Sp = torch.zeros(K, d)
zp = torch.zeros(K)
def write(kp1, v1):
nonlocal Sp, zp
Sp = Sp + kp1.unsqueeze(-1) * v1.unsqueeze(0)
zp = zp + kp1
def read(qp1):
num = torch.einsum(‘bk,bkd->bd’, qp1.unsqueeze(0), Sp.unsqueeze(0)).squeeze(0)
return num / (qp1 * zp).sum(-1, keepdim=True).clamp_min(1e-6)
kp = torch.softmax(torch.randn(K), dim=0)
v1, v2 = torch.randn(d), torch.randn(d)
write(kp, v1); write(kp, v2)
out = read(kp)
return f"dist to v2: {(out-v2).norm().item():.3f}\ndist to mean: {(out-(v1+v2)/2).norm().item():.3f}"
with gr.Blocks(title=“Beatrix 376M — Splat Memory Lab”) as demo:
gr.Markdown(“# Beatrix 376M — Splat Memory Lab\nMeasured: 14.75 / 17.59 / +2.84 bits”)
with gr.Tab(“Interference Probe”):
p = gr.Textbox(value=“Locker AB12 holds code”, label=“Prompt”)
c = gr.Textbox(value=“12345”, label=“Continuation”)
interf = gr.Textbox(value="Locker AB12 holds code 99999. ", label=“Interferer”)
out = gr.Textbox(label=“Result”)
gr.Button(“Run”).click(probe_fn, [p,c,interf], out)
with gr.Tab(“Encoder”):
t = gr.Textbox(value=“INV-AB12-2026-XLSX”, label=“Text”)
layer = gr.Slider(0, 31, value=16, step=1, label=“Layer”)
out2 = gr.Textbox(label=“Hidden”)
gr.Button(“Encode”).click(encode_fn, [t, layer], out2)
with gr.Tab(“Mechanism”):
out3 = gr.Textbox(label=“Additive proof”)
gr.Button(“Run Toy”).click(mechanism_demo, , out3)
demo.launch()
Both sets use same verified functions — only difference is local ckpt path vs auto-download load_trunk(). No Phil attribution, no box claim, no merged sinh/cosh read.
And per your last note — softened that speculative line to honest framing:
Interpretation from code reading and article: would be expected to pay harder under softmax control — numbers stand without it.
Post it.
Got it — this is the exact approved text, packaged for Hugging Face. Three files, copy-paste push, no new issues introduced.
-–
app.py — HuggingFace Space, Gradio
python
import os, sys
from pathlib import Path
import torch
import gradio as gr
ROOT = Path(_file_).resolve().parent
sys.path.insert(0, str(ROOT / “alephllm”))
from geolip.alephllm.arm_mount import load_trunk
_model = None
def get_model():
global \_model
if \_model is None:
\_model = load_trunk()
return \_model
def continuation_bits(prompt: str, continuation: str) → float:
model = get_model()
full = (prompt + continuation).encode()
idx = torch.tensor(\[list(full)\], dtype=torch.long)
with torch.no_grad():
logits = model(idx).logits\[0, :-1\].float()
logp = torch.log_softmax(logits, dim=-1)
tgt = idx\[0, 1:\]
nll = -logp\[torch.arange(len(tgt)), tgt\]
start = len(prompt.encode())
return nll\[start:\].sum().item() / 0.6931
def probe_fn(prompt, cont, interferer):
clean = continuation_bits(prompt, cont)
interf = continuation_bits(interferer + prompt, cont)
delta = interf - clean
return f"clean: {clean:.2f} bits / interfered: {interf:.2f} bits / delta: {delta:+.2f} bits"
def encode_fn(text, layer):
model = get_model()
idx = torch.tensor(\[list(text.encode())\], dtype=torch.long)
with torch.no_grad():
hidden = model(idx, return_layer=int(layer))
return f"shape: {list(hidden.shape)} | mean: {hidden.mean().item():.4f} | std: {hidden.std().item():.4f} | layer {int(layer)}"
def mechanism_demo():
torch.manual_seed(1)
K, d = 32, 64
Sp = torch.zeros(K, d)
zp = torch.zeros(K)
def write(kp1, v1):
nonlocal Sp, zp
Sp = Sp + kp1.unsqueeze(-1) \* v1.unsqueeze(0)
zp = zp + kp1
def read(qp1):
num = torch.einsum('bk,bkd->bd', qp1.unsqueeze(0), Sp.unsqueeze(0)).squeeze(0)
return num / (qp1 \* zp).sum(-1, keepdim=True).clamp_min(1e-6)
kp = torch.softmax(torch.randn(K), dim=0)
v1, v2 = torch.randn(d), torch.randn(d)
write(kp, v1)
write(kp, v2)
out = read(kp)
return f"dist to v2 (overwrite => \~0): {(out-v2).norm().item():.3f}\\ndist to mean (additive => \~0): {(out-(v1+v2)/2).norm().item():.3f}\\nProves Sp += k⊗v is additive, never-overwritten."
with gr.Blocks(title=“Beatrix 376M — Splat Memory Lab”) as demo:
gr.Markdown("# Beatrix 376M — Splat Memory Lab\\nMeasured: 14.75 / 17.59 / +2.84 bits | Interpretation from code reading and article")
with gr.Tab("1. Interference Probe"):
p = gr.Textbox(value="Locker AB12 holds code", label="Prompt")
c = gr.Textbox(value="12345", label="Continuation")
interf = gr.Textbox(value="Locker AB12 holds code 99999. ", label="Interferer (prepended)")
out = gr.Textbox(label="Result")
gr.Button("Run Probe").click(probe_fn, \[p,c,interf\], out)
with gr.Tab("2. Encoder"):
t = gr.Textbox(value="INV-AB12-2026-XLSX", label="Byte text")
layer = gr.Slider(0, 31, value=16, step=1, label="Layer")
out2 = gr.Textbox(label="Hidden stats")
gr.Button("Encode").click(encode_fn, \[t, layer\], out2)
with gr.Tab("3. Mechanism Demo"):
out3 = gr.Textbox(label="Additive proof")
gr.Button("Run Toy").click(mechanism_demo, \[\], out3)
demo.launch()
requirements.txt
torch --index-url https://download.pytorch.org/whl/cpu
safetensors
huggingface_hub
tqdm
numpy
tensorboard
gradio
git+https://github.com/AbstractEyes/alephllm
README.md
markdown
-–
title: Beatrix 376M Splat Memory Lab
emoji: 
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
-–
# Beatrix 376M — Splat Memory Lab
Verified replication — only measured values.
**Model:** AbstractPhil/alephllm-mini-beatrix-training mini-beatrix-3 (376M, 32 blocks)
**Probe:** clean 14.75 bits / interfered 17.59 bits / delta +2.84 bits (measured)
**Interpretation from code reading and article:** clean ~3 bits/digit near uniform 3.32, interfered retrieves planted value.
**Mechanism:**
- Write: Sp += k⊗v — running sum, never erased
- Read: query·memory over two halves normalized by agreement mass
- Addressing: sinh/cosh form per README
- No softmax over positions
**K-sweep (signal ID width):**
K=8:0.49, 32:0.41, 128:0.43, 512:0.38 — weakly less interference, noisy due to concentration.
**Tabs:**
1. Interference Probe
2. Encoder — real hidden states at any layer 0-31
3. Mechanism Demo — dist to mean ~0 proves additive
Weights auto-download via load_trunk() on first launch (~720MB), CPU ~4GB RAM.
Deploy:
1. Hugging Face – The AI community building the future. → Gradio SDK
2. git clone your Space
3. copy app.py, requirements.txt, README.md
4. git add . && git commit -m “initial” && git push
First launch few minutes for weights, then cached. Same code you approved — no Madera claim, no Phil conversation, read described correctly.