agent_envs / README.md
huzican's picture
Register scienceworld train_expert split in dataset card
aeebd61 verified
|
Raw
History Blame Contribute Delete
4.21 kB
---
license: apache-2.0
task_categories:
- reinforcement-learning
tags:
- agent
- alfworld
- scienceworld
- rl
- opd
configs:
- config_name: alfworld
data_files:
- split: train
path: alfworld/train.parquet
- split: train_expert
path: alfworld/train_expert.parquet
- split: train_hard
path: alfworld/train_hard.parquet
- split: test
path: alfworld/test.parquet
- split: test_unseen
path: alfworld/test_unseen.parquet
- config_name: scienceworld
data_files:
- split: train
path: scienceworld/train.parquet
- split: train_expert
path: scienceworld/train_expert.parquet
- split: test
path: scienceworld/test.parquet
---
# Agent Environment Task Sets (ALFWorld & ScienceWorld)
Task sets for RL / OPD / RL+OPD runs on the Slime `agent_envs` stack. Rows are
stored in the Slime-readable schema so `train.py` can load them directly with
`--input-key prompt --label-key label --metadata-key metadata`.
## Row schema (all configs)
Every row separates the model-input field from the environment-input fields:
- `prompt` (model input, raw text): the fixed instruction the model receives.
The live per-turn content (observation + admissible actions + history) is
appended by the env rollout at run time.
- `label`: the environment input string (same as `metadata.env_input`).
- `metadata` (environment input, struct) consumed by
`agent_envs.envs.base.task_from_sample`:
- `env_name`: `alfworld` / `scienceworld`
- `env_input`: **repo-relative** env path. ALFWorld: game file like
`alf-data/json_2.1.1/.../game.tw-pddl`. ScienceWorld: JSON string with
`task_name` / `var_num` / `jar_path` (jar_path relative, e.g.
`scienceworld/scienceworld.jar`). At run time the launch script sets
`AGENT_ENV_DATA_ROOT` (default `datasets/env_assets`) and the rollout joins
it with these relative paths; absolute paths are used as-is.
- `expert_actions`: expert action list (non-empty for ALFWorld
`train_expert` and ScienceWorld `train_expert`; used by TCOD b2f/f2b).
ALFWorld actions come from the ALFRED handcoded planner; ScienceWorld
actions are precomputed via the engine's built-in gold-path solver
(`ScienceWorldEnv.load(..., generateGoldPath=True)` +
`get_gold_action_sequence()`, see
`agent_envs/data/generate_scienceworld_expert.py`).
- `workflow_args`: JSON string (e.g. `max_env_steps`, `mode`, `curriculum`)
- `max_env_steps`, `mode` (`rl`/`opd`/`rl_opd`), `curriculum`
(`none`/`b2f`/`f2b`), `split`
Load in Slime with `--input-key prompt --label-key label --metadata-key metadata`.
## Configs (subsets)
Switch environment with the config dropdown, then pick a split:
- `alfworld`: splits `train`, `train_expert`, `train_hard`, `test`, `test_unseen`
- `scienceworld`: splits `train`, `train_expert`, `test`
## Usage (inspect a config)
```python
from datasets import load_dataset
alf = load_dataset("huzican/agent_envs", "alfworld", split="train")
sci = load_dataset("huzican/agent_envs", "scienceworld", split="test")
```
## Run with a single path (`DATASETS_DIR`)
`env_input` paths are **relative to `env_assets/`**, and `env_assets/` lives next
to the parquet, so the whole thing is self-contained: point one `DATASETS_DIR`
at a prepared datasets dir and the run scripts derive everything.
Layout of a prepared dir:
```
<DATASETS_DIR>/
alfworld/*.parquet
scienceworld/*.parquet
env_assets/{alf-data, scienceworld} # ALFWorld games + ScienceWorld jar (~2.5G)
```
The run scripts set `PROMPT_DATA=<DATASETS_DIR>/<env>/train.parquet` and
`AGENT_ENV_DATA_ROOT=<DATASETS_DIR>/env_assets` automatically:
```bash
DATASETS_DIR=/path/to/datasets \
HF_CHECKPOINT=... REF_LOAD=... \
bash scripts/agent_envs/run_rl_scienceworld.sh
```
The large `env_assets/` is shipped separately as `env_assets.tar.(zst|gz)` in this
repo. To assemble a ready `DATASETS_DIR` from HuggingFace:
```bash
bash scripts/agent_envs/prepare_datasets.sh /path/to/datasets # downloads + extracts
DATASETS_DIR=/path/to/datasets bash scripts/agent_envs/run_rl_scienceworld.sh
```
## Note
ALFWorld game files and the ScienceWorld jar inside `env_assets/` are third-party
data; consider keeping this repo private.