RELEASE NOTES · NOVEMBER 25, 2026

InterpLens 2.0.0

InterpLens 2.0.0 introduces fast gradient-based circuit discovery, Direct Logit Attribution, Contrastive Activation Steering with multi-token generation, dynamic Mermaid architecture diagrams, and full BFloat16 / multi-architecture hardening validated on A100 80GB GPUs.

Version: 2.0.0 Python: 3.10 – 3.13 PyTorch: 2.0+ Tests: 46 / 46 passing License: MIT
$ pip install --upgrade interplens
View on PyPI

A100 80GB Verification Benchmarks

Workload Model / Precision Observed Result
Gradient Attribution Patching (AtP) Qwen/Qwen2.5-7B-Instruct (bfloat16) 504.2 ms full 28-layer × 14-token sweep (Peak: L26 Pos 13, 92.13%)
Direct Logit Attribution (DLA) Qwen/Qwen2.5-7B-Instruct (bfloat16) Isolated L25 MLP (+1.3704) as primary factual-recall writer
MoE & BFloat16 Logit Lens allenai/OLMoE-1B-7B-0924-Instruct (bfloat16) Zero NumPy BFloat16 errors; selective CPU-offloaded hook cache
Multi-Architecture CI Suite Llama, Qwen2, Mixtral, GPT-2 46 automated tests covering DLA, AtP, CAA Steering, Topology, and APIs

New Interpretability Engines

  • New Direct Logit Attribution (DLA): Decomposes the final logit difference logit(target) - logit(foil) into exact additive contributions from the Embedding layer, Attention sublayers, and MLP/MoE sublayers across all layers, with a grouped Chart.js bar view and ranked component table.
  • New Gradient-Based Attribution Patching (AtP): Approximates the full Layer × Token Position causal patching matrix and ranks Attention/MLP/MoE sublayers using 2 forward passes + 1 backward pass, restoring parameter requires_grad flags cleanly after every run.
  • New Contrastive Activation Steering (CAA) & Side-by-Side Generation: Computes Difference-in-Means steering vectors directly from Positive vs. Negative prompt pairs at any layer, stores vectors in memory for instant α sweeps, and generates Baseline vs. Steered multi-token completions side-by-side with built-in presets.
  • New Interactive Mermaid.js Model Architecture Diagrams: Replaced the static card flow with dynamic Mermaid flowcharts showing residual skip paths, tensor shapes, parameter budgets, and auto-detected GQA vs MHSA, RMSNorm vs LayerNorm, SwiGLU, MoE, and tied embeddings — with Zoom, View/Copy Mermaid, and Export SVG.
  • New 2D PCA Residual Stream Trajectories: Added SVD-based 2D PCA coordinates (pc1, pc2) and explained variance ratios across layers in compute_residual_metrics().

Architecture, Scale & Multi-Model Support

  • Scale Selective CPU-Offloaded Hooking: CustomModelAdapter and GenericAdapter now selectively hook key transformer modules (embeddings, blocks, attention, MLP/MoE) and offload captured activations to CPU RAM rather than hooking every sub-op on GPU.
  • Multi-Model Broader Architecture Discovery: Extended sublayer resolution to Mixtral MoE (block_sparse_moe), OPT (model.decoder.layers), Falcon/Bloom (self_attention), and OLMoE alongside Llama 3, Qwen 2.5, Mistral, Gemma 2, Phi, Pythia, and GPT-2.
  • Memory KV-Cache Safe Backward Passes: Attribution Patching passes use_cache=False (with automatic fallback for custom nn.Modules) to avoid KV-cache overhead and autograd conflicts on modern HuggingFace models.
  • API First-Class dtype & hf_token in il.launch(): Wired precision selection (float32, float16, bfloat16) and HuggingFace tokens directly into il.launch() and get_adapter_for_model() without requiring accelerate on CPU.

Bug Fixes & Scientific Rigor

  • Fix BFloat16 NumPy Crash on A100/H100 GPUs: Fixed TypeError: Got unsupported ScalarType BFloat16 in compute_logit_lens() by casting projected logits to float32 prior to NumPy conversion, backed by a dedicated BFloat16 regression test.
  • Fix Eliminated Hardcoded 16 GB VRAM & Fake GPU Telemetry: Replaced hardcoded 16384 MB / 512 MB CPU placeholders and fake NVML fallbacks (42°C, 35 W, 1350 MHz) with real psutil system RAM, process RSS, peak RSS, CPU core counts, and real per-layer parameter/cache footprints.
  • Fix Real HuggingFace Attention Capture: Fixed a hook-key precedence bug where self_attn hidden-state outputs (1, N, D) shadowed real out.attentions tensors stored under layers.{l}.attn.hook_pattern.
  • Fix Explicit Fallback Transparency: Added is_synthetic and warning metadata fields across Attention Heads, MLP Neurons, Token Attribution, and Causal Patching responses so fallback data is never silent.
  • Fix CLI RAM Labeling & PyPI README Math: Fixed CLI startup output to display System RAM (Process) on CPU instead of VRAM Allocated, and replaced broken $$...$$ display math blocks in README.md that PyPI's Markdown parser mangled into italics.

UI, Packaging & CI

  • UI Studio Theme, 3D Isometric Logo & Mobile Support: Refined the web debugger with a high-contrast obsidian theme, custom scrollbars, a transparent 3D isometric SVG favicon, responsive mobile/tablet navigation, and a dismissible mobile desktop-recommendation banner.
  • Packaging Out-of-the-Box Dependencies: Added transformers>=4.36.0, uvicorn[standard], and websockets>=12.0 to core dependencies in pyproject.toml and migrated to SPDX license = "MIT" metadata.
  • CI Ubuntu 26.04 Python Matrix: Updated GitHub Actions CI to test Python 3.10–3.13 on Ubuntu and Windows after EOL Python 3.9 removal.

InterpLens 0.1.0

Initial public release featuring Zero-Copy GPU Attach, L0–L4 Capability Matrix, Logit Lens, Residual Stream norms and cosine drift, Attention Head & Induction Head Explorer, MLP Neuron Activations, Causal Patching sweeps, and PDF Model Reports.