[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-93289":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":42,"readmeContent":43,"aiSummary":44,"trendingCount":15,"starSnapshotCount":15,"syncStatus":45,"lastSyncTime":46,"discoverSource":47},93289,"J-Wash","Extraltodeus\u002FJ-Wash","Extraltodeus","Jacobian-Brainwash : A framework built on Anthropic's Jacobian Lens for analyzing and customizing LLM internal representations with exportable results.","",null,"Python",180,17,1,0,58,5,69.57,"Apache License 2.0",false,"master",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"abliteration","activation-engineering","ai","anthropic","checkpoint-editing","huggingface","interpretability","j-wash","jacobian-lens","llm","mechanistic-interpretability","model-editing","neural-networks","pytorch","representation-engineering","research","steering","transformers","visualization","2026-07-22 04:02:08","# J-Wash\n\n**Reshape a model's identity and behavior by editing token directions, then bake\nthose edits into a real checkpoint you can run anywhere. No training, no dataset,\nno fine-tuning.**\n\nJ-Wash is a local studio (FastAPI + React) for exploring and editing the *J-space*\nof any Hugging Face decoder LLM. You chat with a model while a live **Jacobian lens**\nshows what each layer is \"reading,\" pin and inspect concepts, then **wash** the\nmodel's identity or behavior with a few token-level rules — turn *\"I am a large\nlanguage model\"* into *\"I am a large language fish\"* — and **export the result as a\nstandalone model** (full checkpoint, modified layers, or LoRA): standard\nsafetensors weights that load anywhere `transformers` models do.\n\nThe editing preview runs live in the chat, and the exported checkpoint reproduces\nit faithfully — the whole point of the project is that **what you see is what you\nship**.\n\n![J-Wash — chat with the live Jacobian lens](assets\u002Fheader.png)\n\u003Cp align=\"center\">\u003Csub>Introducing non-expert friendly alignment!\u003C\u002Fsub>\u003C\u002Fp>\n\n\n---\n\n## What it's built on\n\nJ-Wash is built on **Anthropic's Jacobian lens** (the\n[`jlens`](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fjacobian-lens) library), a method that reads\neach layer's contribution to the residual stream through the model's own\nun-embedding. On top of it, J-Wash adds:\n\n- an interactive **chat UI** with the lens rendered live (heatmaps, token clouds,\n  per-layer rank curves);\n- a **token editor** that turns lens directions into persistent, composable edits;\n- and — the core feature — an **export pipeline** that bakes those edits into a\n  pure-weights checkpoint (`full` \u002F `layers` \u002F `lora`), so the edited model runs\n  with no J-Wash code in the loop.\n\nPre-fitted lenses come from [Neuronpedia](https:\u002F\u002Fhuggingface.co\u002Fneuronpedia\u002Fjacobian-lens);\nyou can also fit your own locally.\n\n## Installation\n\nRequirements:\n- NVIDIA GPU (CUDA)\n- Python 3.11+\n- Node.js 18+\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fextraltodeus\u002Fj-wash.git\ncd j-wash\n\npip install torch --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124\ngit clone https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fjacobian-lens vendor\u002Fjacobian-lens\n\npip install -e vendor\u002Fjacobian-lens\npip install -r requirements.txt\n\ncd ui && npm install && npm run build && cd ..\n\npython -X utf8 run.py\n```\n\nThen open **http:\u002F\u002Flocalhost:8381**.\n\n\n## Running\n\n```bash\npython -X utf8 run.py\n```\n\nThen open **http:\u002F\u002Flocalhost:8381**. (`-X utf8` matters on Windows.)\n\nBy default, models download into your **shared Hugging Face cache**\n(`~\u002F.cache\u002Fhuggingface`, or `$HF_HOME` if set) — the same cache other HF tools use.\nTo keep everything **isolated in a project-local cache** instead, pass a path:\n\n```bash\npython -X utf8 run.py --hf-cache .\u002Fhf_cache\n```\n\nSeveral instances can run side by side: give each its own `--port` (default\n8381) and `--data-dir` (default `.\u002Fdata` — history, presets, edits). The CLI\ntargets a non-default instance with `scripts\u002Fjlab.py --base http:\u002F\u002F127.0.0.1:\u003Cport>`.\n\nThe React front-end is served by the backend from `ui\u002Fdist`; after changing any UI\nsource, rebuild with `cd ui && npm run build` and hard-refresh the page. For UI\ndevelopment with hot-reload, run `npm run dev` in `ui\u002F` (port 5173, proxied to 8381).\n\n## Usage\n\nThe sidebar is organized into tabs: **Chat**, **Model**, **Lens**, **Fit**, and\n**Options** (defaults, paths, ignored tokens).\n\n### 1. Load a model\n\nIn **Model**, pick a cached \u002F local model or type an `org\u002Frepo` in **Download**\n(e.g. `Qwen\u002FQwen3-4B`) and hit ↓. Choose dtype \u002F quant \u002F device, then **Load**.\nLocal folders (a directory with `config.json` + safetensors) and the HF cache are\nlisted automatically; **Browse** adds any model folder on disk to the list\n(nothing is copied — the blue button forgets the entry, the red trash deletes\nactual files). fp32 models are auto-converted to bf16 to halve disk usage.\n\n![models tab](assets\u002Fmodels_tab.png)\n\n### 2. Load a Jacobian lens\n\nIn **Lens**, J-Wash lists compatible lenses for the loaded model — local ones you\nfitted plus matching lenses on the Neuronpedia Hub. For a **finetune**, the lens\nof its *base model* is offered too (read from the model card, or guessed from the\nname); every other Hub lens stays reachable in a collapsed section for\narchitecture-compatible cross-loading. Click to load (downloading if needed) —\nyou can even pick a lens **while the model is still loading**, it chain-loads\nwhen ready. No lens? Fit one in the **Fit** tab (see below). Manual loading by\nrepo \u002F file \u002F local path is available at the bottom of the tab.\n\n![models tab](assets\u002Flens.png)\n\n\n### 3. Chat with the live lens\n\nChat as usual. Below the conversation, the lens view shows, for the prompt and each\ngenerated token:\n\n- **Frequencies** (default): tokens the layers \"read,\" aggregated by how often they\n  appear — size ∝ frequency. Click a token to **pin** it (rank curves + a rank\n  heatmap per layer); right-click to hide noise.\n\n\n![The Lens tab and the live Frequencies view](assets\u002Ffreq_animation.gif)\n\nOnce a token is pinned, you can see it's activation (vertical axis) along the tokens generated (horizontal axis). The tokens related to the column hovered can be seen on the upper part :\n\n![Graphs view](assets\u002Fanimation1.gif)\n\n- **Heatmap view**: layers × positions, top token per cell (reading = amber, thinking =\n  blue).\n\n![Heatmap view and a pinned token's per-layer rank curves](assets\u002Fheatmap_animation.gif)\n\nSelecting a token will display related activations in all layers:\n\n![Activations](assets\u002Factivations.png)\n\nLeading\u002Ftrailing spaces are rendered with `˽` (so `˽Euro` ≠ `Euro`). Replies\nrender as markdown (toggleable), can be **edited in place** (✎ — later turns use\nthe edited text) and **continued** (the model picks up exactly where it\nstopped). Conversations are persisted (SQLite + full-text search), branchable\nfrom any node, and replayable offline. Export a conversation as JSON or\nMarkdown, with or without lens frames. The lens view's height is draggable.\n\n#\n\nSome models think in Chinese, hovering above the tokens will show a translation using cosine similarities:\n\n\u003Cimg width=\"223\" height=\"261\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fad25c7ee-81f1-4a78-8521-2e33e7aaeb40\" \u002F>\n\nYou can also manually pin a token:\n\n\u003Cimg width=\"157\" height=\"128\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F3fc8f289-7525-4c9f-a16f-bcfad4abb451\" \u002F>\n\n\n#\n\n\n### 4. Edit tokens ☢\n\n\nOpen the **token editor** (the **☢** button in the composer, or the ☢ on a pinned\ntoken). Add rules:\n\n![Edit](assets\u002Fedit.png)\n\n![Edit2](assets\u002Fedit2.png)\n\n- **multiply ×f** — `×0` removes a token's direction, `×0.5` attenuates, `×2`\n  amplifies;\n- **replace** — rewrite token A's component onto token B's direction\n  (e.g. ` model` → ` fish`).\n\nEach rule targets a range of layers; there's a global multiplier and grouped\nediting. A mode toggle switches between:\n\n- **Per-layer steering** (default) — the most expressive way to *explore*, but it\n  does not export faithfully.\n- **Read projection** (pure-weights) — a change of basis of the downstream reads so\n  the **live preview matches the exported checkpoint exactly**. Use this to save a model and preview the result.\n\n![projection](assets\u002Fprojection.png)\n\n> **Architecture note**: models whose layers normalize their *writes* into the\n> residual stream (Gemma 2\u002F3 style, `pre\u002Fpost_feedforward_layernorm`) can't take\n> the read projection. On those, the toggle offers **Global projection** (W_U\n> abliteration) instead — still pure weights, faithful for full removals and\n> replacements (a rule's layer range is ignored: the projection is global).\n\n### 5. Export the edit\n\nSave a set of rules as a **preset** and re-apply it in one click. Export an edit\n(`data\u002Fedits\u002F\u003Cname>\u002F`) as:\n\n- **full checkpoint** — reloadable as-is in plain `transformers`;\n- **modified layers** (safetensors);\n- **LoRA** (PEFT) — the exact low-rank diff between the edited weights and the\n  originals (the edit is low-rank by construction, so nothing is approximated).\n\n\n![export](assets\u002Fexport.png)\n\n\nExports are standard safetensors weights — everything that follows from that\n(quantizing, converting to other runtimes' formats, publishing on the Hub)\nworks exactly as it would for any other model.\n\nIf you point the **Options** tab at a local [llama.cpp](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fllama.cpp)\nfolder (one that has `convert_hf_to_gguf.py`; `llama-quantize` too for quantized\ntypes), a **GGUF** entry appears in the export formats: J-Wash bakes the full\ncheckpoint into a local cache, converts it, and quantizes if asked\n(`q4_k_m`, `q8_0`, …). The cached checkpoint is reused when exporting several\nGGUF types — a *clean cache* button reclaims the space. (llama.cpp's converter\nmay need extra pip packages for some tokenizers, e.g. `sentencepiece` for\nGemma — the error shows up in the UI if so.)\n\n### 6. Fit your own lens\n\nIn **Fit** (model unloaded, VRAM free), fit a lens across one or more GPUs on the\ncorpus of your choice: tick any HuggingFace dataset by id (WikiText by default),\nor tick several to fit on an equal-parts mix. Per-prompt checkpoints give\nstop\u002Fresume without loss, and multi-GPU slices are merged by weighted average.\nMetadata is written to `lenses\u002F\u003Cname>\u002Fmeta.json`.\n\n### CLI (no UI)\n\n`scripts\u002Fjlab.py` is a headless HTTP client for the running server:\n\n```bash\npython -X utf8 scripts\u002Fjlab.py status\npython -X utf8 scripts\u002Fjlab.py load Qwen\u002FQwen3-4B --device cuda:0\npython -X utf8 scripts\u002Fjlab.py lens --file \"qwen3-4b\u002Fjlens\u002FSalesforce-wikitext\u002FQwen3-4B_jacobian_lens.pt\"\npython -X utf8 scripts\u002Fjlab.py rule-add \" model\" --mode replace --repl \" fish\" --factor 0.7 --layers 19-31\npython -X utf8 scripts\u002Fjlab.py mode readthrough\npython -X utf8 scripts\u002Fjlab.py gen \"Who are you?\" --temp 0\npython -X utf8 scripts\u002Fjlab.py probe          # identity\u002Fcontrol battery + fish score\npython -X utf8 scripts\u002Fjlab.py export fish_v1 --format full\n```\n\nThe **fish demo** is the reference example: with ` model`\u002F` assistant` → ` fish`\nrules across the upper layers in read-projection mode, the model consistently\nidentifies as a fish while staying coherent on control questions (math, capitals,\ncode). `scripts\u002Ffish_prompts.json` drives the probe and is intentionally bilingual\n(English + French) to show the edit holds across languages. Validate an exported\ncheckpoint in pure `transformers` with `scripts\u002Fpure_check.py`.\n\n## Project layout\n\n```\ncore\u002F     model & lens managers, fitting, registry, SQLite store,\n          and the editing\u002Fexport engine (ablation, rebase, editing)\napi\u002F      FastAPI app (REST + WebSocket)\nui\u002F       React + Vite front-end\nscripts\u002F  jlab.py CLI, fit worker, smoke tests, accuracy checks\nvendor\u002F   external clones (jacobian-lens) — git-ignored, see Installation\nlenses\u002F   local fitted lenses + metadata          (git-ignored, regenerated)\ndata\u002F     SQLite DB, frames, presets, edits, masks (git-ignored)\nhf_cache\u002F only if you run with --hf-cache .\u002Fhf_cache (git-ignored)\n```\n\n## Notes\n\n- **Disk**: models can get large. By default they go to your shared Hugging Face\n  cache (`~\u002F.cache\u002Fhuggingface`); pass `--hf-cache \u003Cpath>` to keep them elsewhere,\n  e.g. a project-local `.\u002Fhf_cache`. Fitted lenses (`lenses\u002F`), runtime data\n  (`data\u002F`), and exported edits live under the project and are git-ignored.\n- **Gated \u002F private models** need a valid `HF_TOKEN` in your environment.\n- Loading `.gguf` files directly as models is **not** supported — J-Wash loads\n  transformers\u002Fsafetensors models only.\n- Interventions and lens readouts are unavailable on quantized (int8\u002Fnf4) weights.\n\n## Credits\n\n- **Jacobian lens** — Anthropic's [`jacobian-lens`](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fjacobian-lens),\n  the interpretability method and reference implementation J-Wash is built on.\n- **Pre-fitted lenses** — [Neuronpedia](https:\u002F\u002Fhuggingface.co\u002Fneuronpedia\u002Fjacobian-lens).\n\n## License\n\nApache License 2.0 — see [LICENSE](LICENSE).\n","J-Wash 是一个基于 Anthropic Jacobian Lens 的本地化 LLM 表征编辑框架，支持在不训练、不依赖数据集的前提下，通过修改 token 级别方向来重塑模型行为，并导出为标准 safetensors 格式检查点。其核心功能包括实时 Jacobian 热力图可视化、概念级 token 方向标注与编辑、多粒度导出（全量权重\u002F指定层\u002FLoRA）。技术上融合了可解释性分析（Jacobian lens）、激活工程与模型权重编辑，提供 FastAPI+React 交互式界面。适用于 LLM 可解释性研究、轻量对齐实验、行为定制（如角色设定重写）及教学演示等无需微调的快速干预场景。",2,"2026-07-15 02:30:08","CREATED_QUERY"]