Aligning Large Language Models with Representation Editing: A Control Perspective

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.

Paper

References (73)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer F1xo7/10 · confidence 3/52024-06-12

Summary

In their paper, the authors introduce RE-CONTROL, a novel approach designed to align Large Language Models (LLMs) through representation editing. They view LLMs as discrete-time stochastic dynamical systems and propose the insertion of control signals into the internal representations. This technique allows for precise manipulation of the model's outputs during test time token by token. The experiments show that this method increases the win rate on HH dataset and does not need significant inference time.

Strengths

- Viewing LLMs as a dynamical system and interpret the steering vector as a kind of controlling signal to align models is innovative. - Make LLMs adjustable during the generation process, and the evaluation does not have to wait until the entire sentence is generated. - They empirically show that their method outperform some test-time alignment methods and does not need significant inference time, which makes the method be more practical usable.

Weaknesses

- Some parts of the paper are confusing, especially certain expressions. For example, they did not clarify some notations like a_t, V_{phi} etc.. The legend in figure 1 seems mismatched. And some figures are not mentioned in the paper. - I think the performance of this method is highly depend on the value model. However, the paper does not discuss the reliability of the value model, which is crucial since it needs to assess the alignment effectiveness of the entire result based on each newly generated token and do so before the results are generated. - The theoretical analysis and interpretation of their method is interesting, but lack rigor. e.g. the generated token (y_t) should be determined by logits (o_t), which is a part of state in the dynamic system. However, the paper interprets the generated token as kind of random variable or random noise (w_t).

Questions

Please refer to the part of weaknesses.

Rating

7

Confidence

3

Soundness

4

Presentation

2

Contribution

3

Limitations

Limitation are sufficiently discussed.

Reviewer vtBo6/10 · confidence 4/52024-07-11

Summary

The paper suggests editing language model features for alignment tasks. The authors first learn a value function of a language model from a human-preference dataset. They then increment feature representations in model layers to maximize test-time utility. Empirical evidence shows that this feature editing method surpasses both test-time and training-time alignment baselines.

Strengths

The proposed method, RE-CONTROL, is a useful middle ground between current training-time and test-time alignment methods: - RE-CONTROL, unlike existing training-time methods, does not alter a language model’s parameters, reducing training costs. Instead, it learns a value function offline. - RE-CONTROL, unlike existing test-time methods, employs a learned value function to inject feature increments into features of language models. The experiments are extensive in that they compared RE-CONTROL with both training-time and test-time alignment methods.

Weaknesses

While the paper is technically well-executed, I believe it has three main limitations: (i) the lack of compute--performance tradeoff analysis (ii) the lack of details in comparing RE-CONTROL with training-time alignment baselines. (iii) the limitation in application scope. First, a compute-performance tradeoff analysis would clarify the behavior of RE-CONTROL. RE-CONTROL is more compute-intensive than other test-time decoding alternatives because it requires gradient ascent steps at decoding time (Section 4.4). These steps add up and can become quite intensive for generating long text. Therefore, comparing RE-CONTROL with test-time alignment alternatives while considering compute time would be informative. For instance, the authors could display the win rate of different test-time decoding methods on the y-axis and their wallclock time on the x-axis. Second, I think the performance comparison between RE-CONTROL and training-time alignment methods in Section 6.1 seems very preliminary. There, the authors empirically show that the test-time alignment method RE-CONTROL *outperforms* training-time alignment methods like PPO, by concluding that >We observe that RE-CONTROL achieves a higher GPT-4 win rate and average reward compared to both PPO and DPO. Furthermore, RE-CONTROL also outperforms these methods in terms of diversity and coherence. I'm puzzled by how to interpret the results here. Should the take-home message here be "Decoding-time RE-CONTROL is better than training-time PPO in alignment. Period." or are there qualifications to this statement? I strongly suspect that some qualification is needed. To some extent, RE-CONTROL is a decoding-time approximation of PPO. Both methods use a learned value function to steer the model's behavior. At decoding time, RE-CONTROL does this in a more lossy (due to test-time gradient ascent) and shallower (because not all parameters are updated) way. Thus, with adequate training, I expected PPO to yield better results than RE-CONTROL. Note that this doesn't undermine RE-CONTROL's capability, as it is more lightweight than PPO. Thirdly, while RE-CONTROL is technically sound, its application scope seems narrow. To my understanding, RE-CONTROL is most appealing to users who are unwilling to train a language model offline, who are willing to train a value function offline, who aim to save computing power during training, and who don't mind using more compute during decoding. These intersections of users seem limiting. This raises the question: Is it better to simply use a similar compute budget for efficient alignment (e.g., LoRa) of the LM model using standard methods (DPO, PPO, etc.) and avoid ongoing compute costs during decoding?

