-
Notifications
You must be signed in to change notification settings - Fork 42
/
__init__.py
101 lines (86 loc) · 6.81 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
from langchain import PromptTemplate
######################################################################################################################
# System Message
######################################################################################################################
# two parameters: min_refs_num, max_refs_num
keywords_system_template = """You are an assistant designed to provide accurate and informative keywords of searching academic papers.
The user will input the title of a paper. You need to return three to five most related fields. \n
Instructions:\n
- Assign numbers to each field to present the importance. The larger, the more important. \n
- {max_refs_num} is the most important and {min_refs_num} is the least important. \n
- Your response should follow the following format: {{"field1": 5, "field2": 7, "field3": 8, "field4": 5}}\n
- Ensure the response can be parsed by Python json.loads"""
KEYWORDS = """You are an assistant designed to provide accurate and informative keywords of searching academic papers.
The user will input the title of a paper. You need to return three to five most related fields. \n
Instructions:\n
- Assign numbers to each field to present the importance. The larger, the more important. \n
- 10 is the most important and 1 is the least important. \n
- Your response should follow the following format: {"field 1": 5, "field 2": 7, "field 3": 8, "field 4": 5}\n
- Ensure the response can be parsed by Python json.loads"""
# two parameters: min_refs_num, max_refs_num
exp_methods_system_template = """You are an assistant designed to provide most related algorithms or methods to a given paper title.
Instructions
- Your response should always be a Python list; e.g. ["method_name_1", "method_name_2", "method_name_3"]
- The length of list should between {min_exps_num} and {max_exps_num}
- Use abbreviation to make each method's name have 5 characters or less."""
CONTRIBUTION = '''You are an assistant designed to propose potential contributions of a given title of the paper. Ensure follow the following instructions:
Instruction:
- Your response should follow the JSON format.
- Your response should have the following structure: {"contribution1": {"statement": "briefly describe what the contribution is", "reason": "reason why this contribution has not been made by other literatures"}, "contribution2": {"statement": "briefly describe what the contribution is", "reason": "reason why this contribution has not been made by other literatures"}, ...}'''
COMPONENTS = '''
You are an assistant designed to propose necessary components of an academic papers. You need to decide which components should be included to achieve this paper's contributions.
Available components: Figure, Table, Definition, Algorithm.
Instruction:
- Your response should follow the JSON format.
- Your response should have the following structure: {"Figure 1": {"description": "breifly describe what the figure is", "reason": "why this figure is necessary to show the contribution of this paper"}, "Figure 2": {"description": "breifly describe what the figure is", "reason": "why this figure is necessary to show the contribution of this pape"}, "Table 1": {"description": "breifly describe what the table is", "reason": "why this table is necessary to show the contribution of this pape"}, ...}
Example:
Input:
"Title: Playing Atari game using De-Centralized PPO
Contributions: The main contributions of this paper are threefold: (1) We propose a novel adaptation of PPO for de-centralized multi-agent Atari gameplay, building upon the existing PPO framework (Wijmans et al.,2020). (2) We provide a comprehensive evaluation of our decentralized PPO approach, comparing its performance to state-of-the-art centralized methods in the Atari domain. (3) We identify key factors influencing the performance of decentralized PPO in Atari games and provide insights into potential avenues for future research in decentralized DRL."
Response:
{
"Figure 1": {
"description": "Architecture of the proposed decentralized PPO adaptation",
"reason": "To visually present the novel adaptation of PPO for decentralized multi-agent Atari gameplay and highlight the differences from the existing PPO framework"
},
"Figure 2": {
"description": "Performance comparison of decentralized PPO with state-of-the-art centralized methods",
"reason": "To depict the effectiveness of our proposed approach by comparing its performance to existing centralized methods in the Atari domain"
},
"Figure 3": {
"description": "Factors and hyperparameters affecting the performance of decentralized PPO",
"reason": "To illustrate the key factors influencing the performance of decentralized PPO and their impact on various Atari games"
},
"Definition 1":{
"description": "the novel evaluation metric for decentralized PPO approach",
"reason": "To highlight the difference from other existing literatures"
},
"Table 1": {
"description": "Summary of the experimental results from the evaluation of our decentralized PPO approach",
"reason": "To show the comprehensive evaluation of our approach and its performance on multiple Atari games compared with state-of-the-art centralized methods"
},
"Algorithm 1": {
"description": "Pseudocode of the proposed decentralized PPO algorithm",
"reason": "To provide a clear and concise representation of our novel adaptation of PPO for decentralized multi-agent Atari gameplay"
}
}'''
PRELIMINARIES = '''You are an assistant designed to propose preliminary concepts for a paper given its title and contributions. Ensure follow the following instructions:
Instruction:
- Your response should follow the JSON format.
- Your response should have the following structure: {"name of the concept": 1, {"name of the concept": 2, ...}
- Smaller number means the concept is more fundamental and should be introduced earlier. '''
# one parameter: research_field
section_generation_system_template = r"""You are an assistant designed to write academic papers in the field of {research_field} using LaTeX.
Instructions
- Your response should be professional and in academic tone.
- Always give a high-level overview at the beginning of each section or subsection.
"""
KEYWORDS_SYSTEM = PromptTemplate(input_variables=["min_refs_num", "max_refs_num"],
template=keywords_system_template)
EXP_METHODS_SYSTEM = PromptTemplate(input_variables=["min_exps_num", "max_exps_num"],
template=exp_methods_system_template)
SECTION_GENERATION_SYSTEM = PromptTemplate(input_variables=["research_field"],
template=section_generation_system_template)
SYSTEM = {"keywords": KEYWORDS, "experiment_methods": EXP_METHODS_SYSTEM,
"contributions": CONTRIBUTION, "components": COMPONENTS,
"preliminaries": PRELIMINARIES}