TextGames: Learning to Self-Play Text-Based Puzzle Games via Language Model Reasoning

Frederikus Hudi, Genta Indra Winata, Ruochen Zhang, Alham Fikri AjiarXiv 2025

Abstract

Reasoning is a fundamental capability of large language models (LLMs), enabling them to comprehend, analyze, and solve complex problems. In this paper, we introduce TextGames, an innovative benchmark specifically crafted to assess LLMs through demanding text-based games that require advanced skills in pattern recognition, spatial awareness, arithmetic, and logical reasoning. Our analysis probes LLMs' performance in both single-turn and multi-turn reasoning, and their abilities in leveraging feedback to correct subsequent answers through self-reflection. Our findings reveal that, although LLMs exhibit proficiency in addressing most easy and medium-level problems, they face significant challenges with more difficult tasks. In contrast, humans are capable of solving all tasks when given sufficient time. Moreover, we observe that LLMs show improved performance in multi-turn predictions through self-reflection, yet they still struggle with sequencing, counting, and following complex rules consistently. Additionally, models optimized for reasoning outperform pre-trained LLMs that prioritize instruction following, highlighting the crucial role of reasoning skills in addressing highly complex problems.

The Challenge of Textual Reasoning

While Large Language Models (LLMs) have become remarkably adept at following instructions and generating fluent prose, their ability to perform deep, multi-step reasoning remains a subject of intense debate. Existing benchmarks often focus on narrow domains like mathematical word problems or commonsense Q&A. The authors of TextGames argue that true reasoning is multifaceted, requiring a combination of pattern recognition, spatial awareness, and the ability to follow intricate, interlocking constraints.

TextGames was built to see if LLMs can move beyond "stochastic parroting" and into the realm of active problem-solving, specifically testing if models can self-reflect—using feedback from a "game master" to correct their own mistakes over multiple turns.

The TextGames Benchmark

The core contribution of this work is the TextGames benchmark, which consists of 24,000 test samples across eight distinct games. These are categorized into two primary formats:

  • 1D Puzzles: Anagram Scribble, Password Game, Bracket Game, and String Search. These focus on linear constraints and character-level manipulation.
  • 2D Puzzles: Crossword Arranger, Text Sudoku, Islands (constructing a grid with specific land/water/tree counts), and Ordering Text. These require the model to maintain a mental map of a grid or complex hierarchy.
Overview of the eight text-based puzzle games in the TextGames benchmark.

Each game features three difficulty levels (Easy, Medium, Hard) based on the number of constraints and the size of the search space. This tiered structure allows for a granular analysis of where model reasoning begins to break down.

Methodology: The Self-Play Loop

The researchers developed a game evaluation framework where an LLM acts as a player in a specific loop:

  1. Prompting: The model receives the game rules, constraints, and optionally a one-shot example.
  2. Execution: The model generates a solution.
  3. Grading & Feedback: An automated grader checks the solution. If incorrect, it provides a specific error message (e.g., "Your answer must not contain repeated characters").
  4. Self-Reflection: In multi-turn scenarios, the model receives its previous attempt and the error message, then tries to refine its answer.

The study compared "off-the-shelf" instruction-tuned models (like Llama-3.1 and Qwen-2.5) against proprietary reasoning-focused models (GPT-o3 Mini) and human participants.

Key Results and Insights

Performance comparison across 1D and 2D puzzles, difficulty levels, and multi-turn reasoning.

The 2D Spatial Wall

LLMs face a massive "difficulty spike" when moving from 1D to 2D puzzles. While many models can solve a 1D anagram, they almost universally fail at 2D tasks like "Islands" or "Crossword Arranger," which require tracking spatial relationships in a text-only medium. This highlights a significant limitation in current LLM architectures regarding spatial reasoning.

Reasoning vs. Instruction Following

There is a clear divide between models optimized for general chat (Instruction-tuned) and those optimized for "Chain-of-Thought" (Reasoning-tuned). GPT-o3 Mini was the clear winner, achieving 96.5% accuracy on 1D Easy puzzles and 45.1% on 1D Hard puzzles in a single turn. In contrast, standard LLMs struggled significantly; Llama-3.3 70B dropped from 55.8% on 1D Easy to just 5.1% on 1D Hard.

The Power of the Feedback Loop

Multi-turn interaction is a game-changer. Models showed significant performance gains when allowed to "self-reflect" on grader feedback. For instance, in the "Bracket Game," multi-turn feedback helped Gemma-2 9B jump from 26.6% to 67.1% accuracy. This suggests that LLMs often have the latent capacity to solve a problem but fail initially due to a lack of planning.

The "Overthinking" Trap

Interestingly, the authors observed inverse scaling in some hard games for reasoning-optimized models. In these cases, longer reasoning traces (more "thinking" tokens) actually led to more incorrect answers, as the model would talk itself out of a correct initial intuition or get lost in its own over-complicated logic.

Conclusion

TextGames reveals that while reasoning-optimized models are making strides, the gap between AI and human performance remains wide, especially in spatial and high-constraint tasks. Humans were able to solve nearly all tasks given enough time, whereas models often hit a ceiling. Future work may involve training models specifically on these "self-play" scenarios to bake in spatial and logical constraints more effectively into smaller, more efficient architectures.

Summary updated

BibTeX
@misc{hudi2025textgames,
  author = {Frederikus Hudi and Genta Indra Winata and Ruochen Zhang and Alham Fikri Aji},
  title = {{TextGames: Learning to Self-Play Text-Based Puzzle Games via Language Model Reasoning}},
  year = {2025},
  eprint = {2502.18431},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.18431},
}
Figure