<s>
An	O
evaluation	B-General_Concept
function	I-General_Concept
,	O
also	O
known	O
as	O
a	O
heuristic	B-General_Concept
evaluation	I-General_Concept
function	I-General_Concept
or	O
static	B-General_Concept
evaluation	I-General_Concept
function	I-General_Concept
,	O
is	O
a	O
function	O
used	O
by	O
game-playing	O
computer	O
programs	O
to	O
estimate	O
the	O
value	O
or	O
goodness	O
of	O
a	O
position	O
(	O
usually	O
at	O
a	O
leaf	O
or	O
terminal	O
node	O
)	O
in	O
a	O
game	O
tree	O
.	O
</s>
<s>
Most	O
of	O
the	O
time	O
,	O
the	O
value	O
is	O
either	O
a	O
real	O
number	O
or	O
a	O
quantized	O
integer	O
,	O
often	O
in	O
nths	O
of	O
the	O
value	O
of	O
a	O
playing	O
piece	O
such	O
as	O
a	O
stone	O
in	O
go	O
or	O
a	O
pawn	O
in	O
chess	B-Application
,	O
where	O
n	O
may	O
be	O
tenths	O
,	O
hundredths	O
or	O
other	O
convenient	O
fraction	O
,	O
but	O
sometimes	O
,	O
the	O
value	O
is	O
an	O
array	B-Data_Structure
of	O
three	O
values	O
in	O
the	O
unit	O
interval	O
,	O
representing	O
the	O
win	O
,	O
draw	O
,	O
and	O
loss	O
percentages	O
of	O
the	O
position	O
.	O
</s>
<s>
There	O
do	O
not	O
exist	O
analytical	O
or	O
theoretical	O
models	O
for	O
evaluation	B-General_Concept
functions	I-General_Concept
for	O
unsolved	O
games	O
,	O
nor	O
are	O
such	O
functions	O
entirely	O
ad-hoc	O
.	O
</s>
<s>
The	O
composition	O
of	O
evaluation	B-General_Concept
functions	I-General_Concept
is	O
determined	O
empirically	O
by	O
inserting	O
a	O
candidate	O
function	O
into	O
an	O
automaton	O
and	O
evaluating	O
its	O
subsequent	O
performance	O
.	O
</s>
<s>
A	O
significant	O
body	O
of	O
evidence	O
now	O
exists	O
for	O
several	O
games	O
like	O
chess	B-Application
,	O
shogi	O
and	O
go	O
as	O
to	O
the	O
general	O
composition	O
of	O
evaluation	B-General_Concept
functions	I-General_Concept
for	O
them	O
.	O
</s>
<s>
Games	O
in	O
which	O
game	O
playing	O
computer	O
programs	O
employ	O
evaluation	B-General_Concept
functions	I-General_Concept
include	O
chess	B-Application
,	O
go	O
,	O
shogi	O
(	O
Japanese	O
chess	B-Application
)	O
,	O
othello	O
,	O
hex	O
,	O
backgammon	B-Application
,	O
and	O
checkers	O
.	O
</s>
<s>
In	O
addition	O
,	O
with	O
the	O
advent	O
of	O
programs	O
such	O
as	O
MuZero	B-Application
,	O
computer	O
programs	O
also	O
use	O
evaluation	B-General_Concept
functions	I-General_Concept
to	O
play	O
video	O
games	O
,	O
such	O
as	O
those	O
from	O
the	O
Atari	B-General_Concept
2600	I-General_Concept
.	O
</s>
<s>
A	O
tree	O
of	O
such	O
evaluations	O
is	O
usually	O
part	O
of	O
a	O
search	O
algorithm	O
,	O
such	O
as	O
Monte	B-Application
Carlo	I-Application
tree	I-Application
search	I-Application
or	O
a	O
minimax	O
algorithm	O
like	O
alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
search	I-Algorithm
.	O
</s>
<s>
This	O
implies	O
that	O
for	O
dynamic	O
positions	O
where	O
tactical	O
threats	O
exist	O
,	O
the	O
evaluation	B-General_Concept
function	I-General_Concept
will	O
not	O
be	O
an	O
accurate	O
assessment	O
of	O
the	O
position	O
.	O
</s>
<s>
These	O
positions	O
are	O
termed	O
non-quiescent	O
;	O
they	O
require	O
at	O
least	O
a	O
limited	O
kind	O
of	O
search	O
extension	O
called	O
quiescence	B-General_Concept
search	I-General_Concept
to	O
resolve	O
threats	O
before	O
evaluation	O
.	O
</s>
<s>
Some	O
values	O
returned	O
by	O
evaluation	B-General_Concept
functions	I-General_Concept
are	O
absolute	O
rather	O
than	O
heuristic	O
,	O
if	O
a	O
win	O
,	O
loss	O
or	O
draw	O
occurs	O
at	O
the	O
node	O
.	O
</s>
<s>
There	O
is	O
an	O
intricate	O
relationship	O
between	O
search	O
and	O
knowledge	O
in	O
the	O
evaluation	B-General_Concept
function	I-General_Concept
.	O
</s>
<s>
Because	O
the	O
evaluation	B-General_Concept
function	I-General_Concept
depends	O
on	O
the	O
nominal	O
depth	O
of	O
search	O
as	O
well	O
as	O
the	O
extensions	O
and	O
reductions	O
employed	O
in	O
the	O
search	O
,	O
there	O
is	O
no	O
generic	O
or	O
stand-alone	O
formulation	O
for	O
an	O
evaluation	B-General_Concept
function	I-General_Concept
.	O
</s>
<s>
An	O
evaluation	B-General_Concept
function	I-General_Concept
which	O
works	O
well	O
in	O
one	O
application	O
will	O
usually	O
need	O
to	O
be	O
substantially	O
re-tuned	O
or	O
re-trained	O
to	O
work	O
effectively	O
in	O
another	O
application	O
.	O
</s>
<s>
In	O
chess	B-Application
,	O
the	O
output	O
of	O
an	O
evaluation	B-General_Concept
function	I-General_Concept
is	O
typically	O
an	O
integer	O
,	O
and	O
the	O
units	O
of	O
the	O
evaluation	B-General_Concept
function	I-General_Concept
are	O
typically	O
referred	O
to	O
as	O
pawns	O
.	O
</s>
<s>
The	O
term	O
'	O
pawn	O
 '	O
