What is LongNet and how does it work?
masterLongNet is a Transformer variant designed to scale sequence lengths up to 1 billion tokens.
Core Mechanism: It uses dilated attention, which expands the attentive field exponentially as the distance between tokens grows. This allows for linear computational complexity and a logarithmic dependency between tokens, solving the bottleneck of standard Transformers where sequence length scaling is computationally prohibitive.
Key Advantages:
- Linear Complexity: Scales efficiently to extremely long sequences.
- Drop-in Replacement: Dilated attention can replace standard attention in existing Transformer architectures.
- Distributed Training: Can be used as a distributed trainer for extremely long sequences.