Replace repeats with references: LZ77 points back into a sliding window, LZW builds a dictionary of strings as it reads. Both decoders need nothing but the output.
This interactive visualization needs JavaScript.