Aligning Large Language Models with Representation Editing: A Control Perspective
About
Aligning large language models (LLMs) with human objectives is crucial for real-world applications. However, fine-tuning LLMs for alignment often suffers from unstable training and requires substantial computing resources. Test-time alignment techniques, such as prompting and guided decoding, do not modify the underlying model, and their performance remains dependent on the original model's capabilities. To address these challenges, we propose aligning LLMs through representation editing. The core of our method is to view a pre-trained autoregressive LLM as a discrete-time stochastic dynamical system. To achieve alignment for specific objectives, we introduce external control signals into the state space of this language dynamical system. We train a value function directly on the hidden states according to the Bellman equation, enabling gradient-based optimization to obtain the optimal control signals at test time. Our experiments demonstrate that our method outperforms existing test-time alignment techniques while requiring significantly fewer resources compared to fine-tuning methods. Our code is available at https://github.com/Lingkai-Kong/RE-Control.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Safety Evaluation | AdvBench | -- | 117 | |
| Hallucination Reduction | CAA hallucination benchmark multiple-choice | Alignment Probability68.5 | 110 | |
| Open-ended hallucination | Open-ended hallucination benchmark | Score1.46 | 55 | |
| Refusal | Refusal benchmark | Alignment Probability76.6 | 55 | |
| Open-ended refusal | Open-ended refusal benchmark | Score8.28 | 55 | |
| Language model detoxification | RealToxicityPrompts (test) | Distinct-190.9 | 54 | |
| Preference Alignment | HH-RLHF | Win Rate80 | 45 | |
| Truthfulness Evaluation | TruthfulQA | -- | 33 | |
| Safety Evaluation | HarmBench (test) | ASR28.7 | 31 | |
| Preference Alignment Evaluation | Nectar | -- | 30 |