← Open Source

Official PyTorch Implementation of Long-Short Transformer (NeurIPS 2021).

Python
Momentum
+0stars in 24 hours0.0%
228
Stars
37
Forks
2
Contributors
Created 2021-07-22 · Updated 2026-07-21 · #27654 today
Top developers
wpingnettma15
README

Long-Short Transformer (Transformer-LS)

This repository hosts the code and models for the paper:

Long-Short Transformer: Efficient Transformers for Language and Vision

Updates

Architecture

Long-short Transformer substitutes the full self attention of the original Transformer models with an efficient attention that considers both long-range and short-term correlations. Each query attends to tokens from the segment-wise sliding window to capture short-term correlations, and the dynamically projected features to capture long-range correlations. To align the norms of the original and projected feature vectors and improve the efficacy of the aggregation, we normalize the original and project feature vectors with two sets of Layer Normalizations.

Tasks

Nearby in the ranking

AI Rank for iPhone

Follow AI model rankings

Download on the App Store