Skip to content
IJK

Gemma 2 Sliding Window Attention on Every Other Layer

By IJK ·

What a Hugging Face post says sliding window attention is and what is novel about how Gemma 2 applies it.

What sliding window attention is

Sliding window attention is a method to reduce the memory and time requirements of the attention computations in transformer models and has been used in models such as Mistral. [1]

What is novel in Gemma 2

The novelty of Gemma 2 is that a sliding window is applied to every other layer (local - 4096 tokens), while the layers in between still use full quadratic global attention (8192 tokens). [2]

applied toalternates withSliding window attentionreduces the memory and time requirements of atten...Every other layera sliding window of 4096 tokensLayers in betweenfull quadratic global attention of 8192 tokens
How does Gemma 2 alternate?

Sources

  1. The Hugging Face source says: Sliding window attention is a method to reduce the memory and time requirements of the attention computations in transformer models and has been used in models such as Mistral. Welcome Gemma 2 - Google's new open LLM
  2. The Hugging Face source says: The novelty of Gemma 2 is that a sliding window is applied to every other layer (local - 4096 tokens), while the layers in between still use full quadratic global attention (8192 tokens). Welcome Gemma 2 - Google's new open LLM

Editorial (AI-assisted; automatically checked, not human-reviewed). Each statement is linked to its source; check the source before relying on a detail.

  • gemma 2
  • attention
  • llm
  • hugging face