Can Generative Agents Predict Emotion?

Ciaran Regan, Nanami Iwahashi, Shogo Tanaka, Mizuki OkaarXiv 2024 · DOI · arXiv

Abstract

While Large Language Models (LLMs) demonstrate significant capabilities in "Theory of Mind" (ToM), they frequently fail to align their emotional responses with those of humans. This paper introduces a novel agent architecture that integrates episodic memory and Appraisal Theory to establish a "norm" of past experiences. This allows agents to evaluate new events within a historical context rather than as isolated occurrences. Our findings suggest that while this architecture improves emotional alignment and reduces inherent positive bias, significant gaps in emotional intensity persist compared to human baselines.

Introduction: The Challenge of Emotional Alignment

Current LLMs are surprisingly adept at tracking the intentions and beliefs of others. However, they struggle with emotional alignment—the ability to react to a situation with the same type and intensity of emotion a human would. A primary reason for this gap is that LLMs typically process events as isolated snapshots.

In contrast, human emotion is deeply rooted in context and history. For example, a quiet, empty park might feel "peaceful" to someone seeking solitude, but "lonely" or "eerie" to someone who just saw it bustling with life moments ago. Without a sense of "normalcy" derived from past experiences (episodic memory), AI agents cannot accurately simulate human-like emotional dynamics.

Methodology: Appraisal-Based Architecture

The researchers proposed a new architecture designed to mimic the human cognitive process of "appraisal." The workflow follows a structured sequence to move from raw perception to contextual affect measurement:

  1. Perception: The agent receives a new experience as text.
  2. Norm Creation: The agent retrieves relevant past memories and uses GPT-4 to generate a "norm"—a summary of what is considered "usual" or "expected" based on its history.
  3. Contextual Understanding: The agent compares the new experience to this norm to highlight deviations.
  4. Affect Measurement: To quantify the agent's "feelings," the researchers administered the PANAS (Positive and Negative Affect Schedule), a standard psychological test consisting of 20 emotions rated on a Likert scale.
  5. Memory Storage: The new experience is stored in a graph database to inform future norms.
Figure 1: A visual representation of the temporal sequence used to establish a 'norm' (playing soccer) before introducing a contrasting event (empty park).

To test this, GPT-3.5-Turbo served as the subject, while GPT-4 was used to generate the contextual stories and norms.

Experimental Setup and Datasets

The study utilized EmotionBench, a dataset containing over 400 situations known to elicit specific human emotions. Because EmotionBench situations are typically single sentences, the authors used GPT-4 with "Chain of Thought" prompting to expand them into 5-scene stories. This provided the temporal dimension necessary to observe how an agent's emotional state evolves as a narrative progresses.

Key Insights: The "Norm" as a Cognitive Filter

The core finding is that emotion is not just a reaction to an event, but a reaction to the deviation from a baseline. By forcing the LLM to explicitly define a "norm" before assessing an event, the researchers nudged the model toward more human-like appraisals.

In scenarios involving family conflict or seasonal depression, the "With Norm" architecture allowed the agent to recognize the gravity of a situation—such as a physical fight escalating—that an agent without context might view as a neutral interaction. However, the study also confirmed the "Pollyanna Problem": a persistent positive bias in LLMs. Even in negative scenarios, models like GPT-3.5 often interpreted ambiguous silence as "appreciation" rather than "anxiety."

Results and Quantitative Analysis

The quantitative results were mixed but promising:

  • Improved Negative Affect: Agents using the "Norm" architecture showed a greater increase in negative affect scores (+1.6) compared to those without context (+0.3) in negative scenarios.
  • Decreased Positive Affect: The "With Norm" agents showed a significant drop in positive affect (-18.0) in negative situations, suggesting they were "less happy" about bad events than the baseline agents.
  • Alignment Gaps: Despite improvements, agents fell short of human-level intensity for negative emotions. The decrease in positive affect was much more pronounced than the increase in negative affect, indicating that models are better at "losing joy" than "feeling pain."

Conclusion and Future Work

This research serves as a stepping stone toward creating AI companions and NPCs that can relate to the history and context of human emotional life. Future work must address model-specific biases (potentially by testing open-source models like Llama or Mistral), the scalability of memory retrieval, and the need for direct human validation to judge the authenticity of simulated emotions.

Summary updated

Abstract

Large Language Models (LLMs) have demonstrated a number of human-like abilities, however the empathic understanding and emotional state of LLMs is yet to be aligned to that of humans. In this work, we investigate how the emotional state of generative LLM agents evolves as they perceive new events, introducing a novel architecture in which new experiences are compared to past memories. Through this comparison, the agent gains the ability to understand new experiences in context, which according to the appraisal theory of emotion is vital in emotion creation. First, the agent perceives new experiences as time series text data. After perceiving each new input, the agent generates a summary of past relevant memories, referred to as the norm, and compares the new experience to this norm. Through this comparison we can analyse how the agent reacts to the new experience in context. The PANAS, a test of affect, is administered to the agent, capturing the emotional state of the agent after the perception of the new event. Finally, the new experience is then added to the agents memory to be used in the creation of future norms. By creating multiple experiences in natural language from emotionally charged situations, we test the proposed architecture on a wide range of scenarios. The mixed results suggests that introducing context can occasionally improve the emotional alignment of the agent, but further study and comparison with human evaluators is necessary. We hope that this paper is another step towards the alignment of generative agents.
BibTeX
@misc{regan2024can,
  author = {Ciaran Regan and Nanami Iwahashi and Shogo Tanaka and Mizuki Oka},
  title = {{Can Generative Agents Predict Emotion?}},
  year = {2024},
  eprint = {2402.04232},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.04232},
}
Figure