atlas

Research map / Architectures and efficiency / Attention and transformers

SEA: Sparse Linear Attention with Estimated Attention Mask

ICLR 2024 · Architectures and efficiency › Attention and transformers · approach: Linear attention approximations · 0 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 SEA, a test-time linear-complexity attention that estimates a compressed attention map with Performer plus a CNN decoder, builds a top-k sparse mask from it, and is trained by distilling the attention of a quadratic teacher transformer.

Problem

Quadratic cost of transformer self-attention on long sequences; existing linear/sparse attention methods cannot easily distill from a pretrained teacher's attention matrix, often need retraining from scratch, and lose interpretable full attention maps.

Approach

Estimate a compressed T x K attention matrix with kernel-based linear attention (Performer) and a CNN decoder, select grouped top-k entries, interpolate them into a sparse mask over the full T x T matrix, and run sparse attention; the compressed estimate is distilled directly from teacher attention.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use SEA instead of vanilla attention after positional-embedding interpolationOPT-125M · WikiText2, context length 4096, PPL. (after interp.)perplexity: 52.96 -> 43.96Helped
Use SEA instead of vanilla attention after trainingOPT-125M · WikiText2, context length 4096, PPL. (trained)perplexity: 18.96 -> 23.43Hurt
Use SEA instead of vanilla attentionOPT-125M · WikiText2, context length 4096Memory (MB): 1584 -> 448 (28.28%)Helped
Use SEA instead of vanilla attentionOPT-125M · WikiText2, context length 4096Latency (ms): 17.86 -> 14.31 (80.12%)Helped
Use SEA instead of PerformerOPT-125M · WikiText2, context length 4096, PPL. (after interp.)perplexity: 68.29 -> 43.96Helped
Use SEA instead of PerformerOPT-125M · WikiText2, context length 4096Memory (MB): 102.75 -> 448Hurt
Use SEA instead of PerformerOPT-125M · WikiText2, context length 4096Latency (ms): 2.38 -> 14.31Hurt
Increase k from 96 to 128 after training with query skips fixed at 1 (ablation)SEA on OPT-125M · WikiText2, context length 4096PPL: 22.38 -> 21.38Helped
Increase k from 96 to 128 after training with query skips fixed at 1 (ablation)SEA on OPT-125M · WikiText2, context length 4096Latency (ms): 18.12 -> 20.47Hurt
Use FlatCSR instead of COOSparse attention operation · Random inputsLatency (ms): 75.66 -> 11.4Helped
Use FlatCSR instead of COOSparse attention operation · Random inputsMemory (MB): 1194 -> 817.5Helped

Surprising findings

Limitations

Experimental setup

Datasets: Wikitext2 GLUE MNLI GLUE CoLA GLUE MRPC OpenWebText

Benchmarks: Wikitext2 GLUE MNLI CoLA MRPC OpenWebText

Metrics: perplexity accuracy latency (ms) peak memory (MB) FLOPs

Baselines: Performer Reformer Sinkhorn Cosformer Synthesizer FlashAttention Vanilla quadratic attention

Builds on: Performer knowledge distillation Reformer FlashAttention

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