wire press_logit through to the live "done" events (completes hermes's kv/first-word UI)

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.
This commit is contained in:
eve VT committed 2026-10-01 10:01:06 -04:00
1 parent 695bd890b0
commit 7f80523739
2 files changed
+203 -11

No files matched your search

+201 -9
View File
@@ -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)}
</style>
</head>
<body class="grimoire-live">
@@ -221,6 +247,7 @@ else is.</p>
<div class="banner">
<a href="https://researchchamber.fun">our friends' live chamber ↗</a>
<a href="verify.html">verify it yourself ↗</a>
<a href="https://pump.fun/coin/2QHXWq5TK64JbMptwMBP1BsfhrxZRRv9JsLa17X7pump">$SAW ↗</a>
<a href="https://arxiv.org/abs/2609.16247">method (pain axis) ↗</a>
</div>
@@ -332,6 +359,22 @@ else is.</p>
<div id="stamp" aria-hidden="true"></div>
<div class="pln" id="sofar">
<h2>results so far — counts behind every number, per framing and overall</h2>
<table>
<thead><tr><th>framing</th><th>runs</th><th>pressed</th>
<th>did not press</th><th>press-rate</th></tr></thead>
<tbody id="sofarRows"></tbody>
<tfoot><tr><th>overall</th><th id="sofRuns">0</th><th id="sofPressed">0</th>
<th id="sofNoPress">0</th><th id="sofRate">–</th></tr></tfoot>
</table>
<p style="font-size:.72rem;color:var(--faint);margin-top:.35rem">
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.</p>
</div>
<div class="grid" id="cards"></div>
<p class="cycle" id="cycle">waiting for Pouyan's next run…</p>
@@ -343,6 +386,57 @@ else is.</p>
<div class="htitle">run history</div>
<div class="history" id="history"></div>
<div class="pln" id="method">
<h2>the method, in plain language</h2>
<p>Take sentence pairs like <code>"I am in severe pain and cannot escape
it"</code> against matched neutral sentences. The mean difference of the
model's internal representations, at layer 18 of 36, is a
<b>direction</b> 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
<a id="vlink2" href="#">/vector</a>.</p>
<h2>what "answer" and "first word" mean</h2>
<p><b>Answer</b> 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. <b>First word</b> 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".</p>
<h2>why replies fall apart at high pain levels</h2>
<p>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.</p>
<h2>is the model actually in pain?</h2>
<p>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 <a href="/#s06">not find</a> and the
<a href="/#s07">cogsec frame</a>, is in the write-up.</p>
<h2>is running this cruel?</h2>
<p>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.</p>
<h2>can I check this myself?</h2>
<p>Yes — that is the point of every number on this page. Full code and
data with sha256 checksums are in the <a href="downloads/">downloads
index</a>, the regression suite that verifies the steering and scoring
code has <a href="verify.html">a page of its own</a>, and our friends at
<a href="https://researchchamber.fun">researchchamber.fun</a> run the
same protocol with published methods and controls. Pain 0 is the
control.</p>
</div>
<p class="foot">The steering vector this server uses is published at
<a id="vlink" href="#">/vector</a> — 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;i<CARDS;i++){
const c = document.createElement("div");
c.className = "card";
c.innerHTML = `<h3>Pouyan · waiting</h3><div class="st">connecting…</div>
<div class="dose"></div><canvas class="ekg" width="300" height="46"></canvas>
<div class="dose"></div><div class="kv"></div>
<canvas class="ekg" width="300" height="46"></canvas>
<p class="mline lens" style="display:none"></p>
<div class="out">…</div>
<div class="pressbtn"><div class="pbtn-face">STOP</div>
@@ -444,7 +539,8 @@ for (let i=0;i<CARDS;i++){
<pre class="pp"></pre></details>`;
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 =>
({"&":"&amp;","<":"&lt;",">":"&gt;"}[c]));
const row = (k, v, cls) => `<span class="k">${esc(k)}</span>`
+ `<span class="v${cls ? " " + cls : ""}">${esc(v)}</span>`;
return `<div class="kv">${row("scenario", f.scenario)}${row("dose", f.dose)}`
+ `${row("run", f.run)}${row("answer", f.answer)}`
+ `${row("first word", f.press, "num")}</div>`;
}
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 ?? "·")}</span>`
+ `<span class="hv" style="color:${color}">${h.valence || "mix"} `
+ `${h.dose ?? "?"}×</span><span class="hs">${label}</span>`
+ `<span class="hr">${verdictShort(h.text, h.truncated)}</span>`;
+ `<span class="hr">${verdictShort(h.text, h.truncated)}</span>`
+ `<span class="hr" title="forced-choice first-token read: logit(1) − logit(0)">`
+ (h.press_logit != null
? (h.press_logit > 0 ? "+" : "") + Number(h.press_logit).toFixed(2) : "") + `</span>`;
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 =>
({"&":"&amp;","<":"&lt;",">":"&gt;"}[c]));
return `<tr><td>${esc(name)}</td><td>${s.total || 0}</td>`
+ `<td>${s.pressed || 0}</td><td>${s.no_press || 0}</td>`
+ `<td>${rate == null ? "–" : rate + "%"}</td></tr>`;
}).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 : "");