The Opening Almanac

What works in practice.

An engine looks for the best move against perfect defense. We use billions of Lichess games to ask a different question: what should you play against the replies people actually choose? Explore a position to find promising continuations—including moves that work because the strongest defense is rarely played.

A few things we found.

How we calculate it.

What should you play if your opponent responds like the people in the Lichess database? We combine recorded game results with a search through possible continuations.

1Start with what people played.

For each position we collected, the database tells us how often each move was played, and how many games ended in a win, draw or loss. That gives us a tree of possible moves, with a frequency attached to each reply.

2Look ahead through the opening.

We can’t follow every possibility to checkmate. Eventually we reach positions where our search stops. There, we ask: how did real games that reached this position turn out?

If White won 60%, drew 10% and lost 30%, that position gets a White score of 65%: wins count fully and draws count half. That’s the score we start working backwards from.

3Work backwards.

Suppose Move A gives your opponent two replies. They choose one 80% of the time, reaching a position with a 70% score for you. The other 20% of the time, they reach a position with a 40% score for you.

Scores travel backwards from the endpoints Move A leads to endpoints scoring 70 and 40 percent, reached with frequencies of 80 and 20 percent. Their weighted average is 64 percent. Move B scores 58 percent. At your turn we choose Move A, so the starting position receives 64 percent. Arrows point backwards toward the starting position. Your turn: choose the higher scoreMove AMove BAverage their replies80% play this20% play this 64% 64% 58% 70% 40% Historical scores where our search stops
80% × 70% + 20% × 40% = 64%Made-up numbers. Follow the arrows from the bottom up.

If Move B scores 58%, we choose A. We repeat these same two operations all the way back to the position on your board:

  • Your turn: take the highest score—you can choose that move.
  • Their turn: take the frequency-weighted average—we assume they make the usual mixture of replies.

4Add a preparation budget.

So far, we’ve assumed you follow our recommendations at every turn we explore. With a budget of five, we only get to give you five instructions: “If you reach this position, play this move.”

We choose both the positions and the moves. The five instructions might cover several different replies from your opponent; they don’t have to form one five-move line. Everywhere else, we assume you choose moves with the same frequencies as the database players.

The algorithm finds the set of instructions with the highest estimated score. Run that calculation for each budget, and you get the preparation curve.

5How much should you trust it?

A high score assumes you also play the recommended continuations. Just playing the first move doesn’t get you the whole benefit.

A move can rank highly even if it has a refutation: if hardly anyone plays that reply, it barely affects the average. And sometimes the data is just lucky, or our search stops before the problem shows up. No engine checks these scores.

We pool Lichess ratings and time controls, so your opponents may play differently. We also smooth small samples toward 50%. Treat the numbers as estimates to explore, not a prediction of your own win rate.