Why do dictionary-based compression algorithms adapt to the particular text being compressed?
Consider a simple telephone conversation: A person (message source) speaks into a telephone receiver (encoder), which converts the sound of the spoken word into an electrical signal. This electrical signal is then transmitted over telephone lines (channel) subject to interference (noise). When the signal reaches the telephone receiver (decoder) at the other end of the line it is converted back into vocal sounds. Finally, the recipient (message receiver) hears the original message.
Dictionary-based compression algorithms, such as the Lempel-Ziv algorithm, adapt to the specific text being compressed because they use the input data itself to build a dynamic model of the information.12
Unlike static models that rely on predefined probabilitiesâwhich may not accurately characterize specialized vocabulary or unique data structuresâadaptive models estimate the distribution of characters or strings based on what they have processed so far. By constructing a codebook from sequences encountered previously in the text, the algorithm can replace later occurrences of a string with shorter codes, such as pointers indicating where the sequence previously occurred and its length.23
This approach is highly effective because it allows the compression process to optimize its encoding based on the specific patterns, repetitions, and nonrandom nature of the particular file being processed. Furthermore, because both the compression and decompression programs follow the same rules for updating the dictionary, the model does not need to be transmitted separately, allowing for efficient, dynamic adaptation to the source material.12