Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>llmdbgNew to Visual Studio Code? Get it now.
llmdbg

llmdbg

Sida Liu

|
15 installs
| (0) | Free
Step through LLM layers and inspect human-readable internal representations.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

llmdbg: Debug LLMs — Step, Inspect, Intervene, and Plot

Debug an LLM one token and one layer at a time.

Set breakpoints. Step through attention and MLP blocks. Inspect internal vectors. Remove components and see what changes.

llmdbg stepping through Qwen3.5 with Residual, MLP, and ICA Lens results

Main features

  • Step through an LLM forward pass in VS Code.
  • Inspect the residual stream at each stage.
  • View attention channels and MLP neurons.
  • Use Logit Lens, J-Lens, R-Lens, and ICA Lens.
  • See vector magnitude and direction.
  • Remove an active component and continue the run.
  • Save each intervention as a reproducible experiment log.
  • Plot model vectors with Matplotlib.

Get started

  1. Install llmdbg.
  2. Open a project folder in VS Code.
  3. Press Ctrl+P.
  4. Type >llmdbg: Create Starter Files and press Enter.
  5. Open a generated .llmdbg.py example.
  6. Press F5.
  7. Set a breakpoint. Use F10 to step.
  8. Open Lens from the debug toolbar.

The first run may take a few minutes. llmdbg creates a private Python runtime. It also downloads the selected model. It does not change your project's Python environment.

llmdbg selects the compute backend automatically. It supports NVIDIA CUDA on Windows and Linux. It supports MPS on Apple Silicon. CPU is the fallback.

If setup fails, run llmdbg: Show Runtime Diagnostics.

Lenses and interventions

The Lens page follows the model's execution order. It shows the residual input, attention update, mid-residual state, MLP update, and residual output.

ICA Lens shows the strongest independent components. Right-click an active ICA component, attention channel, or MLP neuron. Choose Intervention: Remove. llmdbg sets it to zero and recomputes the current state. You can then continue the forward pass.

Each intervention creates a note in the project's .logs folder. The note records the model, prompt, location, change, and result.

Supported models

Model Debugging ICA Lens
GPT-2 Small ✓ ✓
Qwen3.5 0.8B ✓ —
Qwen3.5 2B Base ✓ ✓
Qwen3.5 2B Chat ✓ ✓
Qwen3.5 9B ✓ ✓
Qwen3.5 27B ✓ —

J-Lens and R-Lens are available when an artifact exists for the selected model. The official J++ Lens is available for Qwen3.5 9B. Lens files are downloaded on first use and cached locally.

Residual-to-Vocabulary Lens sources

The llmdbg.jLensSource, llmdbg.rLensSource, and llmdbg.jppLensSource settings expose the standard J-Lens, R-Lens, and J++ Lens artifact repositories as ordinary editable text fields. Each source may be a Hugging Face repository URL or a local folder containing the same index.json, manifests, and artifact layout. Run llmdbg: Manage Custom Residual-to-Vocabulary Lenses to add, edit, enable, disable, or remove other compatible lenses. Official J++ and the Post-only Neuronpedia J and J++ Lenses are included as custom Lenses by default, so they can be managed in exactly the same way as any user-added Lens. The Lens selector only shows entries available for the active model. Logit Lens is built in, and ICA Lens remains separately configured and displayed.

Methods

  • Verbalizable Representations Form a Global Workspace in Language Models introduces J-Lens.
  • R-Lens: Making J-Lens More Faithful on Early Layers introduces R-Lens.
  • J++ Lens: Jacobian Filtering Enables More Faithful Workspace Lenses introduces J++ Lens.
  • ICA Lens introduces ICA Lens.

ICA bases:

  • GPT-2 Small
  • Qwen3.5 2B Base
  • Qwen3.5 2B Chat
  • Qwen3.5 9B

Links

  • Source code and issues
  • Lens artifacts
  • Sida Liu's homepage

MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft