laitimes

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

author:Quantum Position

Rich color comes from the temple of Wofei

Qubits | Official account QbitAI

The multi-agent universe that can easily simulate social experiments is here -

It was launched by Tsinghua University, together with Beijing Post and WeChat teams, and has won 1.1k stars on GitHub.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

The name is simple and crude, just "AgentVerse".

Focus: This environment is specifically for large-language model development, that is, agents can use the capabilities of LLM to complete tasks.

And with just a few simple lines of configuration, you want the agents to grow in whatever environment they are born in.

For example, "Prisoner's Dilemma":

The prison guards presented the two suspects with a dilemma, letting them decide for themselves whether to cooperate or betray.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

For example, "NLP classroom":

Professors teach in the form of text, and student agents learn knowledge step by step by raising their hands when they have questions and only after being named before they can speak and ask questions.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

You can even simulate a simple Pokémon game... And it's the kind that users can directly participate in:

(Dialogue by entering text)

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

It's up to you to play what you want.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

The authors also say that the original intention of this project is to simplify the process of building custom multi-agent environments with LLM, so that everyone can focus on the research itself.

At present, the AgentVerse paper has been released, and the source code is on the way.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

Hurry up and take a look.

4 stages, 5 basic components

Just as AgentVerse was developed for large models, the effect of human training of agents is now with the blessing of various LLMs, and has improved a lot, such as stronger generalization ability.

However, just like in the real world, even with the help of LLM, learning to cooperate is something these agents must experience.

Here, the authors propose a multi-agent environment construction framework AgentVerse.

Its workflow simulates the process of human cooperation in solving a problem and is divided into 4 stages:

1. Expert recruitment.

Adjust which agents handle the task according to the current problem resolution progress.

2) Discuss collaborative decisions.

The agents recruited at the previous stage discuss the division of labor required to solve the problem, and a consensus needs to be reached.

3. Action Execution

Agents interact with the environment to complete tasks.

4. Evaluation

After the task is completed, this module compares the current state with the desired goal, and sends a feedback reward back to the first step if the expectation is not met.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

As mentioned at the beginning, one of the highlights of the AgentVerse framework is the implementation of custom environment configurations.

So how to customize?

The method is through 5 basic components.

Each component represents a rule, and combining different rules can build different environments, which is convenient for researchers to study the behavior of agents under different conditions.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

Specifically, the five components are:

  • Describer, which provides each agent with a description of each environment. By customizing the component, you can build the environment to your own specific requirements.
  • Order, which defines the order in which agents take actions in the environment, can take several default options, such as random, sequential, and concurrent, or can be customized.
  • Selector, sometimes the agent will generate some invalid information, it is used to filter this information, select the valid content.
  • Updater, which is used to update the memory of each agent. This is because sometimes an agent's response should not be seen by all agents (e.g. not in a room), and its role is to update only what each agent should see after each response occurs.
  • Visibility, which maintains a list of agents and updates the list to all agents whenever an agent moves to another room or makes other changes.

In addition to these 5 basic components, AgentVerse also has a very basic element: agent.

At present, the system provides two types: one is ConversationAgent and the other is ToolAgent, which means as its name suggests.

Of course, by inheriting the BaseAgent class, we can also customize the third and more types of agents.

How to configure?

Manual clone or pip commands can install AgentVerse.

It should be noted that you will have to prepare an OpenAI API key and install BMTools (optional, if you need the various extensions it provides).

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

When you're ready, as above:

1. We can directly run the examples they set up.

In addition to the "prisoner's dilemma", NLP classroom, and Pokémon game shown at the beginning, there are also software design scenarios (1 code writing agent, 1 test agent, 1 review agent), database management scenarios, and text evaluation scenarios.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

It is worth noting that on the topic of NLP classroom, the author provides a very large number of environments to choose from:

In addition to the question-and-ask case shown at the beginning, there are also the ability to initiate group discussions, students use Bing to search while listening to lessons, play arithmetic games with the WolframAlpha API, and so on.

2. Build one yourself.

Do it yourself with a simple one, such as building a classroom environment with only 1 professor, 1 student, and 1 teaching assistant.

First, create a task directory and configure the environment, which is the configuration of the five basic components described above:

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

Then there's the configuration agent, and here's an example from the professor:

You can see the agent type, name, LLM type used, and other information.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

Finally, write an output parser to serve Gent's response, for example, you can let the model output in the following format in the prompt template:

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

That's the general flow of a simple classroom environment.

To see that the steps are not complicated, of course, the specific operation is still referred to the original article of the project.

If you think this is too simple, you can also customize a more complex one. But the specific tutorial is not yet out (it is said that it will be soon).

Judging from the information disclosed by the author in advance, it is generally carried out around the five basic components, the environment itself and the agent.

In addition, AgentVerse will add some powerful functions in the future, such as support for local LLM, adding documents, etc., which can be expected.

One More Thing

In the paper, the authors also study some of the social behaviors of agents in multi-agent collaboration tasks constructed by the AgentVerse environment.

These behaviors include:

(1) Positive behavior, such as in the Minecraft game, offering to collect sugar cane with other agents to speed up the papermaking process, or helping people who have not yet completed fur collection;

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

(2) Negative behaviors, such as herd conformity, sabotage.

Tsinghua intelligent entity universe is on fire, AI simulation "prisoner's dilemma" and other experiments only need a few lines of simple configuration

Here, the authors also discuss possible strategies for reusing positive behaviors, discarding negative behaviors, and ultimately improving the ability of multi-agent cooperation.

Interested readers can consult the paper further.

Project Address:

https://github.com/OpenBMB/AgentVerse

Paper Address:

https://arxiv.org/abs/2308.10848

— End —

Qubits QbitAI · Headline number signed

Follow us and be the first to know the latest scientific and technological trends