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 see and manipulate the "internal thoughts" of a language model that aren't explicitly written in the output. By visualizing the latent stream of a model, users can identify concepts the model is considering (e.g., "blackmail" or "murder") even when the final text is polite or compliant.

How it works

The project implements a Jacobian lens, which maps the model's internal residual states at various layers into the final-layer vocabulary basis. This allows the system to decode what tokens the model is "pushing toward" at every layer and token position.

To make this computationally feasible on Apple Silicon, the project includes a custom Metal backward kernel for Gated DeltaNet (GDN) layers, significantly speeding up the process of fitting the lens compared to standard fallback operations.

Who it’s for

Researchers and developers working with LLM interpretability on Apple Silicon Macs who want to visualize and intervene in the internal representations of Qwen3.6-27B models.

Highlights

  • Visual Debugger: A grid interface showing the top predicted token for every layer and token position.
  • Latent Stream Visualization: Surfaces concepts that exist in the model's internal state but are not present in the final output.
  • Causal Interventions: Ability to manually edit internal "thoughts" (Replace, Add, Remove, Erase) to change the model's output.
  • Backward Search: A feature that searches for the specific internal edits required to make the model produce a desired word or phrase.
  • MLX Optimized: Specifically tuned for Apple Silicon with custom kernels for high performance.

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Dispatch