Abstract
Researchers from UC San Diego have introduced a General Modular Harness that transforms standard Large Language Models (LLMs) into capable agents for complex, multi-turn games. By decoupling an agent into plug-and-play modules for perception, memory, and reasoning, the framework allows for a systematic analysis of AI agent success, consistently outperforming "unharnessed" baseline models across diverse gaming environments.
Introduction
While LLM-based agents have shown promise in automation, their success often relies on domain-specific hacks—hand-engineered workflows and rigid templates tailored to single environments. This approach suffers from poor generalization, structural opacity, and high barriers to entry. To address these issues, this research utilizes games as a "clean abstraction" for multi-turn interaction. Games are computationally hard (NP-hard or NP-complete) yet provide clear reward signals, making them ideal benchmarks for general-purpose intelligence.
Modular Harness Architecture
The core innovation is the Modular Harness Design, which sits atop a single LLM/VLM backbone (e.g., GPT-4o or Claude 3.7). It consists of three distinct components:
- Perception Module: Converts game states into usable data via raw text, vision, or a combined mode that overlays grid lines on images to reduce spatial errors.
- Memory Module: Maintains a history of the last N game states and actions, incorporating a self-reflection step where the model critiques its previous moves.
- Reasoning Module: Acts as the central controller, integrating perceptual data and memory traces to output final actions.
To ensure robust performance, the team employed a two-stage Prompt Optimization workflow using DSPy and the SIMBA optimizer, reducing performance variance across different models by 33.8% to 63.5%.
Experimental Methodology
The framework was tested on four classic game suites integrated via the Gymnasium API:
- Sokoban: A grid-based puzzle requiring long-term planning (NP-hard).
- Candy Crush: A match-three game with complex temporal dependencies (NP-hard).
- 2048: A sliding-tile puzzle testing path management.
- Tetris: A fast-paced game emphasizing pattern recognition.
Additionally, a correlation study with 20 established benchmarks (e.g., MMLU-Pro, GPQA) was conducted to relate game performance to broader LLM capabilities.
Results and Discussion
The modular harness provided a statistically significant performance lift across all tested environments. In Candy Crush, Claude 3.7-Thinking improved its score from 126.3 (unharnessed) to 484.0 (harnessed).
Ablation studies revealed that different games have different cognitive bottlenecks. Perception is critical for spatially grounded games like Sokoban and Tetris, while Memory (specifically self-reflection) drives success in 2048 and Candy Crush. Furthermore, models with native reasoning capabilities (like o1 or Claude 3.7-Thinking) saw the most dramatic gains, suggesting that structured modules "unlock" latent reasoning behaviors.
Conclusion
The General Modular Harness demonstrates that structured cognitive faculties are additive and essential for complex task execution. While computational costs and environment scope remain challenges, the framework provides a scalable path toward evaluating high-level algorithmic reasoning through gaming. Future work includes extending the pipeline to more complex environments like Pokémon via STABLE RETRO.
Summary updated