atlas

Research map / Architectures and efficiency / Attention and transformers

StableMask: Refining Causal Masking in Decoder-only Transformer

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Efficient language transformers · 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 StableMask, a parameter-free modification of the causal mask that adds decaying pseudo-attention scores to address disproportional attention and restore absolute position encoding in decoder-only Transformers with RPE.

Problem

Decoder-only Transformers with causal masking and relative position encoding force attention to sum to one over all visible tokens, causing disproportional attention to initial/punctuation tokens, and they cannot encode absolute positional information well.

Approach

Append pseudo-attention scores with linearly decaying positional values (-(j-1)gamma) to the upper triangle before softmax, then zero out the upper triangle after softmax; this lets rows sum to less than one, letting heads dump excess attention and encoding absolute position, with no new parameters.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add StableMaskBLOOM 71M with ALiBi · WikiText-103PPL: 29.9 -> 29.0Helped
Add StableMaskOpenLLaMA 71M with RoPE · WikiText-103PPL: 27.4 -> 26.9Helped
Add StableMaskBLOOM 160M with ALiBi · WikiText-103PPL: 27.6 -> 26.1Helped
Add StableMaskOpenLLaMA 160M with RoPE · WikiText-103PPL: 22.5 -> 21.1Helped
Add StableMaskBLOOM 160M with ALiBi · MiniPile, 1 epochPPL: 25.8 -> 25.6Helped
Add StableMaskOpenLLaMA 160M with RoPE · MiniPile, 1 epochPPL: 25.9 -> 25.0Helped
Add StableMaskBLOOM 160M with ALiBi · MiniPile, 2 epochsPPL: 23.3 -> 22.9Helped
Add StableMaskOpenLLaMA 160M with RoPE · MiniPile, 2 epochsPPL: 21.2 -> 20.9Helped
Add StableMaskBLOOM 430M with ALiBi · MiniPilePPL: 20.6 -> 19.6 (1 epoch); 15.6 -> 15.5 (2 epochs)Helped
Add StableMaskOpenLLaMA 430M with RoPE · MiniPilePPL: 19.6 -> 19.5 (1 epoch); 15.7 -> 15.1 (2 epochs)Helped
Add StableMaskOpenLLaMA 1.4B with RoPE · Pile, 5B–25B tokensPPL: 15.4 -> 15.0; 14.8 -> 14.6; 12.4 -> 11.9; 11.7 -> 11.3; 10.7 -> 10.4Helped
Add zero-valued pseudo-attention scores (ablation)StableMask on OpenLLaMA 160M · MiniPilePPL: 22.5 -> 21.5Helped

Surprising findings

Limitations

Experimental setup

Datasets: WikiText-103 MiniPile The Pile LAMBADA PIQA ARC-Easy ARC-Challenge OpenbookQA Winogrande

Benchmarks: WikiText-103 MiniPile The Pile LAMBADA PIQA ARC-Easy ARC-Challenge OpenbookQA Winogrande

Metrics: perplexity accuracy

Baselines: OpenLLaMA BLOOM Learnable AT Fixed Value AT URPE StreamingLLM

Builds on: RoPE ALiBi FlashAttention URPE StreamingLLM

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