Skip to content

Lempel–Ziv Adaptive Dictionary Coding

A lossless coding family that reconstructs phrases from decoder-derived history through branch-specific references and extensions.

Version
v1 · 2026-10-17 · History
Domain-specific #
14212
Domain group
Applied Sciences & Engineering
Origin domain
Computer Science & Software Engineering
Subdomain
Lossless Compression → Computer Science & Software Engineering
Aliases
Lempel-Ziv adaptive dictionary coding, LZ77/LZ78 coding family

Core Idea

Lempel–Ziv adaptive dictionary coding is a family of lossless methods for representing an ordered sequence using references to an evolving history that the decoder can reconstruct. An encoder can encode a phrase by referring to earlier decoded material; the decoder follows the reference, produces the original symbols, and gains the same history for later references. The complete phrase need not already exist before the token: decoding may copy with overlap or add a new symbol to an earlier phrase.[1][2][3]

The original LZ77 branch refers to recent decoded output with an address and copy length. The original LZ78 branch builds indexed phrases and encodes an earlier phrase index plus a supplied extension symbol. Their stream forms and memories differ, but both let the decoder derive what comes next without transmitting a separate growing dictionary. In the 1978 construction, an exceptional final phrase may repeat or be cut short, and state can reset between blocks.[1][2]

How would you explain it like I'm…

Copy From Before

Imagine writing a long message, and when a part repeats, you just write 'copy the bit from back there' instead of writing it again. Your friend reads the message in order, so they already have the earlier part and can do the copying. That makes the message shorter, and your friend still gets every letter exactly right.

Pointing Back to Shrink Data

Lempel–Ziv Adaptive Dictionary Coding is a family of ways to squeeze data smaller without losing anything. The encoder reads the data in order. When it finds a piece it has seen before, it sends a short note pointing to that earlier part instead of the whole thing. The decoder rebuilds the data in the same order, so it already knows everything earlier and can follow the notes. One version, LZ77, says 'go back this far and copy this many symbols.' Another, LZ78, says 'take that earlier phrase and add this one new symbol.' The 'dictionary' never has to be sent separately, because the decoder builds it up as it goes.

History-Referencing Lossless Compression

Lempel–Ziv Adaptive Dictionary Coding is a family of lossless compressors that encode phrases as references into a history both sides can reconstruct. The encoder processes symbols sequentially and encodes a phrase by pointing into what has already been coded. The decoder, rebuilding the exact symbols, gains the same history for later references, so no separate dictionary is transmitted. In LZ77, a token gives a position in recent output and a copy length. In LZ78, the data is parsed into phrases, each an earlier phrase plus one new symbol. These are related but distinct methods, not one format. The 'dictionary' can be an explicit phrase table or simply the decoded output so far. It may also be reset between blocks, so it doesn't necessarily last forever.

 

Lempel–Ziv adaptive dictionary coding is a family of lossless sequential coders in which phrases are encoded by references into an evolving history that the decoder can derive for itself. The encoder processes symbols in order. The decoder exactly reconstructs the output and so obtains the same history for interpreting later tokens, meaning no growing dictionary need be transmitted. "Dictionary" covers both an explicit phrase table and the implicit history of decoded output. LZ77 references recent decoded output via an address and copy length, performing sequential backward copying. LZ78 incrementally parses the input into phrases, each identified as an earlier phrase plus an extension symbol, and its constructive code packs this into an integer rather than a fixed tuple format. The reconstructed phrase need not have existed beforehand. In the 1978 scheme a final phrase at a block boundary may repeat or be truncated, and state can be reset between blocks, so "online" means causal history within the coding unit, not a permanent dictionary. The two papers analyze performance under different models, so no single entropy-limit claim applies to the whole family.

Scope of Application

This family operates on discrete sequences for which exact recovery matters. DEFLATE is an LZ77-derived byte-stream format: it uses literal elements and backward length/distance references, with a separate Huffman representation layer. GIF image data uses the later LZW variation to code pixel color-table indices. GIF's code widths, clear codes, and packing are format rules rather than family-wide rules.[3][4][5]

The methods aim to exploit repeated material, but a short or poorly repetitive input can still expand. “Online” means symbols and phrases are processed in order within a coding unit; it does not mean every implementation keeps one dictionary forever. The original 1977 and 1978 papers prove results in different models, so their claims should not be merged into one blanket entropy promise.[1][2][5]

Clarity

To tell the branches apart, ask what a reference names. LZ77 points back into decoded output, so a copy may overlap bytes currently being written. LZ78 points to an earlier indexed phrase and adds a supplied symbol for an ordinary new phrase. LZW instead sends codes for known phrases and lets the decoder infer table extensions from code context. “Dictionary” describes their shared reliance on learned history; it does not mean that LZ77 has an LZ78-style table or GIF sends original LZ78 tokens.[3][2][5]

Manages Complexity

