Steering When Necessary: Flexible Steering Large Language Models with Backtracking

Zifeng Cheng, Jinwei Gan, Zhiwei Jiang, Cong Wang, Yafeng Yin, Xiang Luo, Yuchen Fu, Qing Gu

Abstract

Aligning Large Language Models (LLMs) with human values typically requires computationally expensive fine-tuning. This paper introduces Flexible Activation Steering with Backtracking (FASB), a framework that enables LLMs to self-correct during inference. By monitoring internal activations in real-time, FASB detects impending hallucinations or untruthful drifts, triggers a backtracking mechanism to rewind generation, and applies adaptive steering vectors to guide the model toward truthful outputs. FASB achieves significant improvements in truthfulness and accuracy across multiple benchmarks while maintaining model informativeness.

Introduction

Aligning LLMs with truthfulness and safety often relies on Reinforcement Learning from Human Feedback (RLHF), which is resource-intensive. Activation steering offers a lightweight alternative by identifying "truthful directions" within a model's internal representations and nudging activations during generation. However, existing methods suffer from a "one-size-fits-all" limitation: they apply uniform nudges regardless of whether the model is already performing well, which can degrade coherence and informativeness.

Figure 1: Example of FASB intervention correcting a hallucination about the US capital.

FASB addresses this by introducing a dynamic, surgical approach to intervention, ensuring the model is only steered when necessary and to the degree required by the specific context.

Methodology

FASB consists of three primary components that transform static steering into a dynamic inference-time process:

  1. State Tracking: FASB monitors the activations of specific "truth-related" attention heads at every generated token. A lightweight probe (e.g., logistic regression) calculates a deviation probability, acting as a real-time detector for internal "drift" toward untruthfulness.
  2. Backtracking Mechanism: A critical insight of this work is that by the time a model generates a false token, its internal hidden states are already corrupted. FASB solves this by "rewinding" the generation by $s$ tokens whenever the deviation probability exceeds a predefined threshold, clearing the polluted states.
  3. Adaptive Steering Strength: Upon backtracking, FASB applies a steering vector with a strength ($r$) proportional to the detected deviation. This ensures that confident "lies" receive a strong nudge, while minor drifts receive a gentle correction, preserving the model's natural informativeness.
Figure 2: The FASB workflow, illustrating state tracking, backtracking, and the calculation of flexible steering strength.

Experimental Results

The researchers evaluated FASB across several benchmarks, including TruthfulQA, COPA, and MMLU, using models such as LLaMA-2, LLaMA-3.1, and Qwen-2.5.

  • Truthfulness vs. Informativeness: On TruthfulQA, FASB achieved a 80.56% score on the True*Info metric, significantly outperforming the LLaMA-2-7B baseline (66.50%) and standard Inference-Time Intervention (ITI) (76.11%).
  • Reasoning and Logic: In multiple-choice tasks like COPA, FASB improved accuracy from 64.4% to 90.0%.
  • Cross-Dataset Generalization: Steering vectors trained on TruthfulQA proved effective on TriviaQA and Natural Questions, suggesting that "truthfulness" is represented as a consistent direction in the model's high-dimensional activation space.

Discussion and Limitations

FASB demonstrates that internal model drift occurs before a token is sampled, making backtracking essential for effective intervention. However, the method introduces some computational overhead due to token regeneration and requires hyperparameter tuning (e.g., threshold $\beta$ and backtrack steps $s$) for different tasks. Future work will explore multilingual generalization and more objective, non-LLM-based verification of steered outputs.

Conclusion

FASB provides a robust framework for enhancing LLM truthfulness without fine-tuning. by combining real-time state tracking with a backtracking mechanism, it allows models to recover from internal drifts, achieving a superior balance between truthfulness and informativeness compared to static steering methods.

Summary updated

BibTeX
@inproceedings{cheng2025steering,
  author = {Zifeng Cheng and Jinwei Gan and Zhiwei Jiang and Cong Wang and Yafeng Yin and Xiang Luo and Yuchen Fu and Qing Gu},
  title = {{Steering When Necessary: Flexible Steering Large Language Models with Backtracking}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=l75RyRcevf},
}
Figure