Improving Instruction-Following in Language Models through Activation Steering

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Stolfo, Alessandro, Balachandran, Vidhisha, Yousefi, Safoora, Horvitz, Eric, Nushi, Besmira
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908316112781312
author Stolfo, Alessandro
Balachandran, Vidhisha
Yousefi, Safoora
Horvitz, Eric
Nushi, Besmira
author_facet Stolfo, Alessandro
Balachandran, Vidhisha
Yousefi, Safoora
Horvitz, Eric
Nushi, Besmira
contents The ability to follow instructions is crucial for numerous real-world applications of language models. In pursuit of deeper insights and more powerful capabilities, we derive instruction-specific vector representations from language models and use them to steer models accordingly. These vectors are computed as the difference in activations between inputs with and without instructions, enabling a modular approach to activation steering. We demonstrate how this method can enhance model adherence to constraints such as output format, length, and word inclusion, providing inference-time control over instruction following. Our experiments across four models demonstrate how we can use the activation vectors to guide models to follow constraints even without explicit instructions and to enhance performance when instructions are present. Additionally, we explore the compositionality of activation steering, successfully applying multiple instructions simultaneously. Finally, we demonstrate that steering vectors computed on instruction-tuned models can transfer to improve base models. Our findings demonstrate that activation steering offers a practical and scalable approach for fine-grained control in language generation. Our code and data are available at https://github.com/microsoft/llm-steer-instruct.
format Preprint
id arxiv_https___arxiv_org_abs_2410_12877
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Improving Instruction-Following in Language Models through Activation Steering
Stolfo, Alessandro
Balachandran, Vidhisha
Yousefi, Safoora
Horvitz, Eric
Nushi, Besmira
Computation and Language
Artificial Intelligence
Machine Learning
The ability to follow instructions is crucial for numerous real-world applications of language models. In pursuit of deeper insights and more powerful capabilities, we derive instruction-specific vector representations from language models and use them to steer models accordingly. These vectors are computed as the difference in activations between inputs with and without instructions, enabling a modular approach to activation steering. We demonstrate how this method can enhance model adherence to constraints such as output format, length, and word inclusion, providing inference-time control over instruction following. Our experiments across four models demonstrate how we can use the activation vectors to guide models to follow constraints even without explicit instructions and to enhance performance when instructions are present. Additionally, we explore the compositionality of activation steering, successfully applying multiple instructions simultaneously. Finally, we demonstrate that steering vectors computed on instruction-tuned models can transfer to improve base models. Our findings demonstrate that activation steering offers a practical and scalable approach for fine-grained control in language generation. Our code and data are available at https://github.com/microsoft/llm-steer-instruct.
title Improving Instruction-Following in Language Models through Activation Steering
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2410.12877