Overview
Large Language Models (LLMs) frequently exhibit emotionally flattened responses following alignment processes, which can diminish their utility in applications that are sensitive to affect. To address this, a framework named EmoVec has been proposed. EmoVec is designed for controllable affective generation through the steering of latent vectors within LLMs. This framework operates by extracting emotion-specific directions and subsequently refining them. During inference, these refined vectors are introduced into the final residual stream, allowing for continuous control over emotional intensity without necessitating modifications to the underlying model weights.
Research Context
The operational context for EmoVec stems from the observation that Large Language Models, after undergoing alignment procedures, often generate responses characterized by emotional flatness. This characteristic restricts their effectiveness in contexts where the expression or understanding of affect is crucial for successful application. The challenge lies in enabling LLMs to produce responses with controlled emotional content while maintaining their core linguistic qualities.
Approach
The EmoVec framework employs a multi-step approach for controllable affective generation:
- Emotion-Specific Direction Extraction: EmoVec initiates the process by extracting emotion-specific directions. This is achieved through the use of contrastive activation addition, applied to paired neutral and emotion-conditioned responses.
- Vector Refinement: Subsequent to extraction, these directions undergo a refinement phase. This phase incorporates task-specific debiasing and principal subspace removal, aimed at purifying the extracted vectors.
- Inference-Time Injection: During the inference stage, the refined vectors are injected into the final residual stream of the LLM.
- Intensity Control: The injection can be performed with either static or scenario-adaptive scaling. This scaling mechanism facilitates continuous control over the emotional intensity of the generated output without requiring any updates to the model weights themselves.
Findings
Experimental evaluations of the EmoVec framework yielded several key findings:
- Broad Applicability: EmoVec was tested across three distinct Large Language Models (LLMs) and eight different emotions, demonstrating its generalizability.
- Emotional Salience Improvement: The framework consistently improved the emotional salience of the generated responses.
- Semantic and Fluency Preservation: Alongside enhanced emotional content, EmoVec largely preserved the semantic content, fluency, and coherence of the LLM outputs.
- Effectiveness of Purification and Scaling: Ablation studies and human evaluation provided further confirmation regarding the effectiveness of two specific components: the vector purification process and the adaptive scaling mechanism.
These findings collectively establish EmoVec as a practical method for achieving affective control in deployed LLMs during the inference phase.
Why This Matters
The development of EmoVec is significant because current Large Language Models, post-alignment, often produce emotionally flattened responses. This limitation reduces their utility in affect-sensitive applications where nuanced emotional expression is necessary. EmoVec offers a method to enhance the emotional salience of LLM outputs while maintaining other critical linguistic qualities, making these models more effective for such applications.