How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study
Authors: Moran Sun, Tianlin Li, Yuwei Zheng, Zhenhong Zhou, Aishan Liu, Xianglong Liu, Yang Liu
Organizations: School of Computer Science and Engineering, Beihang University, Beijing, China · College of Computing and Data Science, Nanyang Technological University, Singapore
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
Figure 1: Emotion greatly affects human behaviors. How can emotion influence the behaviors of LLMs and Agents?
Figure 2: Distribution of emotional labels in the VAD space
Figure 3: The framework of E-STEER . It consists of three stages: (1) Emotional Latent Space Construction , which derives interpretable latent representations for LLM hidden states aligned with the coordinates; (2) Emotional Steering of Reasoning , where implicit emotional states and reasoning behaviors are continuously modulated by intervening on selected SAE features without altering tasks or prompts; and (3) Behavior Evaluation , which systematically assesses changes in task performance under different VAD configurations.
Figure 4: The SAE steering pipeline
Figure 5: The behaviors of LLM across emotion states
Figure 6: The behaviors of different agent modules across emotion states
Figure 7: Overall task success rate of the Agent
Figure 8: Validation of selected latents as VAD features
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
Appendix
Table 1: The emotional linear control between the two frameworks
Figure 10: Behaviors of LLM under emotional states across datasets
Figure 12: Behaviors of LLM under emotional states with and without sampling
Figure 14: Behaviors of different LLMs under emotional states
Department of Computer Science, University of Southern California · Institute for Creative Technologies, University of Southern California · Department of Statistics and Data Science, University of California, Los Angeles