Habr publishes part two of its activation steering guide: repeng, pyreft and a more precise vector
In part one of Habr's activation steering guide, the baseline vector for steering a language model worked, but with caveats: it turned out inverted, the effect was moderate, and on some prompts it didn't show up at all. In part two, the author shows how to find a more accurate vector using the repeng and pyreft libraries and other Python methods.
AI-processed from Habr AI; edited by Hamidun News
The author of a technical blog on Habr has published part two of a guide to activation steering, a technique for controlling a language model's behavior by directly modifying its internal activations. It explains how to find a more accurate steering vector using the repeng and pyreft libraries.
What went wrong in part one
In part one, titled «Pull it where you need it: Activation Steering Tutorial», the author implemented the basic steering idea in three ways: raw PyTorch hooks, the nnsight library and the pyvene library. The idea behind steering is to add a special vector to a neural network's intermediate activations and push its output in the desired direction, without touching the model's weights.
- Three methods from part one: raw PyTorch hooks, the nnsight library, the pyvene library
- The baseline approach worked: the model responded to the steering vector
- But the result was imperfect: the vector turned out inverted, the effect was moderate, and on some prompts there was no effect at all
«Did our baseline work?
Yes, we saw that. Did it work well? No, and we saw that too: the vector turned out inverted, the effect was moderate, and on some prompts there was none at all,» writes the author of the activation steering guide on Habr.
Which tools part two tries
In part two, the author moves from general-purpose interpretability tools to libraries built specifically for finding a more accurate steering vector: repeng, pyreft and other methods. The focus is on fixing the flaws found in part one and implementing the fixes in Python.
The difference in approach matters. nnsight and pyvene are general-purpose libraries for working with a model's internal states, while repeng and pyreft are built specifically for finding a steering vector. That potentially makes them more predictable where the baseline method produced an inverted vector or a weak effect.
The fact that the author needed a second part suggests that implementing steering head-on with bare PyTorch hooks is not enough for stable results. The technique needs dedicated tooling for finding the vector, not just for applying it to the model's activations.
What this means
Activation steering remains a field where the core idea, shifting a model's internal activations in the desired direction, is implemented through a steadily growing set of tools. The choice of library directly affects how predictably and accurately the model's behavior is controlled.
FAQ
What problems did the baseline approach to activation steering have?
In part one, the steering vector found with the baseline method turned out inverted, produced only a moderate effect and did not work at all on some prompts.
Which tools were used in part one?
Three: raw PyTorch hooks, the nnsight library and the pyvene library. All are general-purpose, none specialized in finding a steering vector.
How do repeng and pyreft differ from the tools in part one?
They are built specifically for finding and tuning a steering vector, rather than for general work with a model's internal activations like nnsight and pyvene. That is the subject of part two.
Key Questions Answered
What problems did the baseline approach to activation steering have?
In part one, the steering vector found with the baseline method turned out inverted, produced only a moderate effect and did not work at all on some prompts.
Which tools were used in part one?
Three: raw PyTorch hooks, the nnsight library and the pyvene library. All are general-purpose, none specialized in finding a steering vector.
How do repeng and pyreft differ from the tools in part one?
They are built specifically for finding and tuning a steering vector, rather than for general work with a model's internal activations like nnsight and pyvene. That is the subject of part two.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.