Generating and Validating Agent and Environment Code for Simulating Realistic Personality Profiles with Large Language Models

Nathan Cloos, M Ganesh Kumar, Adam Manoogian, Christopher J Cueva, Shawn A. RhoadsFM4Science @ NeurIPS 2024

TL;DR

This paper introduces a novel pipeline that uses Large Language Models (LLMs) to automatically generate both simulated environments and agent behaviors, specifically designed to reflect realistic personality profiles. By leveraging LLMs to create not only the agent's actions but also the code to validate its personality, this work offers a scalable approach to studying complex agent-environment interactions and their link to individual traits.

What Problem Does This Paper Address?

Creating diverse and scalable simulated environments for AI agents has been a significant hurdle, often requiring extensive manual effort. In fields like behavioral and cognitive science, understanding how personality traits predict behavior is crucial, but traditional methods involving carefully designed cognitive tasks are difficult to scale and require substantial human validation. This paper tackles the challenge of automating both environment generation and the validation of agent personalities within those environments, aiming to bridge the gap between AI simulation capabilities and the nuanced study of human behavior.

Methods

The core of this work is a three-stage pipeline:

  1. Generation: LLMs are used to generate three key components:
  2. Activity List: A diverse set of 100 common activities that reflect various HEXACO personality traits.
  3. Policy Code: Code that dictates an agent's behavior, determining which activity it chooses based on its personality profile.
  4. Evaluation Code: Code designed to assess how well an agent's observed activities align with its assigned personality, by generating responses to HEXACO personality inventory questions.
  5. Simulation: Agents are assigned personality profiles sampled from real-world human data. The generated policy code then simulates the agent's actions over a series of timesteps, with each timestep involving the selection of one activity.
  6. Evaluation: The LLM-generated evaluation code analyzes the sequence of activities performed by the simulated agent. It outputs scores for each HEXACO personality question, allowing for the recovery of the agent's personality profile. The consistency between the original and recovered personality profiles is then measured.

The authors specifically use Claude 3.5 Sonnet as their LLM and base their personality assessment on the HEXACO personality inventory, a well-established model measuring six major personality factors.

Datasets

The paper does not explicitly mention training datasets for the LLMs. For sampling agent personality profiles, they utilize "statistics from empirical data" to ensure the distributions of traits align with real-world statistics. These statistics are derived from the HEXACO personality inventory, with specific references to data from 1126 participants for the self-report form.

Key Insights and Ideas

  • LLMs as Generative Tools for Both Environment and Validation: The most significant insight is the successful use of LLMs not just to create agent behaviors (policy code) and environments (activity lists), but also to generate the validation mechanism itself (evaluation code). This creates a self-contained, automated pipeline.
  • Grounding LLM-Generated Behaviors in Personality: The work demonstrates that LLM-generated policies can indeed simulate agents with distinct personality profiles, and that these profiles can be recovered from their simulated actions. This suggests LLMs can capture nuanced behavioral patterns linked to personality.
  • Context is Crucial for LLM Prompting: The paper highlights that the quality and type of contextual information provided in LLM prompts significantly impact the effectiveness of the generated activities and, consequently, the recoverability of personality profiles. Specifically, a lack of contextual information about personality traits or questions leads to a failure in the pipeline.

Key Results

  • Successful Personality Recovery: The LLM-generated pipeline successfully simulates and recovers distinct personality profiles, such as extroverted and introverted agents, as visualized in Figure 2. The correlation between original and recovered personality traits is shown to be strong across multiple profiles (Figure 3).
  • Diverse Agent Simulation: The pipeline can simulate a wide range of personality profiles by sampling minimum and maximum values for HEXACO factors, leading to distinct behavioral patterns (Figure 3, left).
  • Impact of Prompting: The study found that providing contextual information about HEXACO personality traits or questions in the LLM prompts significantly improves personality recoverability. Conversely, prompts lacking this context lead to a failure in the pipeline (Figure 4).

Limitations and Future Work

  • Lack of Realistic Transition Dynamics: The current simulations treat each timestep independently, meaning the history of activities doesn't influence future choices. This limits the capture of more complex, sequential behavioral patterns. Future work could incorporate transition probabilities to better reflect real-world dependencies.
  • Evaluation Tied to Personality Inventory: The current evaluation method relies on activities derived from the personality inventory itself. Future research aims to recover personality profiles from agents engaging in independently generated activities, further decoupling the generation and evaluation processes.
  • Variability in LLM Outputs: Even with identical prompts, there can be substantial variability in personality recoverability when sampling multiple LLM outputs. This suggests a need for more robust prompting strategies or fine-tuning.

Despite these limitations, the authors believe their approach holds significant promise for discovery-oriented cognitive science, enabling scalable simulations and data-driven insights into the interplay between traits and behavior.

Summary updated

BibTeX
@inproceedings{cloos2024generating,
  author = {Nathan Cloos and M Ganesh Kumar and Adam Manoogian and Christopher J Cueva and Shawn A. Rhoads},
  title = {{Generating and Validating Agent and Environment Code for Simulating Realistic Personality Profiles with Large Language Models}},
  booktitle = {FM4Science @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=oeIvS0ULNl},
}
Figure