Do engines use randomness in move decisions?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

JohnW
Posts: 381
Joined: Thu Nov 22, 2012 12:20 am
Location: New Hampshire

Do engines use randomness in move decisions?

Post by JohnW »

Just curious, do modern engines invoke some kind of random move selection when make move decisions?

The reason I ask is because I was playing a series of blitz matches using uci versions of old Mephisto chess computers (Amsterdam vs Roma) and noticed out of just 20 games there were several where they made the exact same moves, they ended at move 141, ending in a draw with the same exact ending piece positions. I don't think I ever noticed that type of thing with modern engines, the games might start out the same way but differ at some point. I am kind of surprised the old Mephisto engines didn't use some kind of randomness.
tmokonen
Posts: 1297
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: Do engines use randomness in move decisions?

Post by tmokonen »

JohnW wrote:Just curious, do modern engines invoke some kind of random move selection when make move decisions?

The reason I ask is because I was playing a series of blitz matches using uci versions of old Mephisto chess computers (Amsterdam vs Roma) and noticed out of just 20 games there were several where they made the exact same moves, they ended at move 141, ending in a draw with the same exact ending piece positions. I don't think I ever noticed that type of thing with modern engines, the games might start out the same way but differ at some point. I am kind of surprised the old Mephisto engines didn't use some kind of randomness.
A program using a multi-threaded search, running in a multitasking operating system is non-deterministic, and may produce different search results, because it is pretty much impossible to reproduce the timing of when threads are created and destroyed in a multitasking OS. As well, a modern day OS will always be running other processes than your chess engine, and the OS giving resources to those other processes can also alter the timing of a chess engine.

A program like Mephisto Amsterdam runs as a dedicated single task on a single CPU, and is not sharing resources with other programs. Therefore, you can reproduce the same search results on that sort of hardware/software combination.
JohnW
Posts: 381
Joined: Thu Nov 22, 2012 12:20 am
Location: New Hampshire

Re: Do engines use randomness in move decisions?

Post by JohnW »

Ah, I see. Thank you for your explanation..
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Do engines use randomness in move decisions?

Post by pedrox »

Many old dedicated machines have some kind of random move. There are many machines that had a ROM of very small size, for example 2K or 4K, these machines usually had not opening book or very small and to get different games with the built-in random move. Other machines if have a openning book, but even so they usually have a user selectable option to allow random move (perhaps with several degrees).

With engines, perhaps removing those that have multithread, you can also play the samme games. It is therefore important that tournament managers or programmers in their test use appropriate opening books that have a wide number of possibilities in each position or position test with variety.

Some engines (very few since it is not a big problem) they have an option to allow a random move by adding a small random value to the evaluation, for example if you add a random value between 1 and 5 centipawns, evaluation of the engine hardly changes and its strength almost either, but it gives more options so that the games are not repeated. My engine plays with random move when playing with limitstrenght.

Manual of Mephisto Amsterdam:

Image