Back to blog
AI & Algorithms 12 min read

Chess Algorithms: Why AI Is Much More Than LLMs

Chess engines are a reminder that AI is not only about generating words. It is also about search, planning, evaluation, optimization, and decision-making.

AI Chess Algorithms Decision-Making LLMs

When people talk about artificial intelligence today, they usually think of ChatGPT, Gemini, Claude, or other large language models. The current AI boom has made LLMs the public face of artificial intelligence. For many people, AI now means a chatbot that writes emails, summarizes documents, generates code, or answers questions.

But this view is incomplete.

Artificial intelligence did not begin with language models, and it certainly does not end with them. Long before AI could write essays or generate images, it was already solving problems, searching through possibilities, and making decisions. One of the most important examples of this older and deeper form of AI is the chess algorithm.

Chess has always been a natural testing ground for artificial intelligence. The rules are simple, but the number of possible positions is enormous. At every move, a player must evaluate the current position, imagine future possibilities, predict the opponent’s response, and choose the best move.

In that sense, chess is not just a game. It is a model of decision-making.

Chess as an Early AI Challenge

Chess became one of the earliest grand challenges of artificial intelligence because it has clear rules, measurable outcomes, and deep strategic complexity.

A chess algorithm does not “think” like a human. It does not feel pressure, confidence, fear, or creativity in the human sense. Instead, it uses structured methods to search, evaluate, and decide.

A classical chess engine looks at possible moves, then possible replies, then replies to those replies. This creates a tree of future possibilities called a game tree.

The problem is that the tree becomes huge very quickly. In many chess positions, a player may have 30 or more legal moves. If each of those moves creates another 30 replies, the number of possibilities grows rapidly.

So the engine cannot simply search everything forever. It needs an intelligent way to decide which possibilities are worth studying.

That is where chess algorithms become interesting.

The Core Idea: Minimax

One of the most important algorithms in classical chess engines is called Minimax.

The idea is simple:

The engine tries to choose the move that gives it the best possible outcome.

But chess is not a one-player problem. The opponent is also trying to win. So the engine must assume that the opponent will choose the strongest reply.

This means the engine tries to maximize its advantage, while assuming the opponent will try to minimize that advantage.

That is why the algorithm is called Minimax.

In simple terms:

  • On the engine’s turn, choose the move with the highest score.
  • On the opponent’s turn, assume the opponent chooses the move with the lowest score for the engine.
  • Continue this process for several moves into the future.
  • Choose the move that leads to the best final result.

This is very different from a large language model. An LLM predicts and generates text based on patterns in language. A chess algorithm searches possible futures and chooses an action.

One generates words.

The other generates decisions.

Alpha-Beta Pruning: Thinking Smarter, Not Just Harder

Minimax is powerful, but it can be slow because there are too many possible move combinations.

To solve this, chess engines use a technique called Alpha-Beta Pruning.

Alpha-beta pruning allows the engine to stop searching a line when it already knows that the line is not useful.

Imagine you are comparing two possible moves. If the engine already finds that one move leads to a clearly better result, it does not need to waste time fully analyzing another move that is obviously worse.

In simple terms, alpha-beta pruning tells the engine:

Do not search branches that cannot change the final decision.

This makes the engine much faster. It allows the algorithm to search deeper without checking every single possibility.

This is one of the reasons chess engines can play at such a high level. They do not just calculate blindly. They calculate efficiently.

Simplified Code: Minimax with Alpha-Beta Pruning

Below is a simplified program that demonstrates the core logic behind a chess algorithm. Use the toggle to compare the same idea in C, Go, and Python.

This is not a complete chess engine. It does not generate legal chess moves or evaluate an actual chess board. Instead, it shows the decision-making structure used by classical chess engines.

Explanation of the Code

This program represents a simplified chess decision tree.

The array below represents possible final positions after the algorithm looks several moves ahead:

int scores[] = {3, 5, 6, 9, 1, 2, 0, -1};

Each number is a score for a possible final position.

A positive score means the position is good for the engine.

A negative score means the position is better for the opponent.

In a real chess engine, these scores would not be written manually. The engine would calculate them by evaluating the chess board.

For example, the engine may consider:

  • material balance,
  • king safety,
  • pawn structure,
  • piece activity,
  • control of the center,
  • attacking chances,
  • endgame advantages.

The function below is the main algorithm:

int minimax(int depth, int nodeIndex, int isMax, int scores[], int alpha, int beta)

The variable depth tells the algorithm how many levels ahead it should search.

The variable nodeIndex tells the algorithm which position in the tree it is currently analyzing.

The variable isMax tells whose turn it is.

If isMax is 1, it is the engine’s turn. The engine wants the highest score.

If isMax is 0, it is the opponent’s turn. The opponent wants the lowest score for the engine.

This reflects real chess. You do not only choose your best move. You also assume your opponent will reply with their best move.

The base case is:

if (depth == 0) {
    return scores[nodeIndex];
}

