Skip to content

Chess AI: Alpha Beta vs Monte Carlo

AI Research

A chess engine that compares Alpha-Beta Pruning vs Monte Carlo Tree Search. No neural networks, only pure algorithms with real-time visualization. Play it or watch them fight.

Python
JavaScript
Chess
AI
Algorithms
Game Theory
Alpha Beta
Monte Carlo

Key Features

  • Alpha Beta Pruning with adjustable search depth
  • Monte Carlo Tree Search with adjustable simulation count
  • Real-time heatmap of move confidence
  • Algorithm vs algorithm gameplay mode
  • Position evaluation and node statistics
  • Display of pruning-efficiency metrics
  • Interactive web-based chess interface
  • No neural network, pure algorithmic approach

This project explores the foundations of chess AI. It implements and compares two fundamental algorithms: Alpha Beta Pruning and Monte Carlo Tree Search (MCTS). It does not use a neural network.

Live Demo

Try the chess engine yourself: chess.appliedtensors.com

Play against the AI, or watch the two algorithms compete against each other in real time.

Motivation

Google DeepMind’s AlphaZero defeated Stockfish with MCTS and deep neural networks. This project asks a different question: What can these algorithms do on their own, without machine learning?

When we remove the neural network, we can see the strengths and the limits of each algorithm in its pure form.

The Algorithms

Alpha Beta Pruning

Alpha Beta Pruning searches future moves in the game tree. It keeps bounds on the best result that each player can guarantee. When a branch cannot improve on these bounds, the algorithm prunes (skips) that entire subtree.

Characteristics:

  • Methodical and exhaustive within its search depth
  • Highly efficient through strategic pruning
  • Deterministic: the same position always produces the same move
  • Performance scales with search depth (exponential)

MCTS simulates many random game playouts from the current position. It learns which moves produce better outcomes. It gradually focuses its computation on the most promising paths.

Characteristics:

  • Probabilistic: it uses random simulations
  • Scales with the number of simulations
  • Without neural network guidance, it relies on random playouts
  • In chess, random moves often cause blunders

Key Findings

In extensive tests, Alpha Beta Pruning consistently outperforms pure MCTS in this implementation. The reasons follow:

The advantage of Alpha Beta:

  • Chess is a deterministic, perfect-information game
  • Exhaustive search within the depth guarantees optimal play at that depth
  • Pruned bad branches cause no loss of quality
  • No randomness means no accidental blunders

MCTS Without Neural Networks:

  • Random playouts in chess have low quality
  • Random moves frequently blunder pieces
  • The simulations do not teach the algorithm what good chess is
  • It needs many more simulations to overcome the noise from random play

Why AlphaZero Works:

AlphaZero does not use MCTS alone. It combines MCTS with a deep neural network. The network:

  1. Guides simulations: it suggests which moves to explore
  2. Evaluates positions: it gives informed assessments of each position
  3. Removes randomness: it replaces random playouts with learned intuition

The neural network transforms MCTS from “dart throwing” into strategic exploration.

Technical Implementation

The project includes:

  • Adjustable depth control for Alpha Beta (affects search thoroughness)
  • Simulation count slider for MCTS (affects convergence quality)
  • Real-time heatmap that shows move confidence levels (lighter = more confident)
  • Statistics panel that shows:
    • Search depth
    • Position evaluation (centipawn advantage)
    • Nodes searched
    • Branches pruned (for Alpha Beta)
    • Computation time

Demo Video

Watch the full algorithm comparison: youtu.be/QoccSHU-TYI

The video shows both algorithms in action. It includes algorithm-vs-algorithm matches. It explains why modern chess engines need neural networks.