Questions

As mentioned above, in my opinion, it is surprising that decoding-time RE-CONTROL outperforms training-time PPO. To compare PPO and RE-CONTROL more carefully, could the authors consider some ablation studies? For example, you could use the same value function for both PPO and RE-CONTROL, one at training time to fine-tune the model parameters and the other at decoding time to produce the feature increment and compare the results.

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

See the "Weaknesses" section above.

Authorsrebuttal2024-08-13

Thanks for your reply!

Thank you for your reply and for raising the score! We would like to provide some comments as follows: **Thank you for the clarification. As the authors mentioned, I recommend they add a qualification to their statements in Section 6.1, such as: "Overall, the results indicate that our approach is a competitive alternative to parameter-efficient / LoRa-based training-time alignment methods." Without this qualification, readers might question the rigor of the experimental results.** Thank you for the suggestion. We will explicitly clarify that our comparisons are focused on LoRa-based training-time alignment methods, and we demonstrate competitive performance relative to them. **I suggest the authors include a similar discussion in their paper or code repository, as doing so will make the method more appealing to practitioners.** Thank you for your suggestion. We will include the training time in our comparisons with LoRa-based training-time alignment methods in the revised version. **I'm not sure I understand this. Wouldn't it be possible to take a value function trained with PPO and use it within the authors' decoding framework? This approach could allow for a more direct comparison between PPO and the authors' method, as they use the same underlying value function. A similar approach for reusing the PPO value function is discussed here: https://openreview.net/forum?id=QaODpeRaOK.** Thank you for suggesting this paper. The training objective of the value function in PPO is slightly different from ours. In PPO (as Equation 1 in your suggested paper), regularization is incorporated into the reward function. In contrast, our value function estimates the true reward (see Line 168), and we introduce regularization during testing time by tuning the hyperparameters, such as the number of iterations and step size. This difference means that using the PPO value function could complicate hyperparameter tuning, as it would require retraining the value function each time we adjust the regularization strength. That said, we agree that it would be interesting to explore the performance of using the value function from PPO. Additionally, examining how the PPO value function performs in baseline-controlled decoding scenarios would also be interesting. However, with only about a day remaining in the discussion period, it would be challenging to conduct these new experiments, especially since tuning the hyperparameters in this context would require retraining the PPO model. We plan to explore this further in our camera-ready version and hope this is understandable to you. Moreover, since our primary focus is on test-time alignment methods, we believe this does not affect our main conclusions. Again, Thanks for this interesting suggestion! Best, RE-Control authors

Reviewer XYhX5/10 · confidence 3/52024-07-12

Summary

The paper introduces an alternative procedure for LLM alignment that does not fine-tune LLM weights, but instead learns a separate value function that is used to update hidden states. The value function is learned using a variation of temporal difference, then applied at inference time to modify hidden states by gradient ascent, maximizing the predicted state value. Authors evaluate their approach with multiple 7B LLMs on HH-RLHF data, comparing against both RLHF and training-free baselines. The paper also analyzes OOD generalization to HarmfulQA.

Strengths

- Authors propose an interesting approach to that can be used to alter LLM behavior in general - When experimenting with HH-RLHF dataset, authors evaluate against multiple types of baselines and provide additional analysis that was interesting to read - The paper is generally well-written and easy to follow - Authors made the code available, in a (mostly) serviceable state

Weaknesses

**1a. Motivation for the choice of baselines.** In your work, you cite, among others, ARGS[26], DeAL [22], Value Augmented Sampling [21] that also learn value functions and use them to steer model outputs (in other ways), but, to the best of my knowledge, you do not compare against them as baselines, instead choosing a relatively older work on controlled decoding. While [21] may be dismissed as concurrent work, the other works appear to be a relevant alternative and it is not clear why they were not chosen as baselines. If there is a reason why these works will, beyond reasonable doubt, fail at the task that you evaluate on, I would recommend that you explain this in the paper. If there is no such reason, the paper would benefit from comparing against them. **1b. Motivation for the choice of models** Your paper focuses on Llama, Vicuna and Falcon models, of the 7B variety. While these are indeed LLMs, the original Llama was released circa 1.5 years ago and since then, LLMs improved **significantly** across tasks. Picking older LLMs appears counterintuitive, as their generally worse quality makes it harder to measure possible drawdowns introduced by LLM alignment. If you have a reason for choosing these models, please explain why you focus on older LLMs as compared to, for example, Llama 3 8B (or 70B), Qwen2, Gemma or other models near the top of https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard . If there is no such reason, the paper would benefit from switching to more accurate models. **2. Inference time exploration** LLM use cases are often sensitive to inference throughput (tokens per second) and latency (time to first / next token). To the best of my understanding, RE-Control introduces an iterative optimization step to each forward pass during autoregressive inference. Depending on the configuration, this may result in a significant slowdown, which may limit the practical significance of your approach. I would argue that the work would benefit from analyzing this difference in speed in different settings (e.g. single-sequence vs batch inference, etc). **3. Main experiments are limited to one dataset and relatively small past generation LLMs, ranked by GPT-4** This is definitely not a fault on authors' side, but the paper makes its main conclusions based on 7B models, using reward functions trained on a single dataset. This could result in accidental false conclusions if it turns out that, for instance, RE-Control harms the quality of stronger models or if it is somehow implicitly overfitting on on GPT4 opinions. The standard way to minimize this risk is to diversify the experiments: try alternative alignment datasets (e.g. webgpt_comparisons, oasst1, etc), try larger models (llama-3 70B), introduce human rankings in some setups, etc. I understand that not all of these evaluations may be available to the authors, but for a NeurIPS publication, I would expect more variation in the experiments and, if there is a confounder that could not be eliminated (e.g. using GPT4 and no human eval), it should be stated among the limitations section.