This means the algorithm has reached the final level of its search. It now returns the score of that final position.

When it is the engine’s turn, the algorithm uses:

best = max(best, value);
alpha = max(alpha, best);

This means the engine keeps the best score it has found so far.

When it is the opponent’s turn, the algorithm uses:

best = min(best, value);
beta = min(beta, best);

This means the opponent chooses the move that gives the engine the worst result.

The most important optimization is:

if (beta <= alpha) {
    break;
}

This is alpha-beta pruning.

It means the algorithm has found a branch that does not need to be searched further. If one path is already worse than another available option, the engine stops wasting time on it.

This is extremely important in chess because possible move sequences grow very quickly. After only a few moves, the number of possible positions can become enormous.

Alpha-beta pruning helps the engine search deeper while using less computation.

How This Relates to a Real Chess Engine

The code above is only a basic demonstration. A real chess engine such as Stockfish is far more advanced.

A real engine includes:

  • legal move generation,
  • board representation,
  • position evaluation,
  • opening preparation,
  • endgame tablebases,
  • move ordering,
  • alpha-beta pruning,
  • quiescence search,
  • transposition tables,
  • iterative deepening.

However, the core idea is similar.

The engine searches possible moves, evaluates future positions, assumes the opponent will respond strongly, and chooses the move with the best expected outcome.

This is why chess algorithms are such a powerful example of AI.

They show that AI is not only about language. AI can also be about planning, searching, evaluating, optimizing, and making decisions.

From Classical Chess Engines to Learning Systems

Classical chess engines relied heavily on search and handcrafted evaluation rules.

But later systems introduced machine learning into chess.

A famous example is AlphaZero. Instead of being programmed with detailed human chess knowledge, AlphaZero learned by playing games against itself. Through self-play and reinforcement learning, it discovered strong strategies on its own.

This was a major shift.

Earlier engines were mainly based on calculation and human-designed evaluation rules.

Newer learning-based systems showed that AI could learn strategy through experience.

This matters because many real-world problems also involve learning from repeated decisions. Finance, logistics, robotics, cybersecurity, pricing, and business strategy all involve choosing actions, observing results, and improving over time.

Chess became a small but powerful laboratory for these bigger ideas.

Why This Matters Today

The current AI boom is heavily focused on LLMs. That is understandable. LLMs are easy to interact with because they use natural language. Anyone can type a question and receive an answer.

But the danger is that people may start believing AI only means chatbots.

That is not true.

AI also includes:

  • search algorithms,
  • recommendation systems,
  • optimization models,
  • reinforcement learning,
  • computer vision,
  • robotics,
  • planning systems,
  • game-playing engines,
  • predictive models.

A chess algorithm is a perfect reminder of this broader reality.

It does not write poetry.

It does not summarize PDFs.

It does not chat like a person.

But it can make extremely strong decisions in a complex strategic environment.

That is intelligence too.

Business Lessons from Chess Algorithms

Chess algorithms are not only useful for understanding games. They also offer lessons for business and technology.

In business, leaders often face chess-like problems. They must make decisions while competitors, markets, customers, and regulators are also reacting.

A company may ask:

  • Should we enter a new market?
  • How should we price a product?
  • What will competitors do if we lower prices?
  • Which investment gives the best risk-adjusted return?
  • How should we allocate limited resources?
  • What is the best response to a supply-chain disruption?

These are not just language problems. They are decision problems.

This is where the broader field of AI becomes powerful. AI can help simulate scenarios, compare options, predict consequences, and recommend better decisions.

LLMs may help explain the decision.

But other AI systems may help make the decision.

That difference is important.

The Future: Hybrid AI Systems

The future of AI will likely not belong to one type of model alone.

LLMs are powerful because they are excellent interfaces. They help humans communicate with machines using normal language.

But behind the scenes, many important AI systems will still depend on search, optimization, simulation, planning, and reinforcement learning.

The most useful future AI systems may combine both worlds.

An LLM may explain the problem.

A search algorithm may explore possible solutions.

An optimization model may choose the best one.

A reinforcement learning system may improve through experience.

A simulation engine may test different futures.

Together, these systems could become much more powerful than a chatbot alone.

Chess gives us a simple way to understand this future.

A good chess engine does not win because it talks well. It wins because it evaluates positions, searches possibilities, anticipates responses, and chooses strong moves.

That is the side of AI people often forget.

Conclusion

The rise of LLMs has made artificial intelligence more visible than ever. Millions of people now interact with AI through language every day. This is an important moment.

But AI is much bigger than language models.

Chess algorithms remind us that artificial intelligence is also about decision-making. It is about choosing the best move from many possible options. It is about planning ahead, evaluating trade-offs, and acting under uncertainty.

LLMs generate words.

Chess engines generate decisions.

Both are AI, but they represent different kinds of intelligence.

As AI continues to develop, the most important question may not be whether machines can talk like humans.

The deeper question is whether machines can help us make better moves.

In chess, business, finance, technology, and life, that may be the real power of artificial intelligence.