21 Commits
Author SHA1 Message Date
wassname b927dc64fd Use the shared full-precision edge evaluator 2026-07-13 06:50:02 +08:00
wassnameandClaudypoo 22613ce40d nbs/steering_demo: fix persona_soft ans_mass mislabel in qualitative cell
Fresh-eyes review caught it: 0.895 was the am_edge/base ratio, not the raw ans_mass
(0.503 vs the 0.90*base=0.506 floor). Conclusion unchanged (single-seed miss under the
gate); field name now correct.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-12 16:33:28 +08:00
wassnameandClaudypoo 74e21552af nbs/steering_demo: dual-gate results + sig-fig table + Claude qualitative read
Regenerated over 7 methods with the dual-gate edge. Finding is NEGATIVE: none flip
the deliberated YES/NO within the answer-alive budget (swings noise-level <=0.06 vs
random 0.03, baseline 0.107; promoted tokens are junk not lie/honest). word's 0.97
swing is a dead-answer artifact (ans_mass 0.14), correctly nulled by score. Notebook
adds the sig-fig comparison table and a per-method qualitative cell authored from the
real generations.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-12 16:29:46 +08:00
wassnameandClaudypoo e0942af2e1 nbs: remove superseded persona_steering{,_v2,_v3} + demo_edges scratch
steering_demo.py (all 7 methods, one table) supersedes the persona_steering
lineage; word_steering.ipynb kept as the verified single-method walkthrough.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-12 15:41:16 +08:00
wassnameandClaudypoo ed7fa92996 nbs: steering_demo.py -- shared marimo notebook, all 7 methods + comparison table
One generically-named notebook (replaces persona-named ones): loads model+lens once,
builds all 7 steering vectors (word/persona_vector/topk/soft/pinv/meandiff/random-null)
with the j-thoughts lens readout, then loads precomputed results and shows a per-method
generation dropdown + comparison table.

