atlas

Research map / Architectures and efficiency / Attention and transformers

Selective Attention: Enhancing Transformer through Principled Context Control

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head and block redesign · 6 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 Selective Self-Attention (SSA), which applies learnable token- and position-dependent temperature scaling to query and value embeddings, improving language modeling with <0.5% extra parameters via weight sharing.

Problem

Standard softmax self-attention treats all queries identically, which limits its ability to control contextual sparsity (spikiness) of attention per query and per position, causing attention dilution in long contexts.

Approach

Augment softmax attention with data-dependent inverse-temperature scaling on queries (token-aware via tanh of a small MLP reusing attention weights, plus a position-aware log(n) term) and on values, decoupling semantic similarity from contextual sparsity; theory shows norm and expressivity benefits.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add SSA query and value temperature scalingPythia-160m · Wikitext (fine-tune)perplexity: 26.681 -> 26.514Helped
add SSA query and value temperature scalingLlama3-8b · Wikitext (fine-tune)perplexity: 12.416 -> 10.982Helped
add SSA attentionPythia-160m · Passkey retrievalretrieval accuracy: 56.89 -> 74.41Helped
add SSA attentionLlama · Passkey retrievalretrieval accuracy: 77.62 -> 89.53Helped
apply value selectivity to suppress noisy tokensone-layer attention denoising model · Synthetic denoising taskMSE risk: 1.390 -> 0.071Helped
use query-selective attentionone-layer attention model · Synthetic next-token predictioncross-entropy loss: 0.0126 -> 0.009Helped
apply temperature scaling to queries only (ablation)Pythia · Wikitext (fine-tune)perplexity: 28.781 -> 27.416Helped
apply temperature scaling to keys only (ablation)Pythia · Wikitext (fine-tune)perplexity: 28.781 -> 28.715No clear effect
apply temperature scaling to values only (ablation)Pythia · Wikitext (fine-tune)perplexity: 28.781 -> 27.980Helped
apply temperature scaling to queries and values (ablation)Pythia · Wikitext (fine-tune)perplexity: 28.781 -> 26.514Helped
also apply temperature scaling to keys (ablation)Pythia with query and value temperatures · Wikitext (fine-tune)perplexity: 26.514 -> 26.603Hurt
use position-aware query temperature only instead of both position- and token-aware query scaling (ablation)Pythia · Wikitext (fine-tune)perplexity: 27.416 -> 27.995Hurt

Surprising findings

Limitations

Experimental setup

Datasets: SlimPajama Wikitext WebText The Pile

Benchmarks: Wikitext Lambada Piqa HellaSwag Winogrande ARC-E ARC-C passkey retrieval

Metrics: perplexity accuracy acc_norm passkey retrieval accuracy

Baselines: Yarn constant temperature scaling frequency-based temperature vanilla attention

Builds on: Yarn FlashAttention Mamba

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