Table of Contents
Fetching ...

How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study

Moran Sun, Tianlin Li, Yuwei Zheng, Zhenhong Zhou, Aishan Liu, Xianglong Liu, Yang Liu

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.

How Emotion Shapes the Behavior of LLMs and Agents: A Mechanistic Study

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.

Paper Structure

This paper contains 28 sections, 7 equations, 11 figures, 1 table.

Figures (11)

  • 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
  • ...and 6 more figures