Habr AI→ original

Habr released the second part of the Activation Steering guide—repeng, pyreft and exact vector

A second part of a series on Activation Steering was posted on Habr—a technique for controlling language model behavior through direct modification of its internal activations. In the first part, authors implemented basic steering in three ways: via raw PyTorch hooks, via nnsight, and via pyvene, but encountered problems—the vector was inverted, the effect was moderate, and disappeared on some prompts. In the second part, repeng, pyreft and other methods are analyzed that should find the vector more accurately.

AI-processed from Habr AI; edited by Hamidun News
Habr released the second part of the Activation Steering guide—repeng, pyreft and exact vector
Source: Habr AI. Collage: Hamidun News.
◐ Listen to article

The author of a technical blog on Habr released the second part of a guide on activation steering—a technique for controlling language model behavior by directly changing its internal activations—and explains how to find a control vector more precisely using repeng and pyreft libraries.

What Didn't Work in the First Part

In the first part of the guide, which was titled "Pull It Where You Need: Activation Steering Tutorial," the author implemented the basic idea of steering in three ways—through raw PyTorch hooks, through the nnsight library, and through the pyvene library. The idea of steering itself is to add a special vector to intermediate neural network activations and shift its response in the desired direction without modifying model weights.

  • Three methods from the first part: raw PyTorch hooks, nnsight library, pyvene library
  • The basic approach worked—the model responded to the control vector
  • But the result was far from ideal: the vector turned out to be inverted, the effect was moderate, and on some prompts there was no effect at all
"Did our base work?

Yes—we saw it. Was it normal? No—and we saw that too: the vector turned out to be inverted, the effect was moderate, and on some prompts there was no effect," writes the author of the activation steering guide on Habr.

Which Tools Are Tried in the Second Part

In the second part of the guide, the author moves from universal interpretability tools to libraries specifically designed for finding a more precise control vector—repeng, pyreft, and other methods. The topic of the second part is exactly how to fix the shortcomings found in the first part and how to implement it in Python.

The difference in approach is fundamental: if nnsight and pyvene are universal libraries for working with model internal states, then repeng and pyreft were created specifically for the task of finding a control vector, which means they potentially give more predictable results where the basic method gave an inverted vector or weak effect.

The very fact that the author needed a second part of the guide shows: implementing steering "head-on" through raw PyTorch hooks is not enough for stable results—the methodology requires separate instrumentation specifically for vector search, not just for applying it to model activations.

What This Means

Activation steering remains an area where the basic idea—to shift a model's internal activations in the desired direction—is implemented through a constantly growing set of tools; the choice of library directly affects how predictably and precisely model control works.

Frequently Asked Questions

What

Problems Did the Basic Approach to Activation Steering Have?

In the first part of the guide, the control vector found using the basic method turned out to be inverted, gave only moderate effect, and didn't work at all on some prompts.

Which Tools Were Used in the First Part of the Guide?

Three methods: raw PyTorch hooks, nnsight library, and pyvene library—all basic, without specialization in finding a control vector.

How

Do repeng and pyreft Differ from the Tools in the First Part?

They were created specifically for searching and tuning a control vector, not for general work with model internal activations like nnsight and pyvene—this is the subject of the second part of the guide.

ZK
Hamidun News
AI news without noise. Daily editorial selection from 50+ sources. A product by Zhemal Khamidun, Head of AI at Alpina Digital.

Need AI working inside your business — not just in your newsfeed?

I build production AI for companies — custom CRM, internal tools, autonomous agents, workflow automation. Owned by you, shaped to your process, no per-seat tax. Built by Zhemal Khamidun, CPO of AlpinaGPT (AI platform, 6,000+ users).

What do you think?
Loading comments…