How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study
Organizations: School of Computer Science and Engineering, Beihang University, Beijing, China · College of Computing and Data Science, Nanyang Technological University, Singapore
Abstract
Emotion plays an important role in human cognition and performance. Motivated by this, we investigate whether analogous emotional signals can shape the behavior of large language models (LLMs) and agents. Existing emotion-aware studies mainly treat emotion as a surface-level style factor or a perception target, overlooking its mechanistic role in task processing. To address this limitation, we propose E-STEER, an interpretable emotion steering framework that enables direct representation-level intervention in LLMs and agents. It embeds emotion as a structured, controllable variable in hidden states, and with it, we examine the impact of emotion on objective reasoning, subjective generation, safety, and multi-step agent behaviors. The results reveal non-monotonic emotion-behavior relations consistent with established psychological theories, and show that specific emotions not only enhance LLM capability but also improve safety, and systematically shape multi-step agent behaviors.
Figures & tables
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Framework | Valence | Arousal | Dominance |
|---|---|---|---|
| E-STEER | 0.9816 | 0.9792 | 0.9206 |
| Prompt-level | 0.9437 | 0.9021 | 0.7756 |
Emotion Representation in Language Models
Emotion representation in language models studies how models encode, interpret, and use affective concepts such as valence, arousal, and empathy.
See all 64 papers