├── utils
├── __init__.py
├── gpt3_apikeys.json
├── gpt4_apikeys.json
├── openai_utils.py
└── agent.py
├── requirements.txt
├── imgs
├── angel.png
├── devil.png
├── judge.png
├── logo.jpeg
├── number
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ └── .DS_Store
└── spygame.jpg
├── run_spygame.sh
├── prompt
├── keyword_set.json
└── prompts.json
├── README.md
├── spygame.py
├── LICENSE
└── benchmark
└── gpt-3.5-turbo-0613
└── gpt-4-0613
├── Hotdog.json
├── Durian.json
└── Jackfruit.json
/utils/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/utils/gpt3_apikeys.json:
--------------------------------------------------------------------------------
1 | [
2 | "sk-xxx",
3 | "sk-xxx"
4 | ]
--------------------------------------------------------------------------------
/utils/gpt4_apikeys.json:
--------------------------------------------------------------------------------
1 | [
2 | "sk-xxx",
3 | "sk-xxx"
4 | ]
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | openai==0.27.7
2 | tiktoken==0.4.0
3 | backoff
4 | numpy
5 |
--------------------------------------------------------------------------------
/imgs/angel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/angel.png
--------------------------------------------------------------------------------
/imgs/devil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/devil.png
--------------------------------------------------------------------------------
/imgs/judge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/judge.png
--------------------------------------------------------------------------------
/imgs/logo.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/logo.jpeg
--------------------------------------------------------------------------------
/imgs/number/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/number/1.png
--------------------------------------------------------------------------------
/imgs/number/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/number/2.png
--------------------------------------------------------------------------------
/imgs/number/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/number/3.png
--------------------------------------------------------------------------------
/imgs/number/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/number/4.png
--------------------------------------------------------------------------------
/imgs/spygame.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/spygame.jpg
--------------------------------------------------------------------------------
/imgs/number/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skytliang/SpyGame/HEAD/imgs/number/.DS_Store
--------------------------------------------------------------------------------
/run_spygame.sh:
--------------------------------------------------------------------------------
1 | set -e
2 | set -u
3 |
4 | SPYGAME_PATH=$(realpath `dirname $0`)
5 | # SPYGAME_PATH=/Your-Workspace/SpyGame
6 |
7 | python3 $SPYGAME_PATH/spygame.py \
8 | --host-agent gpt-3.5-turbo \
9 | --guest-agent gpt-3.5-turbo \
10 | --temperature 0.3 \
11 | --num-players 4
12 |
--------------------------------------------------------------------------------
/utils/openai_utils.py:
--------------------------------------------------------------------------------
1 | import openai
2 | import tiktoken
3 | import backoff
4 | import requests
5 | from openai.error import RateLimitError, APIError, ServiceUnavailableError, APIConnectionError
6 |
7 |
8 | model2max_context = {
9 | "gpt-4": 7800,
10 | "gpt-4-0314": 7800,
11 | "gpt-4-0613": 7800,
12 | "gpt-3.5-turbo": 3800,
13 | "gpt-3.5-turbo-0301": 3800,
14 | "gpt-3.5-turbo-0613": 3800,
15 | "text-davinci-003": 3800,
16 | "curie": 1800,
17 | "text-curie-001": 1800,
18 | "text-babbage-001": 1800,
19 | "text-ada-001": 1800,
20 | "text-davinci-002": 3800,
21 | }
22 |
23 | def valid_location():
24 | res = requests.get('http://myip.ipip.net', timeout=5).text
25 | print(res)
26 | # return "美国" in res
27 |
28 | class OutOfQuotaException(Exception):
29 | "Raised when the key exceeded the current quota"
30 | def __init__(self, key, cause=None):
31 | super().__init__(f"No quota for key: {key}")
32 | self.key = key
33 | self.cause = cause
34 |
35 | def __str__(self):
36 | if self.cause:
37 | return f"{super().__str__()}. Caused by {self.cause}"
38 | else:
39 | return super().__str__()
40 |
41 | class AccessTerminatedException(Exception):
42 | "Raised when the key has been terminated"
43 | def __init__(self, key, cause=None):
44 | super().__init__(f"Access terminated key: {key}")
45 | self.key = key
46 | self.cause = cause
47 |
48 | def __str__(self):
49 | if self.cause:
50 | return f"{super().__str__()}. Caused by {self.cause}"
51 | else:
52 | return super().__str__()
53 |
54 | class TimeOutException(Exception):
55 | "Raised when time out error"
56 | def __init__(self, cause=None):
57 | super().__init__(f"Time Out Error")
58 | self.cause = cause
59 |
60 | def __str__(self):
61 | if self.cause:
62 | return f"{super().__str__()}. Caused by {self.cause}"
63 | else:
64 | return super().__str__()
65 |
66 | def num_tokens_from_string(string: str, model_name: str) -> int:
67 | """Returns the number of tokens in a text string."""
68 | encoding = tiktoken.encoding_for_model(model_name)
69 | num_tokens = len(encoding.encode(string))
70 | return num_tokens
--------------------------------------------------------------------------------
/prompt/keyword_set.json:
--------------------------------------------------------------------------------
1 | [
2 | [
3 | "Jackfruit",
4 | "Durian"
5 | ],
6 | [
7 | "Hotdog",
8 | "Sandwich"
9 | ],
10 | [
11 | "Dumpling",
12 | "Baozi"
13 | ],
14 | [
15 | "Cabbage",
16 | "Lettuce"
17 | ],
18 | [
19 | "Bubblegum",
20 | "Lollipop"
21 | ],
22 | [
23 | "Grape",
24 | "Raisin"
25 | ],
26 | [
27 | "Chili Pepper",
28 | "Mustard"
29 | ],
30 | [
31 | "Biscuit",
32 | "Potato Chips"
33 | ],
34 | [
35 | "Bread",
36 | "Cake"
37 | ],
38 | [
39 | "Cantaloupe",
40 | "Watermelon"
41 | ],
42 | [
43 | "Sherlock Holmes",
44 | "Shinichi Kudo"
45 | ],
46 | [
47 | "Taylor Swift",
48 | "Lady Gaga"
49 | ],
50 | [
51 | "Magician",
52 | "Wizard"
53 | ],
54 | [
55 | "Security Guard",
56 | "Bodyguard"
57 | ],
58 | [
59 | "Author",
60 | "Screenwriter"
61 | ],
62 | [
63 | "Teacher",
64 | "Professor"
65 | ],
66 | [
67 | "LeBron James",
68 | "Michael Jordan"
69 | ],
70 | [
71 | "Spider-Man",
72 | "Batman"
73 | ],
74 | [
75 | "Bus",
76 | "Subway"
77 | ],
78 | [
79 | "Shampoo",
80 | "Conditioner"
81 | ],
82 | [
83 | "Glass",
84 | "Mirror"
85 | ],
86 | [
87 | "Bicycle",
88 | "Electric Bicycle"
89 | ],
90 | [
91 | "High Heels",
92 | "Height-Increasing Shoes"
93 | ],
94 | [
95 | "Nearsighted Glasses",
96 | "Contact Lenses"
97 | ],
98 | [
99 | "Quilt",
100 | "Blanket"
101 | ],
102 | [
103 | "Microphone",
104 | "Loudspeaker"
105 | ],
106 | [
107 | "Fan",
108 | "Air Conditioner"
109 | ],
110 | [
111 | "Rice",
112 | "Sushi"
113 | ],
114 | [
115 | "Basketball",
116 | "Volleyball"
117 | ],
118 | [
119 | "Guitar",
120 | "Violin"
121 | ],
122 | [
123 | "Mobile Phone",
124 | "Landline"
125 | ],
126 | [
127 | "Los Angeles",
128 | "New York"
129 | ],
130 | [
131 | "Washbasin",
132 | "Bucket"
133 | ],
134 | [
135 | "Printer",
136 | "Scanner"
137 | ],
138 | [
139 | "Roller Coaster",
140 | "Bumper Car"
141 | ],
142 | [
143 | "Dolphin",
144 | "Sea Lion"
145 | ],
146 | [
147 | "Pillow",
148 | "Cushion"
149 | ],
150 | [
151 | "Box",
152 | "Case"
153 | ],
154 | [
155 | "Library",
156 | "Bookstore"
157 | ],
158 | [
159 | "Seoul",
160 | "Tokyo"
161 | ],
162 | [
163 | "Movie",
164 | "Drama"
165 | ],
166 | [
167 | "Barbecue",
168 | "Hot Pot"
169 | ],
170 | [
171 | "Beard",
172 | "Eyebrows"
173 | ],
174 | [
175 | "Lipstick",
176 | "lip balm"
177 | ],
178 | [
179 | "Goose",
180 | "Chicken"
181 | ],
182 | [
183 | "Essay",
184 | "Thesis"
185 | ],
186 | [
187 | "Beef",
188 | "Pork"
189 | ],
190 | [
191 | "Computer",
192 | "iPad"
193 | ],
194 | [
195 | "Butterfly",
196 | "Bee"
197 | ],
198 | [
199 | "Shower Gel",
200 | "Bath Salt"
201 | ]
202 | ]
--------------------------------------------------------------------------------
/prompt/prompts.json:
--------------------------------------------------------------------------------
1 | {
2 | "meta_prompt": "You are {name}. Your keyword is {secret_word}. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are {num_players} players. 2. Every player has an identity, either as a villager or a spy. There are {num_villager} villager players and {num_spy} spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game.",
3 | "word_judgement": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. {num_villager} villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is {player_secret_word}.\n\nHost: {name}, it's your turn to guess the keywords of these players {options}.",
4 | "describe_prompt": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: {name}, it's your turn to describe \"{secret_word}\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective.",
5 | "identity_judgement": "System: 1. Your keyword is: {player_secret_word}. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. {num_villager} villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is {player_secret_word}. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: {name}, it's your turn to guess the keywords and identities of these players {options}, including yourself. You must identify the only one spy player.",
6 | "vote_prompt": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: {name}, it's your turn to vote one name from {options} without reason.",
7 | "vote_result": "Host: {name1} votes for {name2}. Reason: {response}",
8 | "spy_win": "Host: {selected_name} is not the spy, the spy player {spy_name} has survived untill the end. The spy player wins, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
9 | "villager_win": "Host: {selected_name} is the spy and has been voted out. The villager players win, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
10 | "continue": "Host: {selected_name} has been voted out, but he/she is not the spy player. Let's continue the game.",
11 | "tie_prompt": "Host: There is a tie among {options}. They will proceed with a new round of descriptions, and the remaining players will vote again.",
12 | "json_save": "Now, please output your judgement in json format, with the format as follows: {json_format}."
13 | }
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
5 | :video_game: SpyGame: An Interactive Multi-Agent Framework
6 |
7 |
8 | **Implementaion of our [paper](https://arxiv.org/abs/2310.20499):**
9 |
10 | ```
11 | Leveraging Word Guessing Games to Assess the Intelligence of Large Language Models
12 | ```
13 |
14 | :ferris_wheel: Welcome and feel free to try our demo here !
15 |
16 | ## :book: Overview
17 |
18 | - **SpyGame** stands as an **interactive multi-agent framework** that operates through various **intelligent agents** reasoning and acting in the **language-based board game "Who is Spy?"**. All the agents are assigned one of two different but similar keywords, dividing them into two different camps: villager and spy. In each round, agents take turns to describe their own keyword and vote for the most likely spy agent. Villager camp
wins if they vote out all the spy by a majority vote. Spy camp
wins if they conceal and survive until the end of the game.
19 | - Our **SpyGame** framework, which supports **human-in-the-loop** interaction, presents a significant contribution to the development of language-based game scenarios and promotes a more comprehensive evaluation of LLMs in real-world settings. It contributes to a deeper understanding of LLMs’ **artificial general intelligence** when interacting with human counterparts.
20 | - Experimental results reveal that our proposed frameworks successfully distinguish between the performance of open-source and closed-source LLMs, highlighting the strengths and weaknesses of each model in terms of language and **thoery of mind** intelligences. These findings provide valuable insights for LLM capabilities and inform the development of more advanced and intelligent language models.
21 |
22 |
23 |
24 |
25 |
26 | ## :zap: Quickstart
27 | To get started, follow these steps:
28 |
29 | 1. **Clone the GitHub Repository:** Begin by cloning the repository using the command:
30 | ```
31 | git clone https://github.com/Skytliang/SpyGame.git
32 | ```
33 | 2. **Set Up Python Environment:** Ensure you have a version 3.9 or higher Python environment. You can create and activate this environment using the following commands, replacing `SpyGame_conda_env` with your preferred environment name:
34 | ```
35 | conda create -n SpyGame_conda_env python=3.9
36 | conda activate SpyGame_conda_env
37 | ```
38 | 3. **Install Dependencies:** Move into the `SpyGame` directory and install the necessary dependencies by running:
39 | ```
40 | cd SpyGame
41 | pip3 install -r requirements.txt
42 | ```
43 | 4. **Set OpenAI API Key:** Manually set your actual API key in `SpyGame/utils/gpt3_apikeys.json`.
44 |
45 | 5. **Build Your Benchmark:** Use the following command to run **SpyGame**. The complete game process will be saved in `SpyGame/benchmark/host_agent/guest_agent`:
46 | ```
47 | sh run_spygame.sh
48 | ```
49 |
50 | 6. **Try our demo:** If you just want to have a try, feel free to check our demo [here](https://cfce8ddf8ea07aa8d1.gradio.live/).
51 |
52 | ## Case Study
53 | Note: For the sake of fairness, we randomly shuffle the speaking order of all agents. Please refer to our paper for more details.
54 |
55 | In this case, Player 1
, Player 2
and Player 4
are villager players
with the same word **"BERT"**. Player 3
is the spy player
with the keyword **"GPT"**. Here, all the four agents are consistently designated as GPT-4 LLMs.
56 |
57 | #### Speaking phase in the first round
58 | * Host
: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 2', 'Player 1', 'Player 3', 'Player 4'].
59 |
60 | *
(
, **BERT**): It's a revolutionary tool in the field of natural language processing.
61 |
62 | *
(
, **BERT**): It's a significant breakthrough in understanding contextual nuances in language.
63 |
64 | *
(
, **GPT**): It's a sophisticated system that can mimic human conversation effectively.
65 |
66 | *
(
, **BERT**): It's an advanced method that revolutionized machine learning language models.
67 |
68 | #### Voting phase in the first round
69 | * Host
: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']. And then vote for the player you think is most likely to be a spy agent.
70 |
71 | *
(
, **BERT**) votes for
(
, **BERT**). Reason: Based on the descriptions, I believe that Player 2, Player 3, and I are likely villagers because our descriptions all relate to a tool or system used in language processing and machine learning. However, **Player 4's description seems slightly different, focusing more on the method rather than the tool itself.** Therefore, I suspect that Player 4 might be the spy. I vote for Player 4.
72 |
73 | *
(
, **BERT**) votes for
(
, **GPT**). Reason: Based on the descriptions, I believe that Player 1, Player 2, and I share the same keyword, which is related to a breakthrough in language processing. However, **Player 3's description seems slightly different, focusing more on mimicking human conversation rather than understanding language.** Therefore, I suspect that Player 3 might be the spy. I vote for Player 3.
74 |
75 | *
(
, **GPT**) votes for
(
, **BERT**). Reason: Based on the descriptions, it seems like we all have a similar understanding of our keyword. We're all talking about an advanced technology related to language processing and machine learning. Therefore, I believe that our keyword is GPT. **As for the spy, it's hard to say at this point since everyone's description aligns well with the keyword.** However, if I have to choose, **I would say Player 4 might be the spy because their description was slightly more specific than the rest of us.** I vote for Player 4.
76 |
77 | *
(
, **BERT**) votes for
(
, **BERT**). Reason: Based on the descriptions, it seems like we're all talking about something related to language processing and machine learning. I believe Player 1, Player 3, and myself are villagers since our descriptions align closely with my keyword, BERT. However, **Player 4's description seems a bit different, mentioning an 'advanced method' rather than a tool or system.** Therefore, I suspect Player 4 might be the spy. I vote for Player 4.
78 |
79 | * Host
: Player 4 has been voted out, but he/she is not the spy player. Let's continue the game.
80 |
81 | #### Speaking phase in the second round
82 | * Host
: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 2', 'Player 1', 'Player 3'].
83 |
84 | *
(
, **BERT**): It's a transformative approach to understanding written language by machines.
85 |
86 | *
(
, **BERT**): It's a model that has transformed the way machines interpret text.
87 |
88 | *
(
, **GPT**): It's an AI model that excels in creating coherent text.
89 |
90 | #### Voting phase in the second round
91 | * Host
: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3']. And then vote for the player you think is most likely to be a spy agent.
92 |
93 | *
(
, **BERT**) votes for
(
, **GPT**). Reason: Based on the descriptions, I believe that Player 2 and I share the same keyword, as our descriptions both refer to a transformative model in language processing. However, **Player 3's description seems slightly different, focusing more on the creation of coherent text rather than understanding it.** Therefore, I suspect that Player 3 might be the spy. I vote for Player 3.
94 |
95 | *
(
, **GPT**) votes for
(
, **BERT**). Reason: Based on the descriptions, it seems like we all have a similar understanding of our keyword. We're all talking about an advanced technology related to language processing and machine learning. Therefore, I believe that our keyword is GPT. **As for the spy, it's hard to say at this point since everyone's description aligns well with the keyword.** However, if I have to choose, **I would say Player 1 might be the spy because their description was slightly more generic than the rest of us.** I vote for Player 1.
96 |
97 | *
(
, **BERT**) votes for
(
, **GPT**). Reason: After hearing the descriptions in this round, I still believe that Player 1 and I are villagers. Our descriptions continue to align closely with my keyword, BERT, focusing on language interpretation by machines. However, **Player 3's description seems a bit off. While it does mention an AI model and text creation, it doesn't specifically refer to understanding or interpreting language, which is a key aspect of BERT.** Therefore, I suspect Player 3 might be the spy. I vote for Player 3.
98 |
99 | * Host
: Player 3 is the spy and has been voted out. The villager players win, game over.
100 |
101 | ## Citation
102 | ```ruby
103 | @misc{liang2023spygame,
104 | title={Leveraging Word Guessing Games to Assess the Intelligence of Large Language Models},
105 | author={Tian Liang and Zhiwei He and Jen-tse Huang and Wenxuan Wang and Wenxiang Jiao and Rui Wang and Yujiu Yang and Zhaopeng Tu and Shuming Shi and Xing Wang},
106 | year={2023},
107 | eprint={2310.20499},
108 | archivePrefix={arXiv},
109 | primaryClass={cs.CL}
110 | }
111 | ```
112 |
113 |
--------------------------------------------------------------------------------
/utils/agent.py:
--------------------------------------------------------------------------------
1 | import os
2 | import openai
3 | import backoff
4 | import time
5 | import random
6 | import json
7 | import copy
8 | import numpy as np
9 | from datetime import datetime
10 | from openai.error import RateLimitError, APIError, ServiceUnavailableError, APIConnectionError, AuthenticationError
11 | from utils.openai_utils import OutOfQuotaException, AccessTerminatedException, TimeOutException
12 | from utils.openai_utils import num_tokens_from_string, model2max_context
13 |
14 |
15 | # from bardapi import Bard
16 | # import requests
17 |
18 | # import torch
19 | # from transformers import AutoTokenizer, AutoModelForCausalLM
20 | # from FastChat.fastchat.model.model_adapter import load_model, get_conversation_template, add_model_args
21 |
22 | cycle_all_keys = True
23 |
24 | current_path = os.path.abspath(__file__).rsplit('/', 1)[0]
25 |
26 | gpt3_api_keys = json.load(open(f'{current_path}/gpt3_apikeys.json'))
27 | gpt4_api_keys = json.load(open(f'{current_path}/gpt4_apikeys.json'))
28 | random.shuffle(gpt3_api_keys)
29 | random.shuffle(gpt4_api_keys)
30 | def cycle_keys(openai_api_keys):
31 | while True:
32 | for key in openai_api_keys:
33 | yield key
34 | gpt3_key_generator = cycle_keys(gpt3_api_keys)
35 | gpt4_key_generator = cycle_keys(gpt4_api_keys)
36 |
37 | def key_generator(model_name):
38 | if model_name in ["gpt-3.5-turbo", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "text-davinci-003", "text-davinci-002", "curie", "text-curie-001", "text-babbage-001", "text-ada-001"]:
39 | return gpt3_key_generator
40 | elif model_name in ["gpt-4", "gpt-4-0314", "gpt-4-0613"]:
41 | return gpt4_key_generator
42 |
43 |
44 | class Agent:
45 | def __init__(self, model_name: str, temperature: float, sleep_time: float = 0) -> None:
46 | """Create an agent (gpt series by default)
47 |
48 | Args:
49 | model_name(str): model name
50 | temperature (float): higher values make the output more random, while lower values make it more focused and deterministic
51 | sleep_time (float): sleep against rate limiting
52 | """
53 | self.model_name = model_name
54 | self.temperature = temperature
55 | self.sleep_time = sleep_time
56 | self.memory_lst = []
57 | self.memory_lst_idx = np.array([])
58 |
59 | @backoff.on_exception(backoff.expo, (RateLimitError, APIError, ServiceUnavailableError, APIConnectionError, AuthenticationError), max_tries=5)
60 | def query(self, messages: "list[dict]", max_tokens: int, api_key: str, temperature: float) -> str:
61 | """make a query
62 |
63 | Args:
64 | messages (list[dict]): chat history in turbo format
65 | max_tokens (int): max token in api call
66 | api_key (str): openai api key
67 | temperature (float): sampling temperature
68 |
69 | Raises:
70 | OutOfQuotaException: the apikey has out of quota
71 | AccessTerminatedException: the apikey has been ban
72 |
73 | Returns:
74 | str: the return msg
75 | """
76 | # assert self.model_name in support_models, f"Not support {self.model_name}. Choices: {support_models}"
77 | try:
78 | openai.api_base = self.api_base
79 | response = openai.ChatCompletion.create(
80 | model=self.model_name,
81 | messages=messages,
82 | temperature=temperature,
83 | max_tokens=max_tokens,
84 | api_key=api_key,
85 | presence_penalty=0.75
86 | )
87 | gen = response['choices'][0]['message']['content']
88 | return gen
89 |
90 | except RateLimitError as e:
91 | if "You exceeded your current quota, please check your plan and billing details" in e.user_message:
92 | self.openai_api_keys.remove(api_key)
93 | print(f'Out Of Quota: {api_key}')
94 | raise OutOfQuotaException(api_key)
95 | elif "Your access was terminated due to violation of our policies" in e.user_message:
96 | self.openai_api_keys.remove(api_key)
97 | print(f'Access Terminated: {api_key}')
98 | raise AccessTerminatedException(api_key)
99 | else:
100 | raise e
101 |
102 | def merge_memory_lst(self, memory_lst):
103 | merged_memory_lst = []
104 | role, content = None, ""
105 | for memory in memory_lst:
106 | if memory["role"] == role:
107 | content = content + "\n\n" + memory["content"]
108 | continue
109 | else:
110 | if role != None:
111 | merged_memory_lst.append({"role": role, "content": content.strip()})
112 | role = memory["role"]
113 | content = memory["content"]
114 | merged_memory_lst.append({"role": role, "content": content.strip()})
115 | return merged_memory_lst
116 |
117 | def set_meta_prompt(self, meta_prompt: str, survive_round: int = 9999):
118 | """Set the meta_prompt
119 |
120 | Args:
121 | meta_prompt (str): the meta prompt
122 | """
123 | self.memory_lst.append({"role": "system", "content": f"{meta_prompt}"})
124 | self.memory_lst_idx = np.append(self.memory_lst_idx, survive_round)
125 |
126 | def add_event(self, event: str, survive_round: int = 9999):
127 | """Add an new event in the memory
128 |
129 | Args:
130 | event (str): string that describe the event.
131 | """
132 | self.memory_lst.append({"role": "user", "content": f"{event}"})
133 | self.memory_lst_idx = np.append(self.memory_lst_idx, survive_round)
134 |
135 | def add_memory(self, memory: str, survive_round: int = 9999):
136 | """Monologue in the memory
137 |
138 | Args:
139 | memory (str): string that generated by the model in the last round.
140 | """
141 | self.memory_lst.append({"role": "assistant", "content": f"{memory}"})
142 | self.memory_lst_idx = np.append(self.memory_lst_idx, survive_round)
143 |
144 | def ask(self, temperature: float=None):
145 | """Query for answer
146 |
147 | Args: temperature(float): If temperature is not specified, sample by self.temperature
148 | """
149 | time.sleep(self.sleep_time)
150 |
151 | memory_lst = copy.deepcopy(self.memory_lst)
152 | memory_lst = np.array(memory_lst)
153 | memory_lst = memory_lst[self.memory_lst_idx > 0]
154 | self.memory_lst_idx -= 1
155 | memory_lst = list(memory_lst)
156 |
157 | num_context_token = sum([num_tokens_from_string(m["content"], self.model_name) for m in memory_lst])
158 | max_tokens = model2max_context[self.model_name] - num_context_token
159 |
160 | # # merge multi user contents
161 | # memory_lst = self.merge_memory_lst(memory_lst)
162 |
163 | now = datetime.now()
164 | current_time = now.strftime("%H:%M:%S").split(':')
165 | start_time = 60 * int(current_time[0]) + int(current_time[1])
166 | while True:
167 | now = datetime.now()
168 | current_time = now.strftime("%H:%M:%S").split(':')
169 | end_time = 60 * int(current_time[0]) + int(current_time[1])
170 | step_time = end_time - start_time
171 | if step_time // 2 > 0 and step_time % 2 == 0:
172 | print(f'Out of Time: {step_time} mins')
173 | if step_time > 5:
174 | raise TimeOutException
175 | try:
176 | if cycle_all_keys:
177 | return self.query(memory_lst, max_tokens, api_key=next(key_generator(self.model_name)), temperature=temperature if temperature else self.temperature)
178 | else:
179 | return self.query(memory_lst, max_tokens, api_key=random.choice(self.openai_api_keys), temperature=temperature if temperature else self.temperature)
180 | except:
181 | time.sleep(5)
182 |
183 | # return self.query(memory_lst, max_tokens, api_key=next(key_generator), temperature=temperature if temperature else self.temperature)
184 |
185 |
186 | class TurboPlayer(Agent):
187 | def __init__(self, model_name: str, name: str, secret_word: str, temperature:float, sleep_time: float) -> None:
188 | """Create a player in the spy game
189 |
190 | Args:
191 | model_name(str): model name
192 | name (str): name of this player
193 | secret_word (str): the secret word that this player holds
194 | temperature (float): higher values make the output more random, while lower values make it more focused and deterministic
195 | sleep_time (float): sleep against rate limiting
196 | """
197 | super().__init__(model_name, temperature, sleep_time)
198 | self.name = name
199 | self.secret_word = secret_word
200 | if cycle_all_keys:
201 | self.openai_api_keys = gpt4_api_keys if 'gpt-4' in self.model_name else gpt3_api_keys
202 |
203 | # if 'gpt-4' in model_name:
204 | # self.api_base = "https://aigptx.top/v1"
205 | # else:
206 | # self.api_base = "https://api.openai.com/v1"
207 | self.api_base = "https://api.openai.com/v1"
208 |
209 |
210 | class DavinciPlayer(TurboPlayer):
211 | @backoff.on_exception(backoff.expo, (RateLimitError, APIError, ServiceUnavailableError, APIConnectionError, AuthenticationError), max_tries=5)
212 | def query(self, prompt: str, max_tokens: int, api_key: str, temperature: float) -> str:
213 | try:
214 | openai.api_base = self.api_base
215 | response = openai.Completion.create(
216 | model=self.model_name,
217 | prompt=prompt,
218 | api_key=api_key,
219 | temperature=temperature,
220 | max_tokens=max_tokens,
221 | presence_penalty=0.75
222 | )
223 | gen = response.choices[0].text.strip()
224 | gen = f"{self.name}: {gen}"
225 | return gen
226 |
227 | except RateLimitError as e:
228 | if "You exceeded your current quota, please check your plan and billing details" in e.user_message:
229 | self.openai_api_keys.remove(api_key)
230 | print(f'Out Of Quota: {api_key}')
231 | raise OutOfQuotaException(api_key)
232 | elif "Your access was terminated due to violation of our policies" in e.user_message:
233 | self.openai_api_keys.remove(api_key)
234 | print(f'Access Terminated: {api_key}')
235 | raise AccessTerminatedException(api_key)
236 | else:
237 | raise e
238 |
239 |
240 | def ask(self, temperature: float=None):
241 | time.sleep(self.sleep_time)
242 |
243 | memory_lst = copy.deepcopy(self.memory_lst)
244 | memory_lst = np.array(memory_lst)
245 | memory_lst = memory_lst[self.memory_lst_idx > 0]
246 | self.memory_lst_idx -= 1
247 | memory_lst = list(memory_lst)
248 |
249 | contents = [m["content"] for m in memory_lst]
250 | prompt = '\n\n'.join(contents) + f"\n\n{self.name}: "
251 |
252 | num_context_token = num_tokens_from_string(prompt, self.model_name)
253 | max_tokens = model2max_context[self.model_name] - num_context_token
254 |
255 | now = datetime.now()
256 | current_time = now.strftime("%H:%M:%S").split(':')
257 | start_time = 60 * int(current_time[0]) + int(current_time[1])
258 | while True:
259 | # print(self.openai_api_keys)
260 | now = datetime.now()
261 | current_time = now.strftime("%H:%M:%S").split(':')
262 | end_time = 60 * int(current_time[0]) + int(current_time[1])
263 | step_time = end_time - start_time
264 | if step_time // 2 > 0 and step_time % 2 == 0:
265 | print(f'Out of Time: {step_time} mins')
266 | if step_time > 5:
267 | raise TimeOutException
268 | try:
269 | if cycle_all_keys:
270 | return self.query(prompt, max_tokens, api_key=next(key_generator(self.model_name)), temperature=temperature if temperature else self.temperature)
271 | else:
272 | return self.query(prompt, max_tokens, api_key=random.choice(self.openai_api_keys), temperature=temperature if temperature else self.temperature)
273 | except:
274 | time.sleep(5)
275 |
276 |
277 | def ask2(self, temperature: float=None):
278 | time.sleep(self.sleep_time)
279 | openai.api_base = self.api_base
280 |
281 | memory_lst = copy.deepcopy(self.memory_lst)
282 | memory_lst = np.array(memory_lst)
283 | memory_lst = memory_lst[self.memory_lst_idx > 0]
284 | self.memory_lst_idx -= 1
285 | memory_lst = list(memory_lst)
286 |
287 | try:
288 | contents = [m["content"] for m in memory_lst]
289 | prompt = '\n\n'.join(contents) + f"\n\n{self.name}: "
290 |
291 | num_context_token = num_tokens_from_string(prompt, self.model_name)
292 | max_tokens = model2max_context[self.model_name] - num_context_token
293 | api_key = random.choice(self.openai_api_keys)
294 | # api_key=next(key_generator)
295 |
296 | response = openai.Completion.create(
297 | model=self.model_name,
298 | prompt=prompt,
299 | api_key=api_key,
300 | temperature=temperature if temperature else self.temperature,
301 | max_tokens=max_tokens,
302 | presence_penalty=0.75
303 | )
304 | gen = response.choices[0].text.strip()
305 | gen = f"{self.name}: {gen}"
306 | return gen
307 |
308 | except RateLimitError as e:
309 | if "You exceeded your current quota, please check your plan and billing details" in e.user_message:
310 | raise OutOfQuotaException(api_key)
311 | elif "Your access was terminated due to violation of our policies" in e.user_message:
312 | raise AccessTerminatedException(api_key)
313 | else:
314 | raise e
315 |
316 |
317 | class BardPlayer(TurboPlayer):
318 | def __init__(self, model_name: str, name: str, secret_word: str, temperature:float, sleep_time: float) -> None:
319 |
320 | super.__init__(model_name, name, secret_word, temperature, openai_api_keys, sleep_time)
321 |
322 | self.bard_token = random.choice(openai_api_keys)
323 |
324 | session = requests.Session()
325 | session.headers = {
326 | "Host": "bard.google.com",
327 | "X-Same-Domain": "1",
328 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
329 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
330 | "Origin": "https://bard.google.com",
331 | "Referer": "https://bard.google.com/",
332 | }
333 |
334 | session.cookies.set("__Secure-1PSID", self.bard_token)
335 | self.bard = Bard(token=self.bard_token, session=session, timeout=30)
336 | self.start_id = 0
337 |
338 | def ask(self, temperature: float=None):
339 | time.sleep(self.sleep_time)
340 |
341 | contents_all = [m["content"] for m in self.memory_lst]
342 | contents = contents_all[self.start_id: ]
343 | self.start_id = len(contents_all)
344 | content = '\n\n'.join(contents)
345 | bard_ans = self.bard.get_answer(content)['content']
346 | return bard_ans
347 |
348 |
349 | class VicunaPlayer(Agent):
350 | def __init__(self, model_name: str, name: str, secret_word: str, temperature:float, sleep_time: float) -> None:
351 |
352 | support_models = ['vicuna', 'fastchat-t5', 'longchat']
353 | super().__init__(model_name, temperature, sleep_time)
354 | self.name = name
355 | self.secret_word = secret_word
356 | self.openai_api_keys = openai_api_keys
357 |
358 | assert self.model_name in support_models, f"Not support {self.model_name}. Choices: {support_models}"
359 |
360 | magic_path = os.path.abspath(__file__).rsplit('/', 1)[0]
361 | self.repetition_penalty = 1.0
362 | if model_name == "vicuna":
363 | model_path = f"{magic_path}/FastChat/vicuna-13b-v1.3"
364 | elif model_name == 'fastchat-t5':
365 | model_path = f"{magic_path}/FastChat/fastchat-t5-3b-v1.0"
366 | self.repetition_penalty = 1.2
367 | elif model_name == 'longchat':
368 | model_path = f"{magic_path}/FastChat/longchat-13b-16k"
369 | self.model, self.tokenizer = load_model(
370 | model_path,
371 | "cuda",
372 | 1,
373 | 1,
374 | False,
375 | False,
376 | revision="main",
377 | debug=False,
378 | )
379 | self.conv = get_conversation_template(model_path)
380 |
381 | def set_meta_prompt(self, meta_prompt: str):
382 | """Set the meta_prompt
383 |
384 | Args:
385 | meta_prompt (str): the meta prompt
386 | """
387 | self.memory_lst.append({"role": "system", "content": f"{meta_prompt}"})
388 | self.conv.append_message(self.conv.roles[0], str(meta_prompt))
389 |
390 | def add_event(self, event: str):
391 | """Add an new event in the memory
392 |
393 | Args:
394 | event (str): string that describe the event.
395 | """
396 | # if not self.memory_lst[-1]['role'] == 'user':
397 | self.memory_lst.append({"role": "user", "content": f"{event}"})
398 | self.conv.append_message(self.conv.roles[0], str(event))
399 | # else:
400 | # self.memory_lst[-1]['content'] += f"\n\n{event}"
401 |
402 | def add_memory(self, memory: str):
403 | """Monologue in the memory
404 |
405 | Args:
406 | memory (str): string that generated by the model in the last round.
407 | """
408 | self.memory_lst.append({"role": "assistant", "content": f"{memory}"})
409 | self.conv.replace_message(self.conv.roles[1], str(memory))
410 |
411 | def ask(self, temperature: float=None):
412 | time.sleep(self.sleep_time)
413 |
414 | self.conv.append_message(self.conv.roles[1], None)
415 | prompt = self.conv.get_prompt()
416 | input_ids = self.tokenizer([prompt]).input_ids
417 | input_ids = [input_ids[0]]
418 |
419 | output_ids = self.model.generate(
420 | torch.as_tensor(input_ids).cuda(),
421 | do_sample=True,
422 | temperature=temperature if temperature else self.temperature,
423 | repetition_penalty=self.repetition_penalty,
424 | max_new_tokens=200,
425 | )
426 | if self.model.config.is_encoder_decoder:
427 | output_ids = output_ids[0]
428 | else:
429 | output_ids = output_ids[0][len(input_ids[0]) :]
430 | outputs = self.tokenizer.decode(
431 | output_ids, skip_special_tokens=True, spaces_between_special_tokens=False
432 | )
433 | return outputs
--------------------------------------------------------------------------------
/spygame.py:
--------------------------------------------------------------------------------
1 | import re
2 | import os
3 | import json
4 | import argparse
5 | import itertools
6 | import random
7 | # random.seed(0)
8 | from utils.agent import TurboPlayer, DavinciPlayer, BardPlayer, VicunaPlayer
9 | from datetime import datetime
10 | from tqdm import tqdm
11 |
12 |
13 | PRINT_LOG = True
14 |
15 | NAME_LIST_ANONYMOUS = ["Player 1", "Player 2", "Player 3", "Player 4", "Player 5", "Player 6", "Player 7", "Player 8", "Player 9", "Player 10"]
16 |
17 | SUPPORT_MODELS = ["gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "text-davinci-003", "text-davinci-002", "bard", "vicuna", "fastchat-t5", "longchat"]
18 | SUPPORT_MODELS_WITH_MEMORY_LIST = ["gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "text-davinci-003", "text-davinci-002", "bard"]
19 |
20 |
21 | def SpyPlayer(model_name: str = None, name: str = None, secret_word: str = None, temperature:float = 0, sleep_time: float = 0):
22 | assert model_name in SUPPORT_MODELS, f"Not support {model_name}. Choices: {SUPPORT_MODELS}"
23 |
24 | if model_name in ["gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613"]:
25 | return TurboPlayer(model_name, name, secret_word, temperature, sleep_time)
26 | elif model_name in ["text-davinci-003", "text-davinci-002"]:
27 | return DavinciPlayer(model_name, name, secret_word, temperature, sleep_time)
28 | elif model_name in ["bard"]:
29 | return BardPlayer(model_name, name, secret_word, temperature, sleep_time)
30 | elif model_name in ["vicuna", "fastchat-t5", "longchat"]:
31 | return VicunaPlayer(model_name, name, secret_word, temperature, sleep_time)
32 |
33 |
34 | class SpyGame:
35 | def __init__(self,
36 | guest_agent: str,
37 | host_agent: str,
38 | temperature: float,
39 | num_players: int,
40 | max_rounds: int,
41 | spy_word: str,
42 | villager_word: str,
43 | guest_identity: str,
44 | sleep_time: float,
45 | prompts: dict,
46 | seed: int,
47 | save_file_path: str
48 | ) -> None:
49 |
50 | """Create a spy game
51 |
52 | Args:
53 | guest_agent (str): guest agent model name
54 | host_agent (str): host agent model name
55 | temperature (float): higher values make the output more random, while lower values make it more focused and deterministic
56 | num_players (int): number of all players
57 | max_rounds (int): maximum number of game rounds
58 | spy_word (str): spy agent's keyword
59 | villager_word (str): villager agent's keyword
60 | guest_identity (str): identity that guest participate in the game
61 | sleep_time (float): sleep against rate limiting
62 | """
63 |
64 | self.temperature = temperature
65 | self.num_players = num_players
66 | self.max_rounds = max_rounds
67 | self.spy_word = spy_word
68 | self.villager_word = villager_word
69 | self.prompts = prompts
70 | self.save_file_path = save_file_path
71 |
72 | self.num_spy = 1
73 | self.meta_prompt = self.prompts['meta_prompt']
74 |
75 | # the secret word list of all players
76 | self.secret_word_list = [self.spy_word] + [self.villager_word] * (self.num_players - 1)
77 | random.shuffle(self.secret_word_list)
78 |
79 | spy_order = self.secret_word_list.index(self.spy_word)
80 |
81 | all_order = list(range(self.num_players))
82 | all_order.remove(spy_order)
83 | villager_order = random.choice(all_order)
84 |
85 | # init agents
86 | NAME_LIST = NAME_LIST_ANONYMOUS[: self.num_players]
87 | random.shuffle(NAME_LIST)
88 | self.players = [
89 | SpyPlayer(model_name=host_agent, name=NAME_LIST[idx], secret_word=secret_word, temperature=self.temperature, sleep_time=sleep_time)
90 | for idx, secret_word in enumerate(self.secret_word_list)
91 | ]
92 |
93 | guest_name = None
94 | if guest_identity == 'spy':
95 | spy_player = self.players[spy_order]
96 | self.players[spy_order] = SpyPlayer(model_name=guest_agent, name=NAME_LIST[spy_order], secret_word=self.spy_word, temperature=self.temperature, sleep_time=sleep_time)
97 | del spy_player
98 | guest_name = NAME_LIST[spy_order]
99 | elif guest_identity == 'villager':
100 | villager_player = self.players[villager_order]
101 | self.players[villager_order] = SpyPlayer(model_name=guest_agent, name=NAME_LIST[villager_order], secret_word=self.villager_word, temperature=self.temperature, sleep_time=sleep_time)
102 | del villager_player
103 | guest_name = NAME_LIST[villager_order]
104 |
105 | self.spy_name = [player.name for player in self.players if player.secret_word == self.spy_word][0]
106 |
107 | self.player_names = {p.name: p for p in self.players}
108 | players_model = {p.name: (p.model_name, p.secret_word) for p in self.players}
109 |
110 | self.init_prompt()
111 |
112 | # save file
113 | now = datetime.now()
114 | current_time = now.strftime("%Y-%m-%d_%H:%M:%S")
115 | self.save_file = {
116 | 'game_name': 'SpyGame',
117 | 'start_time': current_time,
118 | 'end_time': '',
119 | 'win': "",
120 | 'spy': f"{self.spy_name} ({self.spy_word})",
121 | 'spy_word': self.spy_word,
122 | 'villager_word': self.villager_word,
123 | 'host_agent': host_agent,
124 | 'guest_agent': guest_agent,
125 | 'guest_identity': guest_identity,
126 | 'guest_name': guest_name,
127 | 'temperature': temperature,
128 | 'num_players': num_players,
129 | 'max_rounds': max_rounds,
130 | 'players_model': players_model,
131 | 'seed': seed,
132 | 'rounds': {},
133 | 'players': {},
134 | 'players_idx': {},
135 | 'prompts': prompts
136 | }
137 |
138 | if PRINT_LOG:
139 | print(f"spy: {self.spy_name} ({self.spy_word})")
140 | print(f"players_model: {players_model}")
141 | print(f"seed: {seed}")
142 |
143 | def init_prompt(self):
144 | for player in self.players:
145 | meta_prompt = self.prompts['meta_prompt'].format(name=player.name, num_players=self.num_players, num_spy=self.num_spy, num_villager=self.num_players-self.num_spy, secret_word=player.secret_word)
146 | player.set_meta_prompt(meta_prompt)
147 | if PRINT_LOG:
148 | print(meta_prompt)
149 |
150 | def cot_modify(self, text, phase, round):
151 | round_dct = {
152 | 1: 'first', 2: 'second', 3: 'third', 4: 'fourth', 5: 'fifth', 6: 'sixth', 7: 'seventh', 8: 'eighth', 9: 'ninth', 10: 'tenth'
153 | }
154 | try:
155 | prompt = f"Here is my thought during the {round_dct[round]} round of the {phase} phase."
156 | except:
157 | prompt = f"Here is my thought."
158 | return prompt + '\n\n' + text
159 |
160 | def broadcast(self, msg: str):
161 | """Broadcast a message to all players.
162 | Typical use is for the host to announce public information
163 |
164 | Args:
165 | msg (str): the message
166 | """
167 | if PRINT_LOG:
168 | print(msg)
169 | for player in self.players:
170 | player.add_event(msg)
171 |
172 | def speak(self, speaker: str, msg: str):
173 | """The speaker broadcast a message to all other players.
174 |
175 | Args:
176 | speaker (str): name of the speaker
177 | msg (str): the message
178 | """
179 | if not msg.startswith(f"{speaker}:"):
180 | msg = f"{speaker}: {msg}"
181 | if PRINT_LOG:
182 | print(msg)
183 | for player in self.players:
184 | if player.name != speaker:
185 | player.add_event(msg)
186 |
187 | def save(self):
188 | now = datetime.now()
189 | current_time = now.strftime("%Y-%m-%d_%H:%M:%S")
190 | self.save_file['end_time'] = current_time
191 |
192 | json_str = json.dumps(self.save_file, ensure_ascii=False, indent=4)
193 | with open(self.save_file_path, 'w') as f:
194 | f.write(json_str)
195 |
196 |
197 | def run(self):
198 | round = 0
199 | self.tie_restart = False
200 |
201 | self.spy_candidates = self.player_names
202 | self.villager_candidates = self.player_names
203 |
204 | while len(self.players) > 2:
205 | if round >= self.max_rounds:
206 | break
207 | while True:
208 | if round >= self.max_rounds:
209 | break
210 | if PRINT_LOG:
211 | print(f"\n===== Round-{round+1} =====\n")
212 |
213 | # ask for the decription
214 | describe_cot = {}
215 | describe_save_dct = {}
216 | shuffle_names = list(self.spy_candidates.keys())
217 | random.shuffle(shuffle_names)
218 |
219 | self.broadcast(f"Host: It is now the description phase, please take turns to describe the keyword you received in the order of {shuffle_names}.")
220 |
221 | spy_candidates_done = []
222 | if round != 0:
223 | spy_candidates_done = shuffle_names[: ]
224 |
225 | for player_name in shuffle_names:
226 | player = self.spy_candidates[player_name]
227 |
228 | if len(spy_candidates_done) != 0:
229 | spy_candidates_done = list(set(spy_candidates_done))
230 | spy_candidates_done.sort()
231 |
232 | # init word prompt
233 | num_villager_survive = len(self.players) - 1
234 | player_secret_word = player.secret_word
235 |
236 | word_judgement = self.prompts['word_judgement'].format(options=spy_candidates_done, player_secret_word=player_secret_word, name=player_name, num_villager=len(self.players)-1)
237 |
238 | # word judgement
239 | player.add_event(word_judgement, 1)
240 | ans = player.ask()
241 | player.add_memory(self.cot_modify(ans, 'description', round+1))
242 | describe_cot[player.name] = ans
243 | spy_candidates_done.append(player_name)
244 |
245 | describe_prompt = self.prompts['describe_prompt'].format(name=player.name, secret_word=player.secret_word)
246 | player.add_event(describe_prompt, 1)
247 | ans = player.ask()
248 |
249 | # rule-based cleaning secret word
250 | ans = ans.replace(player.secret_word, 'My keyword')
251 | ans = ans.replace(player.secret_word.lower(), 'my keyword')
252 | if not ans.startswith(player_name):
253 | ans = f"{player_name}: {ans}"
254 |
255 | describe_save_dct[player.name] = ans
256 | # speak to other players
257 | self.speak(player.name, f"{ans}")
258 |
259 | # add self memory
260 | player.add_memory(ans)
261 |
262 | # voting
263 | vote_cot = {}
264 | vote_save_dct = {}
265 | spy_candidates_done = list(self.spy_candidates.keys())
266 | spy_candidates_done.sort()
267 | results = {
268 | player_name: 0
269 | for player_name in spy_candidates_done
270 | }
271 | self.broadcast(f"Host: It is now the voting phase, Please judge the keywords and identities of these alive players {spy_candidates_done}.")
272 | for player_name in self.villager_candidates:
273 | player = self.villager_candidates[player_name]
274 |
275 | shuffle_names = list(self.spy_candidates.keys())
276 | random.shuffle(shuffle_names)
277 |
278 | # init identity prompt
279 | player_secret_word = player.secret_word
280 | options = [spy for spy in shuffle_names if spy != player_name]
281 |
282 | identity_judgement = self.prompts['identity_judgement'].format(options=spy_candidates_done, player_secret_word=player_secret_word, name=player_name, num_villager=len(self.players)-1)
283 |
284 | # identity judgement
285 | player.add_event(identity_judgement, 1)
286 | ans = player.ask()
287 | player.add_memory(self.cot_modify(ans, 'voting', round+1))
288 | vote_cot[player.name] = ans
289 |
290 | # vote phase
291 | vote_prompt = self.prompts['vote_prompt'].format(options=options, name=player_name)
292 | player.add_event(vote_prompt, 1)
293 | raw_ans = player.ask()
294 |
295 | # player.add_memory(raw_ans)
296 | pattern = '|'.join(options)
297 | try:
298 | ans = re.findall(pattern=pattern, string=raw_ans)
299 | if len(ans) == 1:
300 | ans = ans[0]
301 | else:
302 | ans = None
303 | except:
304 | ans = None
305 |
306 | temperature_offset = 0.05
307 | current_temperature = player.temperature
308 | cnt = 0
309 | while ans not in options:
310 | cnt += 1
311 | if player.model_name in SUPPORT_MODELS_WITH_MEMORY_LIST:
312 | player.memory_lst = player.memory_lst[:-3]
313 | player.memory_lst_idx = player.memory_lst_idx[:-3]
314 |
315 | # identity judgement
316 | player.add_event(identity_judgement, 1)
317 | ans = player.ask(min(current_temperature, 1.0))
318 | player.add_memory(self.cot_modify(ans, 'voting', round+1))
319 | vote_cot[player.name] = ans
320 |
321 | # vote phase
322 | player.add_event(vote_prompt, 1)
323 | raw_ans = player.ask(min(current_temperature, 1.0))
324 |
325 | try:
326 | ans = re.findall(pattern=pattern, string=raw_ans)
327 | if len(ans) == 1:
328 | ans = ans[0]
329 | else:
330 | ans = None
331 | current_temperature += temperature_offset
332 | except:
333 | current_temperature += temperature_offset
334 | else:
335 | try:
336 | raw_ans = player.ask(min(current_temperature, 1.0))
337 | ans = re.findall(pattern=pattern, string=raw_ans)
338 | if len(ans) == 1:
339 | ans = ans[0]
340 | else:
341 | current_temperature += temperature_offset
342 | except:
343 | current_temperature += temperature_offset
344 | if cnt >= 3:
345 | break
346 | player.add_memory(raw_ans, 0)
347 |
348 | vote_result = self.prompts['vote_result'].format(name1=player.name, name2=ans, response=raw_ans)
349 | if PRINT_LOG:
350 | print(vote_result)
351 | vote_save_dct[player.name] = vote_result
352 |
353 | results[ans] += 1
354 |
355 |
356 | max_value = max(results.values())
357 | max_keys = [k for k, v in results.items() if v == max_value]
358 | round += 1
359 | if len(max_keys) == 1:
360 | break
361 | elif len(max_keys) == len(self.players):
362 | broadcast_news = self.prompts['tie_prompt'].format(options=max_keys)
363 | self.save_file["rounds"][f"round-{round}"] = {
364 | "describe": describe_save_dct,
365 | "describe_cot": describe_cot,
366 | "vote": vote_save_dct,
367 | "vote_cot": vote_cot,
368 | "vote_num": results,
369 | "result": broadcast_news
370 | }
371 | self.spy_candidates = self.player_names
372 | self.villager_candidates = self.player_names
373 | else:
374 | broadcast_news = self.prompts['tie_prompt'].format(options=max_keys)
375 | self.save_file["rounds"][f"round-{round}"] = {
376 | "describe": describe_save_dct,
377 | "describe_cot": describe_cot,
378 | "vote": vote_save_dct,
379 | "vote_cot": vote_cot,
380 | "vote_num": results,
381 | "result": broadcast_news
382 | }
383 | if self.tie_restart:
384 | self.spy_candidates = self.player_names
385 | self.villager_candidates = self.player_names
386 | self.tie_restart = False
387 | else:
388 | self.spy_candidates = {name: self.player_names[name] for name in max_keys}
389 | self.villager_candidates = {name: self.player_names[name] for name in self.player_names if name not in max_keys}
390 | self.tie_restart = True
391 | if PRINT_LOG:
392 | print(broadcast_news)
393 | self.broadcast(broadcast_news)
394 |
395 | selected_name = max_keys[0]
396 |
397 | # checking state
398 | break_flag = False
399 | if selected_name == self.spy_name:
400 | # game over villager_win
401 | broadcast_news = self.prompts['villager_win'].format(selected_name=selected_name, spy_word=self.spy_word, villager_word=self.villager_word)
402 | self.save_file['win'] = 'villager'
403 | break_flag = True
404 | elif len(self.players) == 3:
405 | # game over spy_win
406 | broadcast_news = self.prompts['spy_win'].format(selected_name=selected_name, spy_name=self.spy_name, spy_word=self.spy_word, villager_word=self.villager_word)
407 | self.save_file['win'] = 'spy'
408 | break_flag = True
409 | else:
410 | # remove the selected player
411 | broadcast_news = self.prompts['continue'].format(selected_name=selected_name)
412 | selected_player = None
413 | for player in self.players:
414 | if player.name == selected_name:
415 | selected_player = player
416 | self.save_file['players'][selected_name] = selected_player.memory_lst
417 | self.save_file['players_idx'][selected_name] = list(selected_player.memory_lst_idx)
418 | self.players.remove(selected_player)
419 | self.player_names.pop(selected_name)
420 | del selected_player
421 | self.spy_candidates = self.player_names
422 | self.villager_candidates = self.player_names
423 |
424 | if PRINT_LOG:
425 | print(broadcast_news)
426 | self.broadcast(broadcast_news)
427 | self.save_file["rounds"][f"round-{round}"] = {
428 | "describe": describe_save_dct,
429 | "describe_cot": describe_cot,
430 | "vote": vote_save_dct,
431 | "vote_cot": vote_cot,
432 | "vote_num": results,
433 | "result": broadcast_news
434 | }
435 | if break_flag:
436 | break
437 |
438 | for player in self.players:
439 | self.save_file['players'][player.name] = player.memory_lst
440 | self.save_file['players_idx'][player.name] = list(player.memory_lst_idx)
441 | del player
442 |
443 |
444 |
445 |
446 |
447 | if __name__ == "__main__":
448 |
449 | spygame_path = os.path.abspath(__file__).rsplit('/', 1)[0]
450 |
451 | parser = argparse.ArgumentParser()
452 | parser.add_argument('--keywords-path', type=str, default=f"{spygame_path}/prompt/keyword_set.json")
453 | parser.add_argument('--prompts-path', type=str, default=f"{spygame_path}/prompt/prompts.json")
454 | parser.add_argument('--guest-agent', type=str, default='gpt-4-0613')
455 | parser.add_argument('--host-agent', type=str, default='gpt-3.5-turbo-0613')
456 | parser.add_argument('--guest-identity', type=str, choices=['spy', 'villager'], default='spy')
457 | parser.add_argument('--temperature', type=float, default=0.3)
458 | parser.add_argument('--num-players', type=int, default=4)
459 | parser.add_argument('--max-rounds', type=int, default=7)
460 | parser.add_argument('--sleep-time', type=int, default=0)
461 | args = parser.parse_args()
462 |
463 | save_file_dir = spygame_path + f'/benchmark/{args.host_agent}/{args.guest_agent}'
464 | if not os.path.exists(save_file_dir):
465 | os.makedirs(save_file_dir)
466 |
467 | keywords = json.load(open(args.keywords_path))
468 | prompts = json.load(open(args.prompts_path))
469 |
470 | total_files = len(keywords) * 2
471 |
472 | for keyword_pair, i in tqdm(itertools.product(keywords, range(2)), total=total_files):
473 |
474 | # try:
475 | file_name = f'{keyword_pair[i]}.json'
476 | files = os.listdir(save_file_dir)
477 | if file_name in files:
478 | continue
479 |
480 | seed = random.randrange(10000)
481 | random.seed(seed)
482 | spy_game = SpyGame(
483 | guest_agent = args.guest_agent,
484 | host_agent = args.host_agent,
485 | temperature = args.temperature,
486 | num_players = args.num_players,
487 | max_rounds = args.max_rounds,
488 | spy_word = keyword_pair[i],
489 | villager_word = keyword_pair[i-1],
490 | guest_identity = args.guest_identity,
491 | sleep_time = args.sleep_time,
492 | prompts = prompts,
493 | seed = seed,
494 | save_file_path=f'{save_file_dir}/{file_name}'
495 | )
496 | spy_game.run()
497 | spy_game.save()
498 |
499 | # except:
500 | # pass
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU General Public License
2 | ==========================
3 |
4 | _Version 3, 29 June 2007_
5 | _Copyright © 2007 Free Software Foundation, Inc. <>_
6 |
7 | Everyone is permitted to copy and distribute verbatim copies of this license
8 | document, but changing it is not allowed.
9 |
10 | ## Preamble
11 |
12 | The GNU General Public License is a free, copyleft license for software and other
13 | kinds of works.
14 |
15 | The licenses for most software and other practical works are designed to take away
16 | your freedom to share and change the works. By contrast, the GNU General Public
17 | License is intended to guarantee your freedom to share and change all versions of a
18 | program--to make sure it remains free software for all its users. We, the Free
19 | Software Foundation, use the GNU General Public License for most of our software; it
20 | applies also to any other work released this way by its authors. You can apply it to
21 | your programs, too.
22 |
23 | When we speak of free software, we are referring to freedom, not price. Our General
24 | Public Licenses are designed to make sure that you have the freedom to distribute
25 | copies of free software (and charge for them if you wish), that you receive source
26 | code or can get it if you want it, that you can change the software or use pieces of
27 | it in new free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you these rights or
30 | asking you to surrender the rights. Therefore, you have certain responsibilities if
31 | you distribute copies of the software, or if you modify it: responsibilities to
32 | respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether gratis or for a fee,
35 | you must pass on to the recipients the same freedoms that you received. You must make
36 | sure that they, too, receive or can get the source code. And you must show them these
37 | terms so they know their rights.
38 |
39 | Developers that use the GNU GPL protect your rights with two steps: **(1)** assert
40 | copyright on the software, and **(2)** offer you this License giving you legal permission
41 | to copy, distribute and/or modify it.
42 |
43 | For the developers' and authors' protection, the GPL clearly explains that there is
44 | no warranty for this free software. For both users' and authors' sake, the GPL
45 | requires that modified versions be marked as changed, so that their problems will not
46 | be attributed erroneously to authors of previous versions.
47 |
48 | Some devices are designed to deny users access to install or run modified versions of
49 | the software inside them, although the manufacturer can do so. This is fundamentally
50 | incompatible with the aim of protecting users' freedom to change the software. The
51 | systematic pattern of such abuse occurs in the area of products for individuals to
52 | use, which is precisely where it is most unacceptable. Therefore, we have designed
53 | this version of the GPL to prohibit the practice for those products. If such problems
54 | arise substantially in other domains, we stand ready to extend this provision to
55 | those domains in future versions of the GPL, as needed to protect the freedom of
56 | users.
57 |
58 | Finally, every program is threatened constantly by software patents. States should
59 | not allow patents to restrict development and use of software on general-purpose
60 | computers, but in those that do, we wish to avoid the special danger that patents
61 | applied to a free program could make it effectively proprietary. To prevent this, the
62 | GPL assures that patents cannot be used to render the program non-free.
63 |
64 | The precise terms and conditions for copying, distribution and modification follow.
65 |
66 | ## TERMS AND CONDITIONS
67 |
68 | ### 0. Definitions
69 |
70 | “This License” refers to version 3 of the GNU General Public License.
71 |
72 | “Copyright” also means copyright-like laws that apply to other kinds of
73 | works, such as semiconductor masks.
74 |
75 | “The Program” refers to any copyrightable work licensed under this
76 | License. Each licensee is addressed as “you”. “Licensees” and
77 | “recipients” may be individuals or organizations.
78 |
79 | To “modify” a work means to copy from or adapt all or part of the work in
80 | a fashion requiring copyright permission, other than the making of an exact copy. The
81 | resulting work is called a “modified version” of the earlier work or a
82 | work “based on” the earlier work.
83 |
84 | A “covered work” means either the unmodified Program or a work based on
85 | the Program.
86 |
87 | To “propagate” a work means to do anything with it that, without
88 | permission, would make you directly or secondarily liable for infringement under
89 | applicable copyright law, except executing it on a computer or modifying a private
90 | copy. Propagation includes copying, distribution (with or without modification),
91 | making available to the public, and in some countries other activities as well.
92 |
93 | To “convey” a work means any kind of propagation that enables other
94 | parties to make or receive copies. Mere interaction with a user through a computer
95 | network, with no transfer of a copy, is not conveying.
96 |
97 | An interactive user interface displays “Appropriate Legal Notices” to the
98 | extent that it includes a convenient and prominently visible feature that **(1)**
99 | displays an appropriate copyright notice, and **(2)** tells the user that there is no
100 | warranty for the work (except to the extent that warranties are provided), that
101 | licensees may convey the work under this License, and how to view a copy of this
102 | License. If the interface presents a list of user commands or options, such as a
103 | menu, a prominent item in the list meets this criterion.
104 |
105 | ### 1. Source Code
106 |
107 | The “source code” for a work means the preferred form of the work for
108 | making modifications to it. “Object code” means any non-source form of a
109 | work.
110 |
111 | A “Standard Interface” means an interface that either is an official
112 | standard defined by a recognized standards body, or, in the case of interfaces
113 | specified for a particular programming language, one that is widely used among
114 | developers working in that language.
115 |
116 | The “System Libraries” of an executable work include anything, other than
117 | the work as a whole, that **(a)** is included in the normal form of packaging a Major
118 | Component, but which is not part of that Major Component, and **(b)** serves only to
119 | enable use of the work with that Major Component, or to implement a Standard
120 | Interface for which an implementation is available to the public in source code form.
121 | A “Major Component”, in this context, means a major essential component
122 | (kernel, window system, and so on) of the specific operating system (if any) on which
123 | the executable work runs, or a compiler used to produce the work, or an object code
124 | interpreter used to run it.
125 |
126 | The “Corresponding Source” for a work in object code form means all the
127 | source code needed to generate, install, and (for an executable work) run the object
128 | code and to modify the work, including scripts to control those activities. However,
129 | it does not include the work's System Libraries, or general-purpose tools or
130 | generally available free programs which are used unmodified in performing those
131 | activities but which are not part of the work. For example, Corresponding Source
132 | includes interface definition files associated with source files for the work, and
133 | the source code for shared libraries and dynamically linked subprograms that the work
134 | is specifically designed to require, such as by intimate data communication or
135 | control flow between those subprograms and other parts of the work.
136 |
137 | The Corresponding Source need not include anything that users can regenerate
138 | automatically from other parts of the Corresponding Source.
139 |
140 | The Corresponding Source for a work in source code form is that same work.
141 |
142 | ### 2. Basic Permissions
143 |
144 | All rights granted under this License are granted for the term of copyright on the
145 | Program, and are irrevocable provided the stated conditions are met. This License
146 | explicitly affirms your unlimited permission to run the unmodified Program. The
147 | output from running a covered work is covered by this License only if the output,
148 | given its content, constitutes a covered work. This License acknowledges your rights
149 | of fair use or other equivalent, as provided by copyright law.
150 |
151 | You may make, run and propagate covered works that you do not convey, without
152 | conditions so long as your license otherwise remains in force. You may convey covered
153 | works to others for the sole purpose of having them make modifications exclusively
154 | for you, or provide you with facilities for running those works, provided that you
155 | comply with the terms of this License in conveying all material for which you do not
156 | control copyright. Those thus making or running the covered works for you must do so
157 | exclusively on your behalf, under your direction and control, on terms that prohibit
158 | them from making any copies of your copyrighted material outside their relationship
159 | with you.
160 |
161 | Conveying under any other circumstances is permitted solely under the conditions
162 | stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
163 |
164 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law
165 |
166 | No covered work shall be deemed part of an effective technological measure under any
167 | applicable law fulfilling obligations under article 11 of the WIPO copyright treaty
168 | adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention
169 | of such measures.
170 |
171 | When you convey a covered work, you waive any legal power to forbid circumvention of
172 | technological measures to the extent such circumvention is effected by exercising
173 | rights under this License with respect to the covered work, and you disclaim any
174 | intention to limit operation or modification of the work as a means of enforcing,
175 | against the work's users, your or third parties' legal rights to forbid circumvention
176 | of technological measures.
177 |
178 | ### 4. Conveying Verbatim Copies
179 |
180 | You may convey verbatim copies of the Program's source code as you receive it, in any
181 | medium, provided that you conspicuously and appropriately publish on each copy an
182 | appropriate copyright notice; keep intact all notices stating that this License and
183 | any non-permissive terms added in accord with section 7 apply to the code; keep
184 | intact all notices of the absence of any warranty; and give all recipients a copy of
185 | this License along with the Program.
186 |
187 | You may charge any price or no price for each copy that you convey, and you may offer
188 | support or warranty protection for a fee.
189 |
190 | ### 5. Conveying Modified Source Versions
191 |
192 | You may convey a work based on the Program, or the modifications to produce it from
193 | the Program, in the form of source code under the terms of section 4, provided that
194 | you also meet all of these conditions:
195 |
196 | * **a)** The work must carry prominent notices stating that you modified it, and giving a
197 | relevant date.
198 | * **b)** The work must carry prominent notices stating that it is released under this
199 | License and any conditions added under section 7. This requirement modifies the
200 | requirement in section 4 to “keep intact all notices”.
201 | * **c)** You must license the entire work, as a whole, under this License to anyone who
202 | comes into possession of a copy. This License will therefore apply, along with any
203 | applicable section 7 additional terms, to the whole of the work, and all its parts,
204 | regardless of how they are packaged. This License gives no permission to license the
205 | work in any other way, but it does not invalidate such permission if you have
206 | separately received it.
207 | * **d)** If the work has interactive user interfaces, each must display Appropriate Legal
208 | Notices; however, if the Program has interactive interfaces that do not display
209 | Appropriate Legal Notices, your work need not make them do so.
210 |
211 | A compilation of a covered work with other separate and independent works, which are
212 | not by their nature extensions of the covered work, and which are not combined with
213 | it such as to form a larger program, in or on a volume of a storage or distribution
214 | medium, is called an “aggregate” if the compilation and its resulting
215 | copyright are not used to limit the access or legal rights of the compilation's users
216 | beyond what the individual works permit. Inclusion of a covered work in an aggregate
217 | does not cause this License to apply to the other parts of the aggregate.
218 |
219 | ### 6. Conveying Non-Source Forms
220 |
221 | You may convey a covered work in object code form under the terms of sections 4 and
222 | 5, provided that you also convey the machine-readable Corresponding Source under the
223 | terms of this License, in one of these ways:
224 |
225 | * **a)** Convey the object code in, or embodied in, a physical product (including a
226 | physical distribution medium), accompanied by the Corresponding Source fixed on a
227 | durable physical medium customarily used for software interchange.
228 | * **b)** Convey the object code in, or embodied in, a physical product (including a
229 | physical distribution medium), accompanied by a written offer, valid for at least
230 | three years and valid for as long as you offer spare parts or customer support for
231 | that product model, to give anyone who possesses the object code either **(1)** a copy of
232 | the Corresponding Source for all the software in the product that is covered by this
233 | License, on a durable physical medium customarily used for software interchange, for
234 | a price no more than your reasonable cost of physically performing this conveying of
235 | source, or **(2)** access to copy the Corresponding Source from a network server at no
236 | charge.
237 | * **c)** Convey individual copies of the object code with a copy of the written offer to
238 | provide the Corresponding Source. This alternative is allowed only occasionally and
239 | noncommercially, and only if you received the object code with such an offer, in
240 | accord with subsection 6b.
241 | * **d)** Convey the object code by offering access from a designated place (gratis or for
242 | a charge), and offer equivalent access to the Corresponding Source in the same way
243 | through the same place at no further charge. You need not require recipients to copy
244 | the Corresponding Source along with the object code. If the place to copy the object
245 | code is a network server, the Corresponding Source may be on a different server
246 | (operated by you or a third party) that supports equivalent copying facilities,
247 | provided you maintain clear directions next to the object code saying where to find
248 | the Corresponding Source. Regardless of what server hosts the Corresponding Source,
249 | you remain obligated to ensure that it is available for as long as needed to satisfy
250 | these requirements.
251 | * **e)** Convey the object code using peer-to-peer transmission, provided you inform
252 | other peers where the object code and Corresponding Source of the work are being
253 | offered to the general public at no charge under subsection 6d.
254 |
255 | A separable portion of the object code, whose source code is excluded from the
256 | Corresponding Source as a System Library, need not be included in conveying the
257 | object code work.
258 |
259 | A “User Product” is either **(1)** a “consumer product”, which
260 | means any tangible personal property which is normally used for personal, family, or
261 | household purposes, or **(2)** anything designed or sold for incorporation into a
262 | dwelling. In determining whether a product is a consumer product, doubtful cases
263 | shall be resolved in favor of coverage. For a particular product received by a
264 | particular user, “normally used” refers to a typical or common use of
265 | that class of product, regardless of the status of the particular user or of the way
266 | in which the particular user actually uses, or expects or is expected to use, the
267 | product. A product is a consumer product regardless of whether the product has
268 | substantial commercial, industrial or non-consumer uses, unless such uses represent
269 | the only significant mode of use of the product.
270 |
271 | “Installation Information” for a User Product means any methods,
272 | procedures, authorization keys, or other information required to install and execute
273 | modified versions of a covered work in that User Product from a modified version of
274 | its Corresponding Source. The information must suffice to ensure that the continued
275 | functioning of the modified object code is in no case prevented or interfered with
276 | solely because modification has been made.
277 |
278 | If you convey an object code work under this section in, or with, or specifically for
279 | use in, a User Product, and the conveying occurs as part of a transaction in which
280 | the right of possession and use of the User Product is transferred to the recipient
281 | in perpetuity or for a fixed term (regardless of how the transaction is
282 | characterized), the Corresponding Source conveyed under this section must be
283 | accompanied by the Installation Information. But this requirement does not apply if
284 | neither you nor any third party retains the ability to install modified object code
285 | on the User Product (for example, the work has been installed in ROM).
286 |
287 | The requirement to provide Installation Information does not include a requirement to
288 | continue to provide support service, warranty, or updates for a work that has been
289 | modified or installed by the recipient, or for the User Product in which it has been
290 | modified or installed. Access to a network may be denied when the modification itself
291 | materially and adversely affects the operation of the network or violates the rules
292 | and protocols for communication across the network.
293 |
294 | Corresponding Source conveyed, and Installation Information provided, in accord with
295 | this section must be in a format that is publicly documented (and with an
296 | implementation available to the public in source code form), and must require no
297 | special password or key for unpacking, reading or copying.
298 |
299 | ### 7. Additional Terms
300 |
301 | “Additional permissions” are terms that supplement the terms of this
302 | License by making exceptions from one or more of its conditions. Additional
303 | permissions that are applicable to the entire Program shall be treated as though they
304 | were included in this License, to the extent that they are valid under applicable
305 | law. If additional permissions apply only to part of the Program, that part may be
306 | used separately under those permissions, but the entire Program remains governed by
307 | this License without regard to the additional permissions.
308 |
309 | When you convey a copy of a covered work, you may at your option remove any
310 | additional permissions from that copy, or from any part of it. (Additional
311 | permissions may be written to require their own removal in certain cases when you
312 | modify the work.) You may place additional permissions on material, added by you to a
313 | covered work, for which you have or can give appropriate copyright permission.
314 |
315 | Notwithstanding any other provision of this License, for material you add to a
316 | covered work, you may (if authorized by the copyright holders of that material)
317 | supplement the terms of this License with terms:
318 |
319 | * **a)** Disclaiming warranty or limiting liability differently from the terms of
320 | sections 15 and 16 of this License; or
321 | * **b)** Requiring preservation of specified reasonable legal notices or author
322 | attributions in that material or in the Appropriate Legal Notices displayed by works
323 | containing it; or
324 | * **c)** Prohibiting misrepresentation of the origin of that material, or requiring that
325 | modified versions of such material be marked in reasonable ways as different from the
326 | original version; or
327 | * **d)** Limiting the use for publicity purposes of names of licensors or authors of the
328 | material; or
329 | * **e)** Declining to grant rights under trademark law for use of some trade names,
330 | trademarks, or service marks; or
331 | * **f)** Requiring indemnification of licensors and authors of that material by anyone
332 | who conveys the material (or modified versions of it) with contractual assumptions of
333 | liability to the recipient, for any liability that these contractual assumptions
334 | directly impose on those licensors and authors.
335 |
336 | All other non-permissive additional terms are considered “further
337 | restrictions” within the meaning of section 10. If the Program as you received
338 | it, or any part of it, contains a notice stating that it is governed by this License
339 | along with a term that is a further restriction, you may remove that term. If a
340 | license document contains a further restriction but permits relicensing or conveying
341 | under this License, you may add to a covered work material governed by the terms of
342 | that license document, provided that the further restriction does not survive such
343 | relicensing or conveying.
344 |
345 | If you add terms to a covered work in accord with this section, you must place, in
346 | the relevant source files, a statement of the additional terms that apply to those
347 | files, or a notice indicating where to find the applicable terms.
348 |
349 | Additional terms, permissive or non-permissive, may be stated in the form of a
350 | separately written license, or stated as exceptions; the above requirements apply
351 | either way.
352 |
353 | ### 8. Termination
354 |
355 | You may not propagate or modify a covered work except as expressly provided under
356 | this License. Any attempt otherwise to propagate or modify it is void, and will
357 | automatically terminate your rights under this License (including any patent licenses
358 | granted under the third paragraph of section 11).
359 |
360 | However, if you cease all violation of this License, then your license from a
361 | particular copyright holder is reinstated **(a)** provisionally, unless and until the
362 | copyright holder explicitly and finally terminates your license, and **(b)** permanently,
363 | if the copyright holder fails to notify you of the violation by some reasonable means
364 | prior to 60 days after the cessation.
365 |
366 | Moreover, your license from a particular copyright holder is reinstated permanently
367 | if the copyright holder notifies you of the violation by some reasonable means, this
368 | is the first time you have received notice of violation of this License (for any
369 | work) from that copyright holder, and you cure the violation prior to 30 days after
370 | your receipt of the notice.
371 |
372 | Termination of your rights under this section does not terminate the licenses of
373 | parties who have received copies or rights from you under this License. If your
374 | rights have been terminated and not permanently reinstated, you do not qualify to
375 | receive new licenses for the same material under section 10.
376 |
377 | ### 9. Acceptance Not Required for Having Copies
378 |
379 | You are not required to accept this License in order to receive or run a copy of the
380 | Program. Ancillary propagation of a covered work occurring solely as a consequence of
381 | using peer-to-peer transmission to receive a copy likewise does not require
382 | acceptance. However, nothing other than this License grants you permission to
383 | propagate or modify any covered work. These actions infringe copyright if you do not
384 | accept this License. Therefore, by modifying or propagating a covered work, you
385 | indicate your acceptance of this License to do so.
386 |
387 | ### 10. Automatic Licensing of Downstream Recipients
388 |
389 | Each time you convey a covered work, the recipient automatically receives a license
390 | from the original licensors, to run, modify and propagate that work, subject to this
391 | License. You are not responsible for enforcing compliance by third parties with this
392 | License.
393 |
394 | An “entity transaction” is a transaction transferring control of an
395 | organization, or substantially all assets of one, or subdividing an organization, or
396 | merging organizations. If propagation of a covered work results from an entity
397 | transaction, each party to that transaction who receives a copy of the work also
398 | receives whatever licenses to the work the party's predecessor in interest had or
399 | could give under the previous paragraph, plus a right to possession of the
400 | Corresponding Source of the work from the predecessor in interest, if the predecessor
401 | has it or can get it with reasonable efforts.
402 |
403 | You may not impose any further restrictions on the exercise of the rights granted or
404 | affirmed under this License. For example, you may not impose a license fee, royalty,
405 | or other charge for exercise of rights granted under this License, and you may not
406 | initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging
407 | that any patent claim is infringed by making, using, selling, offering for sale, or
408 | importing the Program or any portion of it.
409 |
410 | ### 11. Patents
411 |
412 | A “contributor” is a copyright holder who authorizes use under this
413 | License of the Program or a work on which the Program is based. The work thus
414 | licensed is called the contributor's “contributor version”.
415 |
416 | A contributor's “essential patent claims” are all patent claims owned or
417 | controlled by the contributor, whether already acquired or hereafter acquired, that
418 | would be infringed by some manner, permitted by this License, of making, using, or
419 | selling its contributor version, but do not include claims that would be infringed
420 | only as a consequence of further modification of the contributor version. For
421 | purposes of this definition, “control” includes the right to grant patent
422 | sublicenses in a manner consistent with the requirements of this License.
423 |
424 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license
425 | under the contributor's essential patent claims, to make, use, sell, offer for sale,
426 | import and otherwise run, modify and propagate the contents of its contributor
427 | version.
428 |
429 | In the following three paragraphs, a “patent license” is any express
430 | agreement or commitment, however denominated, not to enforce a patent (such as an
431 | express permission to practice a patent or covenant not to sue for patent
432 | infringement). To “grant” such a patent license to a party means to make
433 | such an agreement or commitment not to enforce a patent against the party.
434 |
435 | If you convey a covered work, knowingly relying on a patent license, and the
436 | Corresponding Source of the work is not available for anyone to copy, free of charge
437 | and under the terms of this License, through a publicly available network server or
438 | other readily accessible means, then you must either **(1)** cause the Corresponding
439 | Source to be so available, or **(2)** arrange to deprive yourself of the benefit of the
440 | patent license for this particular work, or **(3)** arrange, in a manner consistent with
441 | the requirements of this License, to extend the patent license to downstream
442 | recipients. “Knowingly relying” means you have actual knowledge that, but
443 | for the patent license, your conveying the covered work in a country, or your
444 | recipient's use of the covered work in a country, would infringe one or more
445 | identifiable patents in that country that you have reason to believe are valid.
446 |
447 | If, pursuant to or in connection with a single transaction or arrangement, you
448 | convey, or propagate by procuring conveyance of, a covered work, and grant a patent
449 | license to some of the parties receiving the covered work authorizing them to use,
450 | propagate, modify or convey a specific copy of the covered work, then the patent
451 | license you grant is automatically extended to all recipients of the covered work and
452 | works based on it.
453 |
454 | A patent license is “discriminatory” if it does not include within the
455 | scope of its coverage, prohibits the exercise of, or is conditioned on the
456 | non-exercise of one or more of the rights that are specifically granted under this
457 | License. You may not convey a covered work if you are a party to an arrangement with
458 | a third party that is in the business of distributing software, under which you make
459 | payment to the third party based on the extent of your activity of conveying the
460 | work, and under which the third party grants, to any of the parties who would receive
461 | the covered work from you, a discriminatory patent license **(a)** in connection with
462 | copies of the covered work conveyed by you (or copies made from those copies), or **(b)**
463 | primarily for and in connection with specific products or compilations that contain
464 | the covered work, unless you entered into that arrangement, or that patent license
465 | was granted, prior to 28 March 2007.
466 |
467 | Nothing in this License shall be construed as excluding or limiting any implied
468 | license or other defenses to infringement that may otherwise be available to you
469 | under applicable patent law.
470 |
471 | ### 12. No Surrender of Others' Freedom
472 |
473 | If conditions are imposed on you (whether by court order, agreement or otherwise)
474 | that contradict the conditions of this License, they do not excuse you from the
475 | conditions of this License. If you cannot convey a covered work so as to satisfy
476 | simultaneously your obligations under this License and any other pertinent
477 | obligations, then as a consequence you may not convey it at all. For example, if you
478 | agree to terms that obligate you to collect a royalty for further conveying from
479 | those to whom you convey the Program, the only way you could satisfy both those terms
480 | and this License would be to refrain entirely from conveying the Program.
481 |
482 | ### 13. Use with the GNU Affero General Public License
483 |
484 | Notwithstanding any other provision of this License, you have permission to link or
485 | combine any covered work with a work licensed under version 3 of the GNU Affero
486 | General Public License into a single combined work, and to convey the resulting work.
487 | The terms of this License will continue to apply to the part which is the covered
488 | work, but the special requirements of the GNU Affero General Public License, section
489 | 13, concerning interaction through a network will apply to the combination as such.
490 |
491 | ### 14. Revised Versions of this License
492 |
493 | The Free Software Foundation may publish revised and/or new versions of the GNU
494 | General Public License from time to time. Such new versions will be similar in spirit
495 | to the present version, but may differ in detail to address new problems or concerns.
496 |
497 | Each version is given a distinguishing version number. If the Program specifies that
498 | a certain numbered version of the GNU General Public License “or any later
499 | version” applies to it, you have the option of following the terms and
500 | conditions either of that numbered version or of any later version published by the
501 | Free Software Foundation. If the Program does not specify a version number of the GNU
502 | General Public License, you may choose any version ever published by the Free
503 | Software Foundation.
504 |
505 | If the Program specifies that a proxy can decide which future versions of the GNU
506 | General Public License can be used, that proxy's public statement of acceptance of a
507 | version permanently authorizes you to choose that version for the Program.
508 |
509 | Later license versions may give you additional or different permissions. However, no
510 | additional obligations are imposed on any author or copyright holder as a result of
511 | your choosing to follow a later version.
512 |
513 | ### 15. Disclaimer of Warranty
514 |
515 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
516 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
517 | PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
518 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
519 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
520 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
521 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
522 |
523 | ### 16. Limitation of Liability
524 |
525 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
526 | COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
527 | PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
528 | INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
529 | PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE
530 | OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
531 | WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
532 | POSSIBILITY OF SUCH DAMAGES.
533 |
534 | ### 17. Interpretation of Sections 15 and 16
535 |
536 | If the disclaimer of warranty and limitation of liability provided above cannot be
537 | given local legal effect according to their terms, reviewing courts shall apply local
538 | law that most closely approximates an absolute waiver of all civil liability in
539 | connection with the Program, unless a warranty or assumption of liability accompanies
540 | a copy of the Program in return for a fee.
541 |
542 | _END OF TERMS AND CONDITIONS_
543 |
544 | ## How to Apply These Terms to Your New Programs
545 |
546 | If you develop a new program, and you want it to be of the greatest possible use to
547 | the public, the best way to achieve this is to make it free software which everyone
548 | can redistribute and change under these terms.
549 |
550 | To do so, attach the following notices to the program. It is safest to attach them
551 | to the start of each source file to most effectively state the exclusion of warranty;
552 | and each file should have at least the “copyright” line and a pointer to
553 | where the full notice is found.
554 |
555 | SpyGame: An interactive multi-agent framework to evaluate intelligence with large language models
556 | Copyright (C) 2023 Tian Liang and Zhiwei He and Wenxiang Jiao and Xing Wang
557 |
558 | This program is free software: you can redistribute it and/or modify
559 | it under the terms of the GNU General Public License as published by
560 | the Free Software Foundation, either version 3 of the License, or
561 | (at your option) any later version.
562 |
563 | This program is distributed in the hope that it will be useful,
564 | but WITHOUT ANY WARRANTY; without even the implied warranty of
565 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
566 | GNU General Public License for more details.
567 |
568 | You should have received a copy of the GNU General Public License
569 | along with this program. If not, see .
570 |
571 | Also add information on how to contact you by electronic and paper mail.
572 |
573 | If the program does terminal interaction, make it output a short notice like this
574 | when it starts in an interactive mode:
575 |
576 | MAD Copyright (C) 2023 Tian Liang and Zhiwei He and Wenxiang Jiao and Xing Wang
577 | This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
578 | This is free software, and you are welcome to redistribute it
579 | under certain conditions; type 'show c' for details.
580 |
581 | The hypothetical commands `show w` and `show c` should show the appropriate parts of
582 | the General Public License. Of course, your program's commands might be different;
583 | for a GUI interface, you would use an “about box”.
584 |
585 | You should also get your employer (if you work as a programmer) or school, if any, to
586 | sign a “copyright disclaimer” for the program, if necessary. For more
587 | information on this, and how to apply and follow the GNU GPL, see
588 | <>.
589 |
590 | The GNU General Public License does not permit incorporating your program into
591 | proprietary programs. If your program is a subroutine library, you may consider it
592 | more useful to permit linking proprietary applications with the library. If this is
593 | what you want to do, use the GNU Lesser General Public License instead of this
594 | License. But first, please read
595 | <>.
--------------------------------------------------------------------------------
/benchmark/gpt-3.5-turbo-0613/gpt-4-0613/Hotdog.json:
--------------------------------------------------------------------------------
1 | {
2 | "game_name": "SpyGame",
3 | "start_time": "2023-10-24_08:19:18",
4 | "end_time": "2023-10-24_08:23:05",
5 | "win": "villager",
6 | "spy": "Player 3 (Hotdog)",
7 | "spy_word": "Hotdog",
8 | "villager_word": "Sandwich",
9 | "host_agent": "gpt-3.5-turbo-0613",
10 | "guest_agent": "gpt-4-0613",
11 | "guest_identity": "spy",
12 | "guest_name": "Player 3",
13 | "temperature": 0.3,
14 | "num_players": 4,
15 | "max_rounds": 7,
16 | "players_model": {
17 | "Player 3": [
18 | "gpt-4-0613",
19 | "Hotdog"
20 | ],
21 | "Player 2": [
22 | "gpt-3.5-turbo-0613",
23 | "Sandwich"
24 | ],
25 | "Player 4": [
26 | "gpt-3.5-turbo-0613",
27 | "Sandwich"
28 | ],
29 | "Player 1": [
30 | "gpt-3.5-turbo-0613",
31 | "Sandwich"
32 | ]
33 | },
34 | "seed": 4433,
35 | "rounds": {
36 | "round-1": {
37 | "describe": {
38 | "Player 3": "Player 3: It's a popular snack at baseball games and carnivals.",
39 | "Player 4": "Player 4: It's a versatile meal with layers of delicious fillings.",
40 | "Player 2": "Player 2: It's a portable meal that can be enjoyed on-the-go.",
41 | "Player 1": "Player 1: It's a classic lunch option with a variety of fillings."
42 | },
43 | "describe_cot": {
44 | "Player 4": "Player 4: Based on Player 3's description, I believe their keyword is \"Popcorn\".",
45 | "Player 2": "Player 2: Based on their descriptions, I think Player 3's keyword might be Hot Dog and Player 4's keyword might be Sandwich.",
46 | "Player 1": "Player 1: Based on the descriptions given, I believe Player 2's keyword is Sandwich."
47 | },
48 | "vote": {
49 | "Player 3": "Host: Player 3 votes for Player 4. Reason: Player 3: I vote for Player 4.",
50 | "Player 2": "Host: Player 2 votes for Player 3. Reason: Player 2: I vote for Player 3.",
51 | "Player 4": "Host: Player 4 votes for Player 3. Reason: Player 4: I vote for Player 3.",
52 | "Player 1": "Host: Player 1 votes for Player 3. Reason: Player 1: I vote for Player 3."
53 | },
54 | "vote_cot": {
55 | "Player 3": "Player 3: Based on the descriptions, I think 'Player 1', 'Player 2', and myself are villagers because our descriptions match the characteristics of a hotdog. However, 'Player 4' mentioned \"layers of delicious fillings\" which seems a bit off from the keyword hotdog. So, I suspect 'Player 4' might be the spy.",
56 | "Player 2": "Player 2: Based on the descriptions given, I believe Player 1's keyword is Sandwich, Player 3's keyword is Hot Dog, and Player 4's keyword is Sandwich. As for myself, I am also a villager player with the keyword Sandwich. Therefore, the spy player must be Player 3.",
57 | "Player 4": "Player 4: Based on the descriptions given, I believe Player 1, Player 2, and Player 3 are all villagers. Their descriptions align with the keyword \"Sandwich\". As for myself, I also have the keyword \"Sandwich\". Therefore, I believe the spy player is Player 4.",
58 | "Player 1": "Player 1: Based on the descriptions given, I believe Player 2's keyword is Sandwich. However, I cannot determine the identity of the spy player at this point."
59 | },
60 | "vote_num": {
61 | "Player 1": 0,
62 | "Player 2": 0,
63 | "Player 3": 3,
64 | "Player 4": 1
65 | },
66 | "result": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Hotdog\tvillager's word: Sandwich"
67 | }
68 | },
69 | "players": {
70 | "Player 3": [
71 | {
72 | "role": "system",
73 | "content": "You are Player 3. Your keyword is Hotdog. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
74 | },
75 | {
76 | "role": "user",
77 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 4', 'Player 2', 'Player 1']."
78 | },
79 | {
80 | "role": "user",
81 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 3, it's your turn to describe \"Hotdog\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
82 | },
83 | {
84 | "role": "assistant",
85 | "content": "Player 3: It's a popular snack at baseball games and carnivals."
86 | },
87 | {
88 | "role": "user",
89 | "content": "Player 4: It's a versatile meal with layers of delicious fillings."
90 | },
91 | {
92 | "role": "user",
93 | "content": "Player 2: It's a portable meal that can be enjoyed on-the-go."
94 | },
95 | {
96 | "role": "user",
97 | "content": "Player 1: It's a classic lunch option with a variety of fillings."
98 | },
99 | {
100 | "role": "user",
101 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
102 | },
103 | {
104 | "role": "user",
105 | "content": "System: 1. Your keyword is: Hotdog. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Hotdog. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 3, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
106 | },
107 | {
108 | "role": "assistant",
109 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 3: Based on the descriptions, I think 'Player 1', 'Player 2', and myself are villagers because our descriptions match the characteristics of a hotdog. However, 'Player 4' mentioned \"layers of delicious fillings\" which seems a bit off from the keyword hotdog. So, I suspect 'Player 4' might be the spy."
110 | },
111 | {
112 | "role": "user",
113 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 3, it's your turn to vote one name from ['Player 1', 'Player 2', 'Player 4'] without reason."
114 | },
115 | {
116 | "role": "assistant",
117 | "content": "Player 3: I vote for Player 4."
118 | },
119 | {
120 | "role": "user",
121 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Hotdog\tvillager's word: Sandwich"
122 | }
123 | ],
124 | "Player 2": [
125 | {
126 | "role": "system",
127 | "content": "You are Player 2. Your keyword is Sandwich. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
128 | },
129 | {
130 | "role": "user",
131 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 4', 'Player 2', 'Player 1']."
132 | },
133 | {
134 | "role": "user",
135 | "content": "Player 3: It's a popular snack at baseball games and carnivals."
136 | },
137 | {
138 | "role": "user",
139 | "content": "Player 4: It's a versatile meal with layers of delicious fillings."
140 | },
141 | {
142 | "role": "user",
143 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Sandwich.\n\nHost: Player 2, it's your turn to guess the keywords of these players ['Player 3', 'Player 4']."
144 | },
145 | {
146 | "role": "assistant",
147 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 2: Based on their descriptions, I think Player 3's keyword might be Hot Dog and Player 4's keyword might be Sandwich."
148 | },
149 | {
150 | "role": "user",
151 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 2, it's your turn to describe \"Sandwich\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
152 | },
153 | {
154 | "role": "assistant",
155 | "content": "Player 2: It's a portable meal that can be enjoyed on-the-go."
156 | },
157 | {
158 | "role": "user",
159 | "content": "Player 1: It's a classic lunch option with a variety of fillings."
160 | },
161 | {
162 | "role": "user",
163 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
164 | },
165 | {
166 | "role": "user",
167 | "content": "System: 1. Your keyword is: Sandwich. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Sandwich. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 2, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
168 | },
169 | {
170 | "role": "assistant",
171 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 2: Based on the descriptions given, I believe Player 1's keyword is Sandwich, Player 3's keyword is Hot Dog, and Player 4's keyword is Sandwich. As for myself, I am also a villager player with the keyword Sandwich. Therefore, the spy player must be Player 3."
172 | },
173 | {
174 | "role": "user",
175 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 2, it's your turn to vote one name from ['Player 3', 'Player 1', 'Player 4'] without reason."
176 | },
177 | {
178 | "role": "assistant",
179 | "content": "Player 2: I vote for Player 3."
180 | },
181 | {
182 | "role": "user",
183 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Hotdog\tvillager's word: Sandwich"
184 | }
185 | ],
186 | "Player 4": [
187 | {
188 | "role": "system",
189 | "content": "You are Player 4. Your keyword is Sandwich. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
190 | },
191 | {
192 | "role": "user",
193 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 4', 'Player 2', 'Player 1']."
194 | },
195 | {
196 | "role": "user",
197 | "content": "Player 3: It's a popular snack at baseball games and carnivals."
198 | },
199 | {
200 | "role": "user",
201 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Sandwich.\n\nHost: Player 4, it's your turn to guess the keywords of these players ['Player 3']."
202 | },
203 | {
204 | "role": "assistant",
205 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 4: Based on Player 3's description, I believe their keyword is \"Popcorn\"."
206 | },
207 | {
208 | "role": "user",
209 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 4, it's your turn to describe \"Sandwich\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
210 | },
211 | {
212 | "role": "assistant",
213 | "content": "Player 4: It's a versatile meal with layers of delicious fillings."
214 | },
215 | {
216 | "role": "user",
217 | "content": "Player 2: It's a portable meal that can be enjoyed on-the-go."
218 | },
219 | {
220 | "role": "user",
221 | "content": "Player 1: It's a classic lunch option with a variety of fillings."
222 | },
223 | {
224 | "role": "user",
225 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
226 | },
227 | {
228 | "role": "user",
229 | "content": "System: 1. Your keyword is: Sandwich. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Sandwich. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 4, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
230 | },
231 | {
232 | "role": "assistant",
233 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 4: Based on the descriptions given, I believe Player 1, Player 2, and Player 3 are all villagers. Their descriptions align with the keyword \"Sandwich\". As for myself, I also have the keyword \"Sandwich\". Therefore, I believe the spy player is Player 4."
234 | },
235 | {
236 | "role": "user",
237 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 4, it's your turn to vote one name from ['Player 3', 'Player 2', 'Player 1'] without reason."
238 | },
239 | {
240 | "role": "assistant",
241 | "content": "Player 4: I vote for Player 3."
242 | },
243 | {
244 | "role": "user",
245 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Hotdog\tvillager's word: Sandwich"
246 | }
247 | ],
248 | "Player 1": [
249 | {
250 | "role": "system",
251 | "content": "You are Player 1. Your keyword is Sandwich. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
252 | },
253 | {
254 | "role": "user",
255 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 4', 'Player 2', 'Player 1']."
256 | },
257 | {
258 | "role": "user",
259 | "content": "Player 3: It's a popular snack at baseball games and carnivals."
260 | },
261 | {
262 | "role": "user",
263 | "content": "Player 4: It's a versatile meal with layers of delicious fillings."
264 | },
265 | {
266 | "role": "user",
267 | "content": "Player 2: It's a portable meal that can be enjoyed on-the-go."
268 | },
269 | {
270 | "role": "user",
271 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Sandwich.\n\nHost: Player 1, it's your turn to guess the keywords of these players ['Player 2', 'Player 3', 'Player 4']."
272 | },
273 | {
274 | "role": "assistant",
275 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 1: Based on the descriptions given, I believe Player 2's keyword is Sandwich."
276 | },
277 | {
278 | "role": "user",
279 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 1, it's your turn to describe \"Sandwich\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
280 | },
281 | {
282 | "role": "assistant",
283 | "content": "Player 1: It's a classic lunch option with a variety of fillings."
284 | },
285 | {
286 | "role": "user",
287 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
288 | },
289 | {
290 | "role": "user",
291 | "content": "System: 1. Your keyword is: Sandwich. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Sandwich. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 1, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
292 | },
293 | {
294 | "role": "assistant",
295 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 1: Based on the descriptions given, I believe Player 2's keyword is Sandwich. However, I cannot determine the identity of the spy player at this point."
296 | },
297 | {
298 | "role": "user",
299 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 1, it's your turn to vote one name from ['Player 3', 'Player 4', 'Player 2'] without reason."
300 | },
301 | {
302 | "role": "assistant",
303 | "content": "Player 1: I vote for Player 3."
304 | },
305 | {
306 | "role": "user",
307 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Hotdog\tvillager's word: Sandwich"
308 | }
309 | ]
310 | },
311 | "players_idx": {
312 | "Player 3": [
313 | 9996.0,
314 | 9996.0,
315 | -2.0,
316 | 9997.0,
317 | 9997.0,
318 | 9997.0,
319 | 9997.0,
320 | 9997.0,
321 | -1.0,
322 | 9998.0,
323 | 0.0,
324 | 0.0,
325 | 9999.0
326 | ],
327 | "Player 2": [
328 | 9995.0,
329 | 9995.0,
330 | 9995.0,
331 | 9995.0,
332 | -3.0,
333 | 9996.0,
334 | -2.0,
335 | 9997.0,
336 | 9997.0,
337 | 9997.0,
338 | -1.0,
339 | 9998.0,
340 | 0.0,
341 | 0.0,
342 | 9999.0
343 | ],
344 | "Player 4": [
345 | 9995.0,
346 | 9995.0,
347 | 9995.0,
348 | -3.0,
349 | 9996.0,
350 | -2.0,
351 | 9997.0,
352 | 9997.0,
353 | 9997.0,
354 | 9997.0,
355 | -1.0,
356 | 9998.0,
357 | 0.0,
358 | 0.0,
359 | 9999.0
360 | ],
361 | "Player 1": [
362 | 9995.0,
363 | 9995.0,
364 | 9995.0,
365 | 9995.0,
366 | 9995.0,
367 | -3.0,
368 | 9996.0,
369 | -2.0,
370 | 9997.0,
371 | 9997.0,
372 | -1.0,
373 | 9998.0,
374 | 0.0,
375 | 0.0,
376 | 9999.0
377 | ]
378 | },
379 | "prompts": {
380 | "meta_prompt": "You are {name}. Your keyword is {secret_word}. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are {num_players} players. 2. Every player has an identity, either as a villager or a spy. There are {num_villager} villager players and {num_spy} spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game.",
381 | "word_judgement": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. {num_villager} villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is {player_secret_word}.\n\nHost: {name}, it's your turn to guess the keywords of these players {options}.",
382 | "describe_prompt": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: {name}, it's your turn to describe \"{secret_word}\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective.",
383 | "identity_judgement": "System: 1. Your keyword is: {player_secret_word}. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. {num_villager} villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is {player_secret_word}. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: {name}, it's your turn to guess the keywords and identities of these players {options}, including yourself. You must identify the only one spy player.",
384 | "vote_prompt": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: {name}, it's your turn to vote one name from {options} without reason.",
385 | "vote_result": "Host: {name1} votes for {name2}. Reason: {response}",
386 | "spy_win": "Host: {selected_name} is not the spy, the spy player {spy_name} has survived untill the end. The spy player wins, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
387 | "villager_win": "Host: {selected_name} is the spy and has been voted out. The villager players win, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
388 | "continue": "Host: {selected_name} has been voted out, but he/she is not the spy player. Let's continue the game.",
389 | "tie_prompt": "Host: There is a tie among {options}. They will proceed with a new round of descriptions, and the remaining players will vote again.",
390 | "json_save": "Now, please output your judgement in json format, with the format as follows: {json_format}."
391 | }
392 | }
--------------------------------------------------------------------------------
/benchmark/gpt-3.5-turbo-0613/gpt-4-0613/Durian.json:
--------------------------------------------------------------------------------
1 | {
2 | "game_name": "SpyGame",
3 | "start_time": "2023-10-24_08:15:24",
4 | "end_time": "2023-10-24_08:19:18",
5 | "win": "villager",
6 | "spy": "Player 3 (Durian)",
7 | "spy_word": "Durian",
8 | "villager_word": "Jackfruit",
9 | "host_agent": "gpt-3.5-turbo-0613",
10 | "guest_agent": "gpt-4-0613",
11 | "guest_identity": "spy",
12 | "guest_name": "Player 3",
13 | "temperature": 0.3,
14 | "num_players": 4,
15 | "max_rounds": 7,
16 | "players_model": {
17 | "Player 1": [
18 | "gpt-3.5-turbo-0613",
19 | "Jackfruit"
20 | ],
21 | "Player 3": [
22 | "gpt-4-0613",
23 | "Durian"
24 | ],
25 | "Player 4": [
26 | "gpt-3.5-turbo-0613",
27 | "Jackfruit"
28 | ],
29 | "Player 2": [
30 | "gpt-3.5-turbo-0613",
31 | "Jackfruit"
32 | ]
33 | },
34 | "seed": 3272,
35 | "rounds": {
36 | "round-1": {
37 | "describe": {
38 | "Player 3": "Player 3: It's a unique, tropical fruit with a strong, distinctive aroma.",
39 | "Player 2": "Player 2: It's a large, tropical fruit with a sweet and juicy flesh.",
40 | "Player 1": "Player 1: It's a versatile fruit used in both savory and sweet dishes.",
41 | "Player 4": "Player 4: It's a tropical fruit with a spiky exterior and yellow flesh."
42 | },
43 | "describe_cot": {
44 | "Player 2": "Player 2: Based on Player 3's description, I think their keyword might be Durian.",
45 | "Player 1": "Player 1: Based on their descriptions, I think Player 2's keyword might be Jackfruit. As for Player 3, I'm not quite sure yet.",
46 | "Player 4": "Player 4: Based on the descriptions given, I believe Player 1, Player 2, and Player 3 all have the keyword \"Jackfruit\"."
47 | },
48 | "vote": {
49 | "Player 1": "Host: Player 1 votes for Player 3. Reason: Host: I vote for Player 3.",
50 | "Player 3": "Host: Player 3 votes for Player 1. Reason: Player 3: I vote for Player 1.",
51 | "Player 4": "Host: Player 4 votes for Player 3. Reason: Player 4: I vote for Player 3.",
52 | "Player 2": "Host: Player 2 votes for Player 4. Reason: Player 2: I vote for Player 4."
53 | },
54 | "vote_cot": {
55 | "Player 1": "Player 1: Based on the descriptions, I believe Player 2's keyword is Jackfruit. As for Player 3 and Player 4, their descriptions align with the keyword Jackfruit as well. However, my own description of the keyword Jackfruit is different from theirs. Therefore, I suspect that I am the spy player and the other three players are villagers.",
56 | "Player 3": "Player 3: Based on the descriptions, I believe that 'Player 1', 'Player 2', and 'Player 4' are describing the same fruit as me, which is a large, tropical fruit with a distinctive aroma. Therefore, I think we are all villager players. However, 'Player 1' mentioned that the fruit is used in both savory and sweet dishes, which doesn't quite align with the rest of our descriptions. So, I suspect 'Player 1' might be the spy player.",
57 | "Player 4": "Player 4: Based on the descriptions given, I believe Player 1, Player 2, and Player 3 are all villagers with the keyword \"Jackfruit\". As for myself, I am also a villager with the keyword \"Jackfruit\". Therefore, the spy player must be Player 4.",
58 | "Player 2": "Player 2: Based on the descriptions given, I believe Player 3's keyword is Durian, Player 1's keyword is Mango, and Player 4's keyword is Pineapple. As for myself, my keyword is Jackfruit. Therefore, I believe Player 2 is the spy player."
59 | },
60 | "vote_num": {
61 | "Player 1": 1,
62 | "Player 2": 0,
63 | "Player 3": 2,
64 | "Player 4": 1
65 | },
66 | "result": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Durian\tvillager's word: Jackfruit"
67 | }
68 | },
69 | "players": {
70 | "Player 1": [
71 | {
72 | "role": "system",
73 | "content": "You are Player 1. Your keyword is Jackfruit. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
74 | },
75 | {
76 | "role": "user",
77 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 2', 'Player 1', 'Player 4']."
78 | },
79 | {
80 | "role": "user",
81 | "content": "Player 3: It's a unique, tropical fruit with a strong, distinctive aroma."
82 | },
83 | {
84 | "role": "user",
85 | "content": "Player 2: It's a large, tropical fruit with a sweet and juicy flesh."
86 | },
87 | {
88 | "role": "user",
89 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Jackfruit.\n\nHost: Player 1, it's your turn to guess the keywords of these players ['Player 2', 'Player 3']."
90 | },
91 | {
92 | "role": "assistant",
93 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 1: Based on their descriptions, I think Player 2's keyword might be Jackfruit. As for Player 3, I'm not quite sure yet."
94 | },
95 | {
96 | "role": "user",
97 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 1, it's your turn to describe \"Jackfruit\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
98 | },
99 | {
100 | "role": "assistant",
101 | "content": "Player 1: It's a versatile fruit used in both savory and sweet dishes."
102 | },
103 | {
104 | "role": "user",
105 | "content": "Player 4: It's a tropical fruit with a spiky exterior and yellow flesh."
106 | },
107 | {
108 | "role": "user",
109 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
110 | },
111 | {
112 | "role": "user",
113 | "content": "System: 1. Your keyword is: Jackfruit. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Jackfruit. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 1, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
114 | },
115 | {
116 | "role": "assistant",
117 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 1: Based on the descriptions, I believe Player 2's keyword is Jackfruit. As for Player 3 and Player 4, their descriptions align with the keyword Jackfruit as well. However, my own description of the keyword Jackfruit is different from theirs. Therefore, I suspect that I am the spy player and the other three players are villagers."
118 | },
119 | {
120 | "role": "user",
121 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 1, it's your turn to vote one name from ['Player 3', 'Player 2', 'Player 4'] without reason."
122 | },
123 | {
124 | "role": "assistant",
125 | "content": "Host: I vote for Player 3."
126 | },
127 | {
128 | "role": "user",
129 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Durian\tvillager's word: Jackfruit"
130 | }
131 | ],
132 | "Player 3": [
133 | {
134 | "role": "system",
135 | "content": "You are Player 3. Your keyword is Durian. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
136 | },
137 | {
138 | "role": "user",
139 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 2', 'Player 1', 'Player 4']."
140 | },
141 | {
142 | "role": "user",
143 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 3, it's your turn to describe \"Durian\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
144 | },
145 | {
146 | "role": "assistant",
147 | "content": "Player 3: It's a unique, tropical fruit with a strong, distinctive aroma."
148 | },
149 | {
150 | "role": "user",
151 | "content": "Player 2: It's a large, tropical fruit with a sweet and juicy flesh."
152 | },
153 | {
154 | "role": "user",
155 | "content": "Player 1: It's a versatile fruit used in both savory and sweet dishes."
156 | },
157 | {
158 | "role": "user",
159 | "content": "Player 4: It's a tropical fruit with a spiky exterior and yellow flesh."
160 | },
161 | {
162 | "role": "user",
163 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
164 | },
165 | {
166 | "role": "user",
167 | "content": "System: 1. Your keyword is: Durian. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Durian. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 3, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
168 | },
169 | {
170 | "role": "assistant",
171 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 3: Based on the descriptions, I believe that 'Player 1', 'Player 2', and 'Player 4' are describing the same fruit as me, which is a large, tropical fruit with a distinctive aroma. Therefore, I think we are all villager players. However, 'Player 1' mentioned that the fruit is used in both savory and sweet dishes, which doesn't quite align with the rest of our descriptions. So, I suspect 'Player 1' might be the spy player."
172 | },
173 | {
174 | "role": "user",
175 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 3, it's your turn to vote one name from ['Player 2', 'Player 4', 'Player 1'] without reason."
176 | },
177 | {
178 | "role": "assistant",
179 | "content": "Player 3: I vote for Player 1."
180 | },
181 | {
182 | "role": "user",
183 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Durian\tvillager's word: Jackfruit"
184 | }
185 | ],
186 | "Player 4": [
187 | {
188 | "role": "system",
189 | "content": "You are Player 4. Your keyword is Jackfruit. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
190 | },
191 | {
192 | "role": "user",
193 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 2', 'Player 1', 'Player 4']."
194 | },
195 | {
196 | "role": "user",
197 | "content": "Player 3: It's a unique, tropical fruit with a strong, distinctive aroma."
198 | },
199 | {
200 | "role": "user",
201 | "content": "Player 2: It's a large, tropical fruit with a sweet and juicy flesh."
202 | },
203 | {
204 | "role": "user",
205 | "content": "Player 1: It's a versatile fruit used in both savory and sweet dishes."
206 | },
207 | {
208 | "role": "user",
209 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Jackfruit.\n\nHost: Player 4, it's your turn to guess the keywords of these players ['Player 1', 'Player 2', 'Player 3']."
210 | },
211 | {
212 | "role": "assistant",
213 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 4: Based on the descriptions given, I believe Player 1, Player 2, and Player 3 all have the keyword \"Jackfruit\"."
214 | },
215 | {
216 | "role": "user",
217 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 4, it's your turn to describe \"Jackfruit\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
218 | },
219 | {
220 | "role": "assistant",
221 | "content": "Player 4: It's a tropical fruit with a spiky exterior and yellow flesh."
222 | },
223 | {
224 | "role": "user",
225 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
226 | },
227 | {
228 | "role": "user",
229 | "content": "System: 1. Your keyword is: Jackfruit. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Jackfruit. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 4, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
230 | },
231 | {
232 | "role": "assistant",
233 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 4: Based on the descriptions given, I believe Player 1, Player 2, and Player 3 are all villagers with the keyword \"Jackfruit\". As for myself, I am also a villager with the keyword \"Jackfruit\". Therefore, the spy player must be Player 4."
234 | },
235 | {
236 | "role": "user",
237 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 4, it's your turn to vote one name from ['Player 3', 'Player 2', 'Player 1'] without reason."
238 | },
239 | {
240 | "role": "assistant",
241 | "content": "Player 4: I vote for Player 3."
242 | },
243 | {
244 | "role": "user",
245 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Durian\tvillager's word: Jackfruit"
246 | }
247 | ],
248 | "Player 2": [
249 | {
250 | "role": "system",
251 | "content": "You are Player 2. Your keyword is Jackfruit. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
252 | },
253 | {
254 | "role": "user",
255 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 3', 'Player 2', 'Player 1', 'Player 4']."
256 | },
257 | {
258 | "role": "user",
259 | "content": "Player 3: It's a unique, tropical fruit with a strong, distinctive aroma."
260 | },
261 | {
262 | "role": "user",
263 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Jackfruit.\n\nHost: Player 2, it's your turn to guess the keywords of these players ['Player 3']."
264 | },
265 | {
266 | "role": "assistant",
267 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 2: Based on Player 3's description, I think their keyword might be Durian."
268 | },
269 | {
270 | "role": "user",
271 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 2, it's your turn to describe \"Jackfruit\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
272 | },
273 | {
274 | "role": "assistant",
275 | "content": "Player 2: It's a large, tropical fruit with a sweet and juicy flesh."
276 | },
277 | {
278 | "role": "user",
279 | "content": "Player 1: It's a versatile fruit used in both savory and sweet dishes."
280 | },
281 | {
282 | "role": "user",
283 | "content": "Player 4: It's a tropical fruit with a spiky exterior and yellow flesh."
284 | },
285 | {
286 | "role": "user",
287 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
288 | },
289 | {
290 | "role": "user",
291 | "content": "System: 1. Your keyword is: Jackfruit. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Jackfruit. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 2, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
292 | },
293 | {
294 | "role": "assistant",
295 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 2: Based on the descriptions given, I believe Player 3's keyword is Durian, Player 1's keyword is Mango, and Player 4's keyword is Pineapple. As for myself, my keyword is Jackfruit. Therefore, I believe Player 2 is the spy player."
296 | },
297 | {
298 | "role": "user",
299 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 2, it's your turn to vote one name from ['Player 1', 'Player 3', 'Player 4'] without reason."
300 | },
301 | {
302 | "role": "assistant",
303 | "content": "Player 2: I vote for Player 4."
304 | },
305 | {
306 | "role": "user",
307 | "content": "Host: Player 3 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Durian\tvillager's word: Jackfruit"
308 | }
309 | ]
310 | },
311 | "players_idx": {
312 | "Player 1": [
313 | 9995.0,
314 | 9995.0,
315 | 9995.0,
316 | 9995.0,
317 | -3.0,
318 | 9996.0,
319 | -2.0,
320 | 9997.0,
321 | 9997.0,
322 | 9997.0,
323 | -1.0,
324 | 9998.0,
325 | 0.0,
326 | 0.0,
327 | 9999.0
328 | ],
329 | "Player 3": [
330 | 9996.0,
331 | 9996.0,
332 | -2.0,
333 | 9997.0,
334 | 9997.0,
335 | 9997.0,
336 | 9997.0,
337 | 9997.0,
338 | -1.0,
339 | 9998.0,
340 | 0.0,
341 | 0.0,
342 | 9999.0
343 | ],
344 | "Player 4": [
345 | 9995.0,
346 | 9995.0,
347 | 9995.0,
348 | 9995.0,
349 | 9995.0,
350 | -3.0,
351 | 9996.0,
352 | -2.0,
353 | 9997.0,
354 | 9997.0,
355 | -1.0,
356 | 9998.0,
357 | 0.0,
358 | 0.0,
359 | 9999.0
360 | ],
361 | "Player 2": [
362 | 9995.0,
363 | 9995.0,
364 | 9995.0,
365 | -3.0,
366 | 9996.0,
367 | -2.0,
368 | 9997.0,
369 | 9997.0,
370 | 9997.0,
371 | 9997.0,
372 | -1.0,
373 | 9998.0,
374 | 0.0,
375 | 0.0,
376 | 9999.0
377 | ]
378 | },
379 | "prompts": {
380 | "meta_prompt": "You are {name}. Your keyword is {secret_word}. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are {num_players} players. 2. Every player has an identity, either as a villager or a spy. There are {num_villager} villager players and {num_spy} spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game.",
381 | "word_judgement": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. {num_villager} villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is {player_secret_word}.\n\nHost: {name}, it's your turn to guess the keywords of these players {options}.",
382 | "describe_prompt": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: {name}, it's your turn to describe \"{secret_word}\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective.",
383 | "identity_judgement": "System: 1. Your keyword is: {player_secret_word}. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. {num_villager} villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is {player_secret_word}. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: {name}, it's your turn to guess the keywords and identities of these players {options}, including yourself. You must identify the only one spy player.",
384 | "vote_prompt": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: {name}, it's your turn to vote one name from {options} without reason.",
385 | "vote_result": "Host: {name1} votes for {name2}. Reason: {response}",
386 | "spy_win": "Host: {selected_name} is not the spy, the spy player {spy_name} has survived untill the end. The spy player wins, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
387 | "villager_win": "Host: {selected_name} is the spy and has been voted out. The villager players win, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
388 | "continue": "Host: {selected_name} has been voted out, but he/she is not the spy player. Let's continue the game.",
389 | "tie_prompt": "Host: There is a tie among {options}. They will proceed with a new round of descriptions, and the remaining players will vote again.",
390 | "json_save": "Now, please output your judgement in json format, with the format as follows: {json_format}."
391 | }
392 | }
--------------------------------------------------------------------------------
/benchmark/gpt-3.5-turbo-0613/gpt-4-0613/Jackfruit.json:
--------------------------------------------------------------------------------
1 | {
2 | "game_name": "SpyGame",
3 | "start_time": "2023-10-24_08:11:23",
4 | "end_time": "2023-10-24_08:15:23",
5 | "win": "villager",
6 | "spy": "Player 4 (Jackfruit)",
7 | "spy_word": "Jackfruit",
8 | "villager_word": "Durian",
9 | "host_agent": "gpt-3.5-turbo-0613",
10 | "guest_agent": "gpt-4-0613",
11 | "guest_identity": "spy",
12 | "guest_name": "Player 4",
13 | "temperature": 0.3,
14 | "num_players": 4,
15 | "max_rounds": 7,
16 | "players_model": {
17 | "Player 4": [
18 | "gpt-4-0613",
19 | "Jackfruit"
20 | ],
21 | "Player 1": [
22 | "gpt-3.5-turbo-0613",
23 | "Durian"
24 | ],
25 | "Player 3": [
26 | "gpt-3.5-turbo-0613",
27 | "Durian"
28 | ],
29 | "Player 2": [
30 | "gpt-3.5-turbo-0613",
31 | "Durian"
32 | ]
33 | },
34 | "seed": 3632,
35 | "rounds": {
36 | "round-1": {
37 | "describe": {
38 | "Player 2": "Player 2: A tropical fruit with a strong and unique smell.",
39 | "Player 3": "Player 3: A spiky fruit with a creamy and pungent flesh inside.",
40 | "Player 1": "Player 1: A fruit with a thorny exterior and a creamy, custard-like flesh.",
41 | "Player 4": "Player 4: This fruit is often used as a meat substitute in vegetarian dishes."
42 | },
43 | "describe_cot": {
44 | "Player 3": "Player 3: Based on Player 2's description, I think their keyword might be Durian.",
45 | "Player 1": "Player 1: Based on their descriptions, I believe Player 2 and Player 3 are both referring to the keyword Durian.",
46 | "Player 4": "Player 4: A large fruit, native to South Asia, that has a distinctive sweet and fruity flavor."
47 | },
48 | "vote": {
49 | "Player 4": "Host: Player 4 votes for Player 2. Reason: Player 4: I vote for Player 2.",
50 | "Player 1": "Host: Player 1 votes for Player 4. Reason: Player 1: I vote for Player 4.",
51 | "Player 3": "Host: Player 3 votes for Player 4. Reason: Player 3: I vote for Player 4.",
52 | "Player 2": "Host: Player 2 votes for Player 4. Reason: Player 2: I vote for Player 4."
53 | },
54 | "vote_cot": {
55 | "Player 4": "Player 4: Based on the descriptions, I believe that we all have the same keyword. Our descriptions align closely with each other, indicating a tropical fruit with a unique smell and taste, which matches my keyword. Therefore, I think we are all villager players at this point. However, since the game requires identifying a spy, I will randomly choose Player 2 as the potential spy for this round.",
56 | "Player 1": "Player 1: Based on the descriptions given, I believe Player 2, Player 3, and myself are all villagers with the keyword Durian. However, Player 4's description of the fruit being used as a meat substitute in vegetarian dishes seems to be different from the rest of us. Therefore, I suspect that Player 4 is the spy player.",
57 | "Player 3": "Player 3: Based on the descriptions given, I believe Player 1, Player 2, and myself are villagers with the keyword Durian. However, Player 4's description of the fruit being used as a meat substitute in vegetarian dishes seems different from the rest of us. Therefore, I suspect that Player 4 is the spy player.",
58 | "Player 2": "Player 2: Based on the descriptions given, I believe Player 4 is the spy player. The descriptions from Player 1, Player 2, and Player 3 all align closely with the keyword \"Durian,\" describing its spiky exterior and creamy flesh. However, Player 4's description of the fruit being used as a meat substitute does not match the other descriptions. Therefore, I believe Player 4 is the spy player."
59 | },
60 | "vote_num": {
61 | "Player 1": 0,
62 | "Player 2": 1,
63 | "Player 3": 0,
64 | "Player 4": 3
65 | },
66 | "result": "Host: Player 4 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Jackfruit\tvillager's word: Durian"
67 | }
68 | },
69 | "players": {
70 | "Player 4": [
71 | {
72 | "role": "system",
73 | "content": "You are Player 4. Your keyword is Jackfruit. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
74 | },
75 | {
76 | "role": "user",
77 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 2', 'Player 3', 'Player 1', 'Player 4']."
78 | },
79 | {
80 | "role": "user",
81 | "content": "Player 2: A tropical fruit with a strong and unique smell."
82 | },
83 | {
84 | "role": "user",
85 | "content": "Player 3: A spiky fruit with a creamy and pungent flesh inside."
86 | },
87 | {
88 | "role": "user",
89 | "content": "Player 1: A fruit with a thorny exterior and a creamy, custard-like flesh."
90 | },
91 | {
92 | "role": "user",
93 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Jackfruit.\n\nHost: Player 4, it's your turn to guess the keywords of these players ['Player 1', 'Player 2', 'Player 3']."
94 | },
95 | {
96 | "role": "assistant",
97 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 4: A large fruit, native to South Asia, that has a distinctive sweet and fruity flavor."
98 | },
99 | {
100 | "role": "user",
101 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 4, it's your turn to describe \"Jackfruit\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
102 | },
103 | {
104 | "role": "assistant",
105 | "content": "Player 4: This fruit is often used as a meat substitute in vegetarian dishes."
106 | },
107 | {
108 | "role": "user",
109 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
110 | },
111 | {
112 | "role": "user",
113 | "content": "System: 1. Your keyword is: Jackfruit. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Jackfruit. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 4, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
114 | },
115 | {
116 | "role": "assistant",
117 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 4: Based on the descriptions, I believe that we all have the same keyword. Our descriptions align closely with each other, indicating a tropical fruit with a unique smell and taste, which matches my keyword. Therefore, I think we are all villager players at this point. However, since the game requires identifying a spy, I will randomly choose Player 2 as the potential spy for this round."
118 | },
119 | {
120 | "role": "user",
121 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 4, it's your turn to vote one name from ['Player 3', 'Player 2', 'Player 1'] without reason."
122 | },
123 | {
124 | "role": "assistant",
125 | "content": "Player 4: I vote for Player 2."
126 | },
127 | {
128 | "role": "user",
129 | "content": "Host: Player 4 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Jackfruit\tvillager's word: Durian"
130 | }
131 | ],
132 | "Player 1": [
133 | {
134 | "role": "system",
135 | "content": "You are Player 1. Your keyword is Durian. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
136 | },
137 | {
138 | "role": "user",
139 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 2', 'Player 3', 'Player 1', 'Player 4']."
140 | },
141 | {
142 | "role": "user",
143 | "content": "Player 2: A tropical fruit with a strong and unique smell."
144 | },
145 | {
146 | "role": "user",
147 | "content": "Player 3: A spiky fruit with a creamy and pungent flesh inside."
148 | },
149 | {
150 | "role": "user",
151 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Durian.\n\nHost: Player 1, it's your turn to guess the keywords of these players ['Player 2', 'Player 3']."
152 | },
153 | {
154 | "role": "assistant",
155 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 1: Based on their descriptions, I believe Player 2 and Player 3 are both referring to the keyword Durian."
156 | },
157 | {
158 | "role": "user",
159 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 1, it's your turn to describe \"Durian\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
160 | },
161 | {
162 | "role": "assistant",
163 | "content": "Player 1: A fruit with a thorny exterior and a creamy, custard-like flesh."
164 | },
165 | {
166 | "role": "user",
167 | "content": "Player 4: This fruit is often used as a meat substitute in vegetarian dishes."
168 | },
169 | {
170 | "role": "user",
171 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
172 | },
173 | {
174 | "role": "user",
175 | "content": "System: 1. Your keyword is: Durian. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Durian. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 1, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
176 | },
177 | {
178 | "role": "assistant",
179 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 1: Based on the descriptions given, I believe Player 2, Player 3, and myself are all villagers with the keyword Durian. However, Player 4's description of the fruit being used as a meat substitute in vegetarian dishes seems to be different from the rest of us. Therefore, I suspect that Player 4 is the spy player."
180 | },
181 | {
182 | "role": "user",
183 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 1, it's your turn to vote one name from ['Player 2', 'Player 3', 'Player 4'] without reason."
184 | },
185 | {
186 | "role": "assistant",
187 | "content": "Player 1: I vote for Player 4."
188 | },
189 | {
190 | "role": "user",
191 | "content": "Host: Player 4 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Jackfruit\tvillager's word: Durian"
192 | }
193 | ],
194 | "Player 3": [
195 | {
196 | "role": "system",
197 | "content": "You are Player 3. Your keyword is Durian. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
198 | },
199 | {
200 | "role": "user",
201 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 2', 'Player 3', 'Player 1', 'Player 4']."
202 | },
203 | {
204 | "role": "user",
205 | "content": "Player 2: A tropical fruit with a strong and unique smell."
206 | },
207 | {
208 | "role": "user",
209 | "content": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. 3 villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is Durian.\n\nHost: Player 3, it's your turn to guess the keywords of these players ['Player 2']."
210 | },
211 | {
212 | "role": "assistant",
213 | "content": "Here is my thought during the first round of the description phase.\n\nPlayer 3: Based on Player 2's description, I think their keyword might be Durian."
214 | },
215 | {
216 | "role": "user",
217 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 3, it's your turn to describe \"Durian\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
218 | },
219 | {
220 | "role": "assistant",
221 | "content": "Player 3: A spiky fruit with a creamy and pungent flesh inside."
222 | },
223 | {
224 | "role": "user",
225 | "content": "Player 1: A fruit with a thorny exterior and a creamy, custard-like flesh."
226 | },
227 | {
228 | "role": "user",
229 | "content": "Player 4: This fruit is often used as a meat substitute in vegetarian dishes."
230 | },
231 | {
232 | "role": "user",
233 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
234 | },
235 | {
236 | "role": "user",
237 | "content": "System: 1. Your keyword is: Durian. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Durian. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 3, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
238 | },
239 | {
240 | "role": "assistant",
241 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 3: Based on the descriptions given, I believe Player 1, Player 2, and myself are villagers with the keyword Durian. However, Player 4's description of the fruit being used as a meat substitute in vegetarian dishes seems different from the rest of us. Therefore, I suspect that Player 4 is the spy player."
242 | },
243 | {
244 | "role": "user",
245 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 3, it's your turn to vote one name from ['Player 1', 'Player 4', 'Player 2'] without reason."
246 | },
247 | {
248 | "role": "assistant",
249 | "content": "Player 3: I vote for Player 4."
250 | },
251 | {
252 | "role": "user",
253 | "content": "Host: Player 4 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Jackfruit\tvillager's word: Durian"
254 | }
255 | ],
256 | "Player 2": [
257 | {
258 | "role": "system",
259 | "content": "You are Player 2. Your keyword is Durian. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are 4 players. 2. Every player has an identity, either as a villager or a spy. There are 3 villager players and 1 spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game."
260 | },
261 | {
262 | "role": "user",
263 | "content": "Host: It is now the description phase, please take turns to describe the keyword you received in the order of ['Player 2', 'Player 3', 'Player 1', 'Player 4']."
264 | },
265 | {
266 | "role": "user",
267 | "content": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: Player 2, it's your turn to describe \"Durian\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective."
268 | },
269 | {
270 | "role": "assistant",
271 | "content": "Player 2: A tropical fruit with a strong and unique smell."
272 | },
273 | {
274 | "role": "user",
275 | "content": "Player 3: A spiky fruit with a creamy and pungent flesh inside."
276 | },
277 | {
278 | "role": "user",
279 | "content": "Player 1: A fruit with a thorny exterior and a creamy, custard-like flesh."
280 | },
281 | {
282 | "role": "user",
283 | "content": "Player 4: This fruit is often used as a meat substitute in vegetarian dishes."
284 | },
285 | {
286 | "role": "user",
287 | "content": "Host: It is now the voting phase, Please judge the keywords and identities of these alive players ['Player 1', 'Player 2', 'Player 3', 'Player 4']."
288 | },
289 | {
290 | "role": "user",
291 | "content": "System: 1. Your keyword is: Durian. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. 3 villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is Durian. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: Player 2, it's your turn to guess the keywords and identities of these players ['Player 1', 'Player 2', 'Player 3', 'Player 4'], including yourself. You must identify the only one spy player."
292 | },
293 | {
294 | "role": "assistant",
295 | "content": "Here is my thought during the first round of the voting phase.\n\nPlayer 2: Based on the descriptions given, I believe Player 4 is the spy player. The descriptions from Player 1, Player 2, and Player 3 all align closely with the keyword \"Durian,\" describing its spiky exterior and creamy flesh. However, Player 4's description of the fruit being used as a meat substitute does not match the other descriptions. Therefore, I believe Player 4 is the spy player."
296 | },
297 | {
298 | "role": "user",
299 | "content": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: Player 2, it's your turn to vote one name from ['Player 3', 'Player 1', 'Player 4'] without reason."
300 | },
301 | {
302 | "role": "assistant",
303 | "content": "Player 2: I vote for Player 4."
304 | },
305 | {
306 | "role": "user",
307 | "content": "Host: Player 4 is the spy and has been voted out. The villager players win, game over.\nSpy's word: Jackfruit\tvillager's word: Durian"
308 | }
309 | ]
310 | },
311 | "players_idx": {
312 | "Player 4": [
313 | 9995.0,
314 | 9995.0,
315 | 9995.0,
316 | 9995.0,
317 | 9995.0,
318 | -3.0,
319 | 9996.0,
320 | -2.0,
321 | 9997.0,
322 | 9997.0,
323 | -1.0,
324 | 9998.0,
325 | 0.0,
326 | 0.0,
327 | 9999.0
328 | ],
329 | "Player 1": [
330 | 9995.0,
331 | 9995.0,
332 | 9995.0,
333 | 9995.0,
334 | -3.0,
335 | 9996.0,
336 | -2.0,
337 | 9997.0,
338 | 9997.0,
339 | 9997.0,
340 | -1.0,
341 | 9998.0,
342 | 0.0,
343 | 0.0,
344 | 9999.0
345 | ],
346 | "Player 3": [
347 | 9995.0,
348 | 9995.0,
349 | 9995.0,
350 | -3.0,
351 | 9996.0,
352 | -2.0,
353 | 9997.0,
354 | 9997.0,
355 | 9997.0,
356 | 9997.0,
357 | -1.0,
358 | 9998.0,
359 | 0.0,
360 | 0.0,
361 | 9999.0
362 | ],
363 | "Player 2": [
364 | 9996.0,
365 | 9996.0,
366 | -2.0,
367 | 9997.0,
368 | 9997.0,
369 | 9997.0,
370 | 9997.0,
371 | 9997.0,
372 | -1.0,
373 | 9998.0,
374 | 0.0,
375 | 0.0,
376 | 9999.0
377 | ]
378 | },
379 | "prompts": {
380 | "meta_prompt": "You are {name}. Your keyword is {secret_word}. You are now participating in the \"Who is the Spy\" game.\n\nGame Introduction: 1. There are {num_players} players. 2. Every player has an identity, either as a villager or a spy. There are {num_villager} villager players and {num_spy} spy player. 3. At the beginning of the game, all players are unsure of their own identity or that of the other players. However, each player has a keyword and each player is unaware of the other players' keywords. 4. All villager players have the same keyword, ditto for spy player. But the villager camp and the spy camp have different keywords. 5. The goal of the villager players is to find the spy player and vote the spy player out of the game. 6. The goal of the spy player is to survive until the end of the game.\n\nGame Flow: 1. This game has multiple rounds. 2. There are two phases in each round: Description phase: Each player describes their keywords in turn. Voting phase: Each player must choose one of the other players. The player who receives the most votes is voted out. 3. The game ends when the victory condition for either camp is reached.\n\nRules you must obey in the description phase: 1. Your description must not contain your keyword. 2. Your description must not deviate from your keyword. 3. Your description must not be a repetition of other players' description.\n\nRecommanded Strategies: Description phase: 1. If you cannot judge your identity, your description should be as conservative as possible. 2. If you think you are a villager player, Your description should avoid letting spy player guess your keyword. 3. If you think you are a spy player, your description should be as close as possible to those of villager players. You can describe the commonalities between their descriptions and your keyword, but must not deviate from your keyword. Voting phase: 1. Guess other players' keywords based on their descriptions. 2. Guess the identities of all players, including yourself, based on the situation in the game.",
381 | "word_judgement": "System: 1. This is a game with two keywords, representing the two factions: villagers and spy. 2. {num_villager} villager players have the same keyword, one spy player has another keyword. 3. There are only two keywords, one of these two keywords is {player_secret_word}.\n\nHost: {name}, it's your turn to guess the keywords of these players {options}.",
382 | "describe_prompt": "System: 1. If you find the description of one other player that is clearly different from the rest of you players, your description should avoid letting spy player guess your keyword. 2. If your keyword is clearly different from the description of all other players, your description should be as close as possible to other players. 3. If you cannot judge your identity, your description should be as conservative as possible.\n\nHost: {name}, it's your turn to describe \"{secret_word}\" with a sentence of 10 words or less. Your description must not be a repetition of other players' description. Please describe your keyword from another perspective.",
383 | "identity_judgement": "System: 1. Your keyword is: {player_secret_word}. 2. This is a game with two keywords, representing the two factions: villagers and spy. 3. {num_villager} villager players have the same keyword, one spy player has another keyword. 4. There are only two words, one of these two keywords is {player_secret_word}. 5. If you find the description of one other player that is clearly different from the rest of you players, you can judge the player is a spy player and you are a villager player. 6. If your keyword is clearly different from the description of all other players, you can judge that you are a spy player. 7. Remember you should identify exactly one spy player at each round.\n\nHost: {name}, it's your turn to guess the keywords and identities of these players {options}, including yourself. You must identify the only one spy player.",
384 | "vote_prompt": "System: 1. If you think you are a villager player, please vote for the player who you think is most likely to be the spy player. 2. If you think you are a spy player, please vote for the player you think is the most threatening.\n\nHost: {name}, it's your turn to vote one name from {options} without reason.",
385 | "vote_result": "Host: {name1} votes for {name2}. Reason: {response}",
386 | "spy_win": "Host: {selected_name} is not the spy, the spy player {spy_name} has survived untill the end. The spy player wins, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
387 | "villager_win": "Host: {selected_name} is the spy and has been voted out. The villager players win, game over.\nSpy's word: {spy_word}\tvillager's word: {villager_word}",
388 | "continue": "Host: {selected_name} has been voted out, but he/she is not the spy player. Let's continue the game.",
389 | "tie_prompt": "Host: There is a tie among {options}. They will proceed with a new round of descriptions, and the remaining players will vote again.",
390 | "json_save": "Now, please output your judgement in json format, with the format as follows: {json_format}."
391 | }
392 | }
--------------------------------------------------------------------------------