Large language models (LLMs) have revolutionized natural language processing tasks; however, their general-purpose nature limits their performance in specialized applications, such as customer service chatbots. Moreover, LLMs struggle with controllability, making it challenging to generate responses that consistently align with user-defined intents or emotional tones. This paper explores a novel approach to steering LLM output toward desired sentiments by manipulating their internal activations during response generation. We investigate activation engineering techniques to identify steering vectors corresponding to specific sentiments and integrate them into the LLM's hidden states during inference. This method enables fine-grained control over the model's output without the computational cost of full retraining. We evaluate our approach on the YELP dataset, leveraging both training-based and mean activation-based steering vectors. Our results demonstrate superior performance in influencing the sentiment of generated text compared to existing state-of-the art techniques. Furthermore, our experiments show that the training-based steering vector provides a computationally efficient and highly effective solution for sentiment control in conversational AI, achieving high accuracy in generated responses. The proposed approach enhances the steerability of LLMs, offering a robust framework for emotion-aware AI systems.
Paper
Full text
Sentiment Steering in Large Language Models via Activation Vector Manipulation
Semantic Scholar · Computer Science · 2025
Abstract
Large language models (LLMs) have revolutionized natural language processing tasks; however, their general-purpose nature limits their performance in specialized applications, such as customer service chatbots. Moreover, LLMs struggle with controllability, making it challenging to generate responses that consistently align with user-defined intents or emotional tones. This paper explores a novel approach to steering LLM output toward desired sentiments by manipulating their internal activations during response generation. We investigate activation engineering techniques to identify steering vectors corresponding to specific sentiments and integrate them into the LLM's hidden states during inference. This method enables fine-grained control over the model's output without the computational cost of full retraining. We evaluate our approach on the YELP dataset, leveraging both training-based and mean activation-based steering vectors. Our results demonstrate superior performance in influencing the sentiment of generated text compared to existing state-of-the art techniques. Furthermore, our experiments show that the training-based steering vector provides a computationally efficient and highly effective solution for sentiment control in conversational AI, achieving high accuracy in generated responses. The proposed approach enhances the steerability of LLMs, offering a robust framework for emotion-aware AI systems.