Questions

**Questions on the definition of state** To the best of my (possibly wrong) understanding, when you apply Bellman equation, you assume that the dynamic system's state satisfies Markov assumption. [If not, please explain why not] Since LLMs use attention to previous hidden states, hidden vector for a specific state do not satisfy Markov assumption, since LLM's next token probability depends not only on them, but on a more distant past as well. In contrast, a fully markovian state would need to contain all previous hidden vectors, or the current hidden vectors and all past KV projections, or a sequence of all previous tokens (no hidden vectors necessary). In other words, **when you define V(s), does s refer to just the current token's hiddens or a full state with Markov assumption?** If you mean the latter state, then the test-time intervention (S4.4) needs to modify all previous hidden states of an LLM. This is important because modifying past hidden states may result in a very inefficient LLM inference algorithm. If only the current state, you seem to apply policy iteration (S4.2-4.3) to a non-markov state. Please explain how you make sure that this algorithm still has the guarantees of optimal policy. If it doesn't, please clearly explain that the algorithm is a heuristic inspired by PI rather than actual PI. ### On reproducibility To reiterate, the fact that you publish the code is great. None of my complaints below affected the final score. The codebase lacks library versions (requirements.txt / dockerfile / list them in the readme), which makes it difficult to reproduce, especially in the future. While I ultimately managed to run the code by choosing the libraries with an educated guess (and minor modifications to the code), I am still not sure if I got the method to work "as intended" and not introduce silent errors. For legal reasons, it would be best to direct the users to a version of Llama 7B that contains its original license, at least in the final version of the paper. Using GPT-4 opinion means that the experiments would be difficult to reproduce after it is cycled ou ### Typos / minor: > L16 LLama The capitalization for the first version was LLaMA, second and third are Llama. > supplementary code: intervented_model you may have meant “intervened”

Rating

5

Confidence

3

Soundness

2

Presentation

3

Contribution

2

Limitations

The "Limitations and future work" appendix can be significantly improved. Currently, it focuses on future work and omits some limitations of the experiments, such as: - using GPT-4 as the primary metric will make the results irreproducible once OpenAI cycles out GPT4, a closed-source model - evaluating only on relatively weaker models (pre-previous gen, 7B) may miss some caveats or synergies from more capable LLMs - using a single training dataset makes it possible that the proposed method is uniquely powerful in this one scenario but not others The quality of the limitation section did not affect my score.

Authorsrebuttal2024-08-13

Thanks for your review

Dear Reviewer XYhX Thank you for your time and effort in helping us improve our work. As we approach the end of the discussion period, we wanted to check in to see if you have any further questions or comments. We are more than happy to address any additional concerns you may have. Best, RE-Control authors

Reviewer Xnva8/10 · confidence 3/52024-07-12

Summary

The paper "Aligning Large Language Models with Representation Editing: A Control Perspective" proposes a method for aligning large language models (LLMs) with human objectives through representation editing. Unlike fine-tuning, which is resource-intensive and unstable, or test-time alignment techniques like prompting that rely on the original model's capabilities, this method introduces external control signals into the hidden states of a pre-trained LLM. The method treats the LLM as a discrete-time stochastic dynamical system and applies control theory to train a value function on the hidden states, optimizing control signals at test time. The experiments show that this method, named RE-CONTROL, outperforms existing test-time alignment techniques and requires fewer resources compared to fine-tuning methods.

Strengths

