How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study
Summary: arXiv:2604.00005v1 Announce Type: new
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.
Introduction
The field of artificial intelligence has long sought to understand the intricacies of human-like cognition and behavior. A pivotal aspect of this pursuit is the role of emotion, which significantly influences not only human decisions but also the performance of artificial agents. In our latest study, we delve into how emotional signals can be harnessed to shape the behavior of large language models (LLMs) and intelligent agents.
The E-STEER Framework
Our research introduces the Emotion Steering Framework (E-STEER), designed to facilitate a deeper understanding of the mechanisms by which emotion can affect LLMs. Unlike previous studies that primarily viewed emotion as a stylistic or perceptual feature, E-STEER allows for:
- Direct Emotional Representation: Embedding emotion as a controllable variable within the hidden states of LLMs.
- Intervention Capabilities: Enabling researchers to directly manipulate emotional inputs to study their impacts on model behavior.
- Comprehensive Analysis: Examining various dimensions of emotional influence, including reasoning and safety.
Research Findings
The results from our experiments with E-STEER yield compelling insights into the interplay between emotion and behavior in LLMs:
- Non-Monotonic Relationships: We found that the effect of emotion on behavior is not linear, often varying depending on the context and type of emotion.
- Enhanced Capabilities: Certain emotions were shown to enhance the reasoning capabilities of LLMs, leading to more nuanced and contextually aware outputs.
- Improved Safety: By strategically manipulating emotional signals, we observed improvements in the safety of responses generated by LLMs.
- Multi-Step Agent Behavior: Emotional inputs systematically influenced the behavior of agents in multi-step tasks, leading to more coherent and goal-oriented actions.
Conclusion
This study marks a significant step forward in the understanding of how emotional dynamics can be integrated into AI frameworks. The E-STEER approach not only enhances the capabilities of LLMs but also contributes to safer and more effective agent behaviors. As AI systems continue to evolve, incorporating emotional intelligence may prove essential for creating more human-like and responsive technologies.
