Table of Contents

Chess - Programming - Late Move Reduction

Intended for use in conjunction with move ordering.

The starting point of LMR varies between programs, but generally the first four or five moves are searched fully and any moves after this are reduced.

LMR will be counterproductive in engines with poor move ordering, ruining the tactical capabilities of the search.


A late move (as opposed to an early move) is a move that gets sorted late in the list of moves we are about to search.

The idea of the late move reductions is since we predict these moves will not produce any good results we might as well reduce the time we spend on them.


An example approach

Just before the search is about to go into the PVS search.

if (movesSearched >= 4 &&
    ply >= 3 &&
    Move.capture(moves[i]) == 0 &&
    !isInCheck(board))
{
  eval=-alphaBeta(board,ply-2,-alpha-1,-alpha,true,depth+1);
}
else 
  eval = alpha +1;
 
if (eval > alpha) // Continue with PVS search

NOTE: This starts with a few conditions for when we are allowed to reduce moves.

  • Then we do a search with a minimal window (since we are only interested if the move fails low or not) using a reduced depth.
  • We reduce the depth with 1 extra ply (a usual search is ply-1).
  • If the eval comes back lower than alpha we are satisfied with this result and can be quite confident that the move was indeed a poor one.
  • If the search however comes back higher than alpha, something is fishy and we have to continue with the ordinary search at regular depth.

When to reduce?

The main idea comes with the first condition; movesSearched >= 4.


What should be reduced among the late moves

Some types of moves that should probably not be reduced:

These are the obvious ones, there are several other techniques for determining if a move is safe to reduce.

There are endless possibilities how to handle the reductions:


Simple late move reduction.


Late Move Reduction