Code Monkey home page Code Monkey logo

generative-agents's Introduction

Generative Large Language Models for Human-Like Behavior

This repository includes a working version of the type of model described in Generative Agents: Interactive Simulacra of Human Behavior.

Setup

The models are distributed as notebooks that are easy to run locally, or on Google Colab. We recommend the use of Jupyter Lab if running locally. The notebook(s) should work as-is on Google Colab.

How to Use

Model

The current model is a simulation of the town of Phandalin from an introductory D&D 5e adventure. This setting is chosen as it is much more free form than the simple scenario described in the original paper.

Limitations

The model, as described in the paper, requires access to a very high quality instruction model such as GPT-3. However, the model also requires many high-context queries to work, making it expensive to run. As such, in this work we use low-parameter, locally runnable models instead.

We expect that with the advent of the next generation of instruction-tuned models, the model in this repo will perform better.

Future Steps

  • Summarize agent decisions as emojis. (WIP)
  • Create a family of questions to compress agent contexts better.
  • Check if the agent contexts are compressed well with an another layer of prompts.

generative-agents's People

Contributors

danieltea avatar mkturkcan avatar prasanth50 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generative-agents's Issues

Incomplete Implementation of Memory-Based Decision Making and Planning

Dear Team,

I'm writing this issue to discuss an aspect of the code related to the behavior, planning, and memory of the agents in the simulation. From my observation of the code, it seems that the agents do not alter their behaviors or plans based on their memories. Furthermore, the decision on which location to visit is not solely based on their plans.

Lack of Memory-based Decision Making: The agents do not seem to make decisions or alter their behaviors based on their memories. An agent's memory of past actions or encounters should influence their future behaviors and decisions. This crucial aspect of memory seems to be missing in the current implementation.

Non-dynamic Planning: The agents' plans do not update based on new memories or encounters. In a realistic scenario, an agent would adapt its plans according to its experiences and memories. However, this doesn't seem to be the case in the current code.

Memory Retrieval: The current memory retrieval only implements the importance aspect from the original text. It lacks the complexity of real-world memory retrieval, which also involves factors like recency, emotional intensity, etc.

I believe addressing these issues could significantly enhance the realism and complexity of the agent's behaviors and interactions in the simulation. Looking forward to your feedback and potential improvements to this aspect of the simulation.

Best Regards,
Zack

Could not load model declare-lab/flan-alpaca-xl

When run second block, an error occurred (error information attached below). It seems I lack the model. How should I get this model, and where should it be placed?
`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [8], in <cell line: 4>()
1 from transformers import pipeline
3 prompt = "Write an email about an alpaca that likes flan"
----> 4 model = pipeline(model="declare-lab/flan-alpaca-xl", device=0)
5 model(prompt, max_length=128, do_sample=True)

File ~/miniconda3/lib/python3.8/site-packages/transformers/pipelines/init.py:776, in pipeline(task, model, config, tokenizer, feature_extractor, image_processor, framework, revision, use_fast, use_auth_token, device, device_map, torch_dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)
772 # Infer the framework from the model
773 # Forced if framework already defined, inferred if it's None
774 # Will load the correct model if possible
775 model_classes = {"tf": targeted_task["tf"], "pt": targeted_task["pt"]}
--> 776 framework, model = infer_framework_load_model(
777 model,
778 model_classes=model_classes,
779 config=config,
780 framework=framework,
781 task=task,
782 **hub_kwargs,
783 **model_kwargs,
784 )
786 model_config = model.config
787 hub_kwargs["_commit_hash"] = model.config._commit_hash

File ~/miniconda3/lib/python3.8/site-packages/transformers/pipelines/base.py:271, in infer_framework_load_model(model, config, model_classes, task, framework, **model_kwargs)
268 continue
270 if isinstance(model, str):
--> 271 raise ValueError(f"Could not load model {model} with any of the following classes: {class_tuple}.")
273 framework = "tf" if "keras.engine.training.Model" in str(inspect.getmro(model.class)) else "pt"
274 return framework, model

ValueError: Could not load model declare-lab/flan-alpaca-xl with any of the following classes: (<class 'transformers.models.auto.modeling_tf_auto.TFAutoModelForSeq2SeqLM'>, <class 'transformers.models.t5.modeling_tf_t5.TFT5ForConditionalGeneration'>).`

IndexError: Replacement index 6 out of range for positional args tuple

When run the notebook on google colab


IndexError Traceback (most recent call last)
in <cell line: 2>()
7
8 for name in people:
----> 9 prompt = "You are {}. {} You are planning to: {}. You are currently in {} with the following description: {}. It is currently {}:00. The following people are in this area: {}. You can interact with them.".format(name, plans[name], location, town_areas[location], str(global_time), ', '.join(people))
10 people_description = []
11 for i in people:

IndexError: Replacement index 6 out of range for positional args tuple

Stops after 40+ min

No an issue as such, rather more a question.
I looked briefly over the code but could not see a time limiter or any specific exit criteria.
But that said, i not went all over it line by line.

Is this by design?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.