WeZZard/jlens-qwen36

J-space / Jacobian-lens visualizer for Qwen3.6-27B (4-bit) on Apple Silicon, ported to Apple MLX

What it solves

It provides a way to visualize and intervene in the internal "thoughts" (latent representations) of a local LLM, specifically Qwen3.6-27B. It allows users to see which concepts the model is processing at each layer and token position, even when those concepts are not explicitly written in the final output.

How it works

The project implements a Jacobian lens, which maps the model's internal residual stream into the final-layer basis to predict token scores. To make this computationally feasible on Apple Silicon, it includes a custom Metal backward kernel for Gated DeltaNet (GDN) layers, enabling the fitting of a full-depth lens significantly faster than standard fallback operations.

Who it’s for

Researchers and developers using Apple Silicon Macs who want to perform mechanistic interpretability and internal state manipulation on Qwen3.6-architecture models.

Highlights

  • Visual Debugger: A grid interface showing the top predicted token for every layer and position.
  • Internal State Intervention: Ability to manually edit internal "thoughts" (Replace, Add, Remove, Erase) to change the model's output.
  • Backward Search: A feature that searches for internal edits required to make the model produce a specific desired word.
  • Hardware Optimized: Specifically tuned for MLX and Apple Silicon with custom kernels for high performance.

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Dispatch