HazyResearch / safari

Convolutions for Sequence Modeling
Apache License 2.0
848 stars 70 forks source link

Relative positional encodings with Hyena #25

Open fransilvionGenomica opened 1 year ago

fransilvionGenomica commented 1 year ago

Hello,

Is there a way to implement relative positional encodings with Hyena similar to what was done in the Transformer-XL paper? Any tips on how to implement that?

Zymrael commented 1 year ago

Are you interested in trying relative encodings for the implicit long convolution filter (HyenaFilter) or a more traditional implementation of encodings that would work at the HyenaOperator level? In our experience, the latter does not appear to affect performance much, since Hyena is not permutation equivariant.

We recevied requests for a version with KERPLE positional embeddings, so that might be something to consider.

fransilvionGenomica commented 1 year ago

Hi,

I was thinking more of the former (relative encodings for the implicit long conv filter), have you tried that?