Improving Chess Commentaries by Combining Language Models with Symbolic Reasoning Engines

Andrew Lee, David Wu, Emily Dinan, Mike LewisarXiv 2022 · DOI

Abstract

Large Language Models (LLMs) excel at generating fluent, natural language but often struggle with factual grounding in complex, rule-bound domains like chess. Conversely, symbolic chess engines provide superhuman strategic analysis but lack the ability to communicate insights in human-readable prose. This paper presents a novel pipeline that decouples strategic reasoning from language generation. By using "control codes" extracted from human commentary and grounded in engine evaluations (Leela Chess Zero), the proposed system generates high-quality, accurate chess commentary. Human evaluations demonstrate a 72% preference for this approach over existing state-of-the-art models.

Introduction: The Grounding Problem in Chess Commentary

While modern LLMs like GPT-4 are incredibly eloquent, they are fundamentally "ungrounded." In the context of chess, this leads to frequent hallucinations where a model might describe a brilliant knight maneuver even if that piece has already been captured. This lack of situational awareness makes pure neural models unreliable for technical commentary.

On the other hand, symbolic reasoning engines such as Stockfish or Leela Chess Zero possess superhuman intelligence but are "voiceless." They can identify the optimal move to a depth of thirty plies but cannot explain why a move is strategically significant. The challenge lies in bridging this gap: creating a system that utilizes the deep logic of a chess engine while maintaining the communicative flair of an expert human commentator.

Methodology: A Decoupled Architecture

The researchers propose a "controllable commentary generation" pipeline that separates the task of reasoning from the task of language production. This process involves three distinct stages:

  1. Tag Extraction: During the training phase, BART-based models analyze human commentaries to extract "control codes" or tags. These tags represent objective factual information, such as move quality (e.g., "Blunder," "Excellent") and suggested alternative moves.
  2. Controllable Training: A language model is trained to generate commentary conditioned on three specific inputs: the raw move history (PGN), a symbolic representation of the board state (piece positions and attack vectors), and the extracted tags.
  3. Engine-Led Inference: At test time, the system does not rely on the LLM for strategic analysis. Instead, the board state is passed to Leela Chess Zero. The engine provides objective move quality and the best alternative lines, which are then converted into tags. The LLM uses these "ground truth" tags to anchor its prose, ensuring the output matches the actual strategic reality of the game.
The controllable commentary generation pipeline, illustrating training with extracted tags and inference guided by the Leela chess engine.

Experimental Setup and Datasets

The study utilized a diverse array of data sources to ensure both linguistic variety and technical accuracy:

  • GameKnot: The primary dataset, containing 373,919 triplets of (Game-state, Move, Commentary) sourced from an online chess community.
  • Pre-training Data: To instill chess-specific vocabulary, the authors collected ~56,000 question-and-answer pairs from Chess.com, Chess StackExchange, and the r/chess Subreddit.
  • Manual Annotations: Small subsets (600–1,800 samples) were manually labeled to fine-tune the tag-extraction models for move quality and suggested moves.

Quantitative and Qualitative Evaluation

The "Fully-Conditioned" model was evaluated against several baselines, including the previous benchmark established by Jhamtani et al. (2018).

Perplexity Scores: The model showed a significant drop in perplexity as more game-state and tag information was introduced. This indicates that engine-provided signals are highly predictive of the linguistic patterns found in high-quality human commentary.

Perplexity scores across different conditioning levels, showing that adding game-state and tag information significantly improves text prediction.

Human Preference: In A/B testing conducted via Amazon Mechanical Turk, human judges preferred the new model's commentaries over the previous state-of-the-art across all categories:

  • Move Description: Preferred 72% of the time.
  • Move Quality: Preferred 75% of the time.
  • Comparative Analysis: Preferred 72% of the time.

Insights and Limitations

A key finding of the study was the "Superhuman Evaluation Gap." Human judges occasionally disagreed with the model's accurate assessments because the model reflected engine insights that were too deep or non-intuitive for human players. Furthermore, a "prompted belief-state" analysis revealed that the LLM has a better "memory" for pieces that moved recently, which explains why hallucinations often involve static pieces on the periphery of the action.

Despite these successes, logical consistency remains a hurdle. While the engine provides accurate tags, the LLM can still fail to connect them logically in long-form text—for instance, correctly identifying a move as a mistake but then erroneously describing a non-existent checkmate in the following sentence. Future work will focus on richer tag annotations to capture "look-ahead" reasoning and long-term strategic plans.

Conclusion

By treating the chess engine as the "brain" and the LLM as the "voice," this research demonstrates that decoupling reasoning from language is a viable path toward grounded, expert-level AI communication. This framework has implications beyond chess, suggesting a template for any domain where symbolic logic must be translated into natural language.

Summary updated

BibTeX
@misc{lee2022improving,
  author = {Andrew Lee and David Wu and Emily Dinan and Mike Lewis},
  title = {{Improving Chess Commentaries by Combining Language Models with Symbolic Reasoning Engines}},
  year = {2022},
  eprint = {2212.08195},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.08195},
}
Figure