---
title: 'MazeEval: Benchmark for Spatial Reasoning in LLMs'
url: https://www.emergentmind.com/topics/mazeeval
type: topic
---

# MazeEval: Benchmark for Spatial Reasoning in LLMs

MazeEval is a formal evaluation benchmark that isolates and quantifies the sequential spatial reasoning abilities of large language models (LLMs). It is designed to measure an LLM’s capacity for pure maze navigation—without visual input or rich environment descriptions—by presenting maze traversal tasks using strictly coordinate-based and minimal feedback, enabling explicit assessment of spatial cognition. MazeEval contrasts with earlier text-based navigation and mapping benchmarks by focusing exclusively on decision-making anchored in spatial feedback, not language parsing or map inference. It offers robust protocols for testing cross-linguistic transfer and enables principled model comparison at scale [2507.20395].

## 1. Benchmark Definition and Task Setup

MazeEval tasks require LLMs to navigate discrete $n\times n$ “perfect” mazes (single unique solution, no loops) of varying sizes, with $n$ ranging from 5 to 15 in core evaluations and up to 30 or 40 for certain models (notably O3). Each navigation episode is defined as an MDP where

- **State** $s = (x, y)$: current agent coordinates, with $x,y \in \{0, \ldots, n-1\}$.
- **Action** $A \in \{\text{north}, \text{south}, \text{east}, \text{west}\}$.
- **Transition Function** $T(s, a)$: deterministic, moves to $s'$ if there is no wall in the selected direction, remains at $s$ otherwise.
- **Observation Model**: At each step, the LLM receives
  $$
  O(s) = (x, y, d_N, d_S, d_E, d_W)
  $$
  where $d_\ast$ reports Manhattan distance to the nearest wall in each direction.

Prompting is conducted via a strict function-calling API; for each turn, the model receives the current state, distances, goal, and full trajectory history, and must produce a direction to move. The environment enforces two termination constraints: visiting any cell more than 10 times results in episode failure, and a global move budget of $3n^2$ prevents pathologically inefficient behaviors.

Maze generation uses a randomized DFS to ensure a single-solution structure, and for every size, five distinct mazes are used to average out instance-specific variance. This protocol allows precise measurement of spatial problem solving under controlled stochasticity [2507.20395].

## 2. Evaluation Metrics

MazeEval provides a suite of formal metrics for quantifying distinct aspects of navigation proficiency:

