Gates improve softmax attention by letting models filter noise and abstain

Abstention and Noise Filtering: Two Missing Primitives of Softmax Attention

Machine LearningComputation and Language

Summary

Attention mechanisms in language models help the model focus on important parts of the input, but traditional softmax attention forces the model to always spread its focus across some parts. The authors find that adding two abilities—one to allow the model to 'abstain' or output nothing, and another to filter out irrelevant noise in the information—improves performance. Small models benefit more from abstention, while bigger models improve more with noise filtering. Using both together works best across model sizes and does not add many extra parameters.

What this means in practice

Authors

Richard Zhe Wang

Abstract

Gating the value pathway of attention reportedly improves language model pretraining, and prior studies disagree on why. We argue and provide experimental evidence that such gates supply two different things that softmax attention lacks: abstention and noise filtering. The first is abstention, which allows an attention head to output nothing, bypassing the requirement that attention weights must sum to one. The second is noise filtering, which allows the value pathway of an attention head to suppress interference from superposed features in the residual stream. In our experiments in matched models from 10M to 350M parameters, we supply abstention through a learned per-head sink logit in the softmax and noise filtering through a gate on each value. We report three empirical findings. First, the benefit of abstention, measured as the reduction in validation loss relative to a matched baseline, declines as models grow, whereas the benefit of noise filtering increases with scale. In particular, abstention accounts for nearly all of the gain from gating at 10M and filtering for most of it at 350M. Second, the best model at every scale is the one with both primitives built in. Third, injecting controlled interference into the values a head reads confirms that the gate removes such interference, and reveals that each of the two gate forms we study has a characteristic blind spot. Supplying both primitives adds negligible parameters and remains compatible with the key-value cache.