Efficient and accurate steering of Large Language Models through attention-guided feature learning
Parmida Davarmanesh, Ashia Wilson, Adityanarayanan Radhakrishnan
TL;DR
This work addresses how to reliably steer large language models by learning concept vectors from attention to prompt prefixes. It introduces an attention-guided framework that (i) dynamically selects token embeddings based on attention to the activating prefix, (ii) uses soft labels derived from token-attention for per-block concept-vector learning, and (iii) employs permutation testing to identify concept-enriched layers for steering. The method yields substantial improvements over prior work, achieving about $95\%$ steerability on a $512$-concept benchmark with Llama-3.1-8b and generalizing to models up to $70$B parameters, while revealing heterogeneous distribution of concept features across layers. This approach offers a scalable path toward efficient fine-tuning and deeper understanding of how semantic concepts are represented in industry-scale LLMs.
Abstract
Steering, or direct manipulation of internal activations to guide LLM responses toward specific semantic concepts, is emerging as a promising avenue for both understanding how semantic concepts are stored within LLMs and advancing LLM capabilities. Yet, existing steering methods are remarkably brittle, with seemingly non-steerable concepts becoming completely steerable based on subtle algorithmic choices in how concept-related features are extracted. In this work, we introduce an attention-guided steering framework that overcomes three core challenges associated with steering: (1) automatic selection of relevant token embeddings for extracting concept-related features; (2) accounting for heterogeneity of concept-related features across LLM activations; and (3) identification of layers most relevant for steering. Across a steering benchmark of 512 semantic concepts, our framework substantially improved steering over previous state-of-the-art (nearly doubling the number of successfully steered concepts) across model architectures and sizes (up to 70 billion parameter models). Furthermore, we use our framework to shed light on the distribution of concept-specific features across LLM layers. Overall, our framework opens further avenues for developing efficient, highly-scalable fine-tuning algorithms for industry-scale LLMs.
