Skip to main content
QUICK REVIEW

[Paper Review] Semantics-Adaptive Activation Intervention for LLMs via Dynamic Steering Vectors

Weixuan Wang, Yang Jing-yuan|arXiv (Cornell University)|Oct 16, 2024
Natural Language Processing TechniquesComputer Science3 citations
TL;DR

This paper proposes Semantics-Adaptive Dynamic Intervention (SADI), a novel activation intervention method that dynamically generates steering vectors at inference time based on input semantics, using activation differences from contrastive pairs to identify critical model components. SADI significantly improves performance across 11 diverse benchmarks on four LLM backbones without any fine-tuning, achieving up to +14.69% accuracy gain over baselines.

ABSTRACT

Large language models (LLMs) have achieved remarkable performance across many tasks, yet aligning them with desired behaviors remains challenging. Activation intervention has emerged as an effective and economical method to modify the behavior of LLMs. Despite considerable interest in this area, current intervention methods exclusively employ a fixed steering vector to modify model activations, lacking adaptability to diverse input semantics. To address this limitation, we propose Semantics-Adaptive Dynamic Intervention (SADI), a novel method that constructs a dynamic steering vector to intervene model activations at inference time. More specifically, SADI utilizes activation differences in contrastive pairs to precisely identify critical elements of an LLM (i.e., attention heads, hidden states, and neurons) for targeted intervention. During inference, SADI dynamically steers model behavior by scaling element-wise activations based on the directions of input semantics. Experimental results show that SADI outperforms established baselines by substantial margins, improving task performance without training. SADI's cost-effectiveness and generalizability across various LLM backbones and tasks highlight its potential as a versatile alignment technique.

Motivation & Objective

  • Address the limitation of fixed steering vectors in activation engineering, which fail to adapt to diverse input semantics during inference.
  • Develop a low-cost, training-free method to improve LLM behavior alignment by dynamically modifying model activations based on input context.
  • Enable generalization across different model architectures, tasks, and few-shot settings through adaptive intervention on attention heads, hidden states, and feed-forward neurons.
  • Demonstrate effectiveness with minimal data, requiring only 150 contrastive examples to construct a dynamic steering vector.
  • Provide a reusable, general-purpose alignment technique that enhances model performance across multiple NLP tasks and multilingual settings.

Proposed method

  • Extract activation differences between positive and negative contrastive pairs across all model layers to identify critical model components (attention heads, hidden states, neurons).
  • Compute the mean activation difference per layer and apply binarization to generate a binary mask identifying key elements for intervention.
  • During inference, apply the dynamic steering vector by element-wise scaling of input activations using the mask and a learnable factor δ.
  • Apply the intervention to multiple components: SADI-Head (attention heads), SADI-Hidden (hidden states), and SADI-Neuron (FFN neurons).
  • Use contrastive pairs from standard benchmarks to train the dynamic steering mechanism without updating model weights.
  • Ensure generalizability by testing across diverse LLM backbones (LLaMA2-7b-chat, BLOOMZ-7b, Mistral-7b, Falcon-7b-instruct) and multilingual setups.

Experimental results

Research questions

  • RQ1Can a dynamic steering vector that adapts to input semantics outperform fixed steering vectors in activation intervention?
  • RQ2How effective is SADI in improving LLM performance across diverse NLP tasks without any fine-tuning?
  • RQ3What is the minimal data requirement for constructing an effective dynamic steering vector using contrastive pairs?
  • RQ4Does SADI generalize across different LLM architectures, few-shot settings, and multilingual scenarios?
  • RQ5Which model components (attention heads, neurons, hidden states) are most responsive to dynamic activation intervention?

Key findings

  • SADI significantly outperforms existing activation intervention baselines, achieving up to +14.69% accuracy improvement on the StoryCloze benchmark.
  • SADI-Head, which intervenes on attention heads, consistently delivers the most substantial performance gains across all evaluated tasks.
  • SADI achieves optimal performance with only 150 contrastive examples, demonstrating high data efficiency compared to fine-tuning methods.
  • The method generalizes effectively across four distinct LLM backbones and multiple few-shot settings, maintaining consistent improvements.
  • SADI enhances performance across multilingual tasks, with the highest gains observed in Indonesian and consistent improvements across eight languages.
  • Activation difference patterns show that latter layers are most sensitive to intervention, aligning with the functional segregation hypothesis of LLMs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.