Commit Β·
f474cdd
0
Parent(s):
add data
Browse filesFiles changed (2)
- README.mdAdded+190
- mazes.jsonlAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190# π§© Maze Navigation Dataset
A comprehensive dataset of 899 maze-solving examples generated using three different maze generation algorithms, designed for training and evaluating LLM navigation capabilities.
## π Dataset Overview
- **Total Mazes**: 899 examples- **Algorithms**: 3 different maze generation techniques (~300 examples each)- **Map Sizes**: 3 different sizes per algorithm - **5x5** inner grid (7x7 with walls) - **10x10** inner grid (12x12 with walls) - **20x20** inner grid (22x22 with walls)- **Format**: JSONL (JSON Lines)- **Task**: Navigation from Player (P) to Destination (D)
### Map Elements
- `#`: Wall (impassable)- `P`: Player start position - `D`: Destination (goal)- `.`: Walkable tile (empty space)
### Example 5x5 Map
```########P....##.###.##.#...##.#.#.##...#D########```
**Note**: Map dimensions (5x5, 10x10, 20x20) refer to the **inner walkable grid**, excluding the outer perimeter walls. A 5x5 inner grid becomes a 7x7 grid with walls.
## π² Generation Algorithms
### 1. Recursive Backtracker (DFS-based)
**Description**: Creates "perfect" mazes with no loops or isolated sections. Each pair of cells has exactly one path between them.
**Characteristics**:- Long, winding corridors- Many dead ends- Spindly, organic branching- High path complexity
**Use Case**: Testing LLM's ability to handle complex, maze-like navigation with many decision points.
### 2. Prim's Algorithm (MST-based)
**Description**: Also creates perfect mazes but with a different structural feel.
**Characteristics**:- Blockier, denser layout- More interconnected "room-like" areas- Wider passages- Bulbous cavern structures
**Use Case**: Testing LLM's spatial reasoning with more open, room-based layouts.
### 3. Cellular Automata
**Description**: Generates organic, natural-looking cave systems using Game of Life-like rules.
**Algorithm**:1. Initialize with random wall distribution (~45%)2. Apply cellular automata rules for 5-8 iterations3. Ensure single connected component via flood fill4. Smooth edges with additional iterations
**Characteristics**:- Organic, irregular shapes- Natural cavern feel- Open areas with scattered obstacles- Less predictable structure
**Use Case**: Testing LLM's adaptability to non-traditional, organic layouts.
## π Output Formats
### Fine-tuning Dataset (`mazes.jsonl`)
Each line is a JSON object:
```json{"input": "Map:\n#######\n#P....#\n#.....#\n#.....#\n#....D#\n#######", "output": "DOWN,DOWN,DOWN,RIGHT,RIGHT,RIGHT,RIGHT"}```
The output contains comma-separated directional commands:- `UP`: Move north- `DOWN`: Move south - `LEFT`: Move west- `RIGHT`: Move east
## π Dataset Statistics
| Algorithm | Small (7x7) | Medium (12x12) | Large (22x22) | Total ||-----------|-------------|----------------|---------------|-------|| Recursive Backtracker | ~100 | ~100 | ~100 | ~300 || Prim's Algorithm | ~100 | ~100 | ~100 | ~300 || Cellular Automata | ~100 | ~100 | ~100 | ~299 || **Total** | ~300 | ~300 | ~299 | **899** |
## π Usage Examples
### Loading the Dataset
```pythonimport json
mazes = []with open('mazes.jsonl', 'r') as f: for line in f: mazes.append(json.loads(line))
print(f"Loaded {len(mazes)} maze examples")```
### Example Training Format
```python# Example maze entryexample = mazes[0]print("Input:")print(example['input'])print("\nExpected Output:")print(example['output'])```
### Parsing Map Data
```pythondef parse_maze(input_text): lines = input_text.split('\n')[1:] # Skip "Map:" header grid = [list(line) for line in lines] # Find start and end positions start_pos = None end_pos = None for i, row in enumerate(grid): for j, cell in enumerate(row): if cell == 'P': start_pos = (i, j) elif cell == 'D': end_pos = (i, j) return grid, start_pos, end_pos```
## π― Use Cases
### 1. LLM Fine-tuningTrain language models to navigate mazes and understand spatial reasoning.
### 2. Path Planning EvaluationBenchmark different algorithms on maze navigation tasks.
### 3. Spatial Intelligence ResearchStudy how models handle different types of spatial layouts.
### 4. Multi-step ReasoningEvaluate models' ability to plan sequences of actions to reach goals.
## π Quality Assurance
- All mazes are **solvable** with exactly one optimal path- **Consistent formatting** across all examples- **Balanced distribution** across algorithms and sizes- **Verified solutions** through automated validation
## π Notes
- Solutions represent the **shortest path** from P to D- All paths avoid walls (#) and only use walkable spaces (.)- Movement is restricted to 4-directional (no diagonal moves)- Each maze has a **unique solution path**
## π€ Model Training Tips
- Use the input as a prompt: `"Map:\n{maze_grid}"`- Expected output format: `"UP,DOWN,LEFT,RIGHT"` sequences- Consider fine-tuning on smaller mazes first, then scaling up- Balance training across different algorithm types for robustness
---
*Dataset generated for maze navigation research and LLM spatial reasoning evaluation.*README.mdAdded+190
mazes.jsonlAdded