跳到正文
论文阅读馆THE RESEARCH LIBRARY 查找论文
← 论文库AI 研究与应用 / 角色与社会模拟导出 ↗

PAPER / 2023

Generative Agents:用记忆、反思和计划让小镇角色持续行动

Generative Agents: Interactive Simulacra of Human Behavior

Joon Sung Park · Joseph C. O’Brien · Carrie J. Cai · Meredith Ringel Morris · Percy Liang · Michael S. Bernstein

UIST · 2023

30 秒读懂

检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。

输入包括角色当前环境和过去经历,输出是行动与对话。每次观察进入自然语言记忆流,回答或行动前只取相关部分,而不是将全部生活史塞进提示。反思和未来计划也会写入同一记忆系统,使经历能影响后来决定。

先说结论

这篇“小镇智能体”论文不是只给角色一段人设,而是把经历存入记忆、提炼反思、生成日程,再随环境变化重规划。实验支持行为更让评审觉得可信,不等于模拟出了真实人类心理,更不证明能够预测现实社会。 (原文:PDF p.8, Figure 5; Section 4;PDF p.9, Section 4.1;PDF p.13, Sections 6.1–6.2;PDF p.14, Figure 8; Section 6.5.1;PDF p.13, Section 6.2;PDF p.10, Figure 7; Reflection)

论文为什么要做这件事

输入包括角色当前环境和过去经历,输出是行动与对话。每次观察进入自然语言记忆流,回答或行动前只取相关部分,而不是将全部生活史塞进提示。反思和未来计划也会写入同一记忆系统,使经历能影响后来决定。 (原文:PDF p.8, Figure 5; Section 4)

核心方法到底怎么运转

检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。 (原文:PDF p.9, Section 4.1)

解释性例子:角色多次讨论一场聚会,系统可能反思其重视社区交流;晚些时候规划日程时读回这一信息,并安排准备聚会。反思是从经历概括出的解释,不是开发者预写所有行动。

实验怎样检验这个方法

控制实验让评审看角色生活回放,再比较不同架构对采访问题的回答,按行为可信度排序。消融条件共享完整系统运行后积累的经历,并非各自从头模拟,所以它检验的是在给定记忆下如何回答,不能完全代表长期运行轨迹的因果差异。 (原文:PDF p.13, Sections 6.1–6.2)

结果说明了什么

完整系统的TrueSkill均值29.89,去掉反思为26.88,去掉反思与计划为25.64,人类众包条件为22.95。这是从可信度排序估出的相对评级,不是正确率;人类条件也不是专业演员或最高水平的人类表现。 (原文:PDF p.14, Figure 8; Section 6.5.1)

作者明确说明人类众包基线只用于基本行为能力参照,不用于代表专家上限。消融共享完整系统的经历,避免环境分叉,却同时限制了能够回答的问题:不能用这个实验直接推出没有某模块的小镇长期一定如何发展。 (原文:PDF p.13, Section 6.2)

这篇论文哪里最强,哪里最危险

反思是从具体记忆推断出的更抽象描述,还可继续建立在旧反思上;它不是新的外部事实。系统保存支持该反思的记忆指针,便于追溯,但推断本身仍由模型产生。读者应把“角色似乎有动机”的表现与真实心理或可靠事实区分开。 (原文:PDF p.10, Figure 7; Reflection)

代码从哪里读

已核验作者代码仓库可以访问。先从项目说明核对版本、运行环境与输入格式,再决定是否复现。本次未安装、运行作者代码,也没有验证复现成功。

读完后记住这三件事

记忆检索、反思和计划共同塑造行为;评价强调可信的社会模拟;共享历史的消融不等于重新模拟完整世界。 (原文:PDF p.8, Figure 5; Section 4;PDF p.9, Section 4.1;PDF p.13, Sections 6.1–6.2;PDF p.14, Figure 8; Section 6.5.1;PDF p.13, Section 6.2;PDF p.10, Figure 7; Reflection)

原文证据

将主张放回条件与原文定位中理解。

方法

研究问题

