CoolFace
Datasetpublic

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.

sourceHugging Faceupdated 6d agoView on Hugging Face
0likes70downloads
Dataset Card

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 路径供训练期重建。

游戏发现规则:

  1. 1.<split_dir>/**/game.tw-pddl,路径含 movableSliced 的跳过;
  2. 2.同目录 traj_data.json 必须存在,且其 task_type 在六类白名单内;
  3. 3.game.tw-pddlgame_data["solvable"] is True

2. 数据结构(parquet 列 schema)

类型含义
data_sourcestr恒为 "alfworld",reward/eval 路由用
promptlist[dict]初始消息 [system, user](见 §4)
abilitystr恒为 "agentic_rl"
extra_infodict见下

extra_info 子结构:

json
{
  "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):

split行数pick_twopick_simplecleancoolheatlook_light
train3553813790650533459308
valid_seen140243527251613
valid_unseen134172431212318
  • 六类任务即 ALFWorld 全部可训练类型:pick_and_place_simplepick_two_obj_and_placepick_clean_then_place_in_receppick_heat_then_place_in_receppick_cool_then_place_in_receplook_at_obj_in_light
  • valid.parquetvalid_seen + valid_unseen 纵向拼接生成,供 data.val_files 使用
  • user 消息长度(train 实测,字符数):min 529 / median 1053 / max 2123, 远小于 max_prompt_length=4096(token),初始 prompt 不会截断。
  • 一行 = 一个游戏 = 一个 episode

4. 消息拼接逻辑

初始 prompt(dataset 内固定不变的两条消息)

python
messages = [
    {"role": "system", "content": SYSTEM_PROMPT},   # 逐字见 make_dataset.py:47
    {"role": "user",   "content": _initial_user_prompt(task, obs, actions)},
]

工具的function定义按需传入

python
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 ToolAgentLoopALFWorldTool.execute → 工具用 render_observationalfworld_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 函数靠它们计数:

状态串含义
Action executed.合法动作,环境推进
The action was not admissible; ...不可执行动作(invalid 计数 +1)
Invalid tool-call format; ...参数格式非法,环境不动(invalid 计数 +1)
Task completed successfully.won(reward=1 的来源)
Episode ended without success.50 步耗尽等终态

参考

https://github.com/KMnO4-zx/agentic-rl-lab/tree/main/08-alfworld 十分感谢