---
title: The NeurIPS 2025 best paper on gated attention adds a head-specific sigmoid gate after scaled dot-product attention…
url: https://gurkanozkan.ai/learn/questions/recent-b-transformers-02/
markdown: https://gurkanozkan.ai/learn/questions/recent-b-transformers-02.md
kind: question
role: Research
stage: Research talk
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/recent-b-transformers-02.json
robots: noindex
---

# 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?

Research · Research talk · Medium

## 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.

*Corrected by an independent AI reviewer.*

## 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?

## Topic guides

- [Interpretability and explainability](https://gurkanozkan.ai/learn/topics/interpretability.md)
- [Training neural networks: losses, optimisers, numerics and scale](https://gurkanozkan.ai/learn/topics/training.md)
- [Transformers, attention and scaling](https://gurkanozkan.ai/learn/topics/transformers.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
