atlas

Research map / Architectures and efficiency / Attention and transformers

PolySketchFormer: Fast Transformers via Sketching Polynomial Kernels

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Linear attention approximations · 2 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 PolySketchFormer, a linear-time Transformer that uses high-degree polynomial attention approximated by non-negative polynomial sketches (self-tensoring), a block-based causal lower-triangular multiplication, and optional learned sketches plus exact local attention, trained for language modeling.

Problem

Quadratic time and memory cost of softmax self-attention limits training of Transformer language models on long contexts, and existing linear attention approximations (e.g., Performer) lose quality or lack guarantees.

Approach

Replace softmax with normalized degree-p polynomial attention (p>=4 matches softmax quality), approximate it with a polynomial sketch followed by self-tensoring so attention weights are provably non-negative, make sketches learnable, and compute causal masking with a block-based prefix-sum scheme; local blocks use exact polynomial attention.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use learned sketches with local exact polynomial attention instead of softmax attentionGPT-2 Small style language model · PG19 test, 32k contextperplexity: 11.55 -> 11.34Helped
use learned sketches with local exact polynomial attention instead of softmax attentionGPT-2 Small style language model · Wiki-40B test, 32k contextperplexity: 14.35 -> 14.29Helped
use Polysketch (learned + local, r=32) instead of FlashAttentionGPT-2 Small style language model · Training, 32k contextspeedup: 2xHelped
add local exact polynomial attention (ablation)Polysketch (learned, r=64) · PG19 test, 32k contextperplexity: 12.19 -> 11.34Helped
replace random sketches with learned sketches, retaining local exact polynomial attention (ablation)Polysketch, r=64 · PG19 test, 32k contextperplexity: 11.91 -> 11.34Helped
increase sketch size from r=32 to r=64 (ablation)Polysketch (learned + local) · PG19 test, 32k contextperplexity: 11.47 -> 11.34Helped
remove local exact polynomial attention and use random sketches (ablation)Polysketch (learned + local, r=64) · PG19 test, 32k contextperplexity: 11.34 -> 13.66Hurt
use a different learning rate schedule (ablation)Polysketch (learned + local) · Selective Copying, 16k contextaccuracy: 92.75% -> 99.44%Helped
replace softmax attention with degree-4 polynomial attentionGPT-2 Small style language model · PG19 test, 8k contextperplexity: 11.65 -> 11.85No clear effect
increase polynomial attention degree from 4 to 8 (ablation)GPT-2 Small style language model · PG19 test, 8k contextperplexity: 11.85 -> 11.64Helped
increase context length to 32kSoftmax and non-kernel polynomial attention · PG19 test, 32k contextperplexityMixed
use a 13-layer Polysketch model rather than 12 layers (ablation)Polysketch (learned + local, r=64) · C4 validation, 8192 context, 125k stepsperplexity: 17.68 -> 17.98Hurt

Surprising findings

Limitations

Experimental setup

Datasets: PG-19 Wiki-40B C4 HellaSwag PIQA Physics Selective Copying Induction heads

Benchmarks: PG-19 Wiki-40B C4 HellaSwag PIQA Physics

Metrics: perplexity 0-shot accuracy 5-shot accuracy training steps/sec selective copying accuracy

Baselines: Softmax attention (FlashAttention) Performer Polynomial attention FlashAttention block 256 FlashAttention block 512

Builds on: Performer FlashAttention Transformer++ polynomial sketching (Ahle et al.)

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