atlas

Research map / Architectures and efficiency / Attention and transformers

Block Transformer: Global-to-Local Language Modeling for Fast Inference

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: KV cache eviction and compression · 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 Block Transformer, a global-to-local subword-level architecture (block decoder for coarse global attention, token decoder for local attention within blocks) that cuts KV cache overheads and yields 10-20x inference throughput at equal perplexity.

Problem

Autoregressive transformer inference is bottlenecked by prefill latency and by KV cache memory I/O that grows with sequence length, causing quadratic memory reads during batch decoding.

Approach

Aggregate subword tokens into fixed-size blocks so global self-attention runs over block embeddings at lower layers, then decode tokens within each block with local attention only, conditioned on a single context embedding from the block decoder; the token decoder thus needs no global KV cache or prefill, and a 1:1 parameter split between decoders is found to be best.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
replace vanilla attention with global-to-local block attentionPythia · Prefill throughput1K tokens per second: 2.3 -> 21.0Helped
replace vanilla attention with global-to-local block attentionPythia · Decode throughput1K tokens per second: 6.2 -> 44.1Helped
replace vanilla attention with global-to-local block attentionPythia · WikiTextperplexity: 20.1 -> 19.1Helped
replace vanilla attention with global-to-local block attentionPythia · HellaSwagaccuracy: 35.05 -> 31.13Hurt
replace vanilla attention with global-to-local block attentionPythia · PIQAaccuracy: 68.10 -> 64.35Hurt
use a lookup-table embedder instead of a RoBERTa-based encoder embedder (ablation)Block Transformer · language modelingtraining lossHelped
use a lookup-table embedder instead of a CLS-token embedder (ablation)Block Transformer · language modelingtraining lossHelped
use prefix decoding instead of cross-attention for context embeddings (ablation)Block Transformer · language modelingperplexityHelped
use prefix decoding instead of summation for context embeddings (ablation)Block Transformer · language modelingperplexityHelped
increase prefix length beyond four tokens (ablation)Block Transformer · language modelingperplexityHelped
allocate parameters equally between block and token decoders (ablation)Block Transformer with block length 4 · language modelingtraining lossHelped
increase block length (ablation)Block Transformer · inferencethroughputHelped

Surprising findings

Limitations

Experimental setup

Datasets: The Pile PG19 LAMBADA WikiText HellaSwag PIQA ARC-easy

Benchmarks: LAMBADA WikiText HellaSwag PIQA ARC-easy PG19 Needle-In-a-Haystack

Metrics: perplexity accuracy throughput (1K tokens/s) memory per sample (MB) training loss

Baselines: Vanilla Transformer (Pythia-style) MEGABYTE

Builds on: Pythia MEGABYTE GPT-NeoX 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