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.
$
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 Positioncausal patching matrix and ranks Attention/MLP/MoE sublayers using 2 forward passes + 1 backward pass, restoring parameterrequires_gradflags 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
GQAvsMHSA,RMSNormvsLayerNorm,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 incompute_residual_metrics().
Architecture, Scale & Multi-Model Support
-
Scale
Selective CPU-Offloaded Hooking:
CustomModelAdapterandGenericAdapternow 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 customnn.Modules) to avoid KV-cache overhead and autograd conflicts on modern HuggingFace models. -
API
First-Class
dtype&hf_tokeninil.launch(): Wired precision selection (float32,float16,bfloat16) and HuggingFace tokens directly intoil.launch()andget_adapter_for_model()without requiringaccelerateon CPU.
Bug Fixes & Scientific Rigor
-
Fix
BFloat16 NumPy Crash on A100/H100 GPUs: Fixed
TypeError: Got unsupported ScalarType BFloat16incompute_logit_lens()by casting projected logits tofloat32prior to NumPy conversion, backed by a dedicated BFloat16 regression test. -
Fix
Eliminated Hardcoded 16 GB VRAM & Fake GPU Telemetry: Replaced hardcoded
16384 MB/512 MBCPU placeholders and fake NVML fallbacks (42°C,35 W,1350 MHz) with realpsutilsystem 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_attnhidden-state outputs(1, N, D)shadowed realout.attentionstensors stored underlayers.{l}.attn.hook_pattern. -
Fix
Explicit Fallback Transparency: Added
is_syntheticandwarningmetadata 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 ofVRAM Allocated, and replaced broken$$...$$display math blocks inREADME.mdthat 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], andwebsockets>=12.0to core dependencies inpyproject.tomland migrated to SPDXlicense = "MIT"metadata. -
CI
Ubuntu 26.04 Python Matrix: Updated GitHub Actions CI to test Python
3.10–3.13on 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.