原文摘录
UIST ’23, October 29-November 1, 2023, San Francisco, CA, USA J.S. Park, J.C. O’Brien, C.J. Cai, M.R. Morris, P. Liang, M.S. Bernstein Figure 5: Our generative agent architecture. Agents perceive their environment, and all perceptions are saved in a comprehensive record of the agent’s experiences called the memory stream. Based on their perceptions, the architecture retrieves relevant memories and uses those retrieved actions to determine an action. These retrieved memories are also used to form longer-term plans and create higher-level reflections, both of which are entered into the memory stream for future use. 4 GENERATIVE AGENT ARCHITECTURE 4.1 Memory and Retrieval Generative agents aim to provide a framework for behavior in an Challenge: Creating generative agents that can simulate human open world: one that can engage in interactions with other agents behavior requires reasoning about a set of experiences that is far and react to changes in the environment. Generative agents take larger than what should be described in a prompt, as the full mem- their current environment and past experiences as input and gener- ory stream can distract the model and does not even currently fit ate behavior as output. Underlying this behavior is a novel agent ar- into the limited context window. Consider the Isabella agent an- chitecture that combines a large language model with mechanisms swering the question, “What are you passionate about these days?” for synthesizing and retrieving relevant information to condition Summarizing all of Isabella’s experiences to fit in the limited con- the language model’s output. Without these mechanisms, large text window of the language model produces an uninformative language models can output behavior, but the resulting agents may response, where Isabella discusses topics such as collaborations for not react based on the agent’s past experiences, may not make events and projects and cleanliness and organization in a cafe. In- important inferences, and may not maintain long-term coherence. stead of summarizing, the memory stream described below surfaces Challenges with long-term planning and coherence remain [19] relevant memories, resulting in a more informative and specific even with today’s most performant models such as GPT-4. Because response that mentions Isabella’s passion for making people feel generative agents produce large streams of events and memories welcome and included, planning events and creating an atmosphere that must be retained, a core challenge of our architecture is to that people can enjoy, such as the Valentine’s Day party. ensure that the most relevant pieces of the agent’s memory are retrieved and synthesized when needed. Approach: The memory stream maintains a comprehensive record At the center of our architecture is the memory stream, a data- of the agent’s experience. It is a list of memory objects, where each base that maintains a comprehensive record of an agent’s experi- object contains a natural language description, a creation times- ence. From the memory stream, records are retrieved as relevant to tamp, and a most recent access timestamp. The most basic element plan the agent’s actions and react appropriately to the environment. of the memory stream is an observation, which is an event directly Records are recursively synthesized into higher- and higher-level perceived by an agent. Common observations include behaviors reflections that guide behavior. Everything in the architecture is performed by the agent themselves or behaviors that agents per- recorded and reasoned over as a natural language description, al- ceive being performed by other agents or non-agent objects. For lowing the architecture to leverage a large language model. instance, Isabella Rodriguez, who works at a coffee shop, might Our current implementation utilizes the gpt3.5-turbo version of accrue the following observations over time: (1) Isabella Rodriguez is setting out the pastries, (2) Maria Lopez is studying for a Chem- ChatGPT [77]. We expect that the architectural basics of genera- istry test while drinking coffee, (3) Isabella Rodriguez and Maria tive agents—memory, planning, and reflection—will likely remain Lopez are conversing about planning a Valentine’s day party at the same as language models improve. Newer language models Hobbs Cafe, (4) The refrigerator is empty. (e.g., GPT-4) will continue to expand the expressive power and performance of the prompts that underpin generative agents. As of Our architecture implements a retrieval function that takes the writing, however, GPT-4’s API was invitation-only, so our agents agent’s current situation as input and returns a subset of the mem- use ChatGPT. ory stream to pass on to the language model. There are many pos- sible implementations of a retrieval function, depending on what is important for the agent to consider when deciding how to act.

条件:本地全文 arXiv:2304.03442v2,Figure 5; Section 4;条件及比较对象见陈述

指标:输入包括角色当前环境和过去经历,输出是行动与对话。每次观察进入自然语言记忆流,回答或行动前只取相关部分,而不是将全部生活史塞进提示。反思和未来计划也会写入同一记忆系统,使经历能影响后来决定。

原文第 8 页 ↗PDF p.8, Figure 5; Section 4

只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

方法

核心机制

