← all repositories

tatp22/linformer-pytorch

A PyTorch implementation of the Linformer transformer architecture that reduces self-attention complexity from O(n²) to O(n) using projected attention.

424 stars Python Language ModelsML Frameworks
linformer-pytorch
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

This repository provides a complete encoder-decoder transformer with linear-time attention, based on the Linformer paper. It implements the projected attention mechanism that compresses the key and value matrices to achieve linear complexity while maintaining model performance. The implementation includes a language model class for easy experimentation with very long sequences (1000+ tokens) on standard hardware.

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