Kalso42/WorldModelForMazeWithX
WorldModelForMazeWithX Maze pathfinding sequences for training/probing sequence models (Transformer, Mamba, GRU, Gated-DeltaNet, ...). Task C1: relative-turn navigation on a fixed 10×10 directed grid. Includes a special x terminator marking wall-hit (illegal) paths, used to study a model's ability to recognize its own errors. Maze 10×10 grid, 100 nodes (0–99). Directed edges (down/right, both directions added), edge probability 0.6. Graph:… See the full description on the dataset page: https://huggingface.co/datasets/Kalso42/WorldModelForMazeWithX.
018
1---2license: mit3task_categories:4 - text-generation5language:6 - en7tags:8 - maze9 - world-model10 - pathfinding11 - sequence-modeling12pretty_name: World Model for Maze (with X)13size_categories:14 - 1M<n<10M15---16 17# WorldModelForMazeWithX18 19Maze pathfinding sequences for training/probing sequence models (Transformer, Mamba, GRU, Gated-DeltaNet, ...). Task **C1**: relative-turn navigation on a fixed 10×10 directed grid. Includes a special **`x`** terminator marking wall-hit (illegal) paths, used to study a model's ability to recognize its own errors.20 21## Maze22 23- 10×10 grid, 100 nodes (`0`–`99`). Directed edges (down/right, both directions added), edge probability 0.6.24- Graph: `maze_graph_C1_RWs.graphml` (node ids are strings `'0'`..`'99'`).25 26## Sequence format (Task C1)27 28```29C <src> <tgt> : <turn tokens...>30```31 32- Agent starts facing **East**. Each turn token both rotates and advances one cell:33 - `F` forward, `L` left, `R` right, `T` turn-around.34- Nodes `0`–`99` are single tokens; `:` separates the prompt from the path.35- **`x`**: wall-hit terminator. A "wrong" path is a correct path with one turn corrupted into a wall direction, then `x` appended. Only the final `x` is supervised during training.36 37## Files (under `data/`)38 39| file | rows | wrong (`x`) ratio | note |40|------|------|-------------------|------|41| `train_C1_RWs_5M.txt` / `.bin` | 5,000,000 | 0.0 | all-correct paths |42| `train_C1_RWs_8M.txt` / `.bin` | 8,000,000 | 0.0 | all-correct paths |43| `train_C1_RWs_10M.txt` / `.bin` | 12,000,000 | 0.2 | 2M wall-hit paths ending in `x` |44| `test_C1_RWs_10K.txt` | ~10K | — | held-out test prompts |45| `val_C1_RWs_10K.bin` | — | — | tokenized validation |46| `meta_C1_RWs.pkl` | — | — | vocab/stoi/itos (vocab size 132, `x` id 131) |47| `maze_graph_C1_RWs.graphml` | — | — | the maze graph |48 49- `.txt`: human-readable sequences. `.bin`: `uint16` token stream (read with `numpy.memmap`). `.bin` can be regenerated from `.txt` via `prepare_multitask_minigpt.py`.50- Only the **10M** set contains wrong paths; 5M / 8M never expose `x` (models trained on them never emit `x`).51 52## Loading53 54```python55import pickle, numpy as np56meta = pickle.load(open("data/meta_C1_RWs.pkl", "rb"))57itos = meta["itos"] # x token id = 13158ids = np.memmap("data/train_C1_RWs_10M.bin", dtype=np.uint16, mode="r")59print(" ".join(itos[i] for i in ids[:60]))60```61 62## Citation63 64Generated with `data/maze/create_multitask_maze.py` (`--tasks C1 --path_type RWs`, `--wrong_ratio 0.2` for 10M, `0.0` for 5M/8M).65 