refers	O
to	O
the	O
value	O
when	O
the	O
player	O
has	O
one	O
more	O
pawn	O
than	O
the	O
opponent	O
in	O
a	O
position	O
,	O
as	O
explained	O
in	O
Chess	B-Application
piece	O
relative	O
value	O
.	O
</s>
<s>
The	O
integer	O
1	O
usually	O
represents	O
some	O
fraction	O
of	O
a	O
pawn	O
,	O
and	O
commonly	O
used	O
in	O
computer	B-Application
chess	I-Application
are	O
centipawns	O
,	O
which	O
are	O
a	O
hundredth	O
of	O
a	O
pawn	O
.	O
</s>
<s>
An	O
evaluation	B-General_Concept
function	I-General_Concept
also	O
implicitly	O
encodes	O
the	O
value	O
of	O
the	O
right	O
to	O
move	O
,	O
which	O
can	O
vary	O
from	O
a	O
small	O
fraction	O
of	O
a	O
pawn	O
to	O
win	O
or	O
loss	O
.	O
</s>
<s>
Historically	O
in	O
computer	B-Application
chess	I-Application
,	O
the	O
terms	O
of	O
an	O
evaluation	B-General_Concept
function	I-General_Concept
are	O
constructed	O
(	O
i.e.	O
</s>
<s>
handcrafted	O
)	O
by	O
the	O
engine	O
developer	O
,	O
as	O
opposed	O
to	O
discovered	O
through	O
training	O
neural	B-Architecture
networks	I-Architecture
.	O
</s>
<s>
The	O
general	O
approach	O
for	O
constructing	O
handcrafted	O
evaluation	B-General_Concept
functions	I-General_Concept
is	O
as	O
a	O
linear	O
combination	O
of	O
various	O
weighted	O
terms	O
determined	O
to	O
influence	O
the	O
value	O
of	O
a	O
position	O
.	O
</s>
<s>
However	O
,	O
not	O
all	O
terms	O
in	O
a	O
handcrafted	O
evaluation	B-General_Concept
function	I-General_Concept
are	O
linear	O
,	O
some	O
,	O
such	O
as	O
king	O
safety	O
and	O
pawn	O
structure	O
,	O
are	O
nonlinear	O
.	O
</s>
<s>
A	O
handcrafted	O
evaluation	B-General_Concept
function	I-General_Concept
typically	O
has	O
of	O
a	O
material	O
balance	O
term	O
that	O
usually	O
dominates	O
the	O
evaluation	O
.	O
</s>
<s>
Handcrafted	O
evaluation	B-General_Concept
functions	I-General_Concept
typically	O
contain	O
dozens	O
to	O
hundreds	O
of	O
individual	O
terms	O
.	O
</s>
<s>
In	O
practice	O
,	O
effective	O
handcrafted	O
evaluation	B-General_Concept
functions	I-General_Concept
are	O
created	O
not	O
by	O
ever	O
expanding	O
the	O
list	O
of	O
evaluated	O
parameters	O
,	O
but	O
by	O
careful	O
tuning	O
or	O
training	O
of	O
the	O
weights	O
relative	O
to	O
each	O
other	O
,	O
of	O
a	O
modest	O
set	O
of	O
parameters	O
such	O
as	O
those	O
described	O
above	O
.	O
</s>
<s>
An	O
example	O
handcrafted	O
evaluation	B-General_Concept
function	I-General_Concept
for	O
chess	B-Application
might	O
look	O
like	O
the	O
following	O
:	O
</s>
<s>
While	O
neural	B-Architecture
networks	I-Architecture
have	O
been	O
used	O
in	O
the	O
evaluation	B-General_Concept
functions	I-General_Concept
of	O
chess	B-Application
engines	O
since	O
the	O
late	O
1980s	O
,	O
they	O
did	O
not	O
become	O
popular	O
in	O
computer	B-Application
chess	I-Application
until	O
the	O
late	O
2010s	O
,	O
as	O
the	O
hardware	O
needed	O
to	O
train	O
neural	B-Architecture
networks	I-Architecture
was	O
not	O
strong	O
enough	O
at	O
the	O
time	O
,	O
and	O
fast	O
training	O
algorithms	O
and	O
network	O
topology	O
and	O
architectures	O
have	O
not	O
been	O
developed	O
yet	O
.	O
</s>
<s>
Initially	O
,	O
neural	B-Architecture
network	I-Architecture
based	O
evaluation	B-General_Concept
functions	I-General_Concept
generally	O
consisted	O
of	O
one	O
neural	B-Architecture
network	I-Architecture
for	O
the	O
entire	O
evaluation	B-General_Concept
function	I-General_Concept
,	O
with	O
input	O
features	O
selected	O
from	O
the	O
board	O
and	O
whose	O
output	O
is	O
an	O
integer	O
,	O
normalized	O
to	O
the	O
centipawn	O
scale	O
so	O
that	O
a	O
value	O
of	O
100	O
is	O
roughly	O
equivalent	O
to	O
a	O
material	O
advantage	O
of	O
a	O
pawn	O
.	O
</s>
<s>
The	O
parameters	O
in	O
neural	B-Architecture
networks	I-Architecture
are	O
typically	O
trained	O
using	O
reinforcement	O
learning	O
or	O
supervised	B-General_Concept
learning	I-General_Concept
.	O
</s>
<s>
More	O
recently	O
,	O
evaluation	B-General_Concept
functions	I-General_Concept
in	O
computer	B-Application
chess	I-Application
have	O
started	O
to	O
use	O
multiple	O
neural	B-Architecture
networks	I-Architecture
,	O
with	O
each	O
neural	B-Architecture
network	I-Architecture
trained	O
for	O
a	O
specific	O
part	O
of	O
the	O
evaluation	O
,	O
such	O
as	O
pawn	O
structure	O
or	O
endgames	O
.	O
</s>
<s>
This	O
allows	O
for	O
hybrid	O
approaches	O
where	O
an	O
evaluation	B-General_Concept
function	I-General_Concept
consists	O
of	O
both	O
neural	B-Architecture
networks	I-Architecture
and	O
handcrafted	O
terms	O
.	O
</s>
<s>
Deep	O
neural	B-Architecture
networks	I-Architecture
have	O
been	O
used	O
,	O
albeit	O
infrequently	O
,	O
in	O
computer	B-Application
chess	I-Application
after	O
Matthew	O
Lai	O
's	O
Giraffe	O
in	O
2015	O
and	O
Deepmind	B-Application
's	O
AlphaZero	B-Application
in	O
2017	O
demonstrated	O
the	O
feasibility	O
of	O
deep	O
neural	B-Architecture
networks	I-Architecture
in	O
evaluation	B-General_Concept
functions	I-General_Concept
.	O
</s>
<s>
The	O
distributed	B-Architecture
computing	I-Architecture
project	O
Leela	B-Application
Chess	I-Application
Zero	I-Application
was	O
started	O
shortly	O
after	O
to	O
attempt	O
to	O
replicate	O
the	O
results	O
of	O
Deepmind	B-Application
's	O
AlphaZero	B-Application
paper	O
.	O
</s>
<s>
Apart	O
from	O
the	O
size	O
of	O
the	O
networks	O
,	O
the	O
neural	B-Architecture
networks	I-Architecture
used	O
in	O
AlphaZero	B-Application
and	O
Leela	B-Application
Chess	I-Application
Zero	I-Application
also	O
differ	O
from	O
those	O
used	O
in	O
traditional	O
chess	B-Application
engines	O
as	O
they	O
have	O
two	O
outputs	O
,	O
one	O
for	O
evaluation	O
(	O
the	O
value	O
head	O
)	O
and	O
one	O
for	O
move	O
ordering	O
(	O
the	O
policy	O
head	O
)	O
,	O
rather	O
than	O
only	O
one	O
output	O
for	O
evaluation	O
.	O
</s>
<s>
In	O
addition	O
,	O
while	O
it	O
is	O
possible	O
to	O
set	O
the	O
output	O
of	O
the	O
value	O
head	O
of	O
Leela	O
's	O
neural	B-Architecture
network	I-Architecture
to	O
a	O
real	O
number	O
to	O
approximate	O
the	O
centipawn	O
scale	O
used	O
in	O
traditional	O
chess	B-Application
engines	O
,	O
by	O
default	O
the	O
output	O
is	O
the	O
win-draw-loss	O
percentages	O
,	O
a	O
vector	O
of	O
three	O
values	O
each	O
from	O
the	O
unit	O
interval	O
.	O
</s>
<s>
Since	O
deep	O
neural	B-Architecture
networks	I-Architecture
are	O
very	O
large	O
,	O
engines	O
using	O
deep	O
neural	B-Architecture
networks	I-Architecture
in	O
their	O
evaluation	B-General_Concept
function	I-General_Concept
usually	O
require	O
a	O
graphics	B-Architecture
processing	I-Architecture
unit	I-Architecture
in	O
order	O
to	O
efficiently	O
calculate	O
the	O
evaluation	B-General_Concept
function	I-General_Concept
.	O
</s>
<s>
The	O
most	O
basic	O
implementation	O
of	O
piece-square	O
table	O
consists	O
of	O
separate	O
tables	O
for	O
each	O
type	O
of	O
piece	O
per	O
player	O
,	O
which	O
in	O
chess	B-Application
results	O
in	O
12	O
piece-square	O
tables	O
in	O
total	O
.	O
</s>
<s>
More	O
complex	O
variants	O
of	O
piece-square	O
tables	O
are	O
used	O
in	O
computer	B-Application
chess	I-Application
,	O
one	O
of	O
the	O
most	O
prominent	O
being	O
the	O
king-piece-square	O
table	O
,	O
used	O
in	O
Stockfish	B-Application
,	O
Komodo	B-Application
Dragon	I-Application
,	O
Ethereal	O
,	O
and	O
many	O
other	O
engines	O
,	O
where	O
each	O
table	O
considers	O
the	O
position	O
of	O
every	O
type	O
of	O
piece	O
in	O
relation	O
to	O
the	O
player	O
's	O
king	O
,	O
rather	O
than	O
the	O
position	O
of	O
the	O
every	O
type	O
of	O
piece	O
alone	O
.	O
</s>
<s>
In	O
handcrafted	O
evaluation	B-General_Concept
functions	I-General_Concept
,	O
there	O
are	O
sometimes	O
two	O
sets	O
of	O
tables	O
:	O
one	O
for	O
the	O
opening/middlegame	O
,	O
and	O
one	O
for	O
the	O
endgame	O
;	O
positions	O
of	O
the	O
middle	O
game	O
are	O
interpolated	O
between	O
the	O
two	O
.	O
</s>
<s>
A	O
common	O
handcrafted	O
evaluation	B-General_Concept
function	I-General_Concept
used	O
in	O
computer	B-Application
chess	I-Application
is	O
the	O
Piece-Square	O
Table	O
Only	O
,	O
or	O
PeSTO	O
for	O
short	O
,	O
which	O
is	O
a	O
very	O
simple	O
evaluation	B-General_Concept
function	I-General_Concept
consisting	O
of	O
material	O
terms	O
and	O
only	O
two	O
sets	O
of	O
piece	O
square	O
tables	O
,	O
one	O
for	O
the	O
opening	O
and	O
one	O
for	O
the	O
endgame	O
,	O
for	O
the	O
positional	O
terms	O
.	O
</s>
<s>
Nevertheless	O
,	O
PeSTO	O
is	O
able	O
to	O
perform	O
as	O
well	O
as	O
many	O
other	O
handcrafted	O
evaluation	B-General_Concept
functions	I-General_Concept
used	O
in	O
computer	B-Application
chess	I-Application
.	O
</s>
<s>
PeSTO	O
was	O
first	O
created	O
by	O
Tomasz	O
Michniewski	O
in	O
2003	O
under	O
the	O
name	O
"	O
Simplified	O
Evaluation	B-General_Concept
Function	I-General_Concept
"	O
,	O
and	O
the	O
current	O
name	O
was	O
introduced	O
by	O
Ronald	O
Friederich	O
when	O
he	O
implemented	O
PeSTO	O
in	O
his	O
engine	O
rofChade	O
.	O
</s>
<s>
Originally	O
developed	O
in	O
computer	O
shogi	O
in	O
2018	O
by	O
Yu	O
Nasu	O
,	O
the	O
most	O
common	O
evaluation	B-General_Concept
function	I-General_Concept
used	O
in	O
computer	B-Application
chess	I-Application
today	O
is	O
the	O
efficiently	B-General_Concept
updatable	I-General_Concept
neural	I-General_Concept
network	I-General_Concept
,	O
or	O
NNUE	B-General_Concept
for	O
short	O
,	O
a	O
sparse	O
and	O
shallow	O
neural	B-Architecture
network	I-Architecture
that	O
has	O
only	O
piece-square	O
tables	O
as	O
the	O
inputs	O
into	O
the	O
neural	B-Architecture
network	I-Architecture
.	O
</s>
<s>
In	O
fact	O
,	O
the	O
most	O
basic	O
NNUE	B-General_Concept
architecture	O
is	O
simply	O
the	O
12	O
piece-square	O
tables	O
described	O
above	O
,	O
a	O
neural	B-Architecture
network	I-Architecture
with	O
only	O
one	O
layer	O
and	O
no	O
activation	B-Algorithm
functions	I-Algorithm
.	O
</s>
<s>
An	O
efficiently	B-General_Concept
updatable	I-General_Concept
neural	I-General_Concept
network	I-General_Concept
architecture	O
,	O
using	O
king-piece-square	O
tables	O
as	O
its	O
inputs	O
,	O
was	O
first	O
ported	O
to	O
chess	B-Application
in	O
a	O
Stockfish	B-Application
derivative	O
called	O
Stockfish	B-Application
NNUE	B-General_Concept
,	O
publicly	O
released	O
on	O
May	O
30	O
,	O
2020	O
,	O
and	O
was	O
adopted	O
by	O
many	O
other	O
engines	O
before	O
eventually	O
being	O
incorporated	O
into	O
the	O
official	O
Stockfish	B-Application
engine	O
on	O
August	O
6	O
,	O
2020	O
.	O
</s>
<s>
Chess	B-Application
engines	O
frequently	O
use	O
endgame	O
tablebases	O
in	O
their	O
evaluation	B-General_Concept
function	I-General_Concept
,	O
as	O
it	O
allows	O
the	O
engine	O
to	O
play	O
perfectly	O
in	O
the	O
endgame	O
.	O
</s>
<s>
Historically	O
,	O
evaluation	B-General_Concept
functions	I-General_Concept
in	O
Go	O
took	O
into	O
account	O
both	O
territory	O
controlled	O
,	O
influence	O
of	O
stones	O
,	O
number	O
of	O
prisoners	O
and	O
life	O
and	O
death	O
of	O
groups	O
on	O
the	O
board	O
.	O
</s>
<s>
However	O
,	O
modern	O
go	O
playing	O
computer	O
programs	O
largely	O
use	O
deep	O
neural	B-Architecture
networks	I-Architecture
in	O
their	O
evaluation	B-General_Concept
functions	I-General_Concept
,	O
such	O
as	O
AlphaGo	B-Application
,	O
Leela	B-Application
Zero	I-Application
,	O
Fine	B-Application
Art	I-Application
,	O
and	O
KataGo	O
,	O
and	O
output	O
a	O
win/draw/loss	O
percentage	O
rather	O
than	O
a	O
value	O
in	O
number	O
of	O
stones	O
.	O
</s>
