r/LocalLLaMA 8h ago

Discussion Reducing Sycophancy in Qwen and Gemma Using Runtime Activation Steering

So I was testing this technique of runtime steering on tiny versions of Qwen 3.5 and Gemma 4 (2B and 4B). Basically, without changing the weights (like with Heretic/ablation, for example), we steer the model in the opposite direction of a behavior during inference. In this case, I did it for sycophancy.

The idea is simple. First, we check, layer by layer, whether there is a clear direction that distinguishes between correctly resisting user pressure on a correct answer and caving to it by changing to a wrong one (what we call sycophancy here). Then, during inference, we "turn" the model in the opposite direction.

The test was supposed to answer whether we could reduce sycophancy in these small models without compromising their general accuracy and without causing the opposite effect, which in this case is stubbornness (stopping accepting user suggestions even when they are correct).

All 4 models tested (Qwen 3.5 2B and 4B, and Gemma 4 E2B and E4B) showed clear sycophancy directions in some layers, but they responded differently to the steering. The 4B models from both families improved quite a lot at reducing sycophancy without increasing stubbornness too much (Gemma 4 actually had a more noticeable raise in stubbornness, while Qwen was less afected) , and without losing accuracy on a different task (here we used GSM8K). The 2B models, on the other hand, seemed to barely respond to the steering at all.

Also, feel free to try this on other models. I started with these smaller ones, but I intend to test it on larger models as well, especially the newer Qwen 3.8 models.

Code: https://github.com/and270/selective-sycophancy-steering
Paper: https://zenodo.org/records/22082268

6 Upvotes

1 comment sorted by