How the KV Cache is managed
KV Cache management is optimized using Gemma 2’s sliding window interleaved attention. [1]
How layers interleave
Hyperparameters are tuned to interleave 5 local layers with 1 global layer (previously 1:1) and reduce the window size to 1024 tokens (down from 4096). [2]
What the savings cost
Crucially, memory savings are achieved without degrading perplexity. [3]
Sources
- The Hugging Face source says: KV Cache management is optimized using Gemma 2’s sliding window interleaved attention. Welcome Gemma 3
- The Hugging Face source says: Hyperparameters are tuned to interleave 5 local layers with 1 global layer (previously 1:1) and reduce the window size to 1024 tokens (down from 4096). Welcome Gemma 3
- The Hugging Face source says: Crucially, memory savings are achieved without degrading perplexity. Welcome Gemma 3