The cache can be backed by hardware/lookup, or by a cheap computation. The line between functions and data is really blurry.
Speculative KV coding: losslessly compressing KV cache by up to ~4×
11–20 of 50 posts
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#12The problem with this approach is that even recomputing a "draft" of the KV cache is still quadratic in context length. Maybe you can get some constant savings by always recomputing the earliest tokens, but it's not a good tradeoff as context sizes grow.
Sure, but any classical attention mechanism is quadratic in context length.
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#13Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#14Note that any cache (eg LRU-eviction) is just a specific speculative model for future usage :-) The cache can be backed by hardware/lookup, or by a cheap computation. The line between functions and data is really blurry.
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#15There is no compression taking place here.
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#16You can use the original model to compress the kv cache and get ∞x compression, since the prediction is perfect. The cost is time, and I don't see how this could be worth it.
The tradeoff gets better the bigger your primary model, and probably with bigger batch sizes. The KV cache can consume a lot of expensive VRAM, and the VRAM and compute costs of the predictor model become a small fraction of the cost of the primary model For serving a 1T model with 16 concurrent requests this could make a lot of sense. For a 8B model with a single request far less so
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#17Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#18The problem with this approach is that even recomputing a "draft" of the KV cache is still quadratic in context length. Maybe you can get some constant savings by always recomputing the earliest tokens, but it's not a good tradeoff as context sizes grow.
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#19If “speculative” approach works so well in different contexts why not make it first class and use everywhere, possibly recursively?
Speculation is only worth it if you can profit from it. Not every context allows this or has a similar idea of what can be speculated.
MoE is more hardcoded, pre determined, speculation is much more dynamic, malleable after training.
This paper actually proposes direction of aligning architecture to aid speculation as future work.
Re: Speculative KV coding: losslessly compressing KV cache by up to ~4×
#20There is no compression taking place here.