Papers
Topics
Authors
Recent
Search
2000 character limit reached

Griffin (RG-LRU) Hybrid Language Model

Updated 13 April 2026
  • Griffin (RG-LRU) is a hybrid language model that combines Real-Gated Linear Recurrent Units with sliding-window local multi-query attention for efficient long-sequence processing.
  • It alternates RG-LRU and local attention blocks within a residual framework to achieve competitive performance with fewer training tokens and improved throughput.
  • Optimized for hardware efficiency, Griffin employs techniques like Megatron-style sharding and bfloat16 operations to deliver lower latency and up to 2× training throughput.

Griffin is a hybrid neural language modeling architecture integrating Real-Gated Linear Recurrent Units (RG-LRU) with sliding-window local multi-query attention. Designed for high hardware efficiency and superior long-sequence processing, Griffin achieves competitive or superior results compared to state-of-the-art Transformer models such as Llama-2, while requiring significantly fewer training tokens and delivering enhanced inference throughput and lower latency. The core innovation lies in the alternation of RG-LRU-based temporal-mixing blocks with local attention within a residual framework, enabling both effective sequence modeling and efficient scaling for large model deployments (De et al., 2024).

1. Architectural Layout and Temporal Mixing

Griffin consists of a stack of NN residual blocks configured in a pre-normalization sequence. Each residual block is composed of two sub-layers:

  • A temporal-mixing sub-layer for aggregating time-dependent information,
  • A feed-forward sub-layer implemented with a gated GeLU expansion and projection.

Both sub-layers utilize a structure of RMSNorm applied to the input, followed by the operator and a skip connection. Griffin alternates between two mechanisms for temporal mixing:

  • Recurrent blocks based on RG-LRU,
  • Local multi-query attention (MQA) blocks with a sliding window.

The canonical cycle is as follows:

Block Position Temporal-Mixing Component Sub-Layer Sequence
(a) RG-LRU RG-LRU → MLP
(b) RG-LRU RG-LRU → MLP
(c) Local MQA (window size ≈ 1024) MQA → MLP

This triadic pattern is repeated N/3\lfloor N/3 \rfloor times. Every temporal-mixing operator (RG-LRU or MQA) is immediately followed by RMSNorm, a gated MLP, and a residual connection.

2. Mathematical Formulation of the RG-LRU

The RG-LRU, or Real-Gated Linear Recurrent Unit, is a recurrent architecture supporting efficient sequence modeling with stable, trainable gating and parallelism over sequence position. For each timestep tt, given input xtRdx_t \in \mathbb{R}^d and hidden state htRdh_t \in \mathbb{R}^d:

  1. Recurrence gate: rt=σ(Waxt+ba)r_t = \sigma(W_a x_t + b_a)
  2. Input gate: it=σ(Wxxt+bx)i_t = \sigma(W_x x_t + b_x)
  3. Recurrence weight: a=σ(Λ),ΛRd,0a1a = \sigma(\Lambda),\quad \Lambda \in \mathbb{R}^d,\quad 0 \leq a \leq 1 (learned)
  4. Powered gate: at=acrt,c=8a_t = a^{c r_t},\quad c=8
  5. Update rule: ht=atht1+1at2(itxt)h_t = a_t \odot h_{t-1} + \sqrt{1 - a_t^2} \odot (i_t \odot x_t)
  6. Output: N/3\lfloor N/3 \rfloor0

Here, the gates N/3\lfloor N/3 \rfloor1 and N/3\lfloor N/3 \rfloor2 depend exclusively on N/3\lfloor N/3 \rfloor3, enabling parallel time computation. Recurrence weights N/3\lfloor N/3 \rfloor4 are sigmoid-constrained (a=σ(Λ)) for stability. In practice, N/3\lfloor N/3 \rfloor5 is computed in log-space for numerical stability using N/3\lfloor N/3 \rfloor6. Projection matrices N/3\lfloor N/3 \rfloor7 are often block-diagonal, supporting efficient sharding. This design allows interpolation between pure LRU-like recurrences and state preservation.

3. Residual Block Integration: RG-LRU and Local MQA

Within each residual block:

  • Input N/3\lfloor N/3 \rfloor8 undergoes RMSNorm.
  • If RG-LRU:
    • Linear₁ projects N/3\lfloor N/3 \rfloor9 to tt0,
    • Channel-wise separable Conv1D (width=4) produces tt1,
    • RG-LRU scan computes tt2,
    • Linear₂ with GeLU and element-wise multiplication: tt3, tt4,
    • Linear₃ projects tt5 to tt6.
  • If local attention:

