The NeurIPS 2025 best paper on gated attention adds a head-specific sigmoid gate after scaled dot-product attention. Where exactly does the gate sit, why could such a small change stabilise training and remove attention sinks, and how would you test it on your own model?
Answer
Model answer, written in a candidate's voice
In short
- Gate sits after each head’s scaled dot-product attention output, elementwise sigmoid(x·W_g), before the output projection.
- It inserts a nonlinear, query-dependent gate between the value path and the output projection, making each head’s contribution sparse and switchable.
- Softmax must sum to 1, so useless heads park mass on the first token; a gate lets a head output near zero instead.
- Alternative: gpt-oss’s learned bias in the softmax denominator, which also lets a head attend to nothing.
- Test with matched-parameter ablations: loss and spike frequency at raised LR, first-token attention share, context-extension evals.
In full
The gate sits immediately after each head’s scaled dot-product attention output and before the output projection: each head’s SDPA result is multiplied elementwise by sigmoid(x·W_g), where x is the current token, so the gate is computed per token and per head rather than as a global scalar. That placement matters because it inserts a nonlinearity between the low-rank value path and the output projection, making the head’s contribution query-dependent and sparse: a head can be driven close to zero for tokens where it has nothing useful to do, instead of always emitting a weighted average of its value vectors. This also explains the sink effect: softmax weights must sum to 1, so a head with nothing useful to attend to tends to park attention on the first token, but a gate lets that head output near zero rather than relying on the sink. A related idea is gpt-oss’s learned bias in the softmax denominator, which also lets a head attend to nothing, though it changes the attention distribution rather than the head output directly. To test it on my own model I would run matched-parameter ablations at small scale, comparing the gated and ungated variants at equal parameter count, and track loss and spike frequency at raised learning rates, first-token attention share, and context-extension evals.
What a strong answer covers
- The gate multiplies each head’s SDPA output elementwise by sigmoid(x·W_g), computed from the current token, before the output projection.
- It adds non-linearity between the low-rank value and output projections and makes the head’s contribution query-dependent and sparse.
- Sinks arise because softmax weights must sum to 1, so a head with nothing useful to do parks attention on the first token; a gate lets it output close to zero instead.
- Links the idea to alternatives such as gpt-oss’s learned bias in the softmax denominator, which also lets a head attend to nothing.
- Test with matched-parameter ablations at small scale: loss and spike frequency at raised learning rates, first-token attention share, and context-extension evals.
Common mistakes
- Placing the gate on the input embeddings or the MLP and calling it gated attention.
Follow-ups
- Why might removing attention sinks matter for KV-cache eviction or quantisation?