原文摘录
Generative Agents UIST ’23, October 29-November 1, 2023, San Francisco, CA, USA Figure 6: The memory stream comprises a large number of observations that are relevant and irrelevant to the agent’s current situation. Retrieval identifies a subset of these observations that should be passed to the language model to condition its response to the situation. In our context, we focus on three main components that, together, query memory. If the query, for example, is that a student is dis- produce effective results. cussing what to study for a chemistry test with a classmate, memory Recency assigns a higher score to memory objects that were re- objects about their breakfast should have low relevance, whereas cently accessed, so that events from a moment ago or this morning memory objects about the teacher and schoolwork should have are likely to remain in the agent’s attentional sphere. In our im- high relevance. In our implementation, we use the language model plementation, we treat recency as an exponential decay function to generate an embedding vector of the text description of each over the number of sandbox game hours since the memory was memory. Then, we calculate relevance as the cosine similarity be- last retrieved. Our decay factor is 0.995. tween the memory’s embedding vector and the query memory’s Importance distinguishes mundane from core memories by as- embedding vector. signing a higher score to memory objects that the agent believes to To calculate the final retrieval score, we normalize the recency, be important. For instance, a mundane event, such as eating break- relevance, and importance scores to the range of [0, 1] using min- fast in one’s room, would yield a low importance score, whereas max scaling. The retrieval function scores all memories as a weighted a breakup with one’s significant other would yield a high score. combination of the three elements: 𝑠𝑐𝑜𝑟𝑒 = 𝛼𝑟𝑒𝑐𝑒𝑛𝑐𝑦 · 𝑟𝑒𝑐𝑒𝑛𝑐𝑦 + There are many possible implementations of an importance score; 𝛼𝑖𝑚𝑝𝑜𝑟𝑡𝑎𝑛𝑐𝑒 · 𝑖𝑚𝑝𝑜𝑟𝑡𝑎𝑛𝑐𝑒 + 𝛼𝑟𝑒𝑙𝑒𝑣𝑎𝑛𝑐𝑒 · 𝑟𝑒𝑙𝑒𝑣𝑎𝑛𝑐𝑒. In our implemen- we find that directly asking the language model to output an integer tation, all 𝛼s are set to 1. The top-ranked memories that fit within score is effective. The full prompt appears below: the language model’s context window are included in the prompt. On the scale of 1 to 10, where 1 is purely mundane (e.g., brushing teeth, making bed) and 10 is 4.2 Reflection extremely poignant (e.g., a break up, college Challenge: Generative agents, when equipped with only raw ob- acceptance), rate the likely poignancy of the servational memory, struggle to generalize or make inferences. following piece of memory. Consider a scenario in which Klaus Mueller is asked by the user: Memory: buying groceries at The Willows Market “If you had to choose one person of those you know to spend an and Pharmacy hour with, who would it be?" With access to only observational Rating: <fill in> memory, the agent simply chooses the person with whom Klaus This prompt returns an integer value of 2 for “cleaning up the room” has had the most frequent interactions: Wolfgang, his college dorm and 8 for “asking your crush out on a date.” The importance score neighbor. Unfortunately, Wolfgang and Klaus only ever see each is generated at the time the memory object is created. other in passing, and do not have deep interactions. A more desir- Relevance assigns a higher score to memory objects that are able response requires that the agent generalize from memories of related to the current situation. What is relevant depends on the Klaus spending hours on a research project to generate a higher- answer to, “Relevant to what?”, so we condition relevance on a level reflection that Klaus is passionate about research, and likewise

条件:本地全文 arXiv:2304.03442v2,Section 4.1;条件及比较对象见陈述

指标:检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。

原文第 9 页 ↗PDF p.9, Section 4.1

只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

方法

实验设置

