LOBE
Mechanistic Interpretability & Steering Toolkit
What it is
LOBE is a modular Python framework for real-time activation steering and causal feature validation in transformer architectures. It implements a RuntimeController and a hook-based intervention engine that lets you scale latent features during inference, steering the model's behavior directly without retraining.
How it works
The core is a hook-based intervention engine that registers forward hooks on transformer layers, capturing activations as they flow through the model. A RuntimeController applies alpha-scaled deltas to targeted latent features, letting you amplify or suppress specific concepts (e.g. "honesty," "refusal") at inference time.
controller = RuntimeController(model) controller.register_hook(layer="blocks.5.hook_resid_pre", feature="honesty") controller.steer(feature="honesty", alpha=1.5) output = model.generate(prompt)
CausalSweeper validates feature-trait correlations by measuring behavioral change across alpha-scaled activation deltas, giving you a causal read on which features actually drive which outputs.
Stack
- Python
- PyTorch
- TransformerLens
- Hook-based intervention engine
- Causal feature validation
Status
Experimental: built to explore how model internals can be steered causally.