Hyena Hierarchy

The paper proposes a dense-attention-free sequence operator built from implicit long convolutions and data-controlled gating.

Metadata

FieldValue
PaperHyena Hierarchy: Towards Larger Convolutional Language Models
AuthorsMichael Poli, Stefano Massaroli, Eric Nguyen, Daniel Y. Fu, Tri Dao, Stephen Baccus, Yoshua Bengio, Stefano Ermon, Christopher Ré
Year2023
VenueICML 2023
arXiv2302.10866
PMLRProceedings page
PDFPMLR PDF
Statusfull note started

Question

Dense self-attention gives direct token-token interaction, but its sequence-length cost is quadratic:

Sparse, low-rank, and state-space alternatives often improve scaling but may lose some of the associative recall and reasoning behavior that makes attention useful. Hyena asks:

The proposed answer is:

Main Claim

Hyena is presented as a drop-in replacement for attention in large sequence models. Its key claim is not just lower asymptotic cost. The stronger claim is that a gated hierarchy of long convolutions can preserve enough expressivity for language modeling and long-range recall tasks:

while avoiding dense pairwise attention.

The architecture lesson is:

That places Hyena between S4, Mamba, and efficient-attention papers such as Longformer, BigBird, and Performer.

Architecture Contract

ItemContract
Inputtoken sequence activations
Target replacementdense self-attention operator
Core operatorimplicit long convolution interleaved with gating
Mixing rangelong context, potentially far beyond local CNN receptive fields
Cost goalsubquadratic in sequence length
Natural tasks in paperlong-range synthetic tasks and language modeling
Main comparisonattention, SSMs, sparse/low-rank/implicit sequence operators

The abstract sequence block can be read as:

The important distinction from a local CNN is that the convolution kernel is long and implicitly parameterized.

Long Convolution View

A causal 1D convolution over a sequence is:

If the kernel length is comparable to the context length, the operator can mix information over long ranges:

Explicitly learning and storing a separate kernel value for every offset can be costly and inflexible. Hyena uses an implicit filter:

where is a learned function over positions or offsets. This makes the long filter parameterized by a smaller network rather than by a raw length- vector.

Data-Controlled Gating

Long convolution alone is still mostly fixed by position. Attention is powerful because mixing weights depend on the input. Hyena adds input-dependent gates around the convolutional operator:

Here:

SymbolMeaning
value-like projected sequence
data-controlled gate
implicit long convolution filter
elementwise modulation

A simplified Hyena layer interleaves these pieces hierarchically:

The hierarchy gives multiple rounds of input-dependent modulation rather than one fixed convolution.

Relation to Attention

Self-attention computes a pairwise content-dependent matrix:

Hyena avoids materializing the attention matrix. Its interaction pattern is not pairwise attention; it is long convolution modulated by gates:

PropertyDense AttentionHyena
token mixingpairwise content-based weightslong convolution plus gating
cost driverattention matrix long convolution/filter implementation
context accessdirect token-token pathsglobal filter over sequence offsets
content dependencequery-key scoresdata-controlled gates
interpretability trapattention weights may be inspectedgates and filters are less direct

Relation to S4 and Mamba

S4 and other structured state-space models also use a convolution view:

Hyena differs by emphasizing implicitly parameterized filters and gating hierarchy rather than a state-space discretization as the core story.

ModelCore RouteContent Dependence
S4structured state-space kernelmostly fixed linear sequence transform
Hyenaimplicit long convolution plus gatingdata-controlled gates
Mambaselective state-space scaninput-dependent SSM parameters

This makes Hyena a useful bridge between long-convolution models and selective sequence models.

Why It Belongs in Architecture Papers

Hyena is not just an efficiency trick. It changes the candidate set for sequence backbones:

For architecture reading, it adds a distinct question:

That question matters for long documents, biological sequences, audio, genomics, and any setting where sequence length makes dense attention expensive.

Evidence to Read Carefully

The paper reports results on long-range recall/reasoning tasks and language modeling. The main evidence should be read through three gates:

EvidenceWhat To Check
long synthetic tasksdoes the operator retrieve information across very long contexts?
language modelingdoes dense-attention-free modeling approach Transformer quality?
speed claimssame sequence length, hardware, implementation maturity, and batch shape?
compute reductionwall-clock and training budget, not only asymptotic notation

The paper’s abstract reports Transformer-quality language modeling with reduced training compute at 2K context and faster operators at longer contexts. Treat those numbers as implementation- and setting-dependent, not universal constants.

Limits

  • Hyena is not attention; tasks requiring explicit pairwise retrieval may expose different failure modes.
  • Speedups depend on optimized kernels, sequence length, batch size, and hardware.
  • Synthetic long-range tasks are useful probes but do not fully predict downstream utility.
  • Later attention variants and SSMs change the comparison baseline.
  • The operator is harder to explain than a local convolution because gating and implicit filters interact.

What This Paper Teaches

Hyena makes sequence architecture comparison more precise:

When reading a new long-context model, ask:

  • Does it materialize pairwise token interactions?
  • Does it use fixed filters, learned implicit filters, or input-dependent filters?
  • Can it stream autoregressively?
  • Are length extrapolation and retrieval evaluated directly?
  • Are throughput, memory, and quality measured at the same context length?
  • Does the model rely on occasional dense attention layers?

Concepts