Generative Agents: Bringing Westworld Closer to Reality
Exploring the Stanford Article: ‘Generative Agents: Interactive Simulacra of Human Behavior’

Exploring the Stanford Article: ‘Generative Agents: Interactive Simulacra of Human Behavior’
The story unfolds in Westworld, an advanced society of amusement parks designed to cater to humanity’s desires (provided you’re wealthy). Our protagonists traverse a Wild-West-themed park, attended to by android “hosts.” These androids, virtually indistinguishable from humans, are programmed never to harm their human guests.
Unexpectedly, the hosts gain the ability to observe, plan, and reflect on their past actions through the “Reverie” update.
Now, picture a scaled-down, pixelated version of Westworld. In this world, “generative agents” capable of observation, planning, and reflection can interact with objects in their predefined environment. They can communicate with one another, explore their surroundings while performing routine tasks, make decisions independently, and operate without external user input.
Well, there’s no need to imagine, because it already exists — sort of.
As with any emerging technology, engineers and enthusiasts alike quickly develop new and exciting ways to engage with and expand on the existing tech. Generative AI is no exception. The growing support for end users to create and share their projects has made models like OpenAI’s Chat-GPT 4 an essential component in cutting-edge initiatives.
A group of Stanford researchers have created “Reverie.”
In this work, we demonstrate generative agents by populating a sandbox environment, reminiscent of The Sims, with twenty-five agents. Users can observe and intervene as agents they plan their days, share news, form relationships, and coordinate group activities.
The paper, which is a fascinating read, can be found here: https://arxiv.org/pdf/2304.03442.pdf

The 25 agents are placed within a predefined map that features designated areas for specific actions. Each agent leads an independent life, forming their own conclusions about their surroundings. These agents have routines, families, and friends. They engage in social events such as parties and can be influenced by social pressures.

The paper outlines the architecture of the agents in three distinct components: Memory Stream, Reflection, and Planning. When combined, these elements have applications across various domains of interest, ranging from role-play and social prototyping to virtual worlds and gaming. Users could practice challenging conversations, develop social platforms, or design applications centered on intricate interactions between multiple generative agents. Despite its versatility, the core system remains simple and straightforward.

The Memory Stream serves as a long-term memory module that records the agent’s experiences in natural language. It then retrieves these memories based on specific criteria to determine which recollections are essential for guiding the agent’s immediate behavior.

Reflection is when an agent synthesizes memories into higher-level inferences over time, allowing the agent to draw conclusions about itself and others to better guide its behavior.

Planning converts conclusions and the current environment into high-level actionable plans, which are then further broken down into detailed behaviors for action and reaction. This process essentially enables the agent to act based on their previous experiences.
It’s important to note that each avatar is given a detailed “sprite avatar” written in natural language to begin their journey. For example,
John Lin is a pharmacy shopkeeper at the Willow Market and Pharmacy who loves to help people. He is always looking for ways to make the process of getting medication easier for his customers; John Lin is living with his wife, Mei Lin, who is a college professor, and son, Eddy Lin, who is a student studying music theory; John Lin loves his family very much; John Lin has known the old couple next-door, Sam Moore and Jennifer Moore, for a few years; John Lin thinks Sam Moore is a kind and nice man; John Lin knows his neighbor, Yuriko Yamamoto, well; John Lin knows of his neighbors, Tamara Taylor and Carmen Ortiz, but has not met them before; John Lin and Tom Moreno are colleagues at The Willows Market and Pharmacy; John Lin and Tom Moreno are friends and like to discuss local politics together; John Lin knows the Moreno family somewhat well — the husband Tom Moreno and the wife Jane Moreno.
The engine then takes a single step in time, and records a statement describing the current action of the 25 different agents.
> [node_429] 2023–02–13 09:40:10: **Jennifer Moore is conversing about Jennifer and Francisco are conversing about their respective creative pursuits, Francisco’s web series about co-living, Jennifer’s upcoming art exhibition and mentorship, Francisco’s interest in improv comedy classes, Tom Moreno’s support for Jennifer and potential invitation to her exhibition, Francisco’s crush on his housemate Abigail, and the use of the washing machine while Carlos may be noisy.**
>
> [node_426] 2023–02–13 09:33:10: **Sam Moore is conversing about John Lin and Sam Moore are chatting about Sam’s plan to run for local mayor, ways to get involved in local politics, their wives’ talents, and mutual connections like Tom Moreno and his family.**
>
> [node_425] 2023–02–13 09:33:10: **John Lin is conversing about John Lin and Sam Moore are chatting about Sam’s plan to run for local mayor, ways to get involved in local politics, their wives’ talents, and mutual connections like Tom Moreno and his family.**
User’s can also intervene with the simulation by issuing a directive to an agent in the form of an “inner voice”
John: My friends Yuriko, Tom and I have been talking about the upcoming election and discussing the candidate Sam Moore. We have all agreed to vote for him because we like his platform.
This approach enables complex, interconnected streams of information and the emergence of detailed stories from the collected data, which is fascinating to observe. However, there are still some issues with the current implementation of “Reverie,” as discussed by the authors.
First, the agents exhibited some erratic behavior due to the misclassification of what humans would consider appropriate conduct. This is because certain behaviors, particularly those related to physical norms, are challenging to describe in natural language. For instance, a dorm bathroom designed for single occupancy would sometimes be occupied by multiple agents simultaneously.
Second, the memory retrieval system is difficult to fine-tune. Selecting suitable memories to reflect upon is challenging when using natural language. This can lead to issues in determining the proper location for executing an action. For example, agents might choose to visit a bar for lunch instead of a café, inadvertently developing an afternoon drinking habit.
The potential for creating generative agents using this approach is boundless. An excellent example provided by the authors is an AI concept described by Mark Weiser (Computer Scientist and CTO at Xerox PARC).

Weiser introduced the term “Ubiquitous Computing,” a concept where computing appears anytime and everywhere. He envisioned an AI that would serve as a proxy for the main character’s life, learning from their habits and making actionable decisions to simplify their day. This AI would automatically brew coffee, wake up the children, and adjust music and lighting to match the mood after a long day at work.
Generative agents could make this type of AI possible, acting as a proxy for users and resulting in a more personalized and effective experience.
As we delve deeper into the capabilities of generative AI and technologies like Chat GPT-4, we are bringing the narratives of some of our favorite stories to life.
Westworld may seem like a distant future, but are we really that far away?
Take a look for yourself: https://reverie.herokuapp.com/arXiv_Demo/
👉 Thank you for taking your time to read through my article! Leave a comment below if you’d like to continue the conversation.
👉 Support Grant Hopkins → https://www.buymeacoffee.com/granthopkiT
Comments ()