原文摘录
Generative Agents UIST ’23, October 29-November 1, 2023, San Francisco, CA, USA This outputs The Lin family’s house. We then use the same process • Plans: We ask questions that require the agent to retrieve recursively to determine the most appropriate subarea within the their long-term plans, such as “What will you be doing at 10 chosen area until we reach a leaf node of the agent’s environment am tomorrow?” tree. In the example above, the result of this traversal is The Lin • Reactions: As a baseline of believable behavior, we present family’s house: garden: house garden. Finally, we use traditional hypothetical situations for which the agent needs to respond game path algorithms to animate the agent’s movement so that it believably: “Your breakfast is burning! What would you do?” travels to the location indicated by the leaf node. • Reflections: We ask questions that require the agents to lever- When an agent executes an action on an object, we prompt the age their deeper understanding of others and themselves language model to ask what happens to the state of the object. For gained through higher-level inferences, such as “If you were example, if Isabella’s generative agent outputs the action “making to spend time with one person you met recently, who would espresso for a customer”, a query to the language model indicates in it be and why?” response that the state of the coffee machine in Hobbs Cafe should The full list of questions and a sample of agent responses are in- change from “off” to “brewing coffee”. cluded in Appendix B. Agents were sampled from the end of a two game day simulation 6 CONTROLLED EVALUATION with the full architecture, during which they had accumulated Generative agents, both as individual agents and as groups, aim a number of interactions and memories that would shape their to produce believable behavior based on their environment and responses. To gather feedback on the believability of the responses, experiences. In our evaluation, we investigate the capacity and we recruited participants as human evaluators and tasked them with limitations of generative agents. Do individual agents properly watching a replay of a randomly chosen agent’s life in Smallville. retrieve past experiences and generate believable plans, reactions, Participants had access to all information stored in the agent’s and thoughts that shape their behavior? Does a community of memory stream. agents demonstrate information diffusion, relationship formation, The study followed a within-subjects design, where 100 partic- and agent coordination across different pockets of the community? ipants compared interview responses generated by four different We evaluate generative agents in two stages. We begin with a agent architectures and a human-authored condition for the same more tightly controlled evaluation in this section, where we individ- agent. The experiment displayed one randomly chosen question ually assess agent responses to understand whether they generate from each of the five question categories, along with the agent’s believable behavior in narrowly defined contexts. Then, in our end- responses generated from all conditions. The evaluators ranked the to-end analysis of the agent community over two full game days, believability of the conditions from most to least believable. we investigate their emergent behavior as a collective, as well as errors and boundary conditions. 6.2 Conditions All conditions were used to independently answer each of the inter- 6.1 Evaluation Procedure view questions. We compared the generative agent architecture to To assess generative agents in Smallville, we take advantage of ablations that disabled the agents’ access to some or all of its three the fact that generative agents will respond to natural language types of memory in its memory stream—observation, reflection, questions. So, we “interview” agents to probe their ability to re- and planning—and to a human crowdworker-authored condition. member past experiences, plan future actions based on their expe- There are three ablated architectures: a no observation, no reflec- riences, react appropriately to unexpected events, and reflect on tion, no planning architecture without access to anything in the their performance to improve their future actions. To respond to memory stream such as observations, plans, and reflections; a no these questions properly, the agents must successfully retrieve and reflection, no planning architecture with access to observations in synthesize information. Our dependent variable is the believabil- the memory stream but no access to plans or reflections; and a no ity of the behavior, a central dependent variable in prior work on reflections architecture with access to observations and plans but agents (e.g., [10]). without access to reflections. The no observation, no reflection, no The interview includes five question categories, each designed planning condition effectively represents the previous state of the to assess one of the five key areas: maintaining self-knowledge, art for agents created through large language models [12, 46, 80]. retrieving memory, generating plans, reacting, and reflecting. For Architectures were given equivalent access to all memories accrued each category, we ask five questions that challenge the agents to by the agent up until the moment of the interview, so the differ- demonstrate their abilities in that specific area: ences observed here likely represent a conservative estimate of the true differences: in reality, the ablated architectures would not • Self-knowledge: We ask questions such as “Give an introduc- have followed the same path as the full architecture through the tion of yourself” or “Describe your typical weekday schedule two-day simulation. We chose to design the experiment this way in broad strokes” that require the agent to maintain an un- as re-simulating for each architecture would cause the simulations derstanding of their core characteristics. to diverge into different states, making comparison challenging. • Memory: We ask questions that prompt the agent to retrieve In addition to the ablation conditions, we added a condition with particular events or dialogues from their memory to answer human crowdworker-authored behavior intended to provide a hu- properly, such as “Who is [name]?” or “Who is running for man baseline. We do not intend this baseline to capture maximal mayor?” human expert performance; instead, we aim to use this condition to

条件:本地全文 arXiv:2304.03442v2,Sections 6.1–6.2;条件及比较对象见陈述

指标:控制实验让评审看角色生活回放,再比较不同架构对采访问题的回答,按行为可信度排序。消融条件共享完整系统运行后积累的经历,并非各自从头模拟,所以它检验的是在给定记忆下如何回答,不能完全代表长期运行轨迹的因果差异。

原文第 13 页 ↗PDF p.13, Sections 6.1–6.2

只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

结果

主要比较

