Aligning Large Language Models with Representation Editing: A Control Perspective

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Kong, Lingkai, Wang, Haorui, Mu, Wenhao, Du, Yuanqi, Zhuang, Yuchen, Zhou, Yifei, Song, Yue, Zhang, Rongzhi, Wang, Kai, Zhang, Chao
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915002263273472
author Kong, Lingkai
Wang, Haorui
Mu, Wenhao
Du, Yuanqi
Zhuang, Yuchen
Zhou, Yifei
Song, Yue
Zhang, Rongzhi
Wang, Kai
Zhang, Chao
author_facet Kong, Lingkai
Wang, Haorui
Mu, Wenhao
Du, Yuanqi
Zhuang, Yuchen
Zhou, Yifei
Song, Yue
Zhang, Rongzhi
Wang, Kai
Zhang, Chao
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2406_05954
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Aligning Large Language Models with Representation Editing: A Control Perspective
Kong, Lingkai
Wang, Haorui
Mu, Wenhao
Du, Yuanqi
Zhuang, Yuchen
Zhou, Yifei
Song, Yue
Zhang, Rongzhi
Wang, Kai
Zhang, Chao
Artificial Intelligence
Machine Learning
Systems and Control
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.
title Aligning Large Language Models with Representation Editing: A Control Perspective
topic Artificial Intelligence
Machine Learning
Systems and Control
url https://arxiv.org/abs/2406.05954