- **Success Rate**:
  $$
  \text{SuccessRate} = \frac{\#\,\text{mazes solved within budget}}{\#\,\text{mazes attempted}}
  $$
  This is the primary outcome, measuring pure task completion.

- **Step Efficiency**:
  $$
  \text{Efficiency} = \frac{\text{optimal path length}}{\text{actual steps taken}}
  $$
  Computed only for successful episodes, indicating planning optimality.

- **Loop Rate**:
  $$
  \text{LoopRate} = \frac{\#\,\text{cells visited} \geq 10\,\text{times}}{n^2}
  $$
  Tracks failure modes dominated by excessive revisiting rather than naïve exploration.

- **Invalid Move Rate**:
  $$
  \text{InvalidRate} = \frac{\#\,\text{attempted moves into walls}}{\text{total moves}}
  $$
  Highlights deficiencies in local feasibility detection [2507.20395].

All failures reported in the principal study are due exclusively to looping behavior, not to exceeding move budgets or legal move errors, indicating that catastrophic navigation failure arises from limitations in persistent spatial memory or strategy [2507.20395].

## 3. Experimental Results and Comparative Evaluation

In systematic experiments, eight state-of-the-art LLMs were assessed via identical APIs, with all prompts and directions translated for cross-linguistic tests (English and Icelandic). Maze sizes ranged from $n=5$ to $n=15$ for all models, with the O3 model evaluated up to $n=30$.

Key results include:

- Models such as OpenAI O3 maintained perfect or near perfect Success Rates up to $n=30$ (100% for all tested $n\leq30$), while Claude Opus 4, Claude Sonnet 4, Gemini 2.5 Flash, Gemini 2.5 Pro, and GPT-4o all failed beyond $n=8{-}12$ (dropping to 0% at $n = 10$ for most).
- All non-O3 model failures were traceable one-to-one to excessive looping, with Loop Rates $>0$ and no recorded over-budget terminations.
- Median Efficiency for successful O3 runs is $\approx 0.9\textrm{–}1.0$ across all sizes; other models drop to $0.4\textrm{–}0.7$ as $n$ increases, and variance grows with maze complexity.
- In Icelandic, every model (except O3) coped with mazes $3$–$4$ sizes smaller than in English, confirmed by Wilcoxon signed-rank ($p < 0.001$, Cohen’s $d \approx 0.5$) [2507.20395].

The empirical pattern reveals a sharp scaling wall: for most LLMs, spatial competence collapses catastrophically beyond $n \approx 8$, regardless of the language used. Performance in low-resource languages degrades much faster, suggesting an emergent effect of training corpus frequency and composition, not an underlying universal spatial schema in current architectures.

| Model              | Max $n$ (English) | Max $n$ (Icelandic) |
|--------------------|-------------------|---------------------|
| Claude Opus 4      | 11                | 8                   |
| Claude Sonnet 4    | 12                | 8                   |
| Gemini 2.5 Flash   | 8                 | 8                   |
| Gemini 2.5 Pro     | 11                | 8                   |
| GPT-4o             | 8                 | 8                   |
| GPT-4o-mini        | –                 | –                   |
| GPT-4.1-mini       | 8                 | 7                   |
| O3                 | $15^+$            | $15^+$              |

*Table: Maximum size of maze ($n$) solved in at least one instance per model/language [2507.20395].*

## 4. Linguistic Transfer and Emergent Limitations

MazeEval critically explores cross-linguistic transfer by translating direction words and prompts into Icelandic, keeping numeric and structural feedback identical. Models universally display a pronounced drop in navigation success for Icelandic, with median maximum solvable maze sizes reduced by 3–4 levels relative to English. Only O3 shows no measurable performance loss.

This strongly supports the interpretation that spatial reasoning in LLMs is not based on modality-independent, language-agnostic mechanisms. Rather, the cognitive mapping required for navigation appears to emerge through linguistic patterns and distributional regularities in the training data. Lower-resource languages lacking sufficient corpus coverage yield substantial drops in spatial problem-solving. This finding has direct implications for robustness of LLM-powered systems in global, multilingual deployments [2507.20395].

## 5. Interpretive Analysis and Failure Modes

The dominant failure mode is catastrophic looping: the model, despite full access to coordinate histories and wall distances, revisits the same cell repeatedly (at least 10 times), indicating failure to encode or exploit visited state information over long horizons. Notably, no failures in the core set are due to move legality (all models respected local wall constraints), ruling out a basic perception or parsing deficit.

Models do not appear to construct or retain internal “cognitive maps” of the traversed structure, a finding consistent with prior diagnostic results showing a rapid collapse in sequential spatial memory beyond relatively small maze dimensions. Excessive looping in the presence of full information implies that persistent memory or trajectory abstraction is not spontaneously realized in current transformer models over these task scales [2507.20395].

A plausible implication is that the scaling wall—behavioral collapse by $n\approx9$—reflects not merely the combinatorial explosion of planning but a fundamental inefficiency (or absence) of memory-binding across long trajectories. The success of O3 up to $n=30$ suggests that architectural or training improvements, e.g., explicit memory modules or increased context window, can partially overcome this barrier.

## 6. Methodological Directions and Future Benchmarks

The MazeEval framework motivates several methodological extensions to more fully capture the space of spatial reasoning challenges:

- **Multimodal inputs**: Introducing “visualization-of-thought” (VOT) prompting, where LLMs are asked to generate, update, or interpret diagrammatic representations, potentially augments internal map construction and explicit memory [2507.20395].
- **Memory-Augmented Architectures**: New designs, inspired by hippocampal grid/place cell systems, could introduce explicit working-memory submodules, directly addressing the observed failures in persistent state tracking.
- **Prompt Engineering**: Adopting subroutine scaffolding or partial map revelation to promote route-planning and backtracking strategies may extend the size regime in which LLMs remain effective.
- **Extended domains**: Adding settings involving continuous or 3D environments, as well as multi-agent coordination, would generalize MazeEval’s relevance to embodied AI and autonomous robotics.
- **Cross-benchmark comparison**: Positioning MazeEval alongside graph-based navigation QA (MANGO [2403.19913]), visually-encoded navigation (AlphaMaze [2502.14669]), and multi-scale diagnostic probing (Lost in Aggregation [2606.22219]) situates its specificity and highlights open research directions.

The authors recommend leveraging MazeEval for principled, neuroscience-inspired, and cross-modal innovations to advance LLM spatial intelligence and ensure reliable navigation capabilities in diverse settings.

## 7. Relation to Broader Maze and Navigation Benchmarks

MazeEval occupies a unique intersection within the landscape of maze-based evaluation tools:

- **Contrast to MANGO**: Where MANGO [2403.19913] focuses on QA over walkthroughs and tests mapping inference in narrative text, MazeEval centers on sequential, decision-time spatial planning with minimal environmental feedback.
- **Relation to AMaze**: AMaze [2411.13072] provides a pipeline for generalization analysis and curriculum design, with human-in-the-loop protocols and explicit visual sign complexity. MazeEval, in contrast, carries a function-calling API with no signs, symbols, or visual ambiguity—its focus is pure spatial reasoning disentangled from perception.
- **Multi-Scale Diagnostic Benchmarks**: The “Lost in Aggregation” framework [2606.22219] decomposes navigation into Fine/Meso/Macro cognitive subproblems and reveals that LLMs retain isolated competence in local passability and global orientation well beyond the point where full-sequence navigation collapses—a phenomenon also visible in MazeEval’s error profiles.
- **AlphaMaze**: AlphaMaze [2502.14669] demonstrates that supervised fine-tuning on tokenized visual maze data, followed by reinforcement learning (GRPO), can specifically boost success rates on MazeEval-like tasks, with explicit chain-of-thought and self-correction emerging as LLMs adapt to the navigation setting.

Collectively, these findings position MazeEval as a benchmark that isolates and exposes foundational spatial deficits in LLMs, grounds promising avenues for architectural and training improvements, and motivates future research on closing the gap between linguistic and spatial intelligence in artificial agents [2507.20395].

Source: https://www.emergentmind.com/topics/mazeeval