Gemma 4 models leverage a hybrid attention mechanism, strategically interleaving local Sliding Window Attention with full global attention layers. This design, combined with innovations like KV cache sharing and Proportional RoPE (p-RoPE), significantly optimizes memory usage—reducing the global KV cache footprint by up to 37.5% in some models. This efficiency allows Gemma to support massive context windows (up to 256K tokens for larger variants) and enhances the effectiveness of Q4 quantization for high-throughput, on-device inference.