Giter Site home page Giter Site logo

agentlab's Introduction

πŸ₯³ AgentLab: A large language model-based simulation toolkit for social science research

PyPI

logo

πŸ”¨ Quick Install

conda create -n AISimu python==3.10
pip install AISimuToolKit
python demo_leaderless_discuss.py
python demo_meeting.py

πŸ₯Έ Functions

  1. Use LLM to simulate agents with different profiles
    • openai gpt-3.5-turbo
    • llaMA-7B (Need to deploy yourself)
      1. download llaMA-7B weight and put it in model/llama-7b directory
      2. download alpaca-lora-7b weight and put it in model/alpaca-lora-7b directory
      3. deploy
      docker run -it --name test -v model:/usr/src/app/model -v data:/usr/src/app/data -v result:/usr/src/app/result --gpus all  llama_service:v1
      export PYTHONPATH=/usr/src/app/
      cd src/deploy/
      python deploy.py
  2. Serial and parallel experiment, see demo
  3. Memory compression => summary, reflect and finetune
    • summary
    • reflect
    • finetune We use a language model to convert recent experiences into conversational corpus for finetune. The function is currently available, but what parameters can be set to make the model remember these experiences needs to be further tested.(Feel free to contact us if you have any πŸ’‘ideas)
  4. A kit for simulation experiments

πŸ‘€ Demo

  1. Serial example demo_leaderless_discuss.py
    Background Four people, Alice, Sophia, Jerre and Benjamin with different profiles are interviewing to be volunteers for the Olympics. This is a leaderless panel. The topic of discussion was "Minority language volunteers take half an hour to get to the site. As the only volunteer on site, now how will you inform foreigners of minority language that they must wear masks before entering the site"
    Result
demo_leaderless_discussion_1
demo_leaderless_discussion_2
  1. Parallel example demo_meeting.py
    Background Alice needs hold a project progress docking meeting this afternoon.She is so busy she don't have time to schedule meetings herself. Alice needs her secretary, Bob, to arrange a meeting for the rest of the project, including Carol and Dave, in the conference room at 3:00 this afternoon.
    Result Bob can send the meeting notification, but the subsequent freedom is too high. More restrictions and testing are needed...

πŸ“ TODO list

  • Decoupling prompt
  • Add environment
    • Social
    • Physical
  • Fine-grained time scheduling
  • Better serial and parallel logic including Automatic identification group
  • Explore the finetune parameter to make the model remember these experiences
  • Support more LLMs

πŸ‘‹ Contributing

Thank you for your attention and support to this project. If you find a problem or have suggestions for improvement, please feel free to create an Issue in this warehouse, we will deal with it in time.

If you are interested in contributing to the project, feel free to Fork this repository and submit your code. We welcome all contributors !

πŸ™‡ References & Thanks

  1. LOGO https://clipdrop.co/stable-diffusion
  2. Reflect https://arxiv.org/abs/2304.03442
  3. LLaMA-7B https://github.com/facebookresearch/llama
  4. alpaca-lora https://github.com/tloen/alpaca-lora

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.