← all repositories

lucidrains/rotary-embedding-torch

A standalone PyTorch library implementing rotary positional embeddings from the Roformer paper for transformer architectures.

812 stars Python Language ModelsML Frameworks
rotary-embedding-torch
Velocity · 7d
+0.5
★ / day
Trend
steady
star history

This library provides an efficient implementation of rotary embeddings (RoPE), a technique that rotates information into tensor axes to encode relative positional information in transformers. It integrates into attention mechanisms by rotating queries and keys prior to the dot-product attention operation. The approach improves upon traditional positional encodings by enabling seamless generalization to sequence lengths not seen during training.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.