6 Commits
Author SHA1 Message Date
wassnameandClaudypoo 99b50695bd config: docstrings say default is pre-fitted RAW lens, chat_corpus is fallback-only
Fresh-eyes caught stale framing: the module/chat_corpus docstrings still sold chat-
templated fitting as the corpus convention. The default demo path now loads the
authors' pre-fitted raw-wikitext lens; chat_corpus only feeds the local-fit fallback,
and chat-vs-raw was never compared head-to-head (run-524 used chat), so it's flagged
unresolved rather than claimed better.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 19:24:51 +08:00
wassnameandClaudypoo a43630cec2 feat: load authors' pre-fitted n1000 Hub lenses; steer_band + masked lens_topk
config.HUB_LENS_FILE maps HF model -> the authors' pre-fitted Jacobian lens on the
Hub (neuronpedia/jacobian-lens, raw Salesforce-wikitext, n=1000). Loading one beats
fitting locally: same estimator, 1000 prompts, zero compute. Our Jacobian already
wraps jlens.JacobianLens, so their .pt loads through Jacobian.from_pretrained with no
format change (verified: n1000 4B loads, d_model=2560, layers [0..30]).

jacobian.py:
- steer_band(model, lo=0.3, hi=0.9): pre-fitted lenses span every layer; steering all
  of them over-drives the residual, so restrict to the mid-depth band run-524 used.
- lens_topk reuses jlens.vis._meaningful_token_mask so j-space readouts hide
  punctuation/single-char/special tokens (per the walkthrough these trail the
  interesting word tokens on Qwen). Verified: Eiffel Tower resolves city->Paris clean.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-10 19:20:06 +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 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