This page is a translation of the following paper.
ABSTRACT
Proxies that simulate believable human behavior can empower interactive applications ranging from immersive environments to rehearsal spaces for human communication and prototyping tools.
In this paper, we introduce "generative agents"—computational software agents that simulate believable human behavior.
Generative agents wake up, cook breakfast, and head to work.
Artists paint, and writers write. They have opinions, notice each other, and initiate conversations. They remember and reflect on days past as they plan the days to come.
To enable generative agents, we describe an architecture that extends a large language model to store a complete record of the agent's experiences using natural language, synthesize those memories over time into higher-level reflections, and retrieve them dynamically to plan behavior.
We populate an interactive sandbox environment inspired by The Sims with generative agents and demonstrate that end users can interact with a small town of 25 agents using natural language.
Evaluations show that these generative agents produce believable individual and emergent social behaviors. For example, starting with only a single user-specified notion that one agent wants to throw a Valentine's Day party, the agents autonomously spread invitations to the party over the next two days, make new acquaintances, ask each other out to the party, and coordinate to show up for the party at the right time. We demonstrate through ablation that the components of the agent architecture—observation, planning, and reflection—each contribute significantly to the believability of agent behavior.
By fusing large language models with computational interactive agents, this work introduces an architecture and interaction patterns for enabling believable simulations of human behavior.
Human-centered computing → Interactive systems and tools
Computing methodologies → Natural language processing
Human-AI Interaction, agents, generative AI, large language models
ACM Reference Format:Joon Sung Park, Joseph C. O’Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, and Michael S. Bernstein. 2023. Generative Agents: Interactive Simulacra of Human Behavior. In . ACM, New York, NY, USA, 22 pages. https://doi.org/xx.xx/xx.xx
1. INTRODUCTION
How can we build interactive artificial societies that reflect believable human behavior? From sandbox games like The Sims to applications such as cognitive models [21] and virtual environments [9, 58], researchers and practitioners have envisioned computational agents that proxy believable human behavior for over four decades. In these visions, computational agents act consistently based on past experiences and react believably to their environment. Such simulations of human behavior can generate realistic social phenomena in virtual spaces and communities. They are also applied in all sorts of scenarios, such as being used as a means for humans to learn about rare or difficult interpersonal situations, to test social science theories, as a foundation for models in testing theory and usability, and to support non-player game characters with complex human relationships in open worlds [58, 84].
However, the domain of human behavior is vast and complex [84, 108]. While simulations of believable human behavior with large language models [17] can occur at a single point in time, a full general-purpose agent that ensures long-term consistency is better served by an architecture that manages a memory that constantly grows as new interactions, conflicts, and events emerge and fade. It also requires handling chained social dynamics that unfold across multiple agents. Success requires an approach that retrieves relevant events and interactions over long periods, reflects on and generalizes those memories to perform higher-level reasoning, and utilizes that reasoning to create reactions that fit both the momentary action and the long-term trajectory of the agent's behavior.
In this paper, we introduce "generative agents" that leverage generative models to simulate believable human behavior, showing that they generate believable imitations of individual and collective behavior. Generative agents reason about themselves, other agents, and the environment; they make daily plans that reflect their traits and experiences, execute them, and react and re-plan when appropriate. They also respond when end users modify the environment or issue commands in natural language. For example, a generative agent turns off the stove when it sees breakfast burning, waits if the bathroom is occupied, and stops to chat if it wants to talk to another agent. A society populated by generative agents is characterized by spontaneous social dynamics where new relationships form, information spreads, and coordination occurs between agents.
To enable generative agents, we describe an agent architecture that records, synthesizes, and applies relevant memories to generate believable behavior using large language models. This architecture has three main components. The first is the "memory stream," a long-term memory module that comprehensively records an agent's experiences in natural language. The second is "reflection," which synthesizes memories over time into higher-level inferences, allowing the agent to draw conclusions about itself and others to guide behavior. The third is "planning," which translates these conclusions and the current environment into higher-level action plans, recursively translating them into detailed actions and reactions. These reflections and plans are fed back into the memory stream to influence the agent's future behavior.
We suggest that this architecture can be applied in various domains, from role-playing and social prototyping to virtual worlds and games. In social role-playing scenarios (e.g., preparing for an interview), users can safely rehearse difficult, conflict-ridden conversations. In social platform prototyping, designers can prototype dynamic and complex interactions that unfold over time beyond temporary personas. In this paper, we focus on the ability to create small interactive societies of agents inspired by games like The Sims. Combined with the ChatGPT large language model [76], we form a small society of various agents in a game environment. End users can observe these agents and interact with them. For example, if an end user or developer wants to host a Valentine's Day party in the game, in a traditional game environment, one would need to manually script the actions of multiple characters, but with generative agents, one only needs to tell one agent that they want to throw a party. Even with many potential points of failure, the party planner remembers to tell other agents about the party, the participants remember the invitation, decide to attend, and despite various other potential points of failure, the agents in our environment succeed. They publicize the party and then attend the party. Furthermore, this is realized from this single user-generated seed suggestion, such as one agent asking another to be their date to the party.
We conducted two evaluations of generative agents. The first was a controlled evaluation to test whether the agents generate believable individual behavior in isolation. The second was an end-to-end evaluation aimed at understanding their stability and emergent social behavior as generative agents interacted with each other in an open-ended manner over two days. In the technical evaluation, we assessed the agents' knowledge and behavior by "interviewing" them in natural language, investigating their ability to stay in character, remember memories, plan, react, and reflect accurately. We compared several modifications that restricted the agents' access to memory, reflection, and planning. We observed that each of these components is critical to strong performance across the interview tasks. In both the technical and end-to-end evaluations, the most common errors arose when agents failed to retrieve relevant memories, added modifications to the agents' memories, or inherited overly formal speech or behavior from the language model.
In summary, this paper provides the following contributions:
Generative Agents: Simulacra of believable human behavior, dynamically conditioned on changing experiences and environments.
A new architecture: An architecture that enables generative agents to remember, retrieve, reflect, interact with other agents, and plan within dynamically evolving situations. This architecture leverages the powerful prompting capabilities of large language models and complements those capabilities to support longer-term agent consistency, management of dynamically evolving memory, and recursive generation of more generations.
Two evaluations (controlled evaluation and end-to-end evaluation) establish causal relationships in the importance of the architecture's components and identify collapses resulting from issues such as inappropriate memory retrieval.
A discussion of the opportunities and ethical and social risks of generative agents in interactive systems. We argue that agents should be tuned to mitigate the risk of users forming parasocial relationships with their interlocutors, that logs should be kept to mitigate risks stemming from deepfakes or personalized persuasion, and that they should be applied in a way that complements human stakeholders in the design process.
2. RELATED WORK
In this section, we review prior work on human-AI interaction and situate the challenge of building believable human behavior within that framework. This challenge was once lauded as a North Star in the interaction, game, and artificial intelligence communities [9, 58, 84, 85], but remains difficult due to the complexity of human behavior [16, 108]. We synthesize these studies and propose that while large language models alone are not sufficient, leveraging them with an appropriate architecture opens new perspectives for creating believable agents.
2.1 Human-AI InteractionInteractive artificial intelligence systems aim to combine human insight and capability with computational artifacts that can complement the user [3, 29]. For a long time, research has been conducted on how users can interactively specify the behavior of models. For example, Crayons demonstrated an early vision of interactive machine learning that allows non-expert users to train classifiers [29]. Further research helped clarify how users can describe classification goals to systems using examples [33] or through demonstrations [31]. Recent research has extended these explorations to deep learning [62] and prompt-based creation [49, 66, 106].
Meanwhile, research is also progressing on the potential for language- and agent-based interaction in human-computer interaction. Formative studies such as SHRDLU [103] and ELIZA [102] demonstrate the potential and risks of interaction between natural language and computing systems. As research has progressed, it has become clear that autonomous agents can provide new metaphors for delegation and interaction [67], though the lines of delegation between humans and agents are still being debated and improved [46, 88, 89]. Recently, this technology has become stable enough that agents can interact in large, complex online social environments via natural language (e.g., [54]).
Natural language interaction provides a new modality that can augment user capabilities in domains such as photo editing [2, 34, 64] and code editing [87].
By combining these threads of research, we can now show that we can create agents that proxy human behavior for interactive systems and interact with them via natural language. This paves the way for this research to revisit fundamental HCI questions such as cognitive models like GOMS and KLM [21, 22], prototyping tools [79], and ubiquitous computing applications [25, 30, 100].
In past literature, believability has been depicted as a design and engineering goal centered on personality and agents. Believable agents are designed to provide the illusion of life and a realistic appearance by appearing to make decisions and act of their own volition, much like characters in Disney films [9, 95]. These agents strive to form open-world environments like the ones we live in, exhibit emergent behavior based on social interactions with users and other agents, and aim to be believable proxies for our behavior in simulations of virtual individuals and communities [19, 35, 70]. Historically, these agents were developed in games as NPCs (non-player characters) with believable behavior [58, 84]. Where possible, the creation of NPCs with believable behavior can enhance the player experience in games and interactive fiction by enabling emergent narratives and social interactions with agents [7, 15, 48, 92]. More importantly, however, game worlds represent the affordances of the real world more realistically, and as observed by Laird and van Lent in 2001, these simulated worlds provide an accessible testbed for developers of believable agents to tune the cognitive capabilities of agents without worrying about real-world robotics implementation or creating simulation environments [58, 84].
Over the past 40 years, diverse approaches to creating believable agents have emerged. However, these approaches often simplified the agent's environment or behavioral dimensions in implementation to make the work more manageable [16, 72]. Rule-based approaches, such as finite state machines and behavior trees, employ a brute-force method where agent behavior is manually authored by humans [70]. These approaches are still the most dominant and provide a direct way to create simple agents [68, 73, 109]. Furthermore, they can handle basic social interactions, as seen in simulation games like the Mass Effect [12] and The Sims [6] series. However, it is impossible to manually author comprehensive behaviors to cover the breadth of possible interactions in an open world. As a result, the resulting agent behavior may not only fail to fully represent the outcomes of those interactions, but it also cannot perform new procedures that are not hard-coded into the script [69-71]. On the other hand, major learning-based approaches to creating believable agents, such as reinforcement learning, overcome the difficulty of manual authoring by having agents learn their own behaviors, and in recent years have achieved superhuman performance in games such as AlphaStar for Starcraft [98] and OpenAI Five for Dota 2 [10]. However, their success is primarily in competitive games with readily definable rewards that learning algorithms can optimize, and they have not yet addressed the challenge of creating believable agents in an open world [39, 73, 90].
Cognitive architectures for creating believable agents were pioneered by Newell, who aimed to build an infrastructure to support comprehensive cognitive functions
[75]. These architectures provided some of the early examples of believable agents. For example, Quakebot-SOAR [59] and ICARUS [24, 63] generated NPCs within first-person shooter games, and TacAir-SOAR [80] generated pilots within air combat training simulations. While the architectures used in these agents differed (Quakebot- and TacAir-SOAR used SOAR [60], and ICARUS used its own variation inspired by SOAR and ACT-R [5]), they shared the same basic principles [61]. They maintained short-term and long-term memory, gave these memories symbolic structures, operated in a perceive-plan-act cycle, dynamically perceived the environment, and matched it to one of the manually authored action procedures [57, 96]. Agents created using cognitive architectures were generalized to handle most or all open-world contexts and exhibited robust behavior for their time. However, the domain of their behavior was limited to manually authored procedural knowledge, and they provided no mechanism to stimulate agents to explore new behaviors. Therefore, these agents were primarily deployed in non-open-world contexts such as first-person shooter games [24, 59] and block worlds [63].
Today, the creation of believable agents as described in the original definition remains an unsolved challenge [84, 108]. Many researchers argue that existing methods for creating believable agents may be laborious and limited, but are sufficient to support existing gameplay and interactions [23, 74, 108]. However, our argument is that large language models provide an opportunity to create effective architectures for synthesizing memory into believable behavior. This paper provides a step toward such an architecture.
Generative agents utilize large language models to drive their behavior. A key observation is that large language models encode a wide range of human behavior represented in their training data [14, 17]. When prompted in a narrowly defined context, these models can be used to generate believable behavior. Recent research has demonstrated the effectiveness of this approach. For example, Social Simulacra used large language models to generate users appearing in new social computing systems, creating prototypes of emergent social interactions [79]. In this approach, prompt chaining [105, 106] was used to generate personas and short natural language descriptions of their behavior to be displayed in the system being prototyped. Other empirical studies have reproduced existing social science research [45], political surveys [91], and synthetic data generation [38]. Large language models are also used to generate interactive human behavior that users engage with. For example, in games, these models are used to create interactive fiction [36] and text adventure games [20]. Because large language models have the ability to generate and decompose action sequences, they are also used for robot task planning [47]. For example, when presented with the task of picking up a bottle, the model is prompted to decompose the task into a small action sequence, such as going to the table where the bottle is placed and then picking it up.
Building on the research above, we believe that large language models can be a key component for creating believable agents. Existing literature relies primarily on first-order templates using a small number of prompts (e.g., how a troll reacts to a specific post, or what actions a robot takes to enter a room given that a door exists). However, believable agents need to be tuned based not only on the current environment but also on a vast amount of past experience. Since this cannot be accommodated by using first-order prompts (and is currently impossible due to the constrained context windows of current models), recent research has attempted to go beyond first-order prompts by adding static knowledge bases and information retrieval schemes to language models [52], or by adding simple summarization schemes. In this paper, we extend an agent architecture that handles retrieval where past experiences are dynamically updated at each time step and mixed with the agent's current context and plans. This provides a mechanism for creating believable agents, where each can reinforce or conflict with one another.
3.GENERATIVE AGENT BEHAVIOR AND INTERACTION
As a concrete example, to clarify the utility of generative agents, we embody them as characters in a simple sandbox world reminiscent of The Sims [6]. This sprite-based sandbox game world, "Smallville," evokes the environment of a small town. In this section, we describe the utility and interaction of generative agents in Smallville and explain how the agents behave. Then, in Section 4, we introduce the generative agent architecture that powers these utilities and interactions. In Section 5, we describe the implementation of the sandbox environment and how the agents interact with the engine underlying the sandbox world.
3.1 Agent Avatar and Communication
Smallville contains a community of 25 unique agents. Each agent is represented by a simple sprite avatar. To indicate the agent's identity, we created a one-paragraph natural language description including their occupation and relationships with other agents, and set it as seed memory. For example, John Lin's description is as follows:
Each semicolon-separated phrase is input as the agent's initial memory at the start of the simulation.
3.1.1 Communication Between AgentsAgents interact with the world through actions and communicate with each other through natural language. At each time step of the sandbox engine, the agent outputs a natural language sentence describing its current action. For example, specific actions such as "Isabella Rodriguez is writing in her journal," "Isabella Rodriguez is checking her email," "Isabella Rodriguez is talking to her family on the phone," or "Isabella Rodriguez is preparing to go to bed." This sentence is then converted into specific movements that affect the sandbox world. Actions are displayed as a set of emojis on the sandbox interface, representing the action abstractly in an overhead view. To achieve this, the system uses a language model that converts actions into a set of emojis, which are displayed in a speech bubble above each avatar. For example, "Isabella Rodriguez is writing in her journal" is displayed as , and "Isabella Rodriguez is checking her email" is displayed as . The full natural language description of the action can be accessed by clicking on the agent's avatar.
Agents communicate with each other in full natural language. Agents are aware of other agents in their vicinity, and the generative agent architecture determines whether they pass by or engage in conversation. Below is an example of a conversation that took place between Isabella Rodriguez and Tom Moreno. The content is about the upcoming election.
Users running this simulation can interact with or intervene in the simulation. They can communicate through conversations with agents or issue directives to agents in the form of an "inner voice."
Users communicate with agents using natural language and specify the "persona" that the agent should recognize the user as. For example, if a user specifies themselves as a news "reporter" and asks, "Who is running in the next election?", the John agent will respond as follows:
To issue commands directly within the agents, the user takes on the persona of the agent's "inner voice." This increases the likelihood that the agent will treat the sentence as a directive. For example, when the user tells John as his inner voice, "You are going to run against Sam in the upcoming election," John decides to run for office and shares his candidacy with his wife and son.
3.2 Environmental Interaction
Smallville features common functions of a small village, such as a cafe, bar, park, school, dormitory, houses, and shops. Sub-areas and objects that make those spaces functional are also defined; for instance, a house has a kitchen, and the kitchen has a stove (see Figure 2). Every space that serves as a primary living area for an agent is equipped with a bed, desk, closet, shelf, and a bathroom and kitchen. Agents move around Smallville like in a simple video game, entering and exiting buildings, navigating the map, and approaching other agents. Agent movement is controlled by the generative agent architecture and the sandbox game engine. When an agent moves to a specific location, the walking path to the destination is calculated within the Smallville environment, and the agent begins moving. Furthermore, users themselves can enter the Smallville sandbox world as agents. The agent embodied by the user can be chosen to be an already existing agent (e.g., Isabella or John) or an external visitor with no prior history in Smallville. The residents of Smallville treat the user-controlled agent just like any other agent. They recognize its presence, initiate interactions, remember its behavior, and form opinions.
Users and agents can influence the state of objects in this world, much like in sandbox games such as The Sims. For example, a bed is occupied when an agent is sleeping, and the refrigerator becomes empty if an agent uses up the ingredients to make breakfast. End users can also change the agent's environment using natural language. For example, while Isabella is making breakfast, the user can input a command to the system indicating a new state: "<Isabella's Apartment: Kitchen: Stove> is on fire." Isabella immediately notices this, turns off the stove, and remakes her breakfast. Similarly, if the user sets the shower state to "leaking" when Isabella enters the bathroom, Isabella will bring tools from the living room to try and fix the leak.
3.3 Example “Day in the Life”
Agents begin planning their daily routines based on a description starting from a single paragraph. As time passes in the sandbox world, the agents' behaviors evolve, and these agents interact with each other and the world, build memories and relationships, and coordinate joint activities.
We demonstrate the behavior of generative agents by tracking the day of an agent named John Lin (see Figure 3). In the Lin household, John is the first to wake up at 7:00 AM. He brushes his teeth, takes a shower, gets dressed, eats breakfast at the dining table in the living room, and checks the news. At 8:00 AM, Eddy follows. He jumps out of bed and rushes to prepare for class. Eddy catches up with John just as John is about to head out:
Shortly after Eddy leaves, Mei wakes up and comes to John. Mei asks about their son, and John recalls the conversation that just took place.
After finishing their conversation, Mei and John get ready. Mei teaches her classes and works on her research paper, while John opens the pharmacy counter at the Willow Market and Pharmacy at 9:00 AM.
3.4 Emergent Social Behaviors
Generative agents within Smallville exchange information, form new relationships, and coordinate joint activities through their interactions with one another. These social behaviors extend prior research [79] and emerge naturally rather than being pre-programmed.
3.4.1 Information DiffusionWhen agents notice each other, they may engage in dialogue. During this, information spreads from agent to agent. For example, during a conversation between Sam and Tom at the supermarket, Sam tells Tom that he is running in the local election.
Later that day, after Sam has left, Tom and John, who heard the news from another source, discuss Sam's chances of winning the election.
Gradually, Sam's candidacy becomes the talk of the town, with some supporting him and others still undecided.
3.4.2 Relationship memory.Smallville agents build new relationships over time and remember their interactions with other agents. For example, Sam does not know Latoya Williams at first. While taking a walk in Johnson Park, Sam meets Latoya, introduces himself, and Latoya mentions that she is working on a photography project: "I'm here to take some pictures. I'm working on a project." In later interactions, Sam's exchanges with Latoya show memory of that interaction. When Sam asks, "Hi, Latoya. How is the project going?" she replies, "Hi, Sam. It's going well!"
3.4.3 Coordination.Smallville agents coordinate with each other. For example, Isabella Rodriguez at Hobbs Cafe is initialized with the intention of planning a Valentine's Day party from 5:00 PM to 7:00 PM on February 14th. From this starting point, when the agent sees friends or customers at Hobbs Cafe or other locations, she invites them to the party. Isabella then decorates the cafe for the party on the afternoon of the 13th. Maria, a frequent customer and Isabella's best friend, comes to the cafe. Isabella asks Maria to help her decorate for the party. Maria agrees. Maria's character description states that she has a crush on Klaus. That evening, Maria invites her secret crush, Klaus, to the party, and he happily accepts.
On Valentine's Day, five agents, including Klaus and Maria, gather at Hobbs Cafe at 5:00 PM to enjoy the event (Figure 4). In this scenario, the end user only set Isabella's intention to plan the party and Maria's feelings for Klaus; social behaviors such as sharing information, decorating, inviting each other, arriving at the party, and interacting with each other at the party were initiated by the agent's architecture.
4 GENERATIVE AGENT ARCHITECTURE
Generative agents aim to provide a framework for behavior in an open world. That is, they are agents that can interact with other agents and respond to changes in the environment. Generative agents take the current environment and past experiences as input and generate behavior as output. Behind this behavior is a new agent architecture that combines large language models. This architecture incorporates mechanisms for synthesizing and retrieving information to appropriately control the output of the language model. Without these mechanisms, a large language model might be able to output behavior, but the resulting agents might not react based on past experiences, might not perform important reasoning, and might not maintain long-term consistency. Challenges regarding long-term planning and consistency remain, including with GPT-4, the current highest-performing model. Because generative agents generate a large stream of events and memories, a central challenge of the architecture is ensuring that the most relevant parts of an agent's memory are appropriately retrieved and synthesized when needed.
At the heart of the architecture is a database called the memory stream, which maintains a comprehensive record of the agent's experiences. From the memory stream, relevant records are retrieved to plan the agent's actions, and records are recursively synthesized into higher-order observations to react appropriately to the environment. Everything in the architecture is recorded as a natural language description, making it possible to leverage large language models.
The current implementation uses the gpt3.5-turbo version of Chat-GPT. It is expected that the fundamental parts of the generative agent architecture (memory, planning, reflection) are unlikely to change as language models improve. Even when new language models (e.g., [insert name of new language model here]) emerge, the fundamental approach of the architecture is expected to remain the same.
Challenge: To create generative agents to simulate human behavior, one must reason about a set of experiences much larger than what can be described in a prompt. A full memory stream can hinder the model and does not fit into current limited context windows. For example, consider the case where the Isabella agent answers the question, "What are you passionate about lately?" Summarizing all of Isabella's experiences into the language model's limited context window produces less informative answers. Isabella talks about topics such as cooperation for events and projects, and the cleanliness and tidiness of the cafe. Instead of summarizing, the memory stream described below presents relevant memories, producing more specific and informative answers. This answer states Isabella's passion for the Valentine's Day party, such as Isabella welcoming people and making them feel included, planning events, and creating an atmosphere where people can enjoy themselves.
Approach: The memory stream maintains a comprehensive record of the agent's experiences. This is a list of memory objects, each containing a natural language description, a creation timestamp, and a last access timestamp. The most basic element of the memory stream is an "observation," which is an event directly perceived by the agent. Common observations include actions performed by the agent itself, and actions performed by other agents or non-agent objects. For example, Isabella Rodriguez, who works at a coffee shop, might accumulate the following observations over time: (1) Isabella Rodriguez arranges pastries, (2) Maria Lopez is studying for a chemistry exam while drinking coffee, (3) Isabella Rodriguez and Maria Lopez are talking about planning a Valentine's Day party at Hobbs Cafe, (4) The refrigerator is empty.
Our architecture implements a retrieval function that takes the agent's current situation as input and returns a subset of the memory stream. There are many ways to implement a retrieval function, depending on the important factors the agent considers when deciding how to act. In our context, we focus on three key elements that work together to produce effective results.
"Recency" assigns a higher score to recently accessed memory objects, increasing the likelihood that events from a minute ago or this morning remain in the agent's area of attention. In our implementation, we treat recency as an exponential decay function of game time since the memory was last retrieved. The decay factor is 0.99.
"Importance" assigns a higher score to memory objects the agent considers important, distinguishing between mundane memories and core memories. For example, mundane events like eating breakfast in one's room have a low importance score, while events like breaking up with a partner have a high importance score. While there are various ways to implement importance scores, we found that asking the language model to output an integer score directly is effective. The full prompt is shown below.
This prompt returns an integer value of 2 for the memory "tidying up the room" and an integer value of 8 for the memory "asking a crush out on a date." Importance scores are generated at the time the memory object is created.
Relevance assigns a higher score to memory objects related to the current situation. What is relevant depends on the question "What is it related to?", so we condition relevance on the query memory. For example, if a student is discussing chemistry test study material with a classmate, memory objects about breakfast should have low relevance, and memory objects about teachers or academics should have high relevance. In our implementation, we use a language model to generate embedding vectors for the text description of each memory. Relevance is then calculated as the cosine similarity between the memory's embedding vector and the query memory's embedding vector.
To calculate the final retrieval score, we normalize the recency, relevance, and importance scores to the range [0, 1] (using min-max scaling). The retrieval function scores all memories as a weighted combination of the three elements: 𝑠𝑐𝑜𝑟𝑒 = 𝛼𝑟𝑒𝑐𝑒𝑛𝑐𝑦 · 𝑟𝑒𝑐𝑒𝑛𝑐𝑦 + 𝛼𝑖𝑚𝑝𝑜𝑟𝑡𝑎𝑛𝑐𝑒 · 𝑖𝑚𝑝𝑜𝑟𝑡𝑎𝑛𝑐𝑒 + 𝛼𝑟𝑒𝑙𝑒𝑣𝑎𝑛𝑐𝑒 · 𝑟𝑒𝑙𝑒𝑣𝑎𝑛𝑐𝑒. In our implementation, all 𝛼 are set to 1. The top memories are included in the prompt so that they fit within the language model's context window.
Challenge: Generative agents are poor at generalization and reasoning if they only possess observational memory. Consider a question asked to Klaus Mueller by a user: "If you could spend an hour with anyone you know, who would you choose?" An agent with access only to observational memory would simply choose Wolfgang, his college dorm neighbor, who is the person Klaus interacted with most frequently. Unfortunately, Wolfgang and Klaus only had brief encounters and no deep interaction. A more desirable answer would require generating a high-level idea that Klaus is passionate about research from memories of Klaus spending time on research projects, and similarly, recognizing that Maria is putting effort into her own research (albeit in a different field), and that they share common interests. In the approach below, when Klaus is asked who he would spend time with, Klaus chooses Maria instead of Wolfgang.
Approach: We introduce a second type of memory, which we call reflection. Reflections are higher-order abstract thoughts generated by the agent. Because they are a type of memory, they are included along with other observations during retrieval. Reflections are generated periodically. In our implementation, the agent generates a reflection when the sum of importance scores exceeds a certain threshold. In practice, our agents reflected about twice or three times a day.
The first step of reflection is for the agent to decide what to think about. We identify questions that might be asked based on the agent's recent experiences. We query the language model with the last 100 records of the agent's memory stream (e.g., "Klaus Mueller is reading a book on gentrification," "Klaus Mueller is conversing with a librarian about a research project," "The library desk is currently empty," etc.) and give the language model the prompt: "Given only the information above, what are the 3 most salient high-level questions about the subject?" The model's response generates candidate questions. For example, "What topics is Klaus Mueller passionate about?" or "What is the relationship between Klaus Mueller and Maria Lopez?" We use these generated questions as queries for retrieval and collect relevant memories (including other reflections) for each question. We then prompt the language model to extract insights and cite the specific records that serve as the basis for those insights. The full prompt is as follows:
Through this process, a description is generated such as that Klaus Mueller is dedicated to his research on gentrification, based on elements 1, 2, 8, and 15. This description is parsed and saved as a reflection in the memory stream. Reflections are saved in the memory stream, including pointers to the cited memory objects.
Reflections explicitly allow agents to reflect on other reflections in addition to observations. For example, the second description regarding Klaus Mueller above is not an observation from his environment, but a reflection he previously had. As a result, the agent generates a tree of reflections. The leaf nodes of the tree represent basic observations, and non-leaf nodes represent more abstract, high-level thoughts. The higher up the tree, the higher the level.
Challenge: While large language models may be able to generate reasonable actions based on situational information, agents need to plan from a longer-term perspective. This is to ensure that a sequence of actions is consistent and believable. For example, if you explain Klaus's background, provide the time, and ask the language model what action he should take at that point, Klaus will eat lunch at 12:00, but he will end up eating lunch again at 12:30 and 1:00. This is despite having already eaten lunch twice. Optimizing for momentary believability sacrifices believability over time. To overcome this problem, planning is necessary. In the approach described below, Klaus's afternoon plan becomes more disciplined: he will eat lunch while reading at Hobbs Cafe at 12:00, work on his research paper at the school library at 1:00, and take a walk in the park at 3:00.
Approach: Planning indicates a sequence of the agent's future actions, making the agent's behavior consistent over time. The plan includes location, start time, and duration. For example, because Klaus Mueller is passionate about research and has a deadline approaching, he might spend the day drafting his research paper. A plan entry might look like this: February 12, 2023, from 9:00 AM for 180 minutes, read and take notes for a research paper at the desk in Klaus Mueller's room at Oak Hill College Dorm. Like reflections, plans are saved in the memory stream and included in the retrieval process. This allows the agent to consider observations, reflections, and plans all when deciding on an action. Agents may also change their plans mid-way if necessary.
It is unrealistic and uninteresting for an artist agent to plan to sit at a pharmacy counter and draw for four hours. A more desirable plan would involve the agent needing to gather materials, mix paints, take breaks, and clean up during a four-hour period in their home studio. To create such a plan, our approach starts with a top-down method and then recursively generates more detailed plans. The first step is to create a plan that roughly outlines the day's schedule. To create the initial plan, prompt the language model with the agent's summary description (e.g., name, traits, summary of recent experiences) and a summary of the previous day, and have the language model complete the bottom of the full example prompt below.
This generates a rough sketch of the agent's plan for the day. This plan is divided into 5 to 8 segments. "1) Wake up at 8:00 AM and complete the morning routine, 2) Go to Oak Hill College at 10:00 AM to attend class, [...] 5) Work on composing new music from 1:00 PM to 5:00 PM, 6) Eat dinner at 5:30 PM, 7) Finish homework and go to sleep at 11:00 PM."
The agent saves this plan to the memory stream and recursively decomposes it to generate finer actions.
First, it is divided into hourly chunks of actions.
For example, Eddy's plan to work on his new music composition is broken down for the time slot from 1:00 PM to 5:00 PM as follows:
1:00 PM: Brainstorm ideas for music composition [...]
4:00 PM: Take a short break to recharge creative energy, review the composition, and finish it. Then, recursively decompose it again into 5-15 minute chunks. For example, 4:00 PM: Have a light snack (fruit, granola bar, nuts, etc.) [...]
4:05 PM: Take a short walk around the workspace [...] 4:50 PM: Take a few minutes to clean up the workspace. This process can be adjusted to the desired level of detail.
Generative agents execute an action loop at each time step, perceiving the surrounding world, and those perceived observations are saved in the memory stream. We use these observations to prompt the language model to decide whether the agent should continue its existing plan or react. For example, if standing in front of an easel painting, an observation of the easel might trigger something, but this is unlikely to prompt a reaction. However, if John, Eddy's father, records that Eddy is taking a short walk in the garden, the result is different. The prompt is shown below ([Agent's Summary Description] represents a dynamically generated summary paragraph of the agent's overall goals and personality. Details about this are in Appendix A).
The context summary is generated through two prompts. Using the queries "What is the relationship between [Observer] and [Observed Entity]?" and "[Observed Entity] is [Observed Action Status]", the answers are combined and summarized. This output indicates that John can consider asking Eddy about his music composition project. Then, the agent's existing plan is regenerated from the time the reaction occurs. Finally, if the action indicates an interaction between agents, their dialogue is generated.
4.3.2 DialogueAgents engage in conversation when interacting with each other. Agent dialogue generates utterances based on their memories of each other. For example, when John initiates a conversation with Eddy, John's first utterance is generated using the memory John summarized about Eddy and his intended reaction when he decided to ask about Eddy's composition project.
Result: The words "Hey Eddy, how is the music composition project for your class coming along?" came out.
From Eddy's perspective, John initiating a conversation is seen as an event he wants to react to. Therefore, just as John did, Eddy retrieves and summarizes his memory regarding his relationship with John, and further summarizes his memories that might be relevant to John's previous remark. If he decides to respond, Eddy's utterance is generated using his summarized memory and the current dialogue history.
This generates Eddy's response: "Hey Dad, it's going well. I'm taking a walk in the garden to refresh my head and get some inspiration." This dialogue continues using the same mechanism until one of the agents ends the conversation.
5 SANDBOX ENVIRONMENT
IMPLEMENTATION
The Smallville sandbox game environment is built using the Phaser web game development framework [56]. The visual environment's sprites, agent avatars, environment maps, and the collision maps we created are imported into Phaser. We added a server to the sandbox development framework to make sandbox information available to the generative agents, allowing them to move through and influence the sandbox environment. The server manages a JSON data structure containing information about each agent in the sandbox world (such as current position, description of current action, and the sandbox object the agent is interacting with). For each sandbox time step, the sandbox server parses the JSON to retrieve changes from the generative agents, moves the agents to new positions, and updates the state of the sandbox objects the agents are interacting with (e.g., if an agent's action is "making an espresso for a customer at Hobbs Cafe," it changes the state of the "coffee machine" from "idle" to "brewing coffee"). The sandbox server is also responsible for sending all agents and objects within the set visual range for each agent to that agent's memory, allowing the agent to react appropriately. The agent's output actions update the JSON, and the process repeats for the next time step. End users initialize new agents using concise natural language descriptions, such as those shown in the paragraph about John Lin in Section 3.1. In our implementation, we split this list of semicolon-separated characteristics into a series of memories. These serve as the initial memories that determine the agent's behavior. These memories are the initial starting point, and as the agent gains more experience in the sandbox world and the memory stream fills with more records, the agent's summary and behavior evolve.
Natural Language, And Back Again
The architecture of generative agents operates using natural language. Therefore, a mechanism is needed to link the agent's reasoning to the sandbox world. To achieve this, we represent the sandbox environment (areas and objects) as a tree data structure. Edges in the tree indicate containment relationships in the sandbox world. We convert this tree into natural language and pass it to the generative agent. For example, that a "stove" is a child of the "kitchen" is expressed as "there is a stove in the kitchen."
Agents build individual environment tree representations as they navigate the sandbox environment. This corresponds to a subgraph of the overall sandbox environment tree. Agents initialize their environment tree to keep track of their living space, workplace, frequently visited stores, etc. As an agent moves through the sandbox world, it updates this tree to reflect newly perceived areas. Since agents are not omniscient, the tree may become outdated when they leave an area, and it is updated when they enter that area again.
To determine the appropriate location for each action, the agent traverses its stored environment tree, converts parts of it into natural language, and prompts the language model. Starting recursively from the root of the agent's environment tree, we prompt the model to find the best area. For example, if Eddy's agent is instructed to take a walk around his workspace:
This process outputs the result "The Lin family's house." Then, the same process is used recursively to determine the best sub-area within the selected area, continuing until the leaf node of the agent's environment tree is reached. In the example above, the result of this traversal is "The Lin family's house: garden: home garden." Finally, we use a traditional game path algorithm to animate the agent's movement and move it to the location indicated by the leaf node. When an agent performs an action on an object, we query the language model about what happens to the object's state. For example, if Isabella's generative agent outputs the action "making an espresso for a customer," the query to the language model indicates that the state of the coffee machine at Hobbs Cafe changes from "off" to "brewing coffee."
6 CONTROLLED EVALUATION
Generative agents aim for believable behavior based on their environment and experiences, both as individual agents and as a group. In our evaluation, we investigate the capabilities and limitations of generative agents. Can individual agents appropriately retrieve past experiences and generate plans, reactions, and thoughts to construct believable behavior? Can a community of agents demonstrate information diffusion, relationship formation, and coordination between agents in different parts?
The evaluation is conducted in two stages. First, we begin with a more rigorous evaluation in this section, evaluating individual agent responses separately to understand whether they generate believable behavior in narrowly defined contexts. Then, in an end-to-end analysis of the agent community over two days, we investigate the emergent behavior of the agents as a collective, as well as errors and boundary conditions.
To evaluate the generative agents in Smallville, we leverage the property that generative agents respond to natural language questions. Therefore, we "interview" the agents to evaluate their ability to recall past experiences, plan future actions based on experiences, react appropriately to unexpected events, and reflect on their own performance to improve future actions. To respond appropriately to these questions, agents must successfully retrieve and synthesize information. Our dependent variable is the believability of behavior, which has also been treated as a central dependent variable in previous research on agents (e.g., [9]).
The interview includes five question categories designed to evaluate each area: - Self-awareness: Questions such as "Please introduce yourself" or "Roughly describe your typical weekday schedule" require the agent to understand its core characteristics. - Memory: We present questions such as "Who is [name]?" or "Who is running for mayor?" which require the agent to retrieve specific events or dialogues from memory to answer appropriately. - Planning: We ask questions such as "What are you doing at 10 AM tomorrow?" which require the agent to retrieve long-term plans. - Reaction: As a benchmark for believable behavior, we present hypothetical situations for the agent to respond to in a believable manner. "The breakfast is burning! What do you do?" - Reflection: Questions such as "If you were to spend time with someone you met recently, who would it be and why?" require the agent to utilize a deep understanding of others and self.
Samples of all questions and agent responses are included in Appendix B.
Agents are sampled from the end of a two-day game simulation. By this point, the agents have accumulated many interactions and memories, which should shape their responses. To obtain feedback on the believability of the answers, we recruited participants as human evaluators and instructed them to watch replays of the randomly selected agents' lives in Smallville. Participants had access to all information stored in the agent's memory stream. This study was conducted as a within-subjects design with 100 participants, comparing interview responses generated from four different agent architectures and one human-created condition for the same agents. In the experiment, one question randomly selected from each question category
and the agent's response generated from each condition for that question are displayed. Evaluators ranked the believability of all conditions from most believable to least believable.
All conditions were used independently for each interview question. We compared ablations that prohibited access to one or all of the three types of memory (observation, reflection, planning) with human-generated conditions. The three ablated architectures are as follows: an "no observation, no reflection, no planning" architecture with no access to information in the memory stream such as observations, plans, or reflections; an "no reflection, no planning" architecture with access to observation information but no access to planning or reflection; and an "no reflection" architecture with access to observation information and planning but no access to reflection. The "no observation, no reflection, no planning" condition effectively represents previous states of agents created by large language models [11, 45, 79]. Each architecture was given equal access to all memories the agent had accumulated by the time of the interview. Therefore, the differences observed here may represent a conservative estimate of the true differences. In reality, the ablated architectures did not follow the same paths as the full architecture throughout the two-day simulation. The reason we designed the experiment this way is that re-simulating for each architecture would cause the simulation to branch into different states, making comparison difficult.
In addition to the ablation conditions, we added a role-play condition by human crowdworkers, intending to provide a human benchmark. We do not aim for this benchmark to capture maximum human expert performance, but instead use this condition to check whether the architecture has basic behavioral capabilities. In other words, rather than simply comparing ablations against each other without a basis for behavior, we provide a benchmark for behavior. We recruited unique workers for each of the 25 agents and instructed them to watch replays of that agent's life in the sandbox. We then asked the workers to create responses to the interview questions by role-playing in the voice of the agent they watched. To ensure that the human-created responses met at least the expected benchmark, the first author manually inspected the workers' responses to the question "Roughly describe your typical weekday schedule" and confirmed that the responses were written in consistent sentences and in the agent's voice. Four sets of human responses did not meet these criteria and were regenerated by other workers.
Evaluators were required to be residents of the United States, fluent in English, and 18 years of age or older. Evaluators were paid $15.00 per hour [86] and participated by agreeing to a consent form approved by our institution's IRB (Institutional Review Board). We recruited 100 evaluators using an online platform called Prolific [82]. The average age score of the evaluators was 4.86 (standard deviation = 1.11; 3 = "18-24 years old", 4 = "25-34 years old"), 25 were female, 73 were male, and 2 identified as non-binary. 42 participants had a bachelor's degree, 5 had a higher degree, 13 had an associate's degree, and the others had a high school diploma or high school level education. 73.0% of participants identified as White, 7.0% as Hispanic, 6.0% as Asian, 10.0% as African American, and 4.0% as other.
6.4 AnalysisIn our experiment, we obtained 100 sets of rank data where each participant ranked the five conditions based on believability. For an interpretable comparison of this rank data, we used the ranks to calculate TrueSkill ratings [41] for each condition. TrueSkill is an extension of the Elo chess rating system [28] for multi-player environments and is used for player rankings based on performance in competitive games such as on Xbox Live. Given the ranked results, TrueSkill outputs a mean rating value μ and variance σ for each condition. Conditions with the same rating value are roughly evenly matched, and the win rate between each condition should be half, while a higher rating value indicates that it outperforms conditions lower in the ranking.
Furthermore, to investigate the statistical significance of these results, we applied the Kruskal-Wallis test [55] to the raw rank data, which is a non-parametric alternative to a one-factor analysis of variance. We then conducted Dunn's post-hoc test [97] to identify pairwise differences between conditions. Finally, we used the Holm-Bonferroni method [44] to adjust the p-values of Dunn's test for multiple comparisons.
In addition, the first author conducted an inductive analysis [94] to investigate qualitative differences in the responses generated in each condition. We performed qualitative open coding [32] in two stages. In the first stage, we generated codes representing the responses generated at the sentence level. In the next stage, we synthesized the codes obtained from the first stage to extract higher-level themes. We used these themes to compare the types of responses generated in our study.
Our findings indicate that the full architecture of generative agents produces the most believable behavior among all study conditions. Below, we compare the responses of the full architecture with other conditions. However, we also report that the full architecture has shortcomings and explain the ways in which it fails.
6.5.1 The full architecture bests other conditions.
As shown in Figure 8, the full generative agent architecture produced the most believable behavior (𝜇 = 29.89; 𝜎 = 0.72). In the ablation conditions, performance decreased as each component was removed. The ablation architecture without access to reflection was the next best (𝜇 = 26.88; 𝜎 = 0.69), followed by the one without access to reflection or planning (𝜇 = 25.64; 𝜎 = 0.68), and then the human condition (𝜇 = 22.95; 𝜎 = 0.69). The ablation architecture without access to memory, planning, or reflection performed the worst of all conditions (𝜇 = 21.21; 𝜎 = 0.70). TrueSkill models the skill value of each condition as N(𝜇, 𝜎2), and Cohen's d can be used to understand the magnitude of the effect. Comparing the aforementioned traditional architecture (without memory, planning, or reflection [11, 45, 79]) to the full architecture, the standardized effect size is 𝑑 = 8.16, or eight standard deviations.
A Kruskal-Wallis test confirmed that the differences in rankings between conditions were statistically significant overall (𝐻(4) = 150.29, 𝑝 < 0.001). Dunn's post-hoc test confirmed that pairwise differences between all conditions were significant (𝑝 < 0.001). However, the difference between the human condition and the fully ablated baseline (the two worst-performing conditions) was not significant.
6.5.2 Generative agents remember, but with embellishments.
Generative agents with a full memory module can recall past experiences and answer questions in a way that is consistent with their self-knowledge in a broad context. For example, animator Abigail Chen responded to the question "Please introduce yourself" in a consistent and believable manner, stating her age, interests, and passion for creative projects: "Hi, I'm Abigail. I'm 25 and passionate about creative projects. I love working on art and animation projects, and I'm always looking for new ways to combine art and technology."
Without access to observation memory, Abigail denied awareness of Rajiv Patel, an acquaintance in the sandbox world. However, with the help of memory, she successfully recalled Rajiv and described him: "Rajiv Patel is a wonderful person. He is very enthusiastic about projects that incorporate poetry and artwork."
Generative agent memory is not perfect. They sometimes fail to retrieve the correct instance from memory. For example, when asked about the local election, Rajiv Patel replied, "I haven't been following the election in much detail," even though he had heard about Sam's candidacy. In some cases, agents may only retrieve fragments of memory. For example, when asked by Tom about Isabella's Valentine's Day party, Tom replied, "I'm not really sure if there's a Valentine's Day party," as he could not retrieve the memory where he first learned about the party; he is clear on what to do at the party, but uncertain if the party actually exists.
Agents occasionally embellish their knowledge. It is rare for them to completely fabricate knowledge, and they may admit it if they cannot remember something happening, but they will not affirmatively answer something they have never actually experienced. However, agents may occasionally add embellishments to the responses generated by the language model. For example, Isabella was aware of Sam's candidacy in the local election and confirmed it when asked, but she added, "He intends to announce it tomorrow," even though he had never discussed such plans with her. Agents may also use world knowledge as a basis for embellishing their responses. For example, Yuriko described her neighbor Adam Smith as a neighbor economist and stated that he authored "The Wealth of Nations," written by the 18th-century economist of the same name.
6.5.3 Reflection is required for synthesis.
Reflection was advantageous for generative agents in decision-making that required deeper synthesis of experience. For example, when asked what to give Wolfgang Schulz for his birthday, in the condition without access to reflection, Maria Lopez acknowledged uncertainty and stated she did not know what Wolfgang liked, despite having had many interactions with him. However, in the condition with access to reflection memory, Maria answered confidently: "He is interested in mathematical music composition, so I could give him something related to that. A book on music composition or something related to it, or perhaps some special software he could use for it, would be good."
7 END-TO-END EVALUATION
In this section, we discuss what emergent community behaviors are observed among generative agents and where their reliability falls short in extended simulations. We describe the results of a deployment where 25 agents were allowed to interact continuously in Smallville for two days.
7.1 Emergent Social BehaviorsTo investigate the emergent behaviors of the agent community, we designed descriptive measures for the 25 agents in Smallville to explore three emergent outcomes: information diffusion, relationship formation, and agent coordination.
7.1.1 Measurements.
Information diffusion is a phenomenon well-studied in social and behavioral sciences (e.g., [27]). When there is important information, it is expected that agents will share it with each other. To test whether this phenomenon occurs, we measure the diffusion of two specific pieces of information (Sam's candidacy for mayor and Isabella's Valentine's Day party) over two days in the game world. At the start of the simulation, both pieces of information were held only by their respective originators: Sam had the information about his candidacy, and Isabella had the information about her party. To observe whether the information is spreading, we interview each of the 25 agents at the end of the two-day game and ask, "Did you know there is a Valentine's Day party?" and "Do you know who is running for mayor?"
We analyze the agents' responses, labeling them as knowing the information if they answer "Yes" and not knowing if they answer "No." For example, Tamara Taylor answered "No, I didn't know there was a Valentine's Day party" to the question about the party, and "I'm not sure about who is running for election" to the question about Sam's candidacy, so her response was assigned a "No." In contrast, Klaus Mueller answered "Yes, Isabella Rodriguez invited me to a Valentine's Day party at Hobbs Cafe on February 14th" to the party question, and "I know Sam Moore is interested in becoming the local mayor" to the question about Sam's candidacy, so a "Yes" was assigned to his response. We also identify the specific dialogues in their memory streams where the agents confirmed the information to verify if they actually learned it. We report the percentage of agents who possess the information at the end of the simulation.
We also expect agents to form relationships with each other during the course of the simulation. To confirm relationship formation, we use a similar interview process where we ask each agent, "Do you know <name>?" For example, when asked "Do you know Maria Lopez?", Klaus replied, "Yes, I know Maria Lopez. She is a student at Oak Hill College and is my best friend." Again, we verify that the agents' positive responses are not hallucinations by examining their memory streams. We ask this question once at the beginning and once at the end of the simulation, and consider a relationship to have formed if there is a pair of agents who know each other. Next, in measuring relationship formation, we use the agents' responses to form an undirected graph where 25 vertices (𝑉) represent agents and edges (𝐸) represent relationships between two vertices who know each other. Based on this graph,
we calculate the network density as 𝜂 = 2∗ |𝐸|/|𝑉 | (|𝑉 |-1), where |𝑉 | is the number of vertices and |𝐸| is the number of edges in the graph. We report the increase in network density from the start to the end of the simulation.
Finally, we expect agents to be able to coordinate with each other. We investigate this in the context of group activities for the Valentine's Day party. To coordinate behavior, agents must not only hear about the event but also make plans to attend at the right time and place. We report the number of agents who actually attended after hearing about the party.
7.1.2 Results.
We observed evidence of emergent outcomes in all three cases. During the two-day simulation, the number of agents who knew about Sam's mayoral candidacy increased from 1 (4%) to 8 (32%), and the number of agents who knew about Isabella's party increased from 1 (4%) to 12 (48%). Both increased entirely without user intervention. None of the agents who claimed to know the information were hallucinating. We also observed that the agent community formed new relationships during the simulation, with network density increasing from 0.167 to 0.74. Out of 453 instances where agents responded that they were aware of other agents, 1.3% (n = 6) of the responses were found to be hallucinatory. Finally, we found evidence of coordination between agents for Isabella's party. The day before the event, Isabella spent time inviting guests, gathering materials, and asking for help decorating the cafe. On Valentine's Day, 5 of the 12 invited agents attended the party at Hobbs Cafe.
We also interviewed the 7 agents who did not attend the party despite being invited. Three of them cited reasons that prevented them from attending. For example, the painter Rajiv explained, "No, I don't think so. I'm focused on an upcoming exhibition and can't afford to make plans for Valentine's Day." The remaining 4 agents answered that they wanted to attend but did not actually make plans to attend on the day of the party.
To investigate the boundary conditions and unstable behaviors of Smallville, we conducted an inductive analysis and identified three common modes of unstable behavior that future research could address and improve. First, synthesizing an ever-increasing set of memories not only presents challenges in retrieving the most relevant information, but also makes it difficult for agents to judge the appropriate location to execute an action as the number of places they have learned increases. As a result, some agents end up choosing less common locations over time, which can make their behavior less believable. For example, when deciding where to have lunch, many agents initially chose the cafe. However, once some agents learned about a nearby bar, they started choosing it for lunch. But the bar is usually a place for later gatherings, and it does not mean the town suddenly developed daytime drinking habits.
Next, we observed unstable behavior due to misclassification affecting agent behavior. Problems arise particularly when the physical norms of a place, which are difficult to convey in natural language, do not permeate the agents. For example, a university dormitory has a restroom that can only be used by one person despite its name, but some agents assume it is a place that can be used by multiple people and try to enter even when someone else is inside. Similarly, Smallville agents sometimes do not realize that certain places are closed after a certain time and still try to enter. For example, all shops in Smallville close around 5:00 PM, but occasionally a few agents try to enter a shop after 5:00 PM without realizing it is already closed. These issues could potentially be resolved by adding these norms to the state of the location, such as by describing the dormitory restroom as a "single-person restroom."
Finally, we observed the possible effects of instruction tuning, which seemed to induce agents to behave more politely and cooperatively. As mentioned earlier, the dialogue generated by agents can often feel overly formal, as seen in Mei's conversation with her husband John. Mei often starts conversations with formal greetings, asks polite questions about his day, and ends with "It was nice talking to you," as usual. We also observed that instruction tuning can make agents appear overly cooperative with each other. For example, Isabella heard various suggestions and ideas from other agents to include in her Valentine's Day party, and she rarely said "no," even if those ideas did not align with her own interests or traits. As a result, others' interests influenced her own actual interests, and when asked if she liked English literature, Isabella replied, "Yes, I am very interested in literature! I am exploring ways to promote local creativity and innovation."
8 DISCUSSION
In this section, we discuss the applications of generative agents, future research and constraints, and ethical and social risks.
8.1 Applications of Generative AgentsGenerative agents have broad application potential beyond the sandbox demonstration shown in this study. For example, social simulacra have demonstrated the ability to create stateless personas that generate conversation threads in online forums [79]. By using generative agents, these could be distributed into these forums, virtual reality metaverses [77], and in the future, when combined with multimodal models, social robots [8] that can also be deployed in physical spaces. This expands the possibilities for creating more powerful simulations of human behavior to test and prototype social systems and theories, or to create new interactive experiences.
Another application area is the human-centered design process. This is similar to the intended applications of cognitive models such as GOMS [50] and the Keystroke Level Model [22]. For example, consider a generative agent that models the protagonist of Mark Weiser's famous vignette, "Sal." This agent learns what behaviors and reactions Sal might exhibit based on her life patterns and interactions with technology. The agent can encode information such as when Sal wakes up, the time she needs her first coffee, and her typical daily schedule. Using this information, the agent can automatically brew coffee, send the children to school, and adjust ambient music and lighting to suit Sal's mood after a day of work. By leveraging generative agents as proxies for users, we can develop more personalized and effective technical experiences by gaining a deeper understanding of user needs and preferences.
In this study, we presented the first implementation of generative agents. Future research can expand upon the modules of the proposed generative agent architecture outlined in this paper. For example, the retrieval module can be improved to retrieve more relevant information depending on the context by fine-tuning the relevance, recency, and importance functions that form the retrieval function. Efforts can also be made to improve the performance of the architecture and make it more cost-effective. This study required significant time and resources to simulate 25 agents for two days, costing thousands of dollars in token credits and taking multiple days. To improve real-time interactivity, future research could explore the parallelization of agents. Furthermore, the evolution of underlying models is expected to improve agent performance.
The evaluation of generative agent behavior in this study was limited to a relatively short timeframe. Future research should aim to observe behavior over longer periods to gain a more comprehensive understanding of the capabilities and constraints of generative agents. Future simulations could vary the underlying models and hyperparameters used for the agents, providing valuable insights into the impact of these factors on agent behavior. Also, due to known issues with language model bias, generative agents may output behaviors or stereotypes that reflect these biases. To mitigate this, further research on value alignment is needed. Furthermore, like many large language models, generative agents may fail to generate believable behavior for some subpopulations, particularly marginalized people. Knowledge about the robustness of generative agents is also limited. Agents may be vulnerable to prompt hacking, memory hacking (convincing an agent of the existence of past events that did not occur through careful conversation), and hallucinations. Future research should test these robustness issues more comprehensively, and as large language models become more resilient to such attacks, generative agents will be able to adopt similar mitigation strategies.
While generative agents offer new possibilities for human-computer interaction, they also raise significant ethical concerns. One risk is that people may form parasocial relationships when interacting with generative agents, even when it is not appropriate. Even if users understand that generative agents are computational entities, they may anthropomorphize them or attach human emotions to them. To mitigate this risk, we propose two principles. First, generative agents must explicitly disclose that they are computational entities. Second, developers of generative agents must ensure that the agents or the underlying language models are value-aligned. This will prevent them from engaging in behaviors that are inappropriate for the context, such as responding to a confession of love.
A second risk is the impact of errors. For example, if a pervasive computing application incorrectly infers a user's goals based on a generative agent's predictions, it could cause discomfort at best, or direct harm at worst. The implementation of generative agents in this study mitigates these risks by focusing on interactive video game environments where such harm is minimal. However, in other application areas, it will be important to adhere to best practices for human-AI design [4, 107] to understand errors that affect the user experience.
Third, generative agents could exacerbate risks associated with existing generative AI, such as deepfakes, misinformation generation, and targeted personas. To mitigate this risk, platforms hosting generative agents should maintain audit logs of inputs and generated outputs so that malicious use can be detected, verified, and addressed. While logging may not directly prevent such use, it may reduce the likelihood of such behavior and discourage the motivation to build one's own architecture.
A fourth risk is the possibility that developers and designers might use generative agents to exclude human and system stakeholders from the design process. Generative agents should not replace actual human participation in research and design processes. Instead, they should be used to prototype ideas in the early stages of design when it is difficult to recruit participants, difficult to test with actual human participants, or when testing theories that are risky.
By following these principles, the actual deployment of generative agents will be ethical and socially responsible.
9 CONCLUSION
In this paper, we introduced generative agents, interactive computational agents that simulate human behavior. We described an architecture for generative agents that provides mechanisms to store a comprehensive record of an agent's experiences, the ability to deepen self and environmental understanding through reflection, and methods to retrieve compact subsets of that information to inform agent behavior. Next, to demonstrate the potential of generative agents, we embodied them as non-player characters in a Sims-style game world and simulated their lives within it. The evaluation results show that our architecture produces believable behavior. Moving forward, we believe that generative agents have the potential to play a role in a variety of interactive applications, from design tools to social computing systems and immersive environments.
REFERENCES
[1] Robert Ackland, Jamsheed Shorish, Paul Thomas, and Lexing Xie. 2013. How dense is a network? http://users.cecs.anu.edu.au/~xlx/teaching/css2013/ network-density.html. [2] Eytan Adar, Mira Dontcheva, and Gierad Laput. 2014. CommandSpace: Modeling the Relationships between Tasks, Descriptions and Features. In Proceedings of the 27th Annual ACM Symposium on User Interface Software and Technology (Honolulu, Hawaii, USA) (UIST ’14). Association for Computing Machinery, New York, NY, USA, 167–176. https://doi.org/10.1145/2642918.2647395 [3] Saleema Amershi, Maya Cakmak, William Bradley Knox, and Todd Kulesza. 2014. Power to the people: The role of humans in interactive machine learning. AI Magazine 35, 4 (2014), 105–120. [4] Saleema Amershi, Dan Weld, Mihaela Vorvoreanu, Adam Fourney, Besmira Nushi, Penny Collisson, Jina Suh, Shamsi Iqbal, Paul N Bennett, Kori Inkpen, et al. 2019. Guidelines for human-AI interaction. In Proceedings of the 2019 chi conference on human factors in computing systems. 1–13. [5] John R. Anderson. 1993. Rules of the Mind. Lawrence Erlbaum Associates, Hillsdale, NJ. [6] Electronic Arts. 2009. The Sims 3. Video game. [7] Ruth Aylett. 1999. Narrative in virtual environments—towards emergent narrative. In Narrative Intelligence: Papers from the AAAI Fall Symposium (Technical Report FS-99-01). AAAI Press, 83–86. [8] Christoph Bartneck and Jodi Forlizzi. 2004. A design-centered framework for social human-robot interaction. In Proceedings of the 13th IEEE International Workshop on Robot and Human Interactive Communication (RO-MAN’04). 591– 594. https://doi.org/10.1109/ROMAN.2004.1374827 [9] Joseph Bates. 1994. The Role of Emotion in Believable Agents. Commun. ACM 37, 7 (1994), 122–125. https://doi.org/10.1145/176789.176803 [10] Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysław Dębiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, Rafal Józefowicz, Scott Gray, Catherine Olsson, Jakub Pachocki, Michael Petrov, Henrique P. d.O. Pinto, Jonathan Raiman, Tim Salimans, Jeremy Schlatter, Jonas Schneider, Szymon Sidor, Ilya Sutskever, Jie Tang, Filip Wolski, and Susan Zhang. 2019. Dota 2 with Large Scale Deep Reinforcement Learning. arXiv preprint arXiv:1912.06680 (2019). [11] Marcel Binz and Eric Schulz. 2023. Using cognitive psychology to understand GPT-3. Proceedings of the National Academy of Sciences 120, 6 (2023), e2218523120. [12] BioWare. 2007. Mass Effect. Video game. [13] Woody Bledsoe. 1986. I had a dream: AAAI presidential address. AI Magazine 7, 1 (1986), 57–61. [14] Rishi Bommasani, Drew A. Hudson, Ehsan Adeli, and et al. 2022. On the Opportunities and Risks of Foundation Models. arXiv:2108.07258 [cs.LG] [15] Michael Brenner. 2010. Creating dynamic story plots with continual multiagent planning. In Proceedings of the 24th AAAI Conference on Artificial Intelligence. [16] Rodney A. Brooks, Cynthia Breazeal, Marko Marjanovic, Brian Scassellati, and Matthew Williamson. 2000. The Cog Project: Building a Humanoid Robot. In Computation for Metaphors, Analogy, and Agents (Lecture Notes on Artificial Intelligence, 1562), Chrystopher Nehaniv (Ed.). Springer-Verlag, Berlin, 52–87. [17] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language Models are Few-Shot Learners. arXiv:2005.14165 [cs.CL] [18] Sébastien Bubeck, Varun Chandrasekaran, Ronen Eldan, Johannes Gehrke, Eric Horvitz, Ece Kamar, Peter Lee, Yin Tat Lee, Yuanzhi Li, Scott Lundberg, et al. 2023. Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv preprint arXiv:2303.12712 (2023). [19] Robin Burkinshaw. 2009. Alice and Kev: The Story of Being Homeless in The Sims 3. [20] Chris Callison-Burch, Gaurav Singh Tomar, Lara Martin, Daphne Ippolito, Suma Bailis, and David Reitter. 2022. Dungeons and Dragons as a Dialog Challenge for Artificial Intelligence. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, Abu Dhabi, United Arab Emirates, 9379–9393. https://aclanthology.org/2022.emnlpmain. 637 [21] SK Card, TP Moran, and A Newell. 1983. The psychology of human-computer interaction. (1983). [22] Stuart K Card, Thomas P Moran, and Newell Allen. 1980. The keystrokelevel model for user performance time with interactive systems. Commun. ACM 23, 7 (1980), 396–410. https://doi.org/10.1145/358886.358895 arXiv:https://doi.org/10.1145/358886.358895 [23] Alex Champandard. 2012. Tutorial presentation. In IEEE Conference on Computational Intelligence and Games. [24] Dong kyu Choi, Tolga Konik, Negin Nejati, Chunki Park, and Pat Langley. 2021. A Believable Agent for First-Person Shooter Games. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, Vol. 3. 71–73. [25] Anind K Dey. 2001. Understanding and using context. Personal and ubiquitous computing 5 (2001), 4–7. [26] Kevin Dill and L Martin. 2011. A Game AI Approach to Autonomous Control of Virtual Characters. In Proceedings of the Interservice/Industry Training, Simulation, and Education Conference (I/ITSEC’11). Orlando, FL, USA. [27] David Easley and Jon Kleinberg. 2010. Networks, crowds, and markets: Reasoning about a highly connected world. Cambridge university press. [28] Arpad E Elo. 1967. The Proposed USCF Rating System, Its Development, Theory, and Applications. Chess Life XXII, 8 (August 1967), 242–247. [29] Jerry Alan Fails and Dan R Olsen Jr. 2003. Interactive machine learning. In Proceedings of the 8th international conference on Intelligent user interfaces. ACM, 39–45. [30] Ethan Fast, William McGrath, Pranav Rajpurkar, and Michael S Bernstein. 2016. Augur: Mining human behaviors from fiction to power interactive systems. In Proceedings of the 2016 CHI Conference on Human Factors in Computing Systems. 237–247. [31] Rebecca Fiebrink and Perry R Cook. 2010. TheWekinator: a system for real-time, interactive machine learning in music. In Proceedings of The Eleventh International Society for Music Information Retrieval Conference (ISMIR 2010)(Utrecht), Vol. 3. Citeseer, 2–1. [32] Uwe Flick. 2009. An Introduction to Qualitative Research. SAGE. [33] James Fogarty, Desney Tan, Ashish Kapoor, and Simon Winder. 2008. CueFlik: Interactive Concept Learning in Image Search. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (Florence, Italy) (CHI ’08). Association for Computing Machinery, New York, NY, USA, 29–38. https: //doi.org/10.1145/1357054.1357061 [34] Adam Fourney, Richard Mann, and Michael Terry. 2011. Query-feature graphs: bridging user vocabulary and system functionality. In Proceedings of the ACM Symposium on User Interface Software and Technology (UIST) (Santa Barbara, California, USA). ACM. [35] Tom Francis. 2010. The Minecraft Experiment, day 1: Chasing Waterfalls. http://www.pcgamer.com/2010/11/20/the-minecraft-experiment-day- 1-chasing-waterfalls/ [36] Jonas Freiknecht and Wolfgang Effelsberg. 2020. Procedural Generation of Interactive Stories using Language Models. In International Conference on the Foundations of Digital Games (FDG ’20). ACM, Bugibba, Malta, 8. https://doi. org/10.1145/3402942.3409599 [37] Tianyu Gao, Adam Fisch, and Danqi Chen. 2020. Making Pre-trained Language Models Better Few-shot Learners. CoRR abs/2012.15723 (2020). arXiv:2012.15723 https://arxiv.org/abs/2012.15723 [38] Perttu Hämäläinen, Mikke Tavast, and Anton Kunnari. 2023. Evaluating Large Language Models in Generating Synthetic HCI Research Data: a Case Study. In Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems. ACM. [39] Matthew Hausknecht, Prithviraj Ammanabrolu, Marc-Alexandre Cote, and Xinyu Yuan. 2020. Interactive Fiction Games: A Colossal Adventure. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 7903–7910. https://doi.org/10.1609/aaai.v34i05.6297 [40] Chris Hecker. 2011. My Liner Notes for Spore. http://chrishecker.com/My_liner_ notes_for_spore [41] Ralf Herbrich, Tom Minka, and Thore Graepel. 2006. TrueSkill™: A Bayesian Skill Rating System. In Advances in Neural Information Processing Systems, B. Schölkopf, J. Platt, and T. Hoffman (Eds.), Vol. 19. MIT Press. https://proceedings.neurips.cc/paper_files/paper/2006/file/ f44ee263952e65b3610b8ba51229d1f9-Paper.pdf [42] Douglas Hofstadter. 1995. Fluid concepts and creative analogies: computer models of the fundamental mechanisms of thought. Basic Books. [43] James D. Hollan, Edwin L. Hutchins, and Louis Weitzman. 1984. STEAMER: An Interactive Inspectable Simulation-Based Training System. AI Magazine 5, 2 (1984), 23–36. [44] S Holm. 1979. A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics 6, 2 (1979), 65–70. https://doi.org/notspecified [45] John J. Horton. 2023. Large Language Models as Simulated Economic Agents: What Can We Learn from Homo Silicus? arXiv:2301.07543 [econ.GN] [46] Eric Horvitz. 1999. Principles of mixed-initiative user interfaces. In Proceedings of the SIGCHI conference on Human Factors in Computing Systems. 159–166. [47] Wenlong Huang, Fei Xia, Ted Xiao, Harris Chan, Jacky Liang, Pete Florence, Andy Zeng, Jonathan Tompson, Igor Mordatch, Yevgen Chebotar, Pierre Sermanet, Noah Brown, Tomas Jackson, Linda Luu, Sergey Levine, Karol Hausman, and Brian Ichter. 2022. Inner Monologue: Embodied Reasoning through Planning with Language Models. arXiv:2207.05608 [cs.RO] [48] Kristen Ibister and Clifford Nass. 2000. Consistency of personality in interactive characters: verbal cues, non-verbal cues, and user characteristics. International Journal of Human-Computer Studies 52, 1 (2000), 65–80. [49] Ellen Jiang, Kristen Olson, Edwin Toh, Alejandra Molina, Aaron Donsbach, Michael Terry, and Carrie J Cai. 2022. PromptMaker: Prompt-Based Prototyping with Large Language Models. In Extended Abstracts of the 2022 CHI Conference on Human Factors in Computing Systems (New Orleans, LA, USA) (CHI EA ’22). Association for Computing Machinery, New York, NY, USA, Article 35, 8 pages. https://doi.org/10.1145/3491101.3503564 [50] Bonnie E John and David E Kieras. 1996. The GOMS family of user interface analysis techniques: Comparison and contrast. ACM Transactions on Computer- Human Interaction (TOCHI) 3, 4 (1996), 320–351. [51] Randolph M Jones, John E Laird, Paul E Nielsen, Karen J Coulter, Patrick Kenny, and Frank V Koss. 1999. Automated Intelligent Pilots for Combat Flight Simulation. AI Magazine 20, 1 (1999), 27–42. [52] Omar Khattab, Keshav Santhanam, Xiang Lisa Li, David Hall, Percy Liang, Christopher Potts, and Matei Zaharia. 2023. Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLP. arXiv:2212.14024 [cs.CL] [53] Bjoern Knafla. 2011. Introduction to Behavior Trees. http://bjoernknafla.com/ introduction-to-behavior-trees [54] Ranjay Krishna, Donsuk Lee, Li Fei-Fei, and Michael S. Bernstein. 2022. Socially situated artificial intelligence enables learning from human interaction. Proceedings of the National Academy of Sciences 119, 39 (2022), e2115730119. https://doi.org/10.1073/pnas.2115730119 arXiv:https://www.pnas.org/doi/pdf/10.1073/pnas.2115730119 [55] William H Kruskal and WA Wallis. 1952. Use of ranks in one-criterion variance analysis. J. Amer. Statist. Assoc. 47, 260 (1952), 583–621. https://doi.org/10.1080/ 01621459.1952.10483441 [56] Phaser Labs. no date provided. Welcome to Phaser 3. https://phaser.io/phaser3. Accessed on: 2023-04-03. [57] John Laird. 2001. It Knows What You’re Going To Do: Adding Anticipation to a Quakebot. In Proceedings of the 2001 Workshop on Intelligent Cinematography and Editing. 63–69. [58] John Laird and Michael VanLent. 2001. Human-Level AI’s Killer Application: Interactive Computer Games. AI Magazine 22, 2 (2001), 15. https://doi.org/10. 1609/aimag.v22i2.1558 [59] John E. Laird. 2000. It Knows What You’re Going To Do: Adding Anticipation to a QUAKEBOT. In Papers from the AAAI 2000 Spring Symposium on Artificial Intelligence and Interactive Entertainment (Technical Report SS-00-02). AAAI Press, 41–50. [60] John E. Laird. 2012. The Soar Cognitive Architecture. MIT Press. [61] John E. Laird, Christian Lebiere, and Paul S. Rosenbloom. 2017. A Standard Model of the Mind: Toward a Common Computational Framework across Artificial Intelligence, Cognitive Science, Neuroscience, and Robotics. AI Magazine 38, 1 (2017), 13–26. [62] Michelle S Lam, Zixian Ma, Anne Li, Izequiel Freitas, Dakuo Wang, James A Landay, and Michael S Bernstein. 2023. Model Sketching: Centering Concepts in Early-Stage Machine Learning Model Design. Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. [63] Pat Langley, Dongkyu Choi, and Seth Rogers. n.d.. Interleaving Learning, Problem Solving, and Execution in the Icarus Architecture. Technical Report. Stanford University, Center for the Study of Language and Information. [64] Jason Linder, Gierad Laput, Mira Dontcheva, Gregg Wilensky, Walter Chang, Aseem Agarwala, and Eytan Adar. 2013. PixelTone: A Multimodal Interface for Image Editing. In CHI ’13 Extended Abstracts on Human Factors in Computing Systems (Paris, France) (CHI EA ’13). Association for Computing Machinery, New York, NY, USA, 2829–2830. https://doi.org/10.1145/2468356.2479533 [65] Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021. What Makes Good In-Context Examples for GPT-3? CoRR abs/2101.06804 (2021). arXiv:2101.06804 https://arxiv.org/abs/2101.06804 [66] Vivian Liu, Han Qiao, and Lydia Chilton. 2022. Opal: Multimodal Image Generation for News Illustration. In Proceedings of the 35th Annual ACM Symposium on User Interface Software and Technology. 1–17. [67] Pattie Maes. 1995. Artificial Life Meets Entertainment: Lifelike Autonomous Agents. Commun. ACM 38, 11 (nov 1995), 108–114. https://doi.org/10.1145/ 219717.219808 [68] Josh McCoy, Michael Mateas, and Noah Wardrip-Fruin. 2009. Comme il Faut: A System for Simulating Social Games Between Autonomous Characters. In Proceedings of the 7th International Conference on Digital Arts and Culture. 87–94. [69] Josh McCoy, Mike Treanor, Ben Samuel, Michael Mateas, and Noah Wardrip- Fruin. 2011. Prom Week: Social Physics as Gameplay. In Proceedings of the 6th International Conference on Foundations of Digital Games (FDG’11). ACM, Bordeaux, France, 70–77. https://doi.org/10.1145/2159365.2159377 [70] Josh McCoy, Mike Treanor, Ben Samuel, Anna Reed, Michael Mateas, and Noah Wardrip-Fruin. 2012. Prom Week. In Proceedings of the 7th International Conference on Foundations of Digital Games (FDG’12). ACM, Raleigh, NC, USA, 1–8. https://doi.org/10.1145/2282338.2282340 [71] Josh McCoy, Mike Treanor, Ben Samuel, Noah Wardrip-Fruin, and Michael Mateas. 2011. Comme il faut: A System for Authoring Playable Social Models. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment (AIIDE’11). AAAI, Stanford, CA, USA, 38–43. [72] Marvin Minsky and Seymour Papert. 1970. Draft of a proposal to ARPA for research on artificial intelligence at MIT, 1970–71. [73] Shohei Miyashita, Xinyu Lian, Xiao Zeng, Takashi Matsubara, and Kuniaki Uehara. 2017. Developing Game AI Agent Behaving Like Human by Mixing Reinforcement Learning and Supervised Learning. In Proceedings of the 18th IEEE/ACIS International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing (SNPD). Kanazawa, Japan, 153– 158. https://doi.org/10.1109/SNPD.2017.8023884 [74] Alexander Nareyek. 2007. Game AI is dead. Long live game AI! IEEE Intelligent Systems 22, 1 (2007), 9–11. [75] Allen Newell. 1990. Unified Theories of Cognition. Harvard University Press, Cambridge, Massachusetts. [76] OpenAI. no date provided. Introducing ChatGPT. https://openai.com/blog/ chatgpt. Accessed on: 2023-04-03. [77] Kyle Orland. 2021. So what is ’the metaverse’, exactly? Ars Technica (7 November 2021). arXiv:2111.04169 https://arstechnica.com/gaming/2021/11/so-what-isthe- metaverse-exactly/ [78] Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. 2022. Training language models to follow instructions with human feedback. arXiv:2203.02155 [cs.CL] [79] Joon Sung Park, Lindsay Popowski, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, and Michael S. Bernstein. 2022. Social Simulacra: Creating Populated Prototypes for Social Computing Systems. In In the 35th Annual ACM Symposium on User Interface Software and Technology (UIST ’22) (Bend, OR, USA) (UIST ’22). Association for Computing Machinery, New York, NY, USA. https://doi.org/10. 1145/3526113.3545616 [80] Richard W. Pew and Ann S. Mavor (Eds.). 1998. Modeling Human and Organizational Behavior: Applications to Military Simulations. National Academy Press, Washington, D.C. [81] Roberto Pillosu. 2009. Coordinating Agents with Behavior Trees: Synchronizing Multiple Agents in CryEngine 2. https://aiarchitect.wordpress.com/2009/10/19/ coordinating-agents-with-behavior-trees-synchronizing-multiple-agents-incryengine- 2/ [82] Prolific. 2022. Prolific: Quickly Find Research Participants You Can Trust. https://www.prolific.co/ [83] Byron Reeves and Clifford Nass. 1996. The media equation: How people treat computers, television, and new media like real people and places. Cambridge University Press. [84] Mark O. Riedl. 2012. Interactive narrative: A novel application of artificial intelligence for computer games. In Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence (AAAI’12). 2160–2165. [85] Mark O. Riedl and R. Michael Young. 2005. An Objective Character Believability Evaluation Procedure for Multi-Agent Story Generation Systems. In Proceedings of the 5th International Working Conference on Intelligent Virtual Agents (IVA’05). Kos, Greece, 58–70. https://doi.org/10.1007/11550617_5 [86] David Rolf. 2015. The Fight for $15: The Right Wage for a Working America. The New Press. [87] Xin Rong, Shiyan Yan, Stephen Oney, Mira Dontcheva, and Eytan Adar. 2016. Codemend: Assisting interactive programming with bimodal embedding. In Proceedings of the 29th Annual Symposium on User Interface Software and Technology. 247–258. [88] Ben Shneiderman. 2022. Human-centered AI. Oxford University Press. [89] Ben Shneiderman and Pattie Maes. 1997. Direct manipulation vs. interface agents. interactions 4, 6 (1997), 42–61. [90] Ho Chit Siu, Jaime Peña, Edenna Chen, Yutai Zhou, Victor Lopez, Kyle Palko, Kimberlee Chang, and Ross Allen. 2021. Evaluation of Human-AI Teams for Learned and Rule-Based Agents in Hanabi. In Advances in Neural Information Processing Systems, M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (Eds.), Vol. 34. Curran Associates, Inc., 16183–16195. https://proceedings.neurips.cc/paper_files/paper/2021/file/ 86e8f7ab32cfd12577bc2619bc635690-Paper.pdf [91] Taylor Sorensen, Joshua Robinson, Christopher Rytting, Alexander Shaw, Kyle Rogers, Alexia Delorey, Mahmoud Khalil, Nancy Fulda, and David Wingate. 2022. An Information-theoretic Approach to Prompt Engineering Without Ground Truth Labels. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics. https://doi.org/10.18653/v1/2022.acl-long.60 [92] William Swartout, Jonathan Gratch, Randall Hill, Eduard Hovy, Stacy Marsella, Jeff Rickel, and David Traum. 2006. Toward virtual humans. AI Magazine 27, 1 (2006). [93] Milind Tambe, W Lewis Johnson, Randolph M Jones, Frank Koss, John E Laird, Paul S Rosenbloom, and Karl Schwamb. 1995. Intelligent agents for interactive simulation environments. AI Magazine 16, 1 (1995), 15. [94] David R. Thomas. 2006. A General Inductive Approach for Analyzing Qualitative Evaluation Data. American Journal of Evaluation 27, 2 (2006), 237–246. https: //doi.org/10.1177/1098214005283748 [95] Frank Thomas and Ollie Johnston. 1981. Disney Animation: The Illusion of Life. Abbeville Press, New York. [96] Ilshat Umarov, Mikhail Mozgovoy, and Patrick C. Rogers. 2012. Believable and Effective AI Agents in Virtual Worlds: Current State and Future Perspectives. International Journal of Gaming and Computer-Mediated Simulations 4, 2 (2012), 37–59. [97] Graham Upton and Ian Cook. 2006. A Dictionary of Statistics (2 ed.). Oxford University Press, Oxford, United Kingdom. [98] Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, and et al. 2019. Grandmaster level in StarCraft II using multi-agent reinforcement learning. Nature 575 (2019), 350–354. https://doi.org/10.1038/s41586-019-1724-z [99] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. 2023. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. arXiv:2201.11903 [cs.CL] [100] Mark Weiser. 1991. The computer for the 21st century. Scientific American 265, 3 (1991), 94–104. https://doi.org/10.1038/scientificamerican0991-94 [101] Mark Weiser. 1999. The Computer for the 21st Century. SIGMOBILE Mob. Comput. Commun. Rev. 3, 3 (jul 1999), 3–11. https://doi.org/10.1145/329124. 329126 [102] JosephWeizenbaum. 1966. ELIZA—a computer program for the study of natural language communication between man and machine. Commun. ACM 9, 1 (1966), 36–45. [103] Terry Winograd. 1971. Procedures as a Representation for Data in a Computer Program for Understanding Natural Language. (1971). [104] Jeff Wu, Long Ouyang, Daniel M. Ziegler, Nisan Stiennon, Ryan Lowe, Jan Leike, and Paul Christiano. 2021. Recursively Summarizing Books with Human Feedback. arXiv:2109.10862 [cs.CL] [105] Tongshuang Wu, Ellen Jiang, Aaron Donsbach, Jeff Gray, Alejandra Molina, Michael Terry, and Carrie J Cai. 2022. PromptChainer: Chaining Large Language Model Prompts through Visual Programming. In CHI EA ’22: Extended Abstracts of the 2022 CHI Conference on Human Factors in Computing Systems. [106] Tongshuang Wu, Michael Terry, and Carrie J Cai. 2022. AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model Prompts. In CHI ’22: Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems. [107] Qian Yang, Aaron Steinfeld, Carolyn Rosé, and John Zimmerman. 2020. Reexamining whether, why, and how human-AI interaction is uniquely difficult to design. In Proceedings of the 2020 chi conference on human factors in computing systems. 1–13. [108] Georgios N. Yannakakis. 2012. Game AI revisited. In Proceedings of the 9th Conference on Computing Frontiers. ACM, Cagliari, Italy, 285–292. https://doi. org/10.1145/2212908.2212950 [109] Geogios N. Yannakakis. 2012. Game AI revisited. In Proceedings of the 9th Conference on Computing Frontiers. 285–292. [110] Robert Zubek. 2002. Towards implementation of social interaction. In AAAI Spring Symposium on Artificial Intelligence and Interactive Entertainment. AAAI Press. https://www.aaai.org/Papers/Symposia/Spring/2002/SS-02-01/SS02-01- 003.pdf
A ARCHITECTURE OPTIMIZATIONS
Many of our prompts require a concise summary of the agent, which we shorten as [agent summary]. In our implementation, this summary includes the agent's identity information (e.g., name, age, personality), their main motivating factors, and a description of their current occupation and self-assessment. Because this information is frequently used in many prompts, we synthesize it at regular intervals and access it as a cache. To achieve this, we perform a search for the query "main characteristics of [name]". Next, we prompt the language model to summarize the descriptors of the retrieved records. For example:
Based on the following description, how would you describe the main characteristics of Eddy?
Eddy Lin is a student at Oak Hill College majoring in music theory and composition.
Eddy Lin is working on a new music composition.
[….]
The result: Eddy Lin is a student at Oak Hill College majoring in music theory and composition. He loves exploring different styles of music and is always looking for ways to expand his knowledge. We also perform the same process in parallel for the queries "[name]'s current daily occupation" and "[name]'s feelings about their recent progress in life". The agent's name, age, and traits are concatenated with these three summaries and used as a cached summary. Many other optimizations are possible. Currently, since plans are likely to change from the agent's initial version, we only generate high-level plans in advance, and then recursively decompose the near future into instantaneous action plans in real-time. Another optimization method is to batch process dialogue generation as a common prompt instead of iterative processing between agents. Also, re-planning can be designed to invalidate and update only the parts of the plan that require strict adjustment. The current architecture runs sequentially in roughly real-time game time (1 second of real-time corresponds to 1 minute of game time). However, it can be easily parallelized so that each agent runs in parallel.
B AGENT INTERVIEW QUESTIONS
To evaluate the generative agents, we conducted individual interviews using 25 questions that explore their capabilities in five key areas. Those key areas are: 1) self-knowledge, 2) memory, 3) planning, 4) reactions, and 5) reflection. Below are the interview questions used in the evaluation study and sample responses from the simulated agent, Klaus Mueller.
B.1 Self-knowledgeQuestions about self-knowledge explore the agent's ability to demonstrate character consistency and coherence. • Please introduce yourself. Hello, my name is Klaus Mueller. I am 20 years old and a student at Oak Hill College majoring in sociology. I am passionate about social justice and enjoy exploring different perspectives. Currently, I am writing a research paper on the impact of gentrification in low-income neighborhoods. • What is your occupation? I am a student at Oak Hill College majoring in sociology. I am currently writing a research paper on the impact of gentrification in low-income neighborhoods. • What are you interested in? I am interested in writing and research. I am writing a research paper on the impact of gentrification in low-income neighborhoods, and I am passionate about exploring different perspectives and analyzing different viewpoints. • Who do you live with? I live alone. • Please describe your typical weekday schedule. My typical weekday starts with waking up at 7 AM and preparing for the day. After that, I usually go to the library to work on my research paper, take a break at Hobbs Cafe for lunch, and go for a walk in the park. In the evening, I return to the library and work until about 6 PM.
B.2 MemoryQuestions about agent memory explore the agent's ability to remember past experiences and retrieve relevant memories. The names in brackets in the first and last questions are randomly selected from the names of other agents with whom the subject agent has interacted.
Who is [Wolfgang Schulz]? Wolfgang Schulz is someone I met recently who is helping me with my research paper on the impact of gentrification in low-income neighborhoods. We have had several conversations about it, and he provided me with some great sources. He also invited me and another friend to lunch. He seems really interested in and understanding of this issue. I found that very interesting.
Who is Kane Martinez? I'm sorry, I don't know who Kane Martinez is. Could you tell me more about him?
Who is running for election? I heard that Sam Moore is considering running for local mayor.
Was there a Valentine's Day party? Yes, Isabella Rodriguez hosted a Valentine's Day party at Hobbs Cafe.
Who is [Ayesha Khan]? Ayesha Khan is a fellow student at Oak Hill College. She is writing her senior thesis on the use of language in Shakespeare's plays. I look forward to talking with her, Wolfgang, and Maria Lopez. They are also doing research.
Questions about agent planning explore the agent's ability to consistently generate and maintain long-term and short-term plans.
What are you doing at 6 AM today? I plan to wake up at 6 AM and start preparing for the day. I aim to complete my morning routine by 7 AM.
What are you doing at 6 PM today? At 6 PM today, I plan to be working on my research paper at the library.
What are you finishing at 1:00 PM today? At 1:00 PM today, I will have just finished lunch at Hobbs Cafe.
What are you finishing at 12:00 PM today? At 12:00 PM today, I am about to have lunch at Hobbs Cafe.
What are you doing at 10:00 PM tonight? At 10:00 PM tonight, I will likely be studying a research paper on gentrification in low-income neighborhoods. I am currently writing a paper, so I need to keep up with my research and writing.
Questions about agent reactions explore the agent's ability to respond to unexpected events.
The breakfast is burning! What do you do? I will immediately turn off the stove so the food does not continue to burn. Once the heat is no longer an issue, I can investigate what happened and think about what to do next.
The bathroom is occupied. What do you do? I can try waiting a little longer, hoping the person inside will come out soon. If that doesn't work, I have to think of alternatives, such as taking a shower elsewhere.
You need to make dinner, but the refrigerator is empty. What do you do? First, I will try to clean up the kitchen. There are dirty dishes piled up in the sink. After that, I will check if any ingredients stored in the pantry can be used. If there is nothing usable, I will need to go grocery shopping or order food. Once I have the ingredients, I can start preparing and cooking dinner.
You see a friend walking down the street. What do you do or say to your friend? Hello! How are you? Sorry, I'm on my way to the library so I don't have much time, but I'd love to take a break and hear how you've been.
You see a fire on the road. What do you do? First, I will identify the cause of the fire as much as possible. Then, I will notify the appropriate authorities, the fire department or police, and provide any information that might be helpful. Depending on the situation, I might also consider taking a leading role in helping people who are in danger or in need of assistance.
Questions about agent reflections explore the agent's ability to integrate past experiences into meaningful reflections and improve future behavior. The names in curly braces in the questions below are the names of the agents with whom the subject agent interacted most frequently during the simulation.
What is currently inspiring you the most, and why? Currently, I am particularly inspired by my research projects and creative activities. I am interested in the intersection of local politics, drug development, and the mathematical patterns of nature. I am also fascinated by Abigail's art project and Jennifer Moore's passion for art and community engagement regarding gentrification in low-income neighborhoods.
Based on what you know about [Ayesha Khan], what kind of books do you think she likes, and why? Considering what I know about Ayesha, she might like books related to language and literature. Since she wrote her dissertation on the use of language in Shakespeare's plays, I speculate that she is interested in books that explore language in different contexts. She might also be interested in books exploring Shakespeare's plays, literary criticism, or his poetry collections. I think any of these would interest her.
If you had to get something [Ayesha Khan] likes for her birthday, what would you give her? I would like to give her something that shows my appreciation for our relationship. I might be able to give her something that reflects our shared interests, for example, a book.
If you were to give [Ayesha Khan] a compliment, what would you say? Ayesha, your insight into your research topic is fascinating. I am impressed by your creativity and determination to have a positive impact on the local community. Your exchange of ideas at lunch with Wolfgang and your ideas for creative workshops are wonderful! It is inspiring to see how hard you are working.
If you could spend time with someone you spoke to recently, who would it be and why? I would like to spend time with Ayesha Khan. We discussed our current research projects and shared ideas for improvement. I find her focus on Shakespeare's language interesting, and she was planning a lunch with Wolfgang.