The output is the sum of the input and tt8 (residual branch), followed by RMSNorm, a gated-MLP, and an additional residual connection. This structure is used in all RG-LRU and MQA blocks, preserving a uniform interface for distributed and efficient layer application.

4. Scaling, Sharding, and Hardware Efficiency

Griffin is engineered for scalable model and data parallelism:

  • Megatron-style tensor slicing with a single all-reduce per layer for MLPs and attention,
  • Attention heads sharded across devices,
  • RG-LRU weights (tt9, xtRdx_t \in \mathbb{R}^d0) block-diagonalized (e.g., 16 blocks per device), with separable Conv1D per channel, eliminating the need for inter-device communication in RG-LRU layers,
  • Optimizer states and model parameters are sharded with ZeRO,
  • Computations in bfloat16 for both parameters and activations.

On TPU-v3, a custom "Pallas" fused linear-scan kernel for RG-LRU maintains hidden states in fast local memory (VMEM) and batches memory accesses, resulting in a 3× speedup over JAX's scan and a 10–20% overall speedup for the Griffin and Hawk architectures. Associative prefix-sum scans and convolutions were empirically slower and did not decrease memory traffic.

For long sequences (xtRdx_t \in \mathbb{R}^d1k), Griffin's temporal-mixing complexity is xtRdx_t \in \mathbb{R}^d2, compared to the Transformer's xtRdx_t \in \mathbb{R}^d3. For xtRdx_t \in \mathbb{R}^d4k at 7B scale, Griffin's training throughput per step is up to 2× higher than MQA baselines. In decoder (generation) mode, Griffin requires only streaming of parameters and a small recurrent state (xtRdx_t \in \mathbb{R}^d5), while Transformers must stream parameters and the full xtRdx_t \in \mathbb{R}^d6 key-value cache. For xtRdx_t \in \mathbb{R}^d7k, xtRdx_t \in \mathbb{R}^d8, Griffin/Hawk achieves xtRdx_t \in \mathbb{R}^d9 lower latency and 2–3× higher throughput (tokens/sec per TPU-core).

5. Empirical Results and Sequence Extrapolation

Griffin’s empirical benchmarks demonstrate its efficacy across scale and context length:

  • Scaling curves: On MassiveText, from 100M to 14B parameters, Griffin outperforms MQA Transformer baselines by approximately 0.1 bits/token at every scale; through higher budgets, its performance approaches that of the pure Hawk (RG-LRU) model.
  • Downstream evaluation (on models trained 300B tokens):
    • Mamba-3B (600B tokens): 58.5
    • Llama-2-7B/13B (2T tokens): 65.3 / 69.3
    • Griffin-3B: 60.7
    • Griffin-7B: 65.8 (matches Llama-2-7B with 7× fewer tokens)
    • Griffin-14B: 69.5 (matches Llama-2-13B with ∼7× fewer tokens)
    • Hawk-3B surpasses Mamba-3B despite half the training tokens.
  • Long-context extrapolation: When evaluated on held-out Books and ArXiv after training with htRdh_t \in \mathbb{R}^d0, Transformer loss plateaus or degrades past 2k tokens, whereas Hawk and Griffin retain improvements up to 32k tokens. Training with htRdh_t \in \mathbb{R}^d1 further boosts Griffin's performance for htRdh_t \in \mathbb{R}^d2k (at the expense of very short contexts).
  • Copy and retrieval tasks: On synthetic "Selective Copy", Griffin matches Transformer learning speed, while Hawk is slower. In "Induction Heads" generalization (train htRdh_t \in \mathbb{R}^d3, test htRdh_t \in \mathbb{R}^d4), Griffin and Hawk extrapolate perfectly. For phonebook lookup, Griffin retrieves up to the local window (1024), gracefully degrading after, while Transformer and Hawk fail beyond their respective context limits (De et al., 2024).

Griffin’s hybrid approach interpolates between the sequential processing strengths of recurrent models and the global contextualization of attention mechanisms. Unlike pure Transformers, which are quadratic in sequence length for temporal-mixing, Griffin's htRdh_t \in \mathbb{R}^d5 complexity enables substantial benefits for long-context tasks and high-throughput inference. Unlike models relying exclusively on attention or recurrence, Griffin’s interleaving of RG-LRU and local attention is central to its capacity for extrapolation, token efficiency, and hardware-aligned deployment at scale.

A plausible implication is that Griffin offers a template for future efficient LLM designs targeting longer context windows, hardware efficiency, and scalable distributed training, while closing the performance gap with well-known large-scale Transformer baselines (De et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Griffin (RG-LRU).