FlashPapers
UIST 2023 Interactive AI LLM Agents

Generative Agents: Interactive Simulacra of Human Behavior

Authors: Joon Sung Park, Joseph C. O'Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, Michael S. Bernstein
Institution: Stanford University, Google Research, Google DeepMind (2023)

TL;DR

This paper introduces computational agents that simulate believable human behavior. By combining a Large Language Model (LLM) with a novel interactive architecture, these agents store a complete record of experiences, synthesize them over time into high-level reflections, and dynamically retrieve them to plan, react, and interact within a sandbox environment reminiscent of The Sims.

Why This Matters

For decades, creating believable virtual characters has required immense manual scripting. Game developers and social scientists had to hardcode every potential interaction, conversation, and reaction. If you wanted a virtual town to host a Valentine's Day party, you had to manually coordinate each character's schedule, dialogue, and movement.

While LLMs excel at generating realistic text in single-turn prompts, they suffer from a lack of long-term coherence. They cannot manage a constantly growing stream of memories, handle cascading social dynamics, or execute complex, multi-step daily plans without losing track of their identity and relationships.

Generative Agents solve this constraint by bridging the gap between raw LLM reasoning and structured, stateful memory.

The Big Idea

The core contribution of this work is an agent architecture that extends a large language model to maintain a stateful, natural-language record of its life. Instead of trying to feed an agent's entire history into the prompt context window (which is impossible), the architecture dynamically retrieves, reflects, and plans using three primary modules:

The Perception-Action-Reflection Loop

Perceive Senses environment & events
Core Memory Stream Retrieval & Storage
Act / Plan Decomposes behaviors
Reflection Module periodically synthesizes memories into higher-level insights.

How It Works: The Core Architecture

1. Memory & Retrieval

The memory stream is a comprehensive database of the agent's experiences, logged in natural language. To query this memory stream, the architecture implements a retrieval function that scores each memory object using three key metrics:

  • Recency: Exponentially decays over the number of sandbox hours since the memory was last accessed ($Decay\ Factor = 0.995$).
  • Importance: A poignant score (1 to 10) generated by prompting the LLM directly to rate how mundane or critical the memory is.
  • Relevance: Cosine similarity between the embedding vector of the memory text and the query vector.
$$Score = w_{rec} \cdot Recency + w_{imp} \cdot Importance + w_{rel} \cdot Relevance$$
W1

Interactive Retrieval Engine Simulator

Adjust the weight sliders below to see how the agent's context changes which memories get retrieved from the stream.

Weights Configuration
Recency Weight ($w_{rec}$) 1.0
Importance Weight ($w_{imp}$) 1.0
Relevance Weight ($w_{rel}$) 1.0
Retrieved Memory Stream (Ranked)

2. The Reflection Engine

Generative agents equipped only with raw observational memory struggle to generalize. If Klaus Mueller is asked who he wants to spend time with, he might choose Wolfgang simply because they cross paths often, even if those interactions are shallow.

To solve this, the architecture periodically triggers reflections: higher-level, abstract thoughts generated by prompting the LLM with the agent's 100 most recent records. These reflections are stored as memory objects, creating a multi-tiered, recursive tree of insights.

W2

Interactive Reflection Tree Visualizer

Hover over or tap any node to see how raw observations are recursively synthesized into abstract insights.

Level 2 Reflection (Root)
Level 1 Reflection A
Level 1 Reflection B
Obs A: Reading Gentrification
Obs B: Taking Notes
Obs C: Discussing with Wolfgang
Obs D: Talking with Ayesha
Node Content / LLM Synthesis

Hover over or tap any element in the tree above to view details of the agent's cognitive synthesis.

3. Recursive Planning & Reacting

Believable behavior requires consistent planning over long horizons. If prompted hour-by-hour, an LLM might make an agent eat lunch at 12:00 PM, 12:30 PM, and 1:00 PM because it forgets its immediate past.

The architecture constructs plans top-down and then recursively decomposes them:

  1. Broad Strokes: Create a daily agenda (e.g., "Wake up, go to college, work on music composition, have dinner").
  2. Hourly Decompositions: Chunk major phases into smaller blocks (e.g., "1:00 PM to 5:00 PM: Brainstorm music ideas").
  3. Minute-by-Minute Decompositions: Refine actions into 5-15 minute increments (e.g., "4:00 PM: Grab a light snack", "4:05 PM: Take a short walk").
W3

Decomposition & Reaction Simulator

Simulate Eddy Lin's plan decomposition. Trigger an environmental event to see how the agent dynamically updates its schedule.

Eddy Lin's Active Agenda Wednesday, Feb 13
[Broad Stroke Plan]

1:00 PM - 5:00 PM: Work on music composition project

[Hourly Decomposition]

4:00 PM - 5:00 PM: Take a short break & refresh creative energy

[Minute-by-Minute Actions]
4:00 PM: Grab a light snack (granola bar) Done
4:05 PM: Take a short walk around the garden Active
4:50 PM: Clean up workspace Pending
Simulate Interruption

As Eddy is walking in the garden, his father John approaches him.

Evaluation & Results

The authors evaluated the believability of the generative agents using a controlled within-subjects study with 100 human evaluators. They compared the full architecture against various ablations and a human crowdworker baseline.

Believability Evaluation (TrueSkill Rating)

Full Architecture (Memory + Reflection + Planning) 29.89 ± 0.72
No Reflection (Memory + Planning) 26.88 ± 0.69
No Reflection, No Planning (Memory Only) 25.64 ± 0.68
Human Crowdworker Baseline 22.95 ± 0.69
No Observation, Reflection, or Planning (Standard LLM) 21.21 ± 0.70

Higher TrueSkill indicates higher human-rated believability. The full architecture statistically outperforms all baselines ($p < 0.001$).

Mayoral Race Awareness
4% → 32%

Agents who learned about Sam's candidacy autonomously over 2 days.

Party Invite Spread
4% → 52%

Agents who heard about Isabella's Valentine's Day party.

Network Density
0.17 → 0.74

Significant increase in mutual social connections across the town.

Limitations & Open Questions

While highly successful, the architecture revealed clear boundary conditions during long-term simulations:

  • Spatial Norm Misclassifications: Agents struggled with physical norms that are hard to convey in natural language. For instance, multiple agents entered a single-person dorm bathroom simultaneously, assuming it was multi-user.
  • Instruction Tuning Politeness: Dialogue generated by the instruction-tuned models often felt overly formal and excessively cooperative, with agents rarely saying "no" to suggestions.
  • Memory Retrieval Overload: As the memory stream grew larger, retrieving the most relevant memories became computationally expensive and occasionally surfaced less typical locations for actions.

Glossary

Generative Agents

Computational software agents that simulate believable human behavior by dynamically querying and updating a long-term memory stream using a Large Language Model.

Memory Stream

A database that maintains a comprehensive, chronological, natural-language record of an agent's experiences and observations.

TrueSkill Rating

A Bayesian skill rating system developed by Microsoft Research, used in this paper to evaluate and rank the believable performance of different agent architectures based on human feedback.

Citation (BibTeX)

@inproceedings{park2023generative,
  author    = {Park, Joon Sung and O'Brien, Joseph C. and Cai, Carrie J. and Morris, Meredith Ringel and Liang, Percy and Bernstein, Michael S.},
  title     = {Generative Agents: Interactive Simulacra of Human Behavior},
  booktitle = {Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology},
  year      = {2023},
  pages     = {1--22},
  url       = {https://doi.org/10.1145/3586183.3606763}
}
Made with Flash Papers — make your own