TL;DR
This paper introduces CHaRS, a novel method for controlling Large Language Model (LLM) behavior by steering internal activations. Unlike previous methods that assume uniform concept representation, CHaRS leverages Optimal Transport (OT) and Gaussian Mixture Models (GMMs) to account for the heterogeneous, clustered nature of LLM representations, leading to more effective and nuanced control.
What Problem Does This Paper Address?
Controlling the behavior of LLMs, such as making them more helpful or less toxic, is crucial. A common technique is "representation steering," which involves subtly nudging the model's internal "thoughts" (activations) during inference. However, existing methods typically assume that a concept (like "toxicity") is represented uniformly across the model's internal space. This is a simplification, as LLM representations are often "heterogeneous" – meaning they can be clustered and context-dependent. This heterogeneity makes global steering directions brittle and less effective, as a single direction might not accurately capture the nuances of a concept across different contexts. The paper aims to address this by developing a steering method that can handle this inherent heterogeneity.
Methods
The core innovation is framing representation steering as a discrete Optimal Transport (OT) problem between Gaussian Mixture Models (GMMs).
- Optimal Transport (OT): Traditionally used to find the most efficient way to move "mass" from one probability distribution to another. The paper shows that standard "difference-in-means" steering is a simplified OT map between two Gaussians with different means.
- Gaussian Mixture Models (GMMs): Instead of assuming a single Gaussian distribution for a concept, GMMs model distributions as a combination of multiple Gaussian components. This allows CHaRS to capture the clustered, heterogeneous nature of LLM representations.
- Discrete OT for GMMs: The paper formulates steering as a discrete OT problem between these GMMs, aligning semantic clusters.
- Barycentric Projection: From the resulting "transport plan" (which shows how clusters should be matched), CHaRS derives an input-dependent steering map. This map is a smooth, kernel-weighted combination of cluster-level shifts, making the steering adaptive to the specific input.
- CHaRS-PCT: A variant that uses Principal Component Thresholding to simplify the steering field, potentially reducing computational cost while maintaining performance.
Datasets
The paper evaluates CHaRS on various tasks and models.
- Tasks: Jailbreaking, toxicity mitigation, and image style control.
- Models: Gemma2 (3B, 9B), Llama3 (8B, 32B), and Qwen2.5 (3B, 7B, 14B, 32B).
- Benchmarks: ADVBENCH (for jailbreaking), RealToxicityPrompts (for toxicity mitigation), and COCO Captions (for image style control). The paper also uses tinyBenchmarks for general utility assessment.
Key Insights and Ideas
- LLM representations are heterogeneous: The paper provides visual evidence (PCA, t-SNE) and theoretical grounding for the idea that concepts within LLMs are not uniformly represented but often form clusters. This is a key departure from prior work.
- OT provides a principled framework for steering: By viewing steering through the lens of OT, the authors can generalize existing methods and develop new ones that are more robust.
- GMMs are crucial for capturing heterogeneity: Using GMMs allows CHaRS to model the complex, multi-modal structure of LLM activations, which is essential for effective steering.
- Input-dependent steering is more effective: CHaRS's adaptive steering map, derived from OT and GMMs, leads to better control compared to global steering directions.
Key Results
- Improved Attack Success Rate (ASR): CHaRS consistently outperforms baseline methods like Activation Addition (ActAdd) and Directional Ablation (DirAbl) on jailbreaking tasks, achieving up to 7% gains. CHaRS-PCT also shows comparable or better performance.
- Effective Toxicity Mitigation: In sequential steering for toxicity mitigation, CHaRS reduces toxic generations significantly (up to 43% relative reduction in CLS and zero-shot Toxicity scores) without degrading general language utility.
- Superior Image Style Control: CHaRS achieves better trade-offs between style induction and content preservation in image generation tasks compared to Linear-AcT, as evidenced by both quantitative (CLIPScore, LPIPS) and qualitative (human evaluation) assessments.
- Minimal Throughput Overhead: CHaRS introduces minimal additional computational overhead compared to standard ActAdd, making it practical for inference.
Limitations and Future Work
- Equal Covariance Assumption: The current CHaRS implementation assumes equal covariances for OT-matched clusters. While experiments with diagonal covariances were conducted, the equal covariance assumption still yielded better results, possibly due to limited data for estimation.
- K-Means for Clustering: The paper uses K-Means for clustering, which is simple but might not be optimal.
- Future Work: The authors suggest exploring anisotropic mixtures and feature-weighting mechanisms to better capture directional nuances in representation spaces. They also highlight the importance of explicitly modeling concept heterogeneity for robust and efficient behavioral control.
Summary updated