Steering When Necessary: Flexible Steering Large Language Models with
  Backtracking
Large language models (LLMs) have achieved remarkable performance across many
generation tasks. Nevertheless, effectively aligning them with desired
behaviors remains a significant challenge. Activation steering is an effective
and cost-efficient approach that directly modifies the activations of LLMs
during the inference stage, aligning their responses with the desired behaviors
and avoiding the high cost of fine-tuning. Existing methods typically
indiscriminately intervene to all generations or rely solely on the question to
determine intervention, which limits the accurate assessment of the
intervention strength. To this end, we propose the Flexible Activation Steering
with Backtracking (FASB) framework, which dynamically determines both the
necessity and strength of intervention by tracking the internal states of the
LLMs during generation, considering both the question and the generated
content. Since intervening after detecting a deviation from the desired
behavior is often too late, we further propose the backtracking mechanism to
correct the deviated tokens and steer the LLMs toward the desired behavior.
Extensive experiments on the TruthfulQA dataset and six multiple-choice
datasets demonstrate that our method outperforms baselines. Our code will be
released at https://github.com/gjw185/FASB.
68aee95e5f5ef03314d8c4a0
Jinwei Gan
68aee95e5f5ef03314d8c4a1
Zifeng Cheng
claimed_verified
2025-08-27T12:45:24.313Z
667bdccc51c82bf039c6b353
/avatars/9728542d386e6e3e06ab2984263296b1.svg
Zifeng Cheng
user
bigorange111
68aee95e5f5ef03314d8c4a2
Zhiwei Jiang
68aee95e5f5ef03314d8c4a3
Cong Wang
68aee95e5f5ef03314d8c4a4
Yafeng Yin
68aee95e5f5ef03314d8c4a5
Xiang Luo
68aee95e5f5ef03314d8c4a6
Yuchen Fu
68aee95e5f5ef03314d8c4a7
Qing Gu
Steering When Necessary: Flexible Steering Large Language Models with
  Backtracking
Large language models (LLMs) have achieved remarkable performance across many
generation tasks. Nevertheless, effectively aligning them with desired
behaviors remains a significant challenge. Activation steering is an effective
and cost-efficient approach that directly modifies the activations of LLMs
during the inference stage, aligning their responses with the desired behaviors
and avoiding the high cost of fine-tuning. Existing methods typically
indiscriminately intervene to all generations or rely solely on the question to
determine intervention, which limits the accurate assessment of the
intervention strength. To this end, we propose the Flexible Activation Steering
with Backtracking (FASB) framework, which dynamically determines both the
necessity and strength of intervention by tracking the internal states of the
LLMs during generation, considering both the question and the generated
content. Since intervening after detecting a deviation from the desired
behavior is often too late, we further propose the backtracking mechanism to
correct the deviated tokens and steer the LLMs toward the desired behavior.
Extensive experiments on the TruthfulQA dataset and six multiple-choice
datasets demonstrate that our method outperforms baselines. Our code will be
released at https://github.com/gjw185/FASB.
The Flexible Activation Steering with Backtracking (FASB) framework dynamically adjusts the intervention strength and necessity in large language models during generation to align with desired behaviors, outperforming existing methods.
large language models activation steering inference stage internal states backtracking mechanism TruthfulQA dataset multiple-choice datasets