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.
We show that emotion vectors in LLMs are organized by a two-dimensional valence-arousal (VA) subspace exhibiting circular geometry. Through principal component decomposition and ridge regression, we recover meaningful VA axes underlying emotion steering vectors whose projections correlate with human affect ratings across 44,728 words. Steering along these axes produces monotonic control over the affective properties of generated text, and further affords bidirectional control over multiple downstream behaviors (refusal and sycophancy) from a single subspace. These effects replicate across Llama-3.1-8B, Qwen3-8B, and Qwen3-14B. We propose lexical mediation to explain why these effects and prior emotionally framed controls work: refusal and compliance tokens occupy distinct VA regions, and VA steering directly modulates their emission probabilities.
Lihao Sun, Lewen Yan, Xiaoya Lu +3
University of Chicago · Shanghai AI Lab · Harvard University
How precisely can we tell a language model how to feel? Most work on emotional generation answers with a discrete label - happy, angry, sad - which cannot express a target like "mildly downcast but calm." We instead specify the desired affect as a continuous point (v*, a*) in the Valence-Arousal plane and train the model to hit it. Our method, VA-DPO, is a small modification to Direct Preference Optimization: a frozen VA regressor scores each sampled generation by its Euclidean distance to the target, we keep only candidate pairs whose distance gap clears a margin tau, and we optimize a LoRA adapter with the ordinary DPO loss against a frozen reference. The DPO objective itself is unchanged; what is new is how the preference data is built. On Llama-3.1-8B-Instruct this cuts mean VA distance to the target by 33% over system-prompting and 25% over few-shot prompting, lifting valence/arousal correlation to r_v=0.93 and r_a=0.75. The gains carry over to Qwen3-8B and Llama-3.2-3B, and they do not come at the usual price: MMLU is unchanged (Delta=+0.0) and HellaSwag and TruthfulQA are preserved. We release the code, configs, and the preference-construction pipeline.
Large language models are routinely deployed on text that varies widely in emotional tone, yet their reasoning behavior is typically evaluated without accounting for emotion as a source of representational variation. Prior work has largely treated emotion as a prediction target, for example in sentiment analysis or emotion classification. In contrast, we study emotion as a latent factor that shapes how models attend to and reason over text. We analyze how emotional tone systematically alters attention geometry in transformer models, showing that metrics such as locality, center-of-mass distance, and entropy vary across emotions and correlate with downstream question-answering performance. To facilitate controlled study of these effects, we introduce Affect-Uniform ReAding QA (AURA-QA), a question-answering dataset with emotionally balanced, human-authored context passages. Finally, an emotional regularization framework is proposed that constrains emotion-conditioned representational drift during training. Experiments across multiple QA benchmarks demonstrate that this approach improves reading comprehension in both emotionally-varying and non-emotionally varying datasets, yielding consistent gains under distribution shift and in-domain improvements on several benchmarks.