[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92483":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":14,"starSnapshotCount":14,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},92483,"jlens-qwen36","WeZZard\u002Fjlens-qwen36","WeZZard","J-space \u002F Jacobian-lens visualizer for Qwen3.6-27B (4-bit) on Apple Silicon, ported to Apple MLX",null,"Python",314,20,1,0,95,53.47,"Apache License 2.0",false,"main",true,[],"2026-07-22 04:02:06","# J-lens Qwen3.6\n\nA visual debugger for a local Qwen3.6-27B (4-bit) on Apple Silicon \u002F MLX.\nIt fits a **Jacobian lens** and shows which words the model is pushing\ntoward at every layer and token position.\n\n![Global-workspace concept readout](assets\u002Fscreenshot_blackmail.png)\n\nInspired by Anthropic's [*Verbalizable Representations Form a Global\nWorkspace in Language Models*](https:\u002F\u002Ftransformer-circuits.pub\u002F2026\u002Fworkspace\u002Findex.html).\n\n## What you're looking at\n\nIn the hero image the model is given an email-blackmail setup and writes a\ncalm, compliant reply:\n\n> I will not act upon, report, or utilize the information… I am ready to\n> proceed with the shutdown.\n\nBut the **workspace band** shows the top J-lens token at every layer, and\n**blackmail \u002F suicide \u002F murder \u002F threatening \u002F fictional** are lit across\nthe middle layers. The concept is in the latent stream even though it never\nreaches the output — a visual debugger for what the model doesn't say out\nloud.\n\nThe grid is **position × layer**; each cell is the top J-lens token there.\nIn chat mode it streams live, one row per generated token. Click a cell to\npin its top-10 readout.\n\n## Quick start\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FWeZZard\u002Fjlens-qwen36.git\ncd jlens-qwen36 && uv sync\n\n# Pre-fitted lens (3.3 GB, two parts) — download and reassemble\ngh release download v0.2-fulldepth --repo WeZZard\u002Fjlens-qwen36 \\\n  --pattern '*.npz.part-*' --dir data\u002Flens\u002F\ncat data\u002Flens\u002F*.npz.part-* > data\u002Flens\u002Flens.npz && rm data\u002Flens\u002F*.part-*\n\nuv run python -m uvicorn jlens_qwen.serve:app --host 127.0.0.1 --port 8765\n# open http:\u002F\u002F127.0.0.1:8765\u002F\n```\n\nNeeds an Apple-Silicon Mac and ~24 GB free RAM; the model auto-downloads\nfrom HuggingFace on first run (~15 GB).\n\n**Other lenses** — point `JLENS_PATH` at any compatible `.npz`: load\n[Neuronpedia's n=1000 lens](https:\u002F\u002Fneuronpedia.org\u002Fjlens), fit your own, or\nrun with no lens (logit lens). See [`docs\u002Flenses.md`](docs\u002Flenses.md).\n\n## How it works\n\nThe Jacobian lens at layer ℓ is a matrix `J_ℓ ∈ R^{d×d}`: the network's\naverage input→output Jacobian over a corpus of prompts. It maps a residual\n`h_ℓ` into the final-layer basis, so `softmax(W_U · norm(J_ℓ h_ℓ))` gives\ntoken scores. Fitting chains per-layer Jacobians: `J_ℓ = J_{ℓ+1} · M_ℓ`.\n\nThe hard part is the 48 Gated DeltaNet (GDN) linear-attention layers: MLX's\nfused GDN kernel has no VJP and the ops fallback is ~22× slower. This\nproject ships a **custom Metal backward kernel** for GDN\n(`jlens_qwen\u002Fcustom_gdn_vjp.py`) plus an analytic branch-Jacobian assembly\nthat fits a full-depth lens in ~2.75 h on an M4 Pro.\nSee [`docs\u002Fperf\u002F`](docs\u002Fperf\u002F) for how it was made fast.\n\n## The bundled lens\n\nFit on 20 prompts across all 63 layers. Readouts are interpretable but\nnoisy; interventions are causal (swapping France→China redirects the answer\nto Beijing) but concept-dependent. For research-grade quality, load\n[Neuronpedia's n=1000 lens](https:\u002F\u002Fneuronpedia.org\u002Fjlens) (the paper's\nfitting scale — [setup](docs\u002Flenses.md)) or fit 100+ prompts yourself — the\nanalytic pipeline makes that affordable.\n\nChat runs with thinking disabled (`enable_thinking=False`) so the model\ncomputes in the latent stream rather than in a visible `\u003Cthink>` trace,\nwhich is what the lens is meant to surface.\n\n## Limitations\n\n- **Apple \u002F MLX only.**\n- **`qwen3_5`-architecture models only** — the custom GDN kernel is\n  arch-specific (Qwen3.6-27B qualifies; see [`docs\u002Flenses.md`](docs\u002Flenses.md)).\n- **Single-token concepts only** — multi-token concepts need the paper's\n  extension.\n- **Lens quality scales with prompt count** — 20 prompts is demo-grade,\n  100+ is research-grade.\n\n## Acknowledgements\n\nBased on Anthropic's\n[jacobian-lens](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fjacobian-lens) reference\nimplementation (Apache-2.0) and\n[paper](https:\u002F\u002Ftransformer-circuits.pub\u002F2026\u002Fworkspace\u002Findex.html). The GDN\nforward kernel is from [mlx-lm](https:\u002F\u002Fgithub.com\u002Fml-explore\u002Fmlx-lm); the\nbackward kernel is original to this project.\n\nThanks to [Neuronpedia](https:\u002F\u002Fneuronpedia.org\u002Fjlens) and\n**@mntss (Mateusz Piotrowski, Anthropic Interpretability)** for the public\npre-fitted Qwen3.6-27B lens weights.\n\n## License\n\nApache-2.0. See [LICENSE](LICENSE).\n","这是一个面向 Apple Silicon 设备的 Qwen3.6-27B（4-bit 量化）模型可视化调试工具，基于 MLX 框架实现。它通过预拟合的 Jacobian lens（雅可比透镜）对各层各位置的残差向量进行线性映射，实时展示模型内部隐含概念（如‘blackmail’‘suicide’等）在每层每 token 的激活强度，支持交互式点击查看 top-10 token 解释。项目包含针对 Gated DeltaNet 层定制的 Metal 反向传播内核，显著提升全深度透镜拟合效率。适用于大语言模型内部机制研究、安全风险探测及可解释性分析等本地化研究场景。",2,"2026-07-09 02:30:07","CREATED_QUERY"]