What Hyena is
Hyena (Poli et al., 2023) replaces attention with two operations that both scale almost linearly with length: long convolutions, whose filters span the whole sequence, and elementwise gates computed from the input. The convolution mixes tokens with fixed weights; the gates make the mixing depend on the data. The paper reports Transformer quality in language modelling with 20 % less training compute at sequence length 2K, and operators twice as fast as optimised attention at 8K and 100 times faster at 64K.
HyenaDNA (Nguyen et al., 2023) applies Hyena to DNA, one token per base, with contexts of up to a million bases. The page records its smallest model, HyenaDNA-tiny with a 1k context: 2 layers of 128 channels. On the HBB coding sequence the recorder measured a next-base loss of 1.327 nats, against 1.386 for guessing uniformly among the four bases.
The operator
A projection of the input, followed by a short causal convolution of 3 taps, gives three streams per channel: two gates and and a value . The order-2 operator recorded here is
where is a causal convolution along the sequence with one long filter per channel and a learned skip. Higher orders repeat the pattern, gate then convolve, with more streams. An output projection follows. The x₁ · x₂ · v column shows the three streams for each base, and Filter · gates the filter and both gates of the chosen channel.
An implicit filter
A filter as long as the sequence would need one weight per lag per channel. Hyena instead generates it: a small network maps each lag to one value per channel, and a decay window shapes the result,
where encodes the lag with sines and cosines, the network uses sine activations (as in SIREN, Sitzmann et al., 2020), and each channel decays at its own rate . The number of parameters does not depend on length, and the filter exists at every lag the model supports: the plot in Filter · gates draws it at all 1,026, shading the 24 that the matrix uses. Parametrising a convolution kernel as a function of position comes from continuous-kernel convolutions such as CKConv (Romero et al., 2021).
The convolution as a matrix
On a sequence of tokens, the causal convolution plus skip is a lower-triangular Toeplitz matrix, constant along every diagonal:
The Filter H view draws one channel's for the 24-base prompt. It is the same for every input, as a convolution's must be. The model computes the product with a fast Fourier transform in rather than as a matrix; the recording checks that the two give the same numbers.
The With gates view folds the gates in: is what the operator applies to , and because the gates come from this sequence, the matrix changes with the input, the way attention weights do. The Hyena paper describes the operator in these terms, as a product of diagonal (gate) and Toeplitz (convolution) matrices.
DNA on this page
The three examples are 24 bases each: the start of the β-globin (HBB) coding sequence from NCBI RefSeq; the same with the single-base change behind sickle-cell anaemia, GAG to GTG, which turns glutamate 6 of the protein into valine; and four copies of the human telomere repeat TTAGGG. Because each base is one token, a one-letter change is one changed token, which models that group bases into fixed k-mers blur; that single-nucleotide resolution is HyenaDNA's argument for a long-context model that reads base by base. Between the HBB and sickle examples, the change at one base alters the gates there and, through the long filter, every later output.
Where it came from
S4 (2021) showed that long convolution kernels generated by a state-space model can model long sequences. H3 (2022) put gates around shift and state-space convolutions to recover associative recall, looking up a value by its key, which attention does easily and plain convolutions do not. Hyena kept the gates and replaced the state-space filters with implicit ones; HyenaDNA took it to genomes. Mamba (the Mamba tab) moved the dependence on the data into the state update itself; FNet (the FNet tab) mixes tokens with a fixed global transform computed by the same FFT; and the Conformer tab shows a short, fixed depthwise convolution beside attention.
Papers
- Hyena Hierarchy: Towards Larger Convolutional Language Models The Hyena operator: implicit long convolutions interleaved with data-controlled gates.
- HyenaDNA: Long-Range Genomic Sequence Modeling at Single Nucleotide Resolution Hyena on DNA with one token per base, the model family recorded here.
- Hungry Hungry Hippos: Towards Language Modeling with State Space Models H3: gates around state-space convolutions, the design Hyena generalises.
- CKConv: Continuous Kernel Convolution For Sequential Data Convolution kernels generated by a small network from the position, the idea behind Hyena's implicit filter.
- Implicit Neural Representations with Periodic Activation Functions SIREN: networks with sine activations, used by Hyena's filter network.
- Efficiently Modeling Long Sequences with Structured State Spaces S4: long convolution kernels from a state-space model, Hyena's starting point.