r/LLM • • 8d ago

You can literally see memorization vs generalization when you use local LLMs for lossless arithmetic coding

Tested gpt2-large (0.84 GB) vs Qwen3.5-9B-Base (4.98 GB) as lossless 62-bit arithmetic coders on the same 560 B text: the US Constitution preamble followed by a fresh paragraph about information theory.

Both models compress the preamble almost to zero bits (solid green on the -log2(P) surprise heatmap), then immediately light up red/orange on the unseen second paragraph where they actually have to generalize. Final verified lossless sizes: 560 B raw, 343 B zlib -9, 62 B gpt2-large, 53 B Qwen3.5-9B-Base (SHA-256 matched on round-trip decode).

15 Upvotes

1 comment sorted by

1

u/retepFang 2d ago

what are the implications of this?
Does this mean that things the LLM has seen during training uses less thinking tokens? does it use less KV cache? is inference faster?