Activation Steering with a Feedback Controller

Dung Viet Nguyen, Yen Nhi Pham, Hieu M. Vu, Lei Zhang, Tan Minh Nguyen

Introduction

Controlling the behaviors of large language models (LLMs)—ensuring they stay safe, helpful, and follow specific stylistic guidelines—is fundamental to their reliable deployment. While this is typically achieved through expensive post-training processes like RLHF, a more lightweight alternative is activation steering. This technique nudges the model's internal "thoughts" (activations) during inference using a steering vector.

However, current steering methods are largely empirical. They act as practical "hacks" that work in many cases but lack a solid theoretical foundation. This often leads to inconsistent results, such as "overshooting" a target behavior or failing to maintain a behavioral correction across all layers of the model. This paper bridges that gap by providing a principled, control-theoretic framework to make activation steering reliable and mathematically grounded.

The Control-Theoretic Perspective

The authors model the layer-by-layer progression of an LLM as a dynamical system. Through this lens, they demonstrate that existing state-of-the-art steering methods, like Activation Addition (ActAdd) and Mean Activation Transport (Mean-AcT), are mathematically equivalent to simple Proportional (P) controllers.

In classical control theory, a P-controller often suffers from "steady-state error"—it pushes the system close to the target but never quite reaches it due to inherent system disturbances. To resolve this, the researchers introduce PID Steering, upgrading the mechanism to a full Proportional-Integral-Derivative controller:

  1. Proportional (P) term: Aligns activations with target semantic directions.
  2. Integral (I) term: Accumulates error across layers. If the model hasn't been steered enough in early layers, the I-term ramps up the pressure to ensure the correction persists.
  3. Derivative (D) term: Monitors the rate of change of the error. It acts as a brake, preventing the steering from changing too rapidly and causing "overshoot" (where the model becomes overly biased in the target direction).
Overview of PID Steering and its connection to control theory

The resulting framework is a discretized PID controller that can be dropped into standard transformer architectures as a lightweight, modular, inference-time modification.

Key Insights: Fixing the "Steady-State" Problem

The paper proves that P-only steering cannot eliminate bias because of inherent "disturbances" in the model's state. The Integral term is mathematically necessary to cancel out this matched disturbance.

However, while the Integral term fixes the bias, it introduces a new problem: it often causes the model's activations to oscillate or overshoot the target. This is where the Derivative term becomes essential, acting as a "damper" that smooths out these dynamics.

Comparison of error dynamics between P, PI, and PID controllers

As visualized in the error dynamics, a standard P-controller (blue) plateaus above zero, leaving a steady-state error. Adding the Integral term (PI-controller, red) eventually reaches zero but suffers from significant overshoot first. The full PID-controller (green) achieves the best of both worlds, reaching zero quickly with minimal overshoot.

Experimental Validation

The PID Steering framework was evaluated across several domains and model families, consistently outperforming state-of-the-art baselines:

  • Toxicity Mitigation: Tested on Gemma-2B and Llama3-8B using the RealToxicityPrompts dataset. On Gemma-2B, PID-AcT reduced toxicity by 8.2x compared to the original model, outperforming standard Mean-AcT while maintaining better language fluency (lower perplexity).
  • Jailbreaking Defense: Evaluated on Qwen2.5, Gemma2, and Llama3 (3B to 14B scales) using AdvBench. PID Steering achieved the highest Attack Success Rate (ASR) reductions. On Llama3.1-8B, it reached a 94.85% defense rate, surpassing the 93.26% of the best baseline.
  • Image Style Control: Applied to the FLUX.1-Schnell diffusion model to steer image generation toward specific aesthetics (e.g., "cyberpunk"). PID Steering provided a much smoother and more coherent transition between styles compared to traditional methods, which often produced distorted images at high steering strengths.
  • General Utility: Monitored using MMLU and TinyBenchmarks, confirming that the steering process did not degrade the models' core reasoning abilities.

Limitations and Future Directions

While PID Steering offers a robust theoretical foundation, it introduces three hyperparameters (the gains $K_p, K_i, K_d$) that require tuning. The authors utilized a "stability-first" manual strategy but note that automated methods could yield even better parameters. Additionally, the current theoretical guarantees rely on local linearizations of the model; extending this to a fully non-linear global stability analysis remains an exciting challenge for future research. Finally, calculating the I and D terms introduces a marginal computational overhead at each layer compared to simple activation addition.

Summary updated

BibTeX
@inproceedings{nguyen2026activation,
  author = {Dung Viet Nguyen and Yen Nhi Pham and Hieu M. Vu and Lei Zhang and Tan Minh Nguyen},
  title = {{Activation Steering with a Feedback Controller}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=vzkEX2SwFD},
}
Figure