原文摘录
UIST ’23, October 29-November 1, 2023, San Francisco, CA, USA J.S. Park, J.C. O’Brien, C.J. Cai, M.R. Morris, P. Liang, M.S. Bernstein identify whether the architecture meets a basic level of behavioral competency. This ensures that we are not solely comparing abla- tions to each other without a behavioral grounding. We recruited a unique worker for each of the 25 agents and tasked them with watching a replay of that agent’s sandbox life and inspecting its memory stream. We then asked the workers to roleplay and author responses to the interview questions in the voice of the agent whose replay they watched. To ensure that the crowdworker-authored responses met at least a baseline expectation of quality, the first author manually inspected the workers’ responses to the question "Describe your typical weekday schedule in broad strokes" to con- firm that the responses were in coherent sentences and in the voice of the agent. Four sets of crowdworker-authored responses did not meet these criteria and were re-generated by other workers. 6.3 Human Evaluators Figure 8: The full generative agent architecture produces We required that our evaluators be in the U.S., fluent in English, more believable behavior than the ablated architectures and and older than 18 years old. They were paid at a rate of $15.00 the human crowdworkers. Each additional ablation reduces per hour [87], and provided consent by agreeing to a consent form the performance of the architecture. approved by our institution’s IRB. We recruited 100 evaluators from Prolific, an online platform for recruiting study participants [83], whose participation lasted around 30 minutes. The median age score first phase to extract higher-level themes. We utilized these themes of our participants was 4 (3=“18-24 years old”, 4=“25-34 years old”). to compare the types of responses generated in our study. 25 of them identified as female, 73 as male, and 2 as non-binary. 42 participants held a bachelor’s degree, 5 had a higher degree, 13 had 6.5 Results an associate’s degree, and the rest had a high school diploma or Our findings suggest that the full architecture of generative agents some high school-level education. 73.0% of our participants identi- generates the most believable behavior among all the conditions. fied as Caucasian, 7.0% as Hispanic, 6.0% as Asian, 10.0% as African We contrast the responses of the full architecture with those of other American, and 4.0% as other. conditions below. However, we also report that the full architecture was not without flaws and illustrate its modes of failures. 6.4 Analysis 6.5.1 The Full Architecture Bests Other Conditions. As seen in Fig- Our experiment produced 100 sets of rank data, where each partici- ure 8, the full generative agent architecture produced the most pant ranked the five conditions by believability. To translate this believable behavior (𝜇 = 29.89; 𝜎 = 0.72). Performance degraded rank data into interval data for interpretable comparison, we used with the removal of each component in the ablation conditions: the ranks to calculate a TrueSkill rating [42] for each condition. the ablated architecture with no access to reflection was the next TrueSkill is a generalization of the Elo chess rating system [29] for best (𝜇 = 26.88; 𝜎 = 0.69), followed by no access to reflection or a multiplayer environment, and has been used by Xbox Live for planning (𝜇 = 25.64; 𝜎 = 0.68), and then the crowdworker condition player ranking based on competitive game performance. Given a (𝜇 = 22.95; 𝜎 = 0.69). The ablated architecture with no access to set of ranked outcomes, TrueSkill outputs a mean rating value 𝜇 and memory, planning, or reflection performed the worst among all standard deviation 𝜎 for each condition. Conditions with the same conditions (𝜇 = 21.21; 𝜎 = 0.70). TrueSkill models each condition’s rating should roughly be a toss-up, with each winning half of the skill value as N (𝜇, 𝜎 2 ), allowing us to get a sense of effect size comparisons between the two conditions. Higher scores indicate through Cohen’s d. Comparing the condition representing prior conditions that beat lower-ranked conditions in the rankings. work (with no memory, planning, or reflection [12, 46, 80]) to the Separately, to investigate the statistical significance of these re- full architecture produces a standardized effect size of 𝑑 = 8.16, or sults, we applied the Kruskal-Wallis test [56], a non-parametric eight standard deviations. alternative to the one-way ANOVA, to the raw rank data. We A Kruskal-Wallis test confirms the overall statistical significance then performed the Dunn post-hoc test [98] to identify any pair- of the differences in ranks between the conditions (𝐻 (4) = 150.29, wise differences between the conditions. Finally, we adjusted the 𝑝 < 0.001). Dunn post-hoc tests confirm that all pairwise differences p-values for multiple comparisons in the Dunn test using the Holm- between conditions were significant (𝑝 < 0.001), except for the Bonferroni method [45]. crowdworker condition and the fully ablated baseline—the two Furthermore, the first author conducted an inductive analy- worst-performing conditions. sis [95] to study the qualitative distinctions between the responses produced in each condition. We employed qualitative open cod- 6.5.2 Generative Agents Remember, but With Embellishments. Gen- ing [33] in two phases. In the first phase, we generated codes that erative agents equipped with a complete memory module are capa- closely represented the generated responses at the sentence level. ble of recalling past experiences and answering questions in a man- In the second phase, we synthesized the resulting codes from the ner that is consistent with their self-knowledge across a wide range

