A Data-Driven Approach for Gin Rummy Hand Evaluation

Sang T. Truong, Todd W. NellerAAAI 2021 · DOI

Abstract

Gin Rummy presents a significant challenge for artificial intelligence due to its imperfect information and the strategic tension between offensive deadwood reduction and defensive risk management. This paper introduces a novel data-driven framework that evaluates hand strength by combining a Dual Inception Convolutional Neural Network (CNN) for offensive scoring with Bayesian reasoning for defensive assessment. By training on high-quality datasets generated through Monte Carlo simulations, the proposed model achieves a 55.4% win rate against standard heuristic-based opponents, demonstrating the superiority of spatial feature extraction over traditional multi-layer perceptrons in card game environments.

Introduction

While games with perfect information like Chess and Go have seen dominant AI performance, Gin Rummy remains a complex frontier. The game requires balancing two competing strategies: building "melds" (sets or runs) to reduce "deadwood" (unmatched cards) while simultaneously avoiding discards that might benefit the opponent. Previous research has largely relied on simple counting principles or basic neural networks that fail to capture the spatial relationships between cards—such as the proximity of a 5 and 6 of hearts in forming a run. This study seeks to quantify "hand strength" through a dual-scoring system that mimics expert human decision-making.

Methodology

The researchers propose a hybrid approach to evaluate game states, treating the hand as a 4x13 binary matrix (suits by ranks).

Offensive Scoring: Dual Inception CNN

To capture the "topology" of a card deck, the authors designed a "Dual Inception" architecture. Unlike standard Multi-Layer Perceptrons (MLPs) that treat cards as independent features, this model uses 2D convolutions with multiple filter sizes (2x2, 3x3, 4x4). This allows the network to simultaneously recognize patterns like pairs, triplets, and consecutive sequences.

Comparison of the Dual Inception architecture (a) against standard MLP (b) and MLP with interactive terms (c).

Defensive Scoring and Data Generation

Defensive play is managed via Bayesian reasoning, maintaining a belief distribution of the opponent's hand based on observed draws and discards. To train the offensive model, the authors used Monte Carlo (MC) simulations to generate high-quality data. By pitting a "Random Player" against a "Simple Player" and recording only the most successful lines of play, the model learned from superior strategies that a basic heuristic player would never attempt.

Datasets

The study utilized three primary datasets collected at the end of game rounds:

  • Simple Dataset: 1.6 million observations from games between two heuristic-based Simple Players (SPs).
  • Random-16: 1.00 million observations recording the best-scoring sample out of 16 MC trials.
  • Random-256: 1.01 million observations recording the best sample out of 256 trials, representing the highest quality play patterns.

Results and Discussion

The Dual Inception model significantly outperformed baseline architectures. As shown in the training curves, the CNN achieved a much lower Mean Squared Error (MSE) in predicting eventual game scores compared to MLPs across different datasets.

Mean Squared Error (MSE) across training epochs for the Simple (a) and Random-256 (b) datasets, showing the superior convergence of the Dual Inception model.

Key findings include:

  • Win Rate: The model trained on the Random-256 dataset achieved a 55.4% ± 0.8% win rate against the Simple Player baseline.
  • Human-like Logic: Qualitative analysis revealed the model learned to value "triangles" (e.g., 4♥, 5♥, 5♠), which have high potential to become melds—a tactic used by expert humans but ignored by basic heuristics.
  • The Offensive-Defensive Dilemma: The model quantified a critical trade-off: cards that provide the best offensive score are often the most dangerous to discard defensively. Success requires navigating this tension rather than maximizing a single metric.

Conclusion and Future Work

While the Dual Inception model shows clear advantages, it currently struggles with discrete "bonus" events like Gin or Undercuts, which the regression model tends to smooth over. Future work may involve joint optimization of offensive and defensive scores through Reinforcement Learning or the use of Graph Neural Networks (GNNs) to treat card relationships more fluidly without the artificial constraints of a matrix representation.

Summary updated

BibTeX
@inproceedings{truong2021data,
  author = {Sang T. Truong and Todd W. Neller},
  title = {{A Data-Driven Approach for Gin Rummy Hand Evaluation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i17.17843},
}
Figure