Four checks organize a codec: the ordered input, the history available to both sides, the reference form, and the decoder update after each phrase. This separates a broken phrase-copy or table-update rule from a format envelope such as DEFLATE's Huffman layer or GIF's code-width schedule. If a decoder's history diverges from the encoder's, later references can become wrong even if the first damaged output looks small.[1][3][4]

Abstract Reasoning

Trace one phrase through a candidate encoder and decoder. Identify the initial state and any reset boundary. Ask whether the decoder can interpret every reference from already derived state and the current token, then reproduce the exact symbols and matching next state. If the decoder needs a phrase that only the encoder knows, the Lempel–Ziv synchronization mechanism has failed.[1][2]

Knowledge Transfer

The same history-reference idea can operate on bytes or pixel indices, but concrete stream conventions must agree for interchange. A DEFLATE decoder must honor backward-copy and Huffman rules.[3] A GIF decoder must honor LZW table and code-width rules.[4] The broader paired encoder/code/decoder structure belongs to Encoding and Decoding. General reuse or compact representation alone does not make a method Lempel–Ziv coding.

Example

Suppose the last two DEFLATE output bytes are X,Y. The RFC permits a backward reference with distance two and length five to add X,Y,X,Y,X; copying one byte at a time makes newly produced bytes available during the same reference. Mapped back: bytes are the ordered input, decoded output is the evolving history, the distance/length pair is the reference, and sequential copying both reconstructs the bytes and updates history.[3]

In GIF, the ordered input is a series of pixel indices. The LZW compressor and expander build corresponding phrase tables while codes are read. Mapped back: those indices are the sequence, the tables are evolving history, phrase codes are references, and the expander reconstructs indices and matching table entries. The extension is inferred from code context rather than transmitted in the original LZ78 form.[4][5]

Relationships to Other Abstractions

Local relationship map for Lempel–Ziv Adaptive Dictionary CodingParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Lempel–Ziv AdaptiveDictionary CodingDOMAINPrime abstraction: Encoding And Decoding — is a kind ofEncodingAnd DecodingPRIME

Current abstraction Lempel–Ziv Adaptive Dictionary Coding Domain-specific

Parents (1) — outgoing typed relations

  • Lempel–Ziv Adaptive Dictionary Coding is a kind of Encoding And Decoding Prime

    Every Lempel–Ziv family coder pairs a scheme-using encoder with a synchronized decoder, adding causal phrase-history references as its differentia.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Lempel–Ziv Adaptive Dictionary Coding sits in a sparse region of the domain-specific corpus (94th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Formal Sequences & Language Structure (19 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

Not to Be Confused With

  • Compression in general: it includes methods without decoder-derived phrase references.
  • Huffman coding alone: it codes symbols but does not create LZ phrase references; DEFLATE combines the two layers.[3]
  • LZW alone: Welch describes a code-only phrase-table coder with decoder-inferred extensions.[5] That specific algorithm is narrower than the whole LZ77/LZ78 family.
  • A fixed dictionary: its entries are agreed before the input rather than learned from reconstructed history.

References

[1] Jacob Ziv and Abraham Lempel, “A Universal Algorithm for Sequential Data Compression,” IEEE Transactions on Information Theory 23, no. 3 (1977): 337–343, especially p. 337, https://doi.org/10.1109/TIT.1977.1055714. Original article copy consulted at https://pzs.dstu.dp.ua/ComputerGraphics/ic/bibl/ziv_lempel_1977.pdf. registry ↩a ↩b ↩c ↩d ↩e

[2] Jacob Ziv and Abraham Lempel, “Compression of Individual Sequences via Variable-Rate Coding,” IEEE Transactions on Information Theory 24, no. 5 (1978): 530–536, especially pp. 530, 532–533, https://doi.org/10.1109/TIT.1978.1055934. Original article copy consulted at https://cs.brynmawr.edu/Courses/cs380/fall2012/LZ_1978_variable-rate.pdf. registry ↩a ↩b ↩c ↩d ↩e

[3] L. Peter Deutsch, DEFLATE Compressed Data Format Specification version 1.3, RFC 1951 (1996), §§1.1, 2, 3.2.3, 3.2.5, https://www.rfc-editor.org/rfc/rfc1951. registry ↩a ↩b ↩c ↩d ↩e ↩f ↩g

[4] CompuServe Incorporated, Graphics Interchange Format, Version 89a (1990), §22 and Appendix F, https://www.w3.org/Graphics/GIF/spec-gif89a.txt. registry ↩a ↩b ↩c ↩d

[5] Terry A. Welch, “A Technique for High-Performance Data Compression,” Computer 17, no. 6 (1984): 8–19, especially pp. 11–12 and 16, https://doi.org/10.1109/MC.1984.1659158. Original article copy consulted at https://courses.cs.duke.edu/spring03/cps296.5/papers/welch_1984_technique_for.pdf. registry ↩a ↩b ↩c ↩d ↩e