LogosIntelligenceLab/SOFT

[NeurIPS 2021 Spotlight] & [IJCV 2024] SOFT: Softmax-free Transformer with Linear Complexity

What it solves

SOFT (Softmax-free Linear Transformer) addresses the computational inefficiency of standard Transformers. Traditional Transformers use a "softmax" operation in their attention mechanism, which becomes very slow and memory-intensive as the input size grows. SOFT removes this bottleneck to achieve linear complexity, making it faster and more efficient for processing large datasets.

How it works

SOFT replaces the traditional softmax-based attention with a normalized, softmax-free self-attention mechanism. By using a Gaussian kernel-based approach, it maintains high performance while significantly reducing the computational overhead. It provides both a standard PyTorch implementation and a highly optimized CUDA version for faster training and inference.

Who it’s for

This project is for researchers and developers working on computer vision tasks—such as image classification, object detection, and semantic segmentation—who need to deploy Transformer models that are more efficient than standard architectures.

Highlights

  • Linear computational complexity compared to standard quadratic Transformers.
  • Includes a normalized version (SOFT-Norm) for improved generalizability.
  • Supports advanced vision tasks including object detection (COCO) and semantic segmentation (ADE20K).
  • Offers both PyTorch and CUDA-accelerated implementations for flexible deployment.

Related

  • Project
  • Project
  • Project
  • Project