Skip to content

Commit 30a9443

Browse files
[Coati] Refine prompt for better inference (#6117)
* refine prompt * update prompt * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7a60161 commit 30a9443

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

applications/ColossalChat/coati/reasoner/guided_search/mcts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def initialization(self):
5858
"""
5959
Root Initiation.
6060
"""
61-
# Dummy answer as root.
61+
# Simple answer as root. You can also use negative response such as "I do not know" as a response.
6262
base_answer = self.sample_base_answer()
6363
self.root = MCTSNode(answer=base_answer)
6464
self.self_evaluate(self.root)
@@ -190,7 +190,7 @@ def sample_base_answer(self):
190190
messages=[
191191
{
192192
"role": "system",
193-
"content": "The user will provide a problem. Solve the problem. The response should begin with [reasoning process]...[Verification]... and end with [Final Answer]. \nThe answer is [answer] \n#### [answer].",
193+
"content": self.cfg.base_system_prompt,
194194
},
195195
{
196196
"role": "user",

applications/ColossalChat/coati/reasoner/guided_search/prompt_store/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class PromptCFG(BaseModel):
55
model: str
66
base_url: str
77
max_tokens: int = 4096
8+
base_system_prompt: str
89
critic_system_prompt: str
910
refine_system_prompt: str
1011
evaluate_system_prompt: str

applications/ColossalChat/coati/reasoner/guided_search/prompt_store/qwen.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
Qwen32B_prompt_CFG = PromptCFG(
88
base_url="http://0.0.0.0:8008/v1",
99
model="Qwen2.5-32B-Instruct",
10-
critic_system_prompt="Provide a detailed and constructive critique to improve the answer. "
11-
"Highlight specific areas that need refinement or correction.",
10+
base_system_prompt="The user will present a problem. Analyze and solve the problem in the following structure:\n"
11+
"Begin with [Reasoning Process] to explain the approach. \n Proceed with [Verification] to confirm the solution. \n Conclude with [Final Answer] in the format: 'Answer: [answer]'",
12+
critic_system_prompt="Provide a detailed and constructive critique of the answer, focusing on ways to improve its clarity, accuracy, and relevance."
13+
"Highlight specific areas that need refinement or correction, and offer concrete suggestions for enhancing the overall quality and effectiveness of the response.",
1214
refine_system_prompt="""# Instruction
1315
Refine the answer based on the critique. The response should begin with [reasoning process]...[Verification]... and end with [Final Answer].
1416
""",
1517
evaluate_system_prompt=(
16-
"Analyze this answer strictly and critic, provide a reward score between -100 and 100 for the answer quality, using very strict standards. "
17-
"Do not give a full score above 95. Make sure the reward score is an integer. "
18-
"Return *ONLY* the score."
18+
"Critically analyze this answer and provide a reward score between -100 and 100 based on strict standards."
19+
"The score should clearly reflect the quality of the answer."
20+
"Make sure the reward score is an integer. You should only return the score. If the score is greater than 95, return 95."
1921
),
2022
)

0 commit comments

Comments
 (0)