Abstract: This paper presents a novel approach for leveraging automatically extracted textual knowledge to improve the performance of control applications such as games. Our ultimate goal is to enrich a stochastic player with high-level guidance expressed in text. Our model jointly learns to identify text that is relevant to a given game state in addition to learning game strategies guided by the selected text. Our method operates in the Monte-Carlo search framework, and learns both text analysis and game strategies based only on environment feedback. We apply our approach to the complex strategy game Civilization II using the official game manual as the text guide. Our results show that a linguistically-informed game-playing agent significantly outperforms its language-unaware counterpart, yielding a 27% absolute improvement and winning over 78% of games when playing against the built-in AI of Civilization II.
Introduction
In complex control applications like strategy games, the state and action spaces are astronomically large. For instance, Civilization II features approximately $10^{21}$ possible actions per turn. For a standard reinforcement learning agent, discovering a winning strategy purely through random exploration and environmental feedback is prohibitively slow.
Humans bypass this by reading manuals and tutorials that provide high-level heuristics, such as "Build your city on a plains or grassland square with a river." However, leveraging this text algorithmically presents a significant challenge in grounded language acquisition: how can an agent automatically extract relevant advice from raw text and map it to actionable strategies using only the game's score as a supervisory signal?
Methodology
The proposed agent is built upon a Monte-Carlo search framework, which evaluates potential moves by running simulated game roll-outs and observing the resulting utility (game score). To integrate textual advice, the action-value function $Q(s,a)$ is approximated using a specialized four-layer neural network.
Instead of processing the entire document at once, the model uses latent variables to parse text dynamically:
- Sentence Relevance: A stochastic softmax layer selects the single sentence from the manual most relevant to the current game state.
- Predicate Labeling: A subsequent layer parses the selected sentence, labeling words as action-descriptions, state-descriptions, or background information.
The network is trained entirely via online simulations. Parameters for both game strategy and linguistic parsing are updated via stochastic gradient descent to minimize the error between predicted $Q(s,a)$ and the actual observed game score. No manual linguistic annotation is required.
Experimental Setup
The model was evaluated using Freeciv, an open-source implementation of Civilization II. The textual data consisted of the official game manual (3,638 words). To test the model's ability to filter noise, sentences from the Wall Street Journal (WSJ) corpus were mixed with the manual during evaluation.
Results and Key Insights
The inclusion of structured linguistic analysis provided a substantial performance boost. In full-length games against the built-in AI, the text-aware model achieved a 78.8% win rate, compared to 45.7% for the language-unaware baseline.
Several key insights emerged from the study:
- Language Grounding Requires Structure: Explicitly differentiating between words describing states (e.g., "grassland") and actions (e.g., "build") is critical. Models lacking this predicate labeling structure performed significantly worse.
- Manuals as "Opening Books": The agent relies most heavily on text features during the first 25 steps of the game. As the game progresses, the network dynamically shifts priority toward game-state features. This mirrors human learning, where manuals provide foundational heuristics while late-game success depends on specific board states.
- Reward-Driven NLP: The study demonstrates that a noisy, high-level reward signal (the game score ratio) is sufficient to teach a machine how to identify relevant sentences and understand their contextual meaning without labeled datasets.
Limitations and Future Work
The primary limitation is the "early-game bias" of the manual; because it is written for beginners, it provides less guidance for complex late-game scenarios. Additionally, to manage the action space, the model assumes unit actions are independent, which limits highly coordinated multi-unit tactics. Future work may involve deeper linguistic analysis to unlock performance in environments with more complex, conditional rules.
Summary updated