Skip to content

Commit f408e94

Browse files
committed
[perf] update alfworld modular rollout prompt
1 parent cb87321 commit f408e94

File tree

1 file changed

+24
-32
lines changed

1 file changed

+24
-32
lines changed
Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,60 @@
11
# # --------------------- ALFWorld --------------------- #
2-
# ALFWORLD_TEMPLATE_NO_HIS = """
3-
# You are an expert agent operating in the ALFRED Embodied Environment.
4-
# Your current observation is: {current_observation}
5-
# Your admissible actions of the current situation are: [{admissible_actions}].
6-
7-
# Now it's your turn to take an action.
8-
# You should first reason step-by-step about the current situation. This reasoning process MUST be enclosed within <plan> </plan> tags.
9-
# Once you've finished your reasoning, you should choose an admissible action for current step and present it within <action> </action> tags.
10-
# """
11-
122
ALFWORLD_TEMPLATE_NO_HIS = """
133
You are an expert agent operating in the ALFRED Embodied Environment.
144
Your task is: {task_description}
155
Your current observation is: {current_observation}
16-
Your admissible actions of the current situation are: [{admissible_actions}].
6+
Your admissible actions of the current situation are: {admissible_actions}.
177
188
Please begin by analyzing the situation and planning your approach:
199
2010
<plan>
21-
Analyze the current situation and devise a plan to accomplish the task:
22-
What are the key steps needed to complete this task?
23-
How to advance our plan toward completing the task in immediate next step?
24-
Based on the current observation, what should be our immediate next step?
11+
Plan the next step:
12+
- Given what I've learned, what should I do next?
13+
- Please explain why this plan is helpful for the next action?
14+
- What do I expect this action to achieve?
2515
</plan>
2616
27-
Finally, choose ONE admissible action for the current step and present it within <action> </action> tags.
17+
<action>
18+
Finally, choose ONE admissible action for the current step and choose it within {admissible_actions}.
19+
</action>
2820
"""
2921

30-
3122
ALFWORLD_TEMPLATE = """
3223
You are an expert agent operating in the ALFRED Embodied Environment. Your task is to: {task_description}
3324
Prior to this step, you have already taken {step_count} step(s). Below are the most recent {history_length} observaitons and the corresponding actions you took: {action_history}
3425
You are now at step {current_step} and your current observation is: {current_observation}
35-
Your admissible actions of the current situation are: [{admissible_actions}].
26+
Your admissible actions of the current situation are: {admissible_actions}.
3627
3728
Now it's your turn to take an action.
3829
39-
You should first recall relevant past experiences and reason from our conversation history, then MUST summarize within <memory_analysis> </memory_analysis> tags like this:
30+
You should first recall relevant past experiences and reason from our conversation history, then MUST summarize within <memory> </memory> tags like this:
4031
41-
<memory_analysis>
42-
[Recall relevant past experiences and reason from our conversation history]
43-
- Please summarize the most relavent memory for this step.
44-
- Please explain why this memory is helpful for the next reflection and planning.
45-
</memory_analysis>
32+
<memory>
33+
Look at the past observations and actions from our conversation history.
34+
- Please retrieve the most relavent memory for this step including the relevant observation and action in a RAG style along with the step number.
35+
- These memory should be helpful milestones to solve this task.
36+
</memory>
4637
4738
After that, you should reflect on the last action and its outcome, then MUST summarize within <reflection> </reflection> tags like this:
4839
4940
<reflection>
50-
[Reflect on the last action and its outcome]
51-
- What did my last action accomplish?
52-
- Was it successful or did it encounter issues?
53-
- How does this outcome affect my plan?
41+
Reflect on the last action and its outcome
42+
- Did I complete the task goal?
43+
- Was last action successful or did it encounter issues?
5444
- Am I making progress toward the task goal?
45+
- If the action did not go as expected and did not result in progress, provide constructive feedback to guide the next planning step.
5546
</reflection>
5647
5748
After that, you should plan the next step based on memory and reflection, then MUST summarize within <plan> </plan> tags like this:
5849
5950
<plan>
60-
[Plan the next step based on memory and reflection]
51+
Plan the next step based on memory and reflection
6152
- Given what I've learned, what should I do next?
6253
- Please explain why this plan is helpful for the next action?
63-
- How does this action fit into my overall strategy?
6454
- What do I expect this action to achieve?
6555
</plan>
6656
67-
Finally, choose ONE admissible action for the current step and present it within <action> </action> tags.
68-
"""
57+
<action>
58+
Finally, choose ONE admissible action for the current step and choose it within {admissible_actions}.
59+
</action>
60+
"""

0 commit comments

Comments
 (0)