Chip Foundry Services Request Assessment

Hyena

Hyena is a subquadratic attention replacement that combines long convolutions (computed via FFT) with element-wise data-dependent gating — achieving $O(n \log n)$ complexity instead of attention's $O(n^2)$ while maintaining the data-dependent processing crucial for language understanding, matching transformer quality on language modeling at 1-2B parameter scale with $100\times $ speedup on $64K-token$ contexts, representing a fundamentally different architectural path beyond the attention mechanism.

What Is Hyena?

  • Definition: A sequence modeling operator (Poli et al., 2023) that replaces the attention mechanism with a composition of long implicit convolutions (parameterized by small neural networks, computed via FFT) and element-wise multiplicative gating that conditions processing on the input data — achieving the "data-dependent" property of attention without the quadratic cost.
  • The Motivation: Attention is $O(n^2)$ in sequence length, and all efficient attention variants (FlashAttention, sparse attention, linear attention) are either still quadratic in FLOPs, approximate, or lose quality. Hyena asks: can we build a fundamentally subquadratic operator that matches attention quality?
  • The Answer: Long convolutions provide global receptive fields in $O(n \log n)$ via FFT, and data-dependent gating provides the input-conditional processing that makes attention so powerful. The combination achieves both.

The Hyena Operator

ComponentFunctionAnalogy to Attention
Implicit Convolution FiltersParameterize convolution kernels with small neural networks, apply via FFTLike the attention pattern (which tokens interact)
Data-Dependent GatingElement-wise multiplication gated by the inputLike attention weights being conditioned on $Q$ and $K$
FFT ComputationConvolution in frequency domain: $O(n \log n)$Replaces the $O(n^2) \mathrm{QK}^T$ attention matrix

Hyena computation: $h = (v \odot filter_1(x)) \odot (x \odot filter_2(x))$

Where $\odot \text{is} \text{element-wise}$ multiplication and filters are implicitly parameterized.

Complexity Comparison

OperatorComplexityData-Dependent?Global Receptive Field?Exact?
Full Attention$O(n^2)$Yes $(\mathrm{QK}^T)$YesYes
FlashAttention$O(n^2) \mathrm{FLOP}s, O(n)$ memoryYesYesYes
Linear Attention$O(n)$ApproximateYes (kernel approx)No
Hyena$O(n \log n)$Yes (gating)Yes (FFT convolution)$N/A$ (different operator)
S4/Mamba$O(n)$ or $O(n \log n)$Yes (selective)Yes $(\mathrm{SSM})$$N/A$ (different operator)
Local Attention$O(n \times w)$YesNo (window only)Yes (within window)

Benchmark Results

BenchmarkTransformer (baseline)HyenaNotes
WikiText-103 (perplexity)18.7 (GPT-2 scale)18.9Within 1% quality
The Pile (perplexity)ComparableComparable at 1-2B scaleMatches at moderate scale
Long-range ArenaBaselineCompetitiveSynthetic long-range benchmarks
Speed ($64K$ context)$1\times $ (with FlashAttention)$\sim 100\times $ fasterDominant advantage at long contexts

Hyena vs Related Subquadratic Architectures

ModelCore MechanismComplexityMaturity
HyenaImplicit convolution + gating$O(n \log n)$Research (2023)
Mamba (S6)Selective State Space Model + hardware-aware scan$O(n)$Production-ready (2024)
RWKVLinear attention + recurrence$O(n)$Open-source, active community
RetNetRetention mechanism ($\parallel +$ recurrent)$O(n)$Research (Microsoft)

Hyena represents a fundamentally new approach to sequence modeling beyond attention — replacing the $O(n^2)$ attention matrix with $O(n \log n) \text{FFT-based}$ implicit convolutions and data-dependent gating, matching transformer quality at moderate scale while delivering $100\times $ speedups on long contexts, demonstrating that the attention mechanism may not be the only path to high-quality language understanding and opening the door to sub-quadratic foundation models.