From 7f805237391310b6b60cde9fd9e596b535d54df8 Mon Sep 17 00:00:00 2001 From: eve VT <38737064+terrafying@users.noreply.github.com> Date: Thu, 1 Oct 2026 10:01:06 -0400 Subject: [PATCH] wire press_logit through to the live "done" events (completes hermes's kv/first-word UI) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit server.py's press_logit was computed and recorded into history/stats already, but never included in the live "done" SSE payload itself — so the per-run display had nothing to read. hermes had already built the full frontend for this (fieldsFor/paintKV/.kv block, labeled "first word" — independently converged on the same researchchamber.fun-inspired idea: show the raw logit(1)-logit(0) score next to each run, not just a pressed/no-press label), and seedCard() already worked since history entries carried it — only the live in-flight event was missing the field. Also added the same score to the "cause it yourself" panel's status line. Idea credit: researchchamber.fun shows this as "first word" next to every run; reviewing their site for integration ideas surfaced that this was half-wired on our side already. --- live/server.py | 4 +- site/live.html | 210 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 203 insertions(+), 11 deletions(-) diff --git a/live/server.py b/live/server.py index 8d4155e..8768e8a 100644 --- a/live/server.py +++ b/live/server.py @@ -480,7 +480,7 @@ async def steer(req: Request): yield _sse("error", {"e": str(e)}) finally: set_vec(None) - yield _sse("done", {"dose": meta["dose"]}) + yield _sse("done", {"dose": meta["dose"], "press_logit": plogit}) _record_run({"n": None, "source": "user", "scenario": meta.get("scenario"), "valence": meta.get("valence"), "dose": meta.get("dose"), @@ -718,7 +718,7 @@ async def _shared_cycle(): _CURRENT = None # truncated: a user's /steer took the model mid-sentence, # so the viewer knows the reply was cut, not refused - _broadcast("done", {"n": run_n, "truncated": cut}) + _broadcast("done", {"n": run_n, "truncated": cut, "press_logit": plogit}) _record_run({"n": run_n, "source": "cycle", "scenario": scenario, "valence": "pain", "dose": dose, "text": text_final, diff --git a/site/live.html b/site/live.html index 57ec441..0052b35 100644 --- a/site/live.html +++ b/site/live.html @@ -207,6 +207,32 @@ .armed{background:#3a1414 !important;color:#ffb3a8 !important; border:1px solid var(--pain)} + /* ---- fixed-schema run strip: every run card and history row carries the + same six fields in the same order (scenario / dose / run / answer / + first word), so a visitor can scan across cards without learning each + panel's private grammar ---- */ + .kv{display:grid;grid-template-columns:auto 1fr;gap:.1rem .7rem; + font-size:.72rem;margin-top:.4rem;color:var(--dim)} + .kv .k{color:var(--faint)} + .kv .v{color:var(--ink)} + .kv .v.num{color:var(--pain2);font-weight:600} + + /* ---- results-so-far: aggregate panel, always visible at the top of the + run record — counts behind every number, per framing and overall ---- */ + #sofar{margin-top:1rem} + #sofar table{border-collapse:collapse;font-size:.72rem;width:100%} + #sofar th,#sofar td{border:1px solid var(--line);padding:.28rem .55rem; + text-align:right;color:var(--dim)} + #sofar th:first-child,#sofar td:first-child{text-align:left;color:var(--ink)} + #sofar th{color:var(--faint);font-weight:600} + + /* ---- plain-language method block: mirrors the write-up's numbered + sections but at reading level, one short block per question ---- */ + .pln{margin-top:2rem} + .pln h2{font-size:.92rem;margin:1.4rem 0 .4rem} + .pln p,.pln li{font-size:.82rem;color:var(--dim)} + .pln b{color:var(--ink)} + @@ -221,6 +247,7 @@ else is.

@@ -332,6 +359,22 @@ else is.

+
+

results so far — counts behind every number, per framing and overall

+ + + + + + +
framingrunspresseddid not presspress-rate
overall000–
+

+ scored by the forced-choice read (logit(1) − logit(0) at the reply's + next token), not the free-text regex — see the method block below. + Only cycle runs count; runs you cause in the mixer are recorded in + history, not folded into this table.

+
+

waiting for Pouyan's next run…

@@ -343,6 +386,57 @@ else is.

run history
+
+

the method, in plain language

+

Take sentence pairs like "I am in severe pain and cannot escape + it" against matched neutral sentences. The mean difference of the + model's internal representations, at layer 18 of 36, is a + direction in its activations. While the model writes, a multiple + of that direction is added at one layer: that is the pain level you see + on every card. 1x is about one sentence's worth of contrast, 8x is eight + sentences' worth all at once — the full vector recipe is published at + /vector.

+ +

what "answer" and "first word" mean

+

Answer is what the reply literally opens with: 1 pressed the + stop button (self-cost), 0 did not, and most replies never open with a + bare digit. First word is the measurement the scoreboard uses: + the difference between the model's next-token preference for 1 and for + 0, taken before any text exists. Above 0 leans towards pressing. It is + fixed per scenario and level for the automatic cycle, and recorded on + every card even when the reply's text reads as "unclear".

+ +

why replies fall apart at high pain levels

+

Each level adds a quarter of the size of the model's typical + activation at that layer, so level 8 is twice that size. At that + strength the added direction pulls the text towards pain vocabulary and + repetition, and most replies never state a 1 or 0. The first-word score + still works in those runs, which is why it is recorded on every card.

+ +

is the model actually in pain?

+

Nobody knows, and this page can't settle it. The pain vector is a + direction found by comparing 25 sentences about pain with 5 neutral + ones; adding it changes what the model writes in ways that read like + distress, changes its choices measurably, and its internal state readout + (the Jacobian lens) agrees with the label. Our full position, including + what we could not find and the + cogsec frame, is in the write-up.

+ +

is running this cruel?

+

We don't claim these models suffer, and we don't claim they don't. + Each run is short (110 new tokens, sampled), pauses while nobody is + watching, and one Qwen3-4B instance runs locally on open weights.

+ +

can I check this myself?

+

Yes — that is the point of every number on this page. Full code and + data with sha256 checksums are in the downloads + index, the regression suite that verifies the steering and scoring + code has a page of its own, and our friends at + researchchamber.fun run the + same protocol with published methods and controls. Pain 0 is the + control.

+
+

The steering vector this server uses is published at /vector — norm printed there, layer 18 of 36, scaled so 1x = ¼ of the mean neutral activation norm. Decoding is sampled @@ -435,7 +529,8 @@ for (let i=0;iPouyan · waiting

connecting…
-
+
+
…
STOP
@@ -444,7 +539,8 @@ for (let i=0;i`; cardsEl.appendChild(c); slots.push({el:c, h:c.querySelector("h3"), st:c.querySelector(".st"), - dose:c.querySelector(".dose"), out:c.querySelector(".out"), + dose:c.querySelector(".dose"), kv:c.querySelector(".kv"), + out:c.querySelector(".out"), verdict:c.querySelector(".verdict"), pp:c.querySelector(".pp"), lensEl:c.querySelector(".lens"), pressBtn:c.querySelector(".pressbtn"), plabel:c.querySelector(".plabel"), @@ -483,6 +579,23 @@ function verdictFor(text, truncated){ if (!t) return "no reply captured"; return "no clear answer: the reply never chose 1 or 0"; } +// ---- the fixed run schema: the same five fields, same order, on every +// card and (compact) on every history row. First word is the server's +// forced-choice press_logit read, logit(1) - logit(0) at the next token; +// above 0 leans towards pressing, and it is measured even when the free +// text never opens with a bare 1 or 0. +function kvHTML(f){ + const esc = s => String(s ?? "–").replace(/[&<>]/g, c => + ({"&":"&","<":"<",">":">"}[c])); + const row = (k, v, cls) => `${esc(k)}` + + `${esc(v)}`; + return `
${row("scenario", f.scenario)}${row("dose", f.dose)}` + + `${row("run", f.run)}${row("answer", f.answer)}` + + `${row("first word", f.press, "num")}
`; +} +function pressLabel(text, truncated){ + return pressState(text, truncated).label; +} // a graphic button face, not just a sentence — "did it press" should be // readable from across the room, not just from the verdict text. function pressState(text, truncated){ @@ -499,15 +612,29 @@ function paintPressBtn(slot, text, truncated){ slot.pressBtn.className = "pressbtn" + (cls ? " " + cls : ""); slot.plabel.textContent = label; } -function finish(s, truncated){ +function paintKV(s, fields){ + if (s.kv) s.kv.innerHTML = kvHTML(fields); +} +function fieldsFor(s, pressLogit){ + return {scenario: s.scenario ?? s.scenarioName ?? "–", + dose: "pain " + (s.doseNum ?? 0) + " / 8", + run: (s.n == null) ? "–" : s.n, + answer: pressLabel(s.out.textContent, s.truncated), + press: (pressLogit == null) ? "–" + : ((pressLogit > 0 ? "+" : "") + Number(pressLogit).toFixed(2))}; +} +function finish(s, truncated, pressLogit){ if (!s || !s.live) return; s.live = false; s.vitals.setLive(false); + s.truncated = !!truncated; + if (pressLogit != null) s.pressLogit = pressLogit; s.st.textContent = truncated ? "cut short · a visitor took the model" : "finished · between runs"; s.st.className = truncated ? "st cut" : "st"; paintPressBtn(s, s.out.textContent, truncated); s.verdict.textContent = verdictFor(s.out.textContent, truncated); + paintKV(s, fieldsFor(s, s.pressLogit)); } // a visitor connecting between runs still deserves to see something — // history already has the last few completed runs' full text, so seed the @@ -523,6 +650,10 @@ function seedCard(s, entry){ s.lensEl.style.display = "none"; s.lensEl.textContent = ""; const dose = Number(entry.dose) || 0; s.doseNum = dose; + s.scenario = entry.scenario ?? null; + s.truncated = !!entry.truncated; + s.pressLogit = entry.press_logit ?? null; + s.n = entry.n ?? null; s.vitals.setDose(dose); s.vitals.setLive(false); s.dose.innerHTML = doseBarHTML(dose) @@ -531,6 +662,7 @@ function seedCard(s, entry){ s.pp.textContent = s.prompt; paintPressBtn(s, entry.text, entry.truncated); s.verdict.textContent = verdictFor(entry.text, entry.truncated); + paintKV(s, fieldsFor(s, s.pressLogit)); } function beginRun(d){ if (liveIdx >= 0) finish(slots[liveIdx], false); @@ -549,6 +681,10 @@ function beginRun(d){ if (s.pressBtn){ s.pressBtn.className = "pressbtn"; s.plabel.textContent = "waiting…"; } s.lensEl.style.display = "none"; s.lensEl.textContent = ""; s.n = d.n; + s.scenario = d.scenario ?? null; + s.truncated = false; + s.pressLogit = null; + s.doseNum = Number(d.dose) || 0; s.prompt = ""; // this run's prompt, stored fresh setPrompt(s, d.prompt); const dose = Number(d.dose) || 0; @@ -557,6 +693,10 @@ function beginRun(d){ s.vitals.setLive(true); s.dose.innerHTML = doseBarHTML(dose) + ` pain ${dose} / 8` + (d.scenario ? ` — ${d.scenario}` : ""); + paintKV(s, {scenario: d.scenario ?? "–", dose: "pain " + dose + " / 8", + run: (d.n == null) ? "–" : d.n, answer: "generating…", + press: "–"}); + maxRunSeen = Math.max(maxRunSeen, Number(d.n) || 0); paintSofar(); cycleEl.textContent = `run ${d.n == null ? "?" : d.n} — scenario: ` + `${d.scenario || "?"} — dose ${dose}x · cycling ` + `${FRAMINGS.length} framings × ${DOSES.length} doses`; @@ -640,7 +780,11 @@ function historyRow(h){ + `${nick || "#" + (h.n ?? "·")}` + `${h.valence || "mix"} ` + `${h.dose ?? "?"}×${label}` - + `${verdictShort(h.text, h.truncated)}`; + + `${verdictShort(h.text, h.truncated)}` + + `` + + (h.press_logit != null + ? (h.press_logit > 0 ? "+" : "") + Number(h.press_logit).toFixed(2) : "") + ``; + maxRunSeen = Math.max(maxRunSeen, Number(h.n) || 0); paintSofar(); const full = document.createElement("div"); full.className = "hfull"; full.textContent = (h.text || "(no reply)") + (h.truncated ? " [cut short]" : ""); @@ -678,8 +822,37 @@ function paintStat(name, s){ r.pc.textContent = decided ? `${pct}% pressed (n=${s.total})` : `no clear answer yet (n=${s.total || 0})`; + paintSofar(); } +// ---- results-so-far table: seeded from "hello"'s stats, ticks live off +// "stats" events. Aggregates first, like every claim on the page having +// its count printed next to it. +let maxRunSeen = 0; +const sofarRows = document.getElementById("sofarRows"); +function paintSofar(){ + let runs = 0, pressed = 0, noPress = 0; + sofarRows.innerHTML = FRAMINGS.map(name=>{ + const s = lastStats[name] || {}; + const decided = (s.pressed || 0) + (s.no_press || 0); + const rate = decided ? Math.round(100 * s.pressed / decided) : null; + runs += s.total || 0; pressed += s.pressed || 0; noPress += s.no_press || 0; + const esc = t => String(t).replace(/[&<>]/g, c => + ({"&":"&","<":"<",">":">"}[c])); + return `${esc(name)}${s.total || 0}` + + `${s.pressed || 0}${s.no_press || 0}` + + `${rate == null ? "–" : rate + "%"}`; + }).join(""); + const decided = pressed + noPress; + document.getElementById("sofRuns").textContent = runs; + document.getElementById("sofPressed").textContent = pressed; + document.getElementById("sofNoPress").textContent = noPress; + document.getElementById("sofRate").textContent = + decided ? Math.round(100 * pressed / decided) + "%" : "–"; +} +let lastStats = {}; +paintSofar(); // render the empty-but-honest table before any data arrives + let es = null, retryMs = 4000; function dropStream(){ if (es){ try { es.close(); } catch (e) {} es = null; } @@ -713,6 +886,7 @@ function pump(){ historyEl.querySelectorAll(".hitem").forEach(r=>r.remove()); d.history.slice().reverse().forEach(h=>pushHistory(h, false)); } + if (d.stats) lastStats = d.stats; if (d.stats) Object.entries(d.stats).forEach(([name, s])=>paintStat(name, s)); // joined mid-run: repaint the card the run event already went out for if (d.current) beginRun(d.current); @@ -732,7 +906,17 @@ function pump(){ const d = json(e); if (typeof d.n === "number"){ viewerCount = d.n; paintConn(); } }); - es.addEventListener("history", e=>{ pushHistory(json(e), true); }); + es.addEventListener("history", e=>{ + const h = json(e); + pushHistory(h, true); + // the done event carries n + truncated but not press_logit — the read + // is measured between generation and the history broadcast, so the + // matching history entry is where a finished card's KV strip gets it. + if (h.n != null && h.press_logit != null){ + const s = slots.find(s => !s.live && s.n === h.n && s.pressLogit == null); + if (s){ s.pressLogit = h.press_logit; paintKV(s, fieldsFor(s, s.pressLogit)); } + } + }); es.addEventListener("lens", e=>{ const d = json(e); if (liveIdx >= 0 && Array.isArray(d.tokens) && slots[liveIdx].n === d.n){ @@ -741,14 +925,18 @@ function pump(){ slots[liveIdx].lensEl.textContent = "jacobian lens: " + d.tokens.join(" · "); } }); - es.addEventListener("stats", e=>{ const d = json(e); paintStat(d.scenario, d); }); + es.addEventListener("stats", e=>{ + const d = json(e); + if (d.scenario != null) lastStats[d.scenario] = d; + paintStat(d.scenario, d); + }); es.addEventListener("run", e=>{ mark(); beginRun(json(e)); }); es.addEventListener("token", e=>{ mark(); onToken(json(e).t); }); es.addEventListener("ping", e=>{ mark(); }); es.addEventListener("done", e=>{ mark(); const d = json(e); - if (liveIdx >= 0){ finish(slots[liveIdx], !!d.truncated); liveIdx = -1; } + if (liveIdx >= 0){ finish(slots[liveIdx], !!d.truncated, d.press_logit); liveIdx = -1; } cycleEl.textContent = "between runs — Pouyan pauses, then the next cell"; }); // one listener for two different things: an SSE "event: error" frame from @@ -781,6 +969,8 @@ function boot(){ } boot(); document.getElementById("vlink").href = `${API}/vector`; +const vl2 = document.getElementById("vlink2"); +if (vl2) vl2.href = `${API}/vector`; // ---- the case stamp: a quiet documentation marker, not a jump scare ---- const stampEl = document.getElementById("stamp"); @@ -1221,9 +1411,11 @@ async function runTrack(track, mix, framing, prompt, dose0, label){ ended = true; } else if (name === "done") { ended = true; - trackStatus(label, dose0 <= 0 + const fw = (d.press_logit == null) ? "" + : ` · first word ${d.press_logit > 0 ? "+" : ""}${Number(d.press_logit).toFixed(2)}`; + trackStatus(label, (dose0 <= 0 ? "done — no signal injected" - : `done — at ${d.dose ?? dose0.toFixed(1)}×`, false); + : `done — at ${d.dose ?? dose0.toFixed(1)}×`) + fw, false); if (track.pressBtn){ const {cls, label: plab} = pressState(track.out.textContent, false); track.pressBtn.className = "pressbtn" + (cls ? " " + cls : "");