Organizations: Gaoling School of Artificial Intelligence, Renmin University of China · Tencent Jarvis Lab · Beijing Key Laboratory of Research on Large Models and Intelligent Governance · Engineering Research Center of Next-Generation Intelligent Search and Recommendation, MOE
Large Language Models (LLMs) often produce emotionally flattened responses after alignment, limiting their effectiveness in affect-sensitive applications. In this paper, we propose EmoVec, a lightweight framework for controllable affective generation via latent vector steering. EmoVec extracts emotion-specific directions from paired neutral and emotion-conditioned responses using contrastive activation addition, and further refines them through task-specific debiasing and principal subspace removal. During inference, these vectors are injected into the final residual stream with static or scenario-adaptive scaling, enabling continuous control over emotional intensity without updating model weights. Experiments across three LLMs and eight emotions show that EmoVec consistently improves emotional salience while largely preserving semantic content, fluency, and coherence. Ablation studies and human evaluation further confirm the effectiveness of vector purification and adaptive scaling, establishing EmoVec as a practical inference-time method for affective control in deployed LLMs.
Figures & tables
Figure 1: Conceptual illustration of controllable affective generation. Through the proposed latent vector steering mechanism, the model’s output is modulated along a Happiness Gradient . This results in three distinct responses that maintain semantic consistency with the input while exhibiting progressively higher levels of emotional intensity, ranging from professional acknowledgment (Level 1) to exuberant celebration (Level 3).
Figure 2: Overview of the latent vector steering framework. The pipeline consists of (1) Emotion Vector Extraction using CAA and two stage debiasing to isolate purified signals , (2) Layer Localization via linear probing to identify the optimal intervention site at the final layer , and (3) Emotion Vector Injection into the final residual stream where intensity is dynamically modulated by a scenario adaptive adapter.
Figure 3: Prediction accuracy across layers. Text-level probing treats each response as an independent sample, while user-level probing averages representations over responses associated with the same scenario or user context before classification.
Emotion
Anger
Anticipation
Disgust
Fear
Joy
Sadness
Surprise
Trust
Avg.
Qwen2.5-7B-Instruct
w/o injection
65.14
70.50
54.69
77.80
80.25
60.30
72.10
75.55
69.54
α=5
score
67.91
71.92
55.26
83.40
84.00
63.15
75.95
78.40
72.50
η
+4.25%
+2.01%
+1.04%
+7.20%
+4.67%
+4.73%
+5.34%
+3.77%
+4.26%
α=10
score
70.18
83.42
55.52
83.38
90.50
68.20
77.20
81.10
76.19
η
+7.74%
+18.33%
+1.52%
+7.17%
+12.77%
+13.10%
+7.07%
+7.35%
+9.56%
Table 1: Evaluation of steering controllability across different emotions and model scales. The table displays absolute scores and relative gains ( η ) for three base models under varying steering magnitudes ( α ). The results demonstrate a consistent positive correlation between the steering coefficient and the resulting emotional salience.
Figure 4: Overall Performance Scaling Across Models at Different Steering Strength α .
Figure 5: Emotional Salience Scores under Varying Steering Strength (Qwen2.5-7B-Instruct).
Setting
Emotion ↑
SemSim ↑
LLM Sim. ↑
w/o injection
69.54
1.000
100.0
α=5
72.50
0.918
90.6
α=10
76.19
0.887
86.9
α=50
84.19
0.801
76.8
Table 2: Semantic preservation under different steering strengths on Qwen2.5-7B-Instruct. SemSim denotes Sentence-BERT cosine similarity, while LLM Sim. denotes GPT-4o semantic consistency scores.
Figure 6: PCA visualization of the purified emotion direction vectors ( Δ^e,t ) within the latent space.
Model
Method
CPsyCounD
Emotional Richness
Semantic Completeness
Professionalism
DeepSeek V3.1
–
69.84 ±0.12
84.68 ±0.09
78.42 ±0.06
GPT-5 mini
–
71.62 ±0.09
87.11 ±0.26
82.46 ±0.09
Gemini 2.5 Flash
–
78.75 ±0.08
91.27 ±0.02
84.89 ±0.06
Llama3.1-8B-Instruct
w/o injection
58.33 ±0.19
76.24 ±0.12
75.43 ±0.14
adaptive control
69.71 ±0.30
76.20 ±0.13
76.77 ±0.10
Table 3: Performance comparison in mental health consultation scenarios. Our method dynamically infers affective states and improves emotional richness while preserving semantic completeness and practical usefulness.
Figure 7: An example of latent affective steering in a mental health consultation scenario from CPsyCounD.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Target
Emotion-specific
Semantic Debiasing
Intensity Control
RepE ( Zou et al., 2023 )
General representations
✗
✗
partial
Activation Engineering ( Turner et al., 2023 )
General behavior
✗
✗
partial
CAA ( Rimsky et al., 2024 )
General behavior
✗
✗
partial
Style Vectors ( Konen et al., 2024 )
Style / tone
partial
✗
partial
Sentiment Steering ( Farooq et al., 2025 )
Sentiment polarity
✗
✗
partial
Persona Vectors ( Chen et al., 2025 )
Persona traits
✗
✗
partial
Appendix
Table 4: Comparison between EmoVec and representative activation steering or emotion representation methods.
Figure 8: t-SNE visualization of latent representations for Control and Depressed groups across model layers. (a) At Layer 0, the representations of the two groups are heavily entangled, indicating no explicit affective structuring. (b) By Layer 28, the hidden states exhibit distinct clusters. This divergence demonstrates the progressive crystallization of affective information as it processed through the transformer architecture.
Controllable text generation steers language models toward desired attributes, formats, audiences, and constraints while preserving useful, natural text.