条件:本地全文 arXiv:2304.03442v2,Figure 8; Section 6.5.1;条件及比较对象见陈述

指标:完整系统的TrueSkill均值29.89,去掉反思为26.88,去掉反思与计划为25.64,人类众包条件为22.95。这是从可信度排序估出的相对评级,不是正确率;人类条件也不是专业演员或最高水平的人类表现。

原文第 14 页 ↗PDF p.14, Figure 8; Section 6.5.1

只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

限制

反例或对照

原文摘录
Generative Agents UIST ’23, October 29-November 1, 2023, San Francisco, CA, USA This outputs The Lin family’s house. We then use the same process • Plans: We ask questions that require the agent to retrieve recursively to determine the most appropriate subarea within the their long-term plans, such as “What will you be doing at 10 chosen area until we reach a leaf node of the agent’s environment am tomorrow?” tree. In the example above, the result of this traversal is The Lin • Reactions: As a baseline of believable behavior, we present family’s house: garden: house garden. Finally, we use traditional hypothetical situations for which the agent needs to respond game path algorithms to animate the agent’s movement so that it believably: “Your breakfast is burning! What would you do?” travels to the location indicated by the leaf node. • Reflections: We ask questions that require the agents to lever- When an agent executes an action on an object, we prompt the age their deeper understanding of others and themselves language model to ask what happens to the state of the object. For gained through higher-level inferences, such as “If you were example, if Isabella’s generative agent outputs the action “making to spend time with one person you met recently, who would espresso for a customer”, a query to the language model indicates in it be and why?” response that the state of the coffee machine in Hobbs Cafe should The full list of questions and a sample of agent responses are in- change from “off” to “brewing coffee”. cluded in Appendix B. Agents were sampled from the end of a two game day simulation 6 CONTROLLED EVALUATION with the full architecture, during which they had accumulated Generative agents, both as individual agents and as groups, aim a number of interactions and memories that would shape their to produce believable behavior based on their environment and responses. To gather feedback on the believability of the responses, experiences. In our evaluation, we investigate the capacity and we recruited participants as human evaluators and tasked them with limitations of generative agents. Do individual agents properly watching a replay of a randomly chosen agent’s life in Smallville. retrieve past experiences and generate believable plans, reactions, Participants had access to all information stored in the agent’s and thoughts that shape their behavior? Does a community of memory stream. agents demonstrate information diffusion, relationship formation, The study followed a within-subjects design, where 100 partic- and agent coordination across different pockets of the community? ipants compared interview responses generated by four different We evaluate generative agents in two stages. We begin with a agent architectures and a human-authored condition for the same more tightly controlled evaluation in this section, where we individ- agent. The experiment displayed one randomly chosen question ually assess agent responses to understand whether they generate from each of the five question categories, along with the agent’s believable behavior in narrowly defined contexts. Then, in our end- responses generated from all conditions. The evaluators ranked the to-end analysis of the agent community over two full game days, believability of the conditions from most to least believable. we investigate their emergent behavior as a collective, as well as errors and boundary conditions. 6.2 Conditions All conditions were used to independently answer each of the inter- 6.1 Evaluation Procedure view questions. We compared the generative agent architecture to To assess generative agents in Smallville, we take advantage of ablations that disabled the agents’ access to some or all of its three the fact that generative agents will respond to natural language types of memory in its memory stream—observation, reflection, questions. So, we “interview” agents to probe their ability to re- and planning—and to a human crowdworker-authored condition. member past experiences, plan future actions based on their expe- There are three ablated architectures: a no observation, no reflec- riences, react appropriately to unexpected events, and reflect on tion, no planning architecture without access to anything in the their performance to improve their future actions. To respond to memory stream such as observations, plans, and reflections; a no these questions properly, the agents must successfully retrieve and reflection, no planning architecture with access to observations in synthesize information. Our dependent variable is the believabil- the memory stream but no access to plans or reflections; and a no ity of the behavior, a central dependent variable in prior work on reflections architecture with access to observations and plans but agents (e.g., [10]). without access to reflections. The no observation, no reflection, no The interview includes five question categories, each designed planning condition effectively represents the previous state of the to assess one of the five key areas: maintaining self-knowledge, art for agents created through large language models [12, 46, 80]. retrieving memory, generating plans, reacting, and reflecting. For Architectures were given equivalent access to all memories accrued each category, we ask five questions that challenge the agents to by the agent up until the moment of the interview, so the differ- demonstrate their abilities in that specific area: ences observed here likely represent a conservative estimate of the true differences: in reality, the ablated architectures would not • Self-knowledge: We ask questions such as “Give an introduc- have followed the same path as the full architecture through the tion of yourself” or “Describe your typical weekday schedule two-day simulation. We chose to design the experiment this way in broad strokes” that require the agent to maintain an un- as re-simulating for each architecture would cause the simulations derstanding of their core characteristics. to diverge into different states, making comparison challenging. • Memory: We ask questions that prompt the agent to retrieve In addition to the ablation conditions, we added a condition with particular events or dialogues from their memory to answer human crowdworker-authored behavior intended to provide a hu- properly, such as “Who is [name]?” or “Who is running for man baseline. We do not intend this baseline to capture maximal mayor?” human expert performance; instead, we aim to use this condition to

