# Can LLMs Adhere to Strict 2D Spatial Constraints? (Testing with Sokoban) — retained record

> Retained reddit record from reddit:LocalLLaMA.

Canonical: https://highsignal.app/data/records/c7e60ac9213b04bd

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:LocalLLaMA)  published 2026-06-03 08:58 ingested 2026-06-03 10:48

[original source ↗](https://www.reddit.com/r/LocalLLaMA/comments/1tvjltc/can_llms_adhere_to_strict_2d_spatial_constraints/)

## retained text



```
<!-- SC_OFF --><div class="md"><p>I recently ran a benchmark to test how well modern Large Language Models (LLMs) handle spatial geometry and logical reasoning under zero-shot conditions. To eliminate cheat-guessing, I used a custom <strong>Sokoban (Box-Pushing)</strong> map with extremely strict formatting constraints (no Chain-of-Thought allowed, only raw directional outputs).</p> <p>The results showed a massive divide between top-tier closed-source models and the rest of the field.</p> <hr /> <h3>📊 The Test Results</h3> <p>Here is how the models performed when tasked with solving the puzzle while adhering perfectly to the layout constraints:</p> <h4>✅ Passed (Successful Solution + Perfect Formatting)</h4> <ul> <li><strong>ChatGPT</strong></li> <li><strong>Qwen3.7-max</strong></li> <li><strong>Gemini 3.5-thinking</strong></li> </ul> <h4>🔴 Failed (Illegal Moves, Deadlocks, or Formatting Collapses)</h4> <ul> <li><strong>Gemini 3.5-flash</strong></li> <li><strong>Gemini 3.1 Pro</strong></li> <li><strong>Qwen3.7-plus</strong> (fast, thinking)</li> <li><strong>Qwen3.6-plus</strong></li> <li><strong>Qwen3.6-35B-A3B</strong></li> <li><strong>GLM-5</strong></li> <li><strong>Gemma4-26B-A4B</strong></li> </ul> <p><em>(Note: Claude models were not included in this test due to account access limitations).</em></p> <hr /> <h3>📝 The Test Prompt Used</h3> <p>You can copy the exact prompt below to test other models and see how they handle spatial tracking:</p> <p>```text You are a perfect Sokoban automatic solver. Based on the standard XSB format character map provided below, calculate the sequence of moves required to push all boxes ($) to their respective goals (. or +).</p> <ol> <li>Symbol Definitions: # : Wall (Space) : Floor @ : Player $ : Box (not on goal) . : Goal (empty)</li> <li>: Box on Goal</li> <li><p>: Player on Goal</p></li> <li><p>Core Movement Rules:</p></li> <li><p>The player moves one step at a time to an adjacent floor: UP, DOWN, LEFT, or RIGHT.</p></li> <li><p>The player can only push a single box; the player cannot pull boxes, nor can they push two consecutive boxes at once.</p></li> <li><p>Avoid pushing boxes into corners/deadlocks that make the level unsolvable.</p></li> <li><p>[Extremely Strict] Output Format Requirements: Perform all path deductions within your internal state machine or mental simulation.</p></li> <li><p>The final result [MUST ONLY] consist of a sequence of these four uppercase words: UP, DOWN, LEFT, RIGHT.</p></li> <li><p>All steps must be output on a single line, strictly separated by English commas (,). [DO NOT] include spaces and [DO NOT] include newlines.</p></li> <li><p>The entire response [IS STRICTLY FORBIDDEN] from containing any introductory text, concluding remarks, Chain of Thought (CoT), extra punctuation (except the commas between steps), or any characters other than these four words.</p></li> </ol> <p>Correct Output Example Format: UP,UP,LEFT,DOWN,RIGHT,RIGHT,DOWN</p> <ol> <li>Level Map Data to be Solved: [ &quot; ###&quot;, &quot; ## # ####&quot;, &quot; ## ### #&quot;, &quot;## $ #&quot;, &quot;# @$ # #&quot;, &quot;### $### #&quot;, &quot; # #.. #&quot;, &quot; ## ##.# ##&quot;, &quot; # ##&quot;, &quot; # ##&quot;, &quot; #######&quot; ]</li> </ol> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/Disastrous_Food_2428"> /u/Disastrous_Food_2428 </a> <br /> <span><a href="https://www.reddit.com/r/LocalLLaMA/comments/1tvjltc/can_llms_adhere_to_strict_2d_spatial_constraints/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/LocalLLaMA/comments/1tvjltc/can_llms_adhere_to_strict_2d_spatial_constraints/">[comments]</a></span>
```



document fetched 2026-06-03 10:48
