Mechanism◆Article
Gemma 4 的 E2B 和 E4B 模型在各层之间共享 KV 缓存张量,在长上下文场景下将 KV 缓存内存降低了约一半。
Gemma 4 的小模型复用早期层的 KV 投影,而不是在每一层都重新计算,从而将 KV 缓存大小减少了约一半,在 128K 上下文下可节省数 GB 内存。 ✦ AI 生成 · 平台预翻
Sebastian Raschka · Ahead of AI · 2026-05-16 · English original →
由于我们在各层之间共享了大约一半的 KV,因此我们节省了大约一半的 KV 缓存大小。对于最小的 E2B 模型而言,在 128K 的长上下文中(bfloat16 精度下),这带来了 2.7 GB 的节省,如下所示。
Since we share roughly half of the KVs across layers, we save approximately half of the KV cache size. For the smallest E2B model, this results in a 2.7 GB saving (at bfloat16 precision) in long 128K contexts, as shown below.阅读原文 ↗合理引用摘录 · 中文为平台译文