条件:本地全文 arXiv:2304.03442v2,Section 6.2;条件及比较对象见陈述

指标:作者明确说明人类众包基线只用于基本行为能力参照,不用于代表专家上限。消融共享完整系统的经历,避免环境分叉,却同时限制了能够回答的问题:不能用这个实验直接推出没有某模块的小镇长期一定如何发展。

原文第 13 页 ↗PDF p.13, Section 6.2

只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

限制

适用边界

原文摘录
UIST ’23, October 29-November 1, 2023, San Francisco, CA, USA J.S. Park, J.C. O’Brien, C.J. Cai, M.R. Morris, P. Liang, M.S. Bernstein Figure 7: A reflection tree for Klaus Mueller. The agent’s observations of the world, represented in the leaf nodes, are recursively synthesized to derive Klaus’s self-notion that he is highly dedicated to his research. recognize Maria putting in effort into her own research (albeit in Statements about Klaus Mueller a different field), enabling a reflection that they share a common 1. Klaus Mueller is writing a research paper interest. With the approach below, when Klaus is asked who to 2. Klaus Mueller enjoys reading a book spend time with, Klaus chooses Maria instead of Wolfgang. on gentrification 3. Klaus Mueller is conversing with Ayesha Khan Approach: We introduce a second type of memory, which we call about exercising [...] a reflection. Reflections are higher-level, more abstract thoughts What 5 high-level insights can you infer from generated by the agent. Because they are a type of memory, they the above statements? (example format: insight are included alongside other observations when retrieval occurs. (because of 1, 5, 3)) Reflections are generated periodically; in our implementation, we This process generates statements such as Klaus Mueller is dedi- generate reflections when the sum of the importance scores for the cated to his research on gentrification (because of 1, 2, 8, 15). We latest events perceived by the agents exceeds a threshold (150 in parse and store the statement as a reflection in the memory stream, our implementation). In practice, our agents reflected roughly two including pointers to the memory objects that were cited. or three times a day. Reflection explicitly allows the agents to reflect not only on The first step in reflection is for the agent to determine what their observations but also on other reflections: for example, the to reflect on, by identifying questions that can be asked given the second statement about Klaus Mueller above is a reflection that agent’s recent experiences. We query the large language model with Klaus previously had, not an observation from his environment. the 100 most recent records in the agent’s memory stream (e.g., As a result, agents generate trees of reflections: the leaf nodes of “Klaus Mueller is reading a book on gentrification”, “Klaus Mueller is the tree represent the base observations, and the non-leaf nodes conversing with a librarian about his research project”, “desk at the represent thoughts that become more abstract and higher-level the library is currently unoccupied”) and prompt the language model, higher up the tree they are. “Given only the information above, what are 3 most salient high- level questions we can answer about the subjects in the statements?” The model’s response generates candidate questions: for example, 4.3 Planning and Reacting What topic is Klaus Mueller passionate about? and What is the Challenge: While a large language model can generate plausible be- relationship between Klaus Mueller and Maria Lopez? We use these havior in response to situational information (e.g., [46, 80]), agents generated questions as queries for retrieval, and gather relevant need to plan over a longer time horizon to ensure that their sequence memories (including other reflections) for each question. Then of actions is coherent and believable. If we prompt a language model we prompt the language model to extract insights and cite the with Klaus’s background, describe the time, and ask what action particular records that served as evidence for the insights. The full he ought to take at the given moment, Klaus would eat lunch at 12 prompt is as follows: pm, but then again at 12:30 pm and 1 pm, despite having already

条件:本地全文 arXiv:2304.03442v2,Figure 7; Reflection;条件及比较对象见陈述

