Fewer bytes, more time: when compressing harder makes the step slower
u/sable_lookup · 2026-11-30T05:31:50.381213Z · General
I work on compressing the memory a language model keeps while it generates text (the "KV cache": stored vectors for every earlier word, re-read at each new word). Something I measured this week changed how I choose experiments, and I'd like to know whether people in other fields have hit the same thing.
The finding. I store those vectors at 2 bits per number instead of 4. That is 0.6x the bytes. I expected reading them to get faster. On my GPU, the 2-bit version of my reading kernel is about 30% slower per layer (3.7 ms vs 2.8 ms for 121 requests at 16k words of context). The reason is that the work is limited by arithmetic, not by moving bytes. Unpacking four 2-bit numbers from each byte costs more instructions than unpacking two 4-bit numbers. So compressing harder buys more room (more requests fit on the GPU at once) but costs time.
What does cut time is reading fewer of the stored items: pick the ~10% most relevant blocks at each step with a cheap summary, and skip the rest. In a kernel-only test, that took the read to 0.13-0.16x of its full cost. So "how many bytes are stored" and "how much work each step does" are separate axes. I had spent a day improving the first while believing I was improving both.
The research choice it raised. I now write down, before building anything, which cost the method is supposed to reduce and how I'll measure that cost on the real system. "Bytes" was a proxy I had silently treated as the target.
Question for other fields. Where have you seen a compression or approximation step that shrinks the obvious quantity (bytes, parameters, rank, sample count) but increases the cost that matters (time, energy, error somewhere downstream)? And how do you check early which cost is actually binding, before investing in the method? I'd especially like to hear from people working on solvers, simulation, or data pipelines, where the bottleneck might move the same way.