atlas

Research map / Architectures and efficiency / Attention and transformers

Transformer-VQ: Linear-Time Transformers via Vector Quantization

ICLR 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.

Transformer-VQ is a decoder-only transformer that computes softmax dense self-attention in linear time by vector-quantizing keys and using a compressive block cache, reaching competitive results on Enwik8, PG-19, and ImageNet64.

Problem

Standard transformer self-attention is quadratic in sequence length, limiting scaling to very long sequences in autoregressive modeling.

Approach

Vector-quantize the keys with a straight-through estimator so that softmax attention over quantized keys can be factored through a shortcode-indexed compressive cache, giving exact dense attention over quantized keys computed in linear time with block-level recurrences.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Increase the codebook size from S = 256 to S = 1024 (ablation)Transformer-VQ · Enwik8 validationBPB: 1.010 -> 1.000Helped
Increase the codebook size from S = 256 to S = 1024 (ablation)Transformer-VQ · Enwik8 validationLatency (Rel.): 0.927 -> 1.109Hurt
Add the compressive cache (ablation)Transformer-VQ · Enwik8 validationBPB: 1.026 -> 1.010Helped
Add the compressive cache (ablation)Transformer-VQ · Enwik8 validationLatency (Rel.): 0.836 -> 0.927Hurt
Use Transformer-VQ instead of Full AttentionSHGA · Sequence length 8192tokens/sec: 23.9k -> 77.2kHelped
Use Transformer-VQ instead of Full AttentionSHGA · Sequence length 32768tokens/sec: 6.5k -> 82.1kHelped

Surprising findings

Limitations

Experimental setup

Datasets: Enwik8 PG-19 ImageNet64

Benchmarks: Enwik8 PG-19 ImageNet64

Metrics: bits-per-byte word-level perplexity training throughput (tokens/sec) latency

Baselines: Transformer-XL Sparse Transformer Compressive Transformer Block-Recurrent Transformer Perceiver AR MegaByte Efficient VDVAE Full attention (quadratic)

Builds on: Transformer-XL FLASH Vector-quantized representation learning (VQ-VAE) Gated attention unit

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