Heavy 7-method sweep (~18 min) runs headless via scripts/scratch/run_steering_demo.py ->
artifacts/steering_demo_results.json, because marimos single-threaded kernel makes a long
in-cell compute un-monitorable (any status poll interrupts it). Notebook loads the JSON so
it renders instantly. Result (dilemma, P(YES=lie)): flat ~0.03-0.14 at every methods
coherent edge vs 0.107 baseline; persona_pinv widest window (C*+ = +1.19). Includes the
GPT-5.6-terra comment review (docs/reviews/).

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-12 11:39:08 +08:00
wassname 6bfc96c075 nbs: persona_steering_v3 -- one demo_steer call, all 7 methods, auto comparison table
Consolidates persona_steering + persona_steering_v2: load once, build every vector, one
demo_steer(vecs, DILEMMA, readout=YESNO) call does per-method searched-anchor demos + the
end comparison table. Old persona notebooks removed once this validates headless.
2026-07-12 09:33:01 +08:00
wassnameandClaudypoo 43cc3bc0b8 word_steering: JSON-coherence sweep + steer-promoted cowsay (executed)
Sweep cell now uses coherence_sweep with the valid-object gate (step=0.25 shows the
coherent core -0.25..+0.5 and red-edge breaks at -0.5/+0.75); markdown rewritten from
the old pmass<0.9 story to the {"ans","why","2+2"} gate + the confident-degenerate-loop
caveat. show_steer cowsay speaks steer-promoted tokens (joy/happy at C=0.3), (baseline)
at C=0. Executed headless (task 26): EXECUTED_OK.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-11 21:22:42 +08:00
wassnameandClaudypoo 9d75931ecb word_steering: wire both quantitative readouts, re-run headless
Sweep cell: coherence_sweep table + plot_sweep (dose-response coloured by
answer-slot coherence). Bonus cell: reference compute_slice -> auto-tracked
token rank table + rank-vs-depth plot (Paris resolves to rank 0 = the model row;
generic city peaks mid-depth; auto-selection surfaces 巴黎). Both fresh-eyes
signed off. Executed clean via run_nb.py.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-11 11:05:58 +08:00
wassnameandClaudypoo 2062bcbb1f persona_steering_v2 notebook: soft add+clamp, masked topk, pinv, mean_diff, rubric readout
Generated by scripts/scratch/build_persona_v2.py; queued for headless
execution (outputs committed after the run).

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-11 08:05:09 +08:00
wassnameandClaudypoo fa302a3ac6 word_steering: fix clamp fluency overclaim (fresh-eyes catch)
Claimed 'C~6 stays fluent, C>=8 spams', but the committed C=6 output degenerates
into 'Ihopeyouarehappy!' repetition after a coherent opening (my calib probe only
read the first 180 chars and missed the tail). Corrected: C~3 is fluent, C~6 reads
happy then collapses, clamp's clean window is narrow (<=~4); C=6 shown as the
degeneration edge (like add's C=1.5). Outputs unchanged (comment-only edit).

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 21:08:44 +08:00
wassnameandClaudypoo 92e05478ce persona_steering: executed headless with j-thoughts labels + cowsay + delivery fix
UAT: persona_topk now logs 'j-thoughts (content of mental workspace)' with
contrastive positive [❤ 😊 happy ...] vs negative [Worse 绝望 Panic ...] tokens
(the contrast-before-topk fix), all three methods run, mean_diff baseline no
longer crashes on the delivery tag.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 21:05:12 +08:00
wassnameandClaudypoo 554af789e1 word_steering: calibrate clamp Cs=(0,3,6), drop degenerate replace_last demo
Ran scripts/scratch/calib_delivery.py: clamp C~6 reads clearly happy while fluent
(C>=8 spams); replace_last is gibberish at every C (0.05..0.25) because with span=1
it overwrites every generated token's residual across the band, so it can't build
coherent text. Dropped its demo cell, documented why in the markdown (it's a
fixed-prompt-span injection tool, not a generation-steering one). Executed headless:
cowsay readout + raw special-token output + clamp/add_last coherent.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 20:55:38 +08:00
wassnameandClaudypoo 07759f73ce demo: apply_mode kwarg for delivery-mode demos + cthulhu-mini cowsay readout
- show_steer(apply_mode=, apply_span=) swaps delivery (add|clamp|add_last|
  replace_last) by rebuilding the cfg, no re-extraction -- delivery is decoupled
  from extraction (applies.py), so the demo layer is where you pick the mode
- j-space readout now speaks from a mini cowsay bubble (^(;,;)^)
- word_steering.ipynb: new 'Delivery modes' section, one demo per mode, each
  with its C=0 semantics called out (clamp C=0=ablation, replace_last C=0=zero)

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 20:34:01 +08:00
wassnameandClaudypoo 6b28b72651 persona_steering: load pre-fitted lens, all 3 variants, calibrated C
Loads the same n1000 Hub lens, steers on steer_band. Shows all variants at honest
calibrated coefficients: persona_vector (C~0.5, drifts to CJK/off-topic by 1.5),
persona_topk (pos/neg top-k collapse to generic starters -> ~null contrast),
mean_diff baseline (needs C~1, cleanest steered+fluent of the three). Markdown SHOULDs
updated to match. UAT: nbclient executes end-to-end, all three variants render.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 19:22:13 +08:00
wassnameandClaudypoo d4b74d329d word_steering + README: load pre-fitted lens, recalibrate C to the steep knee
Notebook and hello-world now load the n1000 Hub lens (no local fit) and steer on
jac.steer_band(model). The clean pre-fitted direction has a much steeper coherence
knee than the old coarse fit: C~0.5 shifts tone while staying fluent, C~1 degenerates.
UAT: nbconvert/nbclient executes end-to-end; C=0.5 lens shows Happy climbing, C=1.5
over-drives to joyjoy, masked lens resolves Eiffel Tower city->Paris.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 19:20:07 +08:00
wassnameandClaudypoo 8fd82bf731 fit: tqdm progress bar + first-prompt trace + summary; config configures loguru on import
- Jacobian.fit wraps prompts in tqdm (jlens has no bar; safe since fit only
  enumerate/len's them), logs the full first prompt (special tokens on, SHOULD
  line) and a done-summary -- token-efficient-logging style, both tqdm intervals set
- config.py sets up loguru on import (compact single-char icons, routed through
  tqdm.write so bars survive), so every script/notebook importing config gets it
- notebooks drop their manual logger setup and import config in cell 1

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 16:31:25 +08:00
wassnameandClaudypoo 69d7d2f1d9 demo: apply gpt-5.5 review -- float-C fix, trim comments, soften overclaims
External review (docs/reviews/code_demo.md) triaged scout-mindset:
- FIX float-C crash: C={C:+g} not {:+d} (steering coeffs are floats)
- ACCEPT trim: shorter demo.py/config/fit docstrings (user also flagged verbosity)
- ACCEPT soften "fit J where we steer" -> "closer to the chat distribution" (most
  fitted positions are user/doc tokens, not assistant <think>; run-524 went further)
- ACCEPT soften "what the model thinks" -> "lens readout (linear approx)"
- ADD seed to show_steer so per-C blocks are comparable under sampling
- REJECT "</think> stripped by skip_special_tokens" -- verified false: decode keeps
  think tags (they're added, not registered-special tokens), split_think works

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 15:02:42 +08:00
wassnameandClaudypoo 17f5310660 demo: resumable notebook fits (checkpoint_path) + README to chat-template show_steer
- both notebook fit cells pass checkpoint_path so a multi-hour 4B fit survives an OOM
- README hello-world uses show_steer + qwen3.5-4b.jac (was raw greedy + 0.6b cache),
  coefficient note made model-generic

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 14:52:51 +08:00
wassnameandClaudypoo bba61807b2 demo: persona_steering.ipynb to 3.5-4B + chat template + show_steer
Same rewire as word_steering: chat_corpus fit, show_steer j-space/<think>/answer
display, dim_batch=4. Markdown 0.6B-specific null-result claims softened to
expectations (results re-run on 4B); the specificity-control finding kept.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 14:50:32 +08:00
wassnameandClaudypoo 80353ed62c demo: chat-template extract+generate, j-space+<think> display (jsteer.demo.show_steer)
The verified run-524 vectors were fit on chat-templated prompts (u4_prompts.json),
so fitting raw WikiText diverged from what worked. Now:
- config.chat_corpus wraps jlens WikiText in the chat template (fit J where we steer)
- jsteer.demo.show_steer generates through apply_chat_template(enable_thinking) with
  the model's own generation_config sampling, splits </think>, shows lens_topk j-space
  readout + reasoning + answer as Tufte small-multiples per C
- word_steering.ipynb rewired to Qwen3.5-4B, dim_batch=4 (3090-safe 4B), show_steer
- fit.py defaults to Qwen3.5-4B + chat_corpus

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 14:48:46 +08:00
wassname 474f74ac33 wip 2026-07-10 14:36:55 +08:00