<s>
PAQ	B-Application
is	O
a	O
series	O
of	O
lossless	B-Algorithm
data	I-Algorithm
compression	I-Algorithm
archivers	O
that	O
have	O
gone	O
through	O
collaborative	O
development	O
to	O
top	O
rankings	O
on	O
several	O
benchmarks	O
measuring	O
compression	O
ratio	O
(	O
although	O
at	O
the	O
expense	O
of	O
speed	O
and	O
memory	O
usage	O
)	O
.	O
</s>
<s>
Specialized	O
versions	O
of	O
PAQ	B-Application
have	O
won	O
the	O
Hutter	O
Prize	O
and	O
the	O
Calgary	B-General_Concept
Challenge	I-General_Concept
.	O
</s>
<s>
PAQ	B-Application
is	O
free	B-Application
software	I-Application
distributed	O
under	O
the	O
GNU	B-License
General	I-License
Public	I-License
License	I-License
.	O
</s>
<s>
PAQ	B-Application
uses	O
a	O
context	B-General_Concept
mixing	I-General_Concept
algorithm	O
.	O
</s>
<s>
Context	B-General_Concept
mixing	I-General_Concept
is	O
related	O
to	O
prediction	B-Algorithm
by	I-Algorithm
partial	I-Algorithm
matching	I-Algorithm
(	O
PPM	O
)	O
in	O
that	O
the	O
compressor	O
is	O
divided	O
into	O
a	O
predictor	O
and	O
an	O
arithmetic	B-Algorithm
coder	I-Algorithm
,	O
but	O
differs	O
in	O
that	O
the	O
next-symbol	O
prediction	O
is	O
computed	O
using	O
a	O
weighted	O
combination	O
of	O
probability	O
estimates	O
from	O
a	O
large	O
number	O
of	O
models	O
conditioned	O
on	O
different	O
contexts	O
.	O
</s>
<s>
Most	O
PAQ	B-Application
versions	O
collect	O
next-symbol	O
statistics	O
for	O
the	O
following	O
contexts	O
:	O
</s>
<s>
n-grams	B-Language
;	O
the	O
context	O
is	O
the	O
last	O
bytes	B-Application
before	O
the	O
predicted	O
symbol	O
(	O
as	O
in	O
PPM	O
)	O
;	O
</s>
<s>
whole-word	O
n-grams	B-Language
,	O
ignoring	O
case	O
and	O
nonalphabetic	O
characters	O
(	O
useful	O
in	O
text	O
files	O
)	O
;	O
</s>
<s>
"	O
sparse	O
"	O
contexts	O
,	O
for	O
example	O
,	O
the	O
second	O
and	O
fourth	O
bytes	B-Application
preceding	O
the	O
predicted	O
symbol	O
(	O
useful	O
in	O
some	O
binary	O
formats	O
)	O
;	O
</s>
<s>
two-dimensional	O
contexts	O
(	O
useful	O
for	O
images	O
,	O
tables	O
,	O
and	O
spreadsheets	O
)	O
;	O
the	O
row	O
length	O
is	O
determined	O
by	O
finding	O
the	O
stride	O
length	O
of	O
repeating	O
byte	B-Application
patterns	O
;	O
</s>
<s>
specialized	O
models	O
,	O
such	O
as	O
x86	B-Operating_System
executables	O
,	O
BMP	B-Device
,	O
TIFF	O
,	O
or	O
JPEG	O
images	O
;	O
these	O
models	O
are	O
active	O
only	O
when	O
the	O
particular	O
file	O
type	O
is	O
detected	O
.	O
</s>
<s>
All	O
PAQ	B-Application
versions	O
predict	O
and	O
compress	O
one	O
bit	O
at	O
a	O
time	O
,	O
but	O
differ	O
in	O
the	O
details	O
of	O
the	O
models	O
and	O
how	O
the	O
predictions	O
are	O
combined	O
and	O
postprocessed	O
.	O
</s>
<s>
Once	O
the	O
next-bit	O
probability	O
is	O
determined	O
,	O
it	O
is	O
encoded	O
by	O
arithmetic	B-Algorithm
coding	I-Algorithm
.	O
</s>
<s>
In	O
PAQ4	O
through	O
PAQ6	B-Application
,	O
the	O
predictions	O
are	O
combined	O
as	O
before	O
,	O
but	O
the	O
weights	O
assigned	O
to	O
each	O
model	O
are	O
adjusted	O
to	O
favor	O
the	O
more	O
accurate	O
models	O
.	O
</s>
<s>
The	O
probabilities	O
are	O
combined	O
using	O
an	O
artificial	B-Architecture
neural	I-Architecture
network	I-Architecture
.	O
</s>
<s>
A	O
string	O
s	O
is	O
compressed	O
to	O
the	O
shortest	O
byte	B-Application
string	O
representing	O
a	O
base-256	O
big-endian	O
number	O
x	O
in	O
the	O
range	O
[	O
0	O
,	O
1 ]	O
such	O
that	O
P( r	O
<	O
s	O
)	O
≤	O
x	O
<	O
P( r	O
≤	O
s	O
)	O
,	O
where	O
P( r	O
<	O
s	O
)	O
is	O
the	O
probability	O
that	O
a	O
random	O
string	O
r	O
with	O
the	O
same	O
length	O
as	O
s	O
will	O
be	O
lexicographically	O
less	O
than	O
s	O
.	O
It	O
is	O
always	O
possible	O
to	O
find	O
an	O
x	O
such	O
that	O
the	O
length	O
of	O
x	O
is	O
at	O
most	O
one	O
byte	B-Application
longer	O
than	O
the	O
Shannon	O
limit	O
,	O
−log2P( r	O
=	O
s	O
)	O
bits	O
.	O
</s>
<s>
The	O
arithmetic	B-Algorithm
coder	I-Algorithm
in	O
PAQ	B-Application
is	O
implemented	O
by	O
maintaining	O
for	O
each	O
prediction	O
a	O
lower	O
and	O
upper	O
bound	O
on	O
x	O
,	O
initially	O
[	O
0	O
,	O
1 ]	O
.	O
</s>
<s>
In	O
PAQ	B-Application
,	O
the	O
lower	O
and	O
upper	O
bounds	O
of	O
the	O
range	O
are	O
represented	O
in	O
3	O
parts	O
.	O
</s>
<s>
The	O
most	O
significant	O
base-256	O
digits	O
are	O
identical	O
,	O
so	O
they	O
can	O
be	O
written	O
as	O
the	O
leading	O
bytes	B-Application
of	O
x	O
.	O
</s>
<s>
The	O
next	O
4	O
bytes	B-Application
are	O
kept	O
in	O
memory	O
,	O
such	O
that	O
the	O
leading	O
byte	B-Application
is	O
different	O
.	O
</s>
<s>
Compression	O
is	O
terminated	O
by	O
writing	O
one	O
more	O
byte	B-Application
from	O
the	O
lower	O
bound	O
.	O
</s>
<s>
In	O
PAQ	B-Application
versions	O
through	O
PAQ6	B-Application
,	O
each	O
model	O
maps	O
a	O
set	O
of	O
distinct	O
contexts	O
to	O
a	O
pair	O
of	O
counts	O
,	O
,	O
a	O
count	O
of	O
zero	O
bits	O
,	O
and	O
,	O
a	O
count	O
of	O
1	O
bits	O
.	O
</s>
<s>
where	O
η	O
is	O
the	O
learning	B-General_Concept
rate	I-General_Concept
(	O
typically	O
0.002	O
to	O
0.01	O
)	O
,	O
y	O
is	O
the	O
predicted	O
bit	O
,	O
and	O
(	O
y	O
−	O
P(1 )	O
)	O
is	O
the	O
prediction	O
error	O
.	O
</s>
<s>
The	O
weight	O
update	O
algorithm	O
differs	O
from	O
backpropagation	B-Algorithm
in	O
that	O
the	O
terms	O
P(1 )	O
P(0 )	O
are	O
dropped	O
.	O
</s>
<s>
This	O
is	O
because	O
the	O
goal	O
of	O
the	O
neural	B-Architecture
network	I-Architecture
is	O
to	O
minimize	O
coding	O
cost	O
,	O
not	O
root	B-General_Concept
mean	I-General_Concept
square	I-General_Concept
error	O
.	O
</s>
<s>
Most	O
versions	O
of	O
PAQ	B-Application
use	O
a	O
small	O
context	O
to	O
select	O
among	O
sets	O
of	O
weights	O
for	O
the	O
neural	B-Architecture
network	I-Architecture
.	O
</s>
<s>
In	O
versions	O
through	O
PAQ6	B-Application
,	O
the	O
state	O
represents	O
a	O
pair	O
of	O
counters	O
(	O
n0	O
,	O
n1	O
)	O
.	O
</s>
<s>
In	O
all	O
PAQ8	B-Application
versions	O
,	O
the	O
representable	O
states	O
are	O
as	O
follows	O
:	O
</s>
<s>
Most	O
context	O
models	O
are	O
implemented	O
as	O
hash	B-Algorithm
tables	I-Algorithm
.	O
</s>
<s>
Some	O
small	O
contexts	O
are	O
implemented	O
as	O
direct	O
lookup	B-Data_Structure
tables	I-Data_Structure
.	O
</s>
<s>
Some	O
versions	O
of	O
PAQ	B-Application
,	O
in	O
particular	O
PAsQDa	O
,	O
PAQAR	O
(	O
both	O
PAQ6	B-Application
derivatives	O
)	O
,	O
and	O
PAQ8HP1	O
through	O
PAQ8HP8	O
(	O
PAQ8	B-Application
derivatives	O
and	O
Hutter	O
prize	O
recipients	O
)	O
preprocess	O
text	O
files	O
by	O
looking	O
up	O
words	O
in	O
an	O
external	O
dictionary	O
and	O
replacing	O
them	O
with	O
1	O
-	O
to	O
3-byte	O
codes	O
.	O
</s>
<s>
The	O
following	O
table	O
is	O
a	O
sample	O
from	O
the	O
by	O
Matt	O
Mahoney	O
that	O
consists	O
of	O
a	O
file	O
consisting	O
of	O
109	O
bytes	B-Application
(	O
1GB	O
,	O
or	O
0.931GiB	O
)	O
of	O
English	O
Wikipedia	O
text	O
.	O
</s>
<s>
See	O
Lossless	B-Algorithm
compression	I-Algorithm
benchmarks	O
for	O
a	O
list	O
of	O
file	O
compression	O
benchmarks	O
.	O
</s>
<s>
The	O
following	O
lists	O
the	O
major	O
enhancements	O
to	O
the	O
PAQ	B-Application
algorithm	O
.	O
</s>
<s>
PAQ5	O
(	O
December	O
18	O
,	O
2003	O
)	O
and	O
PAQ6	B-Application
(	O
December	O
30	O
,	O
2003	O
)	O
were	O
minor	O
improvements	O
,	O
including	O
a	O
new	O
analog	O
model	O
.	O
</s>
<s>
At	O
this	O
point	O
,	O
PAQ	B-Application
was	O
competitive	O
with	O
the	O
best	O
PPM	O
compressors	O
and	O
attracted	O
the	O
attention	O
of	O
the	O
data	O
compression	O
community	O
,	O
which	O
resulted	O
in	O
a	O
large	O
number	O
of	O
incremental	O
improvements	O
through	O
April	O
2004	O
.	O
</s>
<s>
David	O
A	O
.	O
Scott	O
made	O
improvements	O
to	O
the	O
arithmetic	B-Algorithm
coder	I-Algorithm
.	O
</s>
<s>
PAQAR	O
stood	O
as	O
the	O
top-ranked	O
compressor	O
through	O
the	O
end	O
of	O
2004	O
but	O
was	O
significantly	O
slower	O
than	O
prior	O
PAQ	B-Application
versions	O
.	O
</s>
<s>
During	O
the	O
period	O
January	O
18	O
,	O
2005	O
through	O
February	O
7	O
,	O
2005	O
,	O
Przemyslaw	O
Skibinski	O
released	O
four	O
versions	O
of	O
PASqDa	O
,	O
based	O
on	O
PAQ6	B-Application
and	O
PAQAR	O
with	O
the	O
addition	O
of	O
an	O
English	O
dictionary	O
preprocessor	O
.	O
</s>
<s>
A	O
modified	O
version	O
of	O
PAQ6	B-Application
won	O
the	O
Calgary	B-General_Concept
Challenge	I-General_Concept
on	O
January	O
10	O
,	O
2004	O
by	O
Matt	O
Mahoney	O
.	O
</s>
<s>
The	O
most	O
recent	O
was	O
submitted	O
on	O
June	O
5	O
,	O
2006	O
,	O
consisting	O
of	O
compressed	O
data	O
and	O
program	O
source	O
code	O
totaling	O
589,862	O
bytes	B-Application
.	O
</s>
<s>
PAQ7	O
is	O
a	O
complete	O
rewrite	O
of	O
PAQ6	B-Application
and	O
variants	O
(	O
PAQAR	O
,	O
PAsQDa	O
)	O
.	O
</s>
<s>
However	O
it	O
lacked	O
x86	B-Operating_System
and	O
a	O
dictionary	O
,	O
so	O
it	O
did	O
not	O
compress	O
Windows	B-Application
executables	O
and	O
English	O
text	O
files	O
as	O
well	O
as	O
PAsQDa	O
.	O
</s>
<s>
It	O
does	O
include	O
models	O
for	O
color	O
BMP	B-Device
,	O
TIFF	O
and	O
JPEG	O
files	O
,	O
so	O
compresses	O
these	O
files	O
better	O
.	O
</s>
<s>
The	O
primary	O
difference	O
from	O
PAQ6	B-Application
is	O
it	O
uses	O
a	O
neural	B-Architecture
network	I-Architecture
to	O
combine	O
models	O
rather	O
than	O
a	O
gradient	O
descent	O
mixer	O
.	O
</s>
<s>
These	O
were	O
experimental	O
pre-release	O
of	O
anticipated	O
PAQ8	B-Application
.	O
</s>
<s>
PAQ8A	O
also	O
included	O
model	O
for	O
compressing	O
(	O
x86	B-Operating_System
)	O
executables	O
.	O
</s>
<s>
PAQ8F	O
had	O
3	O
improvements	O
over	O
PAQ8A	O
:	O
a	O
more	O
memory	O
efficient	O
context	O
model	O
,	O
a	O
new	O
indirect	O
context	O
model	O
to	O
improve	O
compression	O
,	O
and	O
a	O
new	O
user	O
interface	O
to	O
support	O
drag	O
and	O
drop	O
in	O
Windows	B-Application
.	O
</s>
<s>
This	O
version	O
has	O
since	O
been	O
ported	O
to	O
32	O
bit	O
Windows	B-Application
for	O
several	O
processors	O
,	O
and	O
32	O
and	O
64	O
bit	O
Linux	B-Application
.	O
</s>
<s>
It	O
is	O
based	O
on	O
PAQ8JD	O
and	O
adds	O
a	O
DMC	B-Algorithm
model	O
.	O
</s>
<s>
Contains	O
improved	O
BMP	B-Device
and	O
JPEG	O
models	O
over	O
PAQ8L	O
.	O
</s>
<s>
Can	O
be	O
optionally	O
compiled	O
with	O
SSE2	B-General_Concept
support	O
and	O
for	O
64-bit	O
Linux	B-Application
.	O
</s>
<s>
PAQ8P	B-Application
was	O
released	O
on	O
August	O
25	O
,	O
2008	O
by	O
Andreas	O
Morphis	O
.	O
</s>
<s>
Contains	O
improved	O
BMP	B-Device
model	O
and	O
adds	O
a	O
WAV	O
model	O
.	O
</s>
<s>
PAQ8PF	O
was	O
released	O
on	O
September	O
9	O
,	O
2009	O
by	O
LovePimple	O
without	O
source	O
code	O
(	O
which	O
the	O
GPL	B-License
license	I-License
requires	O
)	O
.	O
</s>
<s>
ZPAQ	B-Application
was	O
released	O
on	O
March	O
12	O
,	O
2009	O
by	O
Matt	O
Mahoney	O
.	O
</s>
<s>
It	O
uses	O
a	O
new	O
archive	O
format	O
designed	O
so	O
that	O
the	O
current	O
ZPAQ	B-Application
program	O
will	O
be	O
able	O
to	O
decompress	O
archives	O
created	O
by	O
future	O
ZPAQ	B-Application
versions	O
(	O
the	O
various	O
PAQ	B-Application
variants	O
listed	O
above	O
are	O
not	O
forward	O
compatible	O
in	O
this	O
fashion	O
)	O
.	O
</s>
<s>
On	O
October	O
27	O
,	O
2006	O
,	O
it	O
was	O
announced	O
that	O
PAQ8HP5	O
won	O
a	O
Hutter	O
Prize	O
for	O
Lossless	B-Algorithm
Compression	I-Algorithm
of	O
Human	O
Knowledge	O
of	O
€	O
3,416	O
.	O
</s>
<s>
Being	O
free	B-Application
software	I-Application
,	O
PAQ	B-Application
can	O
be	O
modified	O
and	O
redistributed	O
by	O
anyone	O
who	O
has	O
a	O
copy	O
.	O
</s>
<s>
This	O
has	O
allowed	O
other	O
authors	O
to	O
fork	B-Application
the	O
PAQ	B-Application
compression	O
engine	O
and	O
add	O
new	O
features	O
such	O
as	O
a	O
graphical	B-Application
user	I-Application
interface	I-Application
or	O
better	O
speed	O
(	O
at	O
the	O
expense	O
of	O
compression	O
ratio	O
)	O
.	O
</s>
<s>
Notable	O
PAQ	B-Application
derivatives	O
include	O
:	O
</s>
<s>
KGB	B-Language
,	O
based	O
on	O
PAQ6	B-Application
(	O
beta	O
version	O
is	O
based	O
on	O
PAQ7	O
)	O
.	O
</s>
<s>
PWCM	O
(	O
PAQ	B-Application
weighted	O
context	B-General_Concept
mixing	I-General_Concept
)	O
is	O
an	O
independently	O
developed	O
closed	O
source	O
implementation	O
of	O
the	O
PAQ	B-Application
algorithm	O
used	O
in	O
WinRK	O
.	O
</s>
<s>
PAQCompress	O
is	O
a	O
graphical	B-Application
user	I-Application
interface	I-Application
for	O
several	O
newer	O
PAQ	B-Application
versions	O
,	O
including	O
the	O
latest	O
releases	O
of	O
PAQ8PX	O
,	O
PAQ8PXD	O
and	O
PAQ8PXV	O
.	O
</s>
<s>
The	O
software	O
intelligently	O
appends	O
an	O
extension	O
to	O
the	O
filename	O
which	O
it	O
can	O
use	O
to	O
decompress	O
the	O
file	O
using	O
the	O
correct	O
PAQ	B-Application
Version	O
.	O
</s>
<s>
In	O
addition	O
,	O
PerfectCompress	O
can	O
compress	O
files	O
to	O
PAQ8PX	O
v42	O
to	O
v67	O
,	O
and	O
ZPAQ	B-Application
,	O
and	O
as	O
of	O
version	O
6.0	O
,	O
can	O
compress	O
files	O
to	O
LPAQ	O
and	O
PAQ8PF	O
beta	O
1	O
to	O
beta	O
3	O
.	O
</s>
<s>
FrontPAQ	O
,	O
small	O
gui	B-Application
for	O
PAQ	B-Application
.	O
</s>
<s>
The	O
software	O
is	O
no	O
longer	O
updated	O
and	O
users	O
are	O
encouraged	O
to	O
use	O
PAQCompress	O
,	O
which	O
implements	O
the	O
latest	O
PAQ	B-Application
releases	O
.	O
</s>