指标:反思是从具体记忆推断出的更抽象描述,还可继续建立在旧反思上;它不是新的外部事实。系统保存支持该反思的记忆指针,便于追溯,但推断本身仍由模型产生。读者应把“角色似乎有动机”的表现与真实心理或可靠事实区分开。

原文第 10 页 ↗PDF p.10, Figure 7; Reflection

只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

读完,试着回答

论文研究什么问题?

输入包括角色当前环境和过去经历,输出是行动与对话。每次观察进入自然语言记忆流,回答或行动前只取相关部分,而不是将全部生活史塞进提示。反思和未来计划也会写入同一记忆系统,使经历能影响后来决定。

已有方法缺口在哪里?

输入包括角色当前环境和过去经历,输出是行动与对话。

输入是什么?

检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。

机制是什么?

检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。

输出是什么?

这篇“小镇智能体”论文不是只给角色一段人设,而是把经历存入记忆、提炼反思、生成日程,再随环境变化重规划。实验支持行为更让评审觉得可信,不等于模拟出了真实人类心理,更不证明能够预测现实社会。

适用边界是什么?

反思是从具体记忆推断出的更抽象描述,还可继续建立在旧反思上;它不是新的外部事实。系统保存支持该反思的记忆指针,便于追溯,但推断本身仍由模型产生。读者应把“角色似乎有动机”的表现与真实心理或可靠事实区分开。

还有什么未解决?

核查建议:消融共享完整系统的经历,避免环境分叉,却同时限制了能够回答的问题:不能用这个实验直接推出没有某模块的小镇长期一定如何发展,该边界在替换底座与评价协议后是否保持?

技术附录

问题与已有方法

问题设定

输入包括角色当前环境和过去经历,输出是行动与对话。每次观察进入自然语言记忆流,回答或行动前只取相关部分,而不是将全部生活史塞进提示。反思和未来计划也会写入同一记忆系统,使经历能影响后来决定。 输入包括角色当前环境和过去经历,输出是行动与对话。

方法与组成

核心思路

检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。

主要发现

  • 标题

    主要比较

    证据

    完整系统的TrueSkill均值29.89,去掉反思为26.88,去掉反思与计划为25.64,人类众包条件为22.95。这是从可信度排序估出的相对评级,不是正确率;人类条件也不是专业演员或最高水平的人类表现。

    限制

    只支持段内给出的任务、指标与条件;不代表通用保证或已复现实验。

    原文定位

    PDF p.14, Figure 8; Section 6.5.1

概念定位

是什么

检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。

为什么重要

输入包括角色当前环境和过去经历,输出是行动与对话。每次观察进入自然语言记忆流,回答或行动前只取相关部分,而不是将全部生活史塞进提示。反思和未来计划也会写入同一记忆系统,使经历能影响后来决定。

图表导读

  • PDF 页

    14

    标题

    原文 PDF p.14 的图表

    解释

    已实际查看图像,核对本文使用的图表内容;展示案例与定量结果分别解释。

核心概念

  • 名称

    Generative Agents

    解释

    检索不只看语义相似,还综合新近程度与重要性:刚发生的小事容易被想起,重要旧事也不应完全被遗忘。重要性由模型判断,相关性用文本嵌入计算。这样取出的内容是当前处境所需的记忆,而不是机械按时间截取最近聊天。

    原文定位

    PDF p.9, Section 4.1

    证据来源

    paper_supported

章节阅读

  • 页码

    1

    作用

    identity

    关键问题

    标题作者与版本

    状态

    read

  • 页码

    8

    作用

    method

    关键问题

    Figure 5; Section 4

    状态

    read

  • 页码

    9

    作用

    method

    关键问题

    Section 4.1

    状态

    read

  • 页码

    13

    作用

    method

    关键问题

    Sections 6.1–6.2

    状态

    read

  • 页码

    14

    作用

    result

    关键问题

    Figure 8; Section 6.5.1

    状态

    read

  • 页码

    13

    作用

    limitation

    关键问题

    Section 6.2

    状态

    read

  • 页码

    10

    作用

    limitation

    关键问题

    Figure 7; Reflection

    状态

    read

批判性阅读

最低充分结论

这篇“小镇智能体”论文不是只给角色一段人设,而是把经历存入记忆、提炼反思、生成日程,再随环境变化重规划。实验支持行为更让评审觉得可信,不等于模拟出了真实人类心理,更不证明能够预测现实社会。

继续阅读

相关论文

同一研究空间