Your network blocks the Lichess assets!

lichess.org
Donate

A Modern Server

Chessboard Through the Eyes of an Engine

Chess engineChess botChess
What's hidden behind the +0.5 eval?

Hey what's up guys!

Today it's over the engines: why are they exactly so strong? Let's review!

To understand this, we need to look directly into the "skull" of chess supercomputers, which are divided into two groups: calculator engines and AI computers.

In the first chapter, we'll discuss the most prominent representative of chess calculators: Stockfish, and in the second, we'll switch to the famous Leela Chess Zero, representing the AI-powered engines camp.

Let's get started!


Stockfish: The Father of Chess Engines

image.png

A bit of history

The Stockfish chess engine was invented by Norwegian programmer Tord Romstad back in 2004.
Glaurung, as our fish was then known, was still far from dominant, but it was already considered strong.

The program received a significant upgrade in 2008 from Italian developer Marco Costalba, who also coined the humorous name "Stockfish." He wrote:

Fish caught in Norway and cooked in Italy.

By this, Costalba meant that the engine itself was conceived in Norway and refined in Italy.

Stockfish gradually gained power because it was a completely open engine, meaning any programmer could drop in and suggest code changes or contribute information from their engine to Stockfish. People were sharing information 24/7, which helped the program's strength grow rapidly.

image.pngOld version of Stockfish

In 2017, when AI chess engines emerged, they obliterated the old Stockfish. But the developers didn't give up: on the contrary, they even embraced the challenge, making a significant leap forward by adding the NNUE system to Stockfish, thereby combining a great computer with AI power.

Today, Stockfish, with a score of 3653 Elo in rapid chess, 3900+ Elo in classical chess, and 4102 Elo in Fischer Random Chess (also often referred to as Chess960), is considered the strongest chess computer, leaving AI computers and, of course, humans far behind.

изображение_2026-06-14_115453022.pngNNUE Stockfish mode lichess


How does Stockfish work?

Step 1: Machine View
Stockfish doesn't see the board the way we see it; the "fish" turns the board into boring numbers.

0 1 1 0 0 1 1 0
1 0 0 1 1 0 0 1
0 1 1 0 0 1 1 0
1 0 0 1 1 0 0 1
0 1 1 0 0 1 1 0
1 0 0 1 1 0 0 1
0 1 1 0 0 1 1 0
0 1 1 0 0 1 1 0

(0 = an empty square)
(1 = a piece)

Step 2: Alpha-Beta cutoff
No amount of power is sufficient to calculate all the variations.
That's why the Stockfish developers came up with a strict variation cutoff. If the "fish" sees that a particular move is bad for a specific reason (for example, it misses checkmate in three or loses a queen), the engine simply stops calculating this line. It continues generating variations and repeats the same pattern until it finds the ideal move, which it calculates to incredible depth.

image.pngAlpha-Beta Algorithm

Extra: NNUE is a very powerful Stockfish assistant: it is literally an AI assistant for Stockfish that searches for moves and a powerful computer (Stockfish) sorts them out. This algorithm greatly facilitates and improves the quality of Stockfish's work.

Step 3: The centipawns
When we are used to the pieces being worth 1, 3, 5 and 9 points, the engine sees them in hundredths (0,12) and changes this value when the piece is in a better place or in the endgame!

You can clearly see it in this engine code: 

enum PieceType {
  NO_PIECE_TYPE = 0, PAWN = 1, KNIGHT = 2, BISHOP = 3, ROOK = 4, QUEEN = 5, KING = 6,
  ALL_PIECES = 0,
  PIECE_TYPE_NB = 8
};

constexpr Value PawnValueMg   = Value(126),  PawnValueEg   = Value(208); 
//Notice here that the pawn in the middlegame (PawnValueMg) is less worth than the pawn in the middlegame (PawnValueEg) (126<208) 
constexpr Value KnightValueMg = Value(781),  KnightValueEg = Value(854); //You can notice it here
constexpr Value BishopValueMg = Value(825),  BishopValueEg = Value(915); //And here
constexpr Value RookValueMg   = Value(1276), RookValueEg   = Value(1380); //And here
constexpr Value QueenValueMg  = Value(2538), QueenValueEg  = Value(2682); //And here

constexpr Value PieceValueMg[PIECE_TYPE_NB] = {
  Value(0), PawnValueMg, KnightValueMg, BishopValueMg, RookValueMg, QueenValueMg, Value(0), Value(0)
};

constexpr Value PieceValueEg[PIECE_TYPE_NB] = {
  Value(0), PawnValueEg, KnightValueEg, BishopValueEg, RookValueEg, QueenValueEg, Value(0), Value(0)
};

Only after this path does Stockfish choose what he believes is the right move.
Imagine if a game lasts hundreds of moves, the amount of work that must be done!


A modern approach to engines: LC0 or Leela Chess Zero

Some History

It all began in 2017, when enthusiastic programmer Gary Linscott, inspired by Google's AlphaZero project, which shut down almost immediately after its release, decided to try to replicate Google's triumph. He really liked Google's idea: they had forced an AI to play millions of games against itself.
Gary took the open-source code for Go and rewrote it for chess.
Together with a large online community, he forced Leela to play millions of games against herself, and she learned to play from scratch and beat Stockfish! (Who later recovered and took a decisive revenge after adding NNUE.)


How does Leela work?

Step 1: Leela plays millions of games with herself.
She analyzes her games and chooses the best move based on the games she has played with herself.

The paradoxical thing about this computer is that Leela doesn't mindlessly try out variations: she looks for the most harmonious variations and calculates them.
It's also worth noting that she doesn't have the usual +1 move evaluations. She builds a win percentage based on her games, and her LC0 evaluation looks like this: 0.50, meaning I have a 50% chance of winning!

Leela's workload is very small, but it's still a very powerful computer!


Concluding Ideas

After all this, I will need to answer one final question: why are they so strong?

Reason 1: Engines have no psychological pressure: they don't care who's sitting in front of them: whether it's you in your home shirt or Magnus Carlsen in jeans...
Reason 2: Perfect knowledge of the opening: engines know every opening absolutely completely and with 100% accuracy: From Ruy Lopez on the Grob Opening.
Reason 3 is of course the depth of the analysis.
Reason 4: In the endgame with less than 7 pieces the engines're knowing every position: this is how the engine can see mate in 67 moves...

It is these aspects that allow them to be the best "chess players" on the planet!

I hope you enjoyed this deep dive into the calculaters and AI machines!

Have a good day, good health and good luck in your chess adventures!