atlas

Research map / Architectures and efficiency / Attention and transformers

QT-ViT: Improving Linear Attention in ViT with Quadratic Taylor Expansion

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head and block redesign · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes QT-ViT, a linear attention for ViTs that replaces softmax with a second-order Taylor expansion decomposed via Kronecker products and reduced to O(Nd^2) with a compact self-multiplication approximation, trained from scratch on ImageNet-1k without distillation.

Problem

Softmax self-attention in ViTs has quadratic time and memory cost in the number of patches, while existing linear attention variants lose accuracy, and the prior fixes (knowledge distillation, high-order residuals) raise training memory.

Approach

Approximate exp(qk/sqrt(d)) with a second-order Taylor expansion, decompose the quadratic term into a kernel dot product via Kronecker products, and keep only the self-multiplication terms x_i^2 (plus constant) so the feature map has length 2d+1, giving linear attention without distillation or masked softmax residuals.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace the EfficientViT attention kernel with the quadratic Taylor expansion kernelQT-ViT · ImageNet-1kTop-1 accuracy (%): 79.4 -> 79.6Helped
Replace the EfficientViT attention kernel with the quadratic Taylor expansion kernelQT-ViT · COCO 2017AP: 39.1 -> 39.3Helped
Replace the EfficientViT attention kernel with the quadratic Taylor expansion kernelQT-ViT · ADE20KmIoU: 32.8 -> 33.2Helped
Use the quadratic Taylor kernel instead of the first-order Taylor kernel (ablation)QT-ViT · ImageNet-1kTop-1 accuracy (%): 78.5 -> 79.6Helped
Use the compact Kronecker product with self-multiplication terms instead of randomly selected quadratic terms (ablation)QT-ViT-1 · ImageNet-1kTop-1 accuracy (%): 61.8 -> 79.6Helped
Reduce the input dimension with pooling, p=2 (ablation)QT-ViT-1 · ImageNet-1kTop-1 accuracy (%): 79.7 -> 79.3Hurt
Split the input into c=2 chunks (ablation)QT-ViT-1 · ImageNet-1kTop-1 accuracy (%): 79.7 -> 79.4Hurt
Add absolute positional embedding (ablation)QT-ViT · COCO 2017AP: 39.2 -> 39.3; 41.0 -> 41.1; 42.5 -> 42.6Helped
Use original softmax attention output during training (ablation)QT-ViT-1 · ImageNet-1kTop-1 accuracy (%): 79.6 -> 79.8Helped
Use original softmax attention output during training (ablation)QT-ViT-1 · ImageNet-1kGPU memory required per GPU during training (GB): 13.9 -> 15.8 (+13.7%)Hurt

Surprising findings

Limitations

Experimental setup

Datasets: ImageNet-1k COCO 2017 ADE20K

Benchmarks: ImageNet-1k COCO 2017 ADE20K

Metrics: top-1 accuracy top-5 accuracy FLOPs parameters latency AP mIoU

Baselines: EfficientViT ViTALiTy Castling-ViT FLatten Transformer Hydra Attention Swin SwinV2 FasterViT ConvNeXt CSWin EfficientNet CMT

Builds on: EfficientViT ViTALiTy Linear Transformer Castling-ViT Flatten Transformer

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy