millyhua/alfworld_parquet
ALFWorld parquet Dataset Card 由 make_dataset.py 从 ALFWorld json_2.1.1 原始游戏生成的parquet格式训练集/验证集,只含任务初始状态,大大减小数据空间。 1. 生成方式 对每个通过过滤的游戏 game.tw-pddl:在子进程中 reset 一次 TextWorld 环境 (max_episode_steps=50,与训练一致),提取 task / 初始 observation / admissible actions,组装为初始 messages;环境随即关闭,仅留下 game_file 路径供训练期重建。 游戏发现规则: <split_dir>/**/game.tw-pddl,路径含 movable 或 Sliced 的跳过; 同目录 traj_data.json 必须存在,且其 task_type 在六类白名单内; game.tw-pddl 内 game_data["solvable"] is True。 2.… See the full description on the dataset page: https://huggingface.co/datasets/millyhua/alfworld_parquet.
ALFWorld parquet Dataset Card
由 make_dataset.py 从 ALFWorld json_2.1.1 原始游戏生成的parquet格式训练集/验证集,只含任务初始状态,大大减小数据空间。
1. 生成方式
对每个通过过滤的游戏 game.tw-pddl:在子进程中 reset 一次 TextWorld 环境 (max_episode_steps=50,与训练一致),提取 task / 初始 observation / admissible actions,组装为初始 messages;环境随即关闭,仅留下 game_file 路径供训练期重建。
游戏发现规则:
<split_dir>/**/game.tw-pddl,路径含movable或Sliced的跳过;- 同目录
traj_data.json必须存在,且其task_type在六类白名单内; game.tw-pddl内game_data["solvable"] is True。
2. 数据结构(parquet 列 schema)
extra_info 子结构:
{
"index": 0,
"split": "train",
"task_type": "look_at_obj_in_light",
"game_file": "look_at_obj_in_light-AlarmClock-None-DeskLamp-301/trial_T20190907_174142_375532/game.tw-pddl",
}3. 数量与范围
实测(json_2.1.1_parquet/,2026-09):
- 六类任务即 ALFWorld 全部可训练类型:
pick_and_place_simple、pick_two_obj_and_place、pick_clean_then_place_in_recep、pick_heat_then_place_in_recep、pick_cool_then_place_in_recep、look_at_obj_in_light。 valid.parquet由valid_seen + valid_unseen纵向拼接生成,供data.val_files使用- user 消息长度(train 实测,字符数):min 529 / median 1053 / max 2123, 远小于
max_prompt_length=4096(token),初始 prompt 不会截断。 - 一行 = 一个游戏 = 一个 episode
4. 消息拼接逻辑
初始 prompt(dataset 内固定不变的两条消息)
messages = [
{"role": "system", "content": SYSTEM_PROMPT}, # 逐字见 make_dataset.py:47
{"role": "user", "content": _initial_user_prompt(task, obs, actions)},
]工具的function定义按需传入
ALFWORLD_TOOL = {
"type": "function",
"function": {
"name": "alfworld_step",
"description": (
"Execute exactly one text action in the current ALFWorld state. "
"Copy object and receptacle names exactly, including numeric suffixes such as "
"'apple 1' and 'fridge 1'. Common command forms are: 'go to <receptacle>', "
"'open <receptacle>', 'close <receptacle>', "
"'take <object> from <receptacle>', 'move <object> to <receptacle>', "
"'inventory', 'examine <thing>', 'use <object>', "
"'heat <object> with <receptacle>', "
"'clean <object> with <receptacle>', 'cool <object> with <receptacle>', "
"'slice <object> with <object>', and 'look'."
),
"parameters": {
"type": "object",
"properties": {
"action": {
"type": "string",
"description": (
"One ALFWorld command. Use the exact spelling and numbering shown "
"by the environment. Do not include explanations in this string."
),
}
},
"required": ["action"],
},
},
}_initial_user_prompt 的六段模板(make_dataset.py:132):
Task: look at alarmclock under the desklamp.
Current step: 1
Current observation:
-= Welcome to TextWorld, ALFRED! =-
...(环境 reset 的完整初始 observation,含 "Your task is to: ..." 行)
Available actions (copy one exactly):
- go to bed 1
- go to drawer 1
...(canonical 化后的 admissible actions,`help` 已剔除,字典序)
Choose the next action by calling alfworld_step exactly once.多轮扩展
每轮:assistant 产出 hermes 格式 <tool_call>(调 alfworld_step)→ verl ToolAgentLoop 调 ALFWorldTool.execute → 工具用 render_observation(alfworld_env.py:147)渲染 tool response 回填为 role=tool 消息。一条轨迹的完整序列:
system SYSTEM_PROMPT(不变)
user 初始六段模板
assistant <tool_call> alfworld_step({"action": "go to drawer 1"})
tool "ALFWorld step 1 result: Action executed.
Current observation:
...新 observation
Available actions (copy one exactly):
- ..."
assistant <tool_call> ... # 最多 50 轮
tool "ALFWorld step N result: Task completed successfully.
Current observation:
..." # done 后不再列 actions
assistant (终止生成)tool response 首行状态串共五种,reward 函数靠它们计数:
参考
https://github.com/KMnO4-zx/agentic-rl-lab/tree/main/08-alfworld 十分感谢
