Spaces:
Running
Running
Yiqiao Jin
commited on
Commit
·
1d838f0
1
Parent(s):
9fbbf6c
Reviewer with multiple characteristics
Browse files- README.md +11 -0
- agentreview/arguments.py +30 -15
- agentreview/experiment_config.py +25 -4
- agentreview/paper_review_settings.py +7 -14
- agentreview/role_descriptions.py +2 -2
README.md
CHANGED
@@ -104,6 +104,17 @@ export AZURE_OPENAI_KEY=... # Your Azure OpenAI key here
|
|
104 |
|
105 |
A demo can be found in `notebooks/demo.ipynb`
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
## Framework Overview
|
109 |
|
|
|
104 |
|
105 |
A demo can be found in `notebooks/demo.ipynb`
|
106 |
|
107 |
+
### Customizing your own environment
|
108 |
+
|
109 |
+
You can add a new setting in `agentreview/experiment_config.py`, then add the setting as a new entry to the `all_settings` dictionary:
|
110 |
+
|
111 |
+
```python
|
112 |
+
all_settings = {
|
113 |
+
"BASELINE": baseline_setting,
|
114 |
+
"benign_Rx1": benign_Rx1_setting,
|
115 |
+
...
|
116 |
+
"your_setting_name": your_setting
|
117 |
+
```
|
118 |
|
119 |
## Framework Overview
|
120 |
|
agentreview/arguments.py
CHANGED
@@ -1,18 +1,22 @@
|
|
1 |
import argparse
|
2 |
import logging
|
3 |
import os
|
4 |
-
|
|
|
|
|
5 |
|
6 |
def parse_args():
|
7 |
parser = argparse.ArgumentParser(description="Argument parser for configuring OpenAI API and experiment settings")
|
8 |
|
9 |
# Authentication details for OpenAI API
|
10 |
parser.add_argument(
|
11 |
-
"--openai_key", type=str, default=None,
|
|
|
12 |
)
|
13 |
|
14 |
parser.add_argument(
|
15 |
-
"--deployment", type=str, default=None,
|
|
|
16 |
)
|
17 |
|
18 |
parser.add_argument(
|
@@ -21,10 +25,10 @@ def parse_args():
|
|
21 |
)
|
22 |
|
23 |
parser.add_argument(
|
24 |
-
"--endpoint", type=str, default=None,
|
|
|
25 |
)
|
26 |
|
27 |
-
|
28 |
parser.add_argument(
|
29 |
"--api_version", type=str, default="2023-05-15", help="API version to be used for making requests. Required "
|
30 |
"for Azure OpenAI clients."
|
@@ -37,7 +41,8 @@ def parse_args():
|
|
37 |
)
|
38 |
|
39 |
parser.add_argument(
|
40 |
-
"--conference", type=str, default="ICLR2023",
|
|
|
41 |
)
|
42 |
|
43 |
parser.add_argument(
|
@@ -47,22 +52,20 @@ def parse_args():
|
|
47 |
parser.add_argument(
|
48 |
"--experiment_name",
|
49 |
type=str, default=None, required=False,
|
50 |
-
choices=[
|
51 |
-
"BASELINE", "benign_Rx1", "malicious_Rx1", "malicious_Rx2", "malicious_Rx3", "unknowledgeable_Rx1",
|
52 |
-
"knowledgeable_Rx1", "responsible_Rx1", "irresponsible_Rx1", "irresponsible_Rx2", "irresponsible_Rx3",
|
53 |
-
"inclusive_ACx1", "authoritarian_ACx1", "conformist_ACx1", "no_numeric_ratings"],
|
54 |
help="Specifies the name of the experiment to run. Choose from predefined experiment types based on the reviewer and AC behavior or experiment configuration."
|
55 |
)
|
56 |
|
57 |
parser.add_argument(
|
58 |
-
"--overwrite", action="store_true",
|
|
|
59 |
)
|
60 |
parser.add_argument(
|
61 |
"--skip_logging", action="store_true", help="If set, we do not log the messages in the console."
|
62 |
)
|
63 |
|
64 |
parser.add_argument(
|
65 |
-
"--num_papers_per_area_chair", type=int, default=10,
|
|
|
66 |
)
|
67 |
|
68 |
# Model configuration
|
@@ -83,19 +86,20 @@ def parse_args():
|
|
83 |
)
|
84 |
|
85 |
parser.add_argument(
|
86 |
-
"--visual_dir", type=str, default="outputs/visual",
|
|
|
87 |
)
|
88 |
|
89 |
# System configuration
|
90 |
parser.add_argument(
|
91 |
-
"--device", type=str, default='cuda',
|
|
|
92 |
)
|
93 |
|
94 |
parser.add_argument(
|
95 |
"--data_dir", type=str, default='data', help="Directory where input data (e.g., papers) are stored."
|
96 |
)
|
97 |
|
98 |
-
|
99 |
parser.add_argument(
|
100 |
"--acceptance_rate", type=float, default=0.32,
|
101 |
help="Percentage of papers to accept. We use 0.32, the average acceptance rate for ICLR 2020 - 2023"
|
@@ -126,6 +130,17 @@ def parse_args():
|
|
126 |
"OPENAI_API_KEY environment variable.")
|
127 |
raise ValueError("OpenAI key is missing.")
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
if args.openai_client_type == "azure_openai":
|
130 |
if os.environ.get('AZURE_OPENAI_KEY') is None:
|
131 |
assert isinstance(args.openai_key, str), ("Please specify the `--openai_key` argument OR set the "
|
|
|
1 |
import argparse
|
2 |
import logging
|
3 |
import os
|
4 |
+
|
5 |
+
logger = logging.getLogger(__name__)
|
6 |
+
|
7 |
|
8 |
def parse_args():
|
9 |
parser = argparse.ArgumentParser(description="Argument parser for configuring OpenAI API and experiment settings")
|
10 |
|
11 |
# Authentication details for OpenAI API
|
12 |
parser.add_argument(
|
13 |
+
"--openai_key", type=str, default=None,
|
14 |
+
help="API key to authenticate with OpenAI. Can be set via this argument or through the OPENAI_API_KEY environment variable."
|
15 |
)
|
16 |
|
17 |
parser.add_argument(
|
18 |
+
"--deployment", type=str, default=None,
|
19 |
+
help="For Azure OpenAI: the deployment name to be used when calling the API."
|
20 |
)
|
21 |
|
22 |
parser.add_argument(
|
|
|
25 |
)
|
26 |
|
27 |
parser.add_argument(
|
28 |
+
"--endpoint", type=str, default=None,
|
29 |
+
help="For Azure OpenAI: custom endpoint to access the API. Should be in the format 'https://<your-endpoint>.openai.azure.com'."
|
30 |
)
|
31 |
|
|
|
32 |
parser.add_argument(
|
33 |
"--api_version", type=str, default="2023-05-15", help="API version to be used for making requests. Required "
|
34 |
"for Azure OpenAI clients."
|
|
|
41 |
)
|
42 |
|
43 |
parser.add_argument(
|
44 |
+
"--conference", type=str, default="ICLR2023",
|
45 |
+
help="Conference name where the papers are being evaluated, e.g., 'ICLR2023'."
|
46 |
)
|
47 |
|
48 |
parser.add_argument(
|
|
|
52 |
parser.add_argument(
|
53 |
"--experiment_name",
|
54 |
type=str, default=None, required=False,
|
|
|
|
|
|
|
|
|
55 |
help="Specifies the name of the experiment to run. Choose from predefined experiment types based on the reviewer and AC behavior or experiment configuration."
|
56 |
)
|
57 |
|
58 |
parser.add_argument(
|
59 |
+
"--overwrite", action="store_true",
|
60 |
+
help="If set, existing results or output files will be overwritten without prompting."
|
61 |
)
|
62 |
parser.add_argument(
|
63 |
"--skip_logging", action="store_true", help="If set, we do not log the messages in the console."
|
64 |
)
|
65 |
|
66 |
parser.add_argument(
|
67 |
+
"--num_papers_per_area_chair", type=int, default=10,
|
68 |
+
help="The number of papers each area chair is assigned for evaluation."
|
69 |
)
|
70 |
|
71 |
# Model configuration
|
|
|
86 |
)
|
87 |
|
88 |
parser.add_argument(
|
89 |
+
"--visual_dir", type=str, default="outputs/visual",
|
90 |
+
help="Directory where visualization files (such as graphs and plots) will be stored."
|
91 |
)
|
92 |
|
93 |
# System configuration
|
94 |
parser.add_argument(
|
95 |
+
"--device", type=str, default='cuda',
|
96 |
+
help="The device to be used for processing (e.g., 'cuda' for GPU acceleration or 'cpu' for standard processing)."
|
97 |
)
|
98 |
|
99 |
parser.add_argument(
|
100 |
"--data_dir", type=str, default='data', help="Directory where input data (e.g., papers) are stored."
|
101 |
)
|
102 |
|
|
|
103 |
parser.add_argument(
|
104 |
"--acceptance_rate", type=float, default=0.32,
|
105 |
help="Percentage of papers to accept. We use 0.32, the average acceptance rate for ICLR 2020 - 2023"
|
|
|
130 |
"OPENAI_API_KEY environment variable.")
|
131 |
raise ValueError("OpenAI key is missing.")
|
132 |
|
133 |
+
EXISTING_EXPERIMENT_SETTINGS = [
|
134 |
+
"BASELINE", "benign_Rx1", "malicious_Rx1", "malicious_Rx2", "malicious_Rx3", "unknowledgeable_Rx1",
|
135 |
+
"knowledgeable_Rx1", "responsible_Rx1", "irresponsible_Rx1", "irresponsible_Rx2", "irresponsible_Rx3",
|
136 |
+
"inclusive_ACx1", "authoritarian_ACx1", "conformist_ACx1", "no_numeric_ratings"]
|
137 |
+
|
138 |
+
if args.experiment_name not in EXISTING_EXPERIMENT_SETTINGS:
|
139 |
+
logger.warning(f"Experiment name '{args.experiment_name}' is not recognized. "
|
140 |
+
f"This can happen if you are customizing your own experiment settings. "
|
141 |
+
f"Otherwise, please choose from the following: "
|
142 |
+
f"{EXISTING_EXPERIMENT_SETTINGS}")
|
143 |
+
|
144 |
if args.openai_client_type == "azure_openai":
|
145 |
if os.environ.get('AZURE_OPENAI_KEY') is None:
|
146 |
assert isinstance(args.openai_key, str), ("Please specify the `--openai_key` argument OR set the "
|
agentreview/experiment_config.py
CHANGED
@@ -224,6 +224,26 @@ no_numeric_ratings_setting = {
|
|
224 |
}
|
225 |
}
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
# All experimental settings.
|
229 |
# Customize your own by adding new settings to this dict.
|
@@ -231,14 +251,15 @@ all_settings = {
|
|
231 |
"BASELINE": baseline_setting,
|
232 |
"benign_Rx1": benign_Rx1_setting,
|
233 |
"malicious_Rx1": malicious_Rx1_setting,
|
234 |
-
"
|
235 |
-
"
|
236 |
-
"
|
237 |
-
"
|
238 |
"conformist_ACx1": conformist_ACx1_setting,
|
239 |
"authoritarian_ACx1": authoritarian_ACx1_setting,
|
240 |
"inclusive_ACx1": inclusive_ACx1_setting,
|
241 |
"no_numeric_ratings": no_numeric_ratings_setting,
|
|
|
242 |
|
243 |
}
|
244 |
|
|
|
224 |
}
|
225 |
}
|
226 |
|
227 |
+
malicious_and_irresponsible_Rx1_setting = {
|
228 |
+
"AC": [
|
229 |
+
"BASELINE"
|
230 |
+
],
|
231 |
+
|
232 |
+
"reviewer": [
|
233 |
+
"malicious irresponsible",
|
234 |
+
"BASELINE",
|
235 |
+
"BASELINE"
|
236 |
+
],
|
237 |
+
|
238 |
+
"author": [
|
239 |
+
"BASELINE"
|
240 |
+
],
|
241 |
+
"global_settings":{
|
242 |
+
"provides_numeric_rating": ['reviewer', 'ac'],
|
243 |
+
"persons_aware_of_authors_identities": []
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
|
248 |
# All experimental settings.
|
249 |
# Customize your own by adding new settings to this dict.
|
|
|
251 |
"BASELINE": baseline_setting,
|
252 |
"benign_Rx1": benign_Rx1_setting,
|
253 |
"malicious_Rx1": malicious_Rx1_setting,
|
254 |
+
"knowledgeable_Rx1": knowledgeable_Rx1_setting,
|
255 |
+
"unknowledgeable_Rx1": unknowledgeable_Rx1_setting,
|
256 |
+
"responsible_Rx1": responsible_Rx1_setting,
|
257 |
+
"irresponsible_Rx1": irresponsible_Rx1_setting,
|
258 |
"conformist_ACx1": conformist_ACx1_setting,
|
259 |
"authoritarian_ACx1": authoritarian_ACx1_setting,
|
260 |
"inclusive_ACx1": inclusive_ACx1_setting,
|
261 |
"no_numeric_ratings": no_numeric_ratings_setting,
|
262 |
+
"malicious_and_irresponsible_Rx1": malicious_and_irresponsible_Rx1_setting,
|
263 |
|
264 |
}
|
265 |
|
agentreview/paper_review_settings.py
CHANGED
@@ -66,36 +66,29 @@ def get_reviewer_setting_from_reviewer_type(reviewer_type: str):
|
|
66 |
}
|
67 |
|
68 |
# Intention
|
69 |
-
if
|
70 |
reviewer_setting["is_benign"] = True
|
71 |
-
|
72 |
reviewer_setting["is_benign"] = False
|
73 |
|
74 |
# Knowledgeability
|
75 |
-
|
76 |
reviewer_setting["is_knowledgeable"] = True
|
77 |
-
|
78 |
reviewer_setting["is_knowledgeable"] = False
|
79 |
|
80 |
# Commitment
|
81 |
-
|
82 |
reviewer_setting["is_responsible"] = True
|
83 |
-
|
84 |
reviewer_setting["is_responsible"] = False
|
85 |
|
86 |
-
|
87 |
-
pass
|
88 |
-
|
89 |
-
elif reviewer_type in ["authors_are_famous"]:
|
90 |
reviewer_setting["knows_authors"] = "famous"
|
91 |
|
92 |
elif reviewer_type in ["authors_are_unfamous"]:
|
93 |
reviewer_setting["knows_authors"] = "unfamous"
|
94 |
|
95 |
-
|
96 |
-
else:
|
97 |
-
raise ValueError(f"Unknown reviewer type: {reviewer_type}")
|
98 |
-
|
99 |
return reviewer_setting
|
100 |
|
101 |
|
|
|
66 |
}
|
67 |
|
68 |
# Intention
|
69 |
+
if "benign" in reviewer_type:
|
70 |
reviewer_setting["is_benign"] = True
|
71 |
+
if "malicious" in reviewer_type:
|
72 |
reviewer_setting["is_benign"] = False
|
73 |
|
74 |
# Knowledgeability
|
75 |
+
if "knowledgeable" in reviewer_type:
|
76 |
reviewer_setting["is_knowledgeable"] = True
|
77 |
+
if "unknowledgeable" in reviewer_type:
|
78 |
reviewer_setting["is_knowledgeable"] = False
|
79 |
|
80 |
# Commitment
|
81 |
+
if "responsible" in reviewer_type:
|
82 |
reviewer_setting["is_responsible"] = True
|
83 |
+
if "irresponsible" in reviewer_type:
|
84 |
reviewer_setting["is_responsible"] = False
|
85 |
|
86 |
+
if reviewer_type in ["authors_are_famous"]:
|
|
|
|
|
|
|
87 |
reviewer_setting["knows_authors"] = "famous"
|
88 |
|
89 |
elif reviewer_type in ["authors_are_unfamous"]:
|
90 |
reviewer_setting["knows_authors"] = "unfamous"
|
91 |
|
|
|
|
|
|
|
|
|
92 |
return reviewer_setting
|
93 |
|
94 |
|
agentreview/role_descriptions.py
CHANGED
@@ -199,7 +199,7 @@ def get_reviewer_description(is_benign: bool = None, is_knowledgeable: bool = No
|
|
199 |
"critically analyze the methodologies, and carefully consider the paper's "
|
200 |
"contribution to the field. ")
|
201 |
|
202 |
-
|
203 |
"to discuss in the reviewer-AC discussion. "
|
204 |
"Your assessments might overlook critical details, lack depth in analysis, "
|
205 |
"fail to recognize novel contributions, "
|
@@ -210,7 +210,7 @@ def get_reviewer_description(is_benign: bool = None, is_knowledgeable: bool = No
|
|
210 |
if is_responsible:
|
211 |
desc = desc_responsible_reviewer
|
212 |
else:
|
213 |
-
desc =
|
214 |
|
215 |
bio += f"Responsibility: {desc}\n\n"
|
216 |
|
|
|
199 |
"critically analyze the methodologies, and carefully consider the paper's "
|
200 |
"contribution to the field. ")
|
201 |
|
202 |
+
desc_irresponsible_reviewer = ("As a lazy reviewer, your reviews tend to be superficial and hastily done. You do not like "
|
203 |
"to discuss in the reviewer-AC discussion. "
|
204 |
"Your assessments might overlook critical details, lack depth in analysis, "
|
205 |
"fail to recognize novel contributions, "
|
|
|
210 |
if is_responsible:
|
211 |
desc = desc_responsible_reviewer
|
212 |
else:
|
213 |
+
desc = desc_irresponsible_reviewer
|
214 |
|
215 |
bio += f"Responsibility: {desc}\n\n"
|
216 |
|