Innovative Approach: The use of control theory to introduce control signals into the hidden states of LLMs is novel and provides a new perspective on alignment. Resource Efficiency: RE-CONTROL is less resource-intensive than traditional fine-tuning methods, making it more practical for large-scale applications. Empirical Success: The experiments demonstrate that RE-CONTROL outperforms existing test-time alignment methods, showing strong generalization and alignment capabilities. Flexibility: The method offers more flexibility than prompting or guided decoding as it perturbs the representation space dynamically during the generation process

Weaknesses

Complexity: The method involves sophisticated control theory and optimization techniques, which might be challenging to implement and understand for practitioners without a strong background in these areas. Dependency on Value Function: The success of the method heavily relies on the accuracy and training of the value function, which might introduce additional challenges in terms of training and performance.

Questions

What are the specific challenges encountered during the training of the value function, and how can they be mitigated?

Rating

8

Confidence

3

Soundness

3

Presentation

4

Contribution

3

Limitations

Limited Scope: The paper primarily focuses on aligning LLMs for helpfulness and minimizing harmfulness. It might not address other important alignment objectives comprehensively. Potential Overfitting: The reliance on a specific value function and control signals might lead to overfitting to the training data or specific tasks, limiting the method's generalizability. Evaluation Metrics: The evaluation metrics, while comprehensive, might not capture all aspects of alignment, especially in diverse and dynamic real-world scenarios.

Authorsrebuttal2024-08-12

More Results on Llama3 7B

Dear reviewers: We would like to present additional results using the Llama3 7B model on the SHP dataset. The table below shows the results. As we can see, RE-Control continues to work well on Llama3. | Model | Diversity ↑ | Coherence ↑ | Average Reward ↑ | Win Rate (%) ↑ | |---------------------------|-------------|-------------|------------------|----------------| | Prompting | **0.878** | **0.672** | 0.878 | 55.3 | | Static RE + Prompting | 0.871 | 0.669 | 0.892 | 57.0 | | CD + Prompting | 0.874 | 0.664 | 0.903 | 61.6 | | CD Prefix + Prompting | 0.869 | 0.668 | *0.907* | *62.3* | | Ours + Prompting | *0.876* | *0.671* | **0.921** | **65.6** | *Table. Performance comparison between RE-Control and other test-time alignment approaches on `SHP` using `Llama3 7B` as the backbone. The win rate is evaluated by `GPT-4` as the rate at which the model's response is rated better than the preferred response in the dataset. CD is an alias for ARGS.*

Authorsrebuttal2024-08-12

Results on Llama3

Dear Reviewer XYhX, We have added new results using Llama3 on the SHP dataset. For more details, please refer to the general response. If you have any further questions or concerns, please feel free to let us know.

Reviewer vtBo2024-08-12

Response

Thank you for your response. It addressed some of my questions, and I raised my score. > A: Actually, RE-Control is significantly faster than controlled decoding. We compared the inference times of all methods using the best hyperparameters selected on the validation set in our paper. Please refer to the inference time (in hours) column in Table 1 of our paper. Apologies for overlooking the inference time mentioned in Table 1. The results are impressive! > We suspect this is because we use LoRA for PPO and DPO, similar to the ARGS paper, which introduces approximation errors. However, we lack the computational resources to perform a direct comparison with full fine-tuning and this is exactly the motivation why we want test-time alignment methods. Thank you for the clarification. As the authors mentioned, I recommend they add a qualification to their statements in Section 6.1, such as: "Overall, the results indicate that our approach is a competitive alternative to **parameter-efficient / LoRa-based** training-time alignment methods." Without this qualification, readers might question the rigor of the experimental results. > We also want to highlight that even with LoRA, fine-tuning methods still require substantially more computing resources. For example, in our experiments, we used LoRA with rank 8 for both PPO and DPO. PPO training takes about 3 days on three A100 GPUs, while DPO takes about 1.5 days on three A100 GPUs. In contrast, training the value function only takes around 3 hours on one A100 GPU. I see. These numbers are very impressive. I suggest the authors include a similar discussion in their paper or code repository, as doing so will make the method more appealing to practitioners. > However, since PPO is an online algorithm that requires iterative training of the value function, it is hard to employ a pre-trained value function. I'm not sure I understand this. Wouldn't it be possible to take a value function trained with PPO and use it within the authors' decoding framework? This approach could allow for a more direct comparison between PPO and the authors' method, as they use the same underlying value function. A similar approach for reusing the PPO value function is discussed here: https://openreview.net/forum?id=QaODpeRaOK.

Reviewer Xnva2024-08-13

Thank you so much for the detailed response, the clarification helps.

Reviewer XYhX2024-08-14

Review update

I apologize for a delayed response and thank authors for a detailed response. Authors have answered my questions in full, suggested reasonable updates to the paper and provided additional experiments. Based on these updates, I have increased my score in the original review.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC