Cogito, Ergo Ludo: An Agent that Learns to Play by Reasoning and Planning

TL;DR

Cogito, ergo ludo (CEL) learns games through reasoning and planning, mastering diverse grid-world tasks.

cs.AI 🔴 Advanced 2025-09-30 3 views
Sai Wang Yu Wu Zhongwen Xu
AI Reinforcement Learning LLM Reasoning Planning

Key Findings

Methodology

We propose a novel agent architecture, Cogito, ergo ludo (CEL), which leverages a Large Language Model (LLM) to build a language-based understanding of its environment. Starting from a tabula rasa state, CEL operates on a cycle of interaction and reflection. After each episode, the agent analyzes its trajectory to perform rule induction and strategy summarization. We evaluate CEL on grid-world tasks like Minesweeper, Frozen Lake, and Sokoban, showing it learns to master these games by autonomously discovering rules and developing effective policies from sparse rewards.

Key Results

  • In Minesweeper, the CEL agent achieved a success rate of 54%, surpassing the baseline agent with ground-truth rules at 26%.
  • In Sokoban, the CEL agent's success rate sharply increased to 84% after initial exploration.
  • In Frozen Lake, the CEL agent achieved a near-perfect success rate of 97% within the first 10 episodes.

Significance

This research demonstrates a path toward more general and interpretable agents that not only act effectively but also build a transparent and improving model of their world through explicit reasoning on raw experience. CEL's success indicates that integrating reasoning and planning with language models can significantly enhance learning efficiency and strategy development in complex environments.

Technical Contribution

CEL introduces a new paradigm by combining LLMs with reinforcement learning, providing explicit knowledge representation in natural language. Unlike existing methods, CEL makes strategies and rules transparent, introducing a post-episode reflection phase that allows the agent to update its environmental model and strategy playbook after each episode.

Novelty

CEL is the first agent architecture to learn games through language-based reasoning and planning. Compared to existing deep reinforcement learning methods, CEL offers greater interpretability and learning efficiency through explicit reasoning and rule induction using language models.

Limitations

  • CEL may perform poorly in highly complex or dynamically changing environments due to its reliance on static language models for rule induction.
  • In tasks requiring real-time decision-making, CEL may be limited by the delay in the reflection process.

Future Work

Future research could explore CEL's application in more complex environments and integrate other model types to enhance its dynamic adaptability.

AI Executive Summary

The field of artificial intelligence has long aimed to develop intelligent agents capable of mastering complex environments. While deep reinforcement learning has achieved remarkable success in certain areas, it relies on vast experience and encodes strategies within neural network weights, making them difficult to interpret. Cogito, ergo ludo (CEL) proposes a new paradigm where agents learn to play by reasoning and planning. CEL leverages a Large Language Model (LLM) to build a language-based understanding of its environment, starting from a tabula rasa state and operating on a cycle of interaction and reflection. After each episode, the agent analyzes its trajectory to perform rule induction and strategy summarization. We evaluate CEL on grid-world tasks like Minesweeper, Frozen Lake, and Sokoban, showing it learns to master these games by autonomously discovering rules and developing effective policies from sparse rewards. CEL's success indicates that integrating reasoning and planning with language models can significantly enhance learning efficiency and strategy development in complex environments. Although CEL may perform poorly in highly complex or dynamically changing environments, it provides a path toward more general and interpretable agents, showcasing broad potential for future research.

Deep Analysis

Background

Recent years have seen significant progress in developing intelligent agents capable of mastering complex environments. Deep reinforcement learning (RL) methods like AlphaGo and MuZero have demonstrated superhuman performance in board games and video games. However, these methods often rely on vast experience, with strategies encoded within neural network weights, making them difficult to interpret. The advent of Large Language Models (LLMs) provides a new foundation for agent design, grounded in reasoning and explicit knowledge representation.

Core Problem

Existing deep reinforcement learning methods, while powerful, suffer from inefficiency and lack of interpretability. Agents require vast computational resources and experience to learn, and their decision-making processes are often opaque. There is a need for agents that can explicitly represent knowledge and learn through reasoning and planning.

Innovation

Cogito, ergo ludo (CEL) combines Large Language Models with reinforcement learning, offering a new paradigm for agent design. CEL explicitly represents the language-based understanding of the environment, starting from a tabula rasa state and operating on a cycle of interaction and reflection. After each episode, the agent analyzes its trajectory to perform rule induction and strategy summarization.

Methodology

  • �� CEL leverages a Large Language Model (LLM) to build a language-based understanding of the environment. • Starts from a tabula rasa state and operates on a cycle of interaction and reflection. • After each episode, the agent analyzes its trajectory to perform rule induction and strategy summarization. • Evaluated on grid-world tasks like Minesweeper, Frozen Lake, and Sokoban.

Experiments

We evaluate CEL on grid-world tasks like Minesweeper, Frozen Lake, and Sokoban, characterized by sparse rewards. The agent receives a reward only at the end of the game. We use rLLM and verl for experiments, employing the Qwen3-4B-Instruct model to interact with environments. Each game undergoes 256 independent trials, reporting average success rates.

Results

In Minesweeper, the CEL agent achieved a success rate of 54%, surpassing the baseline agent with ground-truth rules at 26%. In Sokoban, the CEL agent's success rate sharply increased to 84% after initial exploration. In Frozen Lake, the CEL agent achieved a near-perfect success rate of 97% within the first 10 episodes.

Applications

CEL can be applied in complex environments requiring reasoning and planning, such as autonomous driving and robotic navigation. Its explicit knowledge representation and strategy summarization make it advantageous in scenarios requiring high interpretability and learning efficiency.

Limitations & Outlook

CEL may perform poorly in highly complex or dynamically changing environments due to its reliance on static language models for rule induction. In tasks requiring real-time decision-making, CEL may be limited by the delay in the reflection process. Future research could explore CEL's application in more complex environments and integrate other model types to enhance its dynamic adaptability.

Plain Language Accessible to non-experts

Imagine you're playing a complex board game like Minesweeper. Normally, you would need to learn the rules through trial and error, like feeling your way in the dark. Cogito, ergo ludo (CEL) acts like a smart assistant, not only remembering the outcome of each move but also summarizing a set of rules and strategies after each game. It's like having a super brain assistant that tells you which strategies worked and which didn't, so you can do better next time. CEL improves its gameplay this way, eventually mastering the game. This approach not only enhances learning efficiency but also makes the process more transparent and interpretable.

ELI14 Explained like you're 14

Imagine you're playing a super complex game like Minesweeper. Usually, you'd have to learn the rules by trial and error, like feeling your way in the dark. Cogito, ergo ludo (CEL) is like a smart assistant that not only remembers the outcome of each move but also summarizes a set of rules and strategies after each game. It's like having a super brain assistant that tells you which strategies worked and which didn't, so you can do better next time. CEL improves its gameplay this way, eventually mastering the game. This approach not only enhances learning efficiency but also makes the process more transparent and interpretable.

Glossary

Large Language Model (LLM)

A deep learning model capable of processing and generating natural language.

Used to build a language-based understanding of the environment.

Rule Induction

The process of extracting and summarizing environmental rules from experience.

Used to update the agent's environmental model.

Strategy Summarization

Converting successful and unsuccessful patterns into actionable strategies.

Used to update the agent's strategy playbook.

Sparse Rewards

A reward mechanism where rewards are given only under specific conditions.

Used to test the agent's learning ability in sparse reward environments.

Reflection Cycle

The process where the agent analyzes its trajectory after each episode to improve its model.

Used to enhance the agent's learning efficiency and strategy development.

Open Questions Unanswered questions from this research

  • 1 How to effectively apply CEL in dynamically changing environments?
  • 2 How to improve CEL's efficiency in real-time decision-making tasks?

Applications

Immediate Applications

Autonomous Driving

Enhancing the safety and efficiency of autonomous driving systems through reasoning and planning.

Long-term Vision

Intelligent Robots

Developing intelligent robots capable of autonomously learning and adapting to complex environments.

Abstract

The pursuit of artificial agents that can learn to master complex environments has led to remarkable successes, yet prevailing deep reinforcement learning methods often rely on immense experience, encoding their knowledge opaquely within neural network weights. We propose a different paradigm, one in which an agent learns to play by reasoning and planning. We introduce Cogito, ergo ludo (CEL), a novel agent architecture that leverages a Large Language Model (LLM) to build an explicit, language-based understanding of its environment's mechanics and its own strategy. Starting from a tabula rasa state with no prior knowledge (except action set), CEL operates on a cycle of interaction and reflection. After each episode, the agent analyzes its complete trajectory to perform two concurrent learning processes: Rule Induction, where it refines its explicit model of the environment's dynamics, and Strategy and Playbook Summarization, where it distills experiences into an actionable strategic playbook. We evaluate CEL on diverse grid-world tasks (i.e., Minesweeper, Frozen Lake, and Sokoban), and show that the CEL agent successfully learns to master these games by autonomously discovering their rules and developing effective policies from sparse rewards. Ablation studies confirm that the iterative process is critical for sustained learning. Our work demonstrates a path toward more general and interpretable agents that not only act effectively but also build a transparent and improving model of their world through explicit reasoning on raw